svn commit: r187414 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb

Alan Cox alc at FreeBSD.org
Sun Jan 18 15:34:19 PST 2009


Author: alc
Date: Sun Jan 18 23:34:17 2009
New Revision: 187414
URL: http://svn.freebsd.org/changeset/base/187414

Log:
  MFC rev 180362
    Make preparations for increasing the size of the kernel virtual
    address space on the amd64 architecture:
  
    Rev 180333, ``Change create_pagetables() and pmap_init() so that many
    fewer page table pages have to be preallocated ...'', violates an
    assumption made by minidumpsys(): kernel_vm_end is the highest virtual
    address that has ever been used by the kernel.  Now, however, the kernel
    code, data, and bss may reside at addresses beyond kernel_vm_end.  This
    revision modifies the upper bound on minidumpsys()'s two page table
    traversals to account for this possibility.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/minidump_machdep.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/minidump_machdep.c	Sun Jan 18 23:21:04 2009	(r187413)
+++ stable/7/sys/amd64/amd64/minidump_machdep.c	Sun Jan 18 23:34:17 2009	(r187414)
@@ -202,7 +202,8 @@ minidumpsys(struct dumperinfo *di)
 	/* Walk page table pages, set bits in vm_page_dump */
 	ptesize = 0;
 	pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
-	for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+	for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+	    kernel_vm_end); va += NBPDR) {
 		i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
 		/*
 		 * We always write a page, even if it is zero. Each
@@ -308,7 +309,8 @@ minidumpsys(struct dumperinfo *di)
 
 	/* Dump kernel page table pages */
 	pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
-	for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) {
+	for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR,
+	    kernel_vm_end); va += NBPDR) {
 		i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
 		/* We always write a page, even if it is zero */
 		if ((pdp[i] & PG_V) == 0) {


More information about the svn-src-stable mailing list