ia64/xen-unstable

changeset 8553:a248738166b1

Fix 32-bit shadow mode to handle extended perdomain mapping
area now that mapcache is per domain.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jan 11 11:34:05 2006 +0100 (2006-01-11)
parents 5ae96e117af2
children f226284e5c1a
files xen/arch/x86/shadow.c xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Wed Jan 11 11:09:17 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow.c	Wed Jan 11 11:34:05 2006 +0100
     1.3 @@ -469,6 +469,7 @@ static unsigned long shadow_l2_table(
     1.4  {
     1.5      unsigned long smfn;
     1.6      l2_pgentry_t *spl2e;
     1.7 +    int i;
     1.8  
     1.9      SH_VVLOG("shadow_l2_table(gpfn=%lx, gmfn=%lx)", gpfn, gmfn);
    1.10  
    1.11 @@ -503,9 +504,11 @@ static unsigned long shadow_l2_table(
    1.12          spl2e[l2_table_offset(SH_LINEAR_PT_VIRT_START)] =
    1.13              l2e_from_pfn(smfn, __PAGE_HYPERVISOR);
    1.14  
    1.15 -        spl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
    1.16 -            l2e_from_paddr(__pa(page_get_owner(pfn_to_page(gmfn))->arch.mm_perdomain_pt),
    1.17 -                            __PAGE_HYPERVISOR);
    1.18 +        for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    1.19 +            spl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
    1.20 +                l2e_from_page(virt_to_page(page_get_owner(pfn_to_page(gmfn))->
    1.21 +                                           arch.mm_perdomain_pt) + i,
    1.22 +                              __PAGE_HYPERVISOR);
    1.23  
    1.24          if ( shadow_mode_translate(d) ) // NB: not external
    1.25          {
     2.1 --- a/xen/arch/x86/shadow32.c	Wed Jan 11 11:09:17 2006 +0100
     2.2 +++ b/xen/arch/x86/shadow32.c	Wed Jan 11 11:34:05 2006 +0100
     2.3 @@ -726,6 +726,7 @@ static void alloc_monitor_pagetable(stru
     2.4      l2_pgentry_t *mpl2e;
     2.5      struct pfn_info *mmfn_info;
     2.6      struct domain *d = v->domain;
     2.7 +    int i;
     2.8  
     2.9      ASSERT(pagetable_get_paddr(v->arch.monitor_table) == 0);
    2.10  
    2.11 @@ -740,9 +741,10 @@ static void alloc_monitor_pagetable(stru
    2.12             &idle_pg_table[DOMAIN_ENTRIES_PER_L2_PAGETABLE],
    2.13             HYPERVISOR_ENTRIES_PER_L2_PAGETABLE * sizeof(l2_pgentry_t));
    2.14  
    2.15 -    mpl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
    2.16 -        l2e_from_paddr(__pa(d->arch.mm_perdomain_pt),
    2.17 -                        __PAGE_HYPERVISOR);
    2.18 +    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    2.19 +        mpl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
    2.20 +            l2e_from_page(virt_to_page(d->arch.mm_perdomain_pt) + i,
    2.21 +                          __PAGE_HYPERVISOR);
    2.22  
    2.23      // map the phys_to_machine map into the Read-Only MPT space for this domain
    2.24      mpl2e[l2_table_offset(RO_MPT_VIRT_START)] =
    2.25 @@ -1508,6 +1510,7 @@ static unsigned long shadow_l2_table(
    2.26  {
    2.27      unsigned long smfn;
    2.28      l2_pgentry_t *spl2e;
    2.29 +    int i;
    2.30  
    2.31      SH_VVLOG("shadow_l2_table(gpfn=%lx, gmfn=%lx)", gpfn, gmfn);
    2.32  
    2.33 @@ -1542,9 +1545,11 @@ static unsigned long shadow_l2_table(
    2.34          spl2e[l2_table_offset(SH_LINEAR_PT_VIRT_START)] =
    2.35              l2e_from_pfn(smfn, __PAGE_HYPERVISOR);
    2.36  
    2.37 -        spl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
    2.38 -            l2e_from_paddr(__pa(page_get_owner(pfn_to_page(gmfn))->arch.mm_perdomain_pt),
    2.39 -                            __PAGE_HYPERVISOR);
    2.40 +        for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    2.41 +            spl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
    2.42 +            l2e_from_page(virt_to_page(page_get_owner(pfn_to_page(gmfn))->
    2.43 +                                       arch.mm_perdomain_pt) + i,
    2.44 +                          __PAGE_HYPERVISOR);
    2.45  
    2.46          if ( shadow_mode_translate(d) ) // NB: not external
    2.47          {
     3.1 --- a/xen/arch/x86/shadow_public.c	Wed Jan 11 11:09:17 2006 +0100
     3.2 +++ b/xen/arch/x86/shadow_public.c	Wed Jan 11 11:34:05 2006 +0100
     3.3 @@ -328,6 +328,7 @@ static void alloc_monitor_pagetable(stru
     3.4      l2_pgentry_t *mpl2e;
     3.5      struct pfn_info *mmfn_info;
     3.6      struct domain *d = v->domain;
     3.7 +    int i;
     3.8  
     3.9      ASSERT(pagetable_get_paddr(v->arch.monitor_table) == 0);
    3.10  
    3.11 @@ -342,9 +343,10 @@ static void alloc_monitor_pagetable(stru
    3.12             &idle_pg_table[DOMAIN_ENTRIES_PER_L2_PAGETABLE],
    3.13             HYPERVISOR_ENTRIES_PER_L2_PAGETABLE * sizeof(l2_pgentry_t));
    3.14  
    3.15 -    mpl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
    3.16 -        l2e_from_paddr(__pa(d->arch.mm_perdomain_pt),
    3.17 -                       __PAGE_HYPERVISOR);
    3.18 +    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    3.19 +        mpl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
    3.20 +            l2e_from_page(virt_to_page(d->arch.mm_perdomain_pt) + i,
    3.21 +                          __PAGE_HYPERVISOR);
    3.22  
    3.23      // map the phys_to_machine map into the Read-Only MPT space for this domain
    3.24      mpl2e[l2_table_offset(RO_MPT_VIRT_START)] =