All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Rahul Singh <Rahul.Singh@arm.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	nd <nd@arm.com>, Julien Grall <julien.grall.oss@gmail.com>
Subject: Re: PCI devices passthrough on Arm design proposal
Date: Sat, 18 Jul 2020 09:55:42 +0000	[thread overview]
Message-ID: <C86FE34B-4587-4895-8001-D8CD3F9D44F0@arm.com> (raw)
In-Reply-To: <20200717160550.GZ7191@Air-de-Roger>



> On 17 Jul 2020, at 18:05, Roger Pau Monné <roger.pau@citrix.com> wrote:
> 
> On Fri, Jul 17, 2020 at 03:47:25PM +0000, Bertrand Marquis wrote:
>>> On 17 Jul 2020, at 17:26, Julien Grall <julien@xen.org> wrote:
>>> On 17/07/2020 15:47, Bertrand Marquis wrote:
>>>>>>> * Dom0Less implementation will require to have the capacity inside Xen to discover the PCI devices (without depending on Dom0 to declare them to Xen).
>>>>>>> 
>>>>>>> # Enable the existing x86 virtual PCI support for ARM:
>>>>>>> 
>>>>>>> The existing VPCI support available for X86 is adapted for Arm. When the device is added to XEN via the hyper call “PHYSDEVOP_pci_device_add”, VPCI handler for the config space access is added to the PCI device to emulate the PCI devices.
>>>>>>> 
>>>>>>> A MMIO trap handler for the PCI ECAM space is registered in XEN so that when guest is trying to access the PCI config space, XEN will trap the access and emulate read/write using the VPCI and not the real PCI hardware.
>>>>>>> 
>>>>>>> Limitation:
>>>>>>> * No handler is register for the MSI configuration.
>>>>>>> * Only legacy interrupt is supported and tested as of now, MSI is not implemented and tested.
>>>>>> IIRC, legacy interrupt may be shared between two PCI devices. How do you plan to handle this on Arm?
>>>> We plan to fix this by adding proper support for MSI in the long term.
>>>> For the use case where MSI is not supported or not wanted we might have to find a way to forward the hardware interrupt to several guests to emulate some kind of shared interrupt.
>>> 
>>> Sharing interrupts are a bit pain because you couldn't take advantage of the direct EOI in HW and have to be careful if one guest doesn't EOI in timely maneer.
>>> 
>>> This is something I would rather avoid unless there is a real use case for it.
>> 
>> I would expect that most recent hardware will support MSI and this
>> will not be needed.
> 
> Well, PCI Express mandates MSI support, so while this is just a spec,
> I would expect most (if not all) devices to support MSI (or MSI-X), as
> Arm platforms haven't implemented legacy PCI anyway.

Yes that’s our assumption to. But we have to start somewhere so MSI is
planned but in a future step. I would think that supporting non MSI if not
impossible will be a lot more complex due to the interrupt sharing.
I do think that not supporting non MSI should be ok on Arm.

> 
>> When MSI is not used, the only solution would be to enforce that
>> devices assigned to different guest are using different interrupts
>> which would limit the number of domains being able to use PCI
>> devices on a bus to 4 (if the enumeration can be modified correctly
>> to assign the interrupts properly).
>> 
>> If we all agree that this is an acceptable limitation then we would
>> not need the “interrupt sharing”.
> 
> I might be easier to start by just supporting devices that have MSI
> (or MSI-X) and then move to legacy interrupts if required?

MSI support requires also some support in the interrupt controller part
on arm. So there is some work to achieve that.

> 
> You should have most of the pieces you require already implemented
> since that's what x86 uses, and hence could reuse almost all of it?

Inside PCI probably but the GIC part will require some work.

> 
> IIRC Julien even said that Arm was likely to require much less traps
> than x86 for accesses to MSI and MSI-X since you could allow untrusted
> guests to write directly to the registers as there's another piece of
> hardware that would already translate the interrupts?

Yes this is definitely the case. The ITS part of the GIC interrupt controller
will help a lot and reduce the number of traps.

> 
> I think it's fine to use this workaround while you don't have MSI
> support in order to start testing and upstreaming stuff, but maybe
> that shouldn't be committed?

