debuggers.hg

changeset 3342:fc8767574ee6

bitkeeper revision 1.1159.187.70 (41c82f87JcLj4kF6tbEDtsuLasUe0w)

Only GLOBAL-map real Xen heap mappings. Not start-of-day low mappings.
author kaf24@scramble.cl.cam.ac.uk
date Tue Dec 21 14:13:27 2004 +0000 (2004-12-21)
parents d23fd69d83de
children 85cbf3821127
files xen/arch/x86/boot/x86_32.S xen/arch/x86/x86_32/mm.c
line diff
     1.1 --- a/xen/arch/x86/boot/x86_32.S	Mon Dec 20 17:35:31 2004 +0000
     1.2 +++ b/xen/arch/x86/boot/x86_32.S	Tue Dec 21 14:13:27 2004 +0000
     1.3 @@ -102,15 +102,15 @@ 1:      lss     stack_start-__PAGE_OFFSE
     1.4  
     1.5          /* Initialize low and high mappings of all memory with 4MB pages */
     1.6          mov     $idle_pg_table-__PAGE_OFFSET,%edi
     1.7 -        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+4MB+GLOBAL */
     1.8 +        mov     $0xe3,%eax                  /* PRESENT+RW+A+D+4MB */
     1.9  1:      mov     %eax,__PAGE_OFFSET>>20(%edi) /* high mapping */
    1.10          stosl                                /* low mapping */
    1.11          add     $(1<<L2_PAGETABLE_SHIFT),%eax
    1.12 -        cmp     $DIRECTMAP_PHYS_END+0x1e3,%eax
    1.13 +        cmp     $DIRECTMAP_PHYS_END+0xe3,%eax
    1.14          jne     1b
    1.15  1:      stosl   /* low mappings cover as much physmem as possible */
    1.16          add     $(1<<L2_PAGETABLE_SHIFT),%eax
    1.17 -        cmp     $__HYPERVISOR_VIRT_START+0x1e3,%eax
    1.18 +        cmp     $__HYPERVISOR_VIRT_START+0xe3,%eax
    1.19          jne     1b
    1.20          
    1.21          /* Initialise IDT with simple error defaults. */
     2.1 --- a/xen/arch/x86/x86_32/mm.c	Mon Dec 20 17:35:31 2004 +0000
     2.2 +++ b/xen/arch/x86/x86_32/mm.c	Tue Dec 21 14:13:27 2004 +0000
     2.3 @@ -59,11 +59,13 @@ void __init paging_init(void)
     2.4      void *ioremap_pt;
     2.5      int i;
     2.6  
     2.7 -    /* Idle page table 1:1 maps the first part of physical memory. */
     2.8 -    for ( i = 0; i < DOMAIN_ENTRIES_PER_L2_PAGETABLE; i++ )
     2.9 -        idle_pg_table[i] = 
    2.10 -            mk_l2_pgentry((i << L2_PAGETABLE_SHIFT) | 
    2.11 -                          __PAGE_HYPERVISOR | _PAGE_PSE);
    2.12 +    /* Xen heap mappings can be GLOBAL. */
    2.13 +    if ( cpu_has_pge )
    2.14 +    {
    2.15 +        for ( i = 0; i < DIRECTMAP_PHYS_END; i++ )
    2.16 +            ((unsigned long *)idle_pg_table)
    2.17 +                [(i + PAGE_OFFSET) >> L2_PAGETABLE_SHIFT] |= _PAGE_GLOBAL;
    2.18 +    }
    2.19  
    2.20      /* Create page table for ioremap(). */
    2.21      ioremap_pt = (void *)alloc_xenheap_page();
    2.22 @@ -86,7 +88,6 @@ void __init paging_init(void)
    2.23      /* Set up linear page table mapping. */
    2.24      idle_pg_table[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT] =
    2.25          mk_l2_pgentry(__pa(idle_pg_table) | __PAGE_HYPERVISOR);
    2.26 -
    2.27  }
    2.28  
    2.29  void __init zap_low_mappings(void)