ia64/xen-unstable

changeset 1202:3ef84b0712aa

bitkeeper revision 1.794.1.3 (405de995_4scoWE5EfQzN5TSoyS8Gw)

fixes plus new performance counters
author iap10@tetris.cl.cam.ac.uk
date Sun Mar 21 19:14:29 2004 +0000 (2004-03-21)
parents d0ff128be81d
children a9abf4f7b2f6
files xen/arch/i386/process.c xen/arch/i386/traps.c xen/common/memory.c xen/common/perfc.c xen/common/shadow.c xen/include/xeno/perfc.h xen/include/xeno/perfc_defn.h xen/include/xeno/shadow.h
line diff
     1.1 --- a/xen/arch/i386/process.c	Sat Mar 20 08:46:14 2004 +0000
     1.2 +++ b/xen/arch/i386/process.c	Sun Mar 21 19:14:29 2004 +0000
     1.3 @@ -290,8 +290,8 @@ void switch_to(struct task_struct *prev_
     1.4  
     1.5      if( next_p->mm.shadowmode )
     1.6        {
     1.7 +	check_pagetable( next_p->mm.pagetable, "switch" );
     1.8  	write_cr3_counted(pagetable_val(next_p->mm.shadowtable));
     1.9 -	check_pagetable( next_p->mm.pagetable, "switch" );
    1.10        }
    1.11      else
    1.12  #endif
     2.1 --- a/xen/arch/i386/traps.c	Sat Mar 20 08:46:14 2004 +0000
     2.2 +++ b/xen/arch/i386/traps.c	Sun Mar 21 19:14:29 2004 +0000
     2.3 @@ -340,15 +340,11 @@ asmlinkage void do_page_fault(struct pt_
     2.4      }
     2.5  
     2.6  #ifdef CONFIG_SHADOW
     2.7 -//printk("1");
     2.8 -check_pagetable( current->mm.pagetable, "pre-sf" );
     2.9      if ( p->mm.shadowmode && addr < PAGE_OFFSET &&
    2.10  	 shadow_fault( addr, error_code ) )
    2.11        {
    2.12 -	check_pagetable( current->mm.pagetable, "post-sfa" );
    2.13  	return; // return true if fault was handled 
    2.14        }
    2.15 -    check_pagetable( current->mm.pagetable, "post-sfb" );
    2.16  #endif
    2.17  
    2.18      if ( unlikely(!(regs->xcs & 3)) )
     3.1 --- a/xen/common/memory.c	Sat Mar 20 08:46:14 2004 +0000
     3.2 +++ b/xen/common/memory.c	Sun Mar 21 19:14:29 2004 +0000
     3.3 @@ -764,19 +764,26 @@ void free_page_type(struct pfn_info *pag
     3.4      switch ( type )
     3.5      {
     3.6      case PGT_l1_page_table:
     3.7 -        return free_l1_table(page);
     3.8 +        free_l1_table(page);
     3.9 +#ifdef CONFIG_SHADOW
    3.10 +	// assume we're in shadow mode if PSH_shadowed set
    3.11 +	if ( current->mm.shadowmode && page->shadow_and_flags & PSH_shadowed )
    3.12 +	    unshadow_table( page-frame_table, type );
    3.13 +#endif
    3.14 +	return;
    3.15 +
    3.16      case PGT_l2_page_table:
    3.17 -        return free_l2_table(page);
    3.18 +        free_l2_table(page);
    3.19 +#ifdef CONFIG_SHADOW
    3.20 +	// assume we're in shadow mode if PSH_shadowed set
    3.21 +	if ( current->mm.shadowmode && page->shadow_and_flags & PSH_shadowed )
    3.22 +	    unshadow_table( page-frame_table, type );
    3.23 +#endif
    3.24 +	return;
    3.25 +
    3.26      default:
    3.27          BUG();
    3.28      }
    3.29 -
    3.30 -#ifdef CONFIG_SHADOW
    3.31 -    // assume we're in shadow mode if PSH_shadowed set
    3.32 -    if ( page->shadow_and_flags & PSH_shadowed )
    3.33 -      unshadow_table( page-frame_table );
    3.34 -#endif
    3.35 -
    3.36  }
    3.37  
    3.38  
    3.39 @@ -846,7 +853,17 @@ static int do_extended_command(unsigned 
    3.40  	      shadow_mk_pagetable(pfn << PAGE_SHIFT, current->mm.shadowmode);
    3.41  #endif
    3.42              invalidate_shadow_ldt();
    3.43 -            percpu_info[cpu].deferred_ops |= DOP_FLUSH_TLB;
    3.44 +
    3.45 +            percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB;
    3.46 +#ifdef CONFIG_SHADOW
    3.47 +            if ( unlikely(current->mm.shadowmode) )
    3.48 +	    {
    3.49 +                check_pagetable( current->mm.pagetable, "pre-stlb-flush" );
    3.50 +	        write_cr3_counted(pagetable_val(current->mm.shadowtable));
    3.51 +            }
    3.52 +            else
    3.53 +#endif	  
    3.54 +	        write_cr3_counted(pagetable_val(current->mm.pagetable));
    3.55          }
    3.56          else
    3.57          {
    3.58 @@ -1082,7 +1099,10 @@ check_pagetable( current->mm.pagetable, 
    3.59      {
    3.60  #ifdef CONFIG_SHADOW
    3.61          if ( unlikely(current->mm.shadowmode) )
    3.62 -	  write_cr3_counted(pagetable_val(current->mm.shadowtable));
    3.63 +	{
    3.64 +            check_pagetable( current->mm.pagetable, "pre-stlb-flush" );
    3.65 +	    write_cr3_counted(pagetable_val(current->mm.shadowtable));
    3.66 +        }
    3.67          else
    3.68  #endif	  
    3.69  	  write_cr3_counted(pagetable_val(current->mm.pagetable));
     4.1 --- a/xen/common/perfc.c	Sat Mar 20 08:46:14 2004 +0000
     4.2 +++ b/xen/common/perfc.c	Sun Mar 21 19:14:29 2004 +0000
     4.3 @@ -8,12 +8,20 @@
     4.4  #undef  PERFCOUNTER
     4.5  #undef  PERFCOUNTER_CPU
     4.6  #undef  PERFCOUNTER_ARRAY
     4.7 +#undef  PERFSTATUS
     4.8 +#undef  PERFSTATUS_CPU
     4.9 +#undef  PERFSTATUS_ARRAY
    4.10  #define PERFCOUNTER( var, name )              { name, TYPE_SINGLE, 0 },
    4.11  #define PERFCOUNTER_CPU( var, name )          { name, TYPE_CPU,    0 },
    4.12  #define PERFCOUNTER_ARRAY( var, name, size )  { name, TYPE_ARRAY,  size },
    4.13 +#define PERFSTATUS( var, name )               { name, TYPE_S_SINGLE, 0 },
    4.14 +#define PERFSTATUS_CPU( var, name )           { name, TYPE_S_CPU,    0 },
    4.15 +#define PERFSTATUS_ARRAY( var, name, size )   { name, TYPE_S_ARRAY,  size },
    4.16  static struct {
    4.17      char *name;
    4.18 -    enum { TYPE_SINGLE, TYPE_CPU, TYPE_ARRAY } type;
    4.19 +    enum { TYPE_SINGLE, TYPE_CPU, TYPE_ARRAY,
    4.20 +	   TYPE_S_SINGLE, TYPE_S_CPU, TYPE_S_ARRAY
    4.21 +    } type;
    4.22      int nr_elements;
    4.23  } perfc_info[] = {
    4.24  #include <xeno/perfc_defn.h>
    4.25 @@ -38,10 +46,12 @@ void perfc_printall(u_char key, void *de
    4.26          switch ( perfc_info[i].type )
    4.27          {
    4.28          case TYPE_SINGLE:
    4.29 +        case TYPE_S_SINGLE:
    4.30              printk("TOTAL[%10d]", atomic_read(&counters[0]));
    4.31              counters += 1;
    4.32              break;
    4.33          case TYPE_CPU:
    4.34 +        case TYPE_S_CPU:
    4.35              for ( j = sum = 0; j < smp_num_cpus; j++ )
    4.36                  sum += atomic_read(&counters[j]);
    4.37              printk("TOTAL[%10d]  ", sum);
    4.38 @@ -50,6 +60,7 @@ void perfc_printall(u_char key, void *de
    4.39              counters += NR_CPUS;
    4.40              break;
    4.41          case TYPE_ARRAY:
    4.42 +        case TYPE_S_ARRAY:
    4.43              for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
    4.44                  sum += atomic_read(&counters[j]);
    4.45              printk("TOTAL[%10d]  ", sum);
    4.46 @@ -64,9 +75,37 @@ void perfc_printall(u_char key, void *de
    4.47  
    4.48  void perfc_reset(u_char key, void *dev_id, struct pt_regs *regs)
    4.49  {
    4.50 +    int i, j, sum;
    4.51      s_time_t now = NOW();
    4.52 +    atomic_t *counters = (atomic_t *)&perfcounters;
    4.53 +
    4.54      printk("Xen performance counters RESET (now = 0x%08X:%08X)\n",
    4.55             (u32)(now>>32), (u32)now);
    4.56 -    memset(&perfcounters, 0, sizeof(perfcounters));
    4.57 +
    4.58 +    // leave STATUS counters alone -- don't reset
    4.59 +
    4.60 +    for ( i = 0; i < NR_PERFCTRS; i++ ) 
    4.61 +    {
    4.62 +        switch ( perfc_info[i].type )
    4.63 +        {
    4.64 +        case TYPE_SINGLE:
    4.65 +	    atomic_set(&counters[0],0);
    4.66 +        case TYPE_S_SINGLE:
    4.67 +            counters += 1;
    4.68 +            break;
    4.69 +        case TYPE_CPU:
    4.70 +            for ( j = sum = 0; j < smp_num_cpus; j++ )
    4.71 +	      	atomic_set(&counters[j],0);
    4.72 +        case TYPE_S_CPU:
    4.73 +            counters += NR_CPUS;
    4.74 +            break;
    4.75 +        case TYPE_ARRAY:
    4.76 +            for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
    4.77 +	      	atomic_set(&counters[j],0);
    4.78 +        case TYPE_S_ARRAY:
    4.79 +            counters += j;
    4.80 +            break;
    4.81 +        }
    4.82 +    }
    4.83  }
    4.84  
     5.1 --- a/xen/common/shadow.c	Sat Mar 20 08:46:14 2004 +0000
     5.2 +++ b/xen/common/shadow.c	Sun Mar 21 19:14:29 2004 +0000
     5.3 @@ -10,7 +10,7 @@
     5.4  #ifdef CONFIG_SHADOW
     5.5  
     5.6  
     5.7 -#if 1
     5.8 +#if SHADOW_DEBUG
     5.9  #define MEM_VLOG(_f, _a...)                             \
    5.10    printk("DOM%llu: (file=shadow.c, line=%d) " _f "\n", \
    5.11           current->domain , __LINE__ , ## _a )
    5.12 @@ -63,11 +63,14 @@ pagetable_t shadow_mk_pagetable( unsigne
    5.13  	return mk_pagetable(spfn << PAGE_SHIFT);
    5.14  }
    5.15  
    5.16 -void unshadow_table( unsigned long gpfn )
    5.17 +void unshadow_table( unsigned long gpfn, unsigned int type )
    5.18  {
    5.19  	unsigned long spfn;
    5.20  
    5.21 -MEM_VLOG("unshadow_table %08lx\n", gpfn );
    5.22 +    MEM_VLOG("unshadow_table type=%08x gpfn=%08lx, spfn=%08lx",
    5.23 +		 type,
    5.24 +		 gpfn,
    5.25 +		 frame_table[gpfn].shadow_and_flags & PSH_pfn_mask );
    5.26  
    5.27  	perfc_incrc(unshadow_table_count);
    5.28  
    5.29 @@ -80,8 +83,8 @@ MEM_VLOG("unshadow_table %08lx\n", gpfn 
    5.30  	frame_table[gpfn].shadow_and_flags=0;
    5.31  	frame_table[spfn].shadow_and_flags=0;
    5.32  
    5.33 -#ifdef DEBUG
    5.34 -	{ // XXX delete me!
    5.35 +#if 0 // XXX leave as might be useful for later debugging
    5.36 +	{ 
    5.37  		int i;
    5.38  		unsigned long * spl1e = map_domain_mem( spfn<<PAGE_SHIFT );
    5.39  
    5.40 @@ -93,7 +96,21 @@ MEM_VLOG("unshadow_table %08lx\n", gpfn 
    5.41  	}
    5.42  #endif
    5.43  
    5.44 -	free_domain_page( &frame_table[spfn] );
    5.45 +	if (type == PGT_l1_page_table)
    5.46 +		perfc_decr(shadow_l1_pages);
    5.47 +    else
    5.48 +		perfc_decr(shadow_l2_pages);
    5.49 +
    5.50 +	//free_domain_page( &frame_table[spfn] );
    5.51 +
    5.52 +	{
    5.53 +    unsigned long flags;
    5.54 +    spin_lock_irqsave(&free_list_lock, flags);
    5.55 +    list_add(&frame_table[spfn].list, &free_list);
    5.56 +    free_pfns++;
    5.57 +    spin_unlock_irqrestore(&free_list_lock, flags);
    5.58 +	}
    5.59 +
    5.60  }
    5.61  
    5.62  
    5.63 @@ -107,6 +124,7 @@ unsigned long shadow_l2_table( unsigned 
    5.64  	MEM_VVLOG("shadow_l2_table( %08lx )",gpfn);
    5.65  
    5.66  	perfc_incrc(shadow_l2_table_count);
    5.67 +	perfc_incr(shadow_l2_pages);
    5.68  
    5.69      // XXX in future, worry about racing in SMP guests 
    5.70      //      -- use cmpxchg with PSH_pending flag to show progress (and spin)
    5.71 @@ -198,6 +216,8 @@ int shadow_fault( unsigned long va, long
    5.72  
    5.73  	MEM_VVLOG("shadow_fault( va=%08lx, code=%ld )", va, error_code );
    5.74  
    5.75 +    check_pagetable( current->mm.pagetable, "pre-sf" );
    5.76 +
    5.77  	if ( unlikely(__get_user(gpte, (unsigned long*)&linear_pg_table[va>>PAGE_SHIFT])) )
    5.78  	{
    5.79  		MEM_VVLOG("shadow_fault - EXIT: read gpte faulted" );
    5.80 @@ -250,7 +270,7 @@ int shadow_fault( unsigned long va, long
    5.81  		unsigned long gpde, spde, gl1pfn, sl1pfn;
    5.82  
    5.83          MEM_VVLOG("3: not shadowed or l2 insufficient gpte=%08lx  spte=%08lx",gpte,spte );
    5.84 - 
    5.85 +
    5.86          gpde = l2_pgentry_val(linear_l2_table[va>>L2_PAGETABLE_SHIFT]);
    5.87  
    5.88          gl1pfn = gpde>>PAGE_SHIFT;
    5.89 @@ -266,6 +286,7 @@ int shadow_fault( unsigned long va, long
    5.90  
    5.91              MEM_VVLOG("4a: l1 not shadowed ( %08lx )",sl1pfn);
    5.92  	        perfc_incrc(shadow_l1_table_count);
    5.93 +	        perfc_incr(shadow_l1_pages);
    5.94  
    5.95              sl1pfn_info->shadow_and_flags = PSH_shadow | gl1pfn;
    5.96              frame_table[gl1pfn].shadow_and_flags = PSH_shadowed | sl1pfn;
    5.97 @@ -337,6 +358,8 @@ int shadow_fault( unsigned long va, long
    5.98      	
    5.99      perfc_incrc(shadow_fixup_count);
   5.100  
   5.101 +    check_pagetable( current->mm.pagetable, "post-sf" );
   5.102 +
   5.103      return 1; // let's try the faulting instruction again...
   5.104  
   5.105  }
   5.106 @@ -521,9 +544,11 @@ int check_l1_table( unsigned long va, un
   5.107  	int j;
   5.108  	unsigned long *gpl1e, *spl1e;
   5.109  
   5.110 -	gpl1e = (unsigned long *) &(linear_pg_table[ va>>PAGE_SHIFT]);
   5.111 -	spl1e = (unsigned long *) &(shadow_linear_pg_table[ va>>PAGE_SHIFT]);
   5.112 +	//gpl1e = (unsigned long *) &(linear_pg_table[ va>>PAGE_SHIFT]);
   5.113 +	//spl1e = (unsigned long *) &(shadow_linear_pg_table[ va>>PAGE_SHIFT]);
   5.114  
   5.115 +	gpl1e = map_domain_mem( g2<<PAGE_SHIFT );
   5.116 +	spl1e = map_domain_mem( s2<<PAGE_SHIFT );
   5.117  
   5.118  	for ( j = 0; j < ENTRIES_PER_L1_PAGETABLE; j++ )
   5.119  	{
   5.120 @@ -532,12 +557,15 @@ int check_l1_table( unsigned long va, un
   5.121  		
   5.122  		check_pte( gpte, spte, 1, j );
   5.123  	}
   5.124 +	
   5.125 +	unmap_domain_mem( spl1e );
   5.126 +	unmap_domain_mem( gpl1e );
   5.127  
   5.128  	return 1;
   5.129  }
   5.130  
   5.131  #define FAILPT(_f, _a...)                             \
   5.132 -{printk("XXX FAILPT" _f "\n", ## _a ); BUG();}
   5.133 +{printk("XXX FAIL %s-PT" _f "\n", s, ## _a ); BUG();}
   5.134  
   5.135  int check_pagetable( pagetable_t pt, char *s )
   5.136  {
   5.137 @@ -546,8 +574,6 @@ int check_pagetable( pagetable_t pt, cha
   5.138  	int i;
   5.139  	l2_pgentry_t *gpl2e, *spl2e;
   5.140  
   5.141 -return 1;
   5.142 -
   5.143  	sh_check_name = s;
   5.144  
   5.145      MEM_VVLOG("%s-PT Audit",s);
   5.146 @@ -573,10 +599,41 @@ return 1;
   5.147  	if ( ! frame_table[spfn].shadow_and_flags == (PSH_shadow | gpfn) )
   5.148  		FAILPT("ptbase shadow inconsistent2");
   5.149  
   5.150 +	gpl2e = (l2_pgentry_t *) map_domain_mem( gpfn << PAGE_SHIFT );
   5.151 +	spl2e = (l2_pgentry_t *) map_domain_mem( spfn << PAGE_SHIFT );
   5.152  
   5.153 -	// use the linear map to get a pointer to the L2
   5.154 -	gpl2e = (l2_pgentry_t *) &(linear_l2_table[0]);
   5.155 -	spl2e = (l2_pgentry_t *) &(shadow_linear_l2_table[0]);
   5.156 +	//ipl2e = (l2_pgentry_t *) map_domain_mem( spfn << PAGE_SHIFT );
   5.157 +
   5.158 +
   5.159 +	if ( memcmp( &spl2e[DOMAIN_ENTRIES_PER_L2_PAGETABLE],
   5.160 +			&gpl2e[DOMAIN_ENTRIES_PER_L2_PAGETABLE], 
   5.161 +			((SH_LINEAR_PT_VIRT_START>>(L2_PAGETABLE_SHIFT))-DOMAIN_ENTRIES_PER_L2_PAGETABLE)
   5.162 +			* sizeof(l2_pgentry_t)) )
   5.163 +	{
   5.164 +		printk("gpfn=%08lx spfn=%08lx\n", gpfn, spfn);
   5.165 +		for (i=DOMAIN_ENTRIES_PER_L2_PAGETABLE; 
   5.166 +			 i<(SH_LINEAR_PT_VIRT_START>>(L2_PAGETABLE_SHIFT));
   5.167 +			 i++ )
   5.168 +			printk("+++ (%d) %08lx %08lx\n",i,
   5.169 +				   l2_pgentry_val(gpl2e[i]), l2_pgentry_val(spl2e[i]) );
   5.170 +		FAILPT("hypervisor entries inconsistent");
   5.171 +	}
   5.172 +
   5.173 +	if ( (l2_pgentry_val(spl2e[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT]) != 
   5.174 +		  l2_pgentry_val(gpl2e[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT])) )
   5.175 +		FAILPT("hypervisor linear map inconsistent");
   5.176 +
   5.177 +	if ( (l2_pgentry_val(spl2e[SH_LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT]) != 
   5.178 +		  ((spfn << PAGE_SHIFT) | __PAGE_HYPERVISOR)) )
   5.179 +		FAILPT("hypervisor shadow linear map inconsistent %08lx %08lx",
   5.180 +			   l2_pgentry_val(spl2e[SH_LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT]),
   5.181 +			   		  (spfn << PAGE_SHIFT) | __PAGE_HYPERVISOR
   5.182 +			   );
   5.183 +
   5.184 +	if ( (l2_pgentry_val(spl2e[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT]) !=
   5.185 +		  ((__pa(frame_table[gpfn].u.domain->mm.perdomain_pt) | __PAGE_HYPERVISOR))) )
   5.186 +		FAILPT("hypervisor per-domain map inconsistent");
   5.187 +
   5.188  
   5.189  	// check the whole L2
   5.190  	for ( i = 0; i < DOMAIN_ENTRIES_PER_L2_PAGETABLE; i++ )
   5.191 @@ -601,6 +658,8 @@ return 1;
   5.192  
   5.193  	}
   5.194  
   5.195 +	unmap_domain_mem( spl2e );
   5.196 +	unmap_domain_mem( gpl2e );
   5.197  
   5.198  	MEM_VVLOG("PT verified : l2_present = %d, l1_present = %d\n",
   5.199  		   sh_l2_present, sh_l1_present );
     6.1 --- a/xen/include/xeno/perfc.h	Sat Mar 20 08:46:14 2004 +0000
     6.2 +++ b/xen/include/xeno/perfc.h	Sun Mar 21 19:14:29 2004 +0000
     6.3 @@ -11,6 +11,11 @@
     6.4   * PERFCOUNTER_CPU (counter, string, size)    define a counter per CPU
     6.5   * PERFCOUNTER_ARRY (counter, string, size)   define an array of counters
     6.6   * 
     6.7 + * unlike "COUNTERS", "STATUS" variables DO NOT RESET
     6.8 + * PERFSTATUS (counter, string)               define a new performance stauts
     6.9 + * PERFSTATUS_CPU (counter, string, size)     define a status var per CPU
    6.10 + * PERFSTATUS_ARRY (counter, string, size)    define an array of status vars
    6.11 + * 
    6.12   * unsigned long perfc_value  (counter)        get value of a counter  
    6.13   * unsigned long perfc_valuec (counter)        get value of a per CPU counter
    6.14   * unsigned long perfc_valuea (counter, index) get value of an array counter
    6.15 @@ -32,6 +37,12 @@
    6.16    atomic_t var[NR_CPUS];
    6.17  #define PERFCOUNTER_ARRAY( var, name, size ) \
    6.18    atomic_t var[size];
    6.19 +#define PERFSTATUS( var, name ) \
    6.20 +  atomic_t var[1];
    6.21 +#define PERFSTATUS_CPU( var, name ) \
    6.22 +  atomic_t var[NR_CPUS];
    6.23 +#define PERFSTATUS_ARRAY( var, name, size ) \
    6.24 +  atomic_t var[size];
    6.25  
    6.26  struct perfcounter_t 
    6.27  {
    6.28 @@ -47,6 +58,7 @@ extern struct perfcounter_t perfcounters
    6.29  #define perfc_setc(x,v)   atomic_set(&perfcounters.x[smp_processor_id()], v)
    6.30  #define perfc_seta(x,y,v) atomic_set(&perfcounters.x[y], v)
    6.31  #define perfc_incr(x)     atomic_inc(&perfcounters.x[0])
    6.32 +#define perfc_decr(x)     atomic_dec(&perfcounters.x[0])
    6.33  #define perfc_incrc(x)    atomic_inc(&perfcounters.x[smp_processor_id()])
    6.34  #define perfc_incra(x,y)  atomic_inc(&perfcounters.x[y])
    6.35  #define perfc_add(x,y)    atomic_add((y), &perfcounters.x[0])
     7.1 --- a/xen/include/xeno/perfc_defn.h	Sat Mar 20 08:46:14 2004 +0000
     7.2 +++ b/xen/include/xeno/perfc_defn.h	Sun Mar 21 19:14:29 2004 +0000
     7.3 @@ -30,4 +30,6 @@ PERFCOUNTER_CPU( unshadow_table_count, "
     7.4  PERFCOUNTER_CPU( shadow_fixup_count, "shadow_fixup count" )
     7.5  PERFCOUNTER_CPU( shadow_update_va_fail, "shadow_update_va_fail" )
     7.6  
     7.7 -
     7.8 +/* STATUS counters do not reset when 'P' is hit */
     7.9 +PERFSTATUS( shadow_l2_pages, "current # shadow L2 pages" )
    7.10 +PERFSTATUS( shadow_l1_pages, "current # shadow L1 pages" )
     8.1 --- a/xen/include/xeno/shadow.h	Sat Mar 20 08:46:14 2004 +0000
     8.2 +++ b/xen/include/xeno/shadow.h	Sun Mar 21 19:14:29 2004 +0000
     8.3 @@ -25,7 +25,7 @@
     8.4  #define shadow_linear_l2_table ((l2_pgentry_t *)(SH_LINEAR_PT_VIRT_START+(SH_LINEAR_PT_VIRT_START>>(L2_PAGETABLE_SHIFT-L1_PAGETABLE_SHIFT))))
     8.5  
     8.6  extern pagetable_t shadow_mk_pagetable( unsigned long gptbase, unsigned int shadowmode );
     8.7 -extern void unshadow_table( unsigned long gpfn );
     8.8 +extern void unshadow_table( unsigned long gpfn, unsigned int type );
     8.9  extern unsigned long shadow_l2_table( unsigned long gpfn );
    8.10  extern int shadow_fault( unsigned long va, long error_code );
    8.11  extern void shadow_l1_normal_pt_update( unsigned long pa, unsigned long gpte, 
    8.12 @@ -37,6 +37,8 @@ extern void shadow_l2_normal_pt_update( 
    8.13  #define SHADOW_DEBUG 0
    8.14  #define SHADOW_OPTIMISE 1
    8.15  
    8.16 +#endif // end of CONFIG_SHADOW
    8.17 +
    8.18  #if SHADOW_DEBUG
    8.19  extern int check_pagetable( pagetable_t pt, char *s );
    8.20  #else
    8.21 @@ -44,5 +46,6 @@ extern int check_pagetable( pagetable_t 
    8.22  #endif
    8.23  
    8.24  
    8.25 +
    8.26 +
    8.27  #endif
    8.28 -#endif