thebeanogamer / rpms / qemu-kvm

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