Blame SOURCES/kvm-s390x-pci-add-supported-DT-information-to-clp-respon.patch

bf143f
From de6319fe0ce09297beae5ff4636c03217abe6f26 Mon Sep 17 00:00:00 2001
bf143f
From: Matthew Rosato <mjrosato@linux.ibm.com>
bf143f
Date: Fri, 3 Dec 2021 09:27:06 -0500
bf143f
Subject: [PATCH 04/42] s390x/pci: add supported DT information to clp response
bf143f
MIME-Version: 1.0
bf143f
Content-Type: text/plain; charset=UTF-8
bf143f
Content-Transfer-Encoding: 8bit
bf143f
bf143f
RH-Author: Cédric Le Goater <clg@redhat.com>
bf143f
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
bf143f
RH-Bugzilla: 1664378 2043909
bf143f
RH-Acked-by: Thomas Huth <thuth@redhat.com>
bf143f
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
bf143f
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
bf143f
RH-Commit: [4/41] 275668f6d38fbc1dfa2f1aa8f58b2c319de2657d
bf143f
bf143f
The DTSM is a mask that specifies which I/O Address Translation designation
bf143f
types are supported.  Today QEMU only supports DT=1.
bf143f
bf143f
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
bf143f
Reviewed-by: Eric Farman <farman@linux.ibm.com>
bf143f
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
bf143f
Message-Id: <20211203142706.427279-5-mjrosato@linux.ibm.com>
bf143f
Signed-off-by: Thomas Huth <thuth@redhat.com>
bf143f
(cherry picked from commit ac6aa30ac47b2abaf142f76de46374da2a98f6e7)
bf143f
Signed-off-by: Cédric Le Goater <clg@redhat.com>
bf143f
---
bf143f
 hw/s390x/s390-pci-bus.c         | 1 +
bf143f
 hw/s390x/s390-pci-inst.c        | 1 +
bf143f
 hw/s390x/s390-pci-vfio.c        | 1 +
bf143f
 include/hw/s390x/s390-pci-bus.h | 1 +
bf143f
 include/hw/s390x/s390-pci-clp.h | 3 ++-
bf143f
 5 files changed, 6 insertions(+), 1 deletion(-)
bf143f
bf143f
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
bf143f
index 1b51a72838..01b58ebc70 100644
bf143f
--- a/hw/s390x/s390-pci-bus.c
bf143f
+++ b/hw/s390x/s390-pci-bus.c
bf143f
@@ -782,6 +782,7 @@ static void s390_pci_init_default_group(void)
bf143f
     resgrp->i = 128;
bf143f
     resgrp->maxstbl = 128;
bf143f
     resgrp->version = 0;
bf143f
+    resgrp->dtsm = ZPCI_DTSM;
bf143f
 }
bf143f
 
bf143f
 static void set_pbdev_info(S390PCIBusDevice *pbdev)
bf143f
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
bf143f
index 07bab85ce5..6d400d4147 100644
bf143f
--- a/hw/s390x/s390-pci-inst.c
bf143f
+++ b/hw/s390x/s390-pci-inst.c
bf143f
@@ -329,6 +329,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra)
bf143f
         stw_p(&resgrp->i, group->zpci_group.i);
bf143f
         stw_p(&resgrp->maxstbl, group->zpci_group.maxstbl);
bf143f
         resgrp->version = group->zpci_group.version;
bf143f
+        resgrp->dtsm = group->zpci_group.dtsm;
bf143f
         stw_p(&resgrp->hdr.rsp, CLP_RC_OK);
bf143f
         break;
bf143f
     }
bf143f
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
bf143f
index 2a153fa8c9..6f80a47e29 100644
bf143f
--- a/hw/s390x/s390-pci-vfio.c
bf143f
+++ b/hw/s390x/s390-pci-vfio.c
bf143f
@@ -160,6 +160,7 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
bf143f
         resgrp->i = cap->noi;
bf143f
         resgrp->maxstbl = cap->maxstbl;
bf143f
         resgrp->version = cap->version;
bf143f
+        resgrp->dtsm = ZPCI_DTSM;
bf143f
     }
bf143f
 }
bf143f
 
bf143f
diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h
bf143f
index 2727e7bdef..da3cde2bb4 100644
bf143f
--- a/include/hw/s390x/s390-pci-bus.h
bf143f
+++ b/include/hw/s390x/s390-pci-bus.h
bf143f
@@ -37,6 +37,7 @@
bf143f
 #define ZPCI_MAX_UID 0xffff
bf143f
 #define UID_UNDEFINED 0
bf143f
 #define UID_CHECKING_ENABLED 0x01
bf143f
+#define ZPCI_DTSM 0x40
bf143f
 
bf143f
 OBJECT_DECLARE_SIMPLE_TYPE(S390pciState, S390_PCI_HOST_BRIDGE)
bf143f
 OBJECT_DECLARE_SIMPLE_TYPE(S390PCIBus, S390_PCI_BUS)
bf143f
diff --git a/include/hw/s390x/s390-pci-clp.h b/include/hw/s390x/s390-pci-clp.h
bf143f
index 96b8e3f133..cc8c8662b8 100644
bf143f
--- a/include/hw/s390x/s390-pci-clp.h
bf143f
+++ b/include/hw/s390x/s390-pci-clp.h
bf143f
@@ -163,7 +163,8 @@ typedef struct ClpRspQueryPciGrp {
bf143f
     uint8_t fr;
bf143f
     uint16_t maxstbl;
bf143f
     uint16_t mui;
bf143f
-    uint64_t reserved3;
bf143f
+    uint8_t dtsm;
bf143f
+    uint8_t reserved3[7];
bf143f
     uint64_t dasm; /* dma address space mask */
bf143f
     uint64_t msia; /* MSI address */
bf143f
     uint64_t reserved4;
bf143f
-- 
bf143f
2.37.3
bf143f