Skip to content

KVM: s390: enable zPCI for interpretive execution

Matthew Rosato kvm linux-doc linux-s390 lkml 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest21 patches 21 repliesIn review
  2. v822 patches 5 repliesSuperseded
  3. v722 patches 16 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v621 patches16 repliesSuperseded
v521 patches31 repliesSuperseded
v432 patches33 repliesSuperseded
v330 patches31 repliesSuperseded
v230 patches66 repliesSuperseded
v132 patches83 repliesSuperseded

Changes in v9 from the cover letter

- Rebase on top of 5.19-rc1, adjust ioctl and capability defines
- s/kzdev = 0/kzdev = NULL/ (Alex)
- rename vfio_pci_zdev_open to vfio_pci_zdev_open_device (Jason)
- rename vfio_pci_zdev_release to vfio_pci_zdev_close_device (Jason)
- make vfio_pci_zdev_close_device return void, instead WARN_ON or ignore errors in lower level function (kvm_s390_pci_unregister_kvm) (Jason)
- remove notifier accidentally left in struct zpci_dev + associated include statment (Jason)
- Remove patch 'KVM: s390: introduce CPU feature for zPCI Interpretation' based on discussion in QEMU thread.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21s390/sclp: detect the zPCI load/store interpretation facilityarch/s390/include/asm/sclp.h drivers/s390/char/sclp_early.c+2 -00 replies
2/21s390/sclp: detect the AISII facilityarch/s390/include/asm/sclp.h drivers/s390/char/sclp_early.c+2 -00 replies
3/21s390/sclp: detect the AENI facilityarch/s390/include/asm/sclp.h drivers/s390/char/sclp_early.c+2 -00 replies
4/21s390/sclp: detect the AISI facilityarch/s390/include/asm/sclp.h drivers/s390/char/sclp_early.c+2 -00 replies
5/21s390/airq: pass more TPI info to airq handlersarch/s390/include/asm/airq.h arch/s390/kvm/interrupt.c arch/s390/pci/pci_irq.c +4 more+26 -110 replies
6/21s390/airq: allow for airq structure that uses an input vectorarch/s390/include/asm/airq.h arch/s390/pci/pci_irq.c drivers/s390/cio/airq.c +1 more+15 -90 replies
7/21s390/pci: externalize the SIC operation controls and routinearch/s390/include/asm/pci_insn.h arch/s390/pci/pci_insn.c arch/s390/pci/pci_irq.c+23 -230 replies
8/21s390/pci: stash associated GISA designationarch/s390/include/asm/pci.h arch/s390/include/asm/pci_clp.h arch/s390/pci/pci.c +2 more+19 -10 replies
9/21s390/pci: stash dtsm and maxstblarch/s390/include/asm/pci.h arch/s390/include/asm/pci_clp.h arch/s390/pci/pci_clp.c+8 -20 replies
10/21vfio/pci: introduce CONFIG_VFIO_PCI_ZDEV_KVMdrivers/vfio/pci/Kconfig drivers/vfio/pci/Makefile include/linux/vfio_pci_core.h+13 -25 replies
11/21KVM: s390: pci: add basic kvm_zdev structurearch/s390/include/asm/pci.h arch/s390/kvm/Makefile arch/s390/kvm/pci.c +1 more+61 -00 replies
12/21KVM: s390: pci: do initial setup for AEN interpretationarch/s390/include/asm/pci.h arch/s390/include/asm/pci_insn.h arch/s390/kvm/interrupt.c +4 more+256 -00 replies
13/21KVM: s390: pci: enable host forwarding of Adapter Event Notificationsarch/s390/include/asm/kvm_host.h arch/s390/include/asm/tpi.h arch/s390/kvm/interrupt.c +2 more+103 -20 replies
14/21KVM: s390: mechanism to enable guest zPCI Interpretationarch/s390/include/asm/kvm_host.h arch/s390/kvm/kvm-s390.c arch/s390/kvm/kvm-s390.h+52 -00 replies
15/21KVM: s390: pci: provide routines for enabling/disabling interrupt forwardingarch/s390/kvm/pci.c arch/s390/kvm/pci.h arch/s390/pci/pci_insn.c +1 more+251 -10 replies
16/21KVM: s390: pci: add routines to start/stop interpretive executionarch/s390/include/asm/kvm_host.h arch/s390/include/asm/pci.h arch/s390/kvm/kvm-s390.c +3 more+205 -02 replies
17/21vfio-pci/zdev: add open/close device hooksdrivers/vfio/pci/vfio_pci_core.c drivers/vfio/pci/vfio_pci_zdev.c include/linux/vfio_pci_core.h+43 -12 replies
18/21vfio-pci/zdev: add function handle to clp base capabilitydrivers/vfio/pci/vfio_pci_zdev.c include/uapi/linux/vfio_zdev.h+6 -21 reply
19/21vfio-pci/zdev: different maxstbl for interpreted devicesdrivers/vfio/pci/vfio_pci_zdev.c include/uapi/linux/vfio_zdev.h+8 -21 reply
20/21KVM: s390: add KVM_S390_ZPCI_OP to manage guest zPCI devicesDocumentation/virt/kvm/api.rst arch/s390/kvm/kvm-s390.c arch/s390/kvm/pci.c +2 more+181 -02 replies
21/21MAINTAINERS: additional files related kvm s390 pci passthroughMAINTAINERS+1 -01 reply

Reviews trailers per patch

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

