diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2022-08-16 19:25:54 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 11:40:29 +0200 |
| commit | 57b5be2bd1e04cf43f84af4157c778a880b57008 (patch) | |
| tree | 91f7e2d05f03043006f20d57e120cd54c375891e /arch | |
| parent | cb332a666e3fe5ebdd3c55f0e21c69a3f9174ed5 (diff) | |
| download | linux-57b5be2bd1e04cf43f84af4157c778a880b57008.tar.gz linux-57b5be2bd1e04cf43f84af4157c778a880b57008.tar.bz2 linux-57b5be2bd1e04cf43f84af4157c778a880b57008.zip | |
KVM: arm64: Reject 32bit user PSTATE on asymmetric systems
[ Upstream commit b10d86fb8e46cc812171728bcd326df2f34e9ed5 ]
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 2122a833316f ("arm64: Allow mismatched
32-bit EL0 support"), KVM's did not.
Fixes: 2122a833316f ("arm64: Allow mismatched 32-bit EL0 support")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220816192554.1455559-3-oliver.upton@linux.dev
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm64/kvm/guest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 5ce26bedf23c..94108e2e0917 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -242,7 +242,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) u64 mode = (*(u64 *)valp) & PSR_AA32_MODE_MASK; switch (mode) { case PSR_AA32_MODE_USR: - if (!system_supports_32bit_el0()) + if (!kvm_supports_32bit_el0()) return -EINVAL; break; case PSR_AA32_MODE_FIQ: |
