Skip to contentSkip to conversation

poison invalid cpus

PATCH New Olaf Hering 2 participants 2 messages Feb 10, 2006 – Feb 11, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 poison invalid cpus

from Anton Blanchard <[email protected]>
Novell bug145459

Ensure that per cpu access to !possible cpus causes a fault instead of silent corruption.

 arch/powerpc/kernel/setup_64.c |    8 ++++++++
 1 files changed, 8 insertions(+)
arch/powerpc/kernel/setup_64.c +8 -0
Index: linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c
===================================================================
@@ -670,6 +670,14 @@ void __init setup_per_cpu_areas(void)
 		size = PERCPU_ENOUGH_ROOM;
 #endif
 
+	/*
+	 * Poison invalid cpus, with lots of high bits set this should
+	 * always fault
+	 */
+	for (i = 0; i < NR_CPUS; i++) {
+		paca[i].data_offset = 0xeeeeeeeeeeeeeeeeULL;
+	}
+
 	for_each_cpu(i) {
 		ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
 		if (!ptr)
Signature · 2 lines
short story of a lazy sysadmin:
 alias appserv=wotan
#1 lore raw

PATCH 1/1 ppc64: poison invalid cpus

Ensure that per cpu access to !possible cpus causes a fault instead of silent corruption.

---

Thanks Olaf, I had forgotten to send it out.

arch/powerpc/kernel/setup_64.c +8 -0
Index: linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c
===================================================================
@@ -670,6 +670,14 @@ void __init setup_per_cpu_areas(void)
 		size = PERCPU_ENOUGH_ROOM;
 #endif
 
+	/*
+	 * Poison invalid cpus, with lots of high bits set this should
+	 * always fault
+	 */
+	for (i = 0; i < NR_CPUS; i++) {
+		paca[i].data_offset = 0xeeeeeeeeeeeeeeeeULL;
+	}
+
 	for_each_cpu(i) {
 		ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
 		if (!ptr)