[PATCH] ppc64: Add missing barrier() in kexec code

Anton Blanchard anton at samba.org
Tue Sep 27 18:46:43 EST 2005


Hi,

Mikey and I were testing kexec and hit a lockup. It turns out gcc 4.0
optimises the kexec_prepare_cpus loop so we avoid reloading
paca.hw_cpu_id. A gcc barrier() fixes the problem.

Signed-off-by: Anton Blanchard <anton at samba.org>
---

Index: build/arch/ppc64/kernel/machine_kexec.c
===================================================================
--- build.orig/arch/ppc64/kernel/machine_kexec.c	2005-09-14 13:22:30.000000000 +1000
+++ build/arch/ppc64/kernel/machine_kexec.c	2005-09-15 11:58:07.000000000 +1000
@@ -205,6 +205,7 @@
 			continue;
 
 		while (paca[i].hw_cpu_id != -1) {
+			barrier();
 			if (!cpu_possible(i)) {
 				printk("kexec: cpu %d hw_cpu_id %d is not"
 						" possible, ignoring\n",



More information about the Linuxppc64-dev mailing list