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: Convert HCR_EL2.RW to AS_RES1

Now that we have the AS_RES1 constraint, it becomes trivial to express
the HCR_EL2.RW behaviour.

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

+1 -14
+1 -14
arch/arm64/kvm/config.c
··· 389 389 return kvm_has_feat_enum(kvm, ID_AA64MMFR1_EL1, VMIDBits, 16); 390 390 } 391 391 392 - static bool compute_hcr_rw(struct kvm *kvm, u64 *bits) 393 - { 394 - /* This is purely academic: AArch32 and NV are mutually exclusive */ 395 - if (bits) { 396 - if (kvm_has_feat(kvm, FEAT_AA32EL1)) 397 - *bits &= ~HCR_EL2_RW; 398 - else 399 - *bits |= HCR_EL2_RW; 400 - } 401 - 402 - return true; 403 - } 404 - 405 392 static bool compute_hcr_e2h(struct kvm *kvm, u64 *bits) 406 393 { 407 394 if (bits) { ··· 954 967 955 968 static const struct reg_bits_to_feat_map hcr_feat_map[] = { 956 969 NEEDS_FEAT(HCR_EL2_TID0, FEAT_AA32EL0), 957 - NEEDS_FEAT_FIXED(HCR_EL2_RW, compute_hcr_rw), 970 + NEEDS_FEAT_FLAG(HCR_EL2_RW, AS_RES1, FEAT_AA32EL1), 958 971 NEEDS_FEAT(HCR_EL2_HCD, not_feat_aa64el3), 959 972 NEEDS_FEAT(HCR_EL2_AMO | 960 973 HCR_EL2_BSU |