linux-stable/arch
Mark Rutland 8fe86bd474 KVM: arm64: Correct PSTATE on exception entry
commit a425372e73 upstream.

When KVM injects an exception into a guest, it generates the PSTATE
value from scratch, configuring PSTATE.{M[4:0],DAIF}, and setting all
other bits to zero.

This isn't correct, as the architecture specifies that some PSTATE 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-429.

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-2-mark.rutland@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 04:33:57 -08:00
..
alpha
arc arc: eznps: fix allmodconfig kconfig warning 2020-02-01 09:37:06 +00:00
arm ARM: dts: am43x-epos-evm: set data pin directions for spi0 and spi1 2020-02-05 14:43:52 +00:00
arm64 KVM: arm64: Correct PSTATE on exception entry 2020-02-11 04:33:57 -08:00
c6x
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon hexagon: work around compiler crash 2020-01-17 19:47:17 +01:00
ia64 mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
m68k m68k: Call timer_interrupt() with interrupts disabled 2020-01-27 14:51:23 +01:00
microblaze microblaze: fix multiple bugs in arch/microblaze/boot/Makefile 2019-12-05 09:20:13 +01:00
mips mips: avoid explicit UB in assignment of mips_io_port_base 2020-01-27 14:51:07 +01:00
nds32 nds32: Fix the items of hwcap_str ordering issue. 2019-12-13 08:51:35 +01:00
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc openrisc: Fix broken paths to arch/or32 2019-12-05 09:20:40 +01:00
parisc parisc: Use proper printk format for resource_size_t 2020-02-05 14:43:45 +00:00
powerpc powerpc/fsl/dts: add fsl,erratum-a011043 2020-02-05 14:43:52 +00:00
riscv riscv: delete temporary files 2020-02-05 14:43:48 +00:00
s390 mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
sh mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
sparc sparc32: fix struct ipc64_perm type definition 2020-02-11 04:33:52 -08:00
um um: Fix off by one error in IRQ enumeration 2020-01-27 14:51:13 +01:00
unicore32
x86 x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR 2020-02-11 04:33:51 -08:00
xtensa xtensa: fix TLB sanity checker 2019-12-21 10:57:25 +01:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00