linux/arch/arm64
Marc Zyngier 278583055a KVM: arm64: Use shadow SPSR_EL1 when injecting exceptions on !VHE
Injecting an exception into a guest with non-VHE is risky business.
Instead of writing in the shadow register for the switch code to
restore it, we override the CPU register instead. Which gets
overriden a few instructions later by said restore code.

The result is that although the guest correctly gets the exception,
it will return to the original context in some random state,
depending on what was there the first place... Boo.

Fix the issue by writing to the shadow register. The original code
is absolutely fine on VHE, as the state is already loaded, and writing
to the shadow register in that case would actually be a bug.

Fixes: bb666c472c ("KVM: arm64: Inject AArch64 exceptions from HYP")
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20220121184207.423426-1-maz@kernel.org
2022-01-24 09:39:03 +00:00
..
boot arm64: dts: exynos: drop samsung,ufs-shareability-reg-offset in ExynosAutov9 2021-11-25 14:46:00 +01:00
configs ARM: defconfig updates for 5.16 2021-11-03 17:07:02 -07:00
crypto crypto: arm64/aes-ccm - avoid by-ref argument for ce_aes_ccm_auth_data 2021-09-17 11:05:11 +08:00
hyperv arm64: hyperv: Initialize hypervisor on boot 2021-08-04 16:54:36 +00:00
include Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next 2022-01-04 17:16:15 +00:00
kernel Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next 2022-01-04 17:16:15 +00:00
kvm KVM: arm64: Use shadow SPSR_EL1 when injecting exceptions on !VHE 2022-01-24 09:39:03 +00:00
lib Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
mm kasan: add kasan mode messages when kasan init 2021-11-11 09:34:35 -08:00
net arm64 updates for 5.16 2021-11-01 16:33:53 -07:00
tools Merge branch 'for-next/trbe-errata' into for-next/core 2021-10-29 12:25:33 +01:00
xen xen: allow pv-only hypercalls only with CONFIG_XEN_PV 2021-11-02 08:11:01 -05:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
Kconfig.debug
Kconfig.platforms ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
Makefile kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00