xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2 1/9] xen/vpci: introduce basic handlers to trap accesses to the PCI config space
Date: Mon, 24 Apr 2017 10:12:34 +0000	[thread overview]
Message-ID: <2e76344158434c55ac2c1e943a79710e@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20170424101152.7qjxhvmfadsixo5d@dhcp-3-128.uk.xensource.com>

> -----Original Message-----
> From: Roger Pau Monne
> Sent: 24 April 2017 11:12
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; konrad.wilk@oracle.com;
> boris.ostrovsky@oracle.com; Ian Jackson <Ian.Jackson@citrix.com>; Wei Liu
> <wei.liu2@citrix.com>; Jan Beulich <jbeulich@suse.com>; Andrew Cooper
> <Andrew.Cooper3@citrix.com>
> Subject: Re: [PATCH v2 1/9] xen/vpci: introduce basic handlers to trap
> accesses to the PCI config space
> 
> On Mon, Apr 24, 2017 at 10:58:04AM +0100, Paul Durrant wrote:
> > > -----Original Message-----
> > > From: Roger Pau Monne
> > > Sent: 24 April 2017 10:42
> > > To: Paul Durrant <Paul.Durrant@citrix.com>
> > > Cc: xen-devel@lists.xenproject.org; konrad.wilk@oracle.com;
> > > boris.ostrovsky@oracle.com; Ian Jackson <Ian.Jackson@citrix.com>; Wei
> Liu
> > > <wei.liu2@citrix.com>; Jan Beulich <jbeulich@suse.com>; Andrew
> Cooper
> > > <Andrew.Cooper3@citrix.com>
> > > Subject: Re: [PATCH v2 1/9] xen/vpci: introduce basic handlers to trap
> > > accesses to the PCI config space
> > >
> > > On Fri, Apr 21, 2017 at 05:23:34PM +0100, Paul Durrant wrote:
> > > > > -----Original Message-----
> > > > > From: Roger Pau Monne [mailto:roger.pau@citrix.com]
> > > [...]
> > > > > +int xen_vpci_read(unsigned int seg, unsigned int bus, unsigned int
> > > devfn,
> > > > > +                  unsigned int reg, uint32_t size, uint32_t *data)
> > > > > +{
> > > > > +    struct domain *d = current->domain;
> > > > > +    struct pci_dev *pdev;
> > > > > +    const struct vpci_register *r;
> > > > > +    union vpci_val val = { .double_word = 0 };
> > > > > +    unsigned int data_rshift = 0, data_lshift = 0, data_size;
> > > > > +    uint32_t tmp_data;
> > > > > +    int rc;
> > > > > +
> > > > > +    ASSERT(vpci_locked(d));
> > > > > +
> > > > > +    *data = 0;
> > > > > +
> > > > > +    /* Find the PCI dev matching the address. */
> > > > > +    pdev = pci_get_pdev_by_domain(d, seg, bus, devfn);
> > > > > +    if ( !pdev )
> > > > > +        goto passthrough;
> > > >
> > > > I hope this can eventually be generalised so I wonder what your
> intention is
> > > regarding co-existence between Xen emulated PCI config space, pass-
> > > through and PCI devices emulated externally. We already have a
> framework
> > > for registering PCI devices by SBDF but this code seems to make no use of
> it,
> > > which I suspect is likely to cause future conflict.
> > >
> > > Yes, the long term aim is to use this code in order to implement
> > > PCI-passthrough for PVH and HVM DomUs also.
> > >
> > > TBH, I didn't know we already had such code (I assume you mean the
> IOREQ
> > > related PCI code). As it is, I see a couple of issues with that, the first one
> > > is that this code expects a ioreq client on the other end, and the code I'm
> > > adding here is all inside of the hypervisor. The second issue is that the
> IOREQ
> > > code ATM only allows for local PCI accesses, which means I should extend
> it
> > > to
> > > also deal with ECAM/MMCFG areas.
> > >
> > > I completely agree that at some point this should be made to work
> together,
> > > but
> > > I'm not sure if it would be better to do that once we want to also use vPCI
> for
> > > DomUs, so that the Dom0 side is not delayed further.
> >
> > BTW, that's also an argument for forgetting about the r-b scheme for
> handler registration since, if this really is for dom0 only, 8 pages worth of
> direct map is not a lot.
> 
> It's 8 pages for each device, not 8 pages for each domain, so it doesn't matter
> if it's Dom0 or DomU, each PCIe device would use 8 pages.

Sorry, yes of course it is.

  Paul

> 
> Roger.

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

  reply	other threads:[~2017-04-24 10:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 15:17 [PATCH v2 0/9] vpci: PCI config space emulation Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 1/9] xen/vpci: introduce basic handlers to trap accesses to the PCI config space Roger Pau Monne
2017-04-21 16:07   ` Paul Durrant
2017-04-24  9:09     ` Roger Pau Monne
2017-04-24  9:34       ` Paul Durrant
2017-04-24 10:08         ` Roger Pau Monne
2017-04-24 10:19           ` Paul Durrant
2017-04-24 11:02             ` Roger Pau Monne
2017-04-24 11:50               ` Paul Durrant
2017-04-25  8:27                 ` Roger Pau Monne
2017-04-25  8:35                   ` Paul Durrant
2017-04-21 16:23   ` Paul Durrant
2017-04-24  9:42     ` Roger Pau Monne
2017-04-24  9:55       ` Paul Durrant
2017-04-24  9:58       ` Paul Durrant
2017-04-24 10:11         ` Roger Pau Monne
2017-04-24 10:12           ` Paul Durrant [this message]
2017-04-20 15:17 ` [PATCH v2 2/9] x86/ecam: add handlers for the PVH Dom0 MMCFG areas Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 3/9] xen/mm: move modify_identity_mmio to global file and drop __init Roger Pau Monne
2017-04-24 14:42   ` Julien Grall
2017-04-25  8:01     ` Roger Pau Monne
2017-04-25  9:09       ` Julien Grall
2017-04-25  9:25         ` Roger Pau Monne
2017-04-25  9:32           ` Jan Beulich
2017-04-26  8:26             ` Roger Pau Monne
2017-04-26  8:51               ` Jan Beulich
2017-04-27  8:58             ` Roger Pau Monne
2017-04-27  9:08               ` Julien Grall
2017-04-27  9:29               ` Jan Beulich
2017-04-20 15:17 ` [PATCH v2 4/9] xen/pci: split code to size BARs from pci_add_device Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 5/9] xen/vpci: add handlers to map the BARs Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 6/9] xen/vpci: trap access to the list of PCI capabilities Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 7/9] vpci: add a priority field to the vPCI register initializer Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 8/9] vpci/msi: add MSI handlers Roger Pau Monne
2017-04-21  8:38   ` Roger Pau Monne
2017-04-24 15:31   ` Julien Grall
2017-04-25 11:49     ` Roger Pau Monne
2017-04-25 12:00       ` Julien Grall
2017-04-25 13:19         ` Roger Pau Monne
2017-04-20 15:17 ` [PATCH v2 9/9] vpci/msix: add MSI-X handlers Roger Pau Monne

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=2e76344158434c55ac2c1e943a79710e@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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).