Skip to content

Commit 7fb7660

Browse files
committed
KVM: arm64: Enable SCTLR2 when advertised to the guest
HCRX_EL2.SCTLR2En needs to be set for SCTLR2_EL1 to take effect in hardware (in addition to disabling traps). Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 02dd33e commit 7fb7660

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,9 @@ static inline void vcpu_set_hcrx(struct kvm_vcpu *vcpu)
665665

666666
if (kvm_has_fpmr(kvm))
667667
vcpu->arch.hcrx_el2 |= HCRX_EL2_EnFPM;
668+
669+
if (kvm_has_sctlr2(kvm))
670+
vcpu->arch.hcrx_el2 |= HCRX_EL2_SCTLR2En;
668671
}
669672
}
670673
#endif /* __ARM64_KVM_EMULATE_H__ */

0 commit comments

Comments
 (0)