That was definitely not our plan to commit the code without MSI.
But as requested during the Xen Summit, we try to publish some code
for an RFC and a design early to get comment from the community and
we try to do that with something working, even partially and with lots of
limitations.

Bertrand


  reply	other threads:[~2020-07-18  9:56 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3F6E40FB-79C5-4AE8-81CA-E16CA37BB298@arm.com>
     [not found] ` <BD475825-10F6-4538-8294-931E370A602C@arm.com>
2020-07-16 17:10   ` RFC: PCI devices passthrough on Arm design proposal Rahul Singh
2020-07-16 20:51     ` Stefano Stabellini
2020-07-17  6:53       ` Bertrand Marquis
2020-07-17  7:41         ` Oleksandr Andrushchenko
2020-07-17 11:26           ` Julien Grall
2020-07-17 11:41             ` Oleksandr Andrushchenko
2020-07-17 13:21               ` Bertrand Marquis
2020-07-17 12:46           ` Rahul Singh
2020-07-17 12:55             ` Jan Beulich
2020-07-17 13:12           ` Bertrand Marquis
2020-07-17  8:10     ` Jan Beulich
2020-07-17  8:47       ` Oleksandr Andrushchenko
2020-07-17 13:28         ` Rahul Singh
2020-07-17 13:14       ` Bertrand Marquis
2020-07-17 13:19         ` Jan Beulich
2020-07-17 13:59           ` Bertrand Marquis
2020-07-17 14:06             ` Jan Beulich
2020-07-17 14:34               ` Bertrand Marquis
2020-07-17 14:41                 ` Roger Pau Monné
2020-07-17 14:49                   ` Bertrand Marquis
2020-07-17 15:05                     ` Roger Pau Monné
2020-07-17 15:23                       ` Bertrand Marquis
2020-07-17 15:30                         ` Roger Pau Monné
2020-07-17 15:51                           ` Bertrand Marquis
2020-07-17 16:08                             ` Roger Pau Monné
2020-07-17 16:18                               ` Julien Grall
2020-07-17 19:17                                 ` Oleksandr
2020-07-18  9:58                                   ` Bertrand Marquis
2020-07-18 11:24                                   ` Julien Grall
2020-07-20 11:27                                     ` Oleksandr
2020-07-20  8:47                                 ` Roger Pau Monné
2020-07-20  9:24                                   ` Julien Grall
2020-07-20 23:23                 ` Stefano Stabellini
2020-07-21  9:54                   ` Rahul Singh
2020-07-17 11:16     ` Roger Pau Monné
2020-07-17 13:22       ` Bertrand Marquis
2020-07-17 13:29         ` Julien Grall
2020-07-17 13:44           ` Bertrand Marquis
2020-07-17 13:49             ` Julien Grall
2020-07-17 14:01               ` Bertrand Marquis
2020-07-17 14:31         ` Roger Pau Monné
2020-07-17 15:21           ` Bertrand Marquis
2020-07-17 15:55             ` Roger Pau Monné
2020-07-18  9:49               ` Bertrand Marquis
2020-07-20  8:45                 ` Roger Pau Monné
2020-07-20 23:24             ` Stefano Stabellini
2020-07-21  1:39               ` Rob Herring
2020-07-21 19:35                 ` Stefano Stabellini
     [not found]   ` <8ac91a1b-e6b3-0f2b-0f23-d7aff100936d@xen.org>
2020-07-17 13:50     ` Julien Grall
2020-07-17 13:59       ` Jan Beulich
2020-07-17 14:12         ` Julien Grall
2020-07-17 14:23           ` Jan Beulich
2020-07-17 14:47       ` Bertrand Marquis
2020-07-17 15:26         ` Julien Grall
2020-07-17 15:47           ` Bertrand Marquis
2020-07-17 16:05             ` Roger Pau Monné
2020-07-18  9:55               ` Bertrand Marquis [this message]
2020-07-18 11:14                 ` Julien Grall
2020-07-20 11:32                   ` Rahul Singh
2020-07-18 11:32               ` Julien Grall
2020-07-18 11:08             ` Julien Grall
2020-07-20 11:26               ` Rahul Singh
2020-07-17 10:48 Rahul Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C86FE34B-4587-4895-8001-D8CD3F9D44F0@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=julien.grall.oss@gmail.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.