Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Simplify handling of HCR_EL2.E2H RESx

Now that we can link the RESx behaviour with the value of HCR_EL2.E2H,
we can trivially express the tautological constraint that makes E2H
a reserved value at all times.

Fun, isn't it?

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260202184329.2724080-15-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

+1 -11
+1 -11
arch/arm64/kvm/config.c
··· 388 388 return kvm_has_feat_enum(kvm, ID_AA64MMFR1_EL1, VMIDBits, 16); 389 389 } 390 390 391 - static bool compute_hcr_e2h(struct kvm *kvm, struct resx *bits) 392 - { 393 - if (kvm_has_feat(kvm, FEAT_E2H0)) 394 - bits->res0 |= HCR_EL2_E2H; 395 - else 396 - bits->res1 |= HCR_EL2_E2H; 397 - 398 - return true; 399 - } 400 - 401 391 static const struct reg_bits_to_feat_map hfgrtr_feat_map[] = { 402 392 NEEDS_FEAT(HFGRTR_EL2_nAMAIR2_EL1 | 403 393 HFGRTR_EL2_nMAIR2_EL1, ··· 1007 1017 NEEDS_FEAT(HCR_EL2_TWEDEL | 1008 1018 HCR_EL2_TWEDEn, 1009 1019 FEAT_TWED), 1010 - NEEDS_FEAT_FIXED(HCR_EL2_E2H, compute_hcr_e2h), 1020 + NEEDS_FEAT_FLAG(HCR_EL2_E2H, RES1_WHEN_E2H1 | FORCE_RESx), 1011 1021 FORCE_RES0(HCR_EL2_RES0), 1012 1022 FORCE_RES1(HCR_EL2_RES1), 1013 1023 };