Xen-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Jaggi <mjaggi@caviumnetworks.com>
To: Ian Campbell <ian.campbell@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: Prasun.kapoor@cavium.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.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: Tue, 17 Mar 2015 10:56:48 +0530	[thread overview]
Message-ID: <5507BB18.2020406@caviumnetworks.com> (raw)
In-Reply-To: <1425055836.14641.256.camel@citrix.com>


On Friday 27 February 2015 10:20 PM, Ian Campbell wrote:
> On Fri, 2015-02-27 at 16:35 +0000, Jan Beulich wrote:
>>>>> On 27.02.15 at 16:24, <ian.campbell@citrix.com> wrote:
>>> On Fri, 2015-02-27 at 14:54 +0000, Stefano Stabellini wrote:
>>>> MMCFG is a Linux config option, not to be confused with
>>>> PHYSDEVOP_pci_mmcfg_reserved that is a Xen hypercall interface.  I don't
>>>> think that the way Linux (or FreeBSD) call PHYSDEVOP_pci_mmcfg_reserved
>>>> is relevant.
>>> My (possibly flawed) understanding was that pci_mmcfg_reserved was
>>> intended to propagate the result of dom0 parsing some firmware table or
>>> other to the hypevisor.
>> That's not flawed at all.
> I think that's a first in this thread ;-)
>
>>> In Linux dom0 we call it walking pci_mmcfg_list, which looking at
>>> arch/x86/pci/mmconfig-shared.c pci_parse_mcfg is populated by walking
>>> over a "struct acpi_table_mcfg" (there also appears to be a bunch of
>>> processor family derived entries, which I guess are "quirks" of some
>>> sort).
>> Right - this parses ACPI tables (plus applies some knowledge about
>> certain specific systems/chipsets/CPUs) and verifies that the space
>> needed for the MMCFG region is properly reserved either in E820 or
>> in the ACPI specified resources (only if so Linux decides to use
>> MMCFG and consequently also tells Xen that it may use it).
> Thanks.
>
> So I think what I wrote in <1424948710.14641.25.camel@citrix.com>
> applies as is to Device Tree based ARM devices, including the need for
> the PHYSDEVOP_pci_host_bridge_add call.
>
> On ACPI based devices we will have the MCFG table, and things follow
> much as for x86:
>
>        * Xen should parse MCFG to discover the PCI host-bridges
>        * Dom0 should do likewise and call PHYSDEVOP_pci_mmcfg_reserved in
>          the same way as Xen/x86 does.
>
> The SBSA, an ARM standard for "servers", mandates various things which
> we can rely on here because ACPI on ARM requires an SBSA compliant
> system. So things like odd quirks in PCI controllers or magic setup are
> spec'd out of our zone of caring (into the firmware I suppose), hence
> there is nothing like the DT_DEVICE_START stuff to register specific
> drivers etc.
>
> The PHYSDEVOP_pci_host_bridge_add call is not AFAICT needed on ACPI ARM
> systems (any more than it is on x86). We can decide whether to omit it
> from dom0 or ignore it from Xen later on.
>
> (Manish, this is FYI, I don't expect you to implement ACPI support!)

In drivers/xen/pci.c on notification BUS_NOTIFY_ADD_DEVICE dom0 issues a 
hypercall to inform xen that a new pci device has been added.
If we were to inform xen about a new pci bus that is added there are  2 ways
a) Issue the hypercall from drivers/pci/probe.c
b) When a new device is found (BUS_NOTIFY_ADD_DEVICE) issue 
PHYSDEVOP_pci_device_add hypercall to xen, if xen does not finds that 
segment number (s_bdf), it will return an error
SEG_NO_NOT_FOUND. After that the linux xen code could issue the 
PHYSDEVOP_pci_host_bridge_add hypercall.

I think (b) can be done with minimal code changes. What do you think ?

> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-03-17  5:26 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
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 [this message]
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=5507BB18.2020406@caviumnetworks.com \
    --to=mjaggi@caviumnetworks.com \
    --cc=JBeulich@suse.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.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