direct-io.hg

changeset 4274:d1854f84c551

bitkeeper revision 1.1257 (424166b1-4aA-sSJbmTizuGjdmiSWg)

Don't fully populate the shadow for every L1 we map.
Only populate the demanded entry in the L1, and then from entry 0 up to the
first invalid entry.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Wed Mar 23 12:53:05 2005 +0000 (2005-03-23)
parents 3b80053b6d5a
children 0c149b605692
files BitKeeper/etc/ignore xen/arch/x86/shadow.c xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/BitKeeper/etc/ignore	Wed Mar 23 12:50:40 2005 +0000
     1.2 +++ b/BitKeeper/etc/ignore	Wed Mar 23 12:53:05 2005 +0000
     1.3 @@ -101,3 +101,6 @@ xen/tools/figlet/figlet
     1.4  xen/xen
     1.5  xen/xen-syms
     1.6  xen/xen.*
     1.7 +tools/misc/cpuperf/cpuperf-perfcntr
     1.8 +tools/misc/cpuperf/cpuperf-xen
     1.9 +tools/misc/xc_shadow
     2.1 --- a/xen/arch/x86/shadow.c	Wed Mar 23 12:50:40 2005 +0000
     2.2 +++ b/xen/arch/x86/shadow.c	Wed Mar 23 12:53:05 2005 +0000
     2.3 @@ -1427,14 +1427,27 @@ void shadow_map_l1_into_current_l2(unsig
     2.4              &(shadow_linear_pg_table[l1_linear_offset(va) &
     2.5                                       ~(L1_PAGETABLE_ENTRIES-1)]);
     2.6  
     2.7 +        memset(spl1e, 0, PAGE_SIZE);
     2.8 +
     2.9 +        unsigned long sl1e;
    2.10 +        int index = l1_table_offset(va);
    2.11 +
    2.12 +        l1pte_propagate_from_guest(d, gpl1e[index], &sl1e);
    2.13 +        if ( (sl1e & _PAGE_PRESENT) &&
    2.14 +             !shadow_get_page_from_l1e(mk_l1_pgentry(sl1e), d) )
    2.15 +            sl1e = 0;
    2.16 +        spl1e[index] = sl1e;
    2.17 +
    2.18          for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
    2.19          {
    2.20 -            unsigned long sl1e;
    2.21 -
    2.22 +            if ( i == index )
    2.23 +                continue;
    2.24              l1pte_propagate_from_guest(d, gpl1e[i], &sl1e);
    2.25              if ( (sl1e & _PAGE_PRESENT) &&
    2.26                   !shadow_get_page_from_l1e(mk_l1_pgentry(sl1e), d) )
    2.27                  sl1e = 0;
    2.28 +            if ( sl1e == 0 )
    2.29 +                break;
    2.30              spl1e[i] = sl1e;
    2.31          }
    2.32      }
     3.1 --- a/xen/include/asm-x86/shadow.h	Wed Mar 23 12:50:40 2005 +0000
     3.2 +++ b/xen/include/asm-x86/shadow.h	Wed Mar 23 12:53:05 2005 +0000
     3.3 @@ -609,14 +609,13 @@ static inline int l1pte_read_fault(
     3.4  static inline void l1pte_propagate_from_guest(
     3.5      struct domain *d, unsigned long gpte, unsigned long *spte_p)
     3.6  { 
     3.7 -    unsigned long pfn = gpte >> PAGE_SHIFT;
     3.8      unsigned long mfn, spte;
     3.9  
    3.10      spte = 0;
    3.11  
    3.12      if ( ((gpte & (_PAGE_PRESENT|_PAGE_ACCESSED) ) ==
    3.13            (_PAGE_PRESENT|_PAGE_ACCESSED)) &&
    3.14 -         VALID_MFN(mfn = __gpfn_to_mfn(d, pfn)) )
    3.15 +         VALID_MFN(mfn = __gpfn_to_mfn(d, gpte >> PAGE_SHIFT)) )
    3.16      {
    3.17          spte = (mfn << PAGE_SHIFT) | (gpte & ~PAGE_MASK);
    3.18