Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH 00/10] s390: Host interrupt handling for SAE guests
@ 2026-12-04 12:09 Andreas Grapentin
  2026-12-04 12:09 ` [PATCH 01/10] s390/sae: Prepare handling host interrupts during SAE execution Andreas Grapentin
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Andreas Grapentin @ 2026-12-04 12:09 UTC (permalink / raw)
  To: Steffen Eiden, Marc Zyngier, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Janosch Frank, Claudio Imbrenda, David Hildenbrand, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark
  Cc: kvm, linux-s390, linux-perf-users, linux-kernel,
	Andreas Grapentin

This series makes host interrupts that occur during SAE (Start Arm
Execution) guest execution not terminating its host. It is based on the
arm-on-s390 sysreg series 2 [1].

So far, SAE guests ran with host interrupts disabled, with a temporary
raw_local_irq_enable()/disable() workaround in the C run loop, and
machine checks during SAE execution were treated as host conditions.
This means, that a guest triggering mccks killed the host.

This series mirrors the SIE irq handling to SAE.

The host interrupt mask is managed in assembly around the SAE
instruction with stosm/stnsm, and the SAE stack frame carries the SAE
control block, the vCPU pointer and the interrupt state (patches 1-2).

The external and I/O interrupt entry code detects the SAE case with an
address range check, fixes the return address to sae_exit, extracts the
vCPU pointer from the stack frame and notifies KVM via a callback
(patches 3-5). This mirrors the existing SIE handling in the same code
paths.

The arm64 equivalent of a machine check is an SError ("System Error")
asynchronous exception. Its exception syndrome (ESR) classifies the
error severity in the AET field; KVM injects it into the guest as a
virtual SError with VSESR_EL2.

Machine checks are handled the same way in the NMI entry code and are
forwarded to the guest. The s390 machine check interruption code is
translated to an arm64 SError ESR in mci_to_esr() and injected as a
virtual SError, including HCR_EL2.VSE shadow register tracking so that a
pended SError the guest has not yet taken stays pended (patches 6-9).

mci_to_esr() will in this first iteration translate all machine checks
forwarded to the guest as UEU (Uncorrected Error Unrecoverable):

    An uncorrected error was consumed and the affected context cannot
    continue; the data is wrong and retrying does not help.

Lastly, Patch 10 lets perf recognize interrupted SAE guest execution via
the saved SAE control block.

Thanks,
-A

[1] https://lore.kernel.org/all/20261127-sysreg-v4-0-a6318d18aab5@linux.ibm.com

Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
---
Andreas Grapentin (1):
      s390/perf: Recognize SAE guests

Steffen Eiden (7):
      s390/sae: Prepare handling host interrupts during SAE execution
      s390/sae: Add sae_entry and sae_exit symbols
      KVM: s390: Share mcck_volatile_info between KVMs
      s390: Rename CIF_MCCK_GUEST to CIF_MCCK_SIE
      s390/nmi: Handle MCCKs for SAE guests
      KVM: s390: arm64: Enable SError injection
      KVM: s390: arm64: Enable mcck forwarding

Sven Schnelle (2):
      s390/irq: Add kvm_exit callback for arm-on-s390
      KVM: s390: arm64: Enable host irq

 arch/s390/include/asm/irq.h                 |   2 +
 arch/s390/include/asm/kvm_host.h            |   3 +
 arch/s390/include/asm/kvm_host_arm64.h      |   3 +
 arch/s390/include/asm/kvm_host_s390.h       |   2 -
 arch/s390/include/asm/kvm_host_s390_types.h |  14 ----
 arch/s390/include/asm/kvm_host_types.h      |  14 ++++
 arch/s390/include/asm/nmi.h                 |   6 +-
 arch/s390/include/asm/processor.h           |   6 +-
 arch/s390/include/asm/ptrace.h              |   3 +
 arch/s390/include/asm/sae.h                 |   2 +-
 arch/s390/include/asm/stacktrace.h          |   3 +
 arch/s390/include/asm/thread_info.h         |   8 ++-
 arch/s390/kernel/asm-offsets.c              |   6 +-
 arch/s390/kernel/entry.S                    |  68 ++++++++++++++++---
 arch/s390/kernel/irq.c                      |   9 +++
 arch/s390/kernel/nmi.c                      |  58 +++++++++++++---
 arch/s390/kernel/perf_event.c               |  62 +++++++++++++----
 arch/s390/kvm/arm64/arm.c                   | 100 +++++++++++++++++++++++-----
 arch/s390/kvm/arm64/inject_fault.c          |  15 +++++
 arch/s390/kvm/arm64/reset.c                 |   3 +
 20 files changed, 317 insertions(+), 70 deletions(-)
---
base-commit: 9437ee8b6cf607e883b36e44bd755968daaebd48
change-id: 20261204-host-irq-462e1ef598d5
prerequisite-message-id: 20261127-sysreg-v4-0-a6318d18aab5@linux.ibm.com
prerequisite-patch-id: 4f6b2386967522be268f77ca6eb9487a3503dc96
prerequisite-patch-id: 539f1138a427fddb952a5f7a0691e8acd974d0fb
prerequisite-patch-id: 3e9b8384f07ff18911f48eabe625a1c0507a5e96
prerequisite-patch-id: fc58c00a1006ecffd045728020ef01308022ac03
prerequisite-patch-id: 2c22bad7059a38c4ea01ca774d0c0b49cea27fba
prerequisite-patch-id: c809f818609fed0a0f8ccb1721b96f5329505543
prerequisite-patch-id: b35581eba719557148ea84232698457adc8c8cc4
prerequisite-patch-id: 0b8792bac82c24bfac0b5912d2eec5da32413747
prerequisite-patch-id: 58fb40b78dd793ca3b24cadadad8868bc54aa20e
prerequisite-patch-id: d986b0811f1feac0678eb135ce5c44140748431b
prerequisite-patch-id: 0e3d84b8259a175fceb67b01bc37c1830805636b
prerequisite-patch-id: 53a6741f3c6ec60c798995ccbf4d2b293619ec34
prerequisite-patch-id: b71ccf22e4cb8fccf4ca9eea558af14163b256db
prerequisite-patch-id: bba91e0c077b1f308e2ec914a54399f775d9090d
prerequisite-patch-id: 9be57897346558cd0bea61d946d85d3ba9a17f2e
prerequisite-patch-id: f4ae3a54ce24b78e335eb1f019b971419d82720a
prerequisite-patch-id: cc8dfe5b2b8a3f28b3c29b1a10827d99f987694d
prerequisite-patch-id: f27d96dacb5c7dadc01f1cc72158b8b3f64d7053
prerequisite-patch-id: 1c69a0380267279633c8ba33bf1d30c13877e033
prerequisite-patch-id: 20ac948d6ec4bfd4b9c3d053bcb0fcb3fe067486
prerequisite-patch-id: db6b83091a6107dbfd9c4311af14fadf1534375f
prerequisite-patch-id: af30d541a7cabea0981dfe79276d1e9991a8c91a
prerequisite-patch-id: 5eead648d962cbdc9f45ce40538f174faedd5775
prerequisite-patch-id: 97589af6c7ac9efe15c371883511fc05d4f1c870
prerequisite-patch-id: f661ef5923e8026fab81d73e596006ac30d5cbac

Best regards,
-- 
Andreas Grapentin <gra@linux.ibm.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-12-04 12:40 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 12:09 [PATCH 00/10] s390: Host interrupt handling for SAE guests Andreas Grapentin
2026-12-04 12:09 ` [PATCH 01/10] s390/sae: Prepare handling host interrupts during SAE execution Andreas Grapentin
2026-12-04 12:31   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 02/10] s390/sae: Add sae_entry and sae_exit symbols Andreas Grapentin
2026-12-04 12:30   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 03/10] KVM: s390: Share mcck_volatile_info between KVMs Andreas Grapentin
2026-12-04 12:09 ` [PATCH 04/10] s390/irq: Add kvm_exit callback for arm-on-s390 Andreas Grapentin
2026-12-04 12:40   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 05/10] KVM: s390: arm64: Enable host irq Andreas Grapentin
2026-12-04 12:35   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 06/10] s390: Rename CIF_MCCK_GUEST to CIF_MCCK_SIE Andreas Grapentin
2026-12-04 12:09 ` [PATCH 07/10] s390/nmi: Handle MCCKs for SAE guests Andreas Grapentin
2026-12-04 12:40   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 08/10] KVM: s390: arm64: Enable SError injection Andreas Grapentin
2026-12-04 12:34   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 09/10] KVM: s390: arm64: Enable mcck forwarding Andreas Grapentin
2026-12-04 12:33   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 10/10] s390/perf: Recognize SAE guests Andreas Grapentin
2026-12-04 12:30   ` sashiko-bot
2026-12-04 12:40 ` [PATCH 00/10] s390: Host interrupt handling for " sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox