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

[PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 13 Jun 2025 11:17:30 -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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9v0C6+RsIX+l4808sG+MpH7zRloooqS5T1YfefHTJCo=; b=FPCSPt2OxXLDxBoJ18EbZZy2ZXOGzdFHy3jzhS09Z5kZqKb4L+1en236eaDgs3QryMj5d9WH9UE1W7Efr3ADDle+akE8LNDCyWtEdZq4GBVgaubsu3/3oYR7VXaAR0ZZ5rHfBJHdDeKhob2QSOh6BU20WHgMk8uhAjbKiIMT2s3wJo9Dgtm1dOvqGBa4rvZ+7+PkwwE/HUjgcRsaO0S6Mec089vmemVZcrEaC2ldQcuWaxCS4wcJ/4QKAgDMDcZV5D58z+cviQ7mC3mmwrOwjB2mM8UP1bzfzT41kXF9fB00r/SdOJP+PLEEKQHSfesrmAzc0JPcnWqjmHgKUaEp4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UHE8QqG37/utkIBi5h2dNmoVDQK1juf9b9itrRCB/dSG0CDEedyUycxq2Qc18sNLvYbfRk7pBPEWO0w1uiGrA+1/L44wRVNeNLMV+3P7nVwCWysV0nEf+W53/YpLQeo8hf2nqF9zV5qBGH/klN7Za25BJ0lqDypBKw3+m59TvpGoRWrM9TAdKJGqo0zT79DzQovcMJnfvZqmGkXiSAmbfQV4sjWzXk3antB8BDt9xp6kP+VrdEVyPE1cs/BTlCUjNAYXjdd+qfXQRtZD5yGlivB3I6eaNyREI3hNKAu7jSDnUBKnMxWPHDcqH455ifxtpH9XmywP12TH1t5A9T8qJQ==
  • Cc: Rahul Singh <rahul.singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Delivery-date: Fri, 13 Jun 2025 15:49:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Rahul Singh <rahul.singh@xxxxxxx>

Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM,
even though the feature is not yet complete in the current upstream
codebase. The purpose of this is to make it easier to enable the
necessary configs (HAS_PCI, HAS_VPCI) for testing and development of PCI
passthrough on ARM, and to build it in CI.

Since PCI passthrough on ARM is still work in progress at this time,
make it depend on EXPERT.

Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
The alpine-3.18-gcc-arm64-randconfig CI job should pick up the new
config option, but if we wanted it to be built more consistently in CI
we could add CONFIG_PCI_PASSTHROUGH=y to one of the arm jobs in
automation/gitlab-ci/build.yaml, e.g. alpine-3.18-gcc-debug-arm64.

v7->v8:
* remove select HAS_VPCI as HAS_VPCI_GUEST_SUPPORT already does so
* move select HAS_PCI to HAS_VPCI in common
* move remaining selects under config ARM_64
* add HAS_PASSTHROUGH
* remove "default n" since it is redundant

v6->v7:
* rebase
* send patch separately from series [3]
* add HAS_VPCI_GUEST_SUPPORT since it's upstream now
* drop Julien's A-b due to changes and was given several releases ago

v5->v6:
* no change

v4->v5:
* no change

v3->v4:
* no change

v2->v3:
* add Julien's A-b

v1->v2:
* drop "ARM" naming since it is already in an ARM category
* depend on EXPERT instead of UNSUPPORTED

Changes from downstream to v1:
* depends on ARM_64 (Stefano)
* Don't select HAS_VPCI_GUEST_SUPPORT since this config option is not currently
  used in the upstream codebase. This will want to be re-added here once the
  vpci series [2] is merged.
* Don't select ARM_SMMU_V3 since this option can already be selected
  independently. While PCI passthrough on ARM depends on an SMMU, it does not
  depend on a particular version or variant of an SMMU.
* Don't select HAS_ITS since this option can already be selected independently.
  HAS_ITS may want to be added here once the MSI series [1] is merged.
* Don't select LATE_HWDOM since this option is unrelated to PCI passthrough.

[1] 
https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commits/poc/pci-passthrough
[2] https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg00660.html
[3] 
https://lore.kernel.org/xen-devel/20231113222118.825758-1-stewart.hildebrand@xxxxxxx/T/#t

(cherry picked from commit 9a08f1f7ce28ec619640ba9ce11018bf443e9a0e from the
 downstream branch [1])
---
 xen/arch/arm/Kconfig | 8 ++++++++
 xen/drivers/Kconfig  | 1 +
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 3f25da3ca5fd..95a2cd3d006d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -8,6 +8,8 @@ config ARM_64
        depends on !ARM_32
        select 64BIT
        select HAS_FAST_MULTIPLY
+       select HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH
+       select HAS_PASSTHROUGH if PCI_PASSTHROUGH
 
 config ARM
        def_bool y
@@ -258,6 +260,12 @@ config PARTIAL_EMULATION
 
 source "arch/arm/firmware/Kconfig"
 
+config PCI_PASSTHROUGH
+       bool "PCI passthrough" if EXPERT
+       depends on ARM_64
+       help
+         This option enables PCI device passthrough
+
 endmenu
 
 menu "ARM errata workaround via the alternative framework"
diff --git a/xen/drivers/Kconfig b/xen/drivers/Kconfig
index 20050e9bb8b3..d42314bb1904 100644
--- a/xen/drivers/Kconfig
+++ b/xen/drivers/Kconfig
@@ -14,6 +14,7 @@ source "drivers/video/Kconfig"
 
 config HAS_VPCI
        bool
+       select HAS_PCI
 
 config HAS_VPCI_GUEST_SUPPORT
        bool

base-commit: 229a11aac7bf52f4532ab732ed10f173bd332cd0
-- 
2.49.0




 


Rackspace

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