diff mbox

[Xen-devel,RFC,12/35] ARM64: Initialization of cpu_logical_map(0)

Message ID 1423058539-26403-13-git-send-email-parth.dixit@linaro.org
State New
Headers show

Commit Message

Parth Dixit Feb. 4, 2015, 2:01 p.m. UTC
From: Naresh Bhat <naresh.bhat@linaro.org>

Initialization of cpu_logical_map(0) before acpi_boot_init()

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Naresh Bhat <Naresh.Bhat@linaro.org>
---
 xen/arch/arm/setup.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Julien Grall Feb. 4, 2015, 9:45 p.m. UTC | #1
Hi Parth,

On 04/02/2015 14:01, parth.dixit@linaro.org wrote:
> From: Naresh Bhat <naresh.bhat@linaro.org>
>
> Initialization of cpu_logical_map(0) before acpi_boot_init()

Perhaps, merging with the previous patch?

Regards,

> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> Signed-off-by: Naresh Bhat <Naresh.Bhat@linaro.org>
> ---
>   xen/arch/arm/setup.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 3531d47..569b2da 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -47,6 +47,7 @@
>   #include <xsm/xsm.h>
>   #include <xen/acpi.h>
>   #include <asm/acpi.h>
> +#include <asm-arm/cputype.h>
>
>   struct bootinfo __initdata bootinfo;
>
> @@ -749,6 +750,10 @@ void __init start_xen(unsigned long boot_phys_offset,
>
>   #if defined(CONFIG_ACPI) && defined(CONFIG_ARM_64)
>       acpi_boot_table_init();
> +
> +    /* Get the boot CPU's MPIDR before cpu logical map is built */
> +    cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
> +
>       acpi_boot_init();
>   #endif
>
>
Julien Grall Feb. 11, 2015, 5:09 a.m. UTC | #2
Hi Stefano,

On 05/02/2015 18:26, Stefano Stabellini wrote:
> On Wed, 4 Feb 2015, parth.dixit@linaro.org wrote:
>> From: Naresh Bhat <naresh.bhat@linaro.org>
>>
>> Initialization of cpu_logical_map(0) before acpi_boot_init()
>>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> Signed-off-by: Naresh Bhat <Naresh.Bhat@linaro.org>
>> ---
>>   xen/arch/arm/setup.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index 3531d47..569b2da 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -47,6 +47,7 @@
>>   #include <xsm/xsm.h>
>>   #include <xen/acpi.h>
>>   #include <asm/acpi.h>
>> +#include <asm-arm/cputype.h>
>>
>>   struct bootinfo __initdata bootinfo;
>>
>> @@ -749,6 +750,10 @@ void __init start_xen(unsigned long boot_phys_offset,
>>
>>   #if defined(CONFIG_ACPI) && defined(CONFIG_ARM_64)
>>       acpi_boot_table_init();
>> +
>> +    /* Get the boot CPU's MPIDR before cpu logical map is built */
>> +    cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
>> +
>>       acpi_boot_init();
>>   #endif
>
> Isn't the current cpu_logical_map initialization in smp_init_cpus()
> enough?  If you want to initialize cpu_logical_map earlier, you need to
> move the initialization earlier, removing the old one: we cannot have
> two places where Xen initialize cpu_logical_map(0).

The ACPI is retrieving the CPU in acpi_boot_init (see patch #11). Having 
this patch separate made this code difficult to understand.

Although, I don't see why we can't defer the parsing of the CPU table in 
smp_init_cpu().

FWIW, it's where we get CPU from the DT.

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3531d47..569b2da 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -47,6 +47,7 @@ 
 #include <xsm/xsm.h>
 #include <xen/acpi.h>
 #include <asm/acpi.h>
+#include <asm-arm/cputype.h>
 
 struct bootinfo __initdata bootinfo;
 
@@ -749,6 +750,10 @@  void __init start_xen(unsigned long boot_phys_offset,
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_ARM_64)
     acpi_boot_table_init();
+
+    /* Get the boot CPU's MPIDR before cpu logical map is built */
+    cpu_logical_map(0) = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
+
     acpi_boot_init();
 #endif