ia64/xen-unstable

changeset 3441:b96857892a2c

bitkeeper revision 1.1159.217.17 (41e80727RATVR7CCn-A5xanZXzrSfg)

Merge
author sos22@douglas.cl.cam.ac.uk
date Fri Jan 14 17:53:43 2005 +0000 (2005-01-14)
parents 0002ff9aa407 cfb5f80fb23e
children 5dd6907756ef
files xen/arch/x86/domain.c xen/arch/x86/memory.c xen/arch/x86/x86_32/mm.c xen/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Jan 14 08:40:37 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Fri Jan 14 17:53:43 2005 +0000
     1.3 @@ -236,8 +236,7 @@ void arch_do_createdomain(struct exec_do
     1.4          d->shared_info = (void *)alloc_xenheap_page();
     1.5          memset(d->shared_info, 0, PAGE_SIZE);
     1.6          ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid];
     1.7 -        d->shared_info->arch.mfn_to_pfn_start = 
     1.8 -            virt_to_phys(&machine_to_phys_mapping[0])>>PAGE_SHIFT;
     1.9 +        d->shared_info->arch.mfn_to_pfn_start = m2p_start_mfn;
    1.10          SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
    1.11          machine_to_phys_mapping[virt_to_phys(d->shared_info) >> 
    1.12                                 PAGE_SHIFT] = INVALID_P2M_ENTRY;
     2.1 --- a/xen/arch/x86/memory.c	Fri Jan 14 08:40:37 2005 +0000
     2.2 +++ b/xen/arch/x86/memory.c	Fri Jan 14 17:53:43 2005 +0000
     2.3 @@ -168,7 +168,7 @@ void __init init_frametable(void)
     2.4  
     2.5  void arch_init_memory(void)
     2.6  {
     2.7 -    unsigned long mfn, i;
     2.8 +    unsigned long i;
     2.9  
    2.10      /*
    2.11       * We are rather picky about the layout of 'struct pfn_info'. The
    2.12 @@ -211,13 +211,13 @@ void arch_init_memory(void)
    2.13      dom_io->id = DOMID_IO;
    2.14  
    2.15      /* M2P table is mappable read-only by privileged domains. */
    2.16 -    mfn = l2_pgentry_to_pagenr(
    2.17 -        idle_pg_table[RDWR_MPT_VIRT_START >> L2_PAGETABLE_SHIFT]);
    2.18      for ( i = 0; i < 1024; i++ )
    2.19      {
    2.20 -        frame_table[mfn+i].count_info        = PGC_allocated | 1;
    2.21 -        frame_table[mfn+i].u.inuse.type_info = PGT_gdt_page | 1; /* non-RW */
    2.22 -        frame_table[mfn+i].u.inuse.domain    = dom_xen;
    2.23 +        frame_table[m2p_start_mfn+i].count_info        = PGC_allocated | 1;
    2.24 +	/* gdt to make sure it's only mapped read-only by non-privileged
    2.25 +	   domains. */
    2.26 +        frame_table[m2p_start_mfn+i].u.inuse.type_info = PGT_gdt_page | 1;
    2.27 +        frame_table[m2p_start_mfn+i].u.inuse.domain    = dom_xen;
    2.28      }
    2.29  }
    2.30  
     3.1 --- a/xen/arch/x86/x86_32/mm.c	Fri Jan 14 08:40:37 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_32/mm.c	Fri Jan 14 17:53:43 2005 +0000
     3.3 @@ -27,6 +27,8 @@
     3.4  #include <asm/fixmap.h>
     3.5  #include <asm/domain_page.h>
     3.6  
     3.7 +unsigned long m2p_start_mfn;
     3.8 +
     3.9  static inline void set_pte_phys(unsigned long vaddr,
    3.10                                  l1_pgentry_t entry)
    3.11  {
    3.12 @@ -63,6 +65,7 @@ void __init paging_init(void)
    3.13      /* Allocate and map the machine-to-phys table. */
    3.14      if ( (pg = alloc_domheap_pages(NULL, 10)) == NULL )
    3.15          panic("Not enough memory to bootstrap Xen.\n");
    3.16 +    m2p_start_mfn = page_to_pfn(pg);
    3.17      idle_pg_table[RDWR_MPT_VIRT_START >> L2_PAGETABLE_SHIFT] =
    3.18          mk_l2_pgentry(page_to_phys(pg) | __PAGE_HYPERVISOR | _PAGE_PSE);
    3.19  
     4.1 --- a/xen/include/asm-x86/mm.h	Fri Jan 14 08:40:37 2005 +0000
     4.2 +++ b/xen/include/asm-x86/mm.h	Fri Jan 14 17:53:43 2005 +0000
     4.3 @@ -226,7 +226,10 @@ void synchronise_pagetables(unsigned lon
     4.4  extern unsigned long *machine_to_phys_mapping;
     4.5  extern unsigned long *phys_to_machine_mapping;
     4.6  #else
     4.7 +/* Don't call virt_to_phys on this: it isn't direct mapped.  Using
     4.8 +   m2p_start_mfn instead. */
     4.9  #define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
    4.10 +extern unsigned long m2p_start_mfn;
    4.11  #define phys_to_machine_mapping ((unsigned long *)PERDOMAIN_VIRT_START)
    4.12  #endif
    4.13