PERFORCE change 79108 for review
Paul Saab
ps at FreeBSD.org
Tue Jun 28 20:30:06 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79108
Change 79108 by ps at butter.corp on 2005/06/28 20:29:41
Support 2MB pages in PAE mode.
Submitted by: peter
Affected files ...
.. //depot/projects/hammer/lib/libkvm/kvm_i386.c#6 edit
Differences ...
==== //depot/projects/hammer/lib/libkvm/kvm_i386.c#6 (text+ko) ====
@@ -75,7 +75,8 @@
#define PG_FRAME_PAE (~((uint64_t)PAGE_MASK))
#define PDRSHIFT_PAE 21
-#define NPTEPG_PAE (PAGE_SIZE/sizeof(uint64_t))
+#define NPTEPG_PAE (PAGE_SIZE/sizeof(uint64_t))
+#define NBPDR_PAE (1<<PDRSHIFT_PAE)
struct vmstate {
void *mmapbase;
@@ -360,21 +361,21 @@
if ((u_long)pde & PG_PS) {
/*
- * No second-level page table; ptd describes one 4MB page.
+ * No second-level page table; ptd describes one 2MB page.
* (We assume that the kernel wouldn't set PG_PS without enabling
* it cr0, and that the kernel doesn't support 36-bit physical
* addresses).
*/
-#define PAGE4M_MASK (NBPDR - 1)
-#define PG_FRAME4M (~PAGE4M_MASK)
- pde_pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK);
+#define PAGE2M_MASK (NBPDR_PAE - 1)
+#define PG_FRAME2M (~PAGE2M_MASK)
+ pde_pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK);
s = _kvm_pa2off(kd, pde_pa, &ofs);
if (s <= sizeof pde) {
_kvm_syserr(kd, kd->program, "_kvm_vatop_pae: pde_pa not found");
goto invalid;
}
*pa = ofs;
- return (NBPDR - (va & PAGE4M_MASK));
+ return (NBPDR_PAE - (va & PAGE2M_MASK));
}
pteindex = (va >> PAGE_SHIFT) & (NPTEPG_PAE-1);
More information about the p4-projects
mailing list