Blame SOURCES/kvm-Disable-GeForce-quirks-in-vfio-pci-for-RHEL-machines.patch

9bac43
From 332f7a6f8dd4ee6fae95c87e717d4527ca9344a7 Mon Sep 17 00:00:00 2001
9bac43
From: Alex Williamson <alex.williamson@redhat.com>
9bac43
Date: Tue, 13 Feb 2018 19:04:56 +0100
9bac43
Subject: [PATCH 15/15] Disable GeForce quirks in vfio-pci for RHEL machines
9bac43
9bac43
RH-Author: Alex Williamson <alex.williamson@redhat.com>
9bac43
Message-id: <20180213190456.27565.18217.stgit@gimli.home>
9bac43
Patchwork-id: 78999
9bac43
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH v2 2/2] [RHEL] Disable GeForce quirks in vfio-pci for RHEL machines
9bac43
Bugzilla: 1508330
9bac43
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9bac43
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
9bac43
RH-Acked-by: Marcel Apfelbaum <marcel@redhat.com>
9bac43
9bac43
RHEL-ONLY - The GeForce quirks are primarily used to virtualize the
9bac43
various ways the driver and VGA BIOS has available to access PCI
9bac43
config space using alternate memory regions, ex. MMIO and I/O port.
9bac43
Generally these quirks are benign and even where not required, do not
9bac43
interfere with operation.  However, NVIDIA has a strange MSI behavior
9bac43
where the MSI interrupt will not re-trigger until the driver writes
9bac43
back to specifc addresses in config space via the MMIO mirror.  Since
9bac43
we virtualize the mirror for GeForce, every MSI interrupt requires an
9bac43
exit to QEMU to handle this MSI-ACK behavior.  For very high interrupt
9bac43
rate applications, such as NVIDIA's DolphinVS test program, this
9bac43
virtualization causes enough overhead to degrade the performance.
9bac43
9bac43
RHEL does not support GeForce assignment and supported configurations
9bac43
using Quadro, GRID, or Tesla assignment, including NVIDIA vGPU, do not
9bac43
require these quirks.  We can therefore disable these quirks by
9bac43
default, removing this overhead for supported configurations while
9bac43
still allowing unsupported configurations access to re-enable them
9bac43
via (equally unsupported) <qemu:args> options.
9bac43
9bac43
Upstream development is underway to mitigate this performance overhead
9bac43
even for GeForce, but preliminary results show that we can only
9bac43
achieve 95% of the performance of disabling the quirk entirely via an
9bac43
ioeventfd approach.  Obviously detecting GeForce vs Quadro would also
9bac43
be a useful approach, but there's no clear way to do this aside from
9bac43
scraping device descriptions from libpci.  Therefore, disabling
9bac43
GeForce quirks, with unsupported mechanisms to re-enable unsupported
9bac43
configurations, seems like the best approach for RHEL/RHV.
9bac43
9bac43
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 include/hw/i386/pc.h | 5 +++++
9bac43
 1 file changed, 5 insertions(+)
9bac43
9bac43
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
9bac43
index d1b1320..2b35ed8 100644
9bac43
--- a/include/hw/i386/pc.h
9bac43
+++ b/include/hw/i386/pc.h
9bac43
@@ -1002,6 +1002,11 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
9bac43
             .driver = TYPE_X86_CPU,\
9bac43
             .property = "host-phys-bits",\
9bac43
             .value = "on",\
9bac43
+        },\
9bac43
+        { /* PC_RHEL_COMPAT bz 1508330 */ \
9bac43
+            .driver = "vfio-pci",\
9bac43
+            .property = "x-no-geforce-quirks",\
9bac43
+            .value = "on",\
9bac43
         },
9bac43
 
9bac43
 #define PC_RHEL7_4_COMPAT \
9bac43
-- 
9bac43
1.8.3.1
9bac43