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