linux-kernel-test/arch/mips
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
..
alchemy MIPS: Alchemy: Increase minimum timeout for 32kHz timer. 2012-02-20 18:33:18 +01:00
ar7 Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
ath79 USB: use generic platform driver on ath79 2012-03-15 12:45:43 -07:00
bcm47xx MIPS: BCM47XX: provide sprom to bcma bus 2012-03-05 15:20:51 -05:00
bcm63xx mips: Fix typo in bcm63xx/setup.c 2012-02-05 17:14:47 +01:00
boot MIPS: Alchemy: Basic support for the DB1300 board. 2011-12-07 22:02:06 +00:00
cavium-octeon Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
cobalt MIPS: Mark cascade and low level interrupts IRQF_NO_THREAD 2011-09-21 17:52:15 +02:00
configs MIPS: PowerTV: Fix defconfigs for coverage builds 2012-02-20 18:33:20 +01:00
dec MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
emma MIPS: Yosemite, Emma: Fix off-by-two in arcs_cmdline buffer size check 2011-11-08 12:35:29 +00:00
fw Merge branch 'master' into for-next 2011-04-26 10:22:59 +02:00
include/asm Generialize powerpc's irq_host as irq_domain 2012-03-21 10:27:19 -07:00
jazz Merge branch 'next/generic' into mips-for-linux-next 2012-01-11 15:41:47 +01:00
jz4740 ASoC: jz4740: Convert qi_lb60 to use snd_soc_register_card() 2012-01-20 13:58:29 +00:00
kernel coredump: remove VM_ALWAYSDUMP flag 2012-03-23 16:58:42 -07:00
lantiq Merge branch 'next/generic' into mips-for-linux-next 2012-01-11 15:41:47 +01:00
lasat MIPS: Mark cascade and low level interrupts IRQF_NO_THREAD 2011-09-21 17:52:15 +02:00
lib mips: use the the PCI controller's io_map_base 2012-01-31 23:20:30 +02:00
loongson MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
math-emu MIPS Kprobes: Refactor branch emulation 2011-12-07 22:04:03 +00:00
mipssim atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
mm highmem: kill all __kmap_atomic() 2012-03-20 21:48:30 +08:00
mti-malta MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
netlogic MIPS: Netlogic: Mark Netlogic chips as SMT capable 2011-12-07 22:04:57 +00:00
oprofile MIPS: oprofile: Add callgraph support 2011-06-15 14:35:34 +02:00
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-03-05 21:16:26 -05:00
pmc-sierra MIPS: PCI: use list_for_each_entry() for bus->devices traversal 2012-02-20 18:33:19 +01:00
pnx833x Fix common misspellings 2011-03-31 11:26:23 -03:00
pnx8550 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
power MIPS: Hibernation: Fixes for PAGE_SIZE >= 64kb 2011-05-10 18:15:26 +01:00
powertv Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
rb532 mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
sgi-ip22 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
sgi-ip27 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
sgi-ip32 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
sibyte MIPS: Sibyte: drop select of SIBYTE_CFE 2011-11-13 21:27:34 +01:00
sni MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
txx9 MIPS: txx9 7segled fix struct device has no member 2012-02-20 18:33:18 +01:00
vr41xx mips: fix implicit smp.h usage in various files. 2011-10-31 19:30:55 -04:00
wrppmc
Kbuild
Kbuild.platforms MIPS: XLR, XLS: Move makefile bits to were they belong. 2011-07-20 23:12:11 +01:00
Kconfig irq_domain/mips: Allow irq_domain on MIPS 2012-02-24 09:47:23 -07:00
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile MIPS: BMIPS: Add CFLAGS, Makefile entries for BMIPS 2011-12-07 22:03:17 +00:00