xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Shannon Zhao <shannon.zhao@linaro.org>
Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	Hangaohuai <hangaohuai@huawei.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	stefano.stabellini@eu.citrix.com, andrew@fubar.geek.nz,
	xen-devel@lists.xen.org, julien.grall@citrix.com,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	david.vrabel@citrix.com, JBeulich@suse.com,
	Shannon Zhao <zhaoshenglong@huawei.com>,
	boris.ostrovsky@oracle.com, Parth Dixit <parth.dixit@linaro.org>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: Design doc of adding ACPI support for arm64 on Xen - version 3
Date: Fri, 14 Aug 2015 11:59:41 -0400	[thread overview]
Message-ID: <20150814155940.GA4779@l.oracle.com> (raw)
In-Reply-To: <55CE0247.4030805@linaro.org>

On Fri, Aug 14, 2015 at 10:59:19PM +0800, Shannon Zhao wrote:
> 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.
> 
> Changes v2->v3:
> * remove the two HVM_PARAMs for grant table and let linux kernel use
> xlated_setup_gnttab_pages() to setup grant table.
> * don't modify GTDT table
> * add definition of event-channel interrupt flag
> * state that route all Xen unused interrupt to Dom0
> * state that reusing existing PCI bus_notifier for PCI devices MMIO mapping
> 
> 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, then Dom0 could through HVM_PARAM to get some
> informations for booting necessity, such as event-channel interrupt.
> Change header revison, length and checksum as well.
> 
> d) Copy MADT table. According to the value of dom0_max_vcpus to change
> the number GICC entries.
> 
> e) 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.


Would it make sense to include this URL
http://wiki.xenproject.org/mediawiki/images/0/02/Status-override-table.pdf


> 
> f) Copy XSDT table. Add a new table entry for STAO and change other
> table's entries.
> 
> g) Change the value of xsdt_physical_address in RSDP table.
> 
> h) The rest of tables are not copied or changed. They are reused
> including DSDT, SPCR, GTDT, etc.
> 
> All these tables will be copied to Dom0 memory except that the reused
> tables(DSDT, SPCR, GTDT, etc) will be mapped to Dom0.
> 
> 2. Create minimal DT to pass required information 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.
> 
> An example of the minimal DT:
> / {
>     #address-cells = <2>;
>     #size-cells = <1>;
>     chosen {
>         bootargs = "kernel=Image console=hvc0 earlycon=pl011,0x1c090000
> root=/dev/vda2 rw rootfstype=ext4 init=/bin/sh acpi=force";
>         linux,initrd-start = <0xXXXXXXXX>;
>         linux,initrd-end = <0xXXXXXXXX>;
>         linux,uefi-system-table = <0xXXXXXXXX>;
>         linux,uefi-mmap-start = <0xXXXXXXXX>;
>         linux,uefi-mmap-size = <0xXXXXXXXX>;
>         linux,uefi-mmap-desc-size = <0xXXXXXXXX>;
>         linux,uefi-mmap-desc-ver = <0xXXXXXXXX>;
>     };
> };
> 
> For details loook at
> https://github.com/torvalds/linux/blob/master/Documentation/arm/uefi.txt
> 
> 3. Dom0 gets grant table and event channel irq information
> -----------------------------------------------------------
> Make Linux call xlated_setup_gnttab_pages() to setup grant table. So it
> doesn't need Xen pass grant table start and size information to Dom0.
> 
> To event channel interrupt, reuse HVM_PARAM_CALLBACK_IRQ and add a new
> delivery type to get it.
> val[63:56] == 3: val[15:8] is flag: val[7:0] is a PPI (ARM and ARM64
> only)
> The definition of flag reusing the definition of xenv table. Bit 0
> stands interrupt mode and bit 1 stands interrupt polarity.
> 
> As said above, we assign the hypervisor_id be "XenVMM" to tell Dom0 that
> it runs on Xen hypervisor. Then Dom0 could get it through hypercall
> HVMOP_get_param.
> 
> 4. Map MMIO regions
> -------------------
> Register a bus_notifier for platform and amba bus in Linux. Add a new
> XENMAPSPACE "XENMAPSPACE_dev_mmio". Within the register, check if the
> device is newly added, then call hypercall XENMEM_add_to_physmap to map
> the mmio regions.
> 
> For PCI bus device, it could reuse the existing PCI bus_notifier like
> X86.
> 
> 5. Route device interrupts to Dom0
> ----------------------------------
> Route all the SPI interrupts to Dom0 before Dom0 booting, except the
> interrupts used by Xen. For uart, it could get the interrupt from SPCR
> table and exclude it. For SMMU, it could get the interrupts from IORT
> table and exclude them as well.
> 
> Thanks,
> -- 
> Shannon
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-08-14 15:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 14:59 Design doc of adding ACPI support for arm64 on Xen - version 3 Shannon Zhao
2015-08-14 15:17 ` Julien Grall
2015-08-17 13:01   ` Shannon Zhao
2015-08-17 16:10     ` Julien Grall
2015-08-18  3:19       ` Shannon Zhao
2015-08-18  6:36         ` Julien Grall
2015-08-18  7:23           ` Shannon Zhao
2015-08-18 16:13             ` Julien Grall
2015-08-14 15:59 ` Konrad Rzeszutek Wilk [this message]
2015-08-17 15:33 ` Jan Beulich
2015-08-17 16:19   ` Julien Grall
2015-08-18  5:10     ` Jan Beulich
2015-08-18  6:43       ` Julien Grall
2015-08-18  7:01         ` Jan Beulich
2015-08-18  7:46           ` Shannon Zhao
2015-08-18 19:01           ` Julien Grall
2015-08-18  3:41   ` Shannon Zhao
2015-08-18  5:14     ` Jan Beulich
2015-08-18  7:35       ` Shannon Zhao
2015-08-18  8:15         ` Jan Beulich
2015-08-18  8:21           ` Shannon Zhao
2015-08-18  9:11             ` Jan Beulich
2015-08-18  9:34               ` Shannon Zhao
2015-08-18 19:00                 ` Julien Grall
2015-09-02 11:43                   ` 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=20150814155940.GA4779@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew@fubar.geek.nz \
    --cc=boris.ostrovsky@oracle.com \
    --cc=christoffer.dall@linaro.org \
    --cc=david.vrabel@citrix.com \
    --cc=hangaohuai@huawei.com \
    --cc=ian.campbell@citrix.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=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 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).