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

[PATCH v8 0/2] vPCI capabilities filtering


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 28 Nov 2023 14:44:23 -0500
  • 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 (0)
  • 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=5uXUlNdzuoy+V/xqdDmeP61vCOVi61BDWDYruLA5SG8=; b=AVZdU1awjtdECQM7TZTr5j5W0TsdeL+xD03chLgxi+jiASa41z0KyDOwg0QZEf4kzRaw28BgSU6RBQXfAUFGDio2gzhs7o7ZVCXbao4ktWbngMYh8GpiBD3rRnghFEKpXOnsHftdY8TB3eVjQ65PqpB4WPB0kXYmuGpyzs6/SDQrtYRsHMRXqdQCwKQpVptx74jM5R/u25v5yFXkhN8xIK5N4rU1vpx4X1knslzptZrsiTUDroNFmMRmSeujJ/VgY9GIjL1Z3f6V+rypTtGo/mIydcJL7Y+vSwpaV610sIIF/78migWEa5EPGD23xstCLaKcfFAk4eTwDSSdqt8xiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XNyuvkqtH+RyK2xAiYftmGIJ5/93Odjh95wR8YpF56Tkj/s5W9GLAtCaiIwQOgQl4R7Il+3GsD3gY0l330edXnoMa29SlJ9+xaUqks2OckNPfmD9L4RRjrCu1gicNKftonzeyzFNuMxas/c6lGNJL6KCSL0SzEr2vvtYEhux+cNlg5Kp4W42jdR1fm23fBV2c9xa5nB7NYOGIoDTvvBVE8TseD46vscAf0Y4IN1vvsCQDna9GarI6S/W47kntvurP+dd9E6QNK6z8TarwpudRMCWZJZNisgIshe9/aB04FXCXweA1nUlUBA85YGVXh9+lyMYg+qiJ83VPrHHBIUdkQ==
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 28 Nov 2023 19:45:00 +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.

v7->v8:
* address feedback

v6->v7:
* address feedback in ("xen/vpci: header: status register handler")
* drop ("xen/pci: convert pci_find_*cap* to pci_sbdf_t") and
  ("x86/msi: rearrange read_pci_mem_bar slightly") as they were committed

v5->v6:
* drop ("xen/pci: update PCI_STATUS_* constants") as it has been committed

v4->v5:
* drop ("x86/msi: remove some unused-but-set-variables") as it has been
  committed
* add ("xen/pci: update PCI_STATUS_* constants")
* squash ro_mask patch

v3->v4:
* drop "xen/pci: address a violation of MISRA C:2012 Rule 8.3" as it has been
  committed
* re-order status register handler and capabilities filtering patches
* split an unrelated change from ("xen/pci: convert pci_find_*cap* to 
pci_sbdf_t")
  into its own patch
* add new patch ("x86/msi: rearrange read_pci_mem_bar slightly") based on
  feedback
* add new RFC patch ("xen/vpci: support ro mask")

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-08/msg02361.html

Stewart Hildebrand (2):
  xen/vpci: header: status register handler
  xen/vpci: header: filter PCI capabilities

 tools/tests/vpci/main.c    | 98 ++++++++++++++++++++++++++++++++++++++
 xen/drivers/pci/pci.c      | 31 ++++++++----
 xen/drivers/vpci/header.c  | 75 +++++++++++++++++++++++++++++
 xen/drivers/vpci/vpci.c    | 74 +++++++++++++++++++++++-----
 xen/include/xen/pci.h      |  3 ++
 xen/include/xen/pci_regs.h |  9 ++++
 xen/include/xen/vpci.h     | 14 ++++++
 7 files changed, 282 insertions(+), 22 deletions(-)


base-commit: 18540a313cc66a04eb15a67d74c7992a8576fbec
-- 
2.43.0




 


Rackspace

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