xen-devel.lists.xenproject.org archive mirror
 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 09:36:33 -0400	[thread overview]
Message-ID: <20150922133633.GD24845@l.oracle.com> (raw)
In-Reply-To: <5600F3C702000078000D92F6@prv-mh.provo.novell.com>

On Mon, Sep 21, 2015 at 11:23:03PM -0600, Jan Beulich wrote:
> >>> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 09/21/15 8:06 PM >>>
> >- Never figured out how much data we should save in the Xen's
> >struct pci_device to see if we are 'stale'. Looking back I think
> >we just need to do the interogation of the PCI capabilities and see
> >if they have somehow changed (the ones we care about).
> 
> Didn't we settle on no data to be needed here at all, instead requiring Dom0
> to report devices removed on buses about to be re-numbered, adding them
> back after the re-numbering?

Perhaps?

The Linux code constructs the structs for bus and pci devices (and dispatches
the hypercalls) as it walks the ACPI PCI bus. And if the reassign parameter was used
it then during this walk (buses first) alters the PCI_PRIMARY_BUS. Once it has
done that it restarts the walk and scans for the PCI devices.

What that means is that all the internal Linux PCI devices structure
devices are not available before this ACPI bus scan is done (while
the Xen PCI deviecs structures are available).

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.

My thinking was that why don't we just make PHYSDEVOP_pci_device_add be
capable of dealing with changes like these.

However, you  have also added the code to trap on PCI configuation access
we could also do some smarts when PCI_PRIMARY_BUS is modified (see
a88b72fddd046a0978242411276861039ec99ad0 x86/PCI: add config space abstract
write intercept logic). That would take care of it much easier I think?

> 
> Jan
> 

  reply	other threads:[~2015-09-22 13:36 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 [this message]
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
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=20150922133633.GD24845@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=eswierk@skyportsystems.com \
    --cc=jbeulich@suse.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 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).