Commit 954f8571 authored by Committed by Ingo MolnarBrowse files
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 027ef6c8 ("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 660a293e ("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 <firstname.lastname@example.org> Cc: Andi Kleen <email@example.com> Cc: Shaohua Li <firstname.lastname@example.org> Cc: "H. Peter Anvin" <email@example.com> Cc: Mel Gorman <firstname.lastname@example.org> Cc: Hugh Dickins <email@example.com> Cc: Andrew Morton <firstname.lastname@example.org> Cc: Peter Zijlstra <email@example.com> Cc: Thomas Gleixner <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Ingo Molnar <firstname.lastname@example.org>
Showing with 1 addition and 7 deletions