aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorZachary Amsden <zach@vmware.com>2005-09-03 18:56:40 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:12 -0400
commitc9b02a24130e3ff14a553d966a79f46cf806b037 (patch)
tree1c496ef13e8d2d991f5197ec1c1eb34282beddf0 /arch/i386
parente7a2ff593c0e48b130434dee4d2fd3452a850e6f (diff)
[PATCH] i386: use set_pte macros in a couple places where they were missing
Also, setting PDPEs in PAE mode does not require atomic operations, since the PDPEs are cached by the processor, and only reloaded on an explicit or implicit reload of CR3. Since the four PDPEs must always be present in an active root, and the kernel PDPE is never updated, we are safe even from SMIs and interrupts / NMIs using task gates (which reload CR3). Actually, much of this is moot, since the user PDPEs are never updated either, and the only usage of task gates is by the doublefault handler. It appears the only place PGDs get updated in PAE mode is in init_low_mappings() / zap_low_mapping() for initial page table creation and recovery from ACPI sleep state, and these sites are safe by inspection. Getting rid of the cmpxchg8b saves code space and 720 cycles in pgd_alloc on P4. Signed-off-by: Zachary Amsden <zach@vmware.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/mm/init.c2
-rw-r--r--arch/i386/mm/pageattr.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index d8b23ab76533..9edfc058b894 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -349,7 +349,7 @@ static void __init pagetable_init (void)
349 * All user-space mappings are explicitly cleared after 349 * All user-space mappings are explicitly cleared after
350 * SMP startup. 350 * SMP startup.
351 */ 351 */
352 pgd_base[0] = pgd_base[USER_PTRS_PER_PGD]; 352 set_pgd(&pgd_base[0], pgd_base[USER_PTRS_PER_PGD]);
353#endif 353#endif
354} 354}
355 355
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index bce06a79eafa..f600fc244f02 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -12,6 +12,7 @@
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <asm/processor.h> 13#include <asm/processor.h>
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/pgalloc.h>
15 16
16static DEFINE_SPINLOCK(cpa_lock); 17static DEFINE_SPINLOCK(cpa_lock);
17static struct list_head df_list = LIST_HEAD_INIT(df_list); 18static struct list_head df_list = LIST_HEAD_INIT(df_list);
@@ -52,8 +53,8 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot)
52 addr = address & LARGE_PAGE_MASK; 53 addr = address & LARGE_PAGE_MASK;
53 pbase = (pte_t *)page_address(base); 54 pbase = (pte_t *)page_address(base);
54 for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) { 55 for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
55 pbase[i] = pfn_pte(addr >> PAGE_SHIFT, 56 set_pte(&pbase[i], pfn_pte(addr >> PAGE_SHIFT,
56 addr == address ? prot : PAGE_KERNEL); 57 addr == address ? prot : PAGE_KERNEL));
57 } 58 }
58 return base; 59 return base;
59} 60}