linux/arch/x86/mm
Dave Hansen 3ceaccdf92 x86/mpx: Rewrite the unmap code
The MPX code needs to clear out bounds tables for memory which
is no longer in use.  We do this when a userspace mapping is
torn down (unmapped).

There are two modes:

  1. An entire bounds table becomes unused, and can be freed
     and its pointer removed from the bounds directory.  This
     happens either when a large mapping is torn down, or when
     a small mapping is torn down and it is the last mapping
     "covered" by a bounds table.

  2. Only part of a bounds table becomes unused, in which case
     we free the backing memory as if MADV_DONTNEED was called.

The old code was a spaghetti mess of "edge" bounds tables
where the edges were handled specially, even if we were
unmapping an entire one.  Non-edge bounds tables are always
fully unmapped, but share a different code path from the edge
ones.  The old code had a bug where it was unmapping too much
memory.  I worked on fixing it for two days and gave up.

I didn't write the original code.  I didn't particularly like
it, but it worked, so I left it.  After my debug session, I
realized it was undebuggagle *and* buggy, so out it went.

I also wrote a new unmapping test program which uncovers bugs
pretty nicely.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150607183706.DCAEC67D@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-06-09 12:24:34 +02:00
..
kmemcheck
amdtopology.c
dump_pagetables.c
extable.c
fault.c
gup.c
highmem_32.c
hugetlbpage.c
init_32.c
init_64.c
init.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 13:31:32 -07:00
iomap_32.c
ioremap.c Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-05-06 10:57:37 -07:00
kasan_init_64.c
kmmio.c
Makefile mm: move memtest under mm 2015-04-14 16:49:06 -07:00
mm_internal.h
mmap.c mm: expose arch_mmap_rnd when available 2015-04-14 16:49:05 -07:00
mmio-mod.c
mpx.c x86/mpx: Rewrite the unmap code 2015-06-09 12:24:34 +02:00
numa_32.c
numa_64.c
numa_emulation.c
numa_internal.h
numa.c x86/mm/numa: Fix kernel stack corruption in numa_init()->numa_clear_kernel_node_hotplug() 2015-04-07 16:01:19 +02:00
pageattr-test.c
pageattr.c
pat_internal.h
pat_rbtree.c
pat.c
pf_in.c
pf_in.h
pgtable_32.c
pgtable.c x86, mm: support huge KVA mappings on x86 2015-04-14 16:49:04 -07:00
physaddr.c
physaddr.h
setup_nx.c
srat.c
testmmiotrace.c
tlb.c