ia64/xen-unstable

changeset 14175:5943a8314d69

[XEN] Make the compat-mode l4 page table look more like a page table
and remove some special-case code in the shadows.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Wed Feb 28 13:17:27 2007 +0000 (2007-02-28)
parents 9edd8d7c9355
children f3271ae6a485
files xen/arch/x86/domain.c xen/arch/x86/mm/shadow/common.c xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Feb 28 10:40:52 2007 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Feb 28 13:17:27 2007 +0000
     1.3 @@ -229,6 +229,10 @@ static int setup_compat_l4(struct vcpu *
     1.4  
     1.5      if ( !pg )
     1.6          return -ENOMEM;
     1.7 +
     1.8 +    /* This page needs to look like a pagetable so that it can be shadowed */
     1.9 +    pg->u.inuse.type_info = PGT_l4_page_table|PGT_validated;
    1.10 +
    1.11      l4tab = copy_page(page_to_virt(pg), idle_pg_table);
    1.12      l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
    1.13          l4e_from_page(pg, __PAGE_HYPERVISOR);
     2.1 --- a/xen/arch/x86/mm/shadow/common.c	Wed Feb 28 10:40:52 2007 +0000
     2.2 +++ b/xen/arch/x86/mm/shadow/common.c	Wed Feb 28 13:17:27 2007 +0000
     2.3 @@ -489,11 +489,7 @@ void shadow_demote(struct vcpu *v, mfn_t
     2.4  {
     2.5      struct page_info *page = mfn_to_page(gmfn);
     2.6  
     2.7 -#ifdef CONFIG_COMPAT
     2.8 -    if ( !IS_COMPAT(v->domain) || type != SH_type_l4_64_shadow )
     2.9 -#endif
    2.10 -        ASSERT(test_bit(_PGC_page_table, &page->count_info));
    2.11 -
    2.12 +    ASSERT(test_bit(_PGC_page_table, &page->count_info));
    2.13      ASSERT(test_bit(type, &page->shadow_flags));
    2.14  
    2.15      clear_bit(type, &page->shadow_flags);
    2.16 @@ -1625,6 +1621,7 @@ void sh_destroy_shadow(struct vcpu *v, m
    2.17          break;
    2.18      case SH_type_l2h_64_shadow:
    2.19          ASSERT( IS_COMPAT(v->domain) );
    2.20 +        /* Fall through... */
    2.21      case SH_type_l2_64_shadow:
    2.22          SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 4, 4)(v, smfn);
    2.23          break;
     3.1 --- a/xen/arch/x86/mm/shadow/multi.c	Wed Feb 28 10:40:52 2007 +0000
     3.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Wed Feb 28 13:17:27 2007 +0000
     3.3 @@ -3368,16 +3368,11 @@ sh_set_toplevel_shadow(struct vcpu *v,
     3.4      
     3.5  #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
     3.6      /* Once again OK to unhook entries from this table if we see fork/exit */
     3.7 -#if CONFIG_PAGING_LEVELS == 4
     3.8 -    if ( IS_COMPAT(d) )
     3.9 -        ASSERT(!sh_mfn_is_a_page_table(gmfn));
    3.10 -    else
    3.11 -#endif
    3.12 -        ASSERT(sh_mfn_is_a_page_table(gmfn));
    3.13 +    ASSERT(sh_mfn_is_a_page_table(gmfn));
    3.14      mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings;
    3.15  #endif
    3.16  
    3.17 -    /* Pin the shadow and put it (back) on the list of top-level shadows */
    3.18 +    /* Pin the shadow and put it (back) on the list of pinned shadows */
    3.19      if ( sh_pin(v, smfn) == 0 )
    3.20      {
    3.21          SHADOW_ERROR("can't pin %#lx as toplevel shadow\n", mfn_x(smfn));