[405EX] Bad page map in process ...

Weirich, Bernhard Bernhard.Weirich at riedel.net
Tue Sep 22 18:05:55 EST 2009


Hello,

I use mmap to map an IO address space to user space on a PPC405EX processor.

till kernel 2.6.29 this worked without problems, since 2.6.30. I get intimidating error messages when I do the unmap, mmap works fine, though.

BUG: Bad page map in process deviceDaemon  pte:ffe3b45e pmd:0f11a400
addr:48271000 vm_flags:400844ff anon_vma:(null) mapping:cede3a18 index:fffffe3b
vma->vm_ops->fault: ebm_alloc+0x700/0x708 [fpga_bus_m]
vma->vm_file->f_op->mmap: fpga_regs_ioctl+0x100/0x3e0 [fpga_bus_m]
Call Trace:
[cf1bbda0] [c0006e94] show_stack+0x40/0x15c (unreliable)
[cf1bbdd0] [c00776cc] print_bad_pte+0x12c/0x1e4
[cf1bbe00] [c0077820] vm_normal_page+0x9c/0xb4
[cf1bbe20] [c0078374] unmap_vmas+0x228/0x5f8
[cf1bbeb0] [c007c8b4] unmap_region+0x98/0x138
[cf1bbef0] [c007d9cc] do_munmap+0x280/0x304
[cf1bbf20] [c007da88] sys_munmap+0x38/0x5c
[cf1bbf40] [c000efa4] ret_from_syscall+0x0/0x3c

So far I found out that in mm/memory.c, function vm_normal_page, pfn is greater than highest_memmap_pfn, thus the error is triggered.
It is correct that pfn is higher than the end of physical ram, but it is in a valid IO mapped region.
I guess the problem is that pte_special(pte) returns 0.
I realized that in the 2.6.29 kernel HAVE_PTE_SPECIAL was 0 and the !HAVE_PTE_SPECIAL case silently returned NULL before checking whether pfn < highest_memmap_pfn.

In 2.6.30 HAVE_PTE_SPECIAL is 1 and pte_special(pte) returns 0 so the code jumps to the pfn < highest_memmap_pfn check. Thus I believe that the there is a problem with the pte_special flag.

I will investigate further but maybe someone with more knowledge about page handling on ppc can help me here.

Bernhard WEIRICH
Software Development


More information about the Linuxppc-dev mailing list