linux-kernel-test/arch
Andrea Arcangeli 954f857187 Revert "x86, mm: Make spurious_fault check explicitly check explicitly check the PRESENT bit"
I got a report for a minor regression introduced by commit
027ef6c878 ("mm: thp: fix pmd_present for split_huge_page and
PROT_NONE with THP").

So the problem is, pageattr creates kernel pagetables (pte and
pmds) that breaks pte_present/pmd_present and the patch above
exposed this invariant breakage for pmd_present.

The same problem already existed for the pte and pte_present and
it was fixed by commit 660a293ea9 ("x86, mm: Make
spurious_fault check explicitly check the PRESENT bit") (if it
wasn't for that commit, it wouldn't even be a regression).  That
fix avoids the pagefault to use pte_present.  I could follow
through by stopping using pmd_present/pmd_huge too.

However I think it's more robust to fix pageattr and to clear
the PSE/GLOBAL bitflags too in addition to the present bitflag.
So the kernel page fault can keep using the regular
pte_present/pmd_present/pmd_huge.

The confusion arises because _PAGE_GLOBAL and _PAGE_PROTNONE are
sharing the same bit, and in the pmd case we pretend _PAGE_PSE
to be set only in present pmds (to facilitate split_huge_page
final tlb flush).

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-02-24 13:01:44 +01:00
..
alpha Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 18:19:48 -08:00
arm Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
arm64 Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
avr32 avr32: Provide dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:11:14 +01:00
blackfin Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
c6x c6x: Provide dummy dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:11:14 +01:00
cris cris: Provide dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:11:14 +01:00
frv Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
h8300 These are a few cleanups for asm-generic: 2012-12-21 16:39:08 -08:00
hexagon arch Kconfig: Remove references to IRQ_PER_CPU 2013-02-04 18:53:20 +01:00
ia64 Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 18:19:48 -08:00
m32r ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
m68k Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu into akpm 2013-02-12 16:15:39 -08:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2013-01-07 07:39:32 -08:00
mips Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
mn10300 mn10300: Provide dummy dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:27:40 +01:00
openrisc ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
parisc Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
powerpc Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 19:05:45 -08:00
s390 Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 18:19:48 -08:00
score ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
sh arch Kconfig: Remove references to IRQ_PER_CPU 2013-02-04 18:53:20 +01:00
sparc Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 17:47:58 -08:00
tile tile: tag some code with #ifdef CONFIG_COMPAT 2013-02-08 13:20:43 -05:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-20 18:05:28 -08:00
unicore32 ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
x86 Revert "x86, mm: Make spurious_fault check explicitly check explicitly check the PRESENT bit" 2013-02-24 13:01:44 +01:00
xtensa xtensa: Provide dummy dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:27:41 +01:00
.gitignore
Kconfig kprobes/x86: Move ftrace-based kprobe code into kprobes-ftrace.c 2013-01-21 13:22:36 -05:00