ia64/xen-unstable

changeset 8050:9c81a3c5b33b

Use page-sized batches in GETPAGEFRAMEINFO2 (and generally tidy up).

Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Fri Nov 25 10:51:09 2005 +0100 (2005-11-25)
parents 26b961b72153
children 28a117c5ea94
files xen/arch/x86/dom0_ops.c
line diff
     1.1 --- a/xen/arch/x86/dom0_ops.c	Fri Nov 25 09:17:34 2005 +0100
     1.2 +++ b/xen/arch/x86/dom0_ops.c	Fri Nov 25 10:51:09 2005 +0100
     1.3 @@ -248,7 +248,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
     1.4  
     1.5      case DOM0_GETPAGEFRAMEINFO2:
     1.6      {
     1.7 -#define GPF2_BATCH 128
     1.8 +#define GPF2_BATCH (PAGE_SIZE / sizeof(unsigned long)) 
     1.9          int n,j;
    1.10          int num = op->u.getpageframeinfo2.num;
    1.11          domid_t dom = op->u.getpageframeinfo2.domain;
    1.12 @@ -285,12 +285,9 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    1.13                  struct pfn_info *page;
    1.14                  unsigned long mfn = l_arr[j];
    1.15  
    1.16 -                if ( unlikely(mfn >= max_page) )
    1.17 -                    goto e2_err;
    1.18 +                page = &frame_table[mfn];
    1.19  
    1.20 -                page = &frame_table[mfn];
    1.21 -  
    1.22 -                if ( likely(get_page(page, d)) )
    1.23 +                if ( likely(pfn_valid(mfn) && get_page(page, d)) ) 
    1.24                  {
    1.25                      unsigned long type = 0;
    1.26  
    1.27 @@ -316,10 +313,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    1.28                      put_page(page);
    1.29                  }
    1.30                  else
    1.31 -                {
    1.32 -                e2_err:
    1.33                      l_arr[j] |= XTAB;
    1.34 -                }
    1.35  
    1.36              }
    1.37  
    1.38 @@ -329,7 +323,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    1.39                  break;
    1.40              }
    1.41  
    1.42 -            n += j;
    1.43 +            n += k;
    1.44          }
    1.45  
    1.46          free_xenheap_page(l_arr);