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

Re: Proposal for virtual IOMMU binding b/w vIOMMU and passthrough devices


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 28 Oct 2022 14:37:27 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=YWfkTYsuJ5wbGQNDnH4LWt7X0jxKxnQ63RSEO4E52ng=; b=ajcps4fbtJIMZXsQtlwc7k70oL7nvvVNAvJqG5I8zWIcDl5SCO+kRD/llPIWe0/CqkCSilcvHVAhcY4gZbjE0ZPk5P8opd6wNdQ2AifCFyISD29lVBahNXciUAvnMemEa8mK3TBJQrlUMLTepFw9xIap7pM6KUmyVkwgieMJAElHt5v91cNLO1s31AXPDtIcASnh8k8rYrOlPlTSXuVc+qvZCxR4Rc40wzK20OGZjzDqMiP0x9cz4S4y5TC97KoxLlhNiOzl9/0/euH37VkFmskCxz4bSdRbLVDqE0vSL/fg78YltPnbuY2YThhi+negqYA5sUfIEoH0Llgx+qlBoA==
  • 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=YWfkTYsuJ5wbGQNDnH4LWt7X0jxKxnQ63RSEO4E52ng=; b=AO8YaQu4TqL4LwLLfNvw8TZnJw/XwZMiVxKu/r642kWwxFioMLigHS23In2ssLJ6YrlKPmvHD7ciSD9TuHDlmkE7kerJ0UgSLihDSRggTkhnpIkA4S7xkkBFcsgIlUbUAdFM1B6ESPMiK0Q0QeSR/Wkx6chcoAbev4eI7RYWhQEy8WOzzV90nadStLVxDDXXAu4zI70agO/RUyhJHOdGpfD146uiTUDUjVqpkPHVtUJF3wkP0lPta541dTg7UuneE72nEdJKpVNe0q8kbqRe+USbc5VrhNr/lP8gcozQKqCYx5GHqfzp/0qc7+Zw10N0EJxqoO7UlCQ3O1SLBkifhg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KjfBU9iAHsrpl3NmGUlYNF0xABg8G/jDOXuIWCpBjn/oMdbUXm/egz63yYg1xrYcLAVORCjS78ySn+A4vfA91CK9KTe57Hy77oIodR3stz4f1hVZqciHWCQQlHGmm9jurEeZGnmmxbW+pB8Mp70XiyX808yBQ13jB9CksAMFcclDkxE7V8sdPMcPJKKhX8TBhmykJoITU50YvtZwFGvh1WdGkJ2TI669JHHtM/bxxwo1VK8RXqDN7mK7fz/4ua24E374i1x365cCJi6gaMnQZvSaT6BP5IkBVFRroDL9q0bpIaan+JIxwsLu5fYOVTNB5ttyQoNCbQIA8FEHgvteyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7nKfWeFZOeG9ROq19MS8yH1vRG5N6riAn7zCNvjjSEiVYyMzDjykmTGJcxJkyPYkDlD7NVfDAaL2exo1FQS3di1XNJE9HIxqAKrTsJY0nG6VlpMYGIK6U9zHABgGXz2EbP4J927Mn2Y8IwWyWkeQmaIeMoubTV9aJyVUo5MBipYMzlKKo0VwibYPLcAI9WVAb1sXB1464Vq13oGHOFXAPNNcTGgWYD+NtlBUFRlnAr3ewJZnfLpq92zPIu5nULpaHAyCbf7kSOV0hiRi30nXr39gtu6oC+K+q5K4EW4Y+n3FEncnkrnQEwKxbBiXlT74iuco/C/0F7SgIKAZbtaMg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Rahul Singh <Rahul.Singh@xxxxxxx>, Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <Michal.Orzel@xxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 28 Oct 2022 14:38:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHY6T1V+gcJbmRqpEyt0b8GeG9bFq4grXIAgAAQCACAAFf9AIABVMyAgAAG64CAAVVJgIAAAzuAgAACBwCAAAPNgIAAE5mA
  • Thread-topic: Proposal for virtual IOMMU binding b/w vIOMMU and passthrough devices

Hi Julien,

> On 28 Oct 2022, at 14:27, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 28/10/2022 14:13, Bertrand Marquis wrote:
>> Hi Julien,
> 
> Hi Bertrand,
> 
>>> On 28 Oct 2022, at 14:06, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi Rahul,
>>> 
>>> On 28/10/2022 13:54, Rahul Singh wrote:
>>>>>>>>> For ACPI, I would have expected the information to be found in the 
>>>>>>>>> IOREQ.
>>>>>>>>> 
>>>>>>>>> So can you add more context why this is necessary for everyone?
>>>>>>>> We have information for IOMMU and Master-ID but we don’t have 
>>>>>>>> information for linking vMaster-ID to pMaster-ID.
>>>>>>> 
>>>>>>> I am confused. Below, you are making the virtual master ID optional. So 
>>>>>>> shouldn't this be mandatory if you really need the mapping with the 
>>>>>>> virtual ID?
>>>>>> vMasterID is optional if user knows pMasterID is unique on the system. 
>>>>>> But if pMasterId is not unique then user needs to provide the vMasterID.
>>>>> 
>>>>> So the expectation is the user will be able to know that the pMasterID is 
>>>>> uniq. This may be easy with a couple of SMMUs, but if you have 50+ (as 
>>>>> suggested above). This will become a pain on larger system.
>>>>> 
>>>>> IHMO, it would be much better if we can detect that in libxl (see below).
>>>> We can make the vMasterID compulsory to avoid complexity in libxl to solve 
>>>> this
>>> 
>>> In general, complexity in libxl is not too much of problem.
>> I am a bit unsure about this strategy.
>> Currently xl has one configuration file where you put all Xen parameters. 
>> The device tree is only needed by some guests to have a description of the 
>> system they run on.
>> If we change the model and say that Xen configuration parameters are both in 
>> the configuration and the device tree, we somehow enforce to have a device 
>> tree even though some guests do not need it at all (for example Zephyr).
> 
> I think my approach was misunderstood because there is no change in the 
> existing model.
> 
> What I am suggesting is to not introduce iommu_devid_map but instead let 
> libxl allocate the virtual Master-ID and create the mapping with the physical 
> Master-ID.
> 
> Libxl would then update the property "iommus" in the device-tree with the 
> allocated virtual Master-ID.

Ok I understand now.

> 
> Each node in the partial device-tree would need to have a property
> to refer to the physical device just so we know how to update the "iommus". 
> The list of device passthrough will still be specified in the configuration 
> file. IOW, the partial device-tree is not directly involved in the 
> configuration of the guest.

But we will generate it. How would something like Zephyr guest work ? Zephyr is 
not using the device tree we pass, it has an embedded one.

> 
> So far, I don't see a particular issue with this approach because the vMaster 
> ID algorithm allocation should be generic. But please let me know if you 
> think there are bits I am missing.

I am a bit afraid of things that are “automatic”.

For everything else we let the user in control (IPA for mapping, virtual 
interrupt number) and in this case we switch to a model where we automatically 
generated a vMaster ID.
With this model, guest not using the device tree will have to guess the vMaster 
ID or somehow know how the tools are generating it to use the right one.

Cheers
Bertrand


> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

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