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

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