]> Git Repo - linux.git/commit - fs/proc/vmcore.c
vmcore: support mmap() on /proc/vmcore
authorHATAYAMA Daisuke <[email protected]>
Wed, 3 Jul 2013 22:02:23 +0000 (15:02 -0700)
committerLinus Torvalds <[email protected]>
Wed, 3 Jul 2013 23:07:30 +0000 (16:07 -0700)
commit83086978c63afd7c73e1c173c84aeab184c1e916
tree423cb50415bfd2d3840272718591400e6a1f3b26
parent591ff71664e764a3806e341370f3c758cb2e7e3c
vmcore: support mmap() on /proc/vmcore

This patch introduces mmap_vmcore().

Don't permit writable nor executable mapping even with mprotect()
because this mmap() is aimed at reading crash dump memory.  Non-writable
mapping is also requirement of remap_pfn_range() when mapping linear
pages on non-consecutive physical pages; see is_cow_mapping().

Set VM_MIXEDMAP flag to remap memory by remap_pfn_range and by
remap_vmalloc_range_pertial at the same time for a single vma.
do_munmap() can correctly clean partially remapped vma with two
functions in abnormal case.  See zap_pte_range(), vm_normal_page() and
their comments for details.

On x86-32 PAE kernels, mmap() supports at most 16TB memory only.  This
limitation comes from the fact that the third argument of
remap_pfn_range(), pfn, is of 32-bit length on x86-32: unsigned long.

[[email protected]: use min(), switch to conventional error-unwinding approach]
Signed-off-by: HATAYAMA Daisuke <[email protected]>
Acked-by: Vivek Goyal <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Atsushi Kumagai <[email protected]>
Cc: Lisa Mitchell <[email protected]>
Cc: Zhang Yanfei <[email protected]>
Tested-by: Maxim Uvarov <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/vmcore.c
This page took 0.052794 seconds and 4 git commands to generate.