Skip to content

s390x: SMP for TCG

David Hildenbrand qemu-devel 2 versions – Applied

Status from this message: Thanks, applied (with some minor changes, see the individual patches).

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest30 patches 34 repliesApplied
  2. v127 patches 35 repliesSuperseded

Changes in v2 from the cover letter · 25 lines

- "turn INTERRUPT_EXT into a mask"
-- fix one check (& vs |)
-- rename EXT_FLOATING to EXT_SERVICE
-- drop duplicate storing of interrupt parameters for queded ext irqa
- "s390x/tcg: cleanup service interrupt injectio"
-- added, as we don't have virtio irq anymore (for legacy transport)
- "s390x/tcg: rework checking for deliverable interrupts"
-- added, we actually check if interrupts are deliverable
- "s390x/tcg: take care of external interrupt subclasses"
-- properly check for the subclasses we implement
- "target/s390x: factor out handling of WAIT PSW into s390_handle_wait()" -- renamed handle_wait() -> s390_handle_wait()
- "s390x/tcg: handle WAIT PSWs during interrupt injection"
-- any feedback if this is the right way to do it? needed for stop interrupts
- "target/s390x: interpret PSW_MASK_WAIT only for TCG"
-- identified while testing SIGP
- "s390x/kvm: pass ipb directly into handle_sigp()"
-- order parameters alphabetically
- "s390x/kvm: factor out storing of CPU status"
-- the rework/conversion has been integrated as a fix (Connys queue)
- "MAINTAINERS: use s390 KVM maintainers for target/s390x/sigp.c" -- added as requested by Christian
- "s390x/tcg: implement STOP and RESET interrupts for TCG"
-- some change due to the way interrupts are handled after the rework
for deliverable interrupts
- "s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu" -- added, because we implement SENSE RUNNING STATUS
- "target/s390x: special handling when starting a CPU with WAIT PSW" -- identified while testing SIGP code

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/30s390x/tcg: turn INTERRUPT_EXT into a masktarget/s390x/cpu.h target/s390x/excp_helper.c target/s390x/helper.c +2 more+61 -473 replies
2/30s390x/tcg: cleanup service interrupt injectiontarget/s390x/cpu.c target/s390x/cpu.h target/s390x/excp_helper.c +2 more+10 -382 replies
3/30s390x/tcg: injection of emergency signals and external callstarget/s390x/cpu.h target/s390x/excp_helper.c target/s390x/internal.h +1 more+50 -21 reply
4/30s390x/tcg: rework checking for deliverable interruptstarget/s390x/cpu.c target/s390x/excp_helper.c target/s390x/internal.h +1 more+62 -171 reply
5/30s390x/tcg: take care of external interrupt subclassestarget/s390x/cpu.h target/s390x/excp_helper.c target/s390x/interrupt.c +1 more+50 -131 reply
6/30s390x/tcg: STOPPED cpus can never wake uptarget/s390x/cpu.c+6 -00 replies
7/30s390x/tcg: a CPU cannot switch state due to an interrupttarget/s390x/excp_helper.c+0 -10 replies
8/30target/s390x: factor out handling of WAIT PSW into s390_handle_wait()target/s390x/helper.c target/s390x/internal.h target/s390x/kvm.c+23 -190 replies
9/30s390x/tcg: handle WAIT PSWs during interrupt injectiontarget/s390x/excp_helper.c+6 -01 reply
10/30target/s390x: interpret PSW_MASK_WAIT only for TCGtarget/s390x/helper.c+2 -12 replies
11/30s390x/kvm: pass ipb directly into handle_sigp()target/s390x/kvm.c+3 -30 replies
12/30s390x/kvm: generalize SIGP stop and restart interrupt injectiontarget/s390x/internal.h target/s390x/interrupt.c target/s390x/kvm-stub.c +2 more+53 -120 replies
13/30s390x/kvm: factor out storing of CPU statustarget/s390x/helper.c target/s390x/internal.h target/s390x/kvm.c+65 -661 reply
14/30s390x/kvm: factor out storing of adtl CPU statustarget/s390x/helper.c target/s390x/internal.h target/s390x/kvm.c+31 -290 replies
15/30s390x/kvm: drop two debug printstarget/s390x/kvm.c+0 -20 replies
16/30s390x/kvm: factor out SIGP code into sigp.chw/s390x/s390-virtio-ccw.c target/s390x/Makefile.objs target/s390x/cpu.c +7 more+388 -3591 reply
17/30MAINTAINERS: use s390 KVM maintainers for target/s390x/sigp.cMAINTAINERS+1 -02 replies
18/30s390x/kvm: factor out actual handling of STOP interruptstarget/s390x/internal.h target/s390x/kvm.c target/s390x/sigp.c+16 -81 reply
19/30s390x/tcg: implement SIGP SENSE RUNNING STATUStarget/s390x/cpu.h target/s390x/sigp.c+27 -01 reply
20/30s390x/tcg: implement SIGP SENSEtarget/s390x/sigp.c+29 -02 replies
21/30s390x/tcg: implement SIGP EXTERNAL CALLtarget/s390x/sigp.c+23 -21 reply
22/30s390x/tcg: implement SIGP EMERGENCY SIGNALtarget/s390x/sigp.c+15 -01 reply
23/30s390x/tcg: implement SIGP CONDITIONAL EMERGENCY SIGNALtarget/s390x/cpu.h target/s390x/sigp.c+38 -01 reply
24/30s390x/tcg: implement STOP and RESET interrupts for TCGtarget/s390x/cpu.h target/s390x/excp_helper.c target/s390x/helper.c +3 more+51 -62 replies
25/30s390x/tcg: flush the tlb on SIGP SET PREFIXtarget/s390x/sigp.c+1 -01 reply
26/30s390x/tcg: switch to new SIGP handling codehw/s390x/s390-virtio-ccw.c target/s390x/helper.h target/s390x/misc_helper.c +1 more+11 -422 replies
27/30s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemutarget/s390x/cpu_models.c+1 -01 reply
28/30s390x/tcg: unlock NMIhw/s390x/s390-virtio-ccw.c target/s390x/sigp.c+1 -82 replies
29/30s390x/tcg: refactor stfl(e) to use s390_get_feat_block()target/s390x/misc_helper.c target/s390x/translate.c+29 -391 reply
30/30target/s390x: special handling when starting a CPU with WAIT PSWtarget/s390x/cpu.c target/s390x/sigp.c+14 -31 reply

