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
|