ia64/xen-unstable

changeset 4953:939209814d75

bitkeeper revision 1.1430 (4289ef91cnLSZ2abQmRijAYRLrwMjQ)

Bug fix for shadow external mode (i.e. VMX) operation,
fixing an overly aggressive new ASSERT added with the light weight
shadow code.
author maf46@burn.cl.cam.ac.uk
date Tue May 17 13:20:17 2005 +0000 (2005-05-17)
parents 3b25e1de5efb
children 85f5f11a202e
files xen/arch/x86/domain.c xen/arch/x86/shadow.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Tue May 17 10:52:08 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Tue May 17 13:20:17 2005 +0000
     1.3 @@ -364,7 +364,8 @@ static int vmx_final_setup_guest(
     1.4          /* Put the domain in shadow mode even though we're going to be using
     1.5           * the shared 1:1 page table initially. It shouldn't hurt */
     1.6          shadow_mode_enable(ed->domain,
     1.7 -                           SHM_enable|SHM_refcounts|SHM_translate|SHM_external);
     1.8 +                           SHM_enable|SHM_write_all|SHM_refcounts|
     1.9 +                           SHM_translate|SHM_external);
    1.10      }
    1.11  
    1.12      return 0;
     2.1 --- a/xen/arch/x86/shadow.c	Tue May 17 10:52:08 2005 +0000
     2.2 +++ b/xen/arch/x86/shadow.c	Tue May 17 13:20:17 2005 +0000
     2.3 @@ -2307,9 +2307,10 @@ static int resync_all(struct domain *d, 
     2.4              // guest page.
     2.5              // This only applies when we have writable page tables.
     2.6              //
     2.7 -            if ( (stype == PGT_l1_shadow) && !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) )
     2.8 -                continue;
     2.9 -            if ( (stype != PGT_l1_shadow) && !shadow_mode_write_all(d) )
    2.10 +            if ( !shadow_mode_write_all(d) &&
    2.11 +                 !((stype == PGT_l1_shadow) &&
    2.12 +                   VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
    2.13 +                // Page is not writable -- no resync necessary
    2.14                  continue;
    2.15          }
    2.16  
    2.17 @@ -2336,7 +2337,8 @@ static int resync_all(struct domain *d, 
    2.18              l1_pgentry_t *shadow1 = shadow;
    2.19              l1_pgentry_t *snapshot1 = snapshot;
    2.20  
    2.21 -            ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables));
    2.22 +            ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables) ||
    2.23 +                   shadow_mode_write_all(d));
    2.24  
    2.25              if ( !shadow_mode_refcounts(d) )
    2.26                  revalidate_l1(d, guest1, snapshot1);