ia64/xen-unstable

changeset 2606:f57622168029

bitkeeper revision 1.1159.1.210 (4163f26bMMvYVA4SC5kNm8Kg-jDd1g)

Cleanup whitespace/indention.
author cl349@freefall.cl.cam.ac.uk
date Wed Oct 06 13:26:03 2004 +0000 (2004-10-06)
parents 379689bed73a
children e442cedb12d8
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Wed Oct 06 13:03:13 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Wed Oct 06 13:26:03 2004 +0000
     1.3 @@ -853,12 +853,12 @@ void put_page_type(struct pfn_info *page
     1.4                  nx &= ~PGT_validated;
     1.5              }
     1.6          }
     1.7 -	else if ( unlikely((nx & (PGT_pinned | PGT_count_mask)) == 
     1.8 +        else if ( unlikely((nx & (PGT_pinned | PGT_count_mask)) == 
     1.9                             (PGT_pinned | 1)) )
    1.10 -	{
    1.11 +        {
    1.12              /* Page is now only pinned. Make the back pointer mutable again. */
    1.13 -	    nx |= PGT_va_mutable;
    1.14 -	}
    1.15 +            nx |= PGT_va_mutable;
    1.16 +        }
    1.17      }
    1.18      while ( unlikely((y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x) );
    1.19  }
    1.20 @@ -927,7 +927,7 @@ int get_page_type(struct pfn_info *page,
    1.21                  nx |= PGT_va_unknown;
    1.22              }
    1.23          }
    1.24 -	else if ( unlikely(!(x & PGT_validated)) )
    1.25 +        else if ( unlikely(!(x & PGT_validated)) )
    1.26          {
    1.27              /* Someone else is updating validation of this page. Wait... */
    1.28              while ( (y = page->u.inuse.type_info) == x )
    1.29 @@ -948,8 +948,8 @@ int get_page_type(struct pfn_info *page,
    1.30              MEM_LOG("Error while validating pfn %08lx for type %08x."
    1.31                      " caf=%08x taf=%08x\n",
    1.32                      page_to_pfn(page), type,
    1.33 -		    page->count_info,
    1.34 -		    page->u.inuse.type_info);
    1.35 +                    page->count_info,
    1.36 +                    page->u.inuse.type_info);
    1.37              /* Noone else can get a reference. We hold the only ref. */
    1.38              page->u.inuse.type_info = 0;
    1.39              return 0;
    1.40 @@ -1463,8 +1463,8 @@ int do_mmu_update(mmu_update_t *ureqs, i
    1.41               * page as dirty.
    1.42               */
    1.43              if ( unlikely(d->mm.shadow_mode == SHM_logdirty) && 
    1.44 -		 mark_dirty(&d->mm, pfn) )
    1.45 -		d->mm.shadow_dirty_block_count++;
    1.46 +                 mark_dirty(&d->mm, pfn) )
    1.47 +                d->mm.shadow_dirty_block_count++;
    1.48  
    1.49              put_page(&frame_table[pfn]);
    1.50              break;
    1.51 @@ -1647,8 +1647,7 @@ void ptwr_flush(const int which)
    1.52      int i;
    1.53  
    1.54      l1va = ptwr_info[cpu].ptinfo[which].l1va;
    1.55 -    ptep = (unsigned long *)&linear_pg_table
    1.56 -        [l1va>>PAGE_SHIFT];
    1.57 +    ptep = (unsigned long *)&linear_pg_table[l1va>>PAGE_SHIFT];
    1.58  
    1.59      /* make pt page write protected */
    1.60      if ( unlikely(__get_user(pte, ptep)) ) {
    1.61 @@ -1660,10 +1659,10 @@ void ptwr_flush(const int which)
    1.62      pte &= ~_PAGE_RW;
    1.63  
    1.64      if ( unlikely(current->mm.shadow_mode) ) {
    1.65 -	unsigned long spte;
    1.66 -	l1pte_no_fault(&current->mm, &pte, &spte);
    1.67 -	__put_user( spte, (unsigned long *)&shadow_linear_pg_table
    1.68 -		    [l1va>>PAGE_SHIFT] );
    1.69 +        unsigned long spte;
    1.70 +        l1pte_no_fault(&current->mm, &pte, &spte);
    1.71 +        __put_user( spte, (unsigned long *)&shadow_linear_pg_table
    1.72 +                    [l1va>>PAGE_SHIFT] );
    1.73      }
    1.74  
    1.75      if ( unlikely(__put_user(pte, ptep)) ) {
    1.76 @@ -1682,8 +1681,8 @@ void ptwr_flush(const int which)
    1.77          if (likely(l1_pgentry_val(ol1e) == l1_pgentry_val(nl1e)))
    1.78              continue;
    1.79          if (likely(l1_pgentry_val(ol1e) == (l1_pgentry_val(nl1e) | _PAGE_RW))
    1.80 -	    && readonly_page_from_l1e(nl1e))
    1.81 -	    continue;
    1.82 +            && readonly_page_from_l1e(nl1e))
    1.83 +            continue;
    1.84          if (unlikely(l1_pgentry_val(ol1e) & _PAGE_PRESENT))
    1.85              put_page_from_l1e(ol1e, current);
    1.86          if (unlikely(!get_page_from_l1e(nl1e, current))) {
    1.87 @@ -1694,10 +1693,10 @@ void ptwr_flush(const int which)
    1.88      unmap_domain_mem(pl1e);
    1.89  
    1.90      if (which == PTWR_PT_ACTIVE && likely(!current->mm.shadow_mode)) {
    1.91 -	/* reconnect l1 page (no need if shadow mode)*/
    1.92 -	pl2e = &linear_l2_table[ptwr_info[cpu].active_pteidx];
    1.93 -	nl2e = mk_l2_pgentry(l2_pgentry_val(*pl2e) | _PAGE_PRESENT);
    1.94 -	update_l2e(pl2e, *pl2e, nl2e);
    1.95 +        /* reconnect l1 page (no need if shadow mode) */
    1.96 +        pl2e = &linear_l2_table[ptwr_info[cpu].active_pteidx];
    1.97 +        nl2e = mk_l2_pgentry(l2_pgentry_val(*pl2e) | _PAGE_PRESENT);
    1.98 +        update_l2e(pl2e, *pl2e, nl2e);
    1.99      }
   1.100  
   1.101      if ( unlikely(current->mm.shadow_mode) )
   1.102 @@ -1711,7 +1710,7 @@ void ptwr_flush(const int which)
   1.103              unsigned long spfn = sstat & PSH_pfn_mask;
   1.104              l1_pgentry_t *sl1e = map_domain_mem( spfn << PAGE_SHIFT );
   1.105              
   1.106 -            for( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ )
   1.107 +            for ( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ )
   1.108              {
   1.109                  l1pte_no_fault(&current->mm, 
   1.110                                 &l1_pgentry_val(
   1.111 @@ -1747,7 +1746,7 @@ int ptwr_do_page_fault(unsigned long add
   1.112           (__get_user(pte, (unsigned long *)
   1.113                       &linear_pg_table[addr >> PAGE_SHIFT]) == 0) )
   1.114      {
   1.115 -        if( (pte & _PAGE_RW) && (pte & _PAGE_PRESENT) )
   1.116 +        if ( (pte & _PAGE_RW) && (pte & _PAGE_PRESENT) )
   1.117              return 0; /* we can't help. Maybe shadow mode can? */
   1.118  
   1.119          pfn = pte >> PAGE_SHIFT;
   1.120 @@ -1778,14 +1777,14 @@ int ptwr_do_page_fault(unsigned long add
   1.121  
   1.122              if (which == PTWR_PT_ACTIVE) {
   1.123                  ptwr_info[cpu].active_pteidx = va_mask;
   1.124 -		if ( likely(!current->mm.shadow_mode) ) {
   1.125 -		    /* disconnect l1 page (unnecessary in shadow mode) */
   1.126 -		    nl2e = mk_l2_pgentry((l2_pgentry_val(*pl2e) &
   1.127 -					  ~_PAGE_PRESENT));
   1.128 -		    update_l2e(pl2e, *pl2e, nl2e);
   1.129 -		    flush_tlb();
   1.130 -		}
   1.131 -	    }
   1.132 +                if ( likely(!current->mm.shadow_mode) ) {
   1.133 +                    /* disconnect l1 page (unnecessary in shadow mode) */
   1.134 +                    nl2e = mk_l2_pgentry((l2_pgentry_val(*pl2e) &
   1.135 +                                          ~_PAGE_PRESENT));
   1.136 +                    update_l2e(pl2e, *pl2e, nl2e);
   1.137 +                    flush_tlb();
   1.138 +                }
   1.139 +            }
   1.140  
   1.141              ptwr_info[cpu].ptinfo[which].pl1e =
   1.142                  map_domain_mem(pfn << PAGE_SHIFT);
   1.143 @@ -1822,11 +1821,11 @@ static __init int ptwr_init(void)
   1.144          ptwr_info[i].ptinfo[PTWR_PT_INACTIVE].page =
   1.145              (void *)alloc_xenheap_page();
   1.146          machine_to_phys_mapping[virt_to_phys(
   1.147 -	    ptwr_info[i].ptinfo[PTWR_PT_ACTIVE].page)>>PAGE_SHIFT] =
   1.148 -	    INVALID_P2M_ENTRY;
   1.149 +            ptwr_info[i].ptinfo[PTWR_PT_ACTIVE].page)>>PAGE_SHIFT] =
   1.150 +            INVALID_P2M_ENTRY;
   1.151          machine_to_phys_mapping[virt_to_phys(
   1.152 -	    ptwr_info[i].ptinfo[PTWR_PT_INACTIVE].page)>>PAGE_SHIFT] =
   1.153 -	    INVALID_P2M_ENTRY; 
   1.154 +            ptwr_info[i].ptinfo[PTWR_PT_INACTIVE].page)>>PAGE_SHIFT] =
   1.155 +            INVALID_P2M_ENTRY; 
   1.156      }
   1.157  
   1.158      return 0;
   1.159 @@ -1890,7 +1889,7 @@ void audit_domain(struct domain *d)
   1.160  
   1.161              if ( tcount < 0 )
   1.162              {
   1.163 -		/* This will only come out once. */
   1.164 +                /* This will only come out once. */
   1.165                  printk("Audit %d: type count whent below zero pfn=%x "
   1.166                         "taf=%x otaf=%x\n",
   1.167                         d->domain, page-frame_table,
   1.168 @@ -1900,14 +1899,14 @@ void audit_domain(struct domain *d)
   1.169              
   1.170              page->u.inuse.type_info =
   1.171                  (page->u.inuse.type_info & ~PGT_count_mask) | 
   1.172 -		(tcount & PGT_count_mask);
   1.173 +                (tcount & PGT_count_mask);
   1.174          }
   1.175  
   1.176          ctot++;
   1.177          count += dir;
   1.178          if ( count < 0 )
   1.179          {
   1.180 -	    /* This will only come out once. */
   1.181 +            /* This will only come out once. */
   1.182              printk("Audit %d: general count whent below zero pfn=%x "
   1.183                     "taf=%x otaf=%x\n",
   1.184                     d->domain, page-frame_table,
   1.185 @@ -1917,7 +1916,7 @@ void audit_domain(struct domain *d)
   1.186              
   1.187          page->count_info =
   1.188              (page->count_info & ~PGC_count_mask) | 
   1.189 -	    (count & PGC_count_mask);            
   1.190 +            (count & PGC_count_mask);            
   1.191  
   1.192      }
   1.193  
   1.194 @@ -2107,17 +2106,17 @@ void audit_domain(struct domain *d)
   1.195                      unsigned long l1pfn = pt[i]>>PAGE_SHIFT;
   1.196                      struct pfn_info *l1page = &frame_table[l1pfn];
   1.197  
   1.198 -		    if ( l1pfn < 0x100 )
   1.199 -		    {
   1.200 -			lowmem_mappings++;
   1.201 -			continue;
   1.202 -		    }
   1.203 +                    if ( l1pfn < 0x100 )
   1.204 +                    {
   1.205 +                        lowmem_mappings++;
   1.206 +                        continue;
   1.207 +                    }
   1.208  
   1.209 -		    if ( l1pfn > max_page )
   1.210 -		    {
   1.211 -			io_mappings++;
   1.212 -			continue;
   1.213 -		    }
   1.214 +                    if ( l1pfn > max_page )
   1.215 +                    {
   1.216 +                        io_mappings++;
   1.217 +                        continue;
   1.218 +                    }
   1.219  
   1.220                      if ( pt[i] & _PAGE_RW )
   1.221                      {
   1.222 @@ -2137,12 +2136,12 @@ void audit_domain(struct domain *d)
   1.223                      {
   1.224                          printk("Audit %d: [%lx,%x] Skip foreign page dom=%lx "
   1.225                                 "pfn=%lx c=%08x t=%08x m2p=%lx\n",
   1.226 -			       d->domain, pfn, i,
   1.227 +                               d->domain, pfn, i,
   1.228                                 (unsigned long)l1page->u.inuse.domain,
   1.229 -			       l1pfn,
   1.230 -			       l1page->count_info,
   1.231 -			       l1page->u.inuse.type_info,
   1.232 -			       machine_to_phys_mapping[l1pfn]);    
   1.233 +                               l1pfn,
   1.234 +                               l1page->count_info,
   1.235 +                               l1page->u.inuse.type_info,
   1.236 +                               machine_to_phys_mapping[l1pfn]);    
   1.237                          continue;
   1.238                      }
   1.239  
   1.240 @@ -2159,8 +2158,8 @@ void audit_domain(struct domain *d)
   1.241      }
   1.242  
   1.243      if ( (io_mappings > 0) || (lowmem_mappings > 0) )
   1.244 -	printk("Audit %d: Found %d lowmem mappings and %d io mappings\n",
   1.245 -	       d->domain, lowmem_mappings, io_mappings);
   1.246 +        printk("Audit %d: Found %d lowmem mappings and %d io mappings\n",
   1.247 +               d->domain, lowmem_mappings, io_mappings);
   1.248  
   1.249      /* PHASE 2 */
   1.250  
   1.251 @@ -2248,7 +2247,7 @@ void audit_domain(struct domain *d)
   1.252                           (l1pfn < 0x100) || (l1pfn > max_page) )
   1.253                          continue;
   1.254  
   1.255 -		    adjust(l1page, 1, 0);
   1.256 +                    adjust(l1page, 1, 0);
   1.257                  }
   1.258              }
   1.259  
   1.260 @@ -2276,7 +2275,7 @@ void audit_domains(void)
   1.261  {
   1.262      struct domain *d;
   1.263      for_each_domain ( d )
   1.264 -	audit_domain(d);
   1.265 +        audit_domain(d);
   1.266  }
   1.267  
   1.268  void audit_domains_key(unsigned char key, void *dev_id,