diff mbox

[v4,04/21] arm/acpi: Move end_boot_allocator after acpi_boot_table_init

Message ID 1453540813-15764-5-git-send-email-zhaoshenglong@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao Jan. 23, 2016, 9:19 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

If ACPI is initialized after the boot allocator has ended(the system
state is not early boot), assert happens in acpi_os_zalloc_memory and
acpi_boot_table_init will fail. So it needs to move end_boot_allocator
after acpi_boot_table_init.

Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/arch/arm/setup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Stefano Stabellini Jan. 27, 2016, 2:53 p.m. UTC | #1
On Sat, 23 Jan 2016, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> If ACPI is initialized after the boot allocator has ended(the system
> state is not early boot), assert happens in acpi_os_zalloc_memory and
> acpi_boot_table_init will fail. So it needs to move end_boot_allocator
> after acpi_boot_table_init.

The commit message is wrong: on arm64 system_state is set to
SYS_STATE_boot from start_xen few lines after the vm_init() call,
end_boot_allocator() doesn't change it.

Why do we need to move end_boot_allocator() exactly?


> Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  xen/arch/arm/setup.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 3b29904..0ba601e 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -612,8 +612,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
>         allocator. */
>      init_xenheap_pages(pfn_to_paddr(xenheap_mfn_start),
>                         pfn_to_paddr(boot_mfn_start));
> -
> -    end_boot_allocator();
>  }
>  #else /* CONFIG_ARM_64 */
>  static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
> @@ -681,8 +679,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
>  
>      setup_frametable_mappings(ram_start, ram_end);
>      max_page = PFN_DOWN(ram_end);
> -
> -    end_boot_allocator();
>  }
>  #endif
>  
> @@ -753,6 +749,8 @@ void __init start_xen(unsigned long boot_phys_offset,
>  
>      setup_mm(fdt_paddr, fdt_size);
>  
> +    end_boot_allocator();
> +
>      vm_init();
>      dt_unflatten_host_device_tree();
>  
> -- 
> 2.0.4
> 
>
diff mbox

Patch

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3b29904..0ba601e 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -612,8 +612,6 @@  static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
        allocator. */
     init_xenheap_pages(pfn_to_paddr(xenheap_mfn_start),
                        pfn_to_paddr(boot_mfn_start));
-
-    end_boot_allocator();
 }
 #else /* CONFIG_ARM_64 */
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
@@ -681,8 +679,6 @@  static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     setup_frametable_mappings(ram_start, ram_end);
     max_page = PFN_DOWN(ram_end);
-
-    end_boot_allocator();
 }
 #endif
 
@@ -753,6 +749,8 @@  void __init start_xen(unsigned long boot_phys_offset,
 
     setup_mm(fdt_paddr, fdt_size);
 
+    end_boot_allocator();
+
     vm_init();
     dt_unflatten_host_device_tree();