diff mbox

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

Message ID 1458207668-12012-11-git-send-email-zhaoshenglong@huawei.com
State Superseded
Headers show

Commit Message

Shannon Zhao March 17, 2016, 9:40 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Map all other tables to Dom0 using 1:1 mappings.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain_build.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Julien Grall March 21, 2016, 3:57 p.m. UTC | #1
Title: Map all other tables into DOM0 memory.

On 17/03/2016 09:40, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> Map all other tables to Dom0 using 1:1 mappings.

s/to/into/

>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ---
>   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/domain_build.c
> index ea7d6a5..c71976c 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1357,6 +1357,30 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
>   }
>
>   #ifdef CONFIG_ACPI
> +static void acpi_map_other_tables(struct domain *d)
> +{
> +    int i;
> +    unsigned long res;
> +    u64 addr, size;
> +
> +    /* Map all other tables to Dom0 using 1:1 mappings. */

That's not really true. AFAICT, you will map all the ACPI tables, 
included the ones that have been discarded.

> +    for( i = 0; i < acpi_gbl_root_table_list.count; i++ )
> +    {
> +        addr = acpi_gbl_root_table_list.tables[i].address;
> +        size = acpi_gbl_root_table_list.tables[i].length;
> +        res = map_regions_rw(d,
> +                             paddr_to_pfn(addr & PAGE_MASK),
> +                             DIV_ROUND_UP(size, PAGE_SIZE),
> +                             paddr_to_pfn(addr & PAGE_MASK));
> +        if ( res )
> +        {
> +             panic(XENLOG_ERR "Unable to map 0x%"PRIx64
> +                   " - 0x%"PRIx64" in domain \n",
> +                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);

"Unable to map ACPI region ..." to differentiate with the error message 
in map_range_to_domain.

> +        }
> +    }
> +}
> +
>   static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[])
>   {
>
> @@ -1661,6 +1685,8 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
>       if ( rc != 0 )
>           return rc;
>
> +    acpi_map_other_tables(d);
> +
>       return 0;
>   }
>   #else
>

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index ea7d6a5..c71976c 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1357,6 +1357,30 @@  static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 }
 
 #ifdef CONFIG_ACPI
+static void acpi_map_other_tables(struct domain *d)
+{
+    int i;
+    unsigned long res;
+    u64 addr, size;
+
+    /* Map all other tables to Dom0 using 1:1 mappings. */
+    for( i = 0; i < acpi_gbl_root_table_list.count; i++ )
+    {
+        addr = acpi_gbl_root_table_list.tables[i].address;
+        size = acpi_gbl_root_table_list.tables[i].length;
+        res = map_regions_rw(d,
+                             paddr_to_pfn(addr & PAGE_MASK),
+                             DIV_ROUND_UP(size, PAGE_SIZE),
+                             paddr_to_pfn(addr & PAGE_MASK));
+        if ( res )
+        {
+             panic(XENLOG_ERR "Unable to map 0x%"PRIx64
+                   " - 0x%"PRIx64" in domain \n",
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+        }
+    }
+}
+
 static int acpi_create_rsdp(struct domain *d, struct membank tbl_add[])
 {
 
@@ -1661,6 +1685,8 @@  static int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
     if ( rc != 0 )
         return rc;
 
+    acpi_map_other_tables(d);
+
     return 0;
 }
 #else