thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-s390x-pci-reflect-proper-maxstbl-for-groups-of-inter.patch

62547e
From 65f90bfccf7500978879c15104a79de58173a06b Mon Sep 17 00:00:00 2001
62547e
From: Matthew Rosato <mjrosato@linux.ibm.com>
62547e
Date: Fri, 2 Sep 2022 13:27:36 -0400
62547e
Subject: [PATCH 11/42] s390x/pci: reflect proper maxstbl for groups of
62547e
 interpreted devices
62547e
MIME-Version: 1.0
62547e
Content-Type: text/plain; charset=UTF-8
62547e
Content-Transfer-Encoding: 8bit
62547e
62547e
RH-Author: Cédric Le Goater <clg@redhat.com>
62547e
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
62547e
RH-Bugzilla: 1664378 2043909
62547e
RH-Acked-by: Thomas Huth <thuth@redhat.com>
62547e
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
62547e
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
62547e
RH-Commit: [11/41] 9ac2f5dedef3d743ef621525eef222a3e09d63b3
62547e
62547e
The maximum supported store block length might be different depending
62547e
on whether the instruction is interpretively executed (firmware-reported
62547e
maximum) or handled via userspace intercept (host kernel API maximum).
62547e
Choose the best available value during group creation.
62547e
62547e
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
62547e
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
62547e
Message-Id: <20220902172737.170349-8-mjrosato@linux.ibm.com>
62547e
Signed-off-by: Thomas Huth <thuth@redhat.com>
62547e
(cherry picked from commit 9ee8f7e46a7d42ede69a4780200129bf1acb0d01)
62547e
Signed-off-by: Cédric Le Goater <clg@redhat.com>
62547e
---
62547e
 hw/s390x/s390-pci-vfio.c | 6 +++++-
62547e
 1 file changed, 5 insertions(+), 1 deletion(-)
62547e
62547e
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
62547e
index 338f436e87..2aefa508a0 100644
62547e
--- a/hw/s390x/s390-pci-vfio.c
62547e
+++ b/hw/s390x/s390-pci-vfio.c
62547e
@@ -213,7 +213,11 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
62547e
         resgrp->msia = cap->msi_addr;
62547e
         resgrp->mui = cap->mui;
62547e
         resgrp->i = cap->noi;
62547e
-        resgrp->maxstbl = cap->maxstbl;
62547e
+        if (pbdev->interp && hdr->version >= 2) {
62547e
+            resgrp->maxstbl = cap->imaxstbl;
62547e
+        } else {
62547e
+            resgrp->maxstbl = cap->maxstbl;
62547e
+        }
62547e
         resgrp->version = cap->version;
62547e
         resgrp->dtsm = ZPCI_DTSM;
62547e
     }
62547e
-- 
62547e
2.37.3
62547e