Module Name: src
Committed By: jym
Date: Wed Mar 30 21:53:59 UTC 2011
Modified Files:
src/sys/arch/xen/x86: hypervisor_machdep.c
Log Message:
Fix a year old bug that was only fixed in jym-xensuspend branch, but
not in HEAD:
- use uvm_km_alloc() instead of kmem_alloc() to enforce alignement when
allocating p2m_frame pages (xentools can only deal with page-aligned
addresses)
- do not use paddr_t for p2m_frame_list_list with PAE, xentools expect
32 bits PFNs even with 64 bits PTE.
Required to make ``xm dump-core'' work as expected.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/x86/hypervisor_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.13 src/sys/arch/xen/x86/hypervisor_machdep.c:1.14
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.13 Fri Oct 23 02:32:34 2009
+++ src/sys/arch/xen/x86/hypervisor_machdep.c Wed Mar 30 21:53:58 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor_machdep.c,v 1.13 2009/10/23 02:32:34 snj Exp $ */
+/* $NetBSD: hypervisor_machdep.c,v 1.14 2011/03/30 21:53:58 jym Exp $ */
/*
*
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.13 2009/10/23 02:32:34 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.14 2011/03/30 21:53:58 jym Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -385,10 +385,11 @@
* A L1 page contains the list of MFN we are looking for
*/
max_pfn = xen_start_info.nr_pages;
- fpp = PAGE_SIZE / sizeof(paddr_t);
+ fpp = PAGE_SIZE / sizeof(xen_pfn_t);
/* we only need one L3 page */
- l3_p2m_page = kmem_alloc(PAGE_SIZE, KM_NOSLEEP);
+ l3_p2m_page = (vaddr_t *)uvm_km_alloc(kernel_map, PAGE_SIZE,
+ PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
if (l3_p2m_page == NULL)
panic("could not allocate memory for l3_p2m_page");
@@ -398,7 +399,9 @@
*/
l2_p2m_page_size = howmany(max_pfn, fpp);
- l2_p2m_page = kmem_alloc(l2_p2m_page_size * PAGE_SIZE, KM_NOSLEEP);
+ l2_p2m_page = (vaddr_t *)uvm_km_alloc(kernel_map,
+ l2_p2m_page_size * PAGE_SIZE,
+ PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
if (l2_p2m_page == NULL)
panic("could not allocate memory for l2_p2m_page");
@@ -418,7 +421,7 @@
unsigned long max_pfn;
max_pfn = xen_start_info.nr_pages;
- fpp = PAGE_SIZE / sizeof(paddr_t);
+ fpp = PAGE_SIZE / sizeof(xen_pfn_t);
for (i = 0; i < l2_p2m_page_size; i++) {
/*