All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: eswierk@skyportsystems.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved before PCI enumeration
Date: Tue, 22 Sep 2015 10:33:28 -0400	[thread overview]
Message-ID: <20150922143328.GB4454@l.oracle.com> (raw)
In-Reply-To: <56017E0802000078000A4709@prv-mh.provo.novell.com>

On Tue, Sep 22, 2015 at 08:12:56AM -0600, Jan Beulich wrote:
> >>> On 22.09.15 at 16:09, <konrad.wilk@oracle.com> wrote:
> > On Tue, Sep 22, 2015 at 07:57:29AM -0600, Jan Beulich wrote:
> >> >>> On 22.09.15 at 15:36, <konrad.wilk@oracle.com> wrote:
> >> > The best I could come up with is to do two loops:
> >> >  1) for 0:0:0 -> ff:ff:ff call PHYSDEVOP_pci_device_remove
> >> >     (so blow away what Xen has for its PCI devices.. except for the AMD 
> >> > IOMMU)
> >> >  2) list_for_each_pci_device PHYSDEVOP_pci_device_add (or other variants
> >> >     if VF).
> >> > 
> >> > But that is just a hack working around the Linux code.
> >> 
> >> The price of being non-intrusive on the Linux side. The above would
> >> seem okay to me for the (rare?) reassign case. (Not sure why you
> >> mean to exclude the AMD IOMMU there.)
> > 
> > I think we hide it altogether from the dom0 - so when it does the
> > bus reassignment it does not see the AMD IOMMU.
> > 
> > My concern was that the bus number of the AMD IOMMU device may
> > overlap with other bus numbers - which got moved as a result
> > of the bridge expanding its subordinate bus numbers.
> > 
> > In other words, the AMD IOMMU may have been at bus 0xb, the
> > bridge in question at 0x01, with an PCI device at 0x02;
> > some devices between 0x03 down to 0x0a.
> > 
> > The bridge would now cover 0x01->0x04 (with the PCI device
> > still at 0x02). But the devices at the old 0x03->0x0a have now
> > been shifted to 0x04->0x0b. And the AMD IOMMU is at 0x0c.
> > 
> > But Xen has no clue about this and "loses" the AMD IOMMU and
> > starts writting configuration data to whatever poor device used to
> > be at bus 0x0b.
> 
> And how would that issue be solved by leaving that device alone?

If it was exposed to dom0, it could make an PHYSDEVOP_pci_device_add
to add it back to Xen (as a new device at bus 0x0c).

But Xen wouldn't know what to do with it - it would still think that
the AMD IOMMU is at bus 0x0b.

I believe I am going on a tangent here - that is the MMCFG
conversation is about the extended configuration registers and how
to make Xen aware of them such that when the VF is added Xen will
be able to validate them. Ed's idea of making the MMCFG hypercall
when the PCI notification (with your suggestions) should take care
of it (I hope).

The issue I am waxing on about is just Linux reassigning the
PCI devices and what are some of the repercussions that stem from that.

I should start a new thread about it and propose some prototype
patch, once my TODO queue is a bit sane.


> 
> Jan
> 

  reply	other threads:[~2015-09-22 14:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 23:29 [PATCH] xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved before PCI enumeration Ed Swierk
2015-09-21 15:58 ` Ed Swierk
2015-09-21 18:05   ` Konrad Rzeszutek Wilk
2015-09-22  5:23     ` Jan Beulich
2015-09-22 13:36       ` Konrad Rzeszutek Wilk
2015-09-22 13:57         ` Jan Beulich
2015-09-22 14:09           ` Konrad Rzeszutek Wilk
2015-09-22 14:12             ` Jan Beulich
2015-09-22 14:33               ` Konrad Rzeszutek Wilk [this message]
2015-09-22 15:07                 ` Jan Beulich
2015-09-22  5:21   ` Jan Beulich
2015-09-22 12:35     ` Ed Swierk
2015-09-22 12:40       ` Jan Beulich
2015-09-22 13:26       ` Ed Swierk
2015-09-22 13:36         ` Jan Beulich
2015-09-22 13:39         ` Konrad Rzeszutek Wilk
2015-09-22 13:52           ` Jan Beulich
2015-09-22 14:03             ` Konrad Rzeszutek Wilk
2015-09-22 14:11               ` Jan Beulich
2015-09-22 14:37                 ` Konrad Rzeszutek Wilk
2015-09-22 15:09                   ` Jan Beulich
2015-09-22 20:17                     ` Ed Swierk
2015-09-23  0:53                       ` Konrad Rzeszutek Wilk

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=20150922143328.GB4454@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=eswierk@skyportsystems.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.