ia64/xen-unstable

changeset 9256:1f739672ca00

Fix a bug which occurs when Xen is compiled with debug=y. Destroying a
32-bit HVM guest on x86/64 will cause a Xen hang.

Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 14 15:43:10 2006 +0100 (2006-03-14)
parents 1c24ee05f8f3
children 66f02103f4c5
files xen/arch/x86/shadow.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Tue Mar 14 15:40:44 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow.c	Tue Mar 14 15:43:10 2006 +0100
     1.3 @@ -202,6 +202,16 @@ shadow_promote(struct domain *d, unsigne
     1.4   * tlbflush_timestamp holds a min & max index of valid page table entries
     1.5   * within the shadow page.
     1.6   */
     1.7 +static inline void
     1.8 +shadow_page_info_init(struct page_info *page,
     1.9 +                      unsigned long gmfn,
    1.10 +                      u32 psh_type)
    1.11 +{
    1.12 +    ASSERT( (gmfn & ~PGT_mfn_mask) == 0 );
    1.13 +    page->u.inuse.type_info = psh_type | gmfn;
    1.14 +    page->count_info = 0;
    1.15 +    page->tlbflush_timestamp = 0;
    1.16 +}
    1.17  
    1.18  static inline unsigned long
    1.19  alloc_shadow_page(struct domain *d,
    1.20 @@ -249,6 +259,11 @@ alloc_shadow_page(struct domain *d,
    1.21                  l1 = map_domain_page(page_to_mfn(page + 1));
    1.22                  memset(l1, 0, PAGE_SIZE);
    1.23                  unmap_domain_page(l1);
    1.24 +
    1.25 +                /* we'd like to initialize the second continuous page here
    1.26 +                 * and leave the first page initialization later */
    1.27 +
    1.28 +                shadow_page_info_init(page+1, gmfn, psh_type);
    1.29  #else
    1.30                  page = alloc_domheap_page(NULL);
    1.31                  if (!page)
    1.32 @@ -294,10 +309,7 @@ alloc_shadow_page(struct domain *d,
    1.33  
    1.34      smfn = page_to_mfn(page);
    1.35  
    1.36 -    ASSERT( (gmfn & ~PGT_mfn_mask) == 0 );
    1.37 -    page->u.inuse.type_info = psh_type | gmfn;
    1.38 -    page->count_info = 0;
    1.39 -    page->tlbflush_timestamp = 0;
    1.40 +    shadow_page_info_init(page, gmfn, psh_type);
    1.41  
    1.42      switch ( psh_type )
    1.43      {