All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Manish Jaggi <mjaggi@caviumnetworks.com>
Cc: "Ian Campbell" <ian.campbell@citrix.com>,
	"Vijay Kilari" <vijay.kilari@gmail.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Prasun Kapoor" <Prasun.kapoor@caviumnetworks.com>,
	"Kumar, Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"Julien Grall" <julien.grall@citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@citrix.com>,
	"Kulkarni, Ganapatrao" <Ganapatrao.Kulkarni@caviumnetworks.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: PCI Passthrough ARM Design : Draft1
Date: Tue, 16 Jun 2015 18:28:21 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1506161818430.21829@kaball.uk.xensource.com> (raw)
In-Reply-To: <558058CA.9030806@caviumnetworks.com>

[-- Attachment #1: Type: text/plain, Size: 4418 bytes --]

On Tue, 16 Jun 2015, Manish Jaggi wrote:
> On Tuesday 16 June 2015 09:21 AM, Roger Pau Monné wrote:
> > El 16/06/15 a les 18.13, Stefano Stabellini ha escrit:
> > > On Thu, 11 Jun 2015, Ian Campbell wrote:
> > > > On Thu, 2015-06-11 at 07:25 -0400, Julien Grall wrote:
> > > > > Hi Ian,
> > > > >
> > > > > On 11/06/2015 04:56, Ian Campbell wrote:
> > > > > > On Wed, 2015-06-10 at 15:21 -0400, Julien Grall wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > On 10/06/2015 08:45, Ian Campbell wrote:
> > > > > > > > > 4. DomU access / assignment PCI device
> > > > > > > > > --------------------------------------
> > > > > > > > > When a device is attached to a domU, provision has to be made
> > > > > > > > > such that
> > > > > > > > > it can
> > > > > > > > > access the MMIO space of the device and xen is able to
> > > > > > > > > identify the mapping
> > > > > > > > > between guest bdf and system bdf. Two hypercalls are
> > > > > > > > > introduced
> > > > > > > > I don't think we want/need new hypercalls here, the same
> > > > > > > > existing
> > > > > > > > hypercalls which are used on x86 should be suitable. That's
> > > > > > > > XEN_DOMCTL_memory_mapping from the toolstack I think.
> > > > > > > XEN_DOMCTL_memory_mapping is done by QEMU for x86 HVM when the
> > > > > > > guest
> > > > > > > (i.e hvmloader?) is writing in the PCI BAR.
> > > > > > What about for x86 PV? I think it is done by the toolstack there, I
> > > > > > don't know what pciback does with accesses to BAR registers.
> > > > > XEN_DOMCTL_memory_mapping is only used to map memory in stage-2 page
> > > > > table. This is only used for auto-translated guest.
> > > > >
> > > > > In the case of x86 PV, the page-table is managed by the guest. The
> > > > > only
> > > > > things to do is to give the MMIO permission to the guest in order to
> > > > > the
> > > > > let him use them. This is done at boot time in the toolstack.
> > > > Ah yes, makes sense.
> > > >
> > > > Manish, this sort of thing and the constraints etc should be discussed
> > > > in the doc please.
> > >   I think that the toolstack (libxl) will need to call
> > > xc_domain_memory_mapping (XEN_DOMCTL_memory_mapping), in addition to
> > > xc_domain_iomem_permission, for auto-translated PV guests on x86 (PVH)
> > > and ARM guests.
> > I'm not sure about this, AFAICT you are suggesting that the toolstack
> > (or domain builder for Dom0) should setup the MMIO regions on behalf of
> > the guest using the XEN_DOMCTL_memory_mapping hypercall.
> >
> > IMHO the toolstack should not setup MMIO regions and instead the guest
> > should be in charge of setting them in the p2m by using a hypercall (or
> > at least that was the plan on x86 PVH).
> >
> > Roger.
> There were couple of points discussed,
> a) There needs to be a hypercall issued from an entity to map the device MMIO
> space to domU.
> What that entity be
>  i) Toolstack
> ii) domU kernel.
>
> b) Should the MMIO mapping be 1:1
>
> For (a) I have implemented in domU kernel in the context of the notification
> received when a device is added on the pci-front bus. This was a logical point
> I thought this hypercall should be called. Keep in mind that I am still not
> aware how this works on x86.

I think that is OK, but we would like to avoid a new hypercall. Roger's
suggestion looks good.


