[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no
- To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
- Date: Mon, 28 Apr 2025 12:31:26 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- 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=YSfS/nSVwbcHXz+/paH3aLyOFemEgtrEVVHwb3u4g40=; b=bu5OJMb3979EHZ+2bnxarEAToRKU01xQoWv6DyNJFB35w8XGVqkoLSalsQSUVFg4dTaY5OHF9moMFepyXxx7uG3OsV/lxd1K6AcArkK0EkTWlyf6cbgdgtvw0UBwxl64pIFeSCwSvueh80g0HZeWUFaoxGd85ePQMH8a006lLsceqRvtQPZLwYpZgEgtSx9zE33apE4CJ0rijWBkfjY3pIZxU8Y10l4j1wzg5OvoylpDq8YkvKpiZnX5Vv/l4OfODyjTXjAJ8XtPeXYkS+mpEaoJWFqnFlXP16dbptnodQ2km08jWX/BHdTMymhTcK6CPlUlaCON7F0r6jHRpOShBg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iIOoD2UFsRRgGS1K/hO4fYaKrBbE3kTMxSqp2+KX/ZoEhO3rfHVQVKkdpJbtVLbauqfd/yz+zMEkLu8Dhj/ZJGZx9nlP+GkTheE8qeh177sTiEWWFnFNp0TdoqGn1OCB528m1GFTOZe1DLaUoXWRHL8M08fWU6Dp3RROBqvlCaOzVuvegSO8TIVz7ZyFF4ojx4v8Pn18FuS1kPyCj/XsKKuLGduPlH/M2v+fSX1kjPmMI0NrW+GyaaunMG25N3Bs7epYTGuOsVatwyiyPvhD1MPNWIgO6MBtYegNVnLH6U0+2xX9MoiO0Zok4JrF8CHTKyhY3D4mqVovUxb+Fr3BGg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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>
- Delivery-date: Mon, 28 Apr 2025 12:31:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHblOXdxbIbbkNtn0WSg/9tW2OJ47O5DGKAgAA8u4A=
- Thread-topic: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no
On 28.04.25 11:54, Julien Grall wrote:
> Hi Mykyta,
>
> On 14/03/2025 13:34, Mykyta Poturai wrote:
>> From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>>
>> Enable the use of IOMMU + PCI in dom0 without having to specify
>> "pci-passthrough=yes". We rely on dom0 to initialize the PCI controller
>> and perform a PHYSDEVOP_pci_device_add call to add each device to SMMU.
>
> It would be good to explain why Xen cannot initialize the PCI
> controller. Asking, because the reason is the PCI controller is too
> complex, then you will likely need the same approach for PCI passthrough...
I think the main reason for this is complexity and the possibility of
additional dependencies: there could be external clocks or reset pins
that the PCI host depends on for working correctly. I will add this to
the commit message. Regarding PCI passthrough, it is already using the
same approach (at least on Arm). There are patches for enabling Xen on
Arm to perform bus enumeration by itself by Luca Fancellu, but I haven't
yet got to test them in a meaningful way.
>>
>> Enable pci_init() for initializing Xen's internal PCI subsystem, and
>> allow PHYSDEVOP_pci_device_add when pci-passthrough is disabled.
>
> Effectively, wouldn't this mean dom0 always *have* to call
> PHYSDEVOP_pci_device_add? Otherwise, how would dom0 know whether it
> needs to call PHSYDEVOP_pci_device_add?
>
> Cheers,
>
Yes, I can't say for every system but with PCI host behind SMMU the
PHYSDEVOP_pci_device_add call is required to use DMA.
--
Mykyta
|