qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH qemu] vfio_pci: Allow disabling quirks


From: Alexey Kardashevskiy
Subject: [Qemu-devel] [PATCH qemu] vfio_pci: Allow disabling quirks
Date: Sun, 19 Jul 2015 18:19:30 +1000

The existing quirks aim config space and MSIX BAR accesses interception.
These are not always needed, for example, on pseries machines,
config space and MSI/MSIX configuration are handled by hypervisor.

This adds a "quirks" property to control whether to enable quirks or not;
the property is set to "true" by default.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
---

Helps to get
VGA compatible controller: NVIDIA Corporation GM107GL [Quadro K2200] (rev a2)
(which does not need the quirk anyway) working on POWER8 system.
---
 hw/vfio/pci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2ed877f..ba47301 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -168,6 +168,7 @@ typedef struct VFIOPCIDevice {
     bool has_flr;
     bool has_pm_reset;
     bool rom_read_failed;
+    bool allow_quirks;
 } VFIOPCIDevice;
 
 typedef struct VFIORomBlacklistEntry {
@@ -2442,7 +2443,9 @@ static void vfio_map_bar(VFIOPCIDevice *vdev, int nr)
         }
     }
 
-    vfio_bar_quirk_setup(vdev, nr);
+    if (vdev->allow_quirks) {
+        vfio_bar_quirk_setup(vdev, nr);
+    }
 }
 
 static void vfio_map_bars(VFIOPCIDevice *vdev)
@@ -3753,6 +3756,7 @@ static Property vfio_pci_dev_properties[] = {
                     VFIO_FEATURE_ENABLE_REQ_BIT, true),
     DEFINE_PROP_INT32("bootindex", VFIOPCIDevice, bootindex, -1),
     DEFINE_PROP_BOOL("x-mmap", VFIOPCIDevice, vbasedev.allow_mmap, true),
+    DEFINE_PROP_BOOL("quirks", VFIOPCIDevice, allow_quirks, true),
     /*
      * TODO - support passed fds... is this necessary?
      * DEFINE_PROP_STRING("vfiofd", VFIOPCIDevice, vfiofd_name),
-- 
2.4.0.rc3.8.gfb3e7d5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]