<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Olaf Hering wrote:
<blockquote TYPE=CITE>We use this patch to catch incorrect access to per_cpu
data. But crash
<br>cant deal with it unfortunately.
<p><a href="http://patchwork.ozlabs.org/linuxppc/patch?id=4423">http://patchwork.ozlabs.org/linuxppc/patch?id=4423</a>
<p>honeydew:~ # crash -s /root/2.6.15.42-kexec/vmlinux /proc/vmcore
<br>crash: pglist_data.node_mem_map structure member does not exist.
<br>crash: certain memory-related commands will fail or display invalid
data
<p>crash: invalid kernel virtual address: aeeeeeeeef3736ae  type:
"runqueues entry (per_cpu)"
<p>--
<br>Crash-utility mailing list
<br>Crash-utility@redhat.com
<br><a href="https://www.redhat.com/mailman/listinfo/crash-utility">https://www.redhat.com/mailman/listinfo/crash-utility</a></blockquote>
<tt>Hi Olaf,</tt><tt></tt>
<p><tt>Thanks for the heads-up:</tt><tt></tt>
<p><tt>Index: linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c</tt>
<br><tt>===================================================================</tt>
<br><tt>--- linux-2.6.16-rc1-git3.orig/arch/powerpc/kernel/setup_64.c</tt>
<br><tt>+++ linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c</tt>
<br><tt>@@ -670,6 +670,14 @@ void __init setup_per_cpu_areas(void)</tt>
<br><tt>               
size = PERCPU_ENOUGH_ROOM;</tt>
<br><tt> #endif</tt><tt></tt>
<p><tt>+       /*</tt>
<br><tt>+        * Poison invalid cpus,
with lots of high bits set this should</tt>
<br><tt>+        * always fault</tt>
<br><tt>+        */</tt>
<br><tt>+       for (i = 0; i < NR_CPUS;
i++) {</tt>
<br><tt>+              
paca[i].data_offset = 0xeeeeeeeeeeeeeeeeULL;</tt>
<br><tt>+       }</tt>
<br><tt>+</tt>
<br><tt>        for_each_cpu(i) {</tt>
<br><tt>               
ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);</tt>
<br><tt>               
if (!ptr)</tt>
<br><tt></tt> <tt></tt>
<p><tt>I'll defer this to the IBM ppc64 guys, but it would seemingly</tt>
<br><tt>be simple enough to detect this in ppc64.c:ppc64_paca_init()</tt>
<br><tt>by checking for both 0 and 0xeeeeeeeeeeeeeeeeULL:</tt><tt></tt>
<p><tt>        for (i = cpus = 0; i
< nr_paca; i++) {</tt>
<br><tt>               
readmem(symbol_value("paca") + (i * SIZE(ppc64_paca)),</tt>
<br><tt>                       
KVADDR, cpu_paca_buf, SIZE(ppc64_paca),</tt>
<br><tt>                       
"paca entry", FAULT_ON_ERROR);</tt><tt></tt>
<p><tt>               
per_cpu_offset = ULONG(cpu_paca_buf + data_offset);</tt>
<br><tt>-              
if (per_cpu_offset == 0)</tt>
<br><tt>+              
if ((per_cpu_offset == 0) ||</tt>
<br><tt>+                  
(per_cpu_offset == 0xeeeeeeeeeeeeeeeeULL))</tt>
<br><tt>                       
continue;</tt>
<br><tt>               
kt->__per_cpu_offset[i] = per_cpu_offset;</tt>
<br><tt>               
kt->flags |= PER_CPU_OFF;</tt>
<br><tt>               
cpus++;</tt>
<br><tt>        }</tt><tt></tt>
<p><tt>Thanks again,</tt>
<br><tt>  Dave</tt>
<br><tt></tt> </html>