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

Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 18 Jul 2023 13:35:25 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.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=MJKJwh24mPX1Bkhjmep1b5yYgJ1BO09AW7Zvfylv77A=; b=kQ/HWuDdeBjorOgrja51CdcvM1ZO2aJuUlSBxiIN36RrQuPEVi1JwzAJQ/Tat+WDM5ZoRbUQmJFDmYz9raWF5H+cV3ZwOwInRY+AGCNF4Nq2GfA7FvQH2dKj0rH0Pe5zlUxAN1N0MQnoH1aECT5ub09sjGUcF/gPuIO+8AmFlvJexo/3gofdaUJc2d7S/GhxOsDxp0EaBDa3v6ujG9UmjTBph1B/49QVIP2vLoCDoLKcql6UVH+Qr7bRPRejlLHwSKaPoHHQcFHtLJfoQrzuLOXgJosSwCXxQO4fE9eGRn6yIXseq7LirjxTo4A4EHi069pXekqehDDwTzWcll/Vag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ns+jQAxs0q+y8eAbKZAM8YaqFXuyrUpQDZnXzk79zTsovlxXXTV//fHJfZDDUVRPPEAkOtfyz2KiV8S48IC+MFZJ+8kRfAWDeU+HlzSaKKFSXeUI0v3dJAMwDTP3Jk1euVoFOQ/iisWFXSlPS/UeICoa8ttNLbVyl/5FY/rI6qLEMYBh4nDv6+m5Bxu1fXlP7X4EV4RoaXzpckH1y1dl3sJFhWyKfVVj570lJ5DhcXPLlNnUZkIqcybqe4pl4+qOcfoGEksbbbTm15QoUSSMNSl/RBDPBVljJibXzio96i9p9yOnPPA36k2Ez+HyPoa6+7YvZPx1WDqc/6HukqLk9A==
  • Cc: Rahul Singh <rahul.singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Artem Mygaiev <artem_mygaiev@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Tue, 18 Jul 2023 17:35:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/13/23 14:40, Julien Grall wrote:
> Hi Stewart,
> 
> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>> 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.
>>
>> Since PCI passthrough on ARM is still work in progress at this time, make it
>> depend on EXPERT.
> 
> While preparing the patch for committing, I noticed that HAS_PASSTHROUGH
> will now allow the user to select one of the IOMMU quarantine options.
> 
> There are three of them right now:
>   1. none
>   2. basic (i.e. faulting)
>   3. scratch page
> 
> The latter is unlikely to work on Arm because we don't setup the scratch
> page. AFAIU, for that, we would need to implement the callback
> quarantine_init().
> 
> I would expect 1 and 2 work. That said, I think 1. would behave like 2.
> because on Arm the device should not be automatically re-assigned to
> dom0. I know this is correct for platform device, but will it be valid
> for PCI as well?

In a system with dom0 where the guest is created from the xl toolstack, we rely 
on "xl pci-assignable-add". Upon domain destruction, the device automatically 
gets assigned to domIO. However, there's nothing preventing a user from 
attempting to invoke "xl pci-assignable-remove", which should assign the device 
back to dom0, but it is not automatic.

With dom0less, PCI devices are not deassigned from the domU.

> Overall, before enabling HAS_PASSTHROUGH, I think there would be a bit
> of tweaking necessary to at least prevent a user to select the option 3
> (either via Kconfig or the command line). And possibly update the
> Kconfig for IOMMU_QUARANTINE to reflect the behavior on Arm.

OK



 


Rackspace

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