PERFORCE change 82629 for review

John Baldwin jhb at FreeBSD.org
Fri Aug 26 17:48:21 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=82629

Change 82629 by jhb at jhb_slimer on 2005/08/26 17:47:26

	IFC @82625.

Affected files ...

.. //depot/projects/smpng/sys/alpha/include/_limits.h#8 integrate
.. //depot/projects/smpng/sys/alpha/include/signal.h#8 integrate
.. //depot/projects/smpng/sys/amd64/amd64/exception.S#15 integrate
.. //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#24 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#44 integrate
.. //depot/projects/smpng/sys/amd64/include/_limits.h#6 integrate
.. //depot/projects/smpng/sys/amd64/include/signal.h#7 integrate
.. //depot/projects/smpng/sys/arm/include/_limits.h#7 integrate
.. //depot/projects/smpng/sys/arm/include/signal.h#7 integrate
.. //depot/projects/smpng/sys/conf/files#147 integrate
.. //depot/projects/smpng/sys/conf/files.i386#86 integrate
.. //depot/projects/smpng/sys/conf/newvers.sh#19 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_thermal.c#34 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-all.c#72 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#55 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.h#33 integrate
.. //depot/projects/smpng/sys/dev/hme/if_hme.c#25 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_amd.c#5 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c#9 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_x86.c#3 integrate
.. //depot/projects/smpng/sys/dev/ipw/if_ipw.c#7 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwi.c#9 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwireg.h#2 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwivar.h#3 integrate
.. //depot/projects/smpng/sys/dev/pci/pci_user.c#16 integrate
.. //depot/projects/smpng/sys/dev/ral/if_ral.c#9 integrate
.. //depot/projects/smpng/sys/dev/ral/if_ral_pccard.c#3 integrate
.. //depot/projects/smpng/sys/dev/usb/if_ural.c#8 integrate
.. //depot/projects/smpng/sys/dev/usb/uhub.c#26 integrate
.. //depot/projects/smpng/sys/geom/eli/g_eli.c#3 integrate
.. //depot/projects/smpng/sys/geom/eli/g_eli.h#3 integrate
.. //depot/projects/smpng/sys/geom/eli/g_eli_ctl.c#2 integrate
.. //depot/projects/smpng/sys/geom/label/g_label.c#10 integrate
.. //depot/projects/smpng/sys/geom/label/g_label.h#6 integrate
.. //depot/projects/smpng/sys/geom/label/g_label_ext2fs.c#2 integrate
.. //depot/projects/smpng/sys/geom/label/g_label_iso9660.c#2 integrate
.. //depot/projects/smpng/sys/geom/label/g_label_ntfs.c#1 branch
.. //depot/projects/smpng/sys/geom/label/g_label_reiserfs.c#2 integrate
.. //depot/projects/smpng/sys/geom/stripe/g_stripe.c#13 integrate
.. //depot/projects/smpng/sys/geom/stripe/g_stripe.h#6 integrate
.. //depot/projects/smpng/sys/geom/vinum/geom_vinum_drive.c#13 integrate
.. //depot/projects/smpng/sys/geom/vinum/geom_vinum_volume.c#8 integrate
.. //depot/projects/smpng/sys/i386/conf/NOTES#105 integrate
.. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#85 integrate
.. //depot/projects/smpng/sys/i386/include/_limits.h#7 integrate
.. //depot/projects/smpng/sys/i386/include/signal.h#11 integrate
.. //depot/projects/smpng/sys/i386/isa/if_el.c#15 delete
.. //depot/projects/smpng/sys/i386/isa/if_elreg.h#3 delete
.. //depot/projects/smpng/sys/ia64/include/_limits.h#7 integrate
.. //depot/projects/smpng/sys/ia64/include/signal.h#10 integrate
.. //depot/projects/smpng/sys/kern/kern_conf.c#40 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#82 integrate
.. //depot/projects/smpng/sys/kern/kern_kse.c#23 integrate
.. //depot/projects/smpng/sys/kern/kern_mib.c#28 integrate
.. //depot/projects/smpng/sys/kern/sched_ule.c#61 integrate
.. //depot/projects/smpng/sys/kern/subr_witness.c#134 integrate
.. //depot/projects/smpng/sys/kern/sys_process.c#45 integrate
.. //depot/projects/smpng/sys/kern/vfs_subr.c#108 integrate
.. //depot/projects/smpng/sys/libkern/iconv.c#10 integrate
.. //depot/projects/smpng/sys/modules/Makefile#103 integrate
.. //depot/projects/smpng/sys/modules/el/Makefile#2 delete
.. //depot/projects/smpng/sys/modules/geom/geom_label/Makefile#3 integrate
.. //depot/projects/smpng/sys/modules/geom/geom_vinum/Makefile#2 integrate
.. //depot/projects/smpng/sys/net/bpf.c#55 integrate
.. //depot/projects/smpng/sys/net/bpf.h#16 integrate
.. //depot/projects/smpng/sys/net/bpfdesc.h#13 integrate
.. //depot/projects/smpng/sys/net/if_bridge.c#8 integrate
.. //depot/projects/smpng/sys/net/if_ethersubr.c#62 integrate
.. //depot/projects/smpng/sys/net/rtsock.c#48 integrate
.. //depot/projects/smpng/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c#10 integrate
.. //depot/projects/smpng/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h#6 integrate
.. //depot/projects/smpng/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#14 integrate
.. //depot/projects/smpng/sys/netgraph/ng_base.c#38 integrate
.. //depot/projects/smpng/sys/netgraph/ng_fec.c#16 integrate
.. //depot/projects/smpng/sys/netgraph/ng_ksocket.c#27 integrate
.. //depot/projects/smpng/sys/netinet/if_atm.c#10 integrate
.. //depot/projects/smpng/sys/netinet/if_ether.c#37 integrate
.. //depot/projects/smpng/sys/netinet/in.h#31 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.h#37 integrate
.. //depot/projects/smpng/sys/netinet/ip_fastfwd.c#20 integrate
.. //depot/projects/smpng/sys/netinet/ip_icmp.c#35 integrate
.. //depot/projects/smpng/sys/netinet/ip_output.c#75 integrate
.. //depot/projects/smpng/sys/netinet/raw_ip.c#51 integrate
.. //depot/projects/smpng/sys/netinet/tcp.h#13 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#75 integrate
.. //depot/projects/smpng/sys/netinet/tcp_sack.c#14 integrate
.. //depot/projects/smpng/sys/netinet/tcp_syncache.c#40 integrate
.. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#44 integrate
.. //depot/projects/smpng/sys/netinet/udp_usrreq.c#58 integrate
.. //depot/projects/smpng/sys/netkey/key.c#32 integrate
.. //depot/projects/smpng/sys/pci/if_de.c#28 integrate
.. //depot/projects/smpng/sys/pci/if_devar.h#11 integrate
.. //depot/projects/smpng/sys/powerpc/include/_limits.h#7 integrate
.. //depot/projects/smpng/sys/powerpc/include/signal.h#6 integrate
.. //depot/projects/smpng/sys/sparc64/include/_limits.h#6 integrate
.. //depot/projects/smpng/sys/sparc64/include/signal.h#10 integrate
.. //depot/projects/smpng/sys/sys/malloc.h#23 integrate
.. //depot/projects/smpng/sys/sys/param.h#86 integrate
.. //depot/projects/smpng/sys/sys/signal.h#16 integrate
.. //depot/projects/smpng/sys/sys/systm.h#67 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_softdep.c#47 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#74 integrate

