linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pageattr fixes for pmd/pte_present
@ 2012-12-17 18:00 Andrea Arcangeli
  2012-12-17 18:00 ` [PATCH 1/2] Revert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit" Andrea Arcangeli
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Andrea Arcangeli @ 2012-12-17 18:00 UTC (permalink / raw)
  To: linux-mm
  Cc: Andi Kleen, Andrew Morton, Shaohua Li, H. Peter Anvin, Mel Gorman,
	Hugh Dickins

Hi,

I got a report for a minor regression introduced by commit
027ef6c87853b0a9df53175063028edb4950d476.

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 660a293ea9be709b893d371fbc0328fcca33c33a (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).

Andrea Arcangeli (2):
  Revert "x86, mm: Make spurious_fault check explicitly check the
    PRESENT bit"
  pageattr: prevent PSE and GLOABL leftovers to confuse pmd/pte_present
    and pmd_huge

 arch/x86/mm/fault.c    |    8 +------
 arch/x86/mm/pageattr.c |   50 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 10 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-01-10  7:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 18:00 [PATCH 0/2] pageattr fixes for pmd/pte_present Andrea Arcangeli
2012-12-17 18:00 ` [PATCH 1/2] Revert "x86, mm: Make spurious_fault check explicitly check the PRESENT bit" Andrea Arcangeli
2012-12-17 18:17   ` H. Peter Anvin
2012-12-17 18:35     ` Andrea Arcangeli
2012-12-17 18:00 ` [PATCH 2/2] pageattr: prevent PSE and GLOABL leftovers to confuse pmd/pte_present and pmd_huge Andrea Arcangeli
2013-01-10  7:59   ` Simon Jeons
2013-01-06  2:59 ` [PATCH 0/2] pageattr fixes for pmd/pte_present Simon Jeons
2013-01-07 21:53   ` Andrew Morton
2013-01-07 21:55     ` H. Peter Anvin
2013-01-08 12:25       ` Andrea Arcangeli
2013-01-10  7:42 ` Simon Jeons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).