Xen-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Prasun.kapoor@cavium.com,
	Manish Jaggi <mjaggi@caviumnetworks.com>,
	Vijaya Kumar <Vijaya.Kumar@caviumnetworks.com>,
	Julien Grall <julien.grall@linaro.org>,
	xen-devel@lists.xen.org,
	"StefanoStabellini(Stefano.Stabellini@citrix.com)"
	<stefano.stabellini@citrix.com>
Subject: Re: RFC: [PATCH 1/3] Enhance platform support for PCI
Date: Mon, 23 Feb 2015 15:46:37 +0000	[thread overview]
Message-ID: <1424706397.27930.178.camel@citrix.com> (raw)
In-Reply-To: <54EB54D8020000780006296F@mail.emea.novell.com>

On Mon, 2015-02-23 at 15:27 +0000, Jan Beulich wrote:
> >>> On 23.02.15 at 16:02, <ian.campbell@citrix.com> wrote:
> > On Mon, 2015-02-23 at 14:45 +0000, Jan Beulich wrote:
> >> In which case the Dom0 OS doing so would need to communicate
> >> its decisions to the hypervisor, as you suggest further down.
> > 
> > So more concretely something like:
> >         #define PHYSDEVOP_pci_host_bridge_add <XX>
> >         struct physdev_pci_host_bridge_add {
> >             /* IN */
> >             uint16_t seg;
> >             uint8_t bus;
> >             uint64_t address;
> >         };
> >         typedef struct physdev_pci_host_bridge_add physdev_pci_host_bridge_add_t;
> >         DEFINE_XEN_GUEST_HANDLE(physdev_pci_host_bridge_add_t);
> > 
> > Where seg+bus are enumerated/assigned by dom0 and address is some unique
> > property of the host bridge -- most likely its pci cfg space base
> > address (which is what physdev_pci_mmcfg_reserved also takes, I think?)
> 
> Right.
> 
> > Do you think we would need start_bus + end_bus here? Xen could enumerate
> > this itself I think, and perhaps should even if dom0 tells us something?
> 
> That depends - if what you get presented here by Dom0 is a PCI
> device at <seg>:<bus>:00.0, and if all other setup was already
> done on it, then you could read the secondary and subordinate
> bus numbers from its config space. If that's not possible, then
> Dom0 handing you these values would seem to be necessary.
> 
> As a result you may also need a hook from PCI device registration,
> allowing to associate it with the right host bridge (and refusing to
> add any for which there's none).

Right.

My thinking was that PHYSDEVOP_pci_host_bridge_add would add an entry
into some mapping data structure from (segment,bus) to a handle
associated with the associated pci host bridge driver in Xen.

PHYSDEVOP_manage_pci_add would have to lookup the host bridge driver
from the (segment,bus) I think to construct the necessary linkage for
use later when we try to do things to the device, and it should indeed
fail if it can't find one.

> As an alternative, extending PHYSDEVOP_manage_pci_add_ext in
> a suitable manner may be worth considering, provided (like on x86
> and ia64) the host bridges get surfaced as distinct PCI devices.
> 
> >> This
> >> basically replaces the bus scan (on segment 0) that Xen does on
> >> x86 (which topology information gets derived from).
> > 
> > Is the reason for the scan being of segment 0 only is that it is the one
> > which lives at the legacy PCI CFG addresses (or those magic I/O ports)? 
> 
> Right - ideally we would scan all segments, but we need Dom0 to
> tell us which MMCFG regions are safe to access,

Is this done via PHYSDEVOP_pci_mmcfg_reserved?

>  and hence can't
> do that scan at boot time. But we also won't get away without
> scanning, as we need to set up the IOMMU(s) to at least cover
> the devices used for booting the system.

Which hopefully are all segment 0 or aren't needed until after dom0
tells Xen about them I suppose.

> > What about other host bridges in segment 0 which aren't at that address?
> 
> At which address?

I meant this to be a back reference to "the legacy PCI CFG addresses (or
those magic I/O ports)".

>  (All devices on segment zero are supposed to
> be accessible via config space access method 1.)

Is that "the legacy ....  or magic ..." again?

