xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Manish Jaggi <mjaggi@caviumnetworks.com>,
	"Jaggi, Manish" <Manish.Jaggi@caviumnetworks.com>,
	Xen Devel <xen-devel@lists.xen.org>
Cc: "Prasun.kapoor@cavium.com" <Prasun.kapoor@cavium.com>,
	"Ian Campbell" <ian.campbell@citrix.com>,
	"★ Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"Kumar, Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
	"Daney, David" <David.Daney@caviumnetworks.com>
Subject: Re: PCI Pass-through in Xen ARM: Draft 4
Date: Sat, 19 Sep 2015 21:48:43 +0100	[thread overview]
Message-ID: <55FDCA2B.80309@citrix.com> (raw)
In-Reply-To: <55FDC464.70003@caviumnetworks.com>

Hi Manish,

On 19/09/2015 21:24, Manish Jaggi wrote:
> On Wednesday 16 September 2015 06:28 PM, Julien Grall wrote:
>> On 15/09/15 19:58, Jaggi, Manish wrote:
>>>> I can see 2 different solutions:
>>>>      1) Let DOM0 pass the first requester ID when registering the bus
>>>>         Pros:
>>>>          * Less per-platform code in Xen
>>>>         Cons:
>>>>          * Assume that the requester ID are contiguous. (Is it really a
>>>> cons?)
>>>>          * Still require quirk for buggy device (i.e requester ID not
>>>> correct)
>>>>      2) Do it in Xen
>>>>         Pros:
>>>>          * We are not relying on DOM0 giving the requester ID
>>>>              => Not assuming contiguous requester ID
>>>>          Cons:
>>>>          * Per PCI bridge code to handle the mapping
>>>>
>>>    We can have (3) that when PHYSDEVOP_pci_add_device is called the sbdf
>>> and requesterID both are passed in hypercall.
>> The name of the physdev operation is PHYSDEVOP_pci_device_add and not
>> PHYSDEVOP_pci_add_device. Please rename it all the usage in the design
>> doc.
>>
>> Although, we can't modify PHYSDEVOP_pci_device_add because it's part of
>> the ABI which is stable.
>>
>> Based on David's mail, the requester ID of a given device can be found
>> using base + devfn where base is the first requesterID of the bus.
>>
>> IIRC, this is also match the IORT ACPI spec.
>>
>> So for now, I would extend the physdev you've introduced to add an host
>> bridge (PHYSDEV_pci_host_bridge_add) to pass the base requesterID.
> The requester-ID is derived from the Node# and ECAM# as per David. I
> guess the ECAM and Node# can be derived from
> the cfg_addr.

There is no place for "I guess". Any approximation here would lead to 
add more hypercalls because we design the first one on speculation.

> Each Ecam has a cfg_addr in Thunder, which is mentioned in the pci node
> in device tree.

IIUC what you said, you suggest to retrieve the ECAM based on the 
cfg_addr in Xen, right?

If so, this is the wrong way to go we should avoid to have platform 
specific code in Xen as much as possible and get everything either via 
the firmware table (ACPI or DT) or via hypercall.

> For thunder I think we don't need to pass requester-ID in the phydevop.

May I remind you that this design doc is not about Thunder-X but PCI 
passthrough in general. If your platform already requires specific code 
in Xen to get the requester ID, what prevents other to not do the same?

So it looks like to me that adding the base requester-ID in the 
PHYSDEVOP_pci_host_bridge_add is the right way to go.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-09-19 20:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13  9:42 PCI Pass-through in Xen ARM: Draft 4 Manish Jaggi
2015-08-13 10:37 ` Julien Grall
2015-09-02 15:19   ` Ian Campbell
2015-09-02 15:40     ` Julien Grall
2015-08-13 15:29 ` Jan Beulich
2015-08-13 17:01   ` Ian Campbell
2015-08-14  9:26     ` Jan Beulich
2015-08-14 13:21       ` Stefano Stabellini
2015-08-14 13:58         ` Jan Beulich
2015-08-14 14:03           ` Stefano Stabellini
2015-08-14 14:34             ` Jan Beulich
2015-08-14 14:37               ` Stefano Stabellini
2015-08-14 14:45                 ` Julien Grall
2015-08-14 15:15                   ` Jan Beulich
2015-08-14 15:24                     ` Stefano Stabellini
2015-09-02 14:45               ` Ian Campbell
2015-09-02 14:52                 ` Jan Beulich
2015-09-02 15:07                   ` Ian Campbell
2015-09-02 14:47       ` Ian Campbell
2015-08-14 15:38   ` Stefano Stabellini
2015-08-14 18:58     ` Jaggi, Manish
2015-08-16 23:59       ` Stefano Stabellini
2015-09-02 14:57   ` Ian Campbell
2015-09-02 15:06     ` Jan Beulich
2015-08-31 12:36 ` Manish Jaggi
2015-09-01  7:32   ` Jan Beulich
2015-09-02 12:08     ` Manish Jaggi
2015-09-02 12:59       ` Julien Grall
2015-09-02 13:46         ` Ian Campbell
2015-09-02 15:03           ` Ian Campbell
2015-09-02 15:03         ` Ian Campbell
2015-09-01 16:15 ` Stefano Stabellini
2015-09-10  1:12 ` Julien Grall
2015-09-15 18:58   ` Jaggi, Manish
2015-09-15 21:18     ` David Daney
2015-09-16 12:58     ` Julien Grall
2015-09-19 20:24       ` Manish Jaggi
2015-09-19 20:48         ` Julien Grall [this message]
2015-09-19 21:51           ` Daney, David
2015-09-21 10:17             ` Julien Grall

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=55FDCA2B.80309@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=David.Daney@caviumnetworks.com \
    --cc=Manish.Jaggi@caviumnetworks.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --cc=mjaggi@caviumnetworks.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;
as well as URLs for NNTP newsgroup(s).