direct-io.hg

changeset 7392:9d9b75569d0e

Fix invalidation of shadow LDT on SMP systems.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Oct 15 16:26:03 2005 +0100 (2005-10-15)
parents 9d51c5afda92
children 475e2a8493b8
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Sat Oct 15 16:25:29 2005 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Sat Oct 15 16:26:03 2005 +0100
     1.3 @@ -582,6 +582,7 @@ void put_page_from_l1e(l1_pgentry_t l1e,
     1.4      unsigned long    pfn  = l1e_get_pfn(l1e);
     1.5      struct pfn_info *page = &frame_table[pfn];
     1.6      struct domain   *e;
     1.7 +    struct vcpu     *v;
     1.8  
     1.9      if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) || !pfn_valid(pfn) )
    1.10          return;
    1.11 @@ -615,10 +616,12 @@ void put_page_from_l1e(l1_pgentry_t l1e,
    1.12          /* We expect this is rare so we blow the entire shadow LDT. */
    1.13          if ( unlikely(((page->u.inuse.type_info & PGT_type_mask) == 
    1.14                         PGT_ldt_page)) &&
    1.15 -             unlikely(((page->u.inuse.type_info & PGT_count_mask) != 0)) )
    1.16 -
    1.17 -            // XXX SMP BUG?
    1.18 -            invalidate_shadow_ldt(e->vcpu[0]);
    1.19 +             unlikely(((page->u.inuse.type_info & PGT_count_mask) != 0)) &&
    1.20 +             (d == e) )
    1.21 +        {
    1.22 +            for_each_vcpu ( d, v )
    1.23 +                invalidate_shadow_ldt(v);
    1.24 +        }
    1.25          put_page(page);
    1.26      }
    1.27  }
    1.28 @@ -1311,7 +1314,7 @@ void free_page_type(struct pfn_info *pag
    1.29          }
    1.30      }
    1.31  
    1.32 -    switch (type  & PGT_type_mask)
    1.33 +    switch ( type & PGT_type_mask )
    1.34      {
    1.35      case PGT_l1_page_table:
    1.36          free_l1_table(page);