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/
Home Products Support Community News


[Xen-devel] [PATCH] xen: update machine_to_phys_order on resume

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen: update machine_to_phys_order on resume
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Tue, 12 Jul 2011 18:43:42 +0200
Delivery-date: Tue, 12 Jul 2011 09:44:31 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1310489026; l=1753; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=ZbvsGn3CXKYfFh+dw/ndSdoAXbc=; b=e/wX+WMQ/WIwwaqNs5bfkPVeaq7k45UcmBjffOlDlOeTg65xMmVrXpllzABEkRt8xKP C1PQIP6OJ7SikFanwt3N5jGc6HPWaXQMhDNmvzorsvzgtbbyYVNvUWf69nQTNQqSZ/P6b SNA58rSPQYnXYU/rr7ShByKRwknTo4rgAHk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110701104148.GA32729@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110701104148.GA32729@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21.rev5535 (2011-07-01)
Migration of pv guests fails, the guest crashes on the target host once the
guest is unpaused after transit. It happens when the guest is started on a
small systen, then migrated from that small system to a large system.
If the guest is started on a large system, then migrated to a small system and
back to the large system, the migration will be successful.

The issue is that mfn_to_pfn() makes use of machine_to_phys_order, which
is only configured once early in the boot process. After migration to a
large host the mfns will exceed the order from the small system and a
wrong code path is taken.

Calling xen_setup_machphys_mapping() again in the resume path will avoid
the crash.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

 arch/x86/xen/mmu.c     |    2 +-
 arch/x86/xen/suspend.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Index: linux-3.0-rc7/arch/x86/xen/mmu.c
--- linux-3.0-rc7.orig/arch/x86/xen/mmu.c
+++ linux-3.0-rc7/arch/x86/xen/mmu.c
@@ -1623,7 +1623,7 @@ static void __init xen_map_identity_earl
        set_page_prot(pmd, PAGE_KERNEL_RO);
-void __init xen_setup_machphys_mapping(void)
+void xen_setup_machphys_mapping(void)
        struct xen_machphys_mapping mapping;
        unsigned long machine_to_phys_nr_ents;
Index: linux-3.0-rc7/arch/x86/xen/suspend.c
--- linux-3.0-rc7.orig/arch/x86/xen/suspend.c
+++ linux-3.0-rc7/arch/x86/xen/suspend.c
@@ -43,6 +43,8 @@ void xen_arch_hvm_post_suspend(int suspe
 void xen_arch_post_suspend(int suspend_cancelled)
+       xen_setup_machphys_mapping();

Xen-devel mailing list