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

Re: [PATCH 10/11] xen/arm: Do not map PCI ECAM space to Domain-0's p2m


  • To: Julien Grall <julien@xxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Fri, 10 Sep 2021 14:38:17 +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=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2s9lAzxIwaxbTgLX1SzEKlDX5hXwILM8bu2ZRILhYJA=; b=OMiy6lP1acndZqDnX88C/QS0heeNFpWvGWmgSAJCn18j3FNIQMV8fl63gAm3ZOfo8LfCn1ys6MdY+sZ/uen54ElwvaqkuodM4VBjmkNgpavwDRkMKlvXxGxufhAvO0KOcsSwrKZQbPLnRoAjuCWfFFIc0l+iez/DZDpg9HyQ8KFN6jDEKKlQIj/nmawYE4Xod3pFRU1O/agYa4ysw3FWsK3kywZwayHKZfkCNjUlovCjfPMWxdXq975yprkdZCrMy58vZEvpjrxr46SLyNHQT7Zd7QmWHbl0ODNieCkEbsQE+h9w2emDwY0ZBie9SM+1EWCzDO007yUNM5NOEFMKOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gGdxlPU4yzrr6ZF3rl2eQEvoK+tdVCD/st6CBuEYRSyF/348w5w/+mFEH7TE/s4cHevCoD8eUDPsYu5APeHHc5D4xgu/N6ra6o6idhnx6s6e6ihf22TCLh43p98/xpwUT8/1nwoE3V4/L6mLHIxULCzbcalPAL4eDxlv4mSri9N0f/D8wpQWmAUjx0q1bEi7FH11Z3uKKBZsjOx3JRb51nQIk0KvB9EahD5q4T9BqAkvlJ+bCRtp9tqa1WromnG/h5q+FGAKMKfVKRKJ6U2hI/M7DKMltzDUDq1V5GOvCcHAWL1PErp4pbfdFwjZS0Mw9j03/f7wiu+Q//S4VwibNw==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=epam.com;
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>
  • Delivery-date: Fri, 10 Sep 2021 14:38:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXoJ50hf+zXQhc2ka7YfmmERKX+aucB06AgAE4wYCAAAtRgIAADDiAgAAEjQCAAAWagA==
  • Thread-topic: [PATCH 10/11] xen/arm: Do not map PCI ECAM space to Domain-0's p2m

[snip]


>>> What do you mean by "used by Domain-0 completely"? The hostbridge is owned 
>>> by Xen so I don't think we can let dom0 access any MMIO regions by
>>> default.
>>
>> Now it's my time to ask why do you think Xen owns the bridge?
>
> Because nothing in this series indicates either way. So I assumed this should 
> be owned by Xen because it will drive it.
>
> From what you wrote below, it sounds like this is not the case. I think you 
> want to have a design document sent along the series so we can easily know 
> what's the expected design and validate that the code match the agreement.
>
> There was already a design document sent a few months ago. So you may want to 
> refresh it (if needed) and send it again with this series.
>
Please see [1] which is the design document we use to implement PCI passthrough 
on Arm.

For your convenience:

"

# Problem statement:
[snip]

Only Dom0 and Xen will have access to the real PCI bus,​ guest will have a
direct access to the assigned device itself​. IOMEM memory will be mapped to
the guest ​and interrupt will be redirected to the guest. SMMU has to be
configured correctly to have DMA transaction."

"

# Discovering PCI Host Bridge in XEN:

In order to support the PCI passthrough XEN should be aware of all the PCI host
bridges available on the system and should be able to access the PCI
configuration space. ECAM configuration access is supported as of now. XEN
during boot will read the PCI device tree node “reg” property and will map the
ECAM space to the XEN memory using the “ioremap_nocache ()” function.

[snip]

When Dom0 tries to access the PCI config space of the device, XEN will find the
corresponding host bridge based on segment number and access the corresponding
config space assigned to that bridge.

Limitation:
* Only PCI ECAM configuration space access is supported.
* Device tree binding is supported as of now, ACPI is not supported.
* Need to port the PCI host bridge access code to XEN to access the
configuration space (generic one works but lots of platforms will required
some specific code or quirks).

"

Unfortunately the document had not been updated since then, but the question

being discussed has not changed in the design: Domain-0 has full access to the 
bridge,

Xen traps ECAM. (I am taking dom0less aside as that was not the target for the 
first phase)

Thank you,

Oleksandr

[1] https://lists.xenproject.org/archives/html/xen-devel/2020-07/msg00777.html


 


Rackspace

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