cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
902636
From d5f5a307f3396064d29ef0d300c7377756dd165b Mon Sep 17 00:00:00 2001
902636
From: Cornelia Huck <cohuck@redhat.com>
902636
Date: Tue, 23 Jun 2020 09:25:36 -0400
902636
Subject: [PATCH 02/12] vfio-ccw: allow non-prefetch ORBs
902636
902636
RH-Author: Cornelia Huck <cohuck@redhat.com>
902636
Message-id: <20200623092543.358315-3-cohuck@redhat.com>
902636
Patchwork-id: 97692
902636
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH 2/9] vfio-ccw: allow non-prefetch ORBs
902636
Bugzilla: 1660916
902636
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
902636
RH-Acked-by: David Hildenbrand <david@redhat.com>
902636
RH-Acked-by: Thomas Huth <thuth@redhat.com>
902636
902636
From: Jared Rossi <jrossi@linux.ibm.com>
902636
902636
Remove the explicit prefetch check when using vfio-ccw devices.
902636
This check does not trigger in practice as all Linux channel programs
902636
are intended to use prefetch.
902636
902636
Newer Linux kernel versions do not require to force the PFCH flag with
902636
vfio-ccw devices anymore.
902636
902636
Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
902636
Reviewed-by: Eric Farman <farman@linux.ibm.com>
902636
Message-Id: <20200512181535.18630-2-jrossi@linux.ibm.com>
902636
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
902636
(cherry picked from commit 24e58a7b1d411627e326144030a20dcf0093fed0)
902636
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 hw/vfio/ccw.c | 13 +++----------
902636
 1 file changed, 3 insertions(+), 10 deletions(-)
902636
902636
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
902636
index 3b5520ae75..6bc612b5b7 100644
902636
--- a/hw/vfio/ccw.c
902636
+++ b/hw/vfio/ccw.c
902636
@@ -74,16 +74,9 @@ static IOInstEnding vfio_ccw_handle_request(SubchDev *sch)
902636
     struct ccw_io_region *region = vcdev->io_region;
902636
     int ret;
902636
 
902636
-    if (!(sch->orb.ctrl0 & ORB_CTRL0_MASK_PFCH)) {
902636
-        if (!(vcdev->force_orb_pfch)) {
902636
-            warn_once_pfch(vcdev, sch, "requires PFCH flag set");
902636
-            sch_gen_unit_exception(sch);
902636
-            css_inject_io_interrupt(sch);
902636
-            return IOINST_CC_EXPECTED;
902636
-        } else {
902636
-            sch->orb.ctrl0 |= ORB_CTRL0_MASK_PFCH;
902636
-            warn_once_pfch(vcdev, sch, "PFCH flag forced");
902636
-        }
902636
+    if (!(sch->orb.ctrl0 & ORB_CTRL0_MASK_PFCH) && vcdev->force_orb_pfch) {
902636
+        sch->orb.ctrl0 |= ORB_CTRL0_MASK_PFCH;
902636
+        warn_once_pfch(vcdev, sch, "PFCH flag forced");
902636
     }
902636
 
902636
     QEMU_BUILD_BUG_ON(sizeof(region->orb_area) != sizeof(ORB));
902636
-- 
902636
2.27.0
902636