[Crash-utility] kernel module parsing failure - mips
Sagar Borikar
sagar.borikar at gmail.com
Sat Dec 3 21:15:23 UTC 2016
On Sat, Dec 3, 2016 at 1:59 AM, Rabin Vincent <rabin at rab.in> wrote:
> On Fri, Dec 02, 2016 at 04:06:20PM -0800, Sagar Borikar wrote:
>> With 7.1.7, crash is working for MIPS when all drivers are embedded
>> inside kernel.
>> When I make the driver loadable and panic the kernel, crash doesn't
>> locate some symbols correctly.
>>
>> please wait... (gathering module symbol data)
>> crash: invalid size request: 0 type: "pgd page"
>>
>> debugged further and find that PGD_ORDER provides incorrect number
>> due to which the PGD_SIZE macro results in 0.
>>
>> Just for fun, I replaced PGD_ORDER with 0(I know its incorrect) and it
>> went ahead but couldn't run "mod" command successfully as it threw
>> following error
>>
>> crash> mod
>> mod: cannot access vmalloc'd module memory
>
> In order to access vmalloc'd memory we need interpret the page tables
> correctly. This isn't needed when the modules are built in since then
> the memory will be in the direct-mapped kseg0 segment. So the "mod"
> failure is just a consequence of replacing PGD_ORDER with 0.
Yes, mod will not work as I said earlier. Crash was exiting hence I
wanted to have quick workaround.
> So the first error should be fixed properly before attempting "mod". What
> kernel version is this and what page size do to use?
4.4.20 kernel and page size is 16K
>
> Try running the "help -m" and "mach" commands (you can skip module loading with
> --no_modules to get to the crash> prompt) and check if the values for the
> various page table sizes and bits match what your kernel is using.
>
> crash> help -m
> ...
> pagesize: 4096
> pageshift: 12
> pagemask: fffffffffffff000
> pageoffset: fff
> pgdir_shift: 22
> ptrs_per_pgd: 1024
> ptrs_per_pte: 1024
> ...
>
>
> crash-mips> mach
> PAGE SIZE: 4096
>
> _PAGE_PRESENT: 00000001
> _PAGE_READ: 00000002
> _PAGE_WRITE: 00000004
> _PAGE_ACCESSED: 00000008
> _PAGE_MODIFIED: 00000010
> _PAGE_GLOBAL: 00000020
> _PAGE_VALID: 00000040
> _PAGE_DIRTY: 00000080
This appears to be correct info for my platform.
Thanks
Sagar
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list