ia64/xen-unstable

changeset 4152:9a43f31bae0a

bitkeeper revision 1.1236.33.3 (4236d576pkc2uu_icflDqtaz0FvliA)

Bug fix for shadow_get_page_from_l1e(). Don't try to look for the
owner of an invalid mfn.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Tue Mar 15 12:30:46 2005 +0000 (2005-03-15)
parents 5f0125b2f3a9
children 4ff298f651de
files xen/arch/x86/shadow.c xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Tue Mar 15 10:12:39 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow.c	Tue Mar 15 12:30:46 2005 +0000
     1.3 @@ -1724,7 +1724,8 @@ void __shadow_sync_all(struct domain *d)
     1.4          unsigned long opte = *ppte;
     1.5          unsigned long npte = opte & ~_PAGE_RW;
     1.6  
     1.7 -        shadow_get_page_from_l1e(mk_l1_pgentry(npte), d);
     1.8 +        if ( npte & _PAGE_PRESENT)
     1.9 +            shadow_get_page_from_l1e(mk_l1_pgentry(npte), d);
    1.10          *ppte = npte;
    1.11          put_page_from_l1e(mk_l1_pgentry(opte), d);
    1.12  
     2.1 --- a/xen/include/asm-x86/shadow.h	Tue Mar 15 10:12:39 2005 +0000
     2.2 +++ b/xen/include/asm-x86/shadow.h	Tue Mar 15 12:30:46 2005 +0000
     2.3 @@ -246,9 +246,15 @@ static inline int
     2.4  shadow_get_page_from_l1e(l1_pgentry_t l1e, struct domain *d)
     2.5  {
     2.6      int res = get_page_from_l1e(l1e, d);
     2.7 +    unsigned long mfn;
     2.8      struct domain *owner;
     2.9  
    2.10 +    ASSERT( l1_pgentry_val(l1e) & _PAGE_PRESENT );
    2.11 +
    2.12      if ( unlikely(!res) && IS_PRIV(d) && !shadow_mode_translate(d) &&
    2.13 +         !(l1_pgentry_val(l1e) & L1_DISALLOW_MASK) &&
    2.14 +         (mfn = l1_pgentry_to_pfn(l1e)) &&
    2.15 +         pfn_is_ram(mfn) &&
    2.16           (owner = page_get_owner(pfn_to_page(l1_pgentry_to_pfn(l1e)))) &&
    2.17           (d != owner) )
    2.18      {