1
0
Fork 0
alistair23-linux/arch/arm64
Mark Rutland b0e01e9d23 KVM: arm/arm64: Correct CPSR on exception entry
commit 3c2483f154 upstream.

When KVM injects an exception into a guest, it generates the CPSR value
from scratch, configuring CPSR.{M,A,I,T,E}, and setting all other
bits to zero.

This isn't correct, as the architecture specifies that some CPSR bits
are (conditionally) cleared or set upon an exception, and others are
unchanged from the original context.

This patch adds logic to match the architectural behaviour. To make this
simple to follow/audit/extend, documentation references are provided,
and bits are configured in order of their layout in SPSR_EL2. This
layout can be seen in the diagram on ARM DDI 0487E.a page C5-426.

Note that this code is used by both arm and arm64, and is intended to
fuction with the SPSR_EL2 and SPSR_HYP layouts.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200108134324.46500-3-mark.rutland@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 04:35:16 -08:00
..
boot arm64: dts: meson-sm1-sei610: add gpio bluetooth interrupt 2020-02-05 21:22:42 +00:00
configs arm64/ARM: configs: Change CONFIG_REMOTEPROC from m to y 2019-09-30 11:48:00 -07:00
crypto crypto: arm64/aes-neonbs - add return value of skcipher_walk_done() in __xts_crypt() 2020-01-17 19:48:46 +01:00
include KVM: arm/arm64: Correct CPSR on exception entry 2020-02-11 04:35:16 -08:00
kernel arm64: acpi: fix DAIF manipulation with pNMI 2020-02-11 04:35:15 -08:00
kvm KVM: arm64: Correct PSTATE on exception entry 2020-02-11 04:35:16 -08:00
lib arm64: uaccess: Remove uaccess_*_not_uao asm macros 2019-11-20 18:51:54 +00:00
mm arm64: Revert support for execute-only user mappings 2020-01-09 10:20:01 +01:00
net arm64: bpf: optimize modulo operation 2019-09-03 15:44:40 +02:00
xen xen/efi: have a common runtime setup function 2019-10-02 10:31:07 -04:00
Kbuild arm64: add arch/arm64/Kbuild 2019-08-21 18:47:15 +01:00
Kconfig arm64: Implement copy_thread_tls 2020-01-14 20:08:34 +01:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.platforms arm64: exynos: Enable exynos-chipid driver 2019-09-04 22:43:26 +02:00
Makefile arm64: Kconfig: Make CONFIG_COMPAT_VDSO a proper Kconfig option 2019-10-07 13:32:15 +01:00