Re: [Xen-devel] [PATCH v6 22/22] xen/arm64: Add ACPI support

2016-03-19 Thread Shannon Zhao
On 2016/3/17 19:31, Jan Beulich wrote: On 17.03.16 at 12:03, wrote: >> > On 2016/3/17 18:52, Jan Beulich wrote: >> > On 17.03.16 at 10:41, wrote: > >>> > --- a/xen/include/asm-arm/config.h > >>> > +++ b/xen/include/asm-arm/config.h > >>> > @@ -31,6 +31,10 @@ > >>> >

Re: [Xen-devel] [PATCH v6 19/22] hvm/params: Add a new delivery type for event-channel in HVM_PARAM_CALLBACK_IRQ

2016-03-19 Thread Shannon Zhao
On 2016/3/17 19:29, Jan Beulich wrote: On 17.03.16 at 12:04, wrote: >> On 2016/3/17 18:42, Jan Beulich wrote: >> On 17.03.16 at 10:41, wrote: > --- a/xen/include/public/hvm/params.h > +++ b/xen/include/public/hvm/params.h > @@ -49,11 +49,24 @@ > * Domain = val[47:32],

[Xen-devel] [PATCH v6 05/22] arm/acpi: Prepare MADT table for Dom0

2016-03-19 Thread Shannon Zhao
From: Shannon Zhao Copy main MADT table contents and distributor subtable from physical ACPI MADT table. Make other subtables through the callback of gic_hw_ops. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 50

[Xen-devel] [PATCH v6 15/17] ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services

2016-03-19 Thread Shannon Zhao
From: Shannon Zhao When running on Xen hypervisor, runtime services are supported through hypercall. Add a Xen specific function to initialize runtime services. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/arm/include/asm/xen/xen-ops.h | 6 ++ arch/arm/xen

[Xen-devel] [PATCH v6 06/17] Xen: ARM: Add support for mapping platform device mmio

2016-03-19 Thread Shannon Zhao
From: Shannon Zhao Add a bus_notifier for platform bus device in order to map the device mmio regions when DOM0 booting with ACPI. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- drivers/xen/Makefile | 1 + drivers/xen/arm-device.c | 141

[Xen-devel] [PATCH v6 04/22] arm/gic: Add a new callback for creating MADT table for Dom0

2016-03-19 Thread Shannon Zhao
From: Shannon Zhao Add a new member in gic_hw_operations which is used to creat MADT table for Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- xen/arch/arm/gic-v2.c | 34 ++ xen/arch/arm/gic-v3.c | 47

[Xen-devel] [PATCH v6 10/22] arm/acpi: Map all other tables for Dom0

2016-03-20 Thread Shannon Zhao
From: Shannon Zhao Map all other tables to Dom0 using 1:1 mappings. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm

