Skip to contentSkip to conversation

ARM64: DT: define ARM64 specific arch_match_cpu_phys_id

PATCH New Sudeep KarkadaNagesha 2 participants 3 messages Oct 21, 2013 – Oct 30, 2013 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM64: DT: define ARM64 specific arch_match_cpu_phys_id

From: Sudeep KarkadaNagesha <[email protected]>

OF/DT core library provides architecture specific hook to match the logical cpu index with the corresponding physical identifier.

On ARM64, the MPIDR_EL1 contains specific bitfields(MPIDR_EL1.Aff{3..0}) which uniquely identify a CPU, in addition to some non-identifying information and reserved bits. The ARM cpu binding defines the 'reg' property to only contain the affinity bits, and any cpu nodes with other bits set in their 'reg' entry are skipped.

This patch overrides the weak definition of arch_match_cpu_phys_id with ARM64 specific version using MPIDR_EL1.Aff{3..0} as cpu physical identifiers.

---
 arch/arm64/kernel/setup.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/kernel/setup.c +5 -0
index 055cfb8..ff629f9 100644
@@ -97,6 +97,11 @@ void __init early_print(const char *str, ...)
 	printk("%s", buf);
 }
 
+bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
+{
+	return phys_id == cpu_logical_map(cpu);
+}
+
 static void __init setup_processor(void)
 {
 	struct cpu_info *cpu_info;
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 ARM64: DT: define ARM64 specific arch_match_cpu_phys_id

Hi Catalin,

Quoted 11 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

OF/DT core library provides architecture specific hook to match the logical cpu index with the corresponding physical identifier.

On ARM64, the MPIDR_EL1 contains specific bitfields(MPIDR_EL1.Aff{3..0}) which uniquely identify a CPU, in addition to some non-identifying information and reserved bits. The ARM cpu binding defines the 'reg' property to only contain the affinity bits, and any cpu nodes with other bits set in their 'reg' entry are skipped.

Quoted 4 lines

This patch overrides the weak definition of arch_match_cpu_phys_id with ARM64 specific version using MPIDR_EL1.Aff{3..0} as cpu physical identifiers.

Can you take this trivial patch for v3.13 ?

Regards,
Sudeep

Quoted 25 lines
---
 arch/arm64/kernel/setup.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/kernel/setup.c +5 -0
index 055cfb8..ff629f9 100644
@@ -97,6 +97,11 @@ void __init early_print(const char *str, ...)
 	printk("%s", buf);
 }
 
+bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
+{
+	return phys_id == cpu_logical_map(cpu);
+}
+
 static void __init setup_processor(void)
 {
 	struct cpu_info *cpu_info;
maintainer
#2 lore raw

PATCH 1/1 ARM64: DT: define ARM64 specific arch_match_cpu_phys_id

Quoted 12 lines · Sudeep KarkadaNagesha
Quoted 11 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

OF/DT core library provides architecture specific hook to match the logical cpu index with the corresponding physical identifier.

On ARM64, the MPIDR_EL1 contains specific bitfields(MPIDR_EL1.Aff{3..0}) which uniquely identify a CPU, in addition to some non-identifying information and reserved bits. The ARM cpu binding defines the 'reg' property to only contain the affinity bits, and any cpu nodes with other bits set in their 'reg' entry are skipped.

Quoted 6 lines
Quoted 4 lines

This patch overrides the weak definition of arch_match_cpu_phys_id with ARM64 specific version using MPIDR_EL1.Aff{3..0} as cpu physical identifiers.

Can you take this trivial patch for v3.13 ?

I will take it (missed it with the KS event).

Thanks.

Signature · 1 line
Catalin