xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	"Wei Chen" <Wei.Chen@arm.com>,
	"Campbell Sean" <scampbel@codeaurora.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jiandi An" <anjiandi@codeaurora.org>,
	"Punit Agrawal" <punit.agrawal@arm.com>,
	alistair.francis@xilinx.com,
	xen-devel <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"manish.jaggi@caviumnetworks.com"
	<manish.jaggi@caviumnetworks.com>,
	"Shanker Donthineni" <shankerd@codeaurora.org>,
	"Steve Capper" <Steve.Capper@arm.com>
Subject: Re: [early RFC] ARM PCI Passthrough design document
Date: Wed, 1 Feb 2017 20:24:55 +0000	[thread overview]
Message-ID: <6b4ef41b-171d-16a6-7b7f-4ecdead3d140@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1702011111320.17946@sstabellini-ThinkPad-X260>

Hi Stefano,

On 01/02/2017 19:31, Stefano Stabellini wrote:
> On Wed, 1 Feb 2017, Julien Grall wrote:
>> On 31/01/2017 19:06, Edgar E. Iglesias wrote:
>>> On Tue, Jan 31, 2017 at 05:09:53PM +0000, Julien Grall wrote:
>>>> On 31/01/17 16:53, Edgar E. Iglesias wrote:
>>>>> On Wed, Jan 25, 2017 at 06:53:20PM +0000, Julien Grall wrote:
>>>>>> On 24/01/17 20:07, Stefano Stabellini wrote:
>>>>>>> On Tue, 24 Jan 2017, Julien Grall wrote:
>> From my understanding your MSI controller is embedded in the hostbridge,
>> right? If so, the MSIs would need to be handled where the host bridge will be
>> initialized (e.g either Xen or DOM0).
>>
>> From a design point of view, it would make more sense to have the MSI
>> controller driver in Xen as the hostbridge emulation for guest will also live
>> there.
>>
>> So if we receive MSI in Xen, we need to figure out a way for DOM0 and guest to
>> receive MSI. The same way would be the best, and I guess non-PV if possible. I
>> know you are looking to boot unmodified OS in a VM. This would mean we need to
>> emulate the MSI controller and potentially xilinx PCI controller. How much are
>> you willing to modify the OS?
>>
>> Regarding the MSI doorbell, I have seen it is configured by the software using
>> a physical address of a page allocated in the RAM. When the PCI devices is
>> writing into the doorbell does the access go through the SMMU?
>>
>> Regardless the answer, I think we would need to map the MSI doorbell page in
>> the guest.
>
> Why? We should be able to handle the case by trapping and emulating PCI
> config accesses. Xen can force the real MSI descriptors to use whatever
> Xen wants them to use. With an SMMU, we need to find a way to map the
> MSI doorbell in the SMMU pagetable to allow the device to write to it.
> Without SMMU, it's unneeded.

My point was using guest with SMMU, if you want to support PCI 
passthrough without SMMU then it is another subject and I would rather 
postpone this discussion.

>
>
>> Meaning that even if we trap MSI configuration access, a guess
>> could DMA in the page. So if I am not mistaken, MSI would be insecure in this
>> case :/.
>
> That's right: if a device capable of DMA to an arbitrary address in
> memory is assigned to the guest, the guest can write to the MSI doorbell
> if an SMMU is present, otherwise, the guest can write to any address in
> memory without SMMU. Completely insecure.
>
> It is the same security compromised offered by PV PCI passthrough today
> with no VT-D on the platform. I think it's still usable in some cases,
> but we need to be very clear about its security properties.

The guest would have to be mapped 1:1 in order to do DMA. And this is 
not supported today.

>
>
>> Or maybe we could avoid mapping the doorbell in the guest and let Xen receive
>> an SMMU abort. When receiving the SMMU abort, Xen could sanitize the value and
>> write into the real MSI doorbell. Not sure if it would works thought.
>
> I thought that SMMU aborts are too slow for this?

I got no idea here. However, I think it would be better than a security 
hole. So this could be an option for the user.

Cheers,

