From c49a4955ea504c82f6b690491639bba5b8c1dc47 Mon Sep 17 00:00:00 2001 From: "travis@sgi.com" Date: Wed, 30 Jan 2008 13:33:22 +0100 Subject: x86: add debug of invalid per_cpu map accesses Provide a means to trap usages of per_cpu map variables before they are setup. Define CONFIG_DEBUG_PER_CPU_MAPS to activate. Signed-off-by: Mike Travis Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/topology.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h index 040374f030cf..f1e12329078e 100644 --- a/include/asm-x86/topology.h +++ b/include/asm-x86/topology.h @@ -66,6 +66,13 @@ static inline int early_cpu_to_node(int cpu) static inline int cpu_to_node(int cpu) { +#ifdef CONFIG_DEBUG_PER_CPU_MAPS + if(x86_cpu_to_node_map_early_ptr) { + printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n", + (int)cpu); + BUG(); + } +#endif if(per_cpu_offset(cpu)) return per_cpu(x86_cpu_to_node_map, cpu); else -- cgit v1.2.2