ia64/xen-unstable

changeset 18492:c353f07bae84

x86, shadow: Allow removing writable mappings from splintered page tables.

The moving of the pagetable mapping in the linux kernel exposed the
fact that under the linux kernel sh_rm_write_access_from_sl1p was
always failing.

Linux seems to use big pages to access page tables, so we should
instruct the shadow code to be able to remove writable mappings from
splintered pagetables as well, avoiding using OS heuristic (which were
failing in 2.6.27 before George patch, leading to brute-force search
at each resync).

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 15 11:34:42 2008 +0100 (2008-09-15)
parents 8f456fcd8af1
children 01fb29f72832
files xen/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Sat Sep 13 08:15:26 2008 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Mon Sep 15 11:34:42 2008 +0100
     1.3 @@ -2464,22 +2464,25 @@ int sh_remove_write_access_from_sl1p(str
     1.4      ASSERT(mfn_valid(smfn));
     1.5      ASSERT(mfn_valid(gmfn));
     1.6      
     1.7 -    if ( sp->type == SH_type_l1_32_shadow )
     1.8 +    if ( sp->type == SH_type_l1_32_shadow
     1.9 +         || sp->type == SH_type_fl1_32_shadow )
    1.10      {
    1.11          return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,2)
    1.12              (v, gmfn, smfn, off);
    1.13      }
    1.14  #if CONFIG_PAGING_LEVELS >= 3
    1.15 -    else if ( sp->type == SH_type_l1_pae_shadow )
    1.16 +    else if ( sp->type == SH_type_l1_pae_shadow
    1.17 +              || sp->type == SH_type_fl1_pae_shadow )
    1.18          return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,3)
    1.19              (v, gmfn, smfn, off);
    1.20  #if CONFIG_PAGING_LEVELS >= 4
    1.21 -    else if ( sp->type == SH_type_l1_64_shadow )
    1.22 +    else if ( sp->type == SH_type_l1_64_shadow
    1.23 +              || sp->type == SH_type_fl1_64_shadow )
    1.24          return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p,4)
    1.25              (v, gmfn, smfn, off);
    1.26  #endif
    1.27  #endif
    1.28 -    
    1.29 +
    1.30      return 0;
    1.31  }
    1.32  #endif 
     2.1 --- a/xen/arch/x86/mm/shadow/multi.c	Sat Sep 13 08:15:26 2008 +0100
     2.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Mon Sep 15 11:34:42 2008 +0100
     2.3 @@ -4539,7 +4539,8 @@ int sh_rm_write_access_from_sl1p(struct 
     2.4      sp = mfn_to_shadow_page(smfn);
     2.5  
     2.6      if ( sp->mbz != 0
     2.7 -         || (sp->type != SH_type_l1_shadow) )
     2.8 +         || (sp->type != SH_type_l1_shadow
     2.9 +             && sp->type != SH_type_fl1_shadow) )
    2.10          goto fail;
    2.11  
    2.12      sl1p = sh_map_domain_page(smfn);