ia64/xen-unstable

changeset 7596:6be0d21bb863

Merged.
author emellor@leeni.uk.xensource.com
date Mon Oct 31 17:14:59 2005 +0100 (2005-10-31)
parents 286946489e5d cf0c13832905
children f1b6dd997716 3a3b2f8fbb60
files
line diff
     1.1 --- a/docs/check_pkgs	Mon Oct 31 17:10:57 2005 +0100
     1.2 +++ b/docs/check_pkgs	Mon Oct 31 17:14:59 2005 +0100
     1.3 @@ -1,14 +1,14 @@
     1.4  
     1.5  silent_which ()
     1.6  {
     1.7 -        if ! `which $1 1>/dev/null 2>/dev/null`; then
     1.8 +        which $1 1>/dev/null 2>/dev/null || {
     1.9                  echo "*************************************************"
    1.10                  echo "*************************************************"
    1.11                  echo "* WARNING: Package '$1' is required"
    1.12                  echo "*          to build Xen documentation"
    1.13                  echo "*************************************************"
    1.14                  echo "*************************************************"
    1.15 -        fi
    1.16 +        }
    1.17          which $1 1>/dev/null 2>/dev/null
    1.18  }
    1.19  
     2.1 --- a/xen/arch/x86/shadow.c	Mon Oct 31 17:10:57 2005 +0100
     2.2 +++ b/xen/arch/x86/shadow.c	Mon Oct 31 17:14:59 2005 +0100
     2.3 @@ -228,18 +228,20 @@ alloc_shadow_page(struct domain *d,
     2.4                   */
     2.5                  page = alloc_domheap_pages(NULL, SL1_ORDER, 0);
     2.6                  if (!page)
     2.7 -                    domain_crash_synchronous();
     2.8 +                    goto no_shadow_page;
     2.9  
    2.10                  void *l1_0 = map_domain_page(page_to_pfn(page));
    2.11 -                memset(l1_0,0,PAGE_SIZE);
    2.12 +                memset(l1_0, 0, PAGE_SIZE);
    2.13                  unmap_domain_page(l1_0);
    2.14 +
    2.15                  void *l1_1 = map_domain_page(page_to_pfn(page+1));
    2.16 -                memset(l1_1,0,PAGE_SIZE);
    2.17 +                memset(l1_1, 0, PAGE_SIZE);
    2.18                  unmap_domain_page(l1_1);
    2.19  #else
    2.20                  page = alloc_domheap_page(NULL);
    2.21                  if (!page)
    2.22 -                    domain_crash_synchronous();
    2.23 +                    goto no_shadow_page;
    2.24 +
    2.25                  void *l1 = map_domain_page(page_to_pfn(page));
    2.26                  memset(l1, 0, PAGE_SIZE);
    2.27                  unmap_domain_page(l1);
    2.28 @@ -248,6 +250,9 @@ alloc_shadow_page(struct domain *d,
    2.29              else
    2.30              {
    2.31                  page = alloc_domheap_page(NULL);
    2.32 +                if (!page)
    2.33 +                    goto no_shadow_page;
    2.34 +
    2.35                  void *l1 = map_domain_page(page_to_pfn(page));
    2.36                  memset(l1, 0, PAGE_SIZE);
    2.37                  unmap_domain_page(l1);
    2.38 @@ -255,22 +260,26 @@ alloc_shadow_page(struct domain *d,
    2.39          }
    2.40      }
    2.41      else {
    2.42 +#if CONFIG_PAGING_LEVELS == 2
    2.43          page = alloc_domheap_page(NULL);
    2.44 +#elif CONFIG_PAGING_LEVELS == 3
    2.45 +        if ( psh_type == PGT_l3_shadow )
    2.46 +            page = alloc_domheap_pages(NULL, 0, ALLOC_DOM_DMA);
    2.47 +        else
    2.48 +            page = alloc_domheap_page(NULL);
    2.49 +#elif CONFIG_PAGING_LEVELS == 4
    2.50 +        if ( (psh_type == PGT_l4_shadow) &&
    2.51 +             (d->arch.ops->guest_paging_levels != PAGING_L4) )
    2.52 +            page = alloc_domheap_pages(NULL, 0, ALLOC_DOM_DMA);
    2.53 +        else
    2.54 +            page = alloc_domheap_page(NULL);
    2.55 +#endif
    2.56 +        if (!page)
    2.57 +            goto no_shadow_page;
    2.58 +
    2.59          void *lp = map_domain_page(page_to_pfn(page));
    2.60          memset(lp, 0, PAGE_SIZE);
    2.61          unmap_domain_page(lp);
    2.62 -
    2.63 -    }
    2.64 -    if ( unlikely(page == NULL) )
    2.65 -    {
    2.66 -        printk("Couldn't alloc shadow page! dom%d count=%d\n",
    2.67 -               d->domain_id, d->arch.shadow_page_count);
    2.68 -        printk("Shadow table counts: l1=%d l2=%d hl2=%d snapshot=%d\n",
    2.69 -               perfc_value(shadow_l1_pages), 
    2.70 -               perfc_value(shadow_l2_pages),
    2.71 -               perfc_value(hl2_table_pages),
    2.72 -               perfc_value(snapshot_pages));
    2.73 -        BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
    2.74      }
    2.75  
    2.76      smfn = page_to_pfn(page);
    2.77 @@ -359,7 +368,7 @@ alloc_shadow_page(struct domain *d,
    2.78  
    2.79      return smfn;
    2.80  
    2.81 -  fail:
    2.82 +fail:
    2.83      FSH_LOG("promotion of pfn=%lx mfn=%lx failed!  external gnttab refs?",
    2.84              gpfn, gmfn);
    2.85      if (psh_type == PGT_l1_shadow)
    2.86 @@ -377,6 +386,20 @@ alloc_shadow_page(struct domain *d,
    2.87      }
    2.88      else
    2.89          free_domheap_page(page);
    2.90 +
    2.91 +    return 0;
    2.92 +
    2.93 +no_shadow_page:
    2.94 +    ASSERT(page == NULL);
    2.95 +    printk("Couldn't alloc shadow page! dom%d count=%d\n",
    2.96 +           d->domain_id, d->arch.shadow_page_count);
    2.97 +    printk("Shadow table counts: l1=%d l2=%d hl2=%d snapshot=%d\n",
    2.98 +           perfc_value(shadow_l1_pages),
    2.99 +           perfc_value(shadow_l2_pages),
   2.100 +           perfc_value(hl2_table_pages),
   2.101 +           perfc_value(snapshot_pages));
   2.102 +    BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
   2.103 +
   2.104      return 0;
   2.105  }
   2.106