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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 12 Jun 2025 11:18:07 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=PpmyO498KurqBMzpZ40/Dzk/cJ1/+tNzBSoGHX+GDcg=; b=y09Z1/v5PXySqBQcjL/48kpKW6Za4d5M1eaK/gUxnoCcNd4noHVhLGz37cNHQiQZJkGF6zkUCUZWKCKEF6z4fSBU6Z0LgXppIeX2Uh7J+nNQnADdBVGaPUoy9bugRG1ZMWoRw8zWeQcFLP2H/WQO1XBfxGctveusIJG1PBJ9RJrY3yUQpCDiZyhI/HtGTa02fX95E4m1Ib+zCi8OheU/v5Z4tNbGbPNPS9wPowhixS0WGucpFdHzTeZw637T4OmwIaLe3DaaFze25/NfeCD56cHuHeiFkwvEUBaQcWcNPIc/JImd44azd2S2u0mDxjCpRn6gc0ZwUUNnHNKvW4heAA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Nx2yWgqeEZX7HyFQbtvxhcNDeqfhPyVPu56EQGkSBr50zxW6/0cyaoz64TD4ENA0MrVFu6CllLaiVymkNr+I87dB61D17CoaOtTGYMkcHctczA03t4WtUCj5I843flvTVg+0sT0MHFkonqYQaKsg5n+DuVJ0QzXfUEf/w+gQPwVBX3TsccEKuaJK6xDyxEeAPuTfqc797pNaZ62ei0bIQIT4K+6fxVVzxAEFXgk1vhxUmpt2EpaxbrKOIieEdP4BHp8YD9dAHG4RdzLoa2DaQw2Hx6VCEhuOCDAt3oXSga6ppYnSpV+NH7Tmq0dz4BcKSVn5GBCTjwlxkeRm913uVg==
  • 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Stefano Stabellini" <stefano.stabellini@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 12 Jun 2025 15:18:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 6/12/25 10:58, Jan Beulich wrote:
> On 12.06.2025 15:39, Stewart Hildebrand wrote:
>> On 6/11/25 01:23, Jan Beulich wrote:
>>> On 10.06.2025 19:46, Stewart Hildebrand wrote:
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -258,6 +258,16 @@ config PARTIAL_EMULATION
>>>>  
>>>>  source "arch/arm/firmware/Kconfig"
>>>>  
>>>> +config PCI_PASSTHROUGH
>>>> +  bool "PCI passthrough" if EXPERT
>>>> +  depends on ARM_64
>>>> +  select HAS_PCI
>>>> +  select HAS_VPCI
>>>> +  select HAS_VPCI_GUEST_SUPPORT
>>>
>>> What about HAS_PASSTHROUGH? Seeing that being selected by MMU, what about
>>> that connection here?
>>
>> Hm, yes. I'm not sure if depends or select would be better?
>>
>>      depends on ARM_64 && HAS_PASSTHROUGH
>>
>> or
>>
>>      select HAS_PASSTHROUGH
> 
> Actually, thinking of it: HAS_* shouldn't be selected based on user choices,
> imo. Perhaps unless the HAS_* is a sub-feature of the dependent (as in e.g.
> "select HAS_VPCI if HVM" as we have it for x86). In which case all the
> select-s here might be wrong to use.

How about something like this:

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..0c376704ddc9 100644
--- a/xen/drivers/Kconfig
+++ b/xen/drivers/Kconfig
@@ -13,6 +13,7 @@ source "drivers/pci/Kconfig"
 source "drivers/video/Kconfig"
 
 config HAS_VPCI
+       select HAS_PCI
        bool
 
 config HAS_VPCI_GUEST_SUPPORT



 


Rackspace

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