All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: "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>,
	"Manish Jaggi" <mjaggi@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: Wed, 17 Jun 2015 15:35:02 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1506171534230.21829@kaball.uk.xensource.com> (raw)
In-Reply-To: <1434551364.13744.403.camel@citrix.com>

On Wed, 17 Jun 2015, Ian Campbell wrote:
> On Wed, 2015-06-17 at 07:14 -0700, Manish Jaggi wrote:
> > 
> > On Wednesday 17 June 2015 06:43 AM, Ian Campbell wrote:
> > > On Wed, 2015-06-17 at 13:58 +0100, Stefano Stabellini wrote:
> > >> Yes, pciback is already capable of doing that, see
> > >> drivers/xen/xen-pciback/conf_space.c
> > >>
> > >>> I am not sure if the pci-back driver can query the guest memory map. Is there an existing hypercall ?
> > >> No, that is missing.  I think it would be OK for the virtual BAR to be
> > >> initialized to the same value as the physical BAR.  But I would let the
> > >> guest change the virtual BAR address and map the MMIO region wherever it
> > >> wants in the guest physical address space with
> > >> XENMEM_add_to_physmap_range.
> > > I disagree, given that we've apparently survived for years with x86 PV
> > > guests not being able to right to the BARs I think it would be far
> > > simpler to extend this to ARM and x86 PVH too than to allow guests to
> > > start writing BARs which has various complex questions around it.
> > > All that's needed is for the toolstack to set everything up and write
> > > some new xenstore nodes in the per-device directory with the BAR
> > > address/size.
> > >
> > > Also most guests apparently don't reassign the PCI bus by default, so
> > > using a 1:1 by default and allowing it to be changed would require
> > > modifying the guests to reasssign. Easy on Linux, but I don't know about
> > > others and I imagine some OSes (especially simpler/embedded ones) are
> > > assuming the firmware sets up something sane by default.
> > Does the Flow below captures all points
> > a) When assigning a device to domU, toolstack creates a node in per 
> > device directory with virtual BAR address/size
> > 
> > Option1:
> > b) toolstack using some hypercall ask xen to create p2m mapping { 
> > virtual BAR : physical BAR } for domU
> > c) domU will not anytime update the BARs, if it does then it is a fault, 
> > till we decide how to handle it
> 
> As Julien has noted pciback already deals with this correctly, because
> sizing a BAR involves a write, it implementes a scheme which allows
> either the hardcoded virtual BAR to be written or all 1s (needed for
> size detection).
> 
> > d) when domU queries BAR address from pci-back the virtual BAR address 
> > is provided.
> > 
> > Option2:
> > b) domU will not anytime update the BARs, if it does then it is a fault, 
> > till we decide how to handle it
> > c) when domU queries BAR address from pci-back the virtual BAR address 
> > is provided.
> > d) domU sends a hypercall to map virtual BARs,
> > e) xen pci code reads the BAR and maps { virtual BAR : physical BAR } 
> > for domU
> > 
> > Which option is better I think Ian is for (2) and Stefano may be (1)
> 
> In fact I'm now (after Julien pointed out the current behaviour of
> pciback) in favour of (1), although I'm not sure if Stefano is too.
> 
> (I was never in favour of (2), FWIW, I previously was in favour of (3)
> which is like (2) except pciback makes the hypervcall to map the virtual
> bars to the guest, I'd still favour that over (2) but (1) is now my
> preference)

OK, let's go with (1).

  reply	other threads:[~2015-06-17 14:35 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
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 [this message]
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.1506171534230.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.