--
Julien grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-02-01 20:25 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 14:04 [early RFC] ARM PCI Passthrough design document Julien Grall
2016-12-29 14:16 ` Jaggi, Manish
2016-12-29 17:03   ` Julien Grall
2016-12-29 18:41     ` Jaggi, Manish
2016-12-29 19:38       ` Julien Grall
2017-01-04  0:24 ` Stefano Stabellini
2017-01-24 14:28   ` Julien Grall
2017-01-24 20:07     ` Stefano Stabellini
2017-01-25 11:21       ` Roger Pau Monné
2017-01-25 18:53       ` Julien Grall
2017-01-31 16:53         ` Edgar E. Iglesias
2017-01-31 17:09           ` Julien Grall
2017-01-31 19:06             ` Edgar E. Iglesias
2017-01-31 22:08               ` Stefano Stabellini
2017-02-01 19:04               ` Julien Grall
2017-02-01 19:31                 ` Stefano Stabellini
2017-02-01 20:24                   ` Julien Grall [this message]
2017-02-02 15:33                 ` Edgar E. Iglesias
2017-02-02 23:12                   ` Stefano Stabellini
2017-02-02 23:44                     ` Edgar E. Iglesias
2017-02-10  1:01                       ` Stefano Stabellini
2017-02-13 15:39                         ` Julien Grall
2017-02-13 19:59                           ` Stefano Stabellini
2017-02-14 17:21                             ` Julien Grall
2017-02-14 18:20                               ` Stefano Stabellini
2017-02-14 20:18                                 ` Julien Grall
2017-02-13 15:35                   ` Julien Grall
2017-02-22  4:03                     ` Edgar E. Iglesias
2017-02-23 16:47                       ` Julien Grall
2017-03-02 21:13                         ` Edgar E. Iglesias
2017-02-02 15:40                 ` Roger Pau Monné
2017-02-13 16:22                   ` Julien Grall
2017-01-31 21:58         ` Stefano Stabellini
2017-02-01 20:12           ` Julien Grall
2017-02-01 10:55         ` Roger Pau Monné
2017-02-01 18:50           ` Stefano Stabellini
2017-02-10  9:48             ` Roger Pau Monné
2017-02-10 10:11               ` Paul Durrant
2017-02-10 12:57                 ` Roger Pau Monne
2017-02-10 13:02                   ` Paul Durrant
2017-02-10 21:04                     ` Stefano Stabellini
2017-02-02 12:38           ` Julien Grall
2017-02-02 23:06             ` Stefano Stabellini
2017-03-08 19:06               ` Julien Grall
2017-03-08 19:12                 ` Konrad Rzeszutek Wilk
2017-03-08 19:55                   ` Stefano Stabellini
2017-03-08 21:51                     ` Julien Grall
2017-03-09  2:59                   ` Roger Pau Monné
2017-03-09 11:17                     ` Konrad Rzeszutek Wilk
2017-03-09 13:26                       ` Julien Grall
2017-03-10  0:29                         ` Konrad Rzeszutek Wilk
2017-03-10  3:23                           ` Roger Pau Monné
2017-03-10 15:28                             ` Konrad Rzeszutek Wilk
2017-03-15 12:07                               ` Roger Pau Monné
2017-03-15 12:42                                 ` Konrad Rzeszutek Wilk
2017-03-15 12:56                                   ` Roger Pau Monné
2017-03-15 15:11                                     ` Venu Busireddy
2017-03-15 16:38                                       ` Roger Pau Monn?
2017-03-15 16:54                                         ` Venu Busireddy
2017-03-15 17:00                                           ` Roger Pau Monn?
2017-05-03 12:38                                             ` Julien Grall
2017-05-03 12:53                                         ` Julien Grall
2017-01-25  4:23     ` Manish Jaggi
2017-01-06 15:12 ` Roger Pau Monné
2017-01-06 21:16   ` Stefano Stabellini
2017-01-24 17:17   ` Julien Grall
2017-01-25 11:42     ` Roger Pau Monné
2017-01-31 15:59       ` Julien Grall
2017-01-31 22:03         ` Stefano Stabellini
2017-02-01 10:28           ` Roger Pau Monné
2017-02-01 18:45             ` Stefano Stabellini
2017-01-06 16:27 ` Edgar E. Iglesias
2017-01-06 21:12   ` Stefano Stabellini
2017-01-09 17:50     ` Edgar E. Iglesias
2017-01-19  5:09 ` Manish Jaggi
2017-01-24 17:43   ` Julien Grall
2017-01-25  4:37     ` Manish Jaggi
2017-01-25 15:25       ` Julien Grall
2017-01-30  7:41         ` Manish Jaggi
2017-01-31 13:33           ` Julien Grall
2017-05-19  6:38 ` Goel, Sameer
2017-05-19 16:48   ` Julien Grall

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=6b4ef41b-171d-16a6-7b7f-4ecdead3d140@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Steve.Capper@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=alistair.francis@xilinx.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anjiandi@codeaurora.org \
    --cc=edgar.iglesias@xilinx.com \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=punit.agrawal@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=scampbel@codeaurora.org \
    --cc=shankerd@codeaurora.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).