ia64/xen-unstable

changeset 3814:58be428f51a8

bitkeeper revision 1.1159.258.4 (420e086eRqMDAepFfVSrE8gAuTZ1dg)

Merge maf46@ssh-relay1.cl.cam.ac.uk:/usr/groups/xeno/BK/xen-2.0-testing.bk
into fleming.research:/scratch/fleming/mafetter/xen-2.0-testing.bk
author mafetter@fleming.research
date Sat Feb 12 13:45:18 2005 +0000 (2005-02-12)
parents a63c03fcda8f 4b4a77f35103
children 2e88f4d9217f b0a8660dc6fd
files xen/arch/x86/memory.c xen/arch/x86/shadow.c xen/include/asm-x86/shadow.h xen/include/xen/perfc_defn.h
line diff
     1.1 --- a/xen/arch/x86/memory.c	Sat Feb 12 01:30:21 2005 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Sat Feb 12 13:45:18 2005 +0000
     1.3 @@ -1573,10 +1573,26 @@ int do_update_va_mapping(unsigned long p
     1.4              &shadow_linear_pg_table[page_nr])))) )
     1.5          {
     1.6              /*
     1.7 -             * Since L2's are guranteed RW, failure indicates the page was not 
     1.8 -             * shadowed, so ignore.
     1.9 +             * Since L2's are guranteed RW, failure indicates either that the
    1.10 +             * page was not shadowed, or that the L2 entry has not yet been
    1.11 +             * updated to reflect the shadow.
    1.12               */
    1.13 -            perfc_incrc(shadow_update_va_fail);
    1.14 +            unsigned l2_idx = page_nr >> (L2_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT);
    1.15 +            l2_pgentry_t gpde = linear_l2_table[l2_idx];
    1.16 +            unsigned long gpfn = l2_pgentry_val(gpde) >> PAGE_SHIFT;
    1.17 +
    1.18 +            if (get_shadow_status(&d->mm, gpfn))
    1.19 +            {
    1.20 +                unsigned long *gl1e = map_domain_mem(gpfn << PAGE_SHIFT);
    1.21 +                unsigned l1_idx = page_nr & (ENTRIES_PER_L1_PAGETABLE - 1);
    1.22 +                gl1e[l1_idx] = sval;
    1.23 +                unmap_domain_mem(gl1e);
    1.24 +                put_shadow_status(&d->mm);
    1.25 +
    1.26 +                perfc_incrc(shadow_update_va_fail1);
    1.27 +            }
    1.28 +            else
    1.29 +                perfc_incrc(shadow_update_va_fail2);
    1.30          }
    1.31  
    1.32          /*
     2.1 --- a/xen/arch/x86/shadow.c	Sat Feb 12 01:30:21 2005 +0000
     2.2 +++ b/xen/arch/x86/shadow.c	Sat Feb 12 13:45:18 2005 +0000
     2.3 @@ -794,7 +794,7 @@ static int check_l1_table(
     2.4          BUG();                                                 \
     2.5      } while ( 0 )
     2.6  
     2.7 -int check_pagetable(struct mm_struct *m, pagetable_t pt, char *s)
     2.8 +int _check_pagetable(struct mm_struct *m, pagetable_t pt, char *s)
     2.9  {
    2.10      unsigned long gptbase = pagetable_val(pt);
    2.11      unsigned long gpfn, spfn;
     3.1 --- a/xen/include/asm-x86/shadow.h	Sat Feb 12 01:30:21 2005 +0000
     3.2 +++ b/xen/include/asm-x86/shadow.h	Sat Feb 12 13:45:18 2005 +0000
     3.3 @@ -573,7 +573,8 @@ static inline void shadow_mk_pagetable(s
     3.4  }
     3.5  
     3.6  #if SHADOW_DEBUG
     3.7 -extern int check_pagetable(struct mm_struct *m, pagetable_t pt, char *s);
     3.8 +extern int _check_pagetable(struct mm_struct *m, pagetable_t pt, char *s);
     3.9 +#define check_pagetable(m, pt, s) _check_pagetable(m, pt, s)
    3.10  #else
    3.11  #define check_pagetable(m, pt, s) ((void)0)
    3.12  #endif
     4.1 --- a/xen/include/xen/perfc_defn.h	Sat Feb 12 01:30:21 2005 +0000
     4.2 +++ b/xen/include/xen/perfc_defn.h	Sat Feb 12 13:45:18 2005 +0000
     4.3 @@ -25,7 +25,8 @@ PERFCOUNTER_CPU( shadow_l2_table_count, 
     4.4  PERFCOUNTER_CPU( shadow_l1_table_count, "shadow_l1_table count" )
     4.5  PERFCOUNTER_CPU( unshadow_table_count, "unshadow_table count" )
     4.6  PERFCOUNTER_CPU( shadow_fixup_count, "shadow_fixup count" )
     4.7 -PERFCOUNTER_CPU( shadow_update_va_fail, "shadow_update_va_fail" )
     4.8 +PERFCOUNTER_CPU( shadow_update_va_fail1, "shadow_update_va_fail1" )
     4.9 +PERFCOUNTER_CPU( shadow_update_va_fail2, "shadow_update_va_fail2" )
    4.10  
    4.11  /* STATUS counters do not reset when 'P' is hit */
    4.12  PERFSTATUS( shadow_l2_pages, "current # shadow L2 pages" )