Differences ...

==== //depot/projects/smpng/sys/alpha/include/_limits.h#8 (text+ko) ====

@@ -28,7 +28,7 @@
  *
  *	@(#)limits.h	8.3 (Berkeley) 1/4/94
  *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
- * $FreeBSD: src/sys/alpha/include/_limits.h,v 1.16 2005/01/05 20:05:50 imp Exp $
+ * $FreeBSD: src/sys/alpha/include/_limits.h,v 1.17 2005/08/20 16:44:40 stefanf Exp $
  */
 
 #ifndef _MACHINE__LIMITS_H_
@@ -87,4 +87,10 @@
 #define	__LONG_BIT	64
 #define	__WORD_BIT	32
 
+/*
+ * Minimum signal stack size. The current signal frame
+ * for Alpha is 808 bytes large.
+ */
+#define	__MINSIGSTKSZ	(1024 * 4)
+
 #endif /* !_MACHINE__LIMITS_H_ */

==== //depot/projects/smpng/sys/alpha/include/signal.h#8 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.12 2005/01/05 20:05:50 imp Exp $ */
+/* $FreeBSD: src/sys/alpha/include/signal.h,v 1.13 2005/08/20 16:44:40 stefanf Exp $ */
 /* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */
 
 /*-
@@ -36,14 +36,6 @@
 
 typedef long	sig_atomic_t;
 
-#if __XSI_VISIBLE
-/*
- * Minimum signal stack size. The current signal frame
- * for Alpha is 808 bytes large.
- */
-#define	MINSIGSTKSZ	(1024 * 4)
-#endif
-
 /*
  * Only the kernel should need these old type definitions.
  */

==== //depot/projects/smpng/sys/amd64/amd64/exception.S#15 (text+ko) ====

@@ -27,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.125 2005/06/30 00:26:54 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.126 2005/08/25 20:33:43 ups Exp $
  */
 
 #include "opt_atpic.h"
@@ -94,7 +94,7 @@
 IDTVEC(div)
 	TRAP(T_DIVIDE)
 IDTVEC(nmi)
-	TRAP(T_NMI)
+	TRAP_NOEN(T_NMI)
 IDTVEC(ofl)
 	TRAP(T_OFLOW)
 IDTVEC(bnd)

==== //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#24 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.261 2005/07/21 21:46:09 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.262 2005/08/19 22:10:19 pjd Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kdb.h"
@@ -812,58 +812,6 @@
 		ia32_pause();
 }
 
