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

[PATCH v3 0/4] vPCI capabilities filtering


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Mon, 21 Aug 2023 21:29:48 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VL6lMQVeMDc9PDrdGemq8BetWEBzdrBiDPf1TKvHKwo=; b=n34YAKLAvY/z7MH9KQW1D1+65RO62aCdcuayRxq/3ZpyGO3GXAkswRURaQII27jH2176CC0HtWElriDZnWBvmuqFEqVrEpvQWOvNMXTaGWQ5F+4dBhY0LgCAAaM53UWMgggFlSCILDof94lxDP7AM8936RkfU2ffSDbu5hUpJID/u7z+p8iOqdAAADfQQRm7yFbz5mYd55lGraj6D5nv4ELgD6Bkg3AFCX+V/SD+10MQ5yEhUpRO8OZQhX7KvtwvGVXga8PL+e2+TRAUpwaNwpdPFqJooqCYetDBRfBccRB9AuvErXFgmCMjYUWcrUJk37PtkHVTWwCd7iPkMn8Opw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MP0zm67+1B4m35uORS/grVn/DkDd8FJeh/nsU2MVb9nFeuBO4CFZXXbAJK9xEjxiTLf5Zqi3eLlg3mpYmSG1wdhRs6PfJYSkNjJIEqagJpBzIy5t5PL82xo8glOTIWiCbOcT/7bmGR8R4M8GKxDc4y4FEMXLyLobp4vJPyck1rCYdSBh1fxr1DMweFTwLS4bxUX6ofBmWRlyq94wtZgvt1c1gO/zvTLCYSQs9k+exSeZ5Z4BLl/Y9vHetkecJ5Ervk+++uqO+bWdOURZIynh+IheyMF1OwiXWvf5XQjwtKZrTcAdj1A0baCnHO7N5KVhisMJi07XEjWzE/e8mhCCfw==
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 22 Aug 2023 01:30:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This small series enables vPCI to filter which PCI capabilities we expose to a
domU. This series adds vPCI register handlers within
xen/drivers/vpci/header.c:init_bars(), along with some supporting functions.

Note there are minor rebase conflicts with the in-progress vPCI series [1].
These conflicts fall into the category of functions and code being added
adjacent to one another, so are easily resolved. I did not identify any
dependency on the vPCI locking work, and the two series deal with different
aspects of emulating the PCI header.

Future work may involve adding handlers for more registers in the vPCI header,
such as VID/DID, etc. Future work may also involve exposing additional
capabilities to the guest for broader device/driver support.

v2->v3:
* drop RFC "xen/vpci: header: avoid cast for value passed to vpci_read_val"
* minor misra C violation fixup in preparatory patch
* switch to pci_sbdf_t in preparatory patch
* introduce status handler

v1->v2:
* squash helper functions into the patch where they are used to avoid transient
  dead code situation
* add new RFC patch, possibly throwaway, to get an idea of what it would look
  like to get rid of the (void *)(uintptr_t) cast by introducing a new memory
  allocation

[1] https://lists.xenproject.org/archives/html/xen-devel/2023-07/msg01281.html

Stewart Hildebrand (4):
  xen/pci: address a violation of MISRA C:2012 Rule 8.3
  xen/pci: convert pci_find_*cap* to pci_sbdf_t
  xen/vpci: header: filter PCI capabilities
  xen/vpci: header: status register handler

 xen/arch/x86/msi.c                         | 47 +++--------
 xen/drivers/char/ehci-dbgp.c               |  3 +-
 xen/drivers/passthrough/amd/iommu_detect.c |  2 +-
 xen/drivers/passthrough/ats.c              |  4 +-
 xen/drivers/passthrough/ats.h              |  6 +-
 xen/drivers/passthrough/msi.c              |  6 +-
 xen/drivers/passthrough/pci.c              | 20 ++---
 xen/drivers/passthrough/vtd/quirks.c       | 10 +--
 xen/drivers/passthrough/vtd/x86/ats.c      |  3 +-
 xen/drivers/pci/pci.c                      | 50 +++++++-----
 xen/drivers/vpci/header.c                  | 93 ++++++++++++++++++++++
 xen/drivers/vpci/msi.c                     |  4 +-
 xen/drivers/vpci/msix.c                    |  4 +-
 xen/drivers/vpci/vpci.c                    | 53 +++++++++---
 xen/include/xen/pci.h                      | 11 ++-
 xen/include/xen/vpci.h                     | 14 ++++
 16 files changed, 221 insertions(+), 109 deletions(-)


base-commit: 3fae7c56b313a12288a05e0a8c14c47bfd4dc40e
-- 
2.41.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.