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>,
	Ian Campbell <ian.campbell@citrix.com>
Cc: Prasun Kapoor <Prasun.kapoor@caviumnetworks.com>,
	"Kumar, Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	"Kulkarni, Ganapatrao" <Ganapatrao.Kulkarni@caviumnetworks.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: PCI Pass-through in Xen ARM - Draft 2.
Date: Thu, 9 Jul 2015 15:57:20 +0200	[thread overview]
Message-ID: <559E7DC0.7070707@citrix.com> (raw)
In-Reply-To: <559E4D3C.2010805@caviumnetworks.com>



On 09/07/2015 12:30, Manish Jaggi wrote:
> On Thursday 09 July 2015 01:38 PM, Julien Grall wrote:
>> On 09/07/2015 08:13, Manish Jaggi wrote:
>>>>
>>>> If this was a domctl there might be scope for accepting an
>>>> implementation which made assumptions such as sbdf == deviceid. However
>>>> I'd still like to see this topic given proper treatment in the design
>>>> and not just glossed over with "this is how ThunderX does things".
>>> I got your point.
>>>> Or maybe the solution is simple and we should just do it now -- i.e.
>>>> can
>>>> we add a new field to the PHYSDEVOP_pci_host_bridge_add argument struct
>>>> which contains the base deviceid for that bridge
>>> deviceId would be same as sbdf. As we dont have a way to translate sbdf
>>> to deviceID.
>>
>> I think we have to be clear in this design document about the
>> different meaning.
>>
>> When the Device Tree is used, it's assumed that the deviceID will be
>> equal to the requester ID and not the sbdf.
> Does SMMU v2 has a concept of requesterID.
> I see requesterID term in SMMUv3

The requester ID is part of the PCI spec and not the SMMU.

The version of the SMMUv2 spec doesn't mention anything about PCI. I 
suspect this is because the spec has been written before the introduced 
PCI. And therefore this is implementation defined.

>>
>> Linux provides a function (pci_for_each_dma_alias) which will return a
>> requester ID for a given PCI device. It appears that the BDF (the 's'
>> of sBDF is only internal to Linux and not part of the hardware) is
>> equal to the requester ID on your platform but we can't assume it for
>> anyone else.
> so you mean requesterID = pci_for_each_dma_alias(sbdf)

Yes.

>>
>> When we have a PCI in hand, we have to find the requester ID for this
>> device.
> That is the question. How to map requesterID to sbdf

See above.

>> On
> Once ?

Yes.

>> we have it we can deduce the streamID and the deviceID. The way to do
>> it will depend on whether we use device tree or ACPI:
>>     - For device tree, the streamID, and deviceID will be equal to the
>> requester ID
> what do you think should be streamID when a device is PCI EP and is
> enumerated. Also per ARM SMMU 2.0 spec  StreamID is implementation
> specific.
> As per SMMUv3 specs
> "For PCI, it is intended that StreamID is generated from the PCI
> RequesterID. The generation function may be 1:1
> where one Root Complex is hosted by one SMMU"

I think my sentence "For device tree, the streamID, and deviceID will be 
equal to the requester ID" is pretty clear. FWIW, this is the solution 
chosen for Linux:

"Assume Stream ID == Requester ID for now. We need a way to describe the 
ID mappings in FDT" (see arm_smmu_add_pci_device in 
drivers/iommu/arm-smmu.c).

You can refer to my point below about ACPI tables. The solution would be 
exactly the same. If we have a requester ID in hand we can do pretty 
much everything.

The whole point of my previous email is to give insight about what we 
need and what we can deduce based on firmware tables. I didn't cover 
anything implementation details.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-07-09 13:57 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-28 18:38 PCI Pass-through in Xen ARM - Draft 2 Manish Jaggi
2015-06-29 10:31 ` Julien Grall
2015-06-29 10:50   ` Ian Campbell
2015-06-29 11:00     ` Julien Grall
2015-07-05  5:55   ` Manish Jaggi
2015-07-06  6:13     ` Manish Jaggi
2015-07-06  9:11     ` Ian Campbell
2015-07-06 10:06       ` Manish Jaggi
2015-07-06 10:20         ` Ian Campbell
2015-07-29  9:37           ` Manish Jaggi
2015-07-30  9:54             ` Ian Campbell
2015-07-30 12:51               ` Manish Jaggi
2015-07-30 14:39                 ` Ian Campbell
2015-07-31  7:46                   ` Manish Jaggi
2015-07-31  8:05                     ` Ian Campbell
2015-07-31 10:32                       ` Ian Campbell
2015-07-31 14:24                         ` Konrad Rzeszutek Wilk
2015-07-31 11:07                       ` Manish Jaggi
2015-07-31 11:19                         ` Ian Campbell
2015-07-31 12:50                           ` Manish Jaggi
2015-07-31 12:57                             ` Ian Campbell
2015-07-31 12:59                             ` Julien Grall
2015-07-31 13:27                               ` Ian Campbell
2015-07-31 14:33                               ` Manish Jaggi
2015-07-31 14:56                                 ` Julien Grall
2015-07-31 15:12                                   ` Manish Jaggi
2015-07-31 15:13                                     ` Julien Grall
2015-07-06 10:43     ` Julien Grall
2015-07-06 11:09       ` Manish Jaggi
2015-07-06 11:45         ` Julien Grall
2015-07-07  7:10           ` Manish Jaggi
2015-07-07  8:18             ` Julien Grall
2015-07-07  8:46               ` Manish Jaggi
2015-07-07 10:54                 ` Manish Jaggi
2015-07-07 11:24                 ` Ian Campbell
2015-07-09  7:13                   ` Manish Jaggi
2015-07-09  8:08                     ` Julien Grall
2015-07-09 10:30                       ` Manish Jaggi
2015-07-09 13:57                         ` Julien Grall [this message]
2015-07-10  6:07                           ` Pranavkumar Sawargaonkar
2015-07-14 16:37                       ` Stefano Stabellini
2015-07-14 16:46                         ` Stefano Stabellini
2015-07-14 16:58                           ` Julien Grall
2015-07-14 18:01                             ` Stefano Stabellini
2015-07-22  5:41                               ` Manish Jaggi
2015-07-22  8:34                                 ` Julien Grall
2015-07-14 16:47                   ` Stefano Stabellini
2015-07-07 15:27     ` Konrad Rzeszutek Wilk
2015-06-29 15:34 ` Ian Campbell
2015-07-05  6:07 Manish Jaggi
2015-07-06  9:07 ` 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=559E7DC0.7070707@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ganapatrao.Kulkarni@caviumnetworks.com \
    --cc=Prasun.kapoor@caviumnetworks.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --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;
as well as URLs for NNTP newsgroup(s).