ia64/xen-unstable

changeset 3829:e548686e513d

bitkeeper revision 1.1196.1.1 (4210949fd4uhxJmk2kIDASV8WbY-4w)

Minor shadow mode cleanups.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Mon Feb 14 12:07:59 2005 +0000 (2005-02-14)
parents 1413266e3117
children f9224ed982ae
files xen/arch/x86/shadow.c xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Sat Feb 12 21:10:50 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow.c	Mon Feb 14 12:07:59 2005 +0000
     1.3 @@ -512,8 +512,8 @@ static void shadow_map_l1_into_current_l
     1.4  { 
     1.5      struct exec_domain *ed = current;
     1.6      struct domain *d = ed->domain;
     1.7 -    unsigned long    *gpl1e, *spl1e, gl2e, sl2e, gl1pfn, sl1pfn=0, sl1ss;
     1.8 -    struct pfn_info  *sl1pfn_info;
     1.9 +    unsigned long    *gpl1e, *spl1e, gl2e, sl2e, gl1pfn, sl1mfn, sl1ss;
    1.10 +    struct pfn_info  *sl1mfn_info;
    1.11      int               i;
    1.12  
    1.13      __guest_get_l2e(ed, va, &gl2e);
    1.14 @@ -526,17 +526,17 @@ static void shadow_map_l1_into_current_l
    1.15          /* This L1 is NOT already shadowed so we need to shadow it. */
    1.16          SH_VVLOG("4a: l1 not shadowed ( %p )", sl1pfn);
    1.17  
    1.18 -        sl1pfn_info = alloc_shadow_page(d);
    1.19 -        sl1pfn_info->u.inuse.type_info = PGT_l1_page_table;
    1.20 +        sl1mfn_info = alloc_shadow_page(d);
    1.21 +        sl1mfn_info->u.inuse.type_info = PGT_l1_page_table;
    1.22     
    1.23 -        sl1pfn = sl1pfn_info - frame_table;
    1.24 +        sl1mfn = sl1mfn_info - frame_table;
    1.25  
    1.26          perfc_incrc(shadow_l1_table_count);
    1.27          perfc_incr(shadow_l1_pages);
    1.28  
    1.29 -        set_shadow_status(d, gl1pfn, PSH_shadowed | sl1pfn);
    1.30 +        set_shadow_status(d, gl1pfn, PSH_shadowed | sl1mfn);
    1.31  
    1.32 -        l2pde_general(d, &gl2e, &sl2e, sl1pfn);
    1.33 +        l2pde_general(d, &gl2e, &sl2e, sl1mfn);
    1.34  
    1.35          __guest_set_l2e(ed, va, gl2e);
    1.36          __shadow_set_l2e(ed, va, sl2e);
    1.37 @@ -553,10 +553,10 @@ static void shadow_map_l1_into_current_l
    1.38      else
    1.39      {
    1.40          /* This L1 is shadowed already, but the L2 entry is missing. */
    1.41 -        SH_VVLOG("4b: was shadowed, l2 missing ( %p )", sl1pfn);
    1.42 +        SH_VVLOG("4b: was shadowed, l2 missing ( %p )", sl1ss);
    1.43  
    1.44 -        sl1pfn = sl1ss & PSH_pfn_mask;
    1.45 -        l2pde_general(d, &gl2e, &sl2e, sl1pfn);
    1.46 +        sl1mfn = sl1ss & PSH_pfn_mask;
    1.47 +        l2pde_general(d, &gl2e, &sl2e, sl1mfn);
    1.48          __guest_set_l2e(ed, va, gl2e);
    1.49          __shadow_set_l2e(ed, va, sl2e);
    1.50      }              
     2.1 --- a/xen/arch/x86/traps.c	Sat Feb 12 21:10:50 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Mon Feb 14 12:07:59 2005 +0000
     2.3 @@ -286,7 +286,7 @@ asmlinkage int do_page_fault(struct xen_
     2.4               ((regs->error_code & 3) == 3) && /* write-protection fault */
     2.5               ptwr_do_page_fault(addr) )
     2.6          {
     2.7 -            if ( unlikely(d->arch.shadow_mode) )
     2.8 +            if ( unlikely(shadow_mode(d)) )
     2.9                  (void)shadow_fault(addr, regs->error_code);
    2.10              UNLOCK_BIGLOCK(d);
    2.11              return EXCRET_fault_fixed;
    2.12 @@ -294,7 +294,7 @@ asmlinkage int do_page_fault(struct xen_
    2.13          UNLOCK_BIGLOCK(d);
    2.14      }
    2.15  
    2.16 -    if ( unlikely(d->arch.shadow_mode) && 
    2.17 +    if ( unlikely(shadow_mode(d)) && 
    2.18           (addr < PAGE_OFFSET) && shadow_fault(addr, regs->error_code) )
    2.19          return EXCRET_fault_fixed;
    2.20  
    2.21 @@ -330,7 +330,7 @@ asmlinkage int do_page_fault(struct xen_
    2.22      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    2.23      {
    2.24          perfc_incrc(copy_user_faults);
    2.25 -        if ( !d->arch.shadow_mode )
    2.26 +        if ( !shadow_mode(d) )
    2.27              DPRINTK("Page fault: %p -> %p\n", regs->eip, fixup);
    2.28          regs->eip = fixup;
    2.29          return 0;