kernel-fxtec-pro1x/arch/unicore32/kernel
Jason Baron 909af768e8 coredump: remove VM_ALWAYSDUMP flag
The motivation for this patchset was that I was looking at a way for a
qemu-kvm process, to exclude the guest memory from its core dump, which
can be quite large.  There are already a number of filter flags in
/proc/<pid>/coredump_filter, however, these allow one to specify 'types'
of kernel memory, not specific address ranges (which is needed in this
case).

Since there are no more vma flags available, the first patch eliminates
the need for the 'VM_ALWAYSDUMP' flag.  The flag is used internally by
the kernel to mark vdso and vsyscall pages.  However, it is simple
enough to check if a vma covers a vdso or vsyscall page without the need
for this flag.

The second patch then replaces the 'VM_ALWAYSDUMP' flag with a new
'VM_NODUMP' flag, which can be set by userspace using new madvise flags:
'MADV_DONTDUMP', and unset via 'MADV_DODUMP'.  The core dump filters
continue to work the same as before unless 'MADV_DONTDUMP' is set on the
region.

The qemu code which implements this features is at:

  http://people.redhat.com/~jbaron/qemu-dump/qemu-dump.patch

In my testing the qemu core dump shrunk from 383MB -> 13MB with this
patch.

I also believe that the 'MADV_DONTDUMP' flag might be useful for
security sensitive apps, which might want to select which areas are
dumped.

This patch:

The VM_ALWAYSDUMP flag is currently used by the coredump code to
indicate that a vma is part of a vsyscall or vdso section.  However, we
can determine if a vma is in one these sections by checking it against
the gate_vma and checking for a non-NULL return value from
arch_vma_name().  Thus, freeing a valuable vma bit.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:42 -07:00
..
asm-offsets.c unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
clock.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
cpu-ucv2.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
debug-macro.S unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
debug.S unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
dma.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
early_printk.c unicore32 additional architecture files: low-level lib: ocd debug 2011-03-17 09:19:12 +08:00
elf.c unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
entry.S unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs 2011-03-17 09:19:21 +08:00
fpu-ucf64.c unicore32 additional architecture files: float point handling 2011-03-17 09:19:11 +08:00
gpio.c unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
head.S Fix common misspellings 2011-03-31 11:26:23 -03:00
hibernate.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
hibernate_asm.S unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
init_task.c unicore32 core architecture: process/thread related codes 2011-03-17 09:19:07 +08:00
irq.c PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM 2011-05-11 21:37:15 +02:00
ksyms.c unicore32: fix build error for find bitops 2011-11-15 17:13:14 +08:00
ksyms.h unicore32 core architecture: generic elf and ksyms stuff 2011-03-17 09:19:05 +08:00
Makefile unicore32: move rtc-puv3.c to drivers/rtc directory 2011-06-09 16:15:24 +08:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
pci.c PCI: UniCore: convert pcibios_set_master() to a non-inlined function 2012-01-06 12:10:41 -08:00
pm.c unicore32 additional architecture files: pm related files 2011-03-17 09:19:11 +08:00
process.c coredump: remove VM_ALWAYSDUMP flag 2012-03-23 16:58:42 -07:00
ptrace.c unicore32 additional architecture files: ptrace handling 2011-03-17 09:19:12 +08:00
puv3-core.c driver-core: remove sysdev.h usage. 2011-12-21 16:26:03 -08:00
puv3-nb0916.c unicore32: Remove IRQF_DISABLED 2012-01-10 10:29:41 +08:00
pwm.c unicore32 core architecture: timer and time handling 2011-03-17 09:19:10 +08:00
setup.c unicore32: standardize /proc/iomem "Kernel code" name 2012-01-10 10:29:40 +08:00
setup.h unicore32 core architecture: low level entry and setup codes 2011-03-17 09:19:06 +08:00
signal.c unicore32: Use set_current_blocked() 2012-01-10 10:29:41 +08:00
sleep.S unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs 2011-03-17 09:19:21 +08:00
stacktrace.c unicore32 core architecture: process/thread related codes 2011-03-17 09:19:07 +08:00
sys.c unicore32 core architecture: processor and system headers 2011-03-17 09:19:06 +08:00
time.c unicore32: Remove IRQF_DISABLED 2012-01-10 10:29:41 +08:00
traps.c sysfs: remove "last sysfs file:" line from the oops messages 2011-05-13 16:05:51 -07:00
vmlinux.lds.S unicore32: change PERCPU to PERCPU_SECTION 2011-06-09 16:27:46 +08:00