From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhai, Edwin" Subject: [PATCH] [HVM] fix HVM restore hang Date: Tue, 18 Nov 2008 19:52:04 +0800 Message-ID: <4922AC64.8030902@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040807070500010203070106" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Developers , "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040807070500010203070106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit r18383 mark video memory as ram, and make all valid pages migrated, including vlapic page (0xFEE00), and share page(0xFFFFF). An extra memory population for lapic page would override previous mapping then cause HVM guest with vlapic acceleration hang. This patch from Keir makes mmio page as invalid, so xc_domain_save skip vlapic page. Share page is safe, as the mapping is not set up until after normal guest memory is restored. -- best rgds, edwin --------------040807070500010203070106 Content-Type: text/plain; name="hvm_sr_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hvm_sr_fix.patch" Index: hv/xen/arch/x86/mm.c =================================================================== --- hv.orig/xen/arch/x86/mm.c +++ hv/xen/arch/x86/mm.c @@ -1542,6 +1542,7 @@ static int mod_l1_entry(l1_pgentry_t *pl unsigned long mfn; struct page_info *l1pg = mfn_to_page(gl1mfn); int rc = 1; + p2m_type_t p2mt; page_lock(l1pg); @@ -1558,8 +1559,8 @@ static int mod_l1_entry(l1_pgentry_t *pl if ( l1e_get_flags(nl1e) & _PAGE_PRESENT ) { /* Translate foreign guest addresses. */ - mfn = gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e)); - if ( unlikely(mfn == INVALID_MFN) ) + mfn = gfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e), &p2mt); + if ( !p2m_is_ram(p2mt) || unlikely(mfn == INVALID_MFN) ) return page_unlock(l1pg), 0; ASSERT((mfn & ~(PADDR_MASK >> PAGE_SHIFT)) == 0); nl1e = l1e_from_pfn(mfn, l1e_get_flags(nl1e)); --------------040807070500010203070106 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040807070500010203070106--