From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGjpw-0007Q7-Vc for qemu-devel@nongnu.org; Sun, 19 Jul 2015 04:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGjpt-0005up-PV for qemu-devel@nongnu.org; Sun, 19 Jul 2015 04:20:40 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:51717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGjpt-0005sf-5I for qemu-devel@nongnu.org; Sun, 19 Jul 2015 04:20:37 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 19 Jul 2015 18:20:32 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id D6D6C3578048 for ; Sun, 19 Jul 2015 18:20:29 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6J8KJ9b65339464 for ; Sun, 19 Jul 2015 18:20:29 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6J8JtT4021834 for ; Sun, 19 Jul 2015 18:19:55 +1000 From: Alexey Kardashevskiy Date: Sun, 19 Jul 2015 18:19:30 +1000 Message-Id: <1437293970-6727-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH qemu] vfio_pci: Allow disabling quirks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alex Williamson 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 --- 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