> > You could do the others based on MMCFG tables if you wanted, right?
> 
> Yes, with the above mentioned caveat.
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2015-02-23 15:46 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 11:34 RFC: [PATCH 1/3] Enhance platform support for PCI Manish Jaggi
2015-02-20 12:03 ` Julien Grall
2015-02-20 12:10   ` Manish Jaggi
2015-02-20 12:20     ` Julien Grall
2015-02-20 12:34       ` Manish Jaggi
2015-02-20 13:01         ` Manish Jaggi
2015-02-20 13:45           ` Ian Campbell
2015-02-20 14:11             ` Jan Beulich
2015-02-20 14:26               ` Ian Campbell
2015-02-20 14:39                 ` Jan Beulich
2015-02-20 15:01                   ` Ian Campbell
2015-02-20 15:13                     ` Manish Jaggi
2015-02-20 15:15                       ` Julien Grall
2015-02-20 15:15                     ` Jan Beulich
2015-02-20 17:33                       ` Ian Campbell
2015-02-23  8:43                         ` Jan Beulich
2015-02-23 12:45                           ` Ian Campbell
2015-02-23 14:07                             ` Jan Beulich
2015-02-23 14:33                               ` Ian Campbell
2015-02-23 14:45                                 ` Jan Beulich
2015-02-23 15:02                                   ` Ian Campbell
2015-02-23 15:27                                     ` Jan Beulich
2015-02-23 15:46                                       ` Ian Campbell [this message]
2015-02-23 16:20                                         ` Jan Beulich
2015-02-26 10:09                                           ` Manish Jaggi
2015-02-26 10:30                                             ` Jan Beulich
2015-02-26 11:05                                             ` Ian Campbell
2015-02-27 14:33                                               ` Stefano Stabellini
2015-02-27 14:42                                                 ` Ian Campbell
2015-02-27 14:54                                                   ` Stefano Stabellini
2015-02-27 15:24                                                     ` Ian Campbell
2015-02-27 15:29                                                       ` Ian Campbell
2015-02-27 16:35                                                       ` Jan Beulich
2015-02-27 16:50                                                         ` Ian Campbell
2015-02-27 17:15                                                           ` Stefano Stabellini
2015-03-02 11:48                                                             ` Ian Campbell
2015-03-03  9:19                                                               ` Manish Jaggi
2015-03-17  5:26                                                           ` Manish Jaggi
2015-03-17  7:28                                                             ` Jan Beulich
2015-03-17 12:06                                                               ` Manish Jaggi
2015-03-17 12:31                                                                 ` Jan Beulich
2015-03-18  4:05                                                                   ` Manish Jaggi
2015-03-17 13:17                                                             ` Konrad Rzeszutek Wilk
2015-03-11 18:26                           ` Stefano Stabellini
2015-03-12  9:16                             ` Jan Beulich
2015-03-12 10:33                               ` Stefano Stabellini
2015-03-12 11:28                                 ` Jan Beulich
2015-03-12  9:30                             ` Ian Campbell
2015-02-20 14:14             ` Manish Jaggi
2015-02-20 14:39               ` Ian Campbell
2015-02-23 10:59                 ` Manish Jaggi
2015-02-23 11:14                   ` Julien Grall
2015-02-23 11:50                     ` Manish Jaggi
2015-02-23 15:15                       ` Julien Grall
2015-02-23 17:12                         ` Manish Jaggi
2015-02-23 21:39                           ` Julien Grall
2015-02-24  0:23                             ` Manish Jaggi
2015-02-24 13:43                               ` Julien Grall
2015-02-25  2:33                                 ` Manish Jaggi
2015-02-25 10:20                                   ` Ian Campbell
2015-02-26 10:49                                     ` Vijay Kilari
2015-02-26 11:12                                       ` Ian Campbell
2015-02-26 13:58                                         ` Julien Grall
2015-02-26 14:46                                       ` Pranavkumar Sawargaonkar
2015-02-26 15:17                                         ` Julien Grall
2015-02-27 10:11                                           ` Pranavkumar Sawargaonkar
2015-02-27 10:38                                             ` Ian Campbell
2015-02-27 13:22                                               ` Ian Campbell
2015-02-27 13:59                                                 ` Vijay Kilari
2015-02-20 13:37       ` Ian Campbell

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=1424706397.27930.178.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=julien.grall@linaro.org \
    --cc=mjaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.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