ia64/xen-unstable

changeset 3077:5eb8d44dec3a

bitkeeper revision 1.1159.1.442 (41a1d10dbSYVvRxFN616mDsOZFOL0Q)

processor.h, fault.c:
Make cur_pgd percpu.
author cl349@arcadians.cl.cam.ac.uk
date Mon Nov 22 11:44:13 2004 +0000 (2004-11-22)
parents 665c0039f15f
children c5bce79aef35
files linux-2.6.9-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/processor.h
line diff
     1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/fault.c	Mon Nov 22 10:47:20 2004 +0000
     1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/fault.c	Mon Nov 22 11:44:13 2004 +0000
     1.3 @@ -21,6 +21,7 @@
     1.4  #include <linux/vt_kern.h>		/* For unblank_screen() */
     1.5  #include <linux/highmem.h>
     1.6  #include <linux/module.h>
     1.7 +#include <linux/percpu.h>
     1.8  
     1.9  #include <asm/system.h>
    1.10  #include <asm/uaccess.h>
    1.11 @@ -29,7 +30,7 @@
    1.12  
    1.13  extern void die(const char *,struct pt_regs *,long);
    1.14  
    1.15 -pgd_t *cur_pgd;			/* XXXsmp */
    1.16 +DEFINE_PER_CPU(pgd_t *, cur_pgd);
    1.17  
    1.18  /*
    1.19   * Unlock any spinlocks which will prevent us from getting the
    1.20 @@ -453,7 +454,8 @@ no_context:
    1.21  	printk(" at virtual address %08lx\n",address);
    1.22  	printk(KERN_ALERT " printing eip:\n");
    1.23  	printk("%08lx\n", regs->eip);
    1.24 -	page = ((unsigned long *) cur_pgd)[address >> 22];
    1.25 +	page = ((unsigned long *) per_cpu(cur_pgd, smp_processor_id()))
    1.26 +	    [address >> 22];
    1.27  	printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page, machine_to_phys(page));
    1.28  	/*
    1.29  	 * We must not directly access the pte in the highpte
    1.30 @@ -526,7 +528,7 @@ vmalloc_fault:
    1.31  		pmd_t *pmd, *pmd_k;
    1.32  		pte_t *pte_k;
    1.33  
    1.34 -		pgd = index + cur_pgd;
    1.35 +		pgd = index + per_cpu(cur_pgd, smp_processor_id());
    1.36  		pgd_k = init_mm.pgd + index;
    1.37  
    1.38  		if (!pgd_present(*pgd_k))
     2.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/processor.h	Mon Nov 22 10:47:20 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/processor.h	Mon Nov 22 11:44:13 2004 +0000
     2.3 @@ -87,7 +87,7 @@ extern struct cpuinfo_x86 boot_cpu_data;
     2.4  extern struct cpuinfo_x86 new_cpu_data;
     2.5  extern struct tss_struct doublefault_tss;
     2.6  DECLARE_PER_CPU(struct tss_struct, init_tss);
     2.7 -extern pgd_t *cur_pgd;		/* XXXsmp */
     2.8 +DECLARE_PER_CPU(pgd_t *, cur_pgd);
     2.9  
    2.10  #ifdef CONFIG_SMP
    2.11  extern struct cpuinfo_x86 cpu_data[];
    2.12 @@ -183,7 +183,7 @@ static inline unsigned int cpuid_edx(uns
    2.13  
    2.14  #define load_cr3(pgdir) do {				\
    2.15  	queue_pt_switch(__pa(pgdir));			\
    2.16 -	cur_pgd = pgdir;	/* XXXsmp */		\
    2.17 +	per_cpu(cur_pgd, smp_processor_id()) = pgdir;	\
    2.18  } while (/* CONSTCOND */0)
    2.19  
    2.20