xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xen.org
Cc: Juergen Gross <jgross@suse.com>,
	samuel.thibault@ens-lyon.org, wei.liu2@citrix.com
Subject: [PATCH] pvgrub: fix crash when booting kernel with p2m list outside kernel mapping
Date: Wed, 28 Sep 2016 06:02:44 +0200	[thread overview]
Message-ID: <1475035364-29170-1-git-send-email-jgross@suse.com> (raw)

When trying to boot a kernel with the p2m list not mapped by the
initial kernel mapping it can happen that pvgrub is failing as it is
keeping some page tables mapped.

Unmap the additional page tables created for the special p2m mapping
will avoid this failure.

Reported-by: Sven Koehler <sven.koehler@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
This is a backport candidate for 4.7
---
 stubdom/grub/kexec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 2ed4f6c..437a0a9 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -347,6 +347,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     /* Unmap libxc's projection of the boot page table */
     seg = xc_dom_seg_to_ptr(dom, &dom->pgtables_seg);
     munmap(seg, dom->pgtables_seg.vend - dom->pgtables_seg.vstart);
+    seg = xc_dom_seg_to_ptr(dom, &dom->p2m_seg);
+    munmap(seg, dom->p2m_seg.vend - dom->p2m_seg.vstart);
 
     /* Unmap day0 pages to avoid having a r/w mapping of the future page table */
     for (pfn = 0; pfn < allocated; pfn++)
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

             reply	other threads:[~2016-09-28  4:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28  4:02 Juergen Gross [this message]
2016-09-28 10:49 ` [PATCH] pvgrub: fix crash when booting kernel with p2m list outside kernel mapping Wei Liu

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=1475035364-29170-1-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).