-/*
- * This is about as magic as it gets.  fortune(1) has got similar code
- * for reversing bits in a word.  Who thinks up this stuff??
- *
- * Yes, it does appear to be consistently faster than:
- * while (i = ffs(m)) {
- *	m >>= i;
- *	bits++;
- * }
- * and
- * while (lsb = (m & -m)) {	// This is magic too
- * 	m &= ~lsb;		// or: m ^= lsb
- *	bits++;
- * }
- * Both of these latter forms do some very strange things on gcc-3.1 with
- * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2.
- * There is probably an SSE or MMX popcnt instruction.
- *
- * I wonder if this should be in libkern?
- *
- * XXX Stop the presses!  Another one:
- * static __inline u_int32_t
- * popcnt1(u_int32_t v)
- * {
- *	v -= ((v >> 1) & 0x55555555);
- *	v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
- *	v = (v + (v >> 4)) & 0x0F0F0F0F;
- *	return (v * 0x01010101) >> 24;
- * }
- * The downside is that it has a multiply.  With a pentium3 with
- * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use
- * an imull, and in that case it is faster.  In most other cases
- * it appears slightly slower.
- *
- * Another variant (also from fortune):
- * #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
- * #define  BX_(x)     ((x) - (((x)>>1)&0x77777777)            \
- *                          - (((x)>>2)&0x33333333)            \
- *                          - (((x)>>3)&0x11111111))
- */
-static __inline u_int32_t
-popcnt(u_int32_t m)
-{
-
-	m = (m & 0x55555555) + ((m & 0xaaaaaaaa) >> 1);
-	m = (m & 0x33333333) + ((m & 0xcccccccc) >> 2);
-	m = (m & 0x0f0f0f0f) + ((m & 0xf0f0f0f0) >> 4);
-	m = (m & 0x00ff00ff) + ((m & 0xff00ff00) >> 8);
-	m = (m & 0x0000ffff) + ((m & 0xffff0000) >> 16);
-	return m;
-}
-
 static void
 smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
 {
@@ -878,7 +826,7 @@
 		mask &= ~PCPU_GET(cpumask);
 		if (mask == 0)
 			return;
-		ncpu = popcnt(mask);
+		ncpu = bitcount32(mask);
 		if (ncpu > othercpus) {
 			/* XXX this should be a panic offence */
 			printf("SMP: tlb shootdown to %d other cpus (only have %d)\n",

==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#44 (text+ko) ====

@@ -7,6 +7,8 @@
  * All rights reserved.
  * Copyright (c) 2003 Peter Wemm
  * All rights reserved.
+ * Copyright (c) 2005 Alan L. Cox <alc at cs.rice.edu>
+ * All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * the Systems Programming Group of the University of Utah Computer
@@ -75,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.521 2005/08/14 20:02:49 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.526 2005/08/26 05:18:46 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -205,11 +207,12 @@
 
 static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq,
 		vm_offset_t sva, pd_entry_t ptepde);
-static void pmap_remove_page(struct pmap *pmap, vm_offset_t va);
+static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde);
 static void pmap_remove_entry(struct pmap *pmap, vm_page_t m,
 		vm_offset_t va);
 static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m);
 
+static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags);
 static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags);
 
 static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, int flags);
@@ -288,16 +291,34 @@
 
 /* Return a pointer to the PDP slot that corresponds to a VA */
 static __inline pdp_entry_t *
+pmap_pml4e_to_pdpe(pml4_entry_t *pml4e, vm_offset_t va)
+{
+	pdp_entry_t *pdpe;
+
+	pdpe = (pdp_entry_t *)PHYS_TO_DMAP(*pml4e & PG_FRAME);
+	return (&pdpe[pmap_pdpe_index(va)]);
+}
+
+/* Return a pointer to the PDP slot that corresponds to a VA */
+static __inline pdp_entry_t *
 pmap_pdpe(pmap_t pmap, vm_offset_t va)
 {
 	pml4_entry_t *pml4e;
-	pdp_entry_t *pdpe;
 
 	pml4e = pmap_pml4e(pmap, va);
 	if (pml4e == NULL || (*pml4e & PG_V) == 0)
 		return NULL;
-	pdpe = (pdp_entry_t *)PHYS_TO_DMAP(*pml4e & PG_FRAME);
-	return (&pdpe[pmap_pdpe_index(va)]);
+	return (pmap_pml4e_to_pdpe(pml4e, va));
+}
+
+/* Return a pointer to the PD slot that corresponds to a VA */
+static __inline pd_entry_t *
+pmap_pdpe_to_pde(pdp_entry_t *pdpe, vm_offset_t va)
+{
+	pd_entry_t *pde;
+
+	pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME);
+	return (&pde[pmap_pde_index(va)]);
 }
 
 /* Return a pointer to the PD slot that corresponds to a VA */
@@ -305,13 +326,11 @@
 pmap_pde(pmap_t pmap, vm_offset_t va)
 {
 	pdp_entry_t *pdpe;
-	pd_entry_t *pde;
 
 	pdpe = pmap_pdpe(pmap, va);
 	if (pdpe == NULL || (*pdpe & PG_V) == 0)
 		 return NULL;
-	pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME);
-	return (&pde[pmap_pde_index(va)]);
+	return (pmap_pdpe_to_pde(pdpe, va));
 }
 
 /* Return a pointer to the PT slot that corresponds to a VA */
@@ -786,7 +805,9 @@
 		pde = *pdep;
 		if (pde) {
 			if ((pde & PG_PS) != 0) {
-				rtval = (pde & ~PDRMASK) | (va & PDRMASK);
+				KASSERT((pde & PG_FRAME & PDRMASK) == 0,
+				    ("pmap_extract: bad pde"));
+				rtval = (pde & PG_FRAME) | (va & PDRMASK);
 				PMAP_UNLOCK(pmap);
 				return rtval;
 			}
@@ -819,7 +840,9 @@
 	if (pdep != NULL && (pde = *pdep)) {
 		if (pde & PG_PS) {
 			if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) {
-				m = PHYS_TO_VM_PAGE((pde & ~PDRMASK) |
+				KASSERT((pde & PG_FRAME & PDRMASK) == 0,
+				    ("pmap_extract_and_hold: bad pde"));
+				m = PHYS_TO_VM_PAGE((pde & PG_FRAME) |
 				    (va & PDRMASK));
 				vm_page_hold(m);
 			}
@@ -1222,6 +1245,33 @@
 }
 
 static vm_page_t
+pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags)
+{
+	vm_pindex_t pdpindex, ptepindex;
+	pdp_entry_t *pdpe;
+	vm_page_t pdpg;
+
+	KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT ||
+	    (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK,
+	    ("pmap_allocpde: flags is neither M_NOWAIT nor M_WAITOK"));
+retry:
+	pdpe = pmap_pdpe(pmap, va);
+	if (pdpe != NULL && (*pdpe & PG_V) != 0) {
+		/* Add a reference to the pd page. */
+		pdpg = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME);
+		pdpg->wire_count++;
+	} else {
+		/* Allocate a pd page. */
+		ptepindex = pmap_pde_pindex(va);
+		pdpindex = ptepindex >> NPDPEPGSHIFT;
+		pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, flags);
+		if (pdpg == NULL && (flags & M_WAITOK))
+			goto retry;
+	}
+	return (pdpg);
+}
+
+static vm_page_t
 pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags)
 {
 	vm_pindex_t ptepindex;
@@ -1249,6 +1299,8 @@
 	if (pd != 0 && (*pd & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
 		*pd = 0;
 		pd = 0;
+		pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
+		pmap_unuse_pt(pmap, va, *pmap_pdpe(pmap, va));
 		pmap_invalidate_all(kernel_pmap);
 	}
 
@@ -1510,16 +1562,17 @@
  * Remove a single page from a process address space
  */
 static void
-pmap_remove_page(pmap_t pmap, vm_offset_t va)
+pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde)
 {
-	pd_entry_t ptepde;
 	pt_entry_t *pte;
 
 	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-	pte = pmap_pte_pde(pmap, va, &ptepde);
-	if (pte == NULL || (*pte & PG_V) == 0)
+	if ((*pde & PG_V) == 0)
+		return;
+	pte = pmap_pde_to_pte(pde, va);
+	if ((*pte & PG_V) == 0)
 		return;
-	pmap_remove_pte(pmap, pte, va, ptepde);
+	pmap_remove_pte(pmap, pte, va, *pde);
 	pmap_invalidate_page(pmap, va);
 }
 
@@ -1558,7 +1611,7 @@
 	if (sva + PAGE_SIZE == eva) {
 		pde = pmap_pde(pmap, sva);
 		if (pde && (*pde & PG_PS) == 0) {
-			pmap_remove_page(pmap, sva);
+			pmap_remove_page(pmap, sva, pde);
 			goto out;
 		}
 	}
@@ -1569,13 +1622,13 @@
 			break;
 
 		pml4e = pmap_pml4e(pmap, sva);
-		if (pml4e == 0) {
+		if ((*pml4e & PG_V) == 0) {
 			va_next = (sva + NBPML4) & ~PML4MASK;
 			continue;
 		}
 
-		pdpe = pmap_pdpe(pmap, sva);
-		if (pdpe == 0) {
+		pdpe = pmap_pml4e_to_pdpe(pml4e, sva);
+		if ((*pdpe & PG_V) == 0) {
 			va_next = (sva + NBPDP) & ~PDPMASK;
 			continue;
 		}
@@ -1585,9 +1638,7 @@
 		 */
 		va_next = (sva + NBPDR) & ~PDRMASK;
 
-		pde = pmap_pde(pmap, sva);
-		if (pde == 0)
-			continue;
+		pde = pmap_pdpe_to_pde(pdpe, sva);
 		ptpaddr = *pde;
 
 		/*
@@ -1602,6 +1653,7 @@
 		if ((ptpaddr & PG_PS) != 0) {
 			*pde = 0;
 			pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
+			pmap_unuse_pt(pmap, sva, *pdpe);
 			anyvalid = 1;
 			continue;
 		}
@@ -1724,22 +1776,20 @@
 	for (; sva < eva; sva = va_next) {
 
 		pml4e = pmap_pml4e(pmap, sva);
-		if (pml4e == 0) {
+		if ((*pml4e & PG_V) == 0) {
 			va_next = (sva + NBPML4) & ~PML4MASK;
 			continue;
 		}
 
-		pdpe = pmap_pdpe(pmap, sva);
-		if (pdpe == 0) {
+		pdpe = pmap_pml4e_to_pdpe(pml4e, sva);
+		if ((*pdpe & PG_V) == 0) {
 			va_next = (sva + NBPDP) & ~PDPMASK;
 			continue;
 		}
 
 		va_next = (sva + NBPDR) & ~PDRMASK;
 
-		pde = pmap_pde(pmap, sva);
-		if (pde == NULL)
-			continue;
+		pde = pmap_pdpe_to_pde(pdpe, sva);
 		ptpaddr = *pde;
 
 		/*
@@ -2118,15 +2168,14 @@
 		    vm_object_t object, vm_pindex_t pindex,
 		    vm_size_t size)
 {
-	vm_page_t p;
+	vm_offset_t va;
+	vm_page_t p, pdpg;
 
 	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
 	KASSERT(object->type == OBJT_DEVICE,
 	    ("pmap_object_init_pt: non-device object"));
 	if (((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) {
-		int i;
 		vm_page_t m[1];
-		int npdes;
 		pd_entry_t ptepa, *pde;
 
 		PMAP_LOCK(pmap);
@@ -2166,12 +2215,35 @@
 		p->valid = VM_PAGE_BITS_ALL;
 
 		PMAP_LOCK(pmap);
-		pmap->pm_stats.resident_count += size >> PAGE_SHIFT;
-		npdes = size >> PDRSHIFT;
-		for(i = 0; i < npdes; i++) {
-			pde_store(pde, ptepa | PG_U | PG_RW | PG_V | PG_PS);
+		for (va = addr; va < addr + size; va += NBPDR) {
+			while ((pdpg =
+			    pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) {
+				PMAP_UNLOCK(pmap);
+				vm_page_lock_queues();
+				vm_page_busy(p);
+				vm_page_unlock_queues();
+				VM_OBJECT_UNLOCK(object);
+				VM_WAIT;
+				VM_OBJECT_LOCK(object);
+				vm_page_lock_queues();
+				vm_page_wakeup(p);
+				vm_page_unlock_queues();
+				PMAP_LOCK(pmap);
+			}
+			pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg));
+			pde = &pde[pmap_pde_index(va)];
+			if ((*pde & PG_V) == 0) {
+				pde_store(pde, ptepa | PG_PS | PG_M | PG_A |
+				    PG_U | PG_RW | PG_V);
+				pmap->pm_stats.resident_count +=
+				    NBPDR / PAGE_SIZE;
+			} else {
+				pdpg->wire_count--;
+				KASSERT(pdpg->wire_count > 0,
+				    ("pmap_object_init_pt: missing reference "
+				     "to page directory page, va: 0x%lx", va));
+			}
 			ptepa += NBPDR;
-			pde++;
 		}
 		pmap_invalidate_all(pmap);
 out:
@@ -2245,7 +2317,7 @@
 	}
 	for (addr = src_addr; addr < end_addr; addr = va_next) {
 		pt_entry_t *src_pte, *dst_pte;
-		vm_page_t dstmpte, srcmpte;
+		vm_page_t dstmpde, dstmpte, srcmpte;
 		pml4_entry_t *pml4e;
 		pdp_entry_t *pdpe;
 		pd_entry_t srcptepaddr, *pde;
@@ -2263,41 +2335,37 @@
 			break;
 		
 		pml4e = pmap_pml4e(src_pmap, addr);
-		if (pml4e == 0) {
+		if ((*pml4e & PG_V) == 0) {
 			va_next = (addr + NBPML4) & ~PML4MASK;
 			continue;
 		}
 
-		pdpe = pmap_pdpe(src_pmap, addr);
-		if (pdpe == 0) {
+		pdpe = pmap_pml4e_to_pdpe(pml4e, addr);
+		if ((*pdpe & PG_V) == 0) {
 			va_next = (addr + NBPDP) & ~PDPMASK;
 			continue;
 		}
 
 		va_next = (addr + NBPDR) & ~PDRMASK;
 
-		pde = pmap_pde(src_pmap, addr);
-		if (pde)
-			srcptepaddr = *pde;
-		else
-			continue;
+		pde = pmap_pdpe_to_pde(pdpe, addr);
+		srcptepaddr = *pde;
 		if (srcptepaddr == 0)
 			continue;
 			
 		if (srcptepaddr & PG_PS) {
-			pde = pmap_pde(dst_pmap, addr);
-			if (pde == 0) {
-				/*
-				 * XXX should do an allocpte here to
-				 * instantiate the pde
-				 */
-				continue;
-			}
+			dstmpde = pmap_allocpde(dst_pmap, addr, M_NOWAIT);
+			if (dstmpde == NULL)
+				break;
+			pde = (pd_entry_t *)
+			    PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpde));
+			pde = &pde[pmap_pde_index(addr)];
 			if (*pde == 0) {
 				*pde = srcptepaddr;
 				dst_pmap->pm_stats.resident_count +=
 				    NBPDR / PAGE_SIZE;
-			}
+			} else
+				pmap_unwire_pte_hold(dst_pmap, addr, dstmpde);
 			continue;
 		}
 

==== //depot/projects/smpng/sys/amd64/include/_limits.h#6 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)limits.h	8.3 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.10 2005/01/05 20:17:20 imp Exp $
+ * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.11 2005/08/20 16:44:40 stefanf Exp $
  */
 
 #ifndef	_MACHINE__LIMITS_H_
@@ -83,4 +83,10 @@
 #define	__LONG_BIT	64
 #define	__WORD_BIT	32
 
+/*
+ * Minimum signal stack size. The current signal frame
+ * for i386 is 408 bytes large.
+ */
+#define	__MINSIGSTKSZ	(512 * 4)
+
 #endif /* !_MACHINE__LIMITS_H_ */

==== //depot/projects/smpng/sys/amd64/include/signal.h#7 (text+ko) ====

@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)signal.h	8.1 (Berkeley) 6/11/93
- * $FreeBSD: src/sys/amd64/include/signal.h,v 1.28 2005/01/05 20:17:20 imp Exp $
+ * $FreeBSD: src/sys/amd64/include/signal.h,v 1.29 2005/08/20 16:44:40 stefanf Exp $
  */
 
 #ifndef _MACHINE_SIGNAL_H_
@@ -43,14 +43,6 @@
 
 typedef long sig_atomic_t;
 
-#if __XSI_VISIBLE
-/*
- * Minimum signal stack size. The current signal frame
- * for i386 is 408 bytes large.
- */
-#define	MINSIGSTKSZ	(512 * 4)
-#endif
-
 #if __BSD_VISIBLE
 #include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
 

==== //depot/projects/smpng/sys/arm/include/_limits.h#7 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)limits.h	8.3 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/arm/include/_limits.h,v 1.8 2005/01/05 21:58:48 imp Exp $
+ * $FreeBSD: src/sys/arm/include/_limits.h,v 1.9 2005/08/20 16:44:40 stefanf Exp $
  */
 
 #ifndef _MACHINE__LIMITS_H_
@@ -94,4 +94,7 @@
 #endif
 #define	__WORD_BIT	32
 
+/* Minimum signal stack size. */
+#define	__MINSIGSTKSZ	(1024 * 4)
+
 #endif /* !_MACHINE__LIMITS_H_ */

==== //depot/projects/smpng/sys/arm/include/signal.h#7 (text+ko) ====

@@ -29,7 +29,7 @@
  *      @(#)signal.h    8.1 (Berkeley) 6/11/93
  *	from: FreeBSD: src/sys/i386/include/signal.h,v 1.13 2000/11/09
  *	from: FreeBSD: src/sys/sparc64/include/signal.h,v 1.6 2001/09/30 18:52:17
- * $FreeBSD: src/sys/arm/include/signal.h,v 1.6 2005/01/05 21:58:48 imp Exp $
+ * $FreeBSD: src/sys/arm/include/signal.h,v 1.7 2005/08/20 16:44:40 stefanf Exp $
  */
 
 #ifndef	_MACHINE_SIGNAL_H_
@@ -39,10 +39,6 @@
 
 typedef	long sig_atomic_t;
 
-#if __XSI_VISIBLE
-#define	MINSIGSTKSZ	(1024 * 4)
-#endif
-
 #if __BSD_VISIBLE
 
 struct sigcontext {

==== //depot/projects/smpng/sys/conf/files#147 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1041 2005/08/12 00:27:44 pjd Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1042 2005/08/26 12:48:34 takawata Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -1063,6 +1063,7 @@
 geom/label/g_label_ext2fs.c	optional geom_label
 geom/label/g_label_iso9660.c	optional geom_label
 geom/label/g_label_msdosfs.c	optional geom_label
+geom/label/g_label_ntfs.c	optional geom_label
 geom/label/g_label_reiserfs.c	optional geom_label
 geom/label/g_label_ufs.c	optional geom_label
 geom/mirror/g_mirror.c		optional geom_mirror

==== //depot/projects/smpng/sys/conf/files.i386#86 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.539 2005/08/18 00:30:22 pjd Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.540 2005/08/26 13:42:03 jhb Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -321,7 +321,6 @@
 i386/isa/elcr.c			standard
 i386/isa/elink.c		optional ep
 i386/isa/elink.c		optional ie
-i386/isa/if_el.c		optional el
 i386/isa/isa.c			optional isa
 i386/isa/isa_dma.c		optional isa
 i386/isa/nmi.c			standard

==== //depot/projects/smpng/sys/conf/newvers.sh#19 (text+ko) ====

@@ -28,11 +28,14 @@
 # SUCH DAMAGE.
 #
 #	@(#)newvers.sh	8.1 (Berkeley) 4/20/94
-# $FreeBSD: src/sys/conf/newvers.sh,v 1.70 2005/07/11 08:34:49 scottl Exp $
+# $FreeBSD: src/sys/conf/newvers.sh,v 1.72 2005/08/19 03:56:45 cperciva Exp $
 
 TYPE="FreeBSD"
 REVISION="7.0"
 BRANCH="CURRENT"
+if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
+	BRANCH=${BRANCH_OVERRIDE}
+fi
 RELEASE="${REVISION}-${BRANCH}"
 VERSION="${TYPE} ${RELEASE}"
 
@@ -85,10 +88,14 @@
 i=`${MAKE:-make} -V KERN_IDENT`
 cat << EOF > vers.c
 $COPYRIGHT
-char sccs[] =  "@(#)${VERSION} #${v}: ${t}";
-char version[] = "${VERSION} #${v}: ${t}\\n    ${u}@${h}:${d}\\n";
+#define SCCSSTR "@(#)${VERSION} #${v}: ${t}"
+#define VERSTR "${VERSION} #${v}: ${t}\\n    ${u}@${h}:${d}\\n"
+#define RELSTR "${RELEASE}"
+
+char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
+char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR;
 char ostype[] = "${TYPE}";
-char osrelease[] = "${RELEASE}";
+char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR;
 int osreldate = ${RELDATE};
 char kern_ident[] = "${i}";
 EOF

==== //depot/projects/smpng/sys/dev/acpica/acpi_thermal.c#34 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.56 2005/08/17 17:01:25 ume Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.59 2005/08/26 02:21:02 kan Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -347,7 +347,14 @@
 	    AcpiOsFree(sc->tz_zone.al[i].Pointer);
     if (sc->tz_zone.psl.Pointer != NULL)
 	AcpiOsFree(sc->tz_zone.psl.Pointer);
-    bzero(&sc->tz_zone, sizeof(sc->tz_zone));
+
+    /*
+     * XXX: We initialize only ACPI_BUFFER to avoid race condition
+     * with passive cooling thread which refers psv, tc1, tc2 and tsp.
+     */
+    bzero(sc->tz_zone.ac, sizeof(sc->tz_zone.ac));
+    bzero(sc->tz_zone.al, sizeof(sc->tz_zone.al));
+    bzero(&sc->tz_zone.psl, sizeof(sc->tz_zone.psl));
 
     /* Evaluate thermal zone parameters. */
     for (i = 0; i < TZ_NUMLEVELS; i++) {
@@ -408,6 +415,30 @@
 }
 
 /*
+ * Get the current temperature.
+ */
+static int
+acpi_tz_get_temperature(struct acpi_tz_softc *sc)
+{
+    int		temp;
+    ACPI_STATUS	status;
+
+    ACPI_FUNCTION_NAME ("acpi_tz_get_temperature");
+
+    status = acpi_GetInteger(sc->tz_handle, "_TMP", &temp);
+    if (ACPI_FAILURE(status)) {
+	ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
+	    "error fetching current temperature -- %s\n",
+	     AcpiFormatException(status));
+	return (FALSE);
+    }
+
+    ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "got %d.%dC\n", TZ_KELVTOC(temp)));
+    sc->tz_temperature = temp;
+    return (TRUE);
+}
+
+/*
  * Evaluate the condition of a thermal zone, take appropriate actions.
  */
 static void
@@ -418,24 +449,17 @@
     int		temp;
     int		i;
     int		newactive, newflags;
-    ACPI_STATUS	status;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
     sc = (struct acpi_tz_softc *)Context;
 
     /* Get the current temperature. */
-    status = acpi_GetInteger(sc->tz_handle, "_TMP", &temp);
-    if (ACPI_FAILURE(status)) {
-	ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
-	    "error fetching current temperature -- %s\n",
-	     AcpiFormatException(status));
+    if (!acpi_tz_get_temperature(sc)) {
 	/* XXX disable zone? go to max cooling? */
 	return_VOID;
     }
-
-    ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "got %d.%dC\n", TZ_KELVTOC(temp)));
-    sc->tz_temperature = temp;
+    temp = sc->tz_temperature;
 
     /*
      * Work out what we ought to be doing right now.
@@ -972,19 +996,22 @@
 acpi_tz_cooling_thread(void *arg)
 {
     struct acpi_tz_softc *sc;
-    int error, perf, temperature;
+    int error, perf, curr_temp, prev_temp;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
     sc = (struct acpi_tz_softc *)arg;
 
-    temperature = sc->tz_temperature;
+    prev_temp = sc->tz_temperature;
     while (sc->tz_cooling_enabled) {
-	if (sc->tz_temperature >= sc->tz_zone.psv)
+	if (sc->tz_cooling_active)
+	    (void)acpi_tz_get_temperature(sc);
+	curr_temp = sc->tz_temperature;
+	if (curr_temp >= sc->tz_zone.psv)
 	    sc->tz_cooling_active = TRUE;
 	if (sc->tz_cooling_active) {
-	    perf = sc->tz_zone.tc1 * (sc->tz_temperature - temperature) +
-		   sc->tz_zone.tc2 * (sc->tz_temperature - sc->tz_zone.psv);
+	    perf = sc->tz_zone.tc1 * (curr_temp - prev_temp) +
+		   sc->tz_zone.tc2 * (curr_temp - sc->tz_zone.psv);
 	    perf /= 10;
 
 	    if (perf != 0) {
@@ -1001,7 +1028,7 @@
 		}
 	    }
 	}
-	temperature = sc->tz_temperature;
+	prev_temp = curr_temp;
 	tsleep(&sc->tz_cooling_proc, PZERO, "cooling",
 	    hz * sc->tz_zone.tsp / 10);
     }

==== //depot/projects/smpng/sys/dev/ata/ata-all.c#72 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.254 2005/08/17 15:00:33 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.255 2005/08/25 15:45:03 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -615,7 +615,9 @@
 		atadev->mode = ATA_DMA_MAX;
 	}
 	else {
-	    if (ata_dma && ch->dma)
+	    if (ata_dma && ch->dma &&
+		(ata_umode(&atadev->param) > 0 ||
+		 ata_wmode(&atadev->param) > 0))
 		atadev->mode = ATA_DMA_MAX;
 	}
     }

==== //depot/projects/smpng/sys/dev/ata/ata-chipset.c#55 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.129 2005/08/17 15:00:33 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.131 2005/08/23 08:53:01 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -75,6 +75,7 @@
 static int ata_ali_chipinit(device_t dev);
 static int ata_ali_allocate(device_t dev);
 static int ata_ali_sata_allocate(device_t dev);
+static void ata_ali_reset(device_t dev);
 static void ata_ali_setmode(device_t dev, int mode);
 static int ata_amd_chipinit(device_t dev);
 static int ata_cyrix_chipinit(device_t dev);
@@ -878,26 +879,28 @@
 	break;
 
     case ALINEW:
-	/* deactivate the ATAPI FIFO and enable ATAPI UDMA */
-	pci_write_config(dev, 0x53,
-			 pci_read_config(dev, 0x53, 1) | 0x01, 1);
+	/* use device interrupt as byte count end */
+	pci_write_config(dev, 0x4a, pci_read_config(dev, 0x4a, 1) | 0x20, 1);
 
 	/* enable cable detection and UDMA support on newer chips */
 	pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1);
 
+	/* enable ATAPI UDMA mode */
+	pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x01, 1);
+
 	/* only chips with revision > 0xc4 can do 48bit DMA */
 	if (ctlr->chip->chiprev <= 0xc4)
 	    device_printf(dev,
 			  "using PIO transfers above 137GB as workaround for "
 			  "48bit DMA access bug, expect reduced performance\n");
+	ctlr->reset = ata_ali_reset;
 	ctlr->allocate = ata_ali_allocate;
 	ctlr->setmode = ata_ali_setmode;
 	break;
 
     case ALIOLD:
 	/* deactivate the ATAPI FIFO and enable ATAPI UDMA */
-	pci_write_config(dev, 0x53,
-			 (pci_read_config(dev, 0x53, 1) & ~0x02) | 0x03, 1);
+	pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x03, 1);
 	ctlr->setmode = ata_ali_setmode;
 	break;
     }
@@ -963,6 +966,39 @@
 }
 
 static void

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list