ia64/xen-unstable

changeset 18005:06bcd8f622c8

x86 p2m superpage fix: Re-insert missing shadow code from the original
patch that was submitted to xen-devel, to remove mappings when we're
removing a p2m 2mb page.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jul 09 11:02:37 2008 +0100 (2008-07-09)
parents 830e5d8b71da
children f3afb8625a92
files xen/arch/x86/mm/shadow/common.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/common.c	Wed Jul 09 10:41:49 2008 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/common.c	Wed Jul 09 11:02:37 2008 +0100
     1.3 @@ -3354,6 +3354,26 @@ shadow_write_p2m_entry(struct vcpu *v, u
     1.4          }
     1.5      }
     1.6  
     1.7 +    /* If we're removing a superpage mapping from the p2m, remove all the
     1.8 +     * MFNs covered by it from the shadows too. */
     1.9 +    if ( level == 2 && (l1e_get_flags(*p) & _PAGE_PRESENT) &&
    1.10 +         (l1e_get_flags(*p) & _PAGE_PSE) )
    1.11 +    {
    1.12 +        unsigned int i;
    1.13 +        mfn_t mfn = _mfn(l1e_get_pfn(*p));
    1.14 +        p2m_type_t p2mt = p2m_flags_to_type(l1e_get_flags(*p));
    1.15 +        if ( p2m_is_valid(p2mt) && mfn_valid(mfn) )
    1.16 +        {
    1.17 +            for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
    1.18 +            {
    1.19 +                sh_remove_all_shadows_and_parents(v, mfn);
    1.20 +                if ( sh_remove_all_mappings(v, mfn) )
    1.21 +                    flush_tlb_mask(d->domain_dirty_cpumask);
    1.22 +                mfn = _mfn(mfn_x(mfn) + 1);
    1.23 +            }
    1.24 +        }
    1.25 +    }
    1.26 +
    1.27      /* Update the entry with new content */
    1.28      safe_write_pte(p, new);
    1.29