[Xen-devel] [PATCH v6 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI

2016-03-20 Thread Shannon Zhao
From: Shannon Zhao When it's a Xen domain0 booting with ACPI, it will supply a /chosen and a /hypervisor node in DT. So check if it needs to enable ACPI. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Hanjun Guo --- arch/arm64/kernel/acpi.c | 12 1

[Xen-devel] [PATCH v6 03/17] Xen: xlate: Use page_to_xen_pfn instead of page_to_pfn

2016-03-20 Thread Shannon Zhao
From: Shannon Zhao Make xen_xlate_map_ballooned_pages work with 64K pages. In that case Kernel pages are 64K in size but Xen pages remain 4K in size. Xen pfns refer to 4K pages. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- drivers/xen/xlate_mmu.c | 26

[Xen-devel] [PATCH v6 19/22] hvm/params: Add a new delivery type for event-channel in HVM_PARAM_CALLBACK_IRQ

2016-03-20 Thread Shannon Zhao
From: Shannon Zhao This new delivery type which is for ARM shares the same value with HVM_PARAM_CALLBACK_TYPE_VECTOR which is for x86. val[15:8] is flag: val[7:0] is a PPI. To the flag, bit 8 stands the interrupt mode is edge(1) or level(0) and bit 9 stands the interrupt polarity is active low

[Xen-devel] [PATCH v6 16/22] arm/acpi: Configure SPI interrupt type and route to Dom0 dynamically

2016-03-20 Thread Shannon Zhao
From: Shannon Zhao Interrupt information is described in DSDT and is not available at the time of booting. Check if the interrupt is permitted to access and set the interrupt type, route it to guest dynamically only for SPI and Dom0. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao

Re: [Xen-devel] [PATCH v6 01/22] arm/acpi: Estimate memory required for acpi/efi tables

2016-03-22 Thread Shannon Zhao
On 2016年03月19日 02:44, Julien Grall wrote: >> +++ b/xen/arch/arm/efi/efi-dom0.h > > Why does this header live in arch/arm/efi instead of include/asm-arm? Because this file only externs the acpi_mem and is included in the files under the same directory and there is no such same name file for x86. So

Re: [Xen-devel] [PATCH v6 09/22] arm/p2m: Add helper functions to map memory regions

2016-03-22 Thread Shannon Zhao
On 2016年03月21日 23:52, Julien Grall wrote: > Title: to map/unmap > > On 17/03/2016 09:40, Shannon Zhao wrote: >> diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h >> index 433952a..17be6ad 100644 >> --- a/xen/include/asm-arm/p2m.h >> +++ b/xen/i

Re: [Xen-devel] [PATCH v6 11/22] arm/acpi: Prepare EFI system table for Dom0

2016-03-22 Thread Shannon Zhao
On 2016年03月22日 00:10, Julien Grall wrote: > Hi Shannon, > > On 17/03/2016 09:40, Shannon Zhao wrote: > > [...] > >> diff --git a/xen/arch/arm/efi/efi-dom0.c b/xen/arch/arm/efi/efi-dom0.c >> index 90a7699..b8a062c 100644 >> --- a/xen/arch/arm/efi/efi-dom0.c

Re: [Xen-devel] [PATCH v6 12/22] arm/acpi: Prepare EFI memory descriptor for Dom0

2016-03-22 Thread Shannon Zhao
On 2016年03月22日 00:51, Julien Grall wrote: >> +memory_map[offset].Attribute = EFI_MEMORY_WB; >> +} >> + >> +for( i = 0; i < acpi_mem.nr_banks; i++, offset++ ) >> +{ >> +memory_map[offset].Type = EfiACPIReclaimMemory; >> +memory_map[offset].PhysicalStart = acpi_mem

Re: [Xen-devel] [PATCH v6 13/22] arm/acpi: Map the new created EFI and ACPI tables to Dom0

2016-03-22 Thread Shannon Zhao
On 2016年03月22日 08:42, Julien Grall wrote: > Hi Shannon, > > On 17/03/2016 09:40, Shannon Zhao wrote: >> From: Shannon Zhao >> >> Map the UEFI and ACPI tables which we created to non-RAM space in Dom0. >> >> Signed-off-by: Shannon Zhao >> Reviewed-by:

Re: [Xen-devel] [PATCH v6 14/22] arm/acpi: Create min DT stub for Dom0

2016-03-22 Thread Shannon Zhao
On 2016年03月22日 09:07, Julien Grall wrote: > >> +int __init arm_acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]) > > It's odd to have this function in efi-dom0.c. We want to keep all the > device tree creation together. > We've discussed this before. We want to reuse the definition of EFI

Re: [Xen-devel] [PATCH v6 13/22] arm/acpi: Map the new created EFI and ACPI tables to Dom0

2016-03-24 Thread Shannon Zhao
On 2016年03月23日 00:16, Julien Grall wrote: > Hi Shannon, > > On 22/03/16 13:18, Shannon Zhao wrote: >> On 2016年03月22日 08:42, Julien Grall wrote: >>> Hi Shannon, >>> >>> On 17/03/2016 09:40, Shannon Zhao wrote: >>>> From: Shannon Zhao >>

[Xen-devel] [PATCH v7 02/17] xen/grant-table: Move xlated_setup_gnttab_pages to common place

2016-03-24 Thread Shannon Zhao
Move xlated_setup_gnttab_pages to common place, so it can be reused by ARM to setup grant table. Rename it to xen_xlate_map_ballooned_pages. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/x86/xen/grant-table.c | 57 +-- drivers/xen

[Xen-devel] [PATCH v7 04/17] arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table

2016-03-24 Thread Shannon Zhao
Use xen_xlate_map_ballooned_pages to setup grant table. Then it doesn't rely on DT or ACPI to pass the start address and size of grant table. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 13 - 1 file changed, 4 insertions(+), 9 dele

[Xen-devel] [PATCH v7 13/17] ARM: Xen: Document UEFI support on Xen ARM virtual platforms

2016-03-24 Thread Shannon Zhao
Add a "uefi" node under /hypervisor node in FDT, then Linux kernel could scan this to get the UEFI information. CC: Rob Herring Signed-off-by: Shannon Zhao Acked-by: Rob Herring Reviewed-by: Stefano Stabellini --- Documentation/devicetree/bindings/arm/xe

[Xen-devel] [PATCH v7 05/17] xen: memory : Add new XENMAPSPACE type XENMAPSPACE_dev_mmio

2016-03-24 Thread Shannon Zhao
Add a new type of Xen map space for Dom0 to map device's MMIO region. Signed-off-by: Shannon Zhao --- include/xen/interface/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index 2ecfe4f..9aa8988 100644 --- a/in

[Xen-devel] [PATCH v7 09/17] xen/hvm/params: Add a new delivery type for event-channel in HVM_PARAM_CALLBACK_IRQ

