[Crash-utility] poisoned per_cpu data not handled on ppc64
Dave Anderson
anderson at redhat.com
Thu Mar 9 13:55:24 UTC 2006
Olaf Hering wrote:
> We use this patch to catch incorrect access to per_cpu data. But crash
> cant deal with it unfortunately.
>
> http://patchwork.ozlabs.org/linuxppc/patch?id=4423
>
> honeydew:~ # crash -s /root/2.6.15.42-kexec/vmlinux /proc/vmcore
> crash: pglist_data.node_mem_map structure member does not exist.
> crash: certain memory-related commands will fail or display invalid data
>
> crash: invalid kernel virtual address: aeeeeeeeef3736ae type: "runqueues entry (per_cpu)"
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
Hi Olaf,
Thanks for the heads-up:
Index: linux-2.6.16-rc1-git3/arch/powerpc/kernel/setup_64.c
===================================================================
--- linux-2.6.16-rc1-git3.orig/arch/powerpc/kernel/setup_64.c
+++ 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)
I'll defer this to the IBM ppc64 guys, but it would seemingly
be simple enough to detect this in ppc64.c:ppc64_paca_init()
by checking for both 0 and 0xeeeeeeeeeeeeeeeeULL:
for (i = cpus = 0; i < nr_paca; i++) {
readmem(symbol_value("paca") + (i * SIZE(ppc64_paca)),
KVADDR, cpu_paca_buf, SIZE(ppc64_paca),
"paca entry", FAULT_ON_ERROR);
per_cpu_offset = ULONG(cpu_paca_buf + data_offset);
- if (per_cpu_offset == 0)
+ if ((per_cpu_offset == 0) ||
+ (per_cpu_offset == 0xeeeeeeeeeeeeeeeeULL))
continue;
kt->__per_cpu_offset[i] = per_cpu_offset;
kt->flags |= PER_CPU_OFF;
cpus++;
}
Thanks again,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20060309/bc7ff700/attachment.htm>
More information about the Crash-utility
mailing list