ia64/xen-unstable

changeset 10905:3aad3abca993

[SHADOW] Build p2m mapping according to m2p mapping.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
author kfraser@localhost.localdomain
date Wed Aug 02 09:58:06 2006 +0100 (2006-08-02)
parents acccec7e213a
children f5b9b8439012
files xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c
line diff
     1.1 --- a/xen/arch/x86/shadow32.c	Wed Aug 02 09:54:32 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow32.c	Wed Aug 02 09:58:06 2006 +0100
     1.3 @@ -990,18 +990,20 @@ alloc_p2m_table(struct domain *d)
     1.4  
     1.5      list_ent = d->page_list.next;
     1.6  
     1.7 -    for ( gpfn = 0; list_ent != &d->page_list; gpfn++ )
     1.8 +    while ( list_ent != &d->page_list )
     1.9      {
    1.10          page = list_entry(list_ent, struct page_info, list);
    1.11          mfn = page_to_mfn(page);
    1.12  
    1.13 +        gpfn = get_gpfn_from_mfn(mfn);
    1.14 +
    1.15          if ( !(error = map_p2m_entry(l1tab, gpfn, mfn)) )
    1.16          {
    1.17              domain_crash(d);
    1.18              break;
    1.19          }
    1.20  
    1.21 -        list_ent = frame_table[mfn].list.next;
    1.22 +        list_ent = page->list.next;
    1.23      }
    1.24  
    1.25      unmap_domain_page(l1tab);
     2.1 --- a/xen/arch/x86/shadow_public.c	Wed Aug 02 09:54:32 2006 +0100
     2.2 +++ b/xen/arch/x86/shadow_public.c	Wed Aug 02 09:58:06 2006 +0100
     2.3 @@ -1617,20 +1617,22 @@ alloc_p2m_table(struct domain *d)
     2.4  
     2.5      list_ent = d->page_list.next;
     2.6  
     2.7 -    for ( gpfn = 0; list_ent != &d->page_list; gpfn++ )
     2.8 +    while ( list_ent != &d->page_list )
     2.9      {
    2.10          struct page_info *page;
    2.11  
    2.12          page = list_entry(list_ent, struct page_info, list);
    2.13          mfn = page_to_mfn(page);
    2.14  
    2.15 +        gpfn = get_gpfn_from_mfn(mfn);
    2.16 +
    2.17          if ( !(error = map_p2m_entry(top_tab, gpfn, mfn)) )
    2.18          {
    2.19              domain_crash(d);
    2.20              break;
    2.21          }
    2.22  
    2.23 -        list_ent = frame_table[mfn].list.next;
    2.24 +        list_ent = page->list.next;
    2.25      }
    2.26  
    2.27      unmap_domain_page(top_tab);