ia64/xen-unstable

changeset 19162:271697e6d9b2

x86: Rename cached current from 'v' to 'curr' in a few places.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 04 14:46:47 2009 +0000 (2009-02-04)
parents 398291c661b3
children 13a0272c8c02
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Feb 04 14:28:13 2009 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Feb 04 14:46:47 2009 +0000
     1.3 @@ -469,7 +469,7 @@ static void invalidate_shadow_ldt(struct
     1.4      int i;
     1.5      unsigned long pfn;
     1.6      struct page_info *page;
     1.7 -    
     1.8 +
     1.9      if ( v->arch.shadow_ldt_mapcnt == 0 )
    1.10          return;
    1.11  
    1.12 @@ -2353,8 +2353,8 @@ void cleanup_page_cacheattr(struct page_
    1.13  
    1.14  int new_guest_cr3(unsigned long mfn)
    1.15  {
    1.16 -    struct vcpu *v = current;
    1.17 -    struct domain *d = v->domain;
    1.18 +    struct vcpu *curr = current;
    1.19 +    struct domain *d = curr->domain;
    1.20      int okay;
    1.21      unsigned long old_base_mfn;
    1.22  
    1.23 @@ -2364,19 +2364,19 @@ int new_guest_cr3(unsigned long mfn)
    1.24          okay = paging_mode_refcounts(d)
    1.25              ? 0 /* Old code was broken, but what should it be? */
    1.26              : mod_l4_entry(
    1.27 -                    __va(pagetable_get_paddr(v->arch.guest_table)),
    1.28 +                    __va(pagetable_get_paddr(curr->arch.guest_table)),
    1.29                      l4e_from_pfn(
    1.30                          mfn,
    1.31                          (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
    1.32 -                    pagetable_get_pfn(v->arch.guest_table), 0, 0) == 0;
    1.33 +                    pagetable_get_pfn(curr->arch.guest_table), 0, 0) == 0;
    1.34          if ( unlikely(!okay) )
    1.35          {
    1.36              MEM_LOG("Error while installing new compat baseptr %lx", mfn);
    1.37              return 0;
    1.38          }
    1.39  
    1.40 -        invalidate_shadow_ldt(v);
    1.41 -        write_ptbase(v);
    1.42 +        invalidate_shadow_ldt(curr);
    1.43 +        write_ptbase(curr);
    1.44  
    1.45          return 1;
    1.46      }
    1.47 @@ -2390,14 +2390,14 @@ int new_guest_cr3(unsigned long mfn)
    1.48          return 0;
    1.49      }
    1.50  
    1.51 -    invalidate_shadow_ldt(v);
    1.52 -
    1.53 -    old_base_mfn = pagetable_get_pfn(v->arch.guest_table);
    1.54 -
    1.55 -    v->arch.guest_table = pagetable_from_pfn(mfn);
    1.56 -    update_cr3(v);
    1.57 -
    1.58 -    write_ptbase(v);
    1.59 +    invalidate_shadow_ldt(curr);
    1.60 +
    1.61 +    old_base_mfn = pagetable_get_pfn(curr->arch.guest_table);
    1.62 +
    1.63 +    curr->arch.guest_table = pagetable_from_pfn(mfn);
    1.64 +    update_cr3(curr);
    1.65 +
    1.66 +    write_ptbase(curr);
    1.67  
    1.68      if ( likely(old_base_mfn != 0) )
    1.69      {
    1.70 @@ -2552,8 +2552,8 @@ int do_mmuext_op(
    1.71      unsigned long mfn = 0, gmfn = 0, type;
    1.72      unsigned int done = 0;
    1.73      struct page_info *page;
    1.74 -    struct vcpu *v = current;
    1.75 -    struct domain *d = v->domain;
    1.76 +    struct vcpu *curr = current;
    1.77 +    struct domain *d = curr->domain;
    1.78  
    1.79      if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
    1.80      {
    1.81 @@ -2716,8 +2716,8 @@ int do_mmuext_op(
    1.82                  }
    1.83              }
    1.84  
    1.85 -            old_mfn = pagetable_get_pfn(v->arch.guest_table_user);
    1.86 -            v->arch.guest_table_user = pagetable_from_pfn(mfn);
    1.87 +            old_mfn = pagetable_get_pfn(curr->arch.guest_table_user);
    1.88 +            curr->arch.guest_table_user = pagetable_from_pfn(mfn);
    1.89  
    1.90              if ( old_mfn != 0 )
    1.91              {
    1.92 @@ -2737,7 +2737,7 @@ int do_mmuext_op(
    1.93      
    1.94          case MMUEXT_INVLPG_LOCAL:
    1.95              if ( !paging_mode_enabled(d) 
    1.96 -                 || paging_invlpg(v, op.arg1.linear_addr) != 0 )
    1.97 +                 || paging_invlpg(curr, op.arg1.linear_addr) != 0 )
    1.98                  flush_tlb_one_local(op.arg1.linear_addr);
    1.99              break;
   1.100  
   1.101 @@ -2796,13 +2796,13 @@ int do_mmuext_op(
   1.102                  okay = 0;
   1.103                  MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
   1.104              }
   1.105 -            else if ( (v->arch.guest_context.ldt_ents != ents) || 
   1.106 -                      (v->arch.guest_context.ldt_base != ptr) )
   1.107 +            else if ( (curr->arch.guest_context.ldt_ents != ents) || 
   1.108 +                      (curr->arch.guest_context.ldt_base != ptr) )
   1.109              {
   1.110 -                invalidate_shadow_ldt(v);
   1.111 -                v->arch.guest_context.ldt_base = ptr;
   1.112 -                v->arch.guest_context.ldt_ents = ents;
   1.113 -                load_LDT(v);
   1.114 +                invalidate_shadow_ldt(curr);
   1.115 +                curr->arch.guest_context.ldt_base = ptr;
   1.116 +                curr->arch.guest_context.ldt_ents = ents;
   1.117 +                load_LDT(curr);
   1.118                  this_cpu(percpu_mm_info).deferred_ops &= ~DOP_RELOAD_LDT;
   1.119                  if ( ents != 0 )
   1.120                      this_cpu(percpu_mm_info).deferred_ops |= DOP_RELOAD_LDT;
   1.121 @@ -2918,8 +2918,7 @@ int do_mmu_update(
   1.122      struct page_info *page;
   1.123      int rc = 0, okay = 1, i = 0;
   1.124      unsigned int cmd, done = 0;
   1.125 -    struct vcpu *v = current;
   1.126 -    struct domain *d = v->domain;
   1.127 +    struct domain *d = current->domain;
   1.128      struct domain_mmap_cache mapcache;
   1.129  
   1.130      if ( unlikely(count & MMU_UPDATE_PREEMPTED) )
   1.131 @@ -3029,7 +3028,8 @@ int do_mmu_update(
   1.132  #endif
   1.133                  case PGT_writable_page:
   1.134                      perfc_incr(writable_mmu_updates);
   1.135 -                    okay = paging_write_guest_entry(v, va, req.val, _mfn(mfn));
   1.136 +                    okay = paging_write_guest_entry(
   1.137 +                        current, va, req.val, _mfn(mfn));
   1.138                      break;
   1.139                  }
   1.140                  page_unlock(page);
   1.141 @@ -3039,7 +3039,8 @@ int do_mmu_update(
   1.142              else if ( get_page_type(page, PGT_writable_page) )
   1.143              {
   1.144                  perfc_incr(writable_mmu_updates);
   1.145 -                okay = paging_write_guest_entry(v, va, req.val, _mfn(mfn));
   1.146 +                okay = paging_write_guest_entry(
   1.147 +                    current, va, req.val, _mfn(mfn));
   1.148                  put_page_type(page);
   1.149              }
   1.150