[PATCH v2 stable-5.12.y backport 0/2] KVM: arm64: Commit exception state on exit to userspace

From: Zenghui Yu
Date: Tue Jun 01 2021 - 10:07:54 EST


As promised on the list [0], this series aims to backport 3 upstream
commits [1,2,3] into 5.12-stable tree.

Patch #1 is already in the queue and therefore not included. Patch #2 can
be applied now by manually adding the __KVM_HOST_SMCCC_FUNC___kvm_adjust_pc
macro (please review). Patch #3 can be applied cleanly then (after #2).

I've slightly tested it on my 920 (boot test and the whole kvm-unit-tests),
on top of the latest linux-stable-rc/linux-5.12.y. Please consider taking
them for 5.12-stable.

* From v1:
- Allocate a new number for __KVM_HOST_SMCCC_FUNC___kvm_adjust_pc
- Collect Marc's R-b tags

[0] https://lore.kernel.org/r/0d9f123c-e9f7-7481-143d-efd488873082@xxxxxxxxxx
[1] https://git.kernel.org/torvalds/c/f5e30680616a
[2] https://git.kernel.org/torvalds/c/26778aaa134a
[3] https://git.kernel.org/torvalds/c/e3e880bb1518

Marc Zyngier (1):
KVM: arm64: Commit pending PC adjustemnts before returning to
userspace

Zenghui Yu (1):
KVM: arm64: Resolve all pending PC updates before immediate exit

arch/arm64/include/asm/kvm_asm.h | 1 +
arch/arm64/kvm/arm.c | 20 +++++++++++++++++---
arch/arm64/kvm/hyp/exception.c | 4 ++--
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 8 ++++++++
4 files changed, 28 insertions(+), 5 deletions(-)

--
2.19.1