Re: [PATCH 11 of 11] x86: defer cr3 reload when doing pud_clear()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Keir Fraser <Keir.Fraser@...>
Cc: Jeremy Fitzhardinge <jeremy@...>, Ingo Molnar <mingo@...>, LKML <linux-kernel@...>, Andi Kleen <ak@...>, Jan Beulich <jbeulich@...>, Eduardo Pereira Habkost <ehabkost@...>, Ian Campbell <ijc@...>, William Irwin <wli@...>, Linus Torvalds <torvalds@...>
Date: Friday, January 25, 2008 - 8:10 pm

Keir Fraser wrote:

Actually, it's trickier than that.  The PDPTR, just like the segments, 
aren't a real cache, and aren't invalidated by INVLPG.  This means you 
can't go from less permissive to more permissive, which is normally 
permitted in the x86.  The PDPTR should really be thought of as an 
extended cr3 with four entries (this is also how it would be typically 
implemented in hardware) rather than as a part of the paging structure 
per se.

We do NOT want to frob %cr4 unless we actually need to clear all the 
global pages.

The stuff in chapter 10 sounds like they're flagging for a revised 
INVLPG instruction or mode which would fit some of the extremely serious 
defects in INVLPG that was introduced by haphazard semantics from the P5 
and early P6 days.

In general, we should assume that INVLPG only flushes the hierarchy 
above it, and not rely on side effects.  In particular, we should only 
assume INVLPG invalidates the hierarchy immediately above it, not on any 
side effects.  That's basically sane design anyway.

Now, all of this reminds me of something somewhat messy: if we share the 
kernel page tables for trampoline page tables, as discussed elsewhere, 
we HAVE to do a complete, all-tlb-including-global-pages flush after 
use, since the kernel pages are global and otherwise will stick around. 
  Unlike the permissions pages, there aren't G enable bits on the higher 
levels, but only for the PTEs themselves.

	-hpa

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 11 of 11] x86: defer cr3 reload when doing pud_cl..., Jeremy Fitzhardinge, (Fri Jan 25, 6:54 pm)
Re: [PATCH 11 of 11] x86: defer cr3 reload when doing pud_cl..., H. Peter Anvin, (Fri Jan 25, 8:10 pm)
Re: [PATCH 11 of 11] x86: defer cr3 reload when doing pud_cl..., Jeremy Fitzhardinge, (Fri Jan 25, 8:57 pm)
Re: [PATCH 11 of 11] x86: defer cr3 reload when doing pud_cl..., Jeremy Fitzhardinge, (Fri Jan 25, 7:44 pm)