]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmcore: disable mmap_vmcore() if CONFIG_MMU is not defined
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Thu, 27 Jun 2013 23:51:37 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:36 +0000 (16:37 +1000)
commited3ba287050021f3405ad2401e10eccb3342f961
tree2aa5788b07c1b44031f0a196f33f11f4590e59ab
parentdae57ae14fb284af3acf9859e8f6c374cadf7e35
vmcore: disable mmap_vmcore() if CONFIG_MMU is not defined

From Arnd's report of a link-time build error in vmcore.c, it turned out
that mmap_vmcore() work overlooked no-MMU configuraiton.

In the current design, it's impossible to implement mmap_vmcore() for
no-MMU configuration since MMU is essential in order to map physically
non-contiguous objects (ELF header, ELF note segment and memory regions in
the 1st kernel pointed to by PT_LOAD entries) into virtually contiguous
user-space in ELF layout.

Hence, this patch disables mmap_vmcore() if CONFIG_MMU is not defined,
returning -ENOSYS.

Another change is to fix the build error by using vmalloc_user() instead
of calling vzalloc() and find_vm_area() in order, by which we no longer
need to call find_vm_area() in vmcore.c that has no counterpart on non-MMU
configuration.

Also, on no-MMU configuration, because we don't export buffer for ELF note
segment to user-space, we use vzalloc() to allocate the buffer.
Therefore, we use differnet functions to allocate the buffer for ELF note
segment.  To avoid code duplication, introduce a helper
alloc_elfnotes_buf().

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Lisa Mitchell <lisa.mitchell@hp.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/vmcore.c