From: Kamala Narasimhan Date: Wed, 22 Apr 2009 14:53:27 +0000 (-0400) Subject: Backport Gianluca's mfn validity check patch. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d9163f86140207383107c2864adf8697c9498c7f;p=xenclient%2Fxen-pq.git Backport Gianluca's mfn validity check patch. This should fix the system reset upon PVM spawn issue encountered on some systems. --- diff --git a/xen-3.4/mfn-validity-check-before-shadow-remove b/xen-3.4/mfn-validity-check-before-shadow-remove new file mode 100644 index 0000000..cb75b6e --- /dev/null +++ b/xen-3.4/mfn-validity-check-before-shadow-remove @@ -0,0 +1,18 @@ +diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c +index ca4cb13..71bfe27 100644 +--- a/xen/arch/x86/mm/shadow/common.c ++++ b/xen/arch/x86/mm/shadow/common.c +@@ -2730,6 +2730,13 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all) + + ASSERT(!(all && fast)); + ++ if ( unlikely(!mfn_valid(gmfn)) ) ++ { ++ /* Get out now if we're trying to remove shadows of a MMIO ++ * direct page. */ ++ return; ++ } ++ + /* Although this is an externally visible function, we do not know + * whether the shadow lock will be held when it is called (since it + * can be called via put_page_type when we clear a shadow l1e). diff --git a/xen-3.4/series b/xen-3.4/series index 7dca55d..659e1b1 100644 --- a/xen-3.4/series +++ b/xen-3.4/series @@ -7,3 +7,4 @@ thermal-management pt-load-vga-bios init-vgabios-and-set-size module-reloc +mfn-validity-check-before-shadow-remove