linux/arch/arm64
Zenghui Yu e3e880bb15 KVM: arm64: Resolve all pending PC updates before immediate exit
Commit 26778aaa13 ("KVM: arm64: Commit pending PC adjustemnts before
returning to userspace") fixed the PC updating issue by forcing an explicit
synchronisation of the exception state on vcpu exit to userspace.

However, we forgot to take into account the case where immediate_exit is
set by userspace and KVM_RUN will exit immediately. Fix it by resolving all
pending PC updates before returning to userspace.

Since __kvm_adjust_pc() relies on a loaded vcpu context, I moved the
immediate_exit checking right after vcpu_load(). We will get some overhead
if immediate_exit is true (which should hopefully be rare).

Fixes: 26778aaa13 ("KVM: arm64: Commit pending PC adjustemnts before returning to userspace")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210526141831.1662-1-yuzenghui@huawei.com
Cc: stable@vger.kernel.org # 5.11
2021-05-27 10:33:06 +01:00
..
boot pwm: Changes for v5.13-rc1 2021-05-05 12:53:16 -07:00
configs ARM: platform support for Apple M1 2021-04-26 12:30:36 -07:00
crypto arm64 updates for 5.13: 2021-04-26 10:25:03 -07:00
include KVM: arm64: Commit pending PC adjustemnts before returning to userspace 2021-05-15 10:27:59 +01:00
kernel Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
kvm KVM: arm64: Resolve all pending PC updates before immediate exit 2021-05-27 10:33:06 +01:00
lib arm64: lib: Annotate {clear, copy}_page() as position-independent 2021-03-19 12:01:19 +00:00
mm Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
xen
Kbuild
Kconfig Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms This is the bulk of the pin control changes for the v5.13 kernel cycle 2021-04-30 13:04:30 -07:00
Makefile arm64: move --fix-cortex-a53-843419 linker test to Kconfig 2021-04-25 05:15:33 +09:00