diff options
Diffstat (limited to 'arch/x86/include/asm/pgtable-3level.h')
-rw-r--r-- | arch/x86/include/asm/pgtable-3level.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index 94b979d1b58d..effff47a3c82 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
@@ -69,8 +69,6 @@ static inline void native_pmd_clear(pmd_t *pmd) | |||
69 | 69 | ||
70 | static inline void pud_clear(pud_t *pudp) | 70 | static inline void pud_clear(pud_t *pudp) |
71 | { | 71 | { |
72 | unsigned long pgd; | ||
73 | |||
74 | set_pud(pudp, __pud(0)); | 72 | set_pud(pudp, __pud(0)); |
75 | 73 | ||
76 | /* | 74 | /* |
@@ -79,13 +77,10 @@ static inline void pud_clear(pud_t *pudp) | |||
79 | * section 8.1: in PAE mode we explicitly have to flush the | 77 | * section 8.1: in PAE mode we explicitly have to flush the |
80 | * TLB via cr3 if the top-level pgd is changed... | 78 | * TLB via cr3 if the top-level pgd is changed... |
81 | * | 79 | * |
82 | * Make sure the pud entry we're updating is within the | 80 | * Currently all places where pud_clear() is called either have |
83 | * current pgd to avoid unnecessary TLB flushes. | 81 | * flush_tlb_mm() followed or don't need TLB flush (x86_64 code or |
82 | * pud_clear_bad()), so we don't need TLB flush here. | ||
84 | */ | 83 | */ |
85 | pgd = read_cr3(); | ||
86 | if (__pa(pudp) >= pgd && __pa(pudp) < | ||
87 | (pgd + sizeof(pgd_t)*PTRS_PER_PGD)) | ||
88 | write_cr3(pgd); | ||
89 | } | 84 | } |
90 | 85 | ||
91 | #ifdef CONFIG_SMP | 86 | #ifdef CONFIG_SMP |