qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] s390x/pci: indicate QEMU supports relaxed translation fo


From: Thomas Huth
Subject: Re: [PATCH 2/2] s390x/pci: indicate QEMU supports relaxed translation for passthrough
Date: Wed, 11 Dec 2024 12:40:46 +0100
User-agent: Mozilla Thunderbird

On 09/12/2024 20.29, Matthew Rosato wrote:
Specifying this bit in the guest CLP response indicates that the guest
can optionally choose to skip translation and instead use
identity-mapped operations.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
---
  hw/s390x/s390-pci-vfio.c        | 4 +++-
  include/hw/s390x/s390-pci-clp.h | 1 +
  2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index 7dbbc76823..51ac5ff3eb 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -224,7 +224,9 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
resgrp = &pbdev->pci_group->zpci_group;
          if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
-            resgrp->fr = 1;
+            resgrp->fr = (CLP_RSP_QPCIG_MASK_RTR | CLP_RSP_QPCIG_MASK_REFRESH);
+        } else {
+            resgrp->fr = CLP_RSP_QPCIG_MASK_RTR;
          }

Just a matter of taste, but maybe easier to write it like this:

        resgrp->fr = CLP_RSP_QPCIG_MASK_RTR;
        if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
            resgrp->fr |= CLP_RSP_QPCIG_MASK_REFRESH;
        }

?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]