mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
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>
This commit is contained in:
parent
c27b8b7aab
commit
fb86207bdc
|
|
@ -389,19 +389,6 @@ static bool feat_vmid16(struct kvm *kvm)
|
|||
return kvm_has_feat_enum(kvm, ID_AA64MMFR1_EL1, VMIDBits, 16);
|
||||
}
|
||||
|
||||
static bool compute_hcr_rw(struct kvm *kvm, u64 *bits)
|
||||
{
|
||||
/* This is purely academic: AArch32 and NV are mutually exclusive */
|
||||
if (bits) {
|
||||
if (kvm_has_feat(kvm, FEAT_AA32EL1))
|
||||
*bits &= ~HCR_EL2_RW;
|
||||
else
|
||||
*bits |= HCR_EL2_RW;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool compute_hcr_e2h(struct kvm *kvm, u64 *bits)
|
||||
{
|
||||
if (bits) {
|
||||
|
|
@ -967,7 +954,7 @@ static const DECLARE_FEAT_MAP(hcrx_desc, __HCRX_EL2,
|
|||
|
||||
static const struct reg_bits_to_feat_map hcr_feat_map[] = {
|
||||
NEEDS_FEAT(HCR_EL2_TID0, FEAT_AA32EL0),
|
||||
NEEDS_FEAT_FIXED(HCR_EL2_RW, compute_hcr_rw),
|
||||
NEEDS_FEAT_FLAG(HCR_EL2_RW, AS_RES1, FEAT_AA32EL1),
|
||||
NEEDS_FEAT(HCR_EL2_HCD, not_feat_aa64el3),
|
||||
NEEDS_FEAT(HCR_EL2_AMO |
|
||||
HCR_EL2_BSU |
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user