]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Revert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit"
authorAndrea Arcangeli <aarcange@redhat.com>
Thu, 7 Feb 2013 01:25:50 +0000 (12:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:45:20 +0000 (16:45 +1100)
commitd63d94f75655bd1e383b520c886139dffb417c17
tree24f694a985ccc2cd7b23ef850dcaf7dfce6aebdc
parentd3703e6d6c3cc04e4418480052ab1491e46bbe34
Revert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit"

I got a report for a minor regression introduced by commit 027ef6c87853b
("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 660a293ea9be709 ("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).

This patch:

Revert commit 660a293ea9be709 ("x86, mm: Make spurious_fault check
explicitly check the PRESENT bit").

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: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/fault.c