From patchwork Sun Jul 19 08:19:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 497449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C43D7140DC3 for ; Sun, 19 Jul 2015 18:21:03 +1000 (AEST) Received: from localhost ([::1]:50751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGjqE-0007gc-IJ for incoming@patchwork.ozlabs.org; Sun, 19 Jul 2015 04:20:58 -0400 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 d23dlp03.au.ibm.com (202.81.31.214) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 19 Jul 2015 18:20:30 +1000 X-Helo: d23dlp03.au.ibm.com X-MailFrom: aik@ozlabs.ru X-RcptTo: qemu-devel@nongnu.org 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 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t6J8Jt5U021662; Sun, 19 Jul 2015 18:19:55 +1000 Received: from bran.ozlabs.ibm.com (unknown [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 97395A01B7; Sun, 19 Jul 2015 18:19:31 +1000 (AEST) Received: from ka1.ozlabs.ibm.com (ka1.ozlabs.ibm.com [10.61.145.11]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 7CC67E38E6; Sun, 19 Jul 2015 18:19:31 +1000 (AEST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Sun, 19 Jul 2015 18:19:30 +1000 Message-Id: <1437293970-6727-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.4.0.rc3.8.gfb3e7d5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15071908-0033-0000-0000-000001CF3671 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.142 Cc: Alexey Kardashevskiy , Alex Williamson Subject: [Qemu-devel] [PATCH qemu] vfio_pci: Allow disabling quirks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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),