From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZk7s-0008Ue-Ai for qemu-devel@nongnu.org; Wed, 09 Sep 2015 14:29:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZk7o-0004ef-7w for qemu-devel@nongnu.org; Wed, 09 Sep 2015 14:29:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZk7o-0004dp-0R for qemu-devel@nongnu.org; Wed, 09 Sep 2015 14:29:40 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 41ABAC0AD288 for ; Wed, 9 Sep 2015 18:29:39 +0000 (UTC) From: Alex Williamson Date: Wed, 09 Sep 2015 12:29:38 -0600 Message-ID: <20150909180219.8470.68096.stgit@gimli.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 00/17] vfio: quirks & tracing refactoring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex.williamson@redhat.com Cc: qemu-devel@nongnu.org This series aims to do a few things: - Improve tracing support in vfio, especially the ability to isolate tracing to various features, like INTx, MSI, MSI-X, quirks, specific quirks, etc. There's more to do here, but this is an improvement. - Split quirks out of the core vfio-pci code. They're too large, they need to be separated. - Make quirks more maintainable and extensible. In the past, I tried to make a common quirk interface but the commonality was pushed too high resulting in a shared data structure that didn't make sense for most of the users. This version still provides sufficient commonality for shared teardown, but doesn't impose a data struct on memory region ops. - Make better use of MemoryRegions. We can use more than a single MemoryRegion for each quirk, simplifying the ops callbacks to handle the behavior of only a single register. For instance data and window registers can make use of two MemoryRegions. - Eliminate target page size dependencies in quirks. Some of these must have been to work around bugs in previous generations of the memory API, some were just for convenience. We don't need to setup quirks on target page boundaries, that's the memory API's problem. We don't need to save bits and assume page alignment in the quirks, we're better off using structure specific to our quirk ops and trimming out unused features. - Eliminate build-time debugging and tunables. Interrupt setup is slow path, so we're not saving anything by requiring a rebuild to not use the KVM interrupt path. Make these all experimental (aka unsupported) options that are available for debugging and tracing. Also fix the polarity of x-mmap and rename to x-no-mmap. Backend drivers shouldn't need to expose this unless they want the tracing ability and I've seen users specify it because mmap sounds like something they'd want. Beyond the standard testing I've done, using a variety of devices and configurations that rely on the quirks, I've received testing feed back from several users on the vfio-users mailing list who have reported no regressions. Comments and review welcome. Thanks, Alex PS - this series applies on top of 2.4 + "vfio/pci: Cleanup RTL8168 quirk and tracing" + "vfio/pci: Cleanup vfio_early_setup_msix() error path". Both of these are in my local next branch but haven't been pushed for 2.5 yet. --- Alex Williamson (17): vfio/pci: Rename INTx functions for easier tracing vfio/pci: Rename MSI/X functions for easier tracing vfio/pci: Make interrupt bypass runtime configurable vfio: Change polarity of our no-mmap option vfio/pci: Extract PCI structures to a separate header vfio/pci: Split quirks to a separate file vfio/pci: Cleanup ROM blacklist quirk vfio/pci: Foundation for new quirk structure vfio/pci: Cleanup ATI 0x3c3 quirk vfio/pci: Cleanup Nvidia 0x3d0 quirk vfio/pci: Rework RTL8168 quirk vfio/pci: Config window quirks vfio/pci: Config mirror quirk vfio/pci: Remove old config window and mirror quirks vfio/pci: Move AMD device specific reset to quirks vfio/pci: Cache vendor and device ID vfio/pci: Add emulated PCI IDs hw/vfio/Makefile.objs | 2 hw/vfio/common.c | 2 hw/vfio/pci-quirks.c | 1204 ++++++++++++++++++++++++++++++++++++ hw/vfio/pci.c | 1385 ++++------------------------------------- hw/vfio/pci.h | 159 +++++ hw/vfio/platform.c | 2 include/hw/vfio/vfio-common.h | 7 trace-events | 85 +-- 8 files changed, 1546 insertions(+), 1300 deletions(-) create mode 100644 hw/vfio/pci-quirks.c create mode 100644 hw/vfio/pci.h