ia64/xen-unstable

changeset 11545:a151311fa9c7

Ensure page-table pin changes are noted in shadow log-dirty mode.
Also mark dirty in put_page_type() instead of free_page_type()

Signed-off-by: Steven Hand <steven@xensource.com>
author Steven Hand <steven@xensource.com>
date Wed Sep 20 16:22:06 2006 +0100 (2006-09-20)
parents 9837ff37e354
children 596b0e4fbef4
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Sep 20 12:02:13 2006 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Wed Sep 20 16:22:06 2006 +0100
     1.3 @@ -1536,10 +1536,6 @@ void free_page_type(struct page_info *pa
     1.4          if ( unlikely(shadow_mode_enabled(owner)
     1.5                   && !shadow_lock_is_acquired(owner)) )
     1.6          {
     1.7 -            /* Raw page tables are rewritten during save/restore. */
     1.8 -            if ( !shadow_mode_translate(owner) )
     1.9 -                mark_dirty(owner, page_to_mfn(page));
    1.10 -
    1.11              if ( shadow_mode_refcounts(owner) )
    1.12                  return;
    1.13  
    1.14 @@ -1584,6 +1580,7 @@ void free_page_type(struct page_info *pa
    1.15  void put_page_type(struct page_info *page)
    1.16  {
    1.17      unsigned long nx, x, y = page->u.inuse.type_info;
    1.18 +    struct domain *owner = page_get_owner(page);
    1.19  
    1.20   again:
    1.21      do {
    1.22 @@ -1617,6 +1614,18 @@ void put_page_type(struct page_info *pag
    1.23          }
    1.24      }
    1.25      while ( unlikely((y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x) );
    1.26 +
    1.27 +    if( likely(owner != NULL) )
    1.28 +    {
    1.29 +        if (shadow_mode_enabled(owner))
    1.30 +        {
    1.31 +            if (shadow_lock_is_acquired(owner))  /* this is a shadow page */
    1.32 +                return;
    1.33 +
    1.34 +            if (!shadow_mode_translate(owner))
    1.35 +                mark_dirty(owner, page_to_mfn(page));
    1.36 +        }
    1.37 +    }
    1.38  }
    1.39  
    1.40  
    1.41 @@ -1975,7 +1984,10 @@ int do_mmuext_op(
    1.42                  okay = 0;
    1.43                  break;
    1.44              }
    1.45 -            
    1.46 +
    1.47 +            if ( shadow_mode_enabled(d) )
    1.48 +                mark_dirty(d, mfn);
    1.49 +           
    1.50              break;
    1.51  
    1.52          case MMUEXT_UNPIN_TABLE:
    1.53 @@ -1993,11 +2005,7 @@ int do_mmuext_op(
    1.54                  put_page_and_type(page);
    1.55                  put_page(page);
    1.56                  if ( shadow_mode_enabled(d) )
    1.57 -                {
    1.58 -                    shadow_lock(d);
    1.59 -                    shadow_remove_all_shadows(v, _mfn(mfn));
    1.60 -                    shadow_unlock(d);
    1.61 -                }
    1.62 +                    mark_dirty(d, mfn);
    1.63              }
    1.64              else
    1.65              {