direct-io.hg

changeset 5738:f1a16642edaf

non-PAE behavior should be identical after applying these
patches, i.e. both dom0 and domU boots work as usual.

In PAE mode dom0 boot works and seems to be stable, running
linux kernel builds with -j12 at the moment ;)

Actually using more than 4GB isn't tested yet, my machine has
only one GB. Also this needs a patch for the e820 code in
xen, right now xen will not even try to use memory above 4GB.

Signed-off-by: Gerd Knorr <kraxel@suse.de>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 11 16:00:46 2005 +0000 (2005-07-11)
parents e6f48ae99035
children 622ea2078f85
files linux-2.6-xen-sparse/arch/xen/i386/Kconfig linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/hypervisor.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Mon Jul 11 15:56:50 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/Kconfig	Mon Jul 11 16:00:46 2005 +0000
     1.3 @@ -581,11 +581,11 @@ config HIGHMEM4G
     1.4  	  Select this if you have a 32-bit processor and between 1 and 4
     1.5  	  gigabytes of physical RAM.
     1.6  
     1.7 -#config HIGHMEM64G
     1.8 -#	bool "64GB"
     1.9 -#	help
    1.10 -#	  Select this if you have a 32-bit processor and more than 4
    1.11 -#	  gigabytes of physical RAM.
    1.12 +config HIGHMEM64G
    1.13 +	bool "64GB"
    1.14 +	help
    1.15 +	  Select this if you have a 32-bit processor and more than 4
    1.16 +	  gigabytes of physical RAM.
    1.17  
    1.18  endchoice
    1.19  
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Mon Jul 11 15:56:50 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S	Mon Jul 11 16:00:46 2005 +0000
     2.3 @@ -5,6 +5,11 @@
     2.4  	.ascii	"GUEST_OS=linux,GUEST_VER=2.6"
     2.5  	.ascii	",XEN_VER=3.0"
     2.6  	.ascii	",VIRT_BASE=0xC0000000"
     2.7 +#ifdef CONFIG_X86_PAE
     2.8 +	.ascii	",PAE=yes"
     2.9 +#else
    2.10 +	.ascii	",PAE=no"
    2.11 +#endif
    2.12  	.ascii	",LOADER=generic"
    2.13  	.byte	0
    2.14  
    2.15 @@ -145,10 +150,17 @@ ENTRY(cpu_gdt_table)
    2.16  	.quad 0x0000000000000000	/* 0x53 reserved */
    2.17  	.quad 0x0000000000000000	/* 0x5b reserved */
    2.18  
    2.19 +#ifdef CONFIG_X86_PAE
    2.20 +	.quad 0x00cfbb00000067ff	/* 0x60 kernel 4GB code at 0x00000000 */
    2.21 +	.quad 0x00cfb300000067ff	/* 0x68 kernel 4GB data at 0x00000000 */
    2.22 +	.quad 0x00cffb00000067ff	/* 0x73 user 4GB code at 0x00000000 */
    2.23 +	.quad 0x00cff300000067ff	/* 0x7b user 4GB data at 0x00000000 */
    2.24 +#else
    2.25  	.quad 0x00cfbb000000c3ff	/* 0x60 kernel 4GB code at 0x00000000 */
    2.26  	.quad 0x00cfb3000000c3ff	/* 0x68 kernel 4GB data at 0x00000000 */
    2.27  	.quad 0x00cffb000000c3ff	/* 0x73 user 4GB code at 0x00000000 */
    2.28  	.quad 0x00cff3000000c3ff	/* 0x7b user 4GB data at 0x00000000 */
    2.29 +#endif
    2.30  
    2.31  	.quad 0x0000000000000000	/* 0x80 TSS descriptor */
    2.32  	.quad 0x0000000000000000	/* 0x88 LDT descriptor */
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Mon Jul 11 15:56:50 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Mon Jul 11 16:00:46 2005 +0000
     3.3 @@ -47,15 +47,20 @@
     3.4  #elif defined(CONFIG_X86_64)
     3.5  #define pmd_val_ma(v) (v).pmd
     3.6  #else
     3.7 -#define pmd_val_ma(v) (v).pud.pgd.pgd
     3.8 +#ifdef CONFIG_X86_PAE
     3.9 +# define pmd_val_ma(v) ((v).pmd)
    3.10 +# define pud_val_ma(v) ((v).pgd.pgd)
    3.11 +#else
    3.12 +# define pmd_val_ma(v) ((v).pud.pgd.pgd)
    3.13 +#endif
    3.14  #endif
    3.15  
    3.16  #ifndef CONFIG_XEN_SHADOW_MODE
    3.17 -void xen_l1_entry_update(pte_t *ptr, unsigned long val)
    3.18 +void xen_l1_entry_update(pte_t *ptr, pte_t val)
    3.19  {
    3.20      mmu_update_t u;
    3.21      u.ptr = virt_to_machine(ptr);
    3.22 -    u.val = val;
    3.23 +    u.val = pte_val_ma(val);
    3.24      BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
    3.25  }
    3.26  
    3.27 @@ -67,6 +72,16 @@ void xen_l2_entry_update(pmd_t *ptr, pmd
    3.28      BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
    3.29  }
    3.30  
    3.31 +#ifdef CONFIG_X86_PAE
    3.32 +void xen_l3_entry_update(pud_t *ptr, pud_t val)
    3.33 +{
    3.34 +    mmu_update_t u;
    3.35 +    u.ptr = virt_to_machine(ptr);
    3.36 +    u.val = pud_val_ma(val);
    3.37 +    BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
    3.38 +}
    3.39 +#endif
    3.40 +
    3.41  #ifdef CONFIG_X86_64
    3.42  void xen_l3_entry_update(pud_t *ptr, pud_t val)
    3.43  {
    3.44 @@ -171,6 +186,8 @@ void xen_pgd_pin(unsigned long ptr)
    3.45      struct mmuext_op op;
    3.46  #ifdef CONFIG_X86_64
    3.47      op.cmd = MMUEXT_PIN_L4_TABLE;
    3.48 +#elif defined(CONFIG_X86_PAE)
    3.49 +    op.cmd = MMUEXT_PIN_L3_TABLE;
    3.50  #else
    3.51      op.cmd = MMUEXT_PIN_L2_TABLE;
    3.52  #endif
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Mon Jul 11 15:56:50 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c	Mon Jul 11 16:00:46 2005 +0000
     4.3 @@ -57,9 +57,10 @@ static pmd_t * __init one_md_table_init(
     4.4  {
     4.5  	pud_t *pud;
     4.6  	pmd_t *pmd_table;
     4.7 -		
     4.8 +
     4.9  #ifdef CONFIG_X86_PAE
    4.10  	pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
    4.11 +	make_page_readonly(pmd_table);
    4.12  	set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
    4.13  	pud = pud_offset(pgd, 0);
    4.14  	if (pmd_table != pmd_offset(pud, 0)) 
    4.15 @@ -115,13 +116,13 @@ static void __init page_table_range_init
    4.16  	pmd_idx = pmd_index(vaddr);
    4.17  	pgd = pgd_base + pgd_idx;
    4.18  
    4.19 -	for ( ; (pgd_idx < PTRS_PER_PGD_NO_HV) && (vaddr != end); pgd++, pgd_idx++) {
    4.20 +	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) {
    4.21  		if (pgd_none(*pgd)) 
    4.22  			one_md_table_init(pgd);
    4.23  		pud = pud_offset(pgd, vaddr);
    4.24  		pmd = pmd_offset(pud, vaddr);
    4.25  		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) {
    4.26 -			if (pmd_none(*pmd)) 
    4.27 +			if (vaddr < HYPERVISOR_VIRT_START && pmd_none(*pmd)) 
    4.28  				one_page_table_init(pmd);
    4.29  
    4.30  			vaddr += PMD_SIZE;
    4.31 @@ -160,13 +161,26 @@ static void __init kernel_physical_mappi
    4.32  	pmd_idx = pmd_index(PAGE_OFFSET);
    4.33  	pte_ofs = pte_index(PAGE_OFFSET);
    4.34  
    4.35 -	for (; pgd_idx < PTRS_PER_PGD_NO_HV; pgd++, pgd_idx++) {
    4.36 +	for (; pgd_idx < PTRS_PER_PGD; pgd++, pgd_idx++) {
    4.37 +#ifdef CONFIG_XEN
    4.38 +		/*
    4.39 +		 * Native linux hasn't PAE-paging enabled yet at this
    4.40 +		 * point.  When running as xen domain we are in PAE
    4.41 +		 * mode already, thus we can't simply hook a empty
    4.42 +		 * pmd.  That would kill the mappings we are currently
    4.43 +		 * using ...
    4.44 +		 */
    4.45 +		pmd = pmd_offset(pud_offset(pgd, PAGE_OFFSET), PAGE_OFFSET);
    4.46 +#else
    4.47  		pmd = one_md_table_init(pgd);
    4.48 +#endif
    4.49  		if (pfn >= max_low_pfn)
    4.50  			continue;
    4.51  		pmd += pmd_idx;
    4.52  		for (; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
    4.53  			unsigned int address = pfn * PAGE_SIZE + PAGE_OFFSET;
    4.54 +			if (address >= HYPERVISOR_VIRT_START)
    4.55 +				continue;
    4.56  
    4.57  			/* Map with big pages if possible, otherwise create normal page tables. */
    4.58  			if (cpu_has_pse) {
    4.59 @@ -350,6 +364,7 @@ static void __init pagetable_init (void)
    4.60  	 * page directory, write-protect the new page directory, then switch to
    4.61  	 * it. We clean up by write-enabling and then freeing the old page dir.
    4.62  	 */
    4.63 +#ifndef CONFIG_X86_PAE
    4.64  	memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
    4.65  	make_page_readonly(pgd_base);
    4.66  	xen_pgd_pin(__pa(pgd_base));
    4.67 @@ -358,8 +373,31 @@ static void __init pagetable_init (void)
    4.68  	make_page_writable(old_pgd);
    4.69  	__flush_tlb_all();
    4.70  	free_bootmem(__pa(old_pgd), PAGE_SIZE);
    4.71 +#else
    4.72 +	{
    4.73 +		pud_t *old_pud = pud_offset(old_pgd+3, PAGE_OFFSET);
    4.74 +		pmd_t *old_pmd = pmd_offset(old_pud, PAGE_OFFSET);
    4.75 +		pmd_t *new_pmd = alloc_bootmem_low_pages(PAGE_SIZE);
    4.76 +
    4.77 +		memcpy(new_pmd,  old_pmd, PAGE_SIZE);
    4.78 +		memcpy(pgd_base, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
    4.79 +		set_pgd(&pgd_base[3], __pgd(__pa(new_pmd) | _PAGE_PRESENT));
    4.80 +
    4.81 +		make_page_readonly(new_pmd);
    4.82 +		make_page_readonly(pgd_base);
    4.83 +		xen_pgd_pin(__pa(pgd_base));
    4.84 +		load_cr3(pgd_base);
    4.85 +		xen_pgd_unpin(__pa(old_pgd));
    4.86 +		make_page_writable(old_pgd);
    4.87 +		make_page_writable(old_pmd);
    4.88 +		__flush_tlb_all();
    4.89 +
    4.90 +		free_bootmem(__pa(old_pgd), PAGE_SIZE);
    4.91 +		free_bootmem(__pa(old_pmd), PAGE_SIZE);
    4.92 +	}
    4.93 +#endif
    4.94 +
    4.95  	init_mm.context.pinned = 1;
    4.96 -
    4.97  	kernel_physical_mapping_init(pgd_base);
    4.98  	remap_numa_kva();
    4.99  
   4.100 @@ -372,7 +410,7 @@ static void __init pagetable_init (void)
   4.101  
   4.102  	permanent_kmaps_init(pgd_base);
   4.103  
   4.104 -#ifdef CONFIG_X86_PAE
   4.105 +#if 0 /* def CONFIG_X86_PAE */
   4.106  	/*
   4.107  	 * Add low memory identity-mappings - SMP needs it when
   4.108  	 * starting up on an AP from real-mode. In the non-PAE
   4.109 @@ -380,7 +418,7 @@ static void __init pagetable_init (void)
   4.110  	 * All user-space mappings are explicitly cleared after
   4.111  	 * SMP startup.
   4.112  	 */
   4.113 -	pgd_base[0] = pgd_base[USER_PTRS_PER_PGD];
   4.114 +	set_pgd(&pgd_base[0], pgd_base[USER_PTRS_PER_PGD]);
   4.115  #endif
   4.116  }
   4.117  
   4.118 @@ -415,7 +453,7 @@ void zap_low_mappings (void)
   4.119  	 * us, because pgd_clear() is a no-op on i386.
   4.120  	 */
   4.121  	for (i = 0; i < USER_PTRS_PER_PGD; i++)
   4.122 -#ifdef CONFIG_X86_PAE
   4.123 +#if defined(CONFIG_X86_PAE) && !defined(CONFIG_XEN)
   4.124  		set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));
   4.125  #else
   4.126  		set_pgd(swapper_pg_dir+i, __pgd(0));
   4.127 @@ -514,10 +552,12 @@ void __init paging_init(void)
   4.128  
   4.129  	pagetable_init();
   4.130  
   4.131 -#ifdef CONFIG_X86_PAE
   4.132 +#if defined(CONFIG_X86_PAE) && !defined(CONFIG_XEN)
   4.133  	/*
   4.134  	 * We will bail out later - printk doesn't work right now so
   4.135  	 * the user would just see a hanging kernel.
   4.136 +	 * when running as xen domain we are already in PAE mode at
   4.137 +	 * this point.
   4.138  	 */
   4.139  	if (cpu_has_pae)
   4.140  		set_in_cr4(X86_CR4_PAE);
   4.141 @@ -690,8 +730,13 @@ void __init pgtable_cache_init(void)
   4.142  			panic("pgtable_cache_init(): cannot create pmd cache");
   4.143  	}
   4.144  	pgd_cache = kmem_cache_create("pgd",
   4.145 +#if 0 /* How the heck _this_ works in native linux ??? */
   4.146  				PTRS_PER_PGD*sizeof(pgd_t),
   4.147  				PTRS_PER_PGD*sizeof(pgd_t),
   4.148 +#else
   4.149 +				PAGE_SIZE,
   4.150 +				PAGE_SIZE,
   4.151 +#endif
   4.152  				0,
   4.153  				pgd_ctor,
   4.154  				pgd_dtor);
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Mon Jul 11 15:56:50 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Mon Jul 11 16:00:46 2005 +0000
     5.3 @@ -364,6 +364,7 @@ void pgd_free(pgd_t *pgd)
     5.4  		if (!HAVE_SHARED_KERNEL_PMD) {
     5.5  			pmd_t *pmd = (void *)__va(pgd_val(pgd[USER_PTRS_PER_PGD])-1);
     5.6  			make_page_writable(pmd);
     5.7 +			memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t));
     5.8  			kmem_cache_free(pmd_cache, pmd);
     5.9  		}
    5.10  	}
     6.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Mon Jul 11 15:56:50 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Mon Jul 11 16:00:46 2005 +0000
     6.3 @@ -15,6 +15,8 @@
     6.4  #include <linux/config.h>
     6.5  #include <linux/string.h>
     6.6  #include <linux/types.h>
     6.7 +#include <linux/kernel.h>
     6.8 +#include <asm/bug.h>
     6.9  #include <asm-xen/xen-public/xen.h>
    6.10  #include <asm-xen/foreign_page.h>
    6.11  
    6.12 @@ -84,9 +86,40 @@ typedef struct { unsigned long pte_low, 
    6.13  typedef struct { unsigned long long pmd; } pmd_t;
    6.14  typedef struct { unsigned long long pgd; } pgd_t;
    6.15  typedef struct { unsigned long long pgprot; } pgprot_t;
    6.16 -#define pmd_val(x)	((x).pmd)
    6.17 -#define pte_val(x)	((x).pte_low | ((unsigned long long)(x).pte_high << 32))
    6.18 -#define __pmd(x) ((pmd_t) { (x) } )
    6.19 +#define __pte(x) ({ unsigned long long _x = (x); \
    6.20 +    (((_x)&1) ? ((pte_t) {phys_to_machine(_x)}) : ((pte_t) {(_x)})); })
    6.21 +#define __pgd(x) ({ unsigned long long _x = (x); \
    6.22 +    (((_x)&1) ? ((pgd_t) {phys_to_machine(_x)}) : ((pgd_t) {(_x)})); })
    6.23 +#define __pmd(x) ({ unsigned long long _x = (x); \
    6.24 +    (((_x)&1) ? ((pmd_t) {phys_to_machine(_x)}) : ((pmd_t) {(_x)})); })
    6.25 +static inline unsigned long long pte_val(pte_t x)
    6.26 +{
    6.27 +	unsigned long long ret;
    6.28 +
    6.29 +	if (x.pte_low) {
    6.30 +		ret = x.pte_low | (unsigned long long)x.pte_high << 32;
    6.31 +		ret = machine_to_phys(ret) | 1;
    6.32 +	} else {
    6.33 +		ret = 0;
    6.34 +	}
    6.35 +	return ret;
    6.36 +}
    6.37 +static inline unsigned long long pmd_val(pmd_t x)
    6.38 +{
    6.39 +	unsigned long long ret = x.pmd;
    6.40 +	if (ret) ret = machine_to_phys(ret) | 1;
    6.41 +	return ret;
    6.42 +}
    6.43 +static inline unsigned long long pgd_val(pgd_t x)
    6.44 +{
    6.45 +	unsigned long long ret = x.pgd;
    6.46 +	if (ret) ret = machine_to_phys(ret) | 1;
    6.47 +	return ret;
    6.48 +}
    6.49 +static inline unsigned long long pte_val_ma(pte_t x)
    6.50 +{
    6.51 +	return (unsigned long long)x.pte_high << 32 | x.pte_low;
    6.52 +}
    6.53  #define HPAGE_SHIFT	21
    6.54  #else
    6.55  typedef struct { unsigned long pte_low; } pte_t;
    6.56 @@ -96,6 +129,16 @@ typedef struct { unsigned long pgprot; }
    6.57  #define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : \
    6.58  			 (x).pte_low)
    6.59  #define pte_val_ma(x)	((x).pte_low)
    6.60 +#define __pte(x) ({ unsigned long _x = (x); \
    6.61 +    (((_x)&1) ? ((pte_t) {phys_to_machine(_x)}) : ((pte_t) {(_x)})); })
    6.62 +#define __pgd(x) ({ unsigned long _x = (x); \
    6.63 +    (((_x)&1) ? ((pgd_t) {phys_to_machine(_x)}) : ((pgd_t) {(_x)})); })
    6.64 +static inline unsigned long pgd_val(pgd_t x)
    6.65 +{
    6.66 +	unsigned long ret = x.pgd;
    6.67 +	if (ret) ret = machine_to_phys(ret) | 1;
    6.68 +	return ret;
    6.69 +}
    6.70  #define HPAGE_SHIFT	22
    6.71  #endif
    6.72  #define PTE_MASK	PAGE_MASK
    6.73 @@ -107,20 +150,9 @@ typedef struct { unsigned long pgprot; }
    6.74  #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
    6.75  #endif
    6.76  
    6.77 -
    6.78 -static inline unsigned long pgd_val(pgd_t x)
    6.79 -{
    6.80 -	unsigned long ret = x.pgd;
    6.81 -	if (ret) ret = machine_to_phys(ret);
    6.82 -	return ret;
    6.83 -}
    6.84  #define pgprot_val(x)	((x).pgprot)
    6.85  
    6.86 -#define __pte(x) ({ unsigned long _x = (x); \
    6.87 -    (((_x)&1) ? ((pte_t) {phys_to_machine(_x)}) : ((pte_t) {(_x)})); })
    6.88  #define __pte_ma(x)	((pte_t) { (x) } )
    6.89 -#define __pgd(x) ({ unsigned long _x = (x); \
    6.90 -    (((_x)&1) ? ((pgd_t) {phys_to_machine(_x)}) : ((pgd_t) {(_x)})); })
    6.91  #define __pgprot(x)	((pgprot_t) { (x) } )
    6.92  
    6.93  #endif /* !__ASSEMBLY__ */
     7.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Mon Jul 11 15:56:50 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Mon Jul 11 16:00:46 2005 +0000
     7.3 @@ -400,7 +400,7 @@ extern void noexec_setup(const char *str
     7.4  		        if ( likely((__vma)->vm_mm == current->mm) ) {    \
     7.5  			    HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits)); \
     7.6  			} else {                                          \
     7.7 -                            xen_l1_entry_update((__ptep), (__entry).pte_low); \
     7.8 +                            xen_l1_entry_update((__ptep), (__entry)); \
     7.9  			    flush_tlb_page((__vma), (__address));         \
    7.10  			}                                                 \
    7.11  		}							  \
    7.12 @@ -419,7 +419,7 @@ do {				  					\
    7.13  		HYPERVISOR_update_va_mapping((__address),		\
    7.14  					     __entry, 0);		\
    7.15  	} else {							\
    7.16 -		xen_l1_entry_update((__ptep), (__entry).pte_low);	\
    7.17 +		xen_l1_entry_update((__ptep), (__entry));	\
    7.18  	}								\
    7.19  } while (0)
    7.20  
     8.1 --- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h	Mon Jul 11 15:56:50 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h	Mon Jul 11 16:00:46 2005 +0000
     8.3 @@ -40,9 +40,13 @@
     8.4  #include <asm/ptrace.h>
     8.5  #include <asm/page.h>
     8.6  #if defined(__i386__)
     8.7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     8.8 -#include <asm-generic/pgtable-nopmd.h>
     8.9 -#endif
    8.10 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.11 +#  ifdef CONFIG_X86_PAE
    8.12 +#   include <asm-generic/pgtable-nopud.h>
    8.13 +#  else
    8.14 +#   include <asm-generic/pgtable-nopmd.h>
    8.15 +#  endif
    8.16 +# endif
    8.17  #endif
    8.18  
    8.19  /* arch/xen/i386/kernel/setup.c */
    8.20 @@ -80,11 +84,9 @@ void xen_tlb_flush(void);
    8.21  void xen_invlpg(unsigned long ptr);
    8.22  
    8.23  #ifndef CONFIG_XEN_SHADOW_MODE
    8.24 -void xen_l1_entry_update(pte_t *ptr, unsigned long val);
    8.25 +void xen_l1_entry_update(pte_t *ptr, pte_t val);
    8.26  void xen_l2_entry_update(pmd_t *ptr, pmd_t val);
    8.27 -#ifdef __x86_64__
    8.28 -void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64 only */
    8.29 -#endif
    8.30 +void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */
    8.31  void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
    8.32  void xen_pgd_pin(unsigned long ptr);
    8.33  void xen_pgd_unpin(unsigned long ptr);