All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: [PATCH] xen: update machine_to_phys_order on resume
Date: Tue, 12 Jul 2011 18:43:42 +0200	[thread overview]
Message-ID: <20110712164342.GA12867@aepfle.de> (raw)
In-Reply-To: <20110701104148.GA32729@aepfle.de>


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@aepfle.de>

---
 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_build_mfn_list_list();
 
 	xen_setup_shared_info();

  parent reply	other threads:[~2011-07-12 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 10:41 migration of pv guest fails from small to large host Olaf Hering
2011-07-01 16:20 ` Olaf Hering
2011-07-05 13:46   ` Konrad Rzeszutek Wilk
2011-07-07 13:20     ` Olaf Hering
2011-07-07 18:36       ` Konrad Rzeszutek Wilk
2011-07-07 21:02         ` Olaf Hering
2011-07-12 16:43 ` Olaf Hering [this message]
2011-07-12 18:11   ` [Xen-devel] [PATCH] xen: update machine_to_phys_order on resume Konrad Rzeszutek Wilk
2011-07-13  9:12     ` Ian Campbell
2011-07-13 13:20       ` Konrad Rzeszutek Wilk
2011-07-15  8:56         ` Jan Beulich
2011-07-15 16:05       ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2011-07-13 14:29 Jan Beulich
2011-07-15 17:30 Jan Beulich
2011-07-15 18:23 ` Keir Fraser
2011-07-18  7:05 [Xen-devel] " Jan Beulich
2011-07-18  7:27 ` Keir Fraser
2011-07-18  8:31   ` [Xen-devel] " Ian Campbell
2011-07-18  8:47     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110712164342.GA12867@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.