platform_kernel-5.15/arch/arm64
James Morse 0452c3dc85 KVM: arm64: Stop handle_exit() from handling HVC twice when an SError occurs
commit 1229630af88620f6e3a621a1ebd1ca14d9340df7 upstream.

Prior to commit defe21f49b ("KVM: arm64: Move PC rollback on SError to
HYP"), when an SError is synchronised due to another exception, KVM
handles the SError first. If the guest survives, the instruction that
triggered the original exception is re-exectued to handle the first
exception. HVC is treated as a special case as the instruction wouldn't
normally be re-exectued, as its not a trap.

Commit defe21f49b didn't preserve the behaviour of the 'return 1'
that skips the rest of handle_exit().

Since commit defe21f49b, KVM will try to handle the SError and the
original exception at the same time. When the exception was an HVC,
fixup_guest_exit() has already rolled back ELR_EL2, meaning if the
guest has virtual SError masked, it will execute and handle the HVC
twice.

Restore the original behaviour.

Fixes: defe21f49b ("KVM: arm64: Move PC rollback on SError to HYP")
Cc: stable@vger.kernel.org
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220127122052.1584324-4-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:34:06 +01:00
..
boot arm64: dts: qcom: msm8996: drop not documented adreno properties 2022-01-27 11:05:39 +01:00
configs drivers: bus: Delete CONFIG_SIMPLE_PM_BUS 2021-10-05 17:47:22 +02:00
crypto crypto: arm64/sm4-ce - Make dependent on sm4 library instead of sm4-generic 2021-07-30 10:58:30 +08:00
hyperv arm64: hyperv: Initialize hypervisor on boot 2021-08-04 16:54:36 +00:00
include arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
kernel arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
kvm KVM: arm64: Stop handle_exit() from handling HVC twice when an SError occurs 2022-02-08 18:34:06 +01:00
lib arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 2022-01-27 11:03:28 +01:00
mm arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
net arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
tools arm64: Allow mismatched 32-bit EL0 support 2021-06-11 13:25:40 +01:00
xen
Kbuild arm64: hyperv: Add Hyper-V hypercall and register access utilities 2021-08-04 16:54:36 +00:00
Kconfig arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd 2021-12-29 12:28:36 +01:00
Kconfig.debug
Kconfig.platforms Merge branch 'arm/fixes' into arm/soc 2021-07-09 10:46:02 -07:00
Makefile arm64 updates for 5.15: 2021-09-01 15:04:29 -07:00