Skip to content

Commit 3172613

Browse files
kristina-martsenkoctmarinas
authored andcommitted
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 <[email protected]> Acked-by: Catalin Marinas <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b1319c0 commit 3172613

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, struct sys_reg_desc const *r
12521252
ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3));
12531253
if (!cpus_have_final_cap(ARM64_HAS_WFXT))
12541254
val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_WFxT);
1255+
val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_MOPS);
12551256
break;
12561257
case SYS_ID_AA64DFR0_EL1:
12571258
/* Limit debug to ARMv8.0 */

0 commit comments

Comments
 (0)