Skip to content

Commit d9b5dfc

Browse files
rosatomjhuth
authored andcommitted
s390x/pci: indicate QEMU supports relaxed translation for passthrough
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 <[email protected]> Reviewed-by: Niklas Schnelle <[email protected]> Signed-off-by: Matthew Rosato <[email protected]> Message-ID: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent dfcee1e commit d9b5dfc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

hw/s390x/s390-pci-vfio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,11 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
238238
pbdev->pci_group = s390_group_create(pbdev->zpci_fn.pfgid, start_gid);
239239

240240
resgrp = &pbdev->pci_group->zpci_group;
241+
if (pbdev->rtr_avail) {
242+
resgrp->fr |= CLP_RSP_QPCIG_MASK_RTR;
243+
}
241244
if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
242-
resgrp->fr = 1;
245+
resgrp->fr |= CLP_RSP_QPCIG_MASK_REFRESH;
243246
}
244247
resgrp->dasm = cap->dasm;
245248
resgrp->msia = cap->msi_addr;

include/hw/s390x/s390-pci-clp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ typedef struct ClpRspQueryPciGrp {
158158
#define CLP_RSP_QPCIG_MASK_NOI 0xfff
159159
uint16_t i;
160160
uint8_t version;
161+
#define CLP_RSP_QPCIG_MASK_RTR 0x20
161162
#define CLP_RSP_QPCIG_MASK_FRAME 0x2
162163
#define CLP_RSP_QPCIG_MASK_REFRESH 0x1
163164
uint8_t fr;

0 commit comments

Comments
 (0)