[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: Wed, 4 Oct 2023 14:07:53 -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=CoGLjzHo3oDBHjI78DIiWEFQWIppBzzWA6UMUCz/GH4=; b=m5WV/dGJZx8Sje9pyPjz2E+hZiCwEViM8VpJFdwmX5aUVSl6LeLplYh3OMBPYLPphl5Nlc0JhB84xV4o3VzGG2suXRvnW5MAzzBtrKlZFs6UHzw140NU/GkyoU9i1KO9o+R3BWRWqW3nXXycz2U6FET5kacq0pebR9JLdJ7XjxTbHvrnS1FgdSbapNvrxUtH2T9cVIiIVOsKOsLZnR6NhfVRalXG7ja2Pf/expEVjVqmrLJuwuwIWxcS3ur8fG29Yw5dgDqbRZ5NNoDjB1ULR7/1dCEimTm/OMOSgdKtKM6V8dj7A1tUzXvuLW8cenARIA9Goe0Vr6W68g844zc1YQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DXT3wynQHnCUdWwQgJh69eP9VFU3/TBJ4XCVgsEkv1j042KGqgK+ybtakkjHj7T/eY54xvpJgRzPR0rbpSmHgnufXuRCDBXAgJdfSH+m91m3OI/fn9cDIhA+e5jGtAIIDdChZXoD8drfcdNj3KSzLAV0Atn3A3yrC/gnEDmnOpyk0kZ9xWyB8zfkwB2lvJu5VTQcqagaeywp4xi0eQVkK5a4UqdzqngK692hnWbyEmJ6J3Qx+45V/x+dX1Ou/2KC4x0HCRKhnXR4iEfcqw9r7CrobIjGz3k2JAfJykDWU0uS0sP+fDrNyNVddeymGE4h1inpkwrJpAOul1Op7+x8qw==
  • 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: Wed, 04 Oct 2023 18:08:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/20/23 05:20, Julien Grall wrote:
> Hi,
> 
> On 18/07/2023 18:35, Stewart Hildebrand wrote:
>> 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.
> 
> Ok. To clarify, does this mean any DMA will fault, the same as for
> platform device?

Yes, when the PCI device is assigned to domIO, any DMA from the device will 
produce a SMMU fault. The value of the quarantine= option doesn't change this 
behavior.

>> 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.
> 
> I don't think we want to fully prevent a user to re-assign a device to
> dom0. But we at least want to avoid re-assigning the device to dom0 by
> default. After that a user can reset the device before it gets
> re-assigned to dom0.
> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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