From: Shannon Zhao <zhaoshenglong@huawei.com>
To: xen-devel <xen-devel@lists.xen.org>,
Jan Beulich <jbeulich@suse.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Julien Grall <julien.grall@citrix.com>,
parth.dixit@linaro.org,
Christoffer Dall <christoffer.dall@linaro.org>,
Shannon Zhao <shannon.zhao@linaro.org>
Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
Shannon Zhao <zhaoshenglong@huawei.com>
Subject: Design doc of adding ACPI support for arm64 on Xen
Date: Tue, 4 Aug 2015 21:43:27 +0800 [thread overview]
Message-ID: <55C0C17F.5040208@huawei.com> (raw)
This document is going to explain the design details of Xen booting with
ACPI on ARM. Maybe parts of it may not be appropriate. Any comments are
welcome.
To Xen itself booting with ACPI, this is similar to Linux kernel except
that Xen doesn't parse DSDT table. So I'll skip this part and focus on
how Xen prepares ACPI tables for DOM0 and how Xen passes them to DOM0.
1)copy and change some EFI and ACPI tables.
a) Copy EFI_SYSTEM_TABLE and change the value of FirmwareVendor,
VendorGuid, VendorTable, ConfigurationTable. These changes are not
very special and it just assign values to these members.
b) Create EFI_MEMORY_DESCRIPTOR table. This will add memory start and
size information of DOM0. And DOM0 will get the memory information
through this EFI table.
c) Copy FADT table. Change the value of arm_boot_flags to enable PSCI
and HVC. Let the hypervisor_id be "XenVMM" in order to tell DOM0
that it runs on Xen hypervisor, so DOM0 can call hypercall to get
some informations for booting necessity, such as grant tab start
address and size. Change header revison, length and checksum as
well.
d) Copy GTDT table. Set non_secure_el2_interrupt and
non_secure_el2_flags to 0 to mask EL2 timer for DOM0.
e) Copy MADT table. According to the value of dom0_max_vcpus to change
the number GICC entries.
f) Create STAO table. This table is a new added one that's used to
define a list of ACPI namespace names that are to be ignored by the
OSPM in DOM0. Currently we use it to tell OSPM should ignore UART
defined in SPCR table.
g) Copy XSDT table. Add a new table entry for STAO and change other
table's entries.
h) Change the value of xsdt_physical_address in RSDP table.
i) The reset of tables are not copied or changed. They are reused
including DSDT, SPCR.
All these tables will be copied or mapped to guest memory.
2)Create minimal DT to pass required informations to DOM0
The minimal DT mainly passes DOM0 bootargs, address and size of initrd
(if available), address and size of uefi system table, address and
size of uefi memory table, uefi-mmap-desc-size and uefi-mmap-desc-ver.
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.
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.
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?
5)How route device interrupt to DOM0
Currently we route all the SPI interrupts to DOM0 before DOM0 booting.
But this maybe a workaround. What's the right choice? After DOM0
parses the interrupt information from DSDT and call a hypercall to
route them?
Look forward to your comments.
Thanks,
--
Shannon
next reply other threads:[~2015-08-04 13:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 13:43 Shannon Zhao [this message]
2015-08-04 14:37 ` Design doc of adding ACPI support for arm64 on Xen Stefano Stabellini
2015-08-04 14:59 ` Shannon Zhao
2015-08-05 9:29 ` Shannon Zhao
2015-08-05 10:23 ` Julien Grall
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=55C0C17F.5040208@huawei.com \
--to=zhaoshenglong@huawei.com \
--cc=christoffer.dall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@citrix.com \
--cc=parth.dixit@linaro.org \
--cc=peter.huangpeng@huawei.com \
--cc=shannon.zhao@linaro.org \
--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 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.