All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Hangaohuai <hangaohuai@huawei.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Shannon Zhao <shannon.zhao@linaro.org>,
	Jan Beulich <jbeulich@suse.com>,
	parth.dixit@linaro.org,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: Design doc of adding ACPI support for arm64 on Xen
Date: Wed, 5 Aug 2015 11:23:45 +0100	[thread overview]
Message-ID: <55C1E431.1010200@citrix.com> (raw)
In-Reply-To: <55C1D783.3020908@huawei.com>

Hi Shannon,

On 05/08/15 10:29, Shannon Zhao wrote:
>>
>>> 3)DOM0 how to get grant table and event channel irq informations
>>>   As said above, we assign the hypervisor_id be "XenVMM" to tell DOM0
>>>   that it runs on Xen hypervisor.
>>>   Then save the start address and size
>>>   of grant table in domain->grant_table->start_addr and
>>>   domain->grant_table->size. DOM0 can call a new hypercall
>>>   GNTTABOP_get_start_addr to get these info.
>>>   Same to event channel, we've already save interrupt number in
>>>   d->arch.evtchn_irq, so DOM0 can call a new hypercall EVTCHNOP_get_irq
>>>   to get the irq.
>>
>> It would be nice to go down into more details and write the parameters
>> of the hypercalls in the doc as they will become a newly supported ABI.
>>
> The parameters of GNTTABOP_get_start_addr is like below:

The hypercall is not only giving the start but also the size. So I would
rename into GNTTABOP_get_region

>     struct gnttab_get_start_addr {
>         /* IN parameters */
>         domid_t dom;

The domain ID is not necessary. We only want to retrieve grant table
region of the current domain.

>         uint16_t pad;
>         /* OUT parameters */
>         uint64_t start_addr;
>         uint64_t size;
>     };
> 
> The parameters of EVTCHNOP_get_irq is like below:
>     struct evtchn_get_irq {
>         /* IN parameters. */
>        domid_t dom;

Same remark here.

>        uint16_t pad;
>        /* OUT parameters. */
>        uint32_t irq;

We also need to expose the type of the IRQ (i.e level/edge ...) as ACPI
and DT does.

This is to avoid been tight on edge interrupt for the event channel.

>     };
> 

OOI, did you consider to use an HVM_PARAM rather than introducing two
new hypercalls?

>> The evtchnop would need to be called something like
>> EVTCHNOP_get_notification_irq and would need to be ARM specific (on x86
>> things are different).
>>
>>
>>
>>> 4)How to map MMIO regions
>>>   a)Current implementation is mapping MMIO regions in Dom0 on demand
>>>     when trapping in Xen with a data abort.
>>
>> I think this approach is prone to failures. A driver could program a
>> device for DMA involving regions not yet mapped. As a consequence the
>> DMA operation would fail because the SMMU would stop the transaction.
>>
>>
>>>   b)Another way is to map all the non-ram memory regions before booting.
>>>     But as suggested by Stefano, this will use a lot of memory to store
>>>     the pagetables.
>>>   c)Another suggested way is to use a hypercall from DOM0 to request
>>>     MMIO regions mappings after Linux complete parsing the DSDT. But I
>>>     didn't find a proper place to issue this call. Anyone has some
>>>     suggestion?
>>
>> I suggested to exploit the bus_notifier callbacks and issue an hypercall
>> there. In the case of the PCI bus, we are already handling notifications
>> in drivers/xen/pci.c:xen_pci_notifier.
>>
>> Once you have a struct pci_dev pointer in your hand, you can get the
>> MMIO regions from pdev->resource[bar].
>>
>> Does that work?
>>
> 
> I investigate and test this approach. Adding a bus notifier for platform
> bus, it could map the mmio regions.
> 
> Stefano, thanks for your suggestion. And does anyone else have other
> comments on this approach?

I think this approach would be the best one.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-08-05 10:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 13:43 Design doc of adding ACPI support for arm64 on Xen Shannon Zhao
2015-08-04 14:37 ` Stefano Stabellini
2015-08-04 14:59   ` Shannon Zhao
2015-08-05  9:29   ` Shannon Zhao
2015-08-05 10:23     ` Julien Grall [this message]
2015-08-05 10:33       ` Stefano Stabellini
2015-08-05 10:31     ` Stefano Stabellini
2015-08-05 11:49       ` Shannon Zhao
2015-08-05 12:48         ` Julien Grall
2015-08-05 13:03           ` Shannon Zhao
2015-08-05 13:25             ` Julien Grall
2015-08-05 16:47               ` Stefano Stabellini
2015-08-05 16:52                 ` Stefano Stabellini
2015-08-05 17:00                   ` Julien Grall
2015-08-11 20:43             ` Konrad Rzeszutek Wilk
2015-08-12  3:10               ` Shannon Zhao
2015-08-06  3:28       ` Shannon Zhao
2015-08-06  9:01         ` Stefano Stabellini
2015-08-04 14:43 ` Christoffer Dall
2015-08-04 15:03   ` Shannon Zhao

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=55C1E431.1010200@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=christoffer.dall@linaro.org \
    --cc=hangaohuai@huawei.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=parth.dixit@linaro.org \
    --cc=peter.huangpeng@huawei.com \
    --cc=shannon.zhao@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=zhaoshenglong@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.