ia64/xen-unstable

changeset 19161:398291c661b3

x86: No need to flush TLBs on free_page_type() as we no longer trust
the linear pagetable mapping (we use it but we double check it).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 04 14:28:13 2009 +0000 (2009-02-04)
parents faf20eb0b69e
children 271697e6d9b2
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Feb 04 13:27:17 2009 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Feb 04 14:28:13 2009 +0000
     1.3 @@ -2023,30 +2023,17 @@ int free_page_type(struct page_info *pag
     1.4      unsigned long gmfn;
     1.5      int rc;
     1.6  
     1.7 -    if ( likely(owner != NULL) )
     1.8 +    if ( likely(owner != NULL) && unlikely(paging_mode_enabled(owner)) )
     1.9      {
    1.10 -        /*
    1.11 -         * We have to flush before the next use of the linear mapping
    1.12 -         * (e.g., update_va_mapping()) or we could end up modifying a page
    1.13 -         * that is no longer a page table (and hence screw up ref counts).
    1.14 -         */
    1.15 -        if ( current->domain == owner )
    1.16 -            queue_deferred_ops(owner, DOP_FLUSH_ALL_TLBS);
    1.17 -        else
    1.18 -            flush_tlb_mask(owner->domain_dirty_cpumask);
    1.19 -
    1.20 -        if ( unlikely(paging_mode_enabled(owner)) )
    1.21 -        {
    1.22 -            /* A page table is dirtied when its type count becomes zero. */
    1.23 -            paging_mark_dirty(owner, page_to_mfn(page));
    1.24 -
    1.25 -            if ( shadow_mode_refcounts(owner) )
    1.26 -                return 0;
    1.27 -
    1.28 -            gmfn = mfn_to_gmfn(owner, page_to_mfn(page));
    1.29 -            ASSERT(VALID_M2P(gmfn));
    1.30 -            shadow_remove_all_shadows(owner->vcpu[0], _mfn(gmfn));
    1.31 -        }
    1.32 +        /* A page table is dirtied when its type count becomes zero. */
    1.33 +        paging_mark_dirty(owner, page_to_mfn(page));
    1.34 +
    1.35 +        if ( shadow_mode_refcounts(owner) )
    1.36 +            return 0;
    1.37 +
    1.38 +        gmfn = mfn_to_gmfn(owner, page_to_mfn(page));
    1.39 +        ASSERT(VALID_M2P(gmfn));
    1.40 +        shadow_remove_all_shadows(owner->vcpu[0], _mfn(gmfn));
    1.41      }
    1.42  
    1.43      if ( !(type & PGT_partial) )