2016-03-24 Thread Shannon Zhao
). Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- include/xen/interface/hvm/params.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/xen/interface/hvm/params.h b/include/xen/interface/hvm/params.h index 70ad208..4d61fc5 100644 --- a/include/xen/interface/hvm

[Xen-devel] [PATCH v7 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-24 Thread Shannon Zhao
PI) CC: linux-a...@vger.kernel.org (open list:ACPI) Signed-off-by: Shannon Zhao --- drivers/acpi/scan.c | 68 + 1 file changed, 68 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 5f28cf7..e96a058 100644 --- a/drivers/acpi/scan.

[Xen-devel] [PATCH v7 10/17] arm/xen: Get event-channel irq through HVM_PARAM when booting with ACPI

2016-03-24 Thread Shannon Zhao
When booting with ACPI, it could get the event-channel irq through HVM_PARAM_CALLBACK_IRQ. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/arch/arm

[Xen-devel] [PATCH v7 15/17] ARM64: XEN: Add a function to initialize Xen specific UEFI runtime services

2016-03-24 Thread Shannon Zhao
When running on Xen hypervisor, runtime services are supported through hypercall. Add a Xen specific function to initialize runtime services. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/arm/include/asm/xen/xen-ops.h | 6 ++ arch/arm/xen/Makefile

Re: [Xen-devel] [PATCH v6 15/22] arm/acpi: Permit access all Xen unused SPIs for Dom0

