Skip to contentSkip to conversation

xen/arm: Clean up identify processor call for secondary cpus

PATCH Applied Julien Grall 2 participants 2 messages Jul 29, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen/arm: Clean up identify processor call for secondary cpus

The smp_processor_id() is set at the beginning of start_secondary. We don't need to compute ourself the offset of the cpu data.

---
Changes in v2:
- Initalize the current cpu data with boot cpu data

---
 xen/arch/arm/smpboot.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
xen/arch/arm/smpboot.c +2 -4
index 5895178..b6aea63 100644
@@ -137,15 +137,13 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
                                unsigned long fdt_paddr,
                                unsigned long cpuid)
 {
-    struct cpuinfo_arm *c = cpu_data + cpuid;
-
     memset(get_cpu_info(), 0, sizeof (struct cpu_info));
 
     /* TODO: handle boards where CPUIDs are not contiguous */
     set_processor_id(cpuid);
 
-    *c = boot_cpu_data;
-    identify_cpu(c);
+    current_cpu_data = boot_cpu_data;
+    identify_cpu(&current_cpu_data);
 
     init_traps();
 
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 4 lines · Julien Grall

The smp_processor_id() is set at the beginning of start_secondary. We don't need to compute ourself the offset of the cpu data.

Applied, thanks.

Quoted 30 lines

---
Changes in v2:
- Initalize the current cpu data with boot cpu data

---
 xen/arch/arm/smpboot.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
xen/arch/arm/smpboot.c +2 -4
index 5895178..b6aea63 100644
@@ -137,15 +137,13 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
                                unsigned long fdt_paddr,
                                unsigned long cpuid)
 {
-    struct cpuinfo_arm *c = cpu_data + cpuid;
-
     memset(get_cpu_info(), 0, sizeof (struct cpu_info));
 
     /* TODO: handle boards where CPUIDs are not contiguous */
     set_processor_id(cpuid);
 
-    *c = boot_cpu_data;
-    identify_cpu(c);
+    current_cpu_data = boot_cpu_data;
+    identify_cpu(&current_cpu_data);
 
     init_traps();