ia64/xen-unstable

changeset 17621:14d362d5fa59

x86: Fix fatal page fault when vram dirty logic handles MMIO of passthrough devices.

Signed-off-by: Qing He <qing.he@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon May 12 10:01:01 2008 +0100 (2008-05-12)
parents 810d8c3ac992
children 5c00188dd159
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Thu May 08 16:58:33 2008 +0100
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Mon May 12 10:01:01 2008 +0100
     1.3 @@ -1268,6 +1268,9 @@ static inline void shadow_vram_get_l1e(s
     1.4      if ( !d->dirty_vram ) return;
     1.5  
     1.6      mfn = shadow_l1e_get_mfn(new_sl1e);
     1.7 +
     1.8 +    if ( !mfn_valid(mfn) ) return; /* m2p for mmio_direct may not exist */
     1.9 +
    1.10      gfn = mfn_to_gfn(d, mfn);
    1.11  
    1.12      if ( (gfn >= d->dirty_vram->begin_pfn) && (gfn < d->dirty_vram->end_pfn) ) {
    1.13 @@ -1293,6 +1296,9 @@ static inline void shadow_vram_put_l1e(s
    1.14      if ( !d->dirty_vram ) return;
    1.15  
    1.16      mfn = shadow_l1e_get_mfn(old_sl1e);
    1.17 +
    1.18 +    if ( !mfn_valid(mfn) ) return;
    1.19 +
    1.20      gfn = mfn_to_gfn(d, mfn);
    1.21  
    1.22      if ( (gfn >= d->dirty_vram->begin_pfn) && (gfn < d->dirty_vram->end_pfn) ) {