WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] fix gmfn_to_mfn

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix gmfn_to_mfn
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 9 May 2008 15:07:53 +0900
Delivery-date: Thu, 08 May 2008 23:08:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
gmfn_to_mfn should return INVALID_MFN when the gpfn is I/O page.
Using PV on HVM, I got the following error message.

(XEN) /xen/include/asm/mm.h:181:d2 Error pfn 2: rd=f000000007fb4080, 
od=0000000000000000, caf=0000000000000000, taf=0000000000000000
(XEN) memory.c:165:d2 Bad page free for domain 2

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r f2457c7aff8d xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Fri Apr 25 20:13:52 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Fri May 09 15:01:54 2008 +0900
@@ -494,6 +494,10 @@ gmfn_to_mfn_foreign(struct domain *d, un
        if (!pte) {
                panic("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
        }
+
+       if ((pte & _PAGE_IO) && is_hvm_domain(d))
+               return INVALID_MFN;
+
        return ((pte & _PFN_MASK) >> PAGE_SHIFT);
 }
 
@@ -2838,7 +2842,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(
             goto out;
 
         /* Remove previously mapped page if it was present. */
-        if (prev_mfn && mfn_valid(prev_mfn)) {
+        if (mfn_valid(prev_mfn)) {
             if (is_xen_heap_mfn(prev_mfn))
                 /* Xen heap frames are simply unhooked from this phys slot. */
                 guest_physmap_remove_page(d, xatp.gpfn, prev_mfn);
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel