Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 2009 23:34:18 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r187414 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID:  <200901182334.n0INYIFD091315@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901182334.n0INYIFD091315>