Skip to content

RFC pci pass-through support for qemu/KVM on s390

[email protected] kvm linux-s390 qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6s390: cio: chsc function to register GIBarch/s390/include/asm/cio.h drivers/s390/cio/chsc.c+51 -00 replies
2/6s390: pci: export pci functions for pass-through usagearch/s390/include/asm/pci.h arch/s390/include/asm/pci_clp.h arch/s390/include/asm/pci_insn.h +3 more+126 -1000 replies
3/6KVM: s390: Add GISA supportarch/s390/include/asm/kvm_host.h arch/s390/kvm/kvm-s390.c arch/s390/kvm/kvm-s390.h+265 -23 replies
4/6KVM: s390: Add PCI pass-through supportarch/s390/include/asm/kvm_host.h arch/s390/kvm/Makefile arch/s390/kvm/intercept.c +4 more+2202 -31 reply
5/6s390: Add PCI bus supportdefault-configs/s390x-softmmu.mak hw/s390x/Makefile.objs hw/s390x/css.c +12 more+956 -20 replies
6/6s390: Add PCI pass-through device supporthw/s390x/Makefile.objs hw/s390x/s390-pci-bus.c hw/s390x/s390_pci.c +1 more+365 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][patch 0/6] pci pass-through support for qemu/KVM on s390

This set of patches implements pci pass-through support for qemu/KVM on s390. PCI support on s390 is very different from other platforms.
Major differences are:

1) all PCI operations are driven by special s390 instructions
2) all s390 PCI instructions are privileged
3) PCI config and memory spaces can not be mmap'ed
4) no classic interrupts (INTX, MSI). The pci hw understands the concept of requesting MSIX irqs but irqs are delivered as s390 adapter irqs.
5) For DMA access there is always an IOMMU required. s390 pci implementation does not support a complete memory to iommu mapping, dma mappings are created on request.
6) The OS does not get any informations about the physical layout of the PCI bus.
7) To take advantage of system z specific virtualization features we need to access the SIE control block residing in the kernel KVM
8) To enable system z specific virtualization features we have to manipulate the zpci device in kernel.

For this reasons I decided to implement a kernel based approach similar to x86 device assignment. There is a new qemu device (s390-pci) representing a pass through device on the host. Here is a sample qemu device configuration:

-device s390-pci,host=0000:00:00.0

The device executes the KVM_ASSIGN_PCI_DEVICE ioctl to create a proxy instance in the kernel KVM and connect this instance to the host pci device.

kernel patches apply to linux-kvm

s390: cio: chsc function to register GIB
s390: pci: export pci functions for pass-through usage
KVM: s390: Add GISA support
KVM: s390: Add PCI pass-through support

qemu patches apply to qemu-master

s390: Add PCI bus support
s390: Add PCI pass-through device support

Feedback and discussion is highly welcome ...
Thx!

Frank