From: Jiandi An <anjiandi@codeaurora.org>
To: Julien Grall <julien.grall@arm.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"sstabellini@kernel.org" <sstabellini@kernel.org>,
"shankerd@codeaurora.org" <shankerd@codeaurora.org>,
"Jaggi, Manish" <Manish.Jaggi@cavium.com>
Subject: Re: Xen: ARM: Support for mapping ECAM PCIe Config Space Specified In Static ACPI Table
Date: Tue, 20 Dec 2016 00:31:22 -0600 [thread overview]
Message-ID: <5858D03A.7050704@codeaurora.org> (raw)
In-Reply-To: <5a5cb82c-4408-0e31-f447-4f6ebdcd2fc6@arm.com>
On 12/19/16 07:11, Julien Grall wrote:
>
>
> On 19/12/2016 13:20, Jaggi, Manish wrote:
>>> On 16/12/2016 15:49, Julien Grall wrote:
>>>> On 14/12/16 08:00, Jiandi An wrote:
>>>>> Xen currently doesn't map ECAM space specified in static ACPI table.
>>>>> Seeking opinion on how this should be handled properly.
>>>>> Each root complex ECAM region takes up 64K 4K pages (256MB).
>>>>> For some platforms there might be multiple root complexes.
>>>>> Is the plan to map all at once?Julien has mentioned support
>>>>> for mapping ECAM may come when support for PCI passthrough is
>>>>> added, is that right? What mechanism will it be? Will Xen or
>>>>> dom0 be the one that parses the staic ACPI tables and map the ECAM space?
>>>>
>>>> For performance reason, each ECAM region would need to be mapped at
>>>> once, so the stage-2 page table could take advantage of superpage (it
>>>> will mostly be 2MB).
>>>>
>>>> Now, I don't think Xen should map the ECAM region in stage-2 before
>>>> hand. All the regions may not be described in the MCFG and I would like
>>>> to see a generic solution.
>>>>
>>>> Looking at the code (see pci_create_ecam_create in drivers/pci/ecam.c),
>>>> ioremap is used. I believe the problem is the same for the 2 other
>>>> threads you sent ( [1] and [2]).
>>>>
>>>> So it might be good to look at hooking up a call to
>>>> XENMEM_add_to_physmap_range in ioremap.
>>>>
>>>> Any opinions?
>>>
>>> I thought a bit more about it and I realized we need to be cautious on
>>> how to proceed here.
>>>
>>> DOM0 will have a mix of real devices and emulated devices (e.g some part
>>> of the GIC). For the emulated devices, DOM0 should not call
>>> XENMEM_add_to_physmap_range. However, DOM0 is not aware what is emulated
>>> or not, so even the current approach (hooking up in platform device)
>>> seems fragile. We rely on Xen to say "this region cannot be mapped".
>>>
>> Why not add support for parsing ACPI tables in Xen, from linux, as we parse dt.
>
> Because MMIO can be described in ASL too. I would rather avoid to have a different behavior depending whether the MMIO has been described in static table or ASL.
>
> Cheers,
>
I also think hooking up a call to XENMEM_add_to_physmap_range in ioremap
is not a good approach as ioremap() is commonly called in so many places.
It's not ideal to make a check of am I dom0 running under xen every time
ioremap() is called. And Julien also pointed out, not every call to ioremap()
needs a stage 2 mapping.
--
Jiandi An
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-20 6:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 8:00 Xen: ARM: Support for mapping ECAM PCIe Config Space Specified In Static ACPI Table Jiandi An
2016-12-16 14:49 ` Julien Grall
2016-12-19 10:37 ` Julien Grall
2016-12-19 12:20 ` Jaggi, Manish
2016-12-19 13:11 ` Julien Grall
2016-12-20 6:31 ` Jiandi An [this message]
2016-12-20 11:38 ` Julien Grall
2016-12-20 22:40 ` Stefano Stabellini
2016-12-19 23:54 ` Stefano Stabellini
2016-12-20 12:02 ` Julien Grall
2016-12-20 22:33 ` Stefano Stabellini
2016-12-28 18:22 ` Julien Grall
2017-01-03 9:10 ` Jan Beulich
2017-01-03 19:27 ` Stefano Stabellini
2017-01-16 14:05 ` Julien Grall
2017-01-16 19:28 ` Stefano Stabellini
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=5858D03A.7050704@codeaurora.org \
--to=anjiandi@codeaurora.org \
--cc=Manish.Jaggi@cavium.com \
--cc=julien.grall@arm.com \
--cc=shankerd@codeaurora.org \
--cc=sstabellini@kernel.org \
--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).