thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
97168e
From 65f90bfccf7500978879c15104a79de58173a06b Mon Sep 17 00:00:00 2001
97168e
From: Matthew Rosato <mjrosato@linux.ibm.com>
97168e
Date: Fri, 2 Sep 2022 13:27:36 -0400
97168e
Subject: [PATCH 11/42] s390x/pci: reflect proper maxstbl for groups of
97168e
 interpreted devices
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: [11/41] 9ac2f5dedef3d743ef621525eef222a3e09d63b3
97168e
97168e
The maximum supported store block length might be different depending
97168e
on whether the instruction is interpretively executed (firmware-reported
97168e
maximum) or handled via userspace intercept (host kernel API maximum).
97168e
Choose the best available value during group creation.
97168e
97168e
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
97168e
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
97168e
Message-Id: <20220902172737.170349-8-mjrosato@linux.ibm.com>
97168e
Signed-off-by: Thomas Huth <thuth@redhat.com>
97168e
(cherry picked from commit 9ee8f7e46a7d42ede69a4780200129bf1acb0d01)
97168e
Signed-off-by: Cédric Le Goater <clg@redhat.com>
97168e
---
97168e
 hw/s390x/s390-pci-vfio.c | 6 +++++-
97168e
 1 file changed, 5 insertions(+), 1 deletion(-)
97168e
97168e
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
97168e
index 338f436e87..2aefa508a0 100644
97168e
--- a/hw/s390x/s390-pci-vfio.c
97168e
+++ b/hw/s390x/s390-pci-vfio.c
97168e
@@ -213,7 +213,11 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
97168e
         resgrp->msia = cap->msi_addr;
97168e
         resgrp->mui = cap->mui;
97168e
         resgrp->i = cap->noi;
97168e
-        resgrp->maxstbl = cap->maxstbl;
97168e
+        if (pbdev->interp && hdr->version >= 2) {
97168e
+            resgrp->maxstbl = cap->imaxstbl;
97168e
+        } else {
97168e
+            resgrp->maxstbl = cap->maxstbl;
97168e
+        }
97168e
         resgrp->version = cap->version;
97168e
         resgrp->dtsm = ZPCI_DTSM;
97168e
     }
97168e
-- 
97168e
2.37.3
97168e