]> git.ipfire.org Git - thirdparty/qemu.git/commit
s390x/pci: add support for guests that request direct mapping
authorMatthew Rosato <mjrosato@linux.ibm.com>
Wed, 26 Feb 2025 21:00:12 +0000 (16:00 -0500)
committerThomas Huth <thuth@redhat.com>
Fri, 7 Mar 2025 08:24:00 +0000 (09:24 +0100)
commitdfcee1ea4c52ac60e0a06221eafb7b6253eb10c3
tree107123548c9382b0e8b74588030fa14efd8c21c2
parent9cbff6f29ee099e7cb331802a1bf9b179c4c3934
s390x/pci: add support for guests that request direct mapping

When receiving a guest mpcifc(4) or mpcifc(6) instruction without the T
bit set, treat this as a request to perform direct mapping instead of
address translation.  In order to facilitate this, pin the entirety of
guest memory into the host iommu.

Pinning for the direct mapping case is handled via vfio and its memory
listener.  Additionally, ram discard settings are inherited from vfio:
coordinated discards (e.g. virtio-mem) are allowed while uncoordinated
discards (e.g. virtio-balloon) are disabled.

Subsequent guest DMA operations are all expected to be of the format
guest_phys+sdma, allowing them to be used as lookup into the host
iommu table.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-ID: <20250226210013.238349-2-mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-inst.c
hw/s390x/s390-pci-vfio.c
hw/s390x/s390-virtio-ccw.c
include/hw/s390x/s390-pci-bus.h