ia64/xen-unstable

changeset 5744:308329b4e883

Fix the x86_64 build after the PAE check-in.
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jul 12 07:47:21 2005 +0000 (2005-07-12)
parents 8de4591d112f
children 8a8b8087b083
files linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_time.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Jul 12 07:45:57 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Jul 12 07:47:21 2005 +0000
     1.3 @@ -343,7 +343,7 @@ unsigned long allocate_empty_lowmem_regi
     1.4          pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); 
     1.5          pfn_array[i] = pte_mfn(*pte);
     1.6  #ifdef CONFIG_X86_64
     1.7 -        xen_l1_entry_update(pte, 0);
     1.8 +        xen_l1_entry_update(pte, __pte(0));
     1.9  #else
    1.10          HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
    1.11  #endif
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Tue Jul 12 07:45:57 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c	Tue Jul 12 07:47:21 2005 +0000
     2.3 @@ -67,7 +67,7 @@ static int init_mapping_done;
     2.4  static void __make_page_readonly(unsigned long va)
     2.5  {
     2.6          unsigned long addr;
     2.7 -        pte_t *pte;
     2.8 +        pte_t pte, *ptep;
     2.9  	unsigned long *page = (unsigned long *) init_level4_pgt;
    2.10  
    2.11  	addr = (unsigned long) page[pgd_index(va)];
    2.12 @@ -79,15 +79,16 @@ static void __make_page_readonly(unsigne
    2.13  	addr = page[pmd_index(va)];
    2.14  	addr_to_page(addr, page);
    2.15  
    2.16 -	pte = (pte_t *) &page[pte_index(va)];
    2.17 -	xen_l1_entry_update(pte, (*(unsigned long*)pte) & ~_PAGE_RW);
    2.18 +	ptep = (pte_t *) &page[pte_index(va)];
    2.19 +	pte.pte = (ptep->pte & ~_PAGE_RW);
    2.20 +	xen_l1_entry_update(ptep, pte);
    2.21  	__flush_tlb_one(addr);
    2.22  }
    2.23  
    2.24  static void __make_page_writable(unsigned long va)
    2.25  {
    2.26          unsigned long addr;
    2.27 -        pte_t *pte;
    2.28 +        pte_t pte, *ptep;
    2.29          unsigned long *page = (unsigned long *) init_level4_pgt;
    2.30  
    2.31          addr = (unsigned long) page[pgd_index(va)];
    2.32 @@ -99,8 +100,9 @@ static void __make_page_writable(unsigne
    2.33          addr = page[pmd_index(va)];
    2.34          addr_to_page(addr, page);
    2.35  
    2.36 -        pte = (pte_t *) &page[pte_index(va)];
    2.37 -        xen_l1_entry_update(pte, (*(unsigned long*)pte)| _PAGE_RW);
    2.38 +        ptep = (pte_t *) &page[pte_index(va)];
    2.39 +	pte.pte = (ptep->pte | _PAGE_RW);
    2.40 +        xen_l1_entry_update(ptep, pte);
    2.41  	__flush_tlb_one(addr);
    2.42  }
    2.43  
    2.44 @@ -110,7 +112,7 @@ static void __make_page_writable(unsigne
    2.45   */
    2.46  void make_page_readonly(void *va)
    2.47  {
    2.48 -        pgd_t* pgd; pud_t *pud; pmd_t* pmd; pte_t *pte;
    2.49 +	pgd_t* pgd; pud_t *pud; pmd_t* pmd; pte_t pte, *ptep;
    2.50          unsigned long addr = (unsigned long) va;
    2.51  
    2.52          if (!init_mapping_done) {
    2.53 @@ -121,14 +123,15 @@ void make_page_readonly(void *va)
    2.54          pgd = pgd_offset_k(addr);
    2.55          pud = pud_offset(pgd, addr);
    2.56          pmd = pmd_offset(pud, addr);
    2.57 -        pte = pte_offset_kernel(pmd, addr);
    2.58 -        xen_l1_entry_update(pte, (*(unsigned long*)pte)&~_PAGE_RW);
    2.59 +        ptep = pte_offset_kernel(pmd, addr);
    2.60 +	pte.pte = (ptep->pte & ~_PAGE_RW);
    2.61 +        xen_l1_entry_update(ptep, pte);
    2.62  	__flush_tlb_one(addr);
    2.63  }
    2.64  
    2.65  void make_page_writable(void *va)
    2.66  {
    2.67 -        pgd_t* pgd; pud_t *pud; pmd_t* pmd; pte_t *pte;
    2.68 +        pgd_t* pgd; pud_t *pud; pmd_t* pmd; pte_t pte, *ptep;
    2.69          unsigned long addr = (unsigned long) va;
    2.70  
    2.71          if (!init_mapping_done) {
    2.72 @@ -139,8 +142,9 @@ void make_page_writable(void *va)
    2.73          pgd = pgd_offset_k(addr);
    2.74          pud = pud_offset(pgd, addr);
    2.75          pmd = pmd_offset(pud, addr);
    2.76 -        pte = pte_offset_kernel(pmd, addr);
    2.77 -        xen_l1_entry_update(pte, (*(unsigned long*)pte)|_PAGE_RW);
    2.78 +        ptep = pte_offset_kernel(pmd, addr);
    2.79 +	pte.pte = (ptep->pte | _PAGE_RW);
    2.80 +        xen_l1_entry_update(ptep, pte);
    2.81  	__flush_tlb_one(addr);
    2.82  }
    2.83  
    2.84 @@ -276,7 +280,7 @@ static void set_pte_phys(unsigned long v
    2.85  	if (!pte_none(*pte) &&
    2.86  	    pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask))
    2.87  		pte_ERROR(*pte);
    2.88 -        xen_l1_entry_update(pte, new_pte.pte);
    2.89 +        xen_l1_entry_update(pte, new_pte);
    2.90  
    2.91  	/*
    2.92  	 * It's enough to flush this one mapping.
    2.93 @@ -331,16 +335,12 @@ static void set_pte_phys_ma(unsigned lon
    2.94  	new_pte = pfn_pte_ma(phys >> PAGE_SHIFT, prot);
    2.95  	pte = pte_offset_kernel(pmd, vaddr);
    2.96  
    2.97 -	if (!pte_none(*pte) &&
    2.98 -	    pte_val_ma(*pte) != (pte_val_ma(new_pte) & __supported_pte_mask))
    2.99 -		pte_ERROR(*pte);
   2.100 -
   2.101          /* 
   2.102           * Note that the pte page is already RO, thus we want to use
   2.103           * xen_l1_entry_update(), not set_pte().
   2.104           */
   2.105          xen_l1_entry_update(pte, 
   2.106 -                            (pfn_pte_ma(phys >> PAGE_SHIFT, prot).pte));
   2.107 +                            pfn_pte_ma(phys >> PAGE_SHIFT, prot));
   2.108  
   2.109  	/*
   2.110  	 * It's enough to flush this one mapping.
   2.111 @@ -575,7 +575,7 @@ void __init extend_init_mapping(void)
   2.112  						  __pgprot(_KERNPG_TABLE | _PAGE_USER));
   2.113  
   2.114  				pte = (pte_t *) &pte_page[pte_index(va)];
   2.115 -				xen_l1_entry_update(pte, new_pte.pte);
   2.116 +				xen_l1_entry_update(pte, new_pte);
   2.117  				extended_size += PAGE_SIZE;
   2.118  			}
   2.119  		} 
     3.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_time.h	Tue Jul 12 07:45:57 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_time.h	Tue Jul 12 07:47:21 2005 +0000
     3.3 @@ -7,7 +7,7 @@
     3.4  #ifndef _MACH_TIME_H
     3.5  #define _MACH_TIME_H
     3.6  
     3.7 -#include <linux/mc146818rtc.h>
     3.8 +#include <asm-i386/mc146818rtc.h>
     3.9  
    3.10  /* for check timing call set_rtc_mmss() 500ms     */
    3.11  /* used in arch/i386/time.c::do_timer_interrupt() */
     4.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Jul 12 07:45:57 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Jul 12 07:47:21 2005 +0000
     4.3 @@ -91,10 +91,10 @@ extern unsigned long empty_zero_page[PAG
     4.4  extern inline int pud_present(pud_t pud)	{ return !pud_none(pud); }
     4.5  
     4.6  #ifdef CONFIG_SMP
     4.7 -#define set_pte(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval).pte)
     4.8 +#define set_pte(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval))
     4.9  
    4.10  #else
    4.11 -#define set_pte(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval.pte))
    4.12 +#define set_pte(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval))
    4.13  #if 0
    4.14  static inline void set_pte(pte_t *dst, pte_t val)
    4.15  {
    4.16 @@ -347,7 +347,7 @@ static inline int ptep_test_and_clear_di
    4.17  	pte_t pte = *ptep;
    4.18  	int ret = pte_dirty(pte);
    4.19  	if (ret)
    4.20 -		xen_l1_entry_update(ptep, pte_mkclean(pte).pte);
    4.21 +		xen_l1_entry_update(ptep, pte_mkclean(pte));
    4.22  	return ret;
    4.23  }
    4.24  
    4.25 @@ -356,7 +356,7 @@ static inline int ptep_test_and_clear_yo
    4.26  	pte_t pte = *ptep;
    4.27  	int ret = pte_young(pte);
    4.28  	if (ret)
    4.29 -		xen_l1_entry_update(ptep, pte_mkold(pte).pte);
    4.30 +		xen_l1_entry_update(ptep, pte_mkold(pte));
    4.31  	return ret;
    4.32  }
    4.33