Reviews trailers per patch

All 30 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonThomas Huth
1/30R-b
2/30R-b
3/30R-b
4/30R-b
5/30R-b
6/30R-b
7/30R-b
8/30R-b
9/30R-b
10/30R-b
11/30R-b R-b
12/30R-b
13/30R-b
14/30R-b
15/30R-b R-b
16/30R-b
17/30R-b
18/30R-b
19/30R-b
20/30R-b
21/30R-b
22/30R-b
23/30R-b
24/30R-b
25/30R-b
26/30R-b
27/30R-b
28/30R-b
29/30R-b
30/30R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/30] s390x: SMP for TCG

This series is based on a couple of other patches floating around on the mailing list (e.g. cleanups and LAP). The fist patches of v1 have been sent as a separate series.

As I am working on kvm-unit-tests for SIGP, I discovered some bugs that have been fixed in this series.

======================================
I'll be on vacation until 15. October.
======================================

This series contains:
- properly implement local external interrupts for TCG. Take care of interrupt masks. Cleanup service interrupt handling.
- factor out KVM SIGP handling code into common code
- implement missing SIGP orders for TCG handled by the kernel for KVM (including STOP and RESTART interrupts)
- make TCG use the new SIGP code - experimental SMP support for s390x TCG
- refactor STFL(E) implementation for TCG
- bunch of cleanups

Basically all SIGP instructions are fully supported.

Thanks to Aurelien Jarno for the initital prototype and showcasing that supporting experimental SMP code can be implemented quite easily.

CPU hotplug does still not work correctly.

