ia64/xen-unstable

changeset 12603:b4baf35cff11

[XEN] Remove valid_mfn().
Since cset 12568 removed VALID_MFN(), valid_mfn() is just confusing.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Nov 28 09:51:05 2006 +0000 (2006-11-28)
parents 658b9c47db98
children 6206685650f5
files xen/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/multi.c xen/arch/x86/mm/shadow/private.h xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Tue Nov 28 09:39:32 2006 +0000
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Tue Nov 28 09:51:05 2006 +0000
     1.3 @@ -194,7 +194,7 @@ void shadow_promote(struct vcpu *v, mfn_
     1.4  {
     1.5      struct page_info *page = mfn_to_page(gmfn);
     1.6  
     1.7 -    ASSERT(valid_mfn(gmfn));
     1.8 +    ASSERT(mfn_valid(gmfn));
     1.9  
    1.10      /* We should never try to promote a gmfn that has writeable mappings */
    1.11      ASSERT(shadow_remove_write_access(v, gmfn, 0, 0) == 0);
    1.12 @@ -967,13 +967,13 @@ shadow_set_p2m_entry(struct domain *d, u
    1.13      p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn,
    1.14                                 0, L1_PAGETABLE_ENTRIES);
    1.15      ASSERT(p2m_entry);
    1.16 -    if ( valid_mfn(mfn) )
    1.17 +    if ( mfn_valid(mfn) )
    1.18          *p2m_entry = l1e_from_pfn(mfn_x(mfn), __PAGE_HYPERVISOR|_PAGE_USER);
    1.19      else
    1.20          *p2m_entry = l1e_empty();
    1.21  
    1.22      /* Track the highest gfn for which we have ever had a valid mapping */
    1.23 -    if ( valid_mfn(mfn) && (gfn > d->arch.max_mapped_pfn) ) 
    1.24 +    if ( mfn_valid(mfn) && (gfn > d->arch.max_mapped_pfn) ) 
    1.25          d->arch.max_mapped_pfn = gfn;
    1.26  
    1.27      /* The P2M can be shadowed: keep the shadows synced */
    1.28 @@ -1930,7 +1930,7 @@ static int sh_remove_shadow_via_pointer(
    1.29      
    1.30      if (sp->up == 0) return 0;
    1.31      pmfn = _mfn(sp->up >> PAGE_SHIFT);
    1.32 -    ASSERT(valid_mfn(pmfn));
    1.33 +    ASSERT(mfn_valid(pmfn));
    1.34      vaddr = sh_map_domain_page(pmfn);
    1.35      ASSERT(vaddr);
    1.36      vaddr += sp->up & (PAGE_SIZE-1);
    1.37 @@ -2424,7 +2424,7 @@ void shadow_teardown(struct domain *d)
    1.38              if ( shadow_mode_external(d) )
    1.39              {
    1.40                  mfn = pagetable_get_mfn(v->arch.monitor_table);
    1.41 -                if ( valid_mfn(mfn) && (mfn_x(mfn) != 0) )
    1.42 +                if ( mfn_valid(mfn) && (mfn_x(mfn) != 0) )
    1.43                      shadow_destroy_monitor_table(v, mfn);
    1.44                  v->arch.monitor_table = pagetable_null();
    1.45              }
    1.46 @@ -2755,7 +2755,7 @@ shadow_guest_physmap_add_page(struct dom
    1.47      SHADOW_DEBUG(P2M, "adding gfn=%#lx mfn=%#lx\n", gfn, mfn);
    1.48  
    1.49      omfn = sh_gfn_to_mfn(d, gfn);
    1.50 -    if ( valid_mfn(omfn) )
    1.51 +    if ( mfn_valid(omfn) )
    1.52      {
    1.53          /* Get rid of the old mapping, especially any shadows */
    1.54          struct vcpu *v = current;
    1.55 @@ -2783,7 +2783,7 @@ shadow_guest_physmap_add_page(struct dom
    1.56          /* This machine frame is already mapped at another physical address */
    1.57          SHADOW_DEBUG(P2M, "aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
    1.58                         mfn, ogfn, gfn);
    1.59 -        if ( valid_mfn(omfn = sh_gfn_to_mfn(d, ogfn)) ) 
    1.60 +        if ( mfn_valid(omfn = sh_gfn_to_mfn(d, ogfn)) ) 
    1.61          {
    1.62              SHADOW_DEBUG(P2M, "old gfn=%#lx -> mfn %#lx\n", 
    1.63                             ogfn , mfn_x(omfn));
    1.64 @@ -2888,7 +2888,7 @@ void sh_do_mark_dirty(struct domain *d, 
    1.65      ASSERT(shadow_lock_is_acquired(d));
    1.66      ASSERT(shadow_mode_log_dirty(d));
    1.67  
    1.68 -    if ( !valid_mfn(gmfn) )
    1.69 +    if ( !mfn_valid(gmfn) )
    1.70          return;
    1.71  
    1.72      ASSERT(d->arch.shadow.dirty_bitmap != NULL);
    1.73 @@ -3209,7 +3209,7 @@ void shadow_audit_p2m(struct domain *d)
    1.74                          if ( !(l1e_get_flags(l1e[i1]) & _PAGE_PRESENT) )
    1.75                              continue;
    1.76                          mfn = l1e_get_pfn(l1e[i1]);
    1.77 -                        ASSERT(valid_mfn(_mfn(mfn)));
    1.78 +                        ASSERT(mfn_valid(_mfn(mfn)));
    1.79                          m2pfn = get_gpfn_from_mfn(mfn);
    1.80                          if ( m2pfn != gfn )
    1.81                          {
     2.1 --- a/xen/arch/x86/mm/shadow/multi.c	Tue Nov 28 09:39:32 2006 +0000
     2.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Tue Nov 28 09:51:05 2006 +0000
     2.3 @@ -102,7 +102,7 @@ get_fl1_shadow_status(struct vcpu *v, gf
     2.4  {
     2.5      mfn_t smfn = shadow_hash_lookup(v, gfn_x(gfn), SH_type_fl1_shadow);
     2.6  
     2.7 -    if ( unlikely(shadow_mode_log_dirty(v->domain) && valid_mfn(smfn)) )
     2.8 +    if ( unlikely(shadow_mode_log_dirty(v->domain) && mfn_valid(smfn)) )
     2.9      {
    2.10          struct shadow_page_info *sp = mfn_to_shadow_page(smfn);
    2.11          if ( !(sp->logdirty) )
    2.12 @@ -119,7 +119,7 @@ get_shadow_status(struct vcpu *v, mfn_t 
    2.13      mfn_t smfn = shadow_hash_lookup(v, mfn_x(gmfn), shadow_type);
    2.14      perfc_incrc(shadow_get_shadow_status);
    2.15  
    2.16 -    if ( unlikely(shadow_mode_log_dirty(v->domain) && valid_mfn(smfn)) )
    2.17 +    if ( unlikely(shadow_mode_log_dirty(v->domain) && mfn_valid(smfn)) )
    2.18      {
    2.19          struct shadow_page_info *sp = mfn_to_shadow_page(smfn);
    2.20          if ( !(sp->logdirty) )
    2.21 @@ -241,7 +241,7 @@ guest_walk_tables(struct vcpu *v, unsign
    2.22      /* Walk down to the l3e */
    2.23      if ( !(guest_l4e_get_flags(*gw->l4e) & _PAGE_PRESENT) ) return 0;
    2.24      gw->l3mfn = vcpu_gfn_to_mfn(v, guest_l4e_get_gfn(*gw->l4e));
    2.25 -    if ( !valid_mfn(gw->l3mfn) ) return 1;
    2.26 +    if ( !mfn_valid(gw->l3mfn) ) return 1;
    2.27      /* This mfn is a pagetable: make sure the guest can't write to it. */
    2.28      if ( guest_op && shadow_remove_write_access(v, gw->l3mfn, 3, va) != 0 )
    2.29          flush_tlb_mask(v->domain->domain_dirty_cpumask); 
    2.30 @@ -255,7 +255,7 @@ guest_walk_tables(struct vcpu *v, unsign
    2.31      /* Walk down to the l2e */
    2.32      if ( !(guest_l3e_get_flags(*gw->l3e) & _PAGE_PRESENT) ) return 0;
    2.33      gw->l2mfn = vcpu_gfn_to_mfn(v, guest_l3e_get_gfn(*gw->l3e));
    2.34 -    if ( !valid_mfn(gw->l2mfn) ) return 1;
    2.35 +    if ( !mfn_valid(gw->l2mfn) ) return 1;
    2.36      /* This mfn is a pagetable: make sure the guest can't write to it. */
    2.37      if ( guest_op && shadow_remove_write_access(v, gw->l2mfn, 2, va) != 0 )
    2.38          flush_tlb_mask(v->domain->domain_dirty_cpumask); 
    2.39 @@ -296,7 +296,7 @@ guest_walk_tables(struct vcpu *v, unsign
    2.40      {
    2.41          /* Not a superpage: carry on and find the l1e. */
    2.42          gw->l1mfn = vcpu_gfn_to_mfn(v, guest_l2e_get_gfn(*gw->l2e));
    2.43 -        if ( !valid_mfn(gw->l1mfn) ) return 1;
    2.44 +        if ( !mfn_valid(gw->l1mfn) ) return 1;
    2.45          /* This mfn is a pagetable: make sure the guest can't write to it. */
    2.46          if ( guest_op 
    2.47               && shadow_remove_write_access(v, gw->l1mfn, 1, va) != 0 )
    2.48 @@ -386,33 +386,33 @@ static void sh_audit_gw(struct vcpu *v, 
    2.49          return;
    2.50  
    2.51  #if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */
    2.52 -    if ( valid_mfn(gw->l4mfn)
    2.53 -         && valid_mfn((smfn = get_shadow_status(v, gw->l4mfn, 
    2.54 +    if ( mfn_valid(gw->l4mfn)
    2.55 +         && mfn_valid((smfn = get_shadow_status(v, gw->l4mfn, 
    2.56                                                  SH_type_l4_shadow))) )
    2.57          (void) sh_audit_l4_table(v, smfn, _mfn(INVALID_MFN));
    2.58 -    if ( valid_mfn(gw->l3mfn)
    2.59 -         && valid_mfn((smfn = get_shadow_status(v, gw->l3mfn, 
    2.60 +    if ( mfn_valid(gw->l3mfn)
    2.61 +         && mfn_valid((smfn = get_shadow_status(v, gw->l3mfn, 
    2.62                                                  SH_type_l3_shadow))) )
    2.63          (void) sh_audit_l3_table(v, smfn, _mfn(INVALID_MFN));
    2.64  #endif /* PAE or 64... */
    2.65 -    if ( valid_mfn(gw->l2mfn) )
    2.66 +    if ( mfn_valid(gw->l2mfn) )
    2.67      {
    2.68 -        if ( valid_mfn((smfn = get_shadow_status(v, gw->l2mfn, 
    2.69 +        if ( mfn_valid((smfn = get_shadow_status(v, gw->l2mfn, 
    2.70                                                   SH_type_l2_shadow))) )
    2.71              (void) sh_audit_l2_table(v, smfn, _mfn(INVALID_MFN));
    2.72  #if GUEST_PAGING_LEVELS == 3
    2.73 -        if ( valid_mfn((smfn = get_shadow_status(v, gw->l2mfn, 
    2.74 +        if ( mfn_valid((smfn = get_shadow_status(v, gw->l2mfn, 
    2.75                                                   SH_type_l2h_shadow))) )
    2.76              (void) sh_audit_l2_table(v, smfn, _mfn(INVALID_MFN));
    2.77  #endif
    2.78      }
    2.79 -    if ( valid_mfn(gw->l1mfn)
    2.80 -         && valid_mfn((smfn = get_shadow_status(v, gw->l1mfn, 
    2.81 +    if ( mfn_valid(gw->l1mfn)
    2.82 +         && mfn_valid((smfn = get_shadow_status(v, gw->l1mfn, 
    2.83                                                  SH_type_l1_shadow))) )
    2.84          (void) sh_audit_l1_table(v, smfn, _mfn(INVALID_MFN));
    2.85      else if ( gw->l2e
    2.86                && (guest_l2e_get_flags(*gw->l2e) & _PAGE_PSE)
    2.87 -              && valid_mfn( 
    2.88 +              && mfn_valid( 
    2.89                (smfn = get_fl1_shadow_status(v, guest_l2e_get_gfn(*gw->l2e)))) )
    2.90          (void) sh_audit_fl1_table(v, smfn, _mfn(INVALID_MFN));
    2.91  }
    2.92 @@ -450,7 +450,7 @@ static u32 guest_set_ad_bits(struct vcpu
    2.93      if ( !(ft & FETCH_TYPE_DEMAND) )
    2.94          return flags;
    2.95  
    2.96 -    ASSERT(valid_mfn(gmfn)
    2.97 +    ASSERT(mfn_valid(gmfn)
    2.98             && (sh_mfn_is_a_page_table(gmfn)
    2.99                 || ((mfn_to_page(gmfn)->u.inuse.type_info & PGT_count_mask) 
   2.100                     == 0)));
   2.101 @@ -654,7 +654,7 @@ static always_inline void
   2.102      /* We don't shadow PAE l3s */
   2.103      ASSERT(GUEST_PAGING_LEVELS > 3 || level != 3);
   2.104  
   2.105 -    if ( valid_mfn(guest_table_mfn) )
   2.106 +    if ( mfn_valid(guest_table_mfn) )
   2.107          /* Handle A and D bit propagation into the guest */
   2.108          gflags = guest_set_ad_bits(v, guest_table_mfn, gp, level, ft);
   2.109      else 
   2.110 @@ -686,7 +686,7 @@ static always_inline void
   2.111      // case of a prefetch, an invalid mfn means that we can not usefully
   2.112      // shadow anything, and so we return early.
   2.113      //
   2.114 -    if ( !valid_mfn(target_mfn) )
   2.115 +    if ( !mfn_valid(target_mfn) )
   2.116      {
   2.117          ASSERT((ft == ft_prefetch));
   2.118          *sp = shadow_l1e_empty();
   2.119 @@ -929,7 +929,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl
   2.120      if ( unlikely(!res) &&
   2.121           IS_PRIV(d) &&
   2.122           !shadow_mode_translate(d) &&
   2.123 -         valid_mfn(mfn = shadow_l1e_get_mfn(sl1e)) &&
   2.124 +         mfn_valid(mfn = shadow_l1e_get_mfn(sl1e)) &&
   2.125           (owner = page_get_owner(mfn_to_page(mfn))) &&
   2.126           (d != owner) )
   2.127      {
   2.128 @@ -1745,14 +1745,14 @@ static shadow_l3e_t * shadow_get_and_cre
   2.129  {
   2.130      mfn_t sl4mfn;
   2.131      shadow_l4e_t *sl4e;
   2.132 -    if ( !valid_mfn(gw->l3mfn) ) return NULL; /* No guest page. */
   2.133 +    if ( !mfn_valid(gw->l3mfn) ) return NULL; /* No guest page. */
   2.134      /* Get the l4e */
   2.135      sl4e = shadow_get_and_create_l4e(v, gw, &sl4mfn);
   2.136      ASSERT(sl4e != NULL);
   2.137      if ( shadow_l4e_get_flags(*sl4e) & _PAGE_PRESENT ) 
   2.138      {
   2.139          *sl3mfn = shadow_l4e_get_mfn(*sl4e);
   2.140 -        ASSERT(valid_mfn(*sl3mfn));
   2.141 +        ASSERT(mfn_valid(*sl3mfn));
   2.142      } 
   2.143      else 
   2.144      {
   2.145 @@ -1760,7 +1760,7 @@ static shadow_l3e_t * shadow_get_and_cre
   2.146          shadow_l4e_t new_sl4e;
   2.147          /* No l3 shadow installed: find and install it. */
   2.148          *sl3mfn = get_shadow_status(v, gw->l3mfn, SH_type_l3_shadow);
   2.149 -        if ( !valid_mfn(*sl3mfn) ) 
   2.150 +        if ( !mfn_valid(*sl3mfn) ) 
   2.151          {
   2.152              /* No l3 shadow of this page exists at all: make one. */
   2.153              *sl3mfn = sh_make_shadow(v, gw->l3mfn, SH_type_l3_shadow);
   2.154 @@ -1787,14 +1787,14 @@ static shadow_l2e_t * shadow_get_and_cre
   2.155  #if GUEST_PAGING_LEVELS >= 4 /* 64bit... */
   2.156      mfn_t sl3mfn = _mfn(INVALID_MFN);
   2.157      shadow_l3e_t *sl3e;
   2.158 -    if ( !valid_mfn(gw->l2mfn) ) return NULL; /* No guest page. */
   2.159 +    if ( !mfn_valid(gw->l2mfn) ) return NULL; /* No guest page. */
   2.160      /* Get the l3e */
   2.161      sl3e = shadow_get_and_create_l3e(v, gw, &sl3mfn, ft);
   2.162      if ( sl3e == NULL ) return NULL; 
   2.163      if ( shadow_l3e_get_flags(*sl3e) & _PAGE_PRESENT ) 
   2.164      {
   2.165          *sl2mfn = shadow_l3e_get_mfn(*sl3e);
   2.166 -        ASSERT(valid_mfn(*sl2mfn));
   2.167 +        ASSERT(mfn_valid(*sl2mfn));
   2.168      } 
   2.169      else 
   2.170      {
   2.171 @@ -1802,7 +1802,7 @@ static shadow_l2e_t * shadow_get_and_cre
   2.172          shadow_l3e_t new_sl3e;
   2.173          /* No l2 shadow installed: find and install it. */
   2.174          *sl2mfn = get_shadow_status(v, gw->l2mfn, SH_type_l2_shadow);
   2.175 -        if ( !valid_mfn(*sl2mfn) ) 
   2.176 +        if ( !mfn_valid(*sl2mfn) ) 
   2.177          {
   2.178              /* No l2 shadow of this page exists at all: make one. */
   2.179              *sl2mfn = sh_make_shadow(v, gw->l2mfn, SH_type_l2_shadow);
   2.180 @@ -1825,7 +1825,7 @@ static shadow_l2e_t * shadow_get_and_cre
   2.181      if ( !(shadow_l3e_get_flags(*sl3e) & _PAGE_PRESENT) ) 
   2.182          return NULL;
   2.183      *sl2mfn = shadow_l3e_get_mfn(*sl3e);
   2.184 -    ASSERT(valid_mfn(*sl2mfn));
   2.185 +    ASSERT(mfn_valid(*sl2mfn));
   2.186      return sh_linear_l2_table(v) + shadow_l2_linear_offset(gw->va);
   2.187  #else /* 32bit... */
   2.188      /* There is always a shadow of the top level table.  Get it. */
   2.189 @@ -1859,7 +1859,7 @@ static shadow_l1e_t * shadow_get_and_cre
   2.190                     || !(guest_l2e_get_flags(*gw->l2e) & _PAGE_PSE)) )
   2.191      {
   2.192          *sl1mfn = shadow_l2e_get_mfn(*sl2e);
   2.193 -        ASSERT(valid_mfn(*sl1mfn));
   2.194 +        ASSERT(mfn_valid(*sl1mfn));
   2.195      } 
   2.196      else 
   2.197      {
   2.198 @@ -1873,7 +1873,7 @@ static shadow_l1e_t * shadow_get_and_cre
   2.199              /* Splintering a superpage */
   2.200              gfn_t l2gfn = guest_l2e_get_gfn(*gw->l2e);
   2.201              *sl1mfn = get_fl1_shadow_status(v, l2gfn);
   2.202 -            if ( !valid_mfn(*sl1mfn) ) 
   2.203 +            if ( !mfn_valid(*sl1mfn) ) 
   2.204              {
   2.205                  /* No fl1 shadow of this superpage exists at all: make one. */
   2.206                  *sl1mfn = make_fl1_shadow(v, l2gfn);
   2.207 @@ -1882,9 +1882,9 @@ static shadow_l1e_t * shadow_get_and_cre
   2.208          else 
   2.209          {
   2.210              /* Shadowing an actual guest l1 table */
   2.211 -            if ( !valid_mfn(gw->l2mfn) ) return NULL; /* No guest page. */
   2.212 +            if ( !mfn_valid(gw->l2mfn) ) return NULL; /* No guest page. */
   2.213              *sl1mfn = get_shadow_status(v, gw->l1mfn, SH_type_l1_shadow);
   2.214 -            if ( !valid_mfn(*sl1mfn) ) 
   2.215 +            if ( !mfn_valid(*sl1mfn) ) 
   2.216              {
   2.217                  /* No l1 shadow of this page exists at all: make one. */
   2.218                  *sl1mfn = sh_make_shadow(v, gw->l1mfn, SH_type_l1_shadow);
   2.219 @@ -2153,7 +2153,7 @@ static int validate_gl4e(struct vcpu *v,
   2.220      {
   2.221          gfn_t gl3gfn = guest_l4e_get_gfn(*new_gl4e);
   2.222          mfn_t gl3mfn = vcpu_gfn_to_mfn(v, gl3gfn);
   2.223 -        if ( valid_mfn(gl3mfn) )
   2.224 +        if ( mfn_valid(gl3mfn) )
   2.225              sl3mfn = get_shadow_status(v, gl3mfn, SH_type_l3_shadow);
   2.226          else
   2.227              result |= SHADOW_SET_ERROR;
   2.228 @@ -2205,7 +2205,7 @@ static int validate_gl3e(struct vcpu *v,
   2.229      {
   2.230          gfn_t gl2gfn = guest_l3e_get_gfn(*new_gl3e);
   2.231          mfn_t gl2mfn = vcpu_gfn_to_mfn(v, gl2gfn);
   2.232 -        if ( valid_mfn(gl2mfn) )
   2.233 +        if ( mfn_valid(gl2mfn) )
   2.234              sl2mfn = get_shadow_status(v, gl2mfn, SH_type_l2_shadow);
   2.235          else
   2.236              result |= SHADOW_SET_ERROR;
   2.237 @@ -2242,14 +2242,14 @@ static int validate_gl2e(struct vcpu *v,
   2.238              // for superpage fl1's here, but this is *not* on the demand path,
   2.239              // so we'll hold off trying that for now...
   2.240              //
   2.241 -            if ( !valid_mfn(sl1mfn) )
   2.242 +            if ( !mfn_valid(sl1mfn) )
   2.243                  sl1mfn = make_fl1_shadow(v, gl1gfn);
   2.244  #endif
   2.245          }
   2.246          else
   2.247          {
   2.248              mfn_t gl1mfn = vcpu_gfn_to_mfn(v, gl1gfn);
   2.249 -            if ( valid_mfn(gl1mfn) )
   2.250 +            if ( mfn_valid(gl1mfn) )
   2.251                  sl1mfn = get_shadow_status(v, gl1mfn, SH_type_l1_shadow);
   2.252              else
   2.253                  result |= SHADOW_SET_ERROR;
   2.254 @@ -2317,7 +2317,7 @@ static int validate_gl1e(struct vcpu *v,
   2.255      gfn = guest_l1e_get_gfn(*new_gl1e);
   2.256      gmfn = vcpu_gfn_to_mfn(v, gfn);
   2.257  
   2.258 -    mmio = (is_hvm_vcpu(v) && shadow_vcpu_mode_translate(v) && !valid_mfn(gmfn));
   2.259 +    mmio = (is_hvm_vcpu(v) && shadow_vcpu_mode_translate(v) && !mfn_valid(gmfn));
   2.260      l1e_propagate_from_guest(v, new_gl1e, _mfn(INVALID_MFN), gmfn, &new_sl1e, 
   2.261                               ft_prefetch, mmio);
   2.262      
   2.263 @@ -2352,7 +2352,7 @@ sh_map_and_validate(struct vcpu *v, mfn_
   2.264  
   2.265      /* Map the shadow page */
   2.266      smfn = get_shadow_status(v, gmfn, sh_type);
   2.267 -    ASSERT(valid_mfn(smfn)); /* Otherwise we would not have been called */
   2.268 +    ASSERT(mfn_valid(smfn)); /* Otherwise we would not have been called */
   2.269      guest_idx = guest_index(new_gp);
   2.270      map_mfn = smfn;
   2.271      shadow_idx = shadow_index(&map_mfn, guest_idx);
   2.272 @@ -2737,7 +2737,7 @@ static int sh_page_fault(struct vcpu *v,
   2.273              && shadow_vcpu_mode_translate(v) 
   2.274              && mmio_space(gfn_to_paddr(gfn)));
   2.275  
   2.276 -    if ( !mmio && !valid_mfn(gmfn) )
   2.277 +    if ( !mmio && !mfn_valid(gmfn) )
   2.278      {
   2.279          perfc_incrc(shadow_fault_bail_bad_gfn);
   2.280          SHADOW_PRINTK("BAD gfn=%"SH_PRI_gfn" gmfn=%"SH_PRI_mfn"\n", 
   2.281 @@ -3302,7 +3302,7 @@ sh_set_toplevel_shadow(struct vcpu *v,
   2.282      old_entry = v->arch.shadow_table[slot];
   2.283  
   2.284      /* Now figure out the new contents: is this a valid guest MFN? */
   2.285 -    if ( !valid_mfn(gmfn) )
   2.286 +    if ( !mfn_valid(gmfn) )
   2.287      {
   2.288          new_entry = pagetable_null();
   2.289          goto install_new_entry;
   2.290 @@ -3310,14 +3310,14 @@ sh_set_toplevel_shadow(struct vcpu *v,
   2.291  
   2.292      /* Guest mfn is valid: shadow it and install the shadow */
   2.293      smfn = get_shadow_status(v, gmfn, root_type);
   2.294 -    if ( !valid_mfn(smfn) )
   2.295 +    if ( !mfn_valid(smfn) )
   2.296      {
   2.297          /* Make sure there's enough free shadow memory. */
   2.298          shadow_prealloc(d, SHADOW_MAX_ORDER); 
   2.299          /* Shadow the page. */
   2.300          smfn = sh_make_shadow(v, gmfn, root_type);
   2.301      }
   2.302 -    ASSERT(valid_mfn(smfn));
   2.303 +    ASSERT(mfn_valid(smfn));
   2.304      
   2.305  #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
   2.306      /* Once again OK to unhook entries from this table if we see fork/exit */
   2.307 @@ -3390,7 +3390,7 @@ sh_update_cr3(struct vcpu *v)
   2.308          {
   2.309              gfn = _gfn(paddr_to_pfn(hvm_get_guest_ctrl_reg(v, 3)));
   2.310              gmfn = vcpu_gfn_to_mfn(v, gfn);
   2.311 -            ASSERT(valid_mfn(gmfn));
   2.312 +            ASSERT(mfn_valid(gmfn));
   2.313              ASSERT(pagetable_get_pfn(v->arch.guest_table) == mfn_x(gmfn));
   2.314          } 
   2.315          else 
   2.316 @@ -3831,7 +3831,7 @@ static inline void * emulate_map_dest(st
   2.317  
   2.318      /* Attempted a write to a bad gfn? This should never happen:
   2.319       * after all, we're here because this write is to a page table. */
   2.320 -    BUG_ON(!valid_mfn(mfn));
   2.321 +    BUG_ON(!mfn_valid(mfn));
   2.322  
   2.323      ASSERT(sh_mfn_is_a_page_table(mfn));
   2.324      *mfnp = mfn;
     3.1 --- a/xen/arch/x86/mm/shadow/private.h	Tue Nov 28 09:39:32 2006 +0000
     3.2 +++ b/xen/arch/x86/mm/shadow/private.h	Tue Nov 28 09:51:05 2006 +0000
     3.3 @@ -374,7 +374,7 @@ sh_mfn_is_a_page_table(mfn_t gmfn)
     3.4      struct domain *owner;
     3.5      unsigned long type_info;
     3.6  
     3.7 -    if ( !valid_mfn(gmfn) )
     3.8 +    if ( !mfn_valid(gmfn) )
     3.9          return 0;
    3.10  
    3.11      owner = page_get_owner(page);
     4.1 --- a/xen/include/asm-x86/shadow.h	Tue Nov 28 09:39:32 2006 +0000
     4.2 +++ b/xen/include/asm-x86/shadow.h	Tue Nov 28 09:51:05 2006 +0000
     4.3 @@ -215,12 +215,6 @@ static inline _type _name##_x(_name##_t 
     4.4  TYPE_SAFE(unsigned long,mfn)
     4.5  #define SH_PRI_mfn "05lx"
     4.6  
     4.7 -static inline int
     4.8 -valid_mfn(mfn_t m)
     4.9 -{
    4.10 -    return mfn_valid(mfn_x(m));
    4.11 -}
    4.12 -
    4.13  static inline mfn_t
    4.14  pagetable_get_mfn(pagetable_t pt)
    4.15  {