This series enables VIRT_XFER_TO_GUEST_WORK on s390.
This requires:
1) adding a signal_exits stats counter, which is used by
kvm_handle_signal_exit()
2) moving the point where interrupts are enabled and disabled in the
guest entry path, so that interrupts aren't enabled until after the
__TI_sie flag is set
3) enabling VIRT_XFER_TO_GUEST_WORK and adding the appropriate calls to
check for and handle outstanding work in __vcpu_run() and the VSIE
path.
With this series applied, the kvm-unit-tests suite passes on both the host
and an L1 guest with nested KVM enabled, and benchmarks done using the
exittime tests from kvm-unit-tests show that the impact on entry path
performance is generally small enough to be noise (in my tests, around
+/-3%, running directly in an LPAR and in a L1 KVM guest).
Thanks to Heiko for feedback and guidance on this.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
Changes in v2:
- if work is handled, recheck for outstanding work with interrupts
disabled before entering guest (Heiko)
- Link to v1: https://lore.kernel.org/r/20251125-s390-kvm-xfer-to-guest-work-v1-0-091281a34611@linux.ibm.com
---
Andrew Donnellan (2):
KVM: s390: Add signal_exits counter
KVM: s390: Use generic VIRT_XFER_TO_GUEST_WORK functions
Heiko Carstens (1):
KVM: s390: Enable and disable interrupts in entry code
arch/s390/include/asm/kvm_host.h | 1 +
arch/s390/include/asm/stacktrace.h | 1 +
arch/s390/kernel/asm-offsets.c | 1 +
arch/s390/kernel/entry.S | 2 ++
arch/s390/kvm/Kconfig | 1 +
arch/s390/kvm/kvm-s390.c | 34 +++++++++++++++++++++-------------
arch/s390/kvm/vsie.c | 18 +++++++++++++-----
7 files changed, 40 insertions(+), 18 deletions(-)
---
base-commit: ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d
change-id: 20251105-s390-kvm-xfer-to-guest-work-3eaba6c0ea04
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited