ia64/xen-unstable

changeset 3648:5c112b235281

bitkeeper revision 1.1159.212.85 (42038b45EjUo-1JiSCHXW0Wav4TZGQ)

x86_64 progress: now entering ring 3. Need a hypercall (SYSCALL)
entry point, and some kind of DOM0 image to test against.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Fri Feb 04 14:48:37 2005 +0000 (2005-02-04)
parents 33d462bea5cd
children 715c644ba9ef
files xen/arch/x86/boot/x86_64.S xen/arch/x86/domain.c xen/arch/x86/x86_32/domain_build.c xen/arch/x86/x86_64/domain_build.c xen/arch/x86/x86_64/mm.c xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h
line diff
     1.1 --- a/xen/arch/x86/boot/x86_64.S	Fri Feb 04 12:58:34 2005 +0000
     1.2 +++ b/xen/arch/x86/boot/x86_64.S	Fri Feb 04 14:48:37 2005 +0000
     1.3 @@ -189,7 +189,7 @@ 1:      jmp     1b
     1.4  ENTRY(gdt_table)
     1.5          .fill FIRST_RESERVED_GDT_ENTRY,8,0
     1.6          .quad 0x0000000000000000     /* unused */
     1.7 -        .quad 0x00cf9a000000ffff     /* 0x0808 ring 0 code, compatability */
     1.8 +        .quad 0x00cf9a000000ffff     /* 0x0808 ring 0 code, compatibility */
     1.9          .quad 0x00af9a000000ffff     /* 0x0810 ring 0 code, 64-bit mode   */
    1.10          .quad 0x00cf92000000ffff     /* 0x0818 ring 0 data                */
    1.11          .quad 0x00cffa000000ffff     /* 0x0823 ring 3 code, compatibility */
     2.1 --- a/xen/arch/x86/domain.c	Fri Feb 04 12:58:34 2005 +0000
     2.2 +++ b/xen/arch/x86/domain.c	Fri Feb 04 14:48:37 2005 +0000
     2.3 @@ -491,13 +491,14 @@ void new_thread(struct exec_domain *d,
     2.4  
     2.5      /*
     2.6       * Initial register values:
     2.7 -     *  DS,ES,FS,GS = FLAT_RING1_DS
     2.8 -     *       CS:EIP = FLAT_RING1_CS:start_pc
     2.9 -     *       SS:ESP = FLAT_RING1_DS:start_stack
    2.10 +     *  DS,ES,FS,GS = FLAT_GUESTOS_DS
    2.11 +     *       CS:EIP = FLAT_GUESTOS_CS:start_pc
    2.12 +     *       SS:ESP = FLAT_GUESTOS_SS:start_stack
    2.13       *          ESI = start_info
    2.14       *  [EAX,EBX,ECX,EDX,EDI,EBP are zero]
    2.15       */
    2.16 -    ec->ds = ec->es = ec->fs = ec->gs = ec->ss = FLAT_GUESTOS_DS;
    2.17 +    ec->ds = ec->es = ec->fs = ec->gs = FLAT_GUESTOS_DS;
    2.18 +    ec->ss = FLAT_GUESTOS_SS;
    2.19      ec->cs = FLAT_GUESTOS_CS;
    2.20      ec->eip = start_pc;
    2.21      ec->esp = start_stack;
     3.1 --- a/xen/arch/x86/x86_32/domain_build.c	Fri Feb 04 12:58:34 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_32/domain_build.c	Fri Feb 04 14:48:37 2005 +0000
     3.3 @@ -218,7 +218,7 @@ int construct_dom0(struct domain *d,
     3.4       */
     3.5      ed->thread.failsafe_selector = FLAT_GUESTOS_CS;
     3.6      ed->thread.event_selector    = FLAT_GUESTOS_CS;
     3.7 -    ed->thread.guestos_ss = FLAT_GUESTOS_DS;
     3.8 +    ed->thread.guestos_ss = FLAT_GUESTOS_SS;
     3.9      for ( i = 0; i < 256; i++ ) 
    3.10          ed->thread.traps[i].cs = FLAT_GUESTOS_CS;
    3.11  
    3.12 @@ -257,7 +257,6 @@ int construct_dom0(struct domain *d,
    3.13      l2tab = l2start + l2_table_offset(vpt_start);
    3.14      l1start = l1tab = (l1_pgentry_t *)l2_pgentry_to_phys(*l2tab);
    3.15      l1tab += l1_table_offset(vpt_start);
    3.16 -    l2tab++;
    3.17      for ( count = 0; count < nr_pt_pages; count++ ) 
    3.18      {
    3.19          *l1tab = mk_l1_pgentry(l1_pgentry_val(*l1tab) & ~_PAGE_RW);
    3.20 @@ -294,9 +293,8 @@ int construct_dom0(struct domain *d,
    3.21               */
    3.22              get_page(page, d); /* an extra ref because of readable mapping */
    3.23          }
    3.24 -        l1tab++;
    3.25 -        if( !((unsigned long)l1tab & (PAGE_SIZE - 1)) )
    3.26 -            l1start = l1tab = (l1_pgentry_t *)l2_pgentry_to_phys(*l2tab);
    3.27 +        if ( !((unsigned long)++l1tab & (PAGE_SIZE - 1)) )
    3.28 +            l1start = l1tab = (l1_pgentry_t *)l2_pgentry_to_phys(*++l2tab);
    3.29      }
    3.30  
    3.31      /* Set up shared-info area. */
     4.1 --- a/xen/arch/x86/x86_64/domain_build.c	Fri Feb 04 12:58:34 2005 +0000
     4.2 +++ b/xen/arch/x86/x86_64/domain_build.c	Fri Feb 04 14:48:37 2005 +0000
     4.3 @@ -42,7 +42,9 @@ int construct_dom0(struct domain *d,
     4.4      unsigned long nr_pages = (alloc_end - alloc_start) >> PAGE_SHIFT;
     4.5      unsigned long nr_pt_pages;
     4.6      unsigned long count;
     4.7 -    l2_pgentry_t *l2tab, *l2start;
     4.8 +    l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     4.9 +    l3_pgentry_t *l3tab = NULL, *l3start = NULL;
    4.10 +    l2_pgentry_t *l2tab = NULL, *l2start = NULL;
    4.11      l1_pgentry_t *l1tab = NULL, *l1start = NULL;
    4.12      struct pfn_info *page = NULL;
    4.13      start_info_t *si;
    4.14 @@ -128,8 +130,16 @@ int construct_dom0(struct domain *d,
    4.15          v_end            = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1);
    4.16          if ( (v_end - vstack_end) < (512UL << 10) )
    4.17              v_end += 1UL << 22; /* Add extra 4MB to get >= 512kB padding. */
    4.18 -        if ( (((v_end - dsi.v_start + ((1UL<<L2_PAGETABLE_SHIFT)-1)) >> 
    4.19 -               L2_PAGETABLE_SHIFT) + 1) <= nr_pt_pages )
    4.20 +#define RD(_p,_s) ((_p) >> (_s))                      /* round up */
    4.21 +#define RU(_p,_s) (((_p) + ((1UL<<(_s))-1)) >> (_s))  /* round down */
    4.22 +        if ( (1 + /* # L4 */
    4.23 +              (RU(v_end, L4_PAGETABLE_SHIFT) - 
    4.24 +               RD(dsi.v_start, L4_PAGETABLE_SHIFT)) + /* # L3 */
    4.25 +              (RU(v_end, L3_PAGETABLE_SHIFT) - 
    4.26 +               RD(dsi.v_start, L3_PAGETABLE_SHIFT)) + /* # L2 */
    4.27 +              (RU(v_end, L2_PAGETABLE_SHIFT) - 
    4.28 +               RD(dsi.v_start, L2_PAGETABLE_SHIFT)))  /* # L1 */
    4.29 +             <= nr_pt_pages )
    4.30              break;
    4.31      }
    4.32  
    4.33 @@ -195,8 +205,8 @@ int construct_dom0(struct domain *d,
    4.34      printk("done.\n");
    4.35  
    4.36      /* Construct a frame-allocation list for the initial domain. */
    4.37 -    for ( mfn = (alloc_start>>PAGE_SHIFT); 
    4.38 -          mfn < (alloc_end>>PAGE_SHIFT); 
    4.39 +    for ( mfn = (alloc_start>>PAGE_SHIFT);
    4.40 +          mfn < (alloc_end>>PAGE_SHIFT);
    4.41            mfn++ )
    4.42      {
    4.43          page = &frame_table[mfn];
    4.44 @@ -218,85 +228,97 @@ int construct_dom0(struct domain *d,
    4.45       */
    4.46      ed->thread.failsafe_selector = FLAT_GUESTOS_CS;
    4.47      ed->thread.event_selector    = FLAT_GUESTOS_CS;
    4.48 -    ed->thread.guestos_ss = FLAT_GUESTOS_DS;
    4.49 +    ed->thread.guestos_ss = FLAT_GUESTOS_SS;
    4.50      for ( i = 0; i < 256; i++ ) 
    4.51          ed->thread.traps[i].cs = FLAT_GUESTOS_CS;
    4.52  
    4.53      /* WARNING: The new domain must have its 'processor' field filled in! */
    4.54 -    l2start = l2tab = (l2_pgentry_t *)mpt_alloc; mpt_alloc += PAGE_SIZE;
    4.55 -    memcpy(l2tab, &idle_pg_table[0], PAGE_SIZE);
    4.56 -    l2tab[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT] =
    4.57 -        mk_l2_pgentry((unsigned long)l2start | __PAGE_HYPERVISOR);
    4.58 -    l2tab[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT] =
    4.59 -        mk_l2_pgentry(__pa(d->mm_perdomain_pt) | __PAGE_HYPERVISOR);
    4.60 -    ed->mm.pagetable = mk_pagetable((unsigned long)l2start);
    4.61 +    phys_to_page(mpt_alloc)->u.inuse.type_info = PGT_l4_page_table;
    4.62 +    l4start = l4tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
    4.63 +    memcpy(l4tab, &idle_pg_table[0], PAGE_SIZE);
    4.64 +    l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
    4.65 +        mk_l4_pgentry(__pa(l4start) | __PAGE_HYPERVISOR);
    4.66 +    l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
    4.67 +        mk_l4_pgentry(__pa(d->mm_perdomain_pt) | __PAGE_HYPERVISOR);
    4.68 +    ed->mm.pagetable = mk_pagetable(__pa(l4start));
    4.69  
    4.70 -    l2tab += l2_table_offset(dsi.v_start);
    4.71 +    l4tab += l4_table_offset(dsi.v_start);
    4.72      mfn = alloc_start >> PAGE_SHIFT;
    4.73      for ( count = 0; count < ((v_end-dsi.v_start)>>PAGE_SHIFT); count++ )
    4.74      {
    4.75          if ( !((unsigned long)l1tab & (PAGE_SIZE-1)) )
    4.76          {
    4.77 -            l1start = l1tab = (l1_pgentry_t *)mpt_alloc; 
    4.78 -            mpt_alloc += PAGE_SIZE;
    4.79 -            *l2tab++ = mk_l2_pgentry((unsigned long)l1start | L2_PROT);
    4.80 +            phys_to_page(mpt_alloc)->u.inuse.type_info = PGT_l1_page_table;
    4.81 +            l1start = l1tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
    4.82              clear_page(l1tab);
    4.83              if ( count == 0 )
    4.84                  l1tab += l1_table_offset(dsi.v_start);
    4.85 +            if ( !((unsigned long)l2tab & (PAGE_SIZE-1)) )
    4.86 +            {
    4.87 +                phys_to_page(mpt_alloc)->u.inuse.type_info = PGT_l2_page_table;
    4.88 +                l2start = l2tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
    4.89 +                clear_page(l2tab);
    4.90 +                if ( count == 0 )
    4.91 +                    l2tab += l2_table_offset(dsi.v_start);
    4.92 +                if ( !((unsigned long)l3tab & (PAGE_SIZE-1)) )
    4.93 +                {
    4.94 +                    phys_to_page(mpt_alloc)->u.inuse.type_info =
    4.95 +                        PGT_l3_page_table;
    4.96 +                    l3start = l3tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
    4.97 +                    clear_page(l3tab);
    4.98 +                    if ( count == 0 )
    4.99 +                        l3tab += l3_table_offset(dsi.v_start);
   4.100 +                    *l4tab++ = mk_l4_pgentry(__pa(l3start) | L4_PROT);
   4.101 +                }
   4.102 +                *l3tab++ = mk_l3_pgentry(__pa(l2start) | L3_PROT);
   4.103 +            }
   4.104 +            *l2tab++ = mk_l2_pgentry(__pa(l1start) | L2_PROT);
   4.105          }
   4.106          *l1tab++ = mk_l1_pgentry((mfn << PAGE_SHIFT) | L1_PROT);
   4.107 -        
   4.108 +
   4.109          page = &frame_table[mfn];
   4.110 -        if ( !get_page_and_type(page, d, PGT_writable_page) )
   4.111 +        if ( (page->u.inuse.type_info == 0) &&
   4.112 +             !get_page_and_type(page, d, PGT_writable_page) )
   4.113              BUG();
   4.114  
   4.115          mfn++;
   4.116      }
   4.117  
   4.118      /* Pages that are part of page tables must be read only. */
   4.119 -    l2tab = l2start + l2_table_offset(vpt_start);
   4.120 -    l1start = l1tab = (l1_pgentry_t *)l2_pgentry_to_phys(*l2tab);
   4.121 +    l4tab = l4start + l4_table_offset(vpt_start);
   4.122 +    l3start = l3tab = l4_pgentry_to_l3(*l4tab);
   4.123 +    l3tab += l3_table_offset(vpt_start);
   4.124 +    l2start = l2tab = l3_pgentry_to_l2(*l3tab);
   4.125 +    l2tab += l2_table_offset(vpt_start);
   4.126 +    l1start = l1tab = l2_pgentry_to_l1(*l2tab);
   4.127      l1tab += l1_table_offset(vpt_start);
   4.128 -    l2tab++;
   4.129      for ( count = 0; count < nr_pt_pages; count++ ) 
   4.130      {
   4.131          *l1tab = mk_l1_pgentry(l1_pgentry_val(*l1tab) & ~_PAGE_RW);
   4.132          page = &frame_table[l1_pgentry_to_pagenr(*l1tab)];
   4.133 -        if ( count == 0 )
   4.134 -        {
   4.135 -            page->u.inuse.type_info &= ~PGT_type_mask;
   4.136 -            page->u.inuse.type_info |= PGT_l2_page_table;
   4.137 +
   4.138 +        /* Read-only mapping + PGC_allocated + page-table page. */
   4.139 +        page->count_info         = PGC_allocated | 3;
   4.140 +        page->u.inuse.type_info |= PGT_validated | 1;
   4.141  
   4.142 -            /*
   4.143 -             * No longer writable: decrement the type_count.
   4.144 -             * Installed as CR3: increment both the ref_count and type_count.
   4.145 -             * Net: just increment the ref_count.
   4.146 -             */
   4.147 -            get_page(page, d); /* an extra ref because of readable mapping */
   4.148 -
   4.149 -            /* Get another ref to L2 page so that it can be pinned. */
   4.150 -            if ( !get_page_and_type(page, d, PGT_l2_page_table) )
   4.151 -                BUG();
   4.152 -            set_bit(_PGT_pinned, &page->u.inuse.type_info);
   4.153 +        /* Top-level p.t. is pinned. */
   4.154 +        if ( (page->u.inuse.type_info & PGT_type_mask) == PGT_l4_page_table )
   4.155 +        {
   4.156 +            page->count_info        += 1;
   4.157 +            page->u.inuse.type_info += 1 | PGT_pinned;
   4.158          }
   4.159 -        else
   4.160 +
   4.161 +        /* Iterate. */
   4.162 +        if ( !((unsigned long)++l1tab & (PAGE_SIZE - 1)) )
   4.163          {
   4.164 -            page->u.inuse.type_info &= ~PGT_type_mask;
   4.165 -            page->u.inuse.type_info |= PGT_l1_page_table;
   4.166 -	    page->u.inuse.type_info |= 
   4.167 -		((dsi.v_start>>L2_PAGETABLE_SHIFT)+(count-1))<<PGT_va_shift;
   4.168 -
   4.169 -            /*
   4.170 -             * No longer writable: decrement the type_count.
   4.171 -             * This is an L1 page, installed in a validated L2 page:
   4.172 -             * increment both the ref_count and type_count.
   4.173 -             * Net: just increment the ref_count.
   4.174 -             */
   4.175 -            get_page(page, d); /* an extra ref because of readable mapping */
   4.176 +            if ( !((unsigned long)++l2tab & (PAGE_SIZE - 1)) )
   4.177 +            {
   4.178 +                if ( !((unsigned long)++l3tab & (PAGE_SIZE - 1)) )
   4.179 +                    l3start = l3tab = l4_pgentry_to_l3(*++l4tab); 
   4.180 +                l2start = l2tab = l3_pgentry_to_l2(*l3tab);
   4.181 +            }
   4.182 +            l1start = l1tab = l2_pgentry_to_l1(*l2tab);
   4.183          }
   4.184 -        l1tab++;
   4.185 -        if( !((unsigned long)l1tab & (PAGE_SIZE - 1)) )
   4.186 -            l1start = l1tab = (l1_pgentry_t *)l2_pgentry_to_phys(*l2tab);
   4.187      }
   4.188  
   4.189      /* Set up shared-info area. */
   4.190 @@ -365,12 +387,6 @@ int construct_dom0(struct domain *d,
   4.191      write_ptbase(&current->mm);
   4.192      __sti();
   4.193  
   4.194 -    /* Destroy low mappings - they were only for our convenience. */
   4.195 -    for ( i = 0; i < DOMAIN_ENTRIES_PER_L2_PAGETABLE; i++ )
   4.196 -        if ( l2_pgentry_val(l2start[i]) & _PAGE_PSE )
   4.197 -            l2start[i] = mk_l2_pgentry(0);
   4.198 -    zap_low_mappings(); /* Do the same for the idle page tables. */
   4.199 -    
   4.200      /* DOM0 gets access to everything. */
   4.201      physdev_init_dom0(d);
   4.202  
   4.203 @@ -378,12 +394,6 @@ int construct_dom0(struct domain *d,
   4.204  
   4.205      new_thread(ed, dsi.v_kernentry, vstack_end, vstartinfo_start);
   4.206  
   4.207 -#if 0 /* XXXXX DO NOT CHECK IN ENABLED !!! (but useful for testing so leave) */
   4.208 -    shadow_lock(&d->mm);
   4.209 -    shadow_mode_enable(p, SHM_test); 
   4.210 -    shadow_unlock(&d->mm);
   4.211 -#endif
   4.212 -
   4.213      return 0;
   4.214  }
   4.215  
     5.1 --- a/xen/arch/x86/x86_64/mm.c	Fri Feb 04 12:58:34 2005 +0000
     5.2 +++ b/xen/arch/x86/x86_64/mm.c	Fri Feb 04 14:48:37 2005 +0000
     5.3 @@ -118,8 +118,8 @@ void __init paging_init(void)
     5.4      unsigned long i, p, max;
     5.5  
     5.6      /* Map all of physical memory. */
     5.7 -    max = (max_page + (1UL << L2_PAGETABLE_SHIFT) - 1UL) &
     5.8 -        ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
     5.9 +    max = ((max_page + ENTRIES_PER_L1_PAGETABLE - 1) & 
    5.10 +           ~(ENTRIES_PER_L1_PAGETABLE - 1)) << PAGE_SHIFT;
    5.11      map_pages(idle_pg_table, PAGE_OFFSET, 0, max, PAGE_HYPERVISOR);
    5.12  
    5.13      /*
     6.1 --- a/xen/include/public/arch-x86_32.h	Fri Feb 04 12:58:34 2005 +0000
     6.2 +++ b/xen/include/public/arch-x86_32.h	Fri Feb 04 14:48:37 2005 +0000
     6.3 @@ -49,13 +49,17 @@
     6.4   */
     6.5  #define FLAT_RING1_CS 0x0819    /* GDT index 259 */
     6.6  #define FLAT_RING1_DS 0x0821    /* GDT index 260 */
     6.7 +#define FLAT_RING1_SS 0x0821    /* GDT index 260 */
     6.8  #define FLAT_RING3_CS 0x082b    /* GDT index 261 */
     6.9  #define FLAT_RING3_DS 0x0833    /* GDT index 262 */
    6.10 +#define FLAT_RING3_SS 0x0833    /* GDT index 262 */
    6.11  
    6.12  #define FLAT_GUESTOS_CS FLAT_RING1_CS
    6.13  #define FLAT_GUESTOS_DS FLAT_RING1_DS
    6.14 +#define FLAT_GUESTOS_SS FLAT_RING1_SS
    6.15  #define FLAT_USER_CS    FLAT_RING3_CS
    6.16  #define FLAT_USER_DS    FLAT_RING3_DS
    6.17 +#define FLAT_USER_SS    FLAT_RING3_SS
    6.18  
    6.19  /* And the trap vector is... */
    6.20  #define TRAP_INSTR "int $0x82"
     7.1 --- a/xen/include/public/arch-x86_64.h	Fri Feb 04 12:58:34 2005 +0000
     7.2 +++ b/xen/include/public/arch-x86_64.h	Fri Feb 04 14:48:37 2005 +0000
     7.3 @@ -45,7 +45,9 @@
     7.4  #define FLAT_RING3_CS32 0x0823  /* GDT index 260 */
     7.5  #define FLAT_RING3_CS64 0x082b  /* GDT index 261 */
     7.6  #define FLAT_RING3_DS32 0x0833  /* GDT index 262 */
     7.7 -#define FLAT_RING3_DS64 0x0000
     7.8 +#define FLAT_RING3_DS64 0x0000  /* NULL selector */
     7.9 +#define FLAT_RING3_SS32 0x0833  /* GDT index 262 */
    7.10 +#define FLAT_RING3_SS64 0x0833  /* GDT index 262 */
    7.11  
    7.12  #define FLAT_GUESTOS_DS64 FLAT_RING3_DS64
    7.13  #define FLAT_GUESTOS_DS32 FLAT_RING3_DS32
    7.14 @@ -53,6 +55,9 @@
    7.15  #define FLAT_GUESTOS_CS64 FLAT_RING3_CS64
    7.16  #define FLAT_GUESTOS_CS32 FLAT_RING3_CS32
    7.17  #define FLAT_GUESTOS_CS   FLAT_GUESTOS_CS64
    7.18 +#define FLAT_GUESTOS_SS64 FLAT_RING3_SS64
    7.19 +#define FLAT_GUESTOS_SS32 FLAT_RING3_SS32
    7.20 +#define FLAT_GUESTOS_SS   FLAT_GUESTOS_SS64
    7.21  
    7.22  #define FLAT_USER_DS64 FLAT_RING3_DS64
    7.23  #define FLAT_USER_DS32 FLAT_RING3_DS32
    7.24 @@ -60,13 +65,21 @@
    7.25  #define FLAT_USER_CS64 FLAT_RING3_CS64
    7.26  #define FLAT_USER_CS32 FLAT_RING3_CS32
    7.27  #define FLAT_USER_CS   FLAT_USER_CS64
    7.28 +#define FLAT_USER_SS64 FLAT_RING3_SS64
    7.29 +#define FLAT_USER_SS32 FLAT_RING3_SS32
    7.30 +#define FLAT_USER_SS   FLAT_USER_SS64
    7.31  
    7.32  /* And the trap vector is... */
    7.33  #define TRAP_INSTR "syscall"
    7.34  
    7.35 +#ifndef HYPERVISOR_VIRT_START
    7.36 +#define HYPERVISOR_VIRT_START (0xFFFF800000000000UL)
    7.37 +#define HYPERVISOR_VIRT_END   (0xFFFF880000000000UL)
    7.38 +#endif
    7.39 +
    7.40  /* The machine->physical mapping table starts at this address, read-only. */
    7.41  #ifndef machine_to_phys_mapping
    7.42 -#define machine_to_phys_mapping ((unsigned long *)0xffff810000000000ULL)
    7.43 +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    7.44  #endif
    7.45  
    7.46  #ifndef __ASSEMBLY__