]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
s390x/pci: indicate QEMU supports relaxed translation for passthrough
authorMatthew Rosato <mjrosato@linux.ibm.com>
Wed, 26 Feb 2025 21:00:13 +0000 (16:00 -0500)
committerThomas Huth <thuth@redhat.com>
Fri, 7 Mar 2025 08:24:00 +0000 (09:24 +0100)
Specifying this bit in the guest CLP response indicates that the guest
can optionally choose to skip translation and instead use
identity-mapped operations.

Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20250226210013.238349-3-mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/s390-pci-vfio.c
include/hw/s390x/s390-pci-clp.h

index 443e22291272e45899a75f167f2f51ff5fd93297..6236ac7f1e686c9774ade172bf57a1e526b59939 100644 (file)
@@ -238,8 +238,11 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
         pbdev->pci_group = s390_group_create(pbdev->zpci_fn.pfgid, start_gid);
 
         resgrp = &pbdev->pci_group->zpci_group;
+        if (pbdev->rtr_avail) {
+            resgrp->fr |= CLP_RSP_QPCIG_MASK_RTR;
+        }
         if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
-            resgrp->fr = 1;
+            resgrp->fr |= CLP_RSP_QPCIG_MASK_REFRESH;
         }
         resgrp->dasm = cap->dasm;
         resgrp->msia = cap->msi_addr;
index 03b7f9ba5f749abfe9b1accb884a71be1a3f1a40..6a635d693baf0cfdec02ba17a971ca7dd5c870a6 100644 (file)
@@ -158,6 +158,7 @@ typedef struct ClpRspQueryPciGrp {
 #define CLP_RSP_QPCIG_MASK_NOI 0xfff
     uint16_t i;
     uint8_t version;
+#define CLP_RSP_QPCIG_MASK_RTR     0x20
 #define CLP_RSP_QPCIG_MASK_FRAME   0x2
 #define CLP_RSP_QPCIG_MASK_REFRESH 0x1
     uint8_t fr;