ia64/xen-unstable

changeset 17829:cc4e471bbc08

minios: Fix >4GB machine addresses

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 10 16:59:24 2008 +0100 (2008-06-10)
parents 5bf5fb8117c0
children b8fa4a11f715
files extras/mini-os/arch/x86/mm.c extras/mini-os/include/x86/arch_mm.h
line diff
     1.1 --- a/extras/mini-os/arch/x86/mm.c	Tue Jun 10 15:30:50 2008 +0100
     1.2 +++ b/extras/mini-os/arch/x86/mm.c	Tue Jun 10 16:59:24 2008 +0100
     1.3 @@ -59,7 +59,7 @@ void new_pt_frame(unsigned long *pt_pfn,
     1.4  {   
     1.5      pgentry_t *tab = (pgentry_t *)start_info.pt_base;
     1.6      unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn); 
     1.7 -    unsigned long prot_e, prot_t;
     1.8 +    pgentry_t prot_e, prot_t;
     1.9      mmu_update_t mmu_updates[1];
    1.10      
    1.11      prot_e = prot_t = 0;
    1.12 @@ -69,7 +69,7 @@ void new_pt_frame(unsigned long *pt_pfn,
    1.13  
    1.14      /* We need to clear the page, otherwise we might fail to map it
    1.15         as a page table page */
    1.16 -    memset((unsigned long*)pfn_to_virt(*pt_pfn), 0, PAGE_SIZE);  
    1.17 +    memset((void*) pt_page, 0, PAGE_SIZE);  
    1.18   
    1.19      switch ( level )
    1.20      {
    1.21 @@ -99,7 +99,7 @@ void new_pt_frame(unsigned long *pt_pfn,
    1.22  #endif
    1.23      tab = pte_to_virt(tab[l3_table_offset(pt_page)]);
    1.24  
    1.25 -    mmu_updates[0].ptr = ((pgentry_t)tab[l2_table_offset(pt_page)] & PAGE_MASK) + 
    1.26 +    mmu_updates[0].ptr = (tab[l2_table_offset(pt_page)] & PAGE_MASK) + 
    1.27                           sizeof(pgentry_t) * l1_table_offset(pt_page);
    1.28      mmu_updates[0].val = (pgentry_t)pfn_to_mfn(*pt_pfn) << PAGE_SHIFT | 
    1.29                           (prot_e & ~_PAGE_RW);
    1.30 @@ -474,7 +474,7 @@ void do_map_frames(unsigned long addr,
    1.31                  if (!pgt || !(addr & L1_MASK))
    1.32                      pgt = need_pgt(addr);
    1.33  		mmu_updates[i].ptr = virt_to_mach(pgt);
    1.34 -		mmu_updates[i].val = ((f[(done + i) * stride] + (done + i) * increment) << PAGE_SHIFT) | prot;
    1.35 +		mmu_updates[i].val = ((pgentry_t)(f[(done + i) * stride] + (done + i) * increment) << PAGE_SHIFT) | prot;
    1.36  	    }
    1.37  
    1.38  	    rc = HYPERVISOR_mmu_update(mmu_updates, todo, NULL, id);
     2.1 --- a/extras/mini-os/include/x86/arch_mm.h	Tue Jun 10 15:30:50 2008 +0100
     2.2 +++ b/extras/mini-os/include/x86/arch_mm.h	Tue Jun 10 16:59:24 2008 +0100
     2.3 @@ -109,16 +109,16 @@ typedef unsigned long pgentry_t;
     2.4    (((_a) >> L4_PAGETABLE_SHIFT) & (L4_PAGETABLE_ENTRIES - 1))
     2.5  #endif
     2.6  
     2.7 -#define _PAGE_PRESENT  0x001UL
     2.8 -#define _PAGE_RW       0x002UL
     2.9 -#define _PAGE_USER     0x004UL
    2.10 -#define _PAGE_PWT      0x008UL
    2.11 -#define _PAGE_PCD      0x010UL
    2.12 -#define _PAGE_ACCESSED 0x020UL
    2.13 -#define _PAGE_DIRTY    0x040UL
    2.14 -#define _PAGE_PAT      0x080UL
    2.15 -#define _PAGE_PSE      0x080UL
    2.16 -#define _PAGE_GLOBAL   0x100UL
    2.17 +#define _PAGE_PRESENT  0x001ULL
    2.18 +#define _PAGE_RW       0x002ULL
    2.19 +#define _PAGE_USER     0x004ULL
    2.20 +#define _PAGE_PWT      0x008ULL
    2.21 +#define _PAGE_PCD      0x010ULL
    2.22 +#define _PAGE_ACCESSED 0x020ULL
    2.23 +#define _PAGE_DIRTY    0x040ULL
    2.24 +#define _PAGE_PAT      0x080ULL
    2.25 +#define _PAGE_PSE      0x080ULL
    2.26 +#define _PAGE_GLOBAL   0x100ULL
    2.27  
    2.28  #if defined(__i386__)
    2.29  #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
    2.30 @@ -140,7 +140,7 @@ typedef unsigned long pgentry_t;
    2.31  
    2.32  #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> L1_PAGETABLE_SHIFT)
    2.33  #define PFN_DOWN(x)	((x) >> L1_PAGETABLE_SHIFT)
    2.34 -#define PFN_PHYS(x)	((x) << L1_PAGETABLE_SHIFT)
    2.35 +#define PFN_PHYS(x)	((uint64_t)(x) << L1_PAGETABLE_SHIFT)
    2.36  #define PHYS_PFN(x)	((x) >> L1_PAGETABLE_SHIFT)
    2.37  
    2.38  /* to align the pointer to the (next) page boundary */