PatchEric FarmanChristian BorntraegerClaudio ImbrendaThomas HuthPierre MorelCornelia HuckNiklas SchnelleAlex Williamson
1/21R-b R-b R-b
2/21R-b R-b R-b
3/21R-b R-b R-b
4/21R-b R-b R-b
5/21R-b A-b R-b R-b R-b A-b
6/21R-b R-b R-b A-b
7/21R-b R-b R-b
8/21R-b R-b R-b
9/21R-b R-b R-b
10/21R-b A-b
11/21R-b R-b R-b
12/21R-b
13/21R-b R-b
14/21R-b R-b
15/21R-b A-b
16/21A-b
17/21R-b A-b
18/21R-b R-b A-b
19/21R-b A-b
20/21R-b A-b
21/21A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/21] KVM: s390: enable zPCI for interpretive execution

Enable interpretive execution of zPCI instructions + adapter interruption forwarding for s390x KVM vfio-pci. This is done by triggering a routine when the VFIO group is associated with the KVM guest, transmitting to firmware a special token (GISA designation) to enable that specific guest for interpretive execution on that zPCI device. Load/store interpreation enablement is then controlled by userspace (based upon whether or not a SHM bit is placed in the virtual function handle). Adapter Event Notification interpretation is controlled from userspace via a new KVM ioctl.

By allowing intepretation of zPCI instructions and firmware delivery of interrupts to guests, we can reduce the frequency of guest SIE exits for zPCI.

From the perspective of guest configuration, you passthrough zPCI devices in the same manner as before, with intepretation support being used by default if available in kernel+qemu.

Will follow up with a link the most recent QEMU series.

Changelog v8->v9:
- Rebase on top of 5.19-rc1, adjust ioctl and capability defines
- s/kzdev = 0/kzdev = NULL/ (Alex)
- rename vfio_pci_zdev_open to vfio_pci_zdev_open_device (Jason)
- rename vfio_pci_zdev_release to vfio_pci_zdev_close_device (Jason)
- make vfio_pci_zdev_close_device return void, instead WARN_ON or ignore errors in lower level function (kvm_s390_pci_unregister_kvm) (Jason)
- remove notifier accidentally left in struct zpci_dev + associated include statment (Jason)
- Remove patch 'KVM: s390: introduce CPU feature for zPCI Interpretation' based on discussion in QEMU thread.

Matthew Rosato (21):
s390/sclp: detect the zPCI load/store interpretation facility s390/sclp: detect the AISII facility
s390/sclp: detect the AENI facility
s390/sclp: detect the AISI facility
s390/airq: pass more TPI info to airq handlers
s390/airq: allow for airq structure that uses an input vector s390/pci: externalize the SIC operation controls and routine s390/pci: stash associated GISA designation
s390/pci: stash dtsm and maxstbl
vfio/pci: introduce CONFIG_VFIO_PCI_ZDEV_KVM
KVM: s390: pci: add basic kvm_zdev structure
KVM: s390: pci: do initial setup for AEN interpretation
KVM: s390: pci: enable host forwarding of Adapter Event Notifications
KVM: s390: mechanism to enable guest zPCI Interpretation
KVM: s390: pci: provide routines for enabling/disabling interrupt
forwarding
KVM: s390: pci: add routines to start/stop interpretive execution vfio-pci/zdev: add open/close device hooks
vfio-pci/zdev: add function handle to clp base capability vfio-pci/zdev: different maxstbl for interpreted devices
KVM: s390: add KVM_S390_ZPCI_OP to manage guest zPCI devices
MAINTAINERS: additional files related kvm s390 pci passthrough

 Documentation/virt/kvm/api.rst   |  47 +++
 MAINTAINERS                      |   1 +
 arch/s390/include/asm/airq.h     |   7 +-
 arch/s390/include/asm/kvm_host.h |  23 ++
 arch/s390/include/asm/pci.h      |  11 +
 arch/s390/include/asm/pci_clp.h  |   9 +-
 arch/s390/include/asm/pci_insn.h |  29 +-
 arch/s390/include/asm/sclp.h     |   4 +
 arch/s390/include/asm/tpi.h      |  13 +
 arch/s390/kvm/Makefile           |   1 +
 arch/s390/kvm/interrupt.c        |  96 ++++-
 arch/s390/kvm/kvm-s390.c         |  83 +++-
 arch/s390/kvm/kvm-s390.h         |  10 +
 arch/s390/kvm/pci.c              | 690 +++++++++++++++++++++++++++++++
 arch/s390/kvm/pci.h              |  88 ++++
 arch/s390/pci/pci.c              |  16 +
 arch/s390/pci/pci_clp.c          |   7 +
 arch/s390/pci/pci_insn.c         |   4 +-
 arch/s390/pci/pci_irq.c          |  48 ++-
 drivers/s390/char/sclp_early.c   |   4 +
 drivers/s390/cio/airq.c          |  12 +-
 drivers/s390/cio/qdio_thinint.c  |   6 +-
 drivers/s390/crypto/ap_bus.c     |   9 +-
 drivers/s390/virtio/virtio_ccw.c |   6 +-
 drivers/vfio/pci/Kconfig         |  11 +
 drivers/vfio/pci/Makefile        |   2 +-
 drivers/vfio/pci/vfio_pci_core.c |  10 +-
 drivers/vfio/pci/vfio_pci_zdev.c |  35 +-
 include/linux/sched/user.h       |   3 +-
 include/linux/vfio_pci_core.h    |  12 +-
 include/uapi/linux/kvm.h         |  31 ++
 include/uapi/linux/vfio_zdev.h   |   7 +
 32 files changed, 1279 insertions(+), 56 deletions(-)
 create mode 100644 arch/s390/kvm/pci.c
 create mode 100644 arch/s390/kvm/pci.h
Signature · 1 line
2.27.0