Skip to content

Commit b10d86f

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Reject 32bit user PSTATE on asymmetric systems
KVM does not support AArch32 EL0 on asymmetric systems. To that end, prevent userspace from configuring a vCPU in such a state through setting PSTATE. It is already ABI that KVM rejects such a write on a system where AArch32 EL0 is unsupported. Though the kernel's definition of a 32bit system changed in commit 2122a83 ("arm64: Allow mismatched 32-bit EL0 support"), KVM's did not. Fixes: 2122a83 ("arm64: Allow mismatched 32-bit EL0 support") Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f3c6efc commit b10d86f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kvm/guest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
242242
u64 mode = (*(u64 *)valp) & PSR_AA32_MODE_MASK;
243243
switch (mode) {
244244
case PSR_AA32_MODE_USR:
245-
if (!system_supports_32bit_el0())
245+
if (!kvm_supports_32bit_el0())
246246
return -EINVAL;
247247
break;
248248
case PSR_AA32_MODE_FIQ:

0 commit comments

Comments
 (0)