]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
pvgrub: fix crash when booting kernel with p2m list outside kernel mapping
authorJuergen Gross <jgross@suse.com>
Wed, 28 Sep 2016 04:02:44 +0000 (06:02 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 28 Sep 2016 10:29:28 +0000 (11:29 +0100)
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>
Acked-by: Wei Liu <wei.liu2@citrix.com>
stubdom/grub/kexec.c

index 8fd9ff9c580cd4fd597526a5bf617acbe09a6005..71c2f3f117cee70a5dd15f9f8bb39d19d762e01c 100644 (file)
@@ -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++)