summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-09-02 02:55:45 +0000
committerkmacy <kmacy@FreeBSD.org>2008-09-02 02:55:45 +0000
commit5b1439fb4876c015207f761e57de477662d4ddd6 (patch)
tree2ec79a9bbb4fd2223de1368d7056f533c328e944 /sys/i386
parent840a563001e3febebae3b739172cd4253a390c23 (diff)
downloadFreeBSD-src-5b1439fb4876c015207f761e57de477662d4ddd6.zip
FreeBSD-src-5b1439fb4876c015207f761e57de477662d4ddd6.tar.gz
Accomodate the fact that the number of l1 pages varies with the size of the initially
allocated memory - this lets us boot with 3GB MFC after: 1 month
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/xen/xen_machdep.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c
index 0a6602f..ee589cf 100644
--- a/sys/i386/xen/xen_machdep.c
+++ b/sys/i386/xen/xen_machdep.c
@@ -861,7 +861,8 @@ initvalues(start_info_t *startinfo)
l3_pages = 0;
#endif
l2_pages = 1;
- l1_pages = 4; /* XXX not certain if this varies */
+ l1_pages = xen_start_info->nr_pt_frames - l2_pages - l3_pages;
+
KPTphysoff = (l2_pages + l3_pages)*PAGE_SIZE;
KPTphys = xpmap_ptom(VTOP(startinfo->pt_base + KPTphysoff));
@@ -916,7 +917,9 @@ initvalues(start_info_t *startinfo)
xen_pt_unpin(IdlePDPTma);
#endif /* PAE */
- /* unmap remaining pages from initial 4MB chunk */
+ /* unmap remaining pages from initial 4MB chunk
+ *
+ */
for (tmpva = cur_space; (tmpva & ((1<<22)-1)) != 0; tmpva += PAGE_SIZE) {
bzero((char *)tmpva, PAGE_SIZE);
PT_SET_MA(tmpva, (vm_paddr_t)0);
@@ -931,12 +934,12 @@ initvalues(start_info_t *startinfo)
/* allocate remainder of NKPT pages */
for (i = l1_pages; i < NKPT; i++, cur_space += PAGE_SIZE) {
/*
- * ensure that all page table pages have been zeroed
+ * make sure that all the initial page table pages
+ * have been zeroed
*/
PT_SET_MA(cur_space, xpmap_ptom(VTOP(cur_space)) | PG_V | PG_RW);
bzero((char *)cur_space, PAGE_SIZE);
- PT_SET_MA(cur_space, 0);
-
+ PT_SET_MA(cur_space, (vm_paddr_t)0);
xen_pt_pin(xpmap_ptom(VTOP(cur_space)));
xen_queue_pt_update((vm_paddr_t)(IdlePTDma + (offset + i)*sizeof(vm_paddr_t)),
xpmap_ptom(VTOP(cur_space)) | PG_KERNEL);
OpenPOWER on IntegriCloud