Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   ARM: crash registers might be read from the wrong physical address (http://www.linux-archive.org/crash-utility/684829-arm-crash-registers-might-read-wrong-physical-address.html)

Dave Anderson 07-18-2012 01:12 PM

ARM: crash registers might be read from the wrong physical address
 
----- Original Message -----
>
>
>
>
> Hi Dave
>
>
>
> I found a problem in arm.c that arm_get_crash_notes() is called too
> early. This has never been a problem until now.
>
> arm_get_crash_notes() in arm.c
> calls readmem(, KVADDR, )
> which calls kvtop()
> which calls machdep->kvtop that is arm_kvtop
> which uses vt->vmalloc_start
> vt->vmalloc_start is initialized in vm_init
>
> From main_loop:
>
> machdep_init(POST_GDB);
> vm_init();
> machdep_init(POST_VM);
>
> arm_get_crash_notes() is currently called in the POST_GDB section of
> machdep_init, but should be moved to the POST_VM section. I put the
> comment and the code just before:
>
> if (init_unwind_tables()) {
>
> and then it works fine. Without this fix the crash registers might be
> read from the wrong physical address.
>
> Jan

Looking at the 2.6.38-based SMP ARM sample kernel I have, the
arm_get_crash_notes() does not make any readmem() calls of a vmalloc
address, only unity-mapped calls:

$ crash -d7 vmlinux vmcore
...
<readmem: c0b04230, KVADDR, "crash_notes", 4, (ROE), 85be9e0>
<read_diskdump: addr: c0b04230 paddr: 80b04230 cnt: 4>
<readmem: c0d5194c, KVADDR, "note_buf_t", 180, (ROE), 85bede0>
<read_diskdump: addr: c0d5194c paddr: 80d5194c cnt: 180>
...

Have newer ARM kernels changed how percpu addresses are translated
such that the note_ptrs[] entries become vmalloc addresses here
in arm_get_crash_notes():?

if (symbol_exists("__per_cpu_offset")) {

/* Add __per_cpu_offset for each cpu to form the pointer to the notes */
for (i = 0; i<kt->cpus; i++)
notes_ptrs[i] = notes_ptrs[kt->cpus-1] + kt->__per_cpu_offset[i];
}

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 12:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.