]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Handle Asymmetric AArch32 systems
authorQais Yousef <qais.yousef@arm.com>
Tue, 27 Oct 2020 21:51:13 +0000 (21:51 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 30 Oct 2020 16:06:22 +0000 (16:06 +0000)
commitdcf4b923440f9a0687ad62c09b8a60db3be25bc2
tree1bda703a6c17ac70f6c37f57193f505ede6e874a
parentade4514081cb6881b3a91c79216e87f9a299550e
KVM: arm64: Handle Asymmetric AArch32 systems

On a system without uniform support for AArch32 at EL0, it is possible
for the guest to force run AArch32 at EL0 and potentially cause an
illegal exception if running on a core without AArch32. Add an extra
check so that if we catch the guest doing that, then we prevent it from
running again by resetting vcpu->arch.target and return
ARM_EXCEPTION_IL.

We try to catch this misbehaviour as early as possible and not rely on
an illegal exception occuring to signal the problem. Attempting to run a
32bit app in the guest will produce an error from QEMU if the guest
exits while running in AArch32 EL0.

Tested on Juno by instrumenting the host to fake asym aarch32 and
instrumenting KVM to make the asymmetry visible to the guest.

[will: Incorporated feedback from Marc]

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201021104611.2744565-2-qais.yousef@arm.com
Link: https://lore.kernel.org/r/20201027215118.27003-2-will@kernel.org
arch/arm64/kvm/arm.c