v1 -> v2:
- "turn INTERRUPT_EXT into a mask"
-- fix one check (& vs |)
-- rename EXT_FLOATING to EXT_SERVICE
-- drop duplicate storing of interrupt parameters for queded ext irqa
- "s390x/tcg: cleanup service interrupt injectio"
-- added, as we don't have virtio irq anymore (for legacy transport)
- "s390x/tcg: rework checking for deliverable interrupts"
-- added, we actually check if interrupts are deliverable
- "s390x/tcg: take care of external interrupt subclasses"
-- properly check for the subclasses we implement
- "target/s390x: factor out handling of WAIT PSW into s390_handle_wait()" -- renamed handle_wait() -> s390_handle_wait()
- "s390x/tcg: handle WAIT PSWs during interrupt injection"
-- any feedback if this is the right way to do it? needed for stop interrupts
- "target/s390x: interpret PSW_MASK_WAIT only for TCG"
-- identified while testing SIGP
- "s390x/kvm: pass ipb directly into handle_sigp()"
-- order parameters alphabetically
- "s390x/kvm: factor out storing of CPU status"
-- the rework/conversion has been integrated as a fix (Connys queue)
- "MAINTAINERS: use s390 KVM maintainers for target/s390x/sigp.c" -- added as requested by Christian
- "s390x/tcg: implement STOP and RESET interrupts for TCG"
-- some change due to the way interrupts are handled after the rework
for deliverable interrupts
- "s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu" -- added, because we implement SENSE RUNNING STATUS
- "target/s390x: special handling when starting a CPU with WAIT PSW" -- identified while testing SIGP code

Based on: https://github.com/cohuck/qemu.git s390-next Available on: https://github.com/davidhildenbrand/qemu.git s390x-queue

David Hildenbrand (30):
s390x/tcg: turn INTERRUPT_EXT into a mask
s390x/tcg: cleanup service interrupt injection
s390x/tcg: injection of emergency signals and external calls s390x/tcg: rework checking for deliverable interrupts s390x/tcg: take care of external interrupt subclasses s390x/tcg: STOPPED cpus can never wake up
s390x/tcg: a CPU cannot switch state due to an interrupt target/s390x: factor out handling of WAIT PSW into s390_handle_wait() s390x/tcg: handle WAIT PSWs during interrupt injection target/s390x: interpret PSW_MASK_WAIT only for TCG s390x/kvm: pass ipb directly into handle_sigp()
s390x/kvm: generalize SIGP stop and restart interrupt injection s390x/kvm: factor out storing of CPU status
s390x/kvm: factor out storing of adtl CPU status s390x/kvm: drop two debug prints
s390x/kvm: factor out SIGP code into sigp.c
MAINTAINERS: use s390 KVM maintainers for target/s390x/sigp.c s390x/kvm: factor out actual handling of STOP interrupts s390x/tcg: implement SIGP SENSE RUNNING STATUS
s390x/tcg: implement SIGP SENSE
s390x/tcg: implement SIGP EXTERNAL CALL
s390x/tcg: implement SIGP EMERGENCY SIGNAL
s390x/tcg: implement SIGP CONDITIONAL EMERGENCY SIGNAL s390x/tcg: implement STOP and RESET interrupts for TCG s390x/tcg: flush the tlb on SIGP SET PREFIX
s390x/tcg: switch to new SIGP handling code s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu s390x/tcg: unlock NMI
s390x/tcg: refactor stfl(e) to use s390_get_feat_block() target/s390x: special handling when starting a CPU with WAIT PSW

 MAINTAINERS                |   1 +
 hw/s390x/s390-virtio-ccw.c |  11 +-
 target/s390x/Makefile.objs |   1 +
 target/s390x/cpu.c         |  35 ++--
 target/s390x/cpu.h         |  42 ++--
 target/s390x/cpu_models.c  |   1 +
 target/s390x/excp_helper.c | 116 +++++++----
 target/s390x/helper.c      | 132 ++++++++++--
 target/s390x/helper.h      |   2 +-
 target/s390x/internal.h    |  23 +-
 target/s390x/interrupt.c   | 172 ++++++++++++++-
 target/s390x/kvm-stub.c    |  13 +-
 target/s390x/kvm.c         | 491 +++----------------------------------------
 target/s390x/kvm_s390x.h   |   3 +-
 target/s390x/misc_helper.c | 109 ++++------
 target/s390x/sigp.c        | 508 +++++++++++++++++++++++++++++++++++++++++++++
 target/s390x/trace-events  |   4 +-
 target/s390x/translate.c   |  12 +-
 18 files changed, 1013 insertions(+), 663 deletions(-)
 create mode 100644 target/s390x/sigp.c
Signature · 1 line
2.13.5