> For (b) The BAR region is not updated AFAIK by the pci device driver running
> in domU. So once set the BARs by firmware or enumeration logic, are not
> changed, not in domU for sure. Then it is 1:1 always.
> Should the BAR region of the device be updated to make it not 1:1 ?

I think the point Ian and Julien were trying to make is that we should
not rely on the mapping being 1:1. It is OK for the guest not to change
the BARs. But given that the memory layout of the guest is different
from the one on the host, it is possible that the BAR might have an
address that overlaps with a valid memory range in DomU. In that case
the guest should map the MMIO region elsewhere in the guest physical
space. It might also want to update the virtual BAR accordingly.

(Alternatively the toolstack could come up with an appropriate placement
of the virtual BARs and MMIO region mappings in the guest. This is what
I was suggesting, but this solution is probably more complex than
letting the guest choose.)

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2015-06-16 17:28 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  7:52 PCI Passthrough ARM Design : Draft1 Manish Jaggi
2015-06-09 14:42 ` Jaggi, Manish
2015-06-09 15:58   ` Ian Campbell
2015-06-10 12:45 ` Ian Campbell
2015-06-10 19:21   ` Julien Grall
2015-06-11  8:56     ` Ian Campbell
2015-06-11 11:25       ` Julien Grall
2015-06-11 12:02         ` Ian Campbell
2015-06-16 16:13           ` Stefano Stabellini
2015-06-16 16:21             ` Roger Pau Monné
2015-06-16 17:11               ` Manish Jaggi
2015-06-16 17:28                 ` Stefano Stabellini [this message]
2015-06-16 17:46                   ` Manish Jaggi
2015-06-17 12:58                     ` Stefano Stabellini
2015-06-17 13:43                       ` Ian Campbell
2015-06-17 14:14                         ` Manish Jaggi
2015-06-17 14:29                           ` Ian Campbell
2015-06-17 14:35                             ` Stefano Stabellini
2015-06-22 18:33                               ` Konrad Rzeszutek Wilk
2015-06-23  8:44                                 ` Ian Campbell
2015-06-23 14:11                                   ` Konrad Rzeszutek Wilk
2015-06-25  7:44                             ` Manish Jaggi
2015-06-25  9:11                               ` Ian Campbell
2015-06-25 11:59                                 ` Manish Jaggi
2015-06-25 12:21                                   ` Ian Campbell
2015-06-25 17:26                                     ` Konrad Rzeszutek Wilk
2015-06-26  2:07                                       ` Manish Jaggi
2015-06-26  7:32                                         ` Ian Campbell
2015-06-26  8:50                                           ` Manish Jaggi
2015-06-26  9:09                                             ` Ian Campbell
2015-06-26 11:57                                               ` Manish Jaggi
2015-06-26 12:41                                                 ` Ian Campbell
2015-06-26 13:28                                                   ` Konrad Rzeszutek Wilk
2015-06-26 13:47                                                     ` Ian Campbell
2015-06-26 13:52                                                       ` Konrad Rzeszutek Wilk
2015-06-16 17:16               ` Stefano Stabellini
2015-06-17 10:08                 ` Ian Campbell
2015-06-17 12:11                   ` Julien Grall
2015-06-17 12:21                     ` Ian Campbell
2015-06-17 12:53                   ` Stefano Stabellini
2015-06-17 12:57                     ` Julien Grall
2015-06-17 13:32                     ` Ian Campbell
2015-06-17 13:40                       ` Stefano Stabellini
2015-06-17 13:56                         ` Ian Campbell
2015-06-17 14:18                           ` Stefano Stabellini
2015-06-17 14:26                             ` Ian Campbell
2015-06-22 18:31                               ` Konrad Rzeszutek Wilk
2015-06-11  9:05     ` Roger Pau Monné
2015-06-11 12:04       ` Ian Campbell
2015-06-16 16:17         ` Stefano Stabellini
2015-06-11 21:38     ` Manish Jaggi
2015-06-12  8:32       ` Ian Campbell
2015-06-12 11:41         ` Julien Grall
2015-06-12 11:52           ` Ian Campbell
2015-06-16  5:42         ` Manish Jaggi
2015-06-16  7:02           ` Roger Pau Monné
2015-06-16 10:42             ` 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=alpine.DEB.2.02.1506161818430.21829@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ganapatrao.Kulkarni@caviumnetworks.com \
    --cc=Prasun.kapoor@caviumnetworks.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=vijay.kilari@gmail.com \
    --cc=xen-devel@lists.xen.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.