diff options
author | Kristina Martsenko <kristina.martsenko@arm.com> | 2023-05-09 16:22:30 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2023-06-05 18:05:31 +0200 |
commit | 3172613fbcbb0634d91d05601f029da0c1466999 (patch) | |
tree | 555b01deebecf6c36a60a5db5df761fab9818d18 | |
parent | arm64: mops: don't disable host MOPS instructions from EL2 (diff) | |
download | linux-3172613fbcbb0634d91d05601f029da0c1466999.tar.xz linux-3172613fbcbb0634d91d05601f029da0c1466999.zip |
KVM: arm64: hide MOPS from guests
As FEAT_MOPS is not supported in guests yet, hide it from the ID
registers for guests.
The MOPS instructions are UNDEFINED in guests as HCRX_EL2.MSCEn is not
set in HCRX_GUEST_FLAGS, and will take an exception to EL1 if executed.
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20230509142235.3284028-7-kristina.martsenko@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/kvm/sys_regs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 71b12094d613..6dae7fe91cfa 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1252,6 +1252,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, struct sys_reg_desc const *r ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3)); if (!cpus_have_final_cap(ARM64_HAS_WFXT)) val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_WFxT); + val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_MOPS); break; case SYS_ID_AA64DFR0_EL1: /* Limit debug to ARMv8.0 */ |