2016-03-24 Thread Shannon Zhao
On 2016年03月23日 02:18, Julien Grall wrote: > >> + * Dom0 configures the interrupt, set the interrupt type and >> route it to >> + * Dom0. >> + */ >> +for( i = NR_LOCAL_IRQS; i < vgic_num_irqs(d); i++ ) >> +{ >> +desc = irq_to_desc(i); >> +if( desc->action != NULL

[Xen-devel] [PATCH v7 06/17] Xen: ARM: Add support for mapping platform device mmio

2016-03-24 Thread Shannon Zhao
Add a bus_notifier for platform bus device in order to map the device mmio regions when DOM0 booting with ACPI. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- drivers/xen/Makefile | 1 + drivers/xen/arm-device.c | 141 +++ 2 files

[Xen-devel] [PATCH v7 03/17] Xen: xlate: Use page_to_xen_pfn instead of page_to_pfn

2016-03-24 Thread Shannon Zhao
Make xen_xlate_map_ballooned_pages work with 64K pages. In that case Kernel pages are 64K in size but Xen pages remain 4K in size. Xen pfns refer to 4K pages. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- drivers/xen/xlate_mmu.c | 26 -- 1 file changed

[Xen-devel] [PATCH v7 08/17] Xen: public/hvm: sync changes of HVM_PARAM_CALLBACK_VIA ABI from Xen

2016-03-24 Thread Shannon Zhao
Sync the changes of HVM_PARAM_CALLBACK_VIA ABI introduced by Xen commit (public/hvm: export the HVM_PARAM_CALLBACK_VIA ABI in the API). Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- include/xen/interface/hvm/params.h | 27 +-- 1 file changed, 21

[Xen-devel] [PATCH v7 11/17] ARM: XEN: Move xen_early_init() before efi_init()

2016-03-24 Thread Shannon Zhao
Move xen_early_init() before efi_init(), then when calling efi_init() could initialize Xen specific UEFI. Check if it runs on Xen hypervisor through the flat dts. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 56

[Xen-devel] [PATCH v7 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-03-24 Thread Shannon Zhao
Move x86 specific codes to architecture directory and export those EFI runtime service functions. This will be useful for initializing runtime service on ARM later. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- arch/x86/xen/efi.c| 112

[Xen-devel] [PATCH v7 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI

2016-03-24 Thread Shannon Zhao
When it's a Xen domain0 booting with ACPI, it will supply a /chosen and a /hypervisor node in DT. So check if it needs to enable ACPI. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Hanjun Guo --- arch/arm64/kernel/acpi.c | 12 1 file changed, 8 inser

[Xen-devel] [PATCH v7 16/17] FDT: Add a helper to get the subnode by given name

2016-03-24 Thread Shannon Zhao
Sometimes it needs to check if there is a subnode of given node in FDT by given name. Introduce this helper to get the subnode if it exists. CC: Rob Herring Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Acked-by: Rob Herring --- drivers/of/fdt.c | 13 + include

[Xen-devel] [PATCH v7 17/17] Xen: EFI: Parse DT parameters for Xen specific UEFI

2016-03-24 Thread Shannon Zhao
Add a new function to parse DT parameters for Xen specific UEFI just like the way for normal UEFI. Then it could reuse the existing codes. If Xen supports EFI, initialize runtime services. CC: Matt Fleming Signed-off-by: Shannon Zhao Reviewed-by: Matt Fleming Reviewed-by: Stefano Stabellini

Re: [Xen-devel] [PATCH v6 12/22] arm/acpi: Prepare EFI memory descriptor for Dom0

2016-03-24 Thread Shannon Zhao
On 2016年03月23日 00:04, Julien Grall wrote: > Hi Shannon, > > On 22/03/16 13:16, Shannon Zhao wrote: >> On 2016年03月22日 00:51, Julien Grall wrote: >>>> +memory_map[offset].Attribute = EFI_MEMORY_WB; >>>> +} >>>> + >&

[Xen-devel] [PATCH v7 07/17] Xen: ARM: Add support for mapping AMBA device mmio

2016-03-24 Thread Shannon Zhao
Add a bus_notifier for AMBA bus device in order to map the device mmio regions when DOM0 booting with ACPI. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- drivers/xen/arm-device.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a

Re: [Xen-devel] [PATCH v6 17/22] arm/gic: Add a new callback to deny Dom0 access to GIC regions

2016-03-24 Thread Shannon Zhao
On 2016年03月24日 20:45, Stefano Stabellini wrote: > On Tue, 22 Mar 2016, Julien Grall wrote: >> > Hi Shannon, >> > >> > On 17/03/16 09:41, Shannon Zhao wrote: >>> > > From: Shannon Zhao >>> > > >>> > > Add a new member in

[Xen-devel] [PATCH v7 00/17] Add ACPI support for Xen Dom0 on ARM64

2016-03-24 Thread Shannon Zhao
and wallclock patch from Stefano * Refactor AMBA and platform device MMIO map to one file * Use EFI_PARAVIRT to check if it supports XEN EFI * Refactor Xen EFI codes * Address other comments Shannon Zhao (17): Xen: ACPI: Hide UART used by Xen xen/grant-table: Move xlated_setup_gnttab_pages to commo

Re: [Xen-devel] [PATCH v6 15/22] arm/acpi: Permit access all Xen unused SPIs for Dom0

2016-03-25 Thread Shannon Zhao
On 2016/3/24 23:37, Julien Grall wrote: > Hi Shannon, > > On 24/03/16 15:01, Shannon Zhao wrote: >> On 2016年03月23日 02:18, Julien Grall wrote: >>> >>>> + * Dom0 configures the interrupt, set the interrupt type and >>>> route it to &

Re: [Xen-devel] [PATCH v7 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-25 Thread Shannon Zhao
On 2016/3/24 23:08, Rafael J. Wysocki wrote: > On Thu, Mar 24, 2016 at 3:44 PM, Shannon Zhao wrote: >> > +static void acpi_get_spcr_uart_addr(void) > static void __init acpi_get_spcr_uart_addr(void) > > I suppose? > > Apart from this it looks fine. > Thanks, I

[Xen-devel] [PATCH v8 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-25 Thread Shannon Zhao
From: Shannon Zhao ACPI 6.0 introduces a new table STAO to list the devices which are used by Xen and can't be used by Dom0. On Xen virtual platforms, the physical UART is used by Xen. So here it hides UART from Dom0. CC: "Rafael J. Wysocki" (supporter:ACPI) CC: Len Brown (sup

[Xen-devel] [PATCH v7 01/22] arm/acpi: Estimate memory required for acpi/efi tables

2016-03-25 Thread Shannon Zhao
Estimate the memory required for loading acpi/efi tables in Dom0. Make the length of each table aligned with 64bit. Alloc the pages to store the new created EFI and ACPI tables and free these pages when destroying domain. Signed-off-by: Shannon Zhao --- v7: address several comments from Julien

[Xen-devel] [PATCH v7 06/22] arm/acpi: Prepare STAO table for Dom0

2016-03-25 Thread Shannon Zhao
: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 41 + 1 file changed, 41 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 86fc3e0..c09fb26 100644 --- a/xen/arch/arm

[Xen-devel] [PATCH v7 08/22] arm/acpi: Prepare RSDP table for Dom0

2016-03-25 Thread Shannon Zhao
Copy RSDP table and replace rsdp->xsdt_physical_address with the address of XSDT table, so it can point to the right XSDT table. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 38 ++ 1 f

[Xen-devel] [PATCH v7 03/22] arm/acpi: Prepare FADT table for Dom0

2016-03-25 Thread Shannon Zhao
Copy and modify FADT table before passing it to Dom0. Set PSCI_COMPLIANT and PSCI_USE_HVC. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 43 +++ 1 file changed, 43 insertions

[Xen-devel] [PATCH v7 05/22] arm/acpi: Prepare MADT table for Dom0

2016-03-25 Thread Shannon Zhao
Copy main MADT table contents and distributor subtable from physical ACPI MADT table. Make other subtables through the callback of gic_hw_ops. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 60

[Xen-devel] [PATCH v7 10/22] arm/acpi: Map all other tables for Dom0

2016-03-25 Thread Shannon Zhao
Map all other ACPI tables into Dom0 using 1:1 mappings. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: Fix comments and printk log --- xen/arch/arm/domain_build.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/xen/arch/arm/domain_build.c b

[Xen-devel] [PATCH v7 00/22] Prepare UEFI and ACPI tables for Dom0 on ARM64

2016-03-25 Thread Shannon Zhao
o use ACPI. Then at last enable ACPI support on ARM64. See individual patch for changes. Thanks, Shannon [1] http://lists.xenproject.org/archives/html/xen-devel/2015-11/msg01831.html Parth Dixit (1): arm/p2m: Add helper functions to map memory regions Shannon Zhao (21): arm/acpi: Estimate m

[Xen-devel] [PATCH v7 07/22] arm/acpi: Prepare XSDT table for Dom0

2016-03-25 Thread Shannon Zhao
Copy and modify XSDT table before passing it to Dom0. Replace the entry value of the copied table. Add a new entry for STAO table as well. And keep entry value of other reused tables unchanged. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm

[Xen-devel] [PATCH v7 11/22] arm/acpi: Prepare EFI system table for Dom0

2016-03-25 Thread Shannon Zhao
Prepare EFI system table for Dom0 to describe the information of UEFI. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: use domain as parameter --- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/efi/efi-dom0.c | 45

[Xen-devel] [PATCH v7 14/22] arm/acpi: Create min DT stub for Dom0

2016-03-25 Thread Shannon Zhao
Bhat Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: change the function name and address comments --- docs/misc/arm/device-tree/guest.txt | 60 +++ xen/arch/arm/domain_build.c | 142 xen/a

[Xen-devel] [PATCH v7 04/22] arm/gic: Add a new callback for creating MADT table for Dom0

2016-03-25 Thread Shannon Zhao
Add a new member in gic_hw_operations which is used to create MADT table for Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: make other fields of GICC zero --- xen/arch/arm/gic-v2.c | 42 +++ xen/arch/arm/gic-v3.c | 56

[Xen-devel] [PATCH v7 09/22] arm/p2m: Add helper functions to map memory regions

2016-03-25 Thread Shannon Zhao
From: Parth Dixit Create a helper function for mapping with cached attributes and read-write range. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: rename to map_regions_rw_cache --- xen/arch/arm/p2m.c| 26

[Xen-devel] [PATCH v7 02/22] arm/acpi: Add a helper function to get the acpi table offset

2016-03-25 Thread Shannon Zhao
These tables are aligned with 64bit. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: add commnets to explain what thsi function does --- xen/arch/arm/acpi/lib.c| 20 xen/include/asm-arm/acpi.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a

[Xen-devel] [PATCH v7 20/22] xen/acpi: Fix event-channel interrupt when booting with ACPI

2016-03-25 Thread Shannon Zhao
Store the event-channel interrupt number and flag in HVM parameter HVM_PARAM_CALLBACK_IRQ. Then Dom0 could get it through hypercall HVMOP_get_param. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 14 ++ 1 file changed, 14 insertions

[Xen-devel] [PATCH v7 19/22] hvm/params: Add a new delivery type for event-channel in HVM_PARAM_CALLBACK_IRQ

2016-03-25 Thread Shannon Zhao
: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Signed-off-by: Shannon Zhao --- xen/include/public/hvm/params.h | 13 + 1 file changed, 13 insertions(+) diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index e69c72c..f7338a3 100644 --- a/xen

[Xen-devel] [PATCH v7 12/22] arm/acpi: Prepare EFI memory descriptor for Dom0

2016-03-25 Thread Shannon Zhao
Create EFI memory descriptors to tell Dom0 the RAM region information, ACPI table regions and EFI tables reserved regions. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: check the size --- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/efi/efi

[Xen-devel] [PATCH v7 15/22] arm/acpi: Permit access all Xen unused SPIs for Dom0

2016-03-25 Thread Shannon Zhao
Allow DOM0 to use all SPIs but the ones used by Xen. Then when Dom0 configures the interrupt, it could set the interrupt type and route it to Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: add a TODO for SMMU used SPIs --- xen/arch/arm/domain_build.c | 35

[Xen-devel] [PATCH v7 16/22] arm/acpi: Configure SPI interrupt type and route to Dom0 dynamically

2016-03-25 Thread Shannon Zhao
Interrupt information is described in DSDT and is not available at the time of booting. Check if the interrupt is permitted to access and set the interrupt type, route it to guest dynamically only for SPI and Dom0. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano

[Xen-devel] [PATCH v7 13/22] arm/acpi: Map the new created EFI and ACPI tables to Dom0

2016-03-25 Thread Shannon Zhao
Map the UEFI and ACPI tables which we created to non-RAM space in Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v7: flush the cache --- xen/arch/arm/domain_build.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen

[Xen-devel] [PATCH v7 22/22] xen/arm64: Add ACPI support

2016-03-25 Thread Shannon Zhao
Add ACPI support on arm64 xen hypervisor. Enable EFI support on ARM. Cc: Jan Beulich Signed-off-by: Shannon Zhao Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- v7: Drop CONFIG_ACPI_BOOT --- xen/arch/arm/Kconfig | 9 + xen/common/efi/runtime.c | 12 +++- 2

[Xen-devel] [PATCH v7 18/22] arm/acpi: Permit MMIO access of Xen unused devices for Dom0

2016-03-25 Thread Shannon Zhao
Firstly it permits full MMIO capabilities for Dom0. Then deny MMIO access of Xen used devices, such as UART, GIC, SMMU. Currently, it only denies the MMIO access of UART and GIC regions. For other Xen used devices it could be added later when they are supported. Signed-off-by: Shannon Zhao

[Xen-devel] [PATCH v7 21/22] xen/arm: Add a hypercall for device mmio mapping

2016-03-25 Thread Shannon Zhao
e the XEN_DOMCTL_memory_mapping to map mmio region for Dom0. Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Signed-off-by: Shannon Zhao --- xen/arch/arm/mm.c | 3 +++ xen/arch/arm/p2m.c | 22 ++ xen/common/memory.c

[Xen-devel] [PATCH v7 17/22] arm/gic: Add a new callback to deny Dom0 access to GIC regions

2016-03-25 Thread Shannon Zhao
Add a new member in gic_hw_operations which is used to deny Dom0 access to GIC regions. Signed-off-by: Shannon Zhao --- v7: move them out of CONFIG_ACPI --- xen/arch/arm/gic-v2.c | 27 +++ xen/arch/arm/gic-v3.c | 41 + xen

Re: [Xen-devel] [PATCH v8 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-29 Thread Shannon Zhao
On 2016/3/26 1:15, Bjorn Helgaas wrote: > On Fri, Mar 25, 2016 at 04:05:49PM +0800, Shannon Zhao wrote: >> > From: Shannon Zhao >> > >> > ACPI 6.0 introduces a new table STAO to list the devices which are used >> > by Xen and can't be used by

[Xen-devel] [PATCH v9 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-29 Thread Shannon Zhao
From: Shannon Zhao ACPI 6.0 introduces a new table STAO to list the devices which are used by Xen and can't be used by Dom0. On Xen virtual platforms, the physical UART is used by Xen. So here it hides UART from Dom0. CC: "Rafael J. Wysocki" (supporter:ACPI) CC: Len Brown (sup

[Xen-devel] [RESEND PATCH v9 01/17] Xen: ACPI: Hide UART used by Xen

2016-03-29 Thread Shannon Zhao
From: Shannon Zhao ACPI 6.0 introduces a new table STAO to list the devices which are used by Xen and can't be used by Dom0. On Xen virtual platforms, the physical UART is used by Xen. So here it hides UART from Dom0. CC: "Rafael J. Wysocki" (supporter:ACPI) CC: Len Brown (sup

Re: [Xen-devel] [PATCH v7 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI

2016-03-30 Thread Shannon Zhao
Hi Will, Mark, On 2016/3/30 0:31, Mark Rutland wrote: > On Tue, Mar 29, 2016 at 05:18:38PM +0100, Will Deacon wrote: >> > On Thu, Mar 24, 2016 at 10:44:31PM +0800, Shannon Zhao wrote: >>> > > When it's a Xen domain0 booting with ACPI, it will supply a /chosen and

Re: [Xen-devel] [PATCH v7 10/17] arm/xen: Get event-channel irq through HVM_PARAM when booting with ACPI

2016-03-30 Thread Shannon Zhao
On 2016/3/30 0:35, Julien Grall wrote: > Hi Shannon, > > On 24/03/16 14:44, Shannon Zhao wrote: >> When booting with ACPI, it could get the event-channel irq through > > The kernel will always get the event-channel IRQ through > HVM_PARAM_CALLBACK_IRQ. > > So I

Re: [Xen-devel] [PATCH v7 03/17] Xen: xlate: Use page_to_xen_pfn instead of page_to_pfn

2016-03-30 Thread Shannon Zhao
On 2016/3/30 0:28, Julien Grall wrote: > Hi Shannon, > > On 24/03/16 14:44, Shannon Zhao wrote: >> Make xen_xlate_map_ballooned_pages work with 64K pages. In that case >> Kernel pages are 64K in size but Xen pages remain 4K in size. Xen pfns >> refer to 4K pages. &

[Xen-devel] [PATCH v8 16/21] arm/acpi: Configure SPI interrupt type and route to Dom0 dynamically

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Interrupt information is described in DSDT and is not available at the time of booting. Check if the interrupt is permitted to access and set the interrupt type, route it to guest dynamically only for SPI and Dom0. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao

[Xen-devel] [PATCH v8 00/21] Prepare UEFI and ACPI tables for Dom0 on ARM64

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao These patches are Part 4 (and last part) of the previous patch set I sent which adds ACPI support for arm64 on Xen[1]. Split them as an individual set for convenient reviewing. These patches create UEFI and ACPI tables which are mapped to Dom0's space and add

[Xen-devel] [PATCH v8 14/21] arm/acpi: Create min DT stub for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Create a DT for Dom0 for ACPI-case only. DT contains minimal required information such as Dom0 bootargs, initrd, efi description table and address of uefi memory table. Also document this device tree bindings of "hypervisor" and "hypervisor/uefi" node. S

[Xen-devel] [PATCH v8 13/21] arm/acpi: Map the new created EFI and ACPI tables to Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Map the UEFI and ACPI tables which we created to non-RAM space in Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- v8: update the comments --- xen/arch/arm/domain_build.c | 22 ++ 1 file changed, 22

[Xen-devel] [PATCH v8 12/21] arm/acpi: Prepare EFI memory descriptor for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Create EFI memory descriptors to tell Dom0 the RAM region information, ACPI table regions and EFI tables reserved regions. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 1

[Xen-devel] [PATCH v8 06/21] arm/acpi: Prepare STAO table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Create STAO table for Dom0. This table is used to tell Dom0 whether it should ignore UART defined in SPCR table or the ACPI namespace names. Look at below url for details: http://wiki.xenproject.org/mediawiki/images/0/02/Status-override-table.pdf Signed-off-by: Parth Dixit

[Xen-devel] [PATCH v8 18/21] arm/acpi: Permit MMIO access of Xen unused devices for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Firstly it permits full MMIO capabilities for Dom0. Then deny MMIO access of Xen used devices, such as UART, GIC, SMMU. Currently, it only denies the MMIO access of UART and GIC regions. For other Xen used devices it could be added later when they are supported. Signed-off-by

[Xen-devel] [PATCH v8 04/21] arm/gic: Add a new callback for creating MADT table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Add a new member in gic_hw_operations which is used to create MADT table for Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/gic-v2.c | 42 +++ xen/arch/arm/gic-v3.c | 56

[Xen-devel] [PATCH v8 05/21] arm/acpi: Prepare MADT table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Copy main MADT table contents and distributor subtable from physical ACPI MADT table. Make other subtables through the callback of gic_hw_ops. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 60

[Xen-devel] [PATCH v8 11/21] arm/acpi: Prepare EFI system table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Prepare EFI system table for Dom0 to describe the information of UEFI. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/efi/efi-dom0.c | 45

[Xen-devel] [PATCH v8 01/21] arm/acpi: Estimate memory required for acpi/efi tables

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Estimate the memory required for loading acpi/efi tables in Dom0. Make the length of each table aligned with 64bit. Alloc the pages to store the new created EFI and ACPI tables and free these pages when destroying domain. Signed-off-by: Shannon Zhao Reviewed-by: Stefano

[Xen-devel] [PATCH v8 20/21] xen/arm: Add a hypercall for device mmio mapping

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao It needs to map platform or amba device mmio to Dom0 on ARM. But when booting with ACPI, it can't get the mmio region in Xen due to lack of AML interpreter to parse DSDT table. Therefore, let Dom0 call a hypercall to map mmio region when it adds the devices. Here we add

[Xen-devel] [PATCH v8 09/21] arm/p2m: Add helper functions to map memory regions

2016-03-30 Thread Shannon Zhao
From: Parth Dixit Create a helper function for mapping with cached attributes and read-write range. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/p2m.c| 26 ++ xen/include/asm

[Xen-devel] [PATCH v8 19/21] xen/acpi: Fix event-channel interrupt when booting with ACPI

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Store the event-channel interrupt number and flag in HVM parameter HVM_PARAM_CALLBACK_IRQ. Then Dom0 could get it through hypercall HVMOP_get_param. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 14

[Xen-devel] [PATCH v8 03/21] arm/acpi: Prepare FADT table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Copy and modify FADT table before passing it to Dom0. Set PSCI_COMPLIANT and PSCI_USE_HVC. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 43 +++ 1 file changed

[Xen-devel] [PATCH v8 17/21] arm/gic: Add a new callback to deny Dom0 access to GIC regions

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Add a new member in gic_hw_operations which is used to deny Dom0 access to GIC regions. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/gic-v2.c | 27 +++ xen/arch/arm/gic-v3.c | 41

[Xen-devel] [PATCH v8 15/21] arm/acpi: Permit access all Xen unused SPIs for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Allow DOM0 to use all SPIs but the ones used by Xen. Then when Dom0 configures the interrupt, it could set the interrupt type and route it to Dom0. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 35

[Xen-devel] [PATCH v8 10/21] arm/acpi: Map all other tables for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Map all other ACPI tables into Dom0 using 1:1 mappings. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/xen/arch/arm

[Xen-devel] [PATCH v8 08/21] arm/acpi: Prepare RSDP table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Copy RSDP table and replace rsdp->xsdt_physical_address with the address of XSDT table, so it can point to the right XSDT table. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c |

[Xen-devel] [PATCH v8 21/21] xen/arm64: Add ACPI support

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Add ACPI support on arm64 xen hypervisor. Enable EFI support on ARM. Cc: Jan Beulich Signed-off-by: Shannon Zhao Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/Kconfig | 9 + xen/common/efi/runtime.c | 12

[Xen-devel] [PATCH v8 07/21] arm/acpi: Prepare XSDT table for Dom0

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao Copy and modify XSDT table before passing it to Dom0. Replace the entry value of the copied table. Add a new entry for STAO table as well. And keep entry value of other reused tables unchanged. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Acked-by: Julien Grall

[Xen-devel] [PATCH v8 02/21] arm/acpi: Add a helper function to get the acpi table offset

2016-03-30 Thread Shannon Zhao
From: Shannon Zhao These tables are aligned with 64bit. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- v8: update the description of the function --- xen/arch/arm/acpi/lib.c| 15 +++ xen/include/asm-arm/acpi.h | 10 ++ 2 files changed, 25 insertions

Re: [Xen-devel] [PATCH v7 03/17] Xen: xlate: Use page_to_xen_pfn instead of page_to_pfn

2016-03-30 Thread Shannon Zhao
On 2016年03月30日 19:22, Julien Grall wrote: > Hi Shannon, > > On 30/03/16 08:38, Shannon Zhao wrote: >> >> >> On 2016/3/30 0:28, Julien Grall wrote: >>> On 24/03/16 14:44, Shannon Zhao wrote: >>>> Make xen_xlate_map_ballooned_pages work with 64K pages

Re: [Xen-devel] [PATCH v8 20/21] xen/arm: Add a hypercall for device mmio mapping

2016-03-31 Thread Shannon Zhao
On 2016/3/31 0:47, Julien Grall wrote: > Hi, > > On 30/03/16 17:11, Konrad Rzeszutek Wilk wrote: >> On Wed, Mar 30, 2016 at 06:08:13PM +0800, Shannon Zhao wrote: >>> From: Shannon Zhao >>> >>> It needs to map platform or amba device mmio to Dom0 on ARM

[Xen-devel] [PATCH] xen/arm: make the error log printk ratelimited

2016-03-31 Thread Shannon Zhao
From: Shannon Zhao To avoid a lot of possible error logs in function map_dev_mmio_region, make it printk ratelimited. Signed-off-by: Shannon Zhao --- xen/arch/arm/p2m.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index

Re: [Xen-devel] [PATCH] xen/arm: make the error log printk ratelimited

2016-03-31 Thread Shannon Zhao
On 2016/3/31 17:12, Jan Beulich wrote: On 31.03.16 at 11:05, wrote: >> > --- a/xen/arch/arm/p2m.c >> > +++ b/xen/arch/arm/p2m.c >> > @@ -1284,8 +1284,9 @@ int map_dev_mmio_region(struct domain *d, >> > res = map_mmio_regions(d, start_gfn, nr, mfn); >> > if ( res < 0 ) >> > {

[Xen-devel] [PATCH v2] xen/arm: use XENLOG_G_ERR instead

2016-03-31 Thread Shannon Zhao
From: Shannon Zhao To distinguish the error logs in function map_dev_mmio_region, use XENLOG_G_ERR instead of XENLOG_ERR. Signed-off-by: Shannon Zhao --- xen/arch/arm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index

[Xen-devel] [PATCH v9 06/17] Xen: ARM: Add support for mapping platform device mmio

2016-03-31 Thread Shannon Zhao
From: Shannon Zhao Add a bus_notifier for platform bus device in order to map the device mmio regions when DOM0 booting with ACPI. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- drivers/xen/Makefile | 1 + drivers/xen/arm-device.c | 141

[Xen-devel] [PATCH v9 03/17] Xen: xlate: Use page_to_xen_pfn instead of page_to_pfn

2016-03-31 Thread Shannon Zhao
From: Shannon Zhao Make xen_xlate_map_ballooned_pages work with 64K pages. In that case Kernel pages are 64K in size but Xen pages remain 4K in size. Xen pfns refer to 4K pages. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini --- drivers/xen/xlate_mmu.c | 38

  1   2   3   4   5   6   7   8   9   10   >