Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2008 15:19:24 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 148195 for review
Message-ID:  <200808231519.m7NFJOES009553@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=148195

Change 148195 by ed@ed_dull on 2008/08/23 15:18:28

	Sync my TTY changes to SVN.

Affected files ...

.. //depot/projects/mpsafetty/bin/stty/modes.c#3 integrate
.. //depot/projects/mpsafetty/bin/stty/print.c#4 integrate
.. //depot/projects/mpsafetty/bin/stty/stty.1#5 integrate
.. //depot/projects/mpsafetty/sys/amd64/amd64/local_apic.c#2 integrate
.. //depot/projects/mpsafetty/sys/conf/files.sparc64#2 integrate
.. //depot/projects/mpsafetty/sys/dev/gem/if_gem.c#2 integrate
.. //depot/projects/mpsafetty/sys/i386/cpufreq/est.c#3 integrate
.. //depot/projects/mpsafetty/sys/i386/i386/local_apic.c#3 integrate
.. //depot/projects/mpsafetty/sys/kern/tty_outq.c#9 integrate
.. //depot/projects/mpsafetty/sys/kern/vfs_cache.c#4 integrate
.. //depot/projects/mpsafetty/sys/netinet/tcp_syncache.c#7 integrate
.. //depot/projects/mpsafetty/sys/security/audit/audit_syscalls.c#4 integrate
.. //depot/projects/mpsafetty/sys/sparc64/conf/GENERIC#7 integrate
.. //depot/projects/mpsafetty/sys/sparc64/conf/NOTES#2 integrate
.. //depot/projects/mpsafetty/sys/vm/uma_core.c#3 integrate

Differences ...

==== //depot/projects/mpsafetty/bin/stty/modes.c#3 (text+ko) ====

@@ -33,7 +33,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/stty/modes.c,v 1.13 2004/04/06 20:06:53 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/stty/modes.c,v 1.14 2008/08/23 13:28:55 ed Exp $");
 
 #include <sys/types.h>
 #include <stddef.h>

==== //depot/projects/mpsafetty/bin/stty/print.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
 #endif
 #endif /* not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/stty/print.c,v 1.21 2008/07/16 11:20:04 ed Exp $");
+__FBSDID("$FreeBSD: src/bin/stty/print.c,v 1.22 2008/08/23 13:28:55 ed Exp $");
 
 #include <sys/types.h>
 

==== //depot/projects/mpsafetty/bin/stty/stty.1#5 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)stty.1	8.4 (Berkeley) 4/18/94
-.\" $FreeBSD: src/bin/stty/stty.1,v 1.33 2005/02/09 17:37:39 ru Exp $
+.\" $FreeBSD: src/bin/stty/stty.1,v 1.34 2008/08/23 13:28:55 ed Exp $
 .\"
 .Dd August 23, 2008
 .Dt STTY 1

==== //depot/projects/mpsafetty/sys/amd64/amd64/local_apic.c#2 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.45 2008/05/24 06:32:26 jb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.46 2008/08/23 12:35:43 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -77,10 +77,6 @@
 CTASSERT(APIC_LOCAL_INTS == 240);
 CTASSERT(IPI_STOP < APIC_SPURIOUS_INT);
 
-#define	LAPIC_TIMER_HZ_DIVIDER		2
-#define	LAPIC_TIMER_STATHZ_DIVIDER	15
-#define	LAPIC_TIMER_PROFHZ_DIVIDER	3
-
 /* Magic IRQ values for the timer and syscalls. */
 #define	IRQ_TIMER	(NUM_IO_INTS + 1)
 #define	IRQ_SYSCALL	(NUM_IO_INTS + 2)
@@ -389,13 +385,24 @@
 		    lapic_timer_divisor, value);
 
 	/*
-	 * We will drive the timer at a small multiple of hz and drive
-	 * both of the other timers with similarly small but relatively
-	 * prime divisors.
+	 * We want to run stathz in the neighborhood of 128hz.  We would
+	 * like profhz to run as often as possible, so we let it run on
+	 * each clock tick.  We try to honor the requested 'hz' value as
+	 * much as possible.
+	 *
+	 * If 'hz' is above 1500, then we just let the lapic timer
+	 * (and profhz) run at hz.  If 'hz' is below 1500 but above
+	 * 750, then we let the lapic timer run at 2 * 'hz'.  If 'hz'
+	 * is below 750 then we let the lapic timer run at 4 * 'hz'.
 	 */
-	lapic_timer_hz = hz * LAPIC_TIMER_HZ_DIVIDER;
-	stathz = lapic_timer_hz / LAPIC_TIMER_STATHZ_DIVIDER;
-	profhz = lapic_timer_hz / LAPIC_TIMER_PROFHZ_DIVIDER;
+	if (hz >= 1500)
+		lapic_timer_hz = hz;
+	else if (hz >= 750)
+		lapic_timer_hz = hz * 2;
+	else
+		lapic_timer_hz = hz * 4;
+	stathz = lapic_timer_hz / (lapic_timer_hz / 128);
+	profhz = lapic_timer_hz;
 	lapic_timer_period = value / lapic_timer_hz;
 
 	/*

==== //depot/projects/mpsafetty/sys/conf/files.sparc64#2 (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.sparc64,v 1.95 2008/04/26 11:01:37 marius Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.96 2008/08/23 14:28:44 marius Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -74,7 +74,7 @@
 libkern/flsl.c			standard
 sparc64/central/central.c	optional	central
 sparc64/ebus/ebus.c		optional	ebus
-sparc64/fhc/clkbrd.c		optional	clkbrd fhc
+sparc64/fhc/clkbrd.c		optional	fhc
 sparc64/fhc/fhc.c		optional	fhc
 sparc64/isa/isa.c		optional	isa
 sparc64/isa/isa_dma.c		optional	isa

==== //depot/projects/mpsafetty/sys/dev/gem/if_gem.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.50 2008/06/22 13:54:51 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.51 2008/08/23 15:03:26 marius Exp $");
 
 /*
  * Driver for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers
@@ -87,7 +87,7 @@
 #define	TRIES	10000
 
 /*
- * The GEM hardware support basic TCP/UDP checksum offloading.  However,
+ * The hardware supports basic TCP/UDP checksum offloading.  However,
  * the hardware doesn't compensate the checksum for UDP datagram which
  * can yield to 0x0.  As a safe guard, UDP checksum offload is disabled
  * by default.  It can be reactivated by setting special link option
@@ -536,18 +536,26 @@
 {
 	struct gem_softc *sc = arg;
 	struct ifnet *ifp;
+	uint32_t v;
 
 	GEM_LOCK_ASSERT(sc, MA_OWNED);
 
 	ifp = sc->sc_ifp;
 	/*
-	 * Unload collision counters.
+	 * Unload collision and error counters.
 	 */
 	ifp->if_collisions +=
 	    GEM_BANK1_READ_4(sc, GEM_MAC_NORM_COLL_CNT) +
-	    GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT) +
-	    GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT);
+	v = GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) +
 	    GEM_BANK1_READ_4(sc, GEM_MAC_LATE_COLL_CNT);
+	ifp->if_collisions += v;
+	ifp->if_oerrors += v;
+	ifp->if_ierrors +=
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_LEN_ERR_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_ALIGN_ERR) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CRC_ERR_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL);
 
 	/*
 	 * Then clear the hardware counters.
@@ -556,6 +564,10 @@
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_FIRST_COLL_CNT, 0);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_EXCESS_COLL_CNT, 0);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_LATE_COLL_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_LEN_ERR_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_ALIGN_ERR, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CRC_ERR_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CODE_VIOL, 0);
 
 	mii_tick(sc->sc_mii);
 
@@ -1739,7 +1751,7 @@
 /*
  * MII interface
  *
- * The GEM MII interface supports at least three different operating modes:
+ * The MII interface supports at least three different operating modes:
  *
  * Bitbang mode is implemented using data, clock and output enable registers.
  *
@@ -1971,12 +1983,12 @@
 	v |= GEM_MAC_XIF_TX_MII_ENA;
 	if ((sc->sc_flags & GEM_SERDES) == 0) {
 		if ((GEM_BANK1_READ_4(sc, GEM_MIF_CONFIG) &
-		    GEM_MIF_CONFIG_PHY_SEL) != 0 &&
-		    (IFM_OPTIONS(sc->sc_mii->mii_media_active) &
-		    IFM_FDX) == 0)
+		    GEM_MIF_CONFIG_PHY_SEL) != 0) {
 			/* External MII needs echo disable if half duplex. */
-			v |= GEM_MAC_XIF_ECHO_DISABL;
-		else
+		    	if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) &
+			    IFM_FDX) == 0)
+				v |= GEM_MAC_XIF_ECHO_DISABL;
+		} else
 			/*
 			 * Internal MII needs buffer enable.
 			 * XXX buffer enable makes only sense for an

==== //depot/projects/mpsafetty/sys/i386/cpufreq/est.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/cpufreq/est.c,v 1.18 2008/08/13 16:09:40 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/cpufreq/est.c,v 1.19 2008/08/23 12:53:42 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -38,6 +38,7 @@
 #include <sys/systm.h>
 
 #include "cpufreq_if.h"
+#include <machine/clock.h>
 #include <machine/md_var.h>
 #include <machine/specialreg.h>
 
@@ -71,6 +72,7 @@
 struct est_softc {
 	device_t	dev;
 	int		acpi_settings;
+	int		msr_settings;
 	freq_info	*freq_list;
 };
 
@@ -898,6 +900,7 @@
 static int	est_get_info(device_t dev);
 static int	est_acpi_info(device_t dev, freq_info **freqs);
 static int	est_table_info(device_t dev, uint64_t msr, freq_info **freqs);
+static int	est_msr_info(device_t dev, uint64_t msr, freq_info **freqs);
 static freq_info *est_get_current(freq_info *freq_list);
 static int	est_settings(device_t dev, struct cf_setting *sets, int *count);
 static int	est_set(device_t dev, const struct cf_setting *set);
@@ -1035,7 +1038,7 @@
 	struct est_softc *sc;
 
 	sc = device_get_softc(dev);
-	if (sc->acpi_settings)
+	if (sc->acpi_settings || sc->msr_settings)
 		free(sc->freq_list, M_DEVBUF);
 #endif
 	return (ENXIO);
@@ -1060,6 +1063,8 @@
 	error = est_table_info(dev, msr, &sc->freq_list);
 	if (error)
 		error = est_acpi_info(dev, &sc->freq_list);
+	if (error)
+		error = est_msr_info(dev, msr, &sc->freq_list);
 
 	if (error) {
 		printf(
@@ -1165,6 +1170,88 @@
 	return (0);
 }
 
+static int
+bus_speed_ok(int bus)
+{
+
+	switch (bus) {
+	case 100:
+	case 133:
+	case 333:
+		return (1);
+	default:
+		return (0);
+	}
+}
+
+/*
+ * Flesh out a simple rate table containing the high and low frequencies
+ * based on the current clock speed and the upper 32 bits of the MSR.
+ */
+static int
+est_msr_info(device_t dev, uint64_t msr, freq_info **freqs)
+{
+	struct est_softc *sc;
+	freq_info *fp;
+	int bus, freq, volts;
+	uint16_t id;
+
+	/* Figure out the bus clock. */
+	freq = tsc_freq / 1000000;
+	id = msr >> 32;
+	bus = freq / (id >> 8);
+	device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus);
+	if (!bus_speed_ok(bus)) {
+		/* We may be running on the low frequency. */
+		id = msr >> 48;
+		bus = freq / (id >> 8);
+		device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus);
+		if (!bus_speed_ok(bus))
+			return (EOPNOTSUPP);
+		
+		/* Calculate high frequency. */
+		id = msr >> 32;
+		freq = ((id >> 8) & 0xff) * bus;
+	}
+
+	/* Fill out a new freq table containing just the high and low freqs. */
+	sc = device_get_softc(dev);
+	fp = malloc(sizeof(freq_info) * 3, M_DEVBUF, M_WAITOK | M_ZERO);
+
+	/* First, the high frequency. */
+	volts = id & 0xff;
+	if (volts != 0) {
+		volts <<= 4;
+		volts += 700;
+	}
+	fp[0].freq = freq;
+	fp[0].volts = volts;
+	fp[0].id16 = id;
+	fp[0].power = CPUFREQ_VAL_UNKNOWN;
+	device_printf(dev, "Guessed high setting of %d MHz @ %d Mv\n", freq,
+	    volts);
+
+	/* Second, the low frequency. */
+	id = msr >> 48;
+	freq = ((id >> 8) & 0xff) * bus;
+	volts = id & 0xff;
+	if (volts != 0) {
+		volts <<= 4;
+		volts += 700;
+	}
+	fp[1].freq = freq;
+	fp[1].volts = volts;
+	fp[1].id16 = id;
+	fp[1].power = CPUFREQ_VAL_UNKNOWN;
+	device_printf(dev, "Guessed low setting of %d MHz @ %d Mv\n", freq,
+	    volts);
+
+	/* Table is already terminated due to M_ZERO. */
+	sc->msr_settings = TRUE;
+	*freqs = fp;
+	return (0);
+}
+
 static void
 est_get_id16(uint16_t *id16_p)
 {

==== //depot/projects/mpsafetty/sys/i386/i386/local_apic.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.47 2008/08/22 20:38:25 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.48 2008/08/23 12:35:43 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -77,10 +77,6 @@
 CTASSERT(APIC_LOCAL_INTS == 240);
 CTASSERT(IPI_STOP < APIC_SPURIOUS_INT);
 
-#define	LAPIC_TIMER_HZ_DIVIDER		2
-#define	LAPIC_TIMER_STATHZ_DIVIDER	15
-#define	LAPIC_TIMER_PROFHZ_DIVIDER	3
-
 /* Magic IRQ values for the timer and syscalls. */
 #define	IRQ_TIMER	(NUM_IO_INTS + 1)
 #define	IRQ_SYSCALL	(NUM_IO_INTS + 2)
@@ -391,13 +387,24 @@
 		    lapic_timer_divisor, value);
 
 	/*
-	 * We will drive the timer at a small multiple of hz and drive
-	 * both of the other timers with similarly small but relatively
-	 * prime divisors.
+	 * We want to run stathz in the neighborhood of 128hz.  We would
+	 * like profhz to run as often as possible, so we let it run on
+	 * each clock tick.  We try to honor the requested 'hz' value as
+	 * much as possible.
+	 *
+	 * If 'hz' is above 1500, then we just let the lapic timer
+	 * (and profhz) run at hz.  If 'hz' is below 1500 but above
+	 * 750, then we let the lapic timer run at 2 * 'hz'.  If 'hz'
+	 * is below 750 then we let the lapic timer run at 4 * 'hz'.
 	 */
-	lapic_timer_hz = hz * LAPIC_TIMER_HZ_DIVIDER;
-	stathz = lapic_timer_hz / LAPIC_TIMER_STATHZ_DIVIDER;
-	profhz = lapic_timer_hz / LAPIC_TIMER_PROFHZ_DIVIDER;
+	if (hz >= 1500)
+		lapic_timer_hz = hz;
+	else if (hz >= 750)
+		lapic_timer_hz = hz * 2;
+	else
+		lapic_timer_hz = hz * 4;
+	stathz = lapic_timer_hz / (lapic_timer_hz / 128);
+	profhz = lapic_timer_hz;
 	lapic_timer_period = value / lapic_timer_hz;
 
 	/*

==== //depot/projects/mpsafetty/sys/kern/tty_outq.c#9 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/tty_outq.c,v 1.1 2008/08/20 08:31:58 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/tty_outq.c,v 1.2 2008/08/23 13:32:21 ed Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>

==== //depot/projects/mpsafetty/sys/kern/vfs_cache.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_cache.c,v 1.123 2008/08/16 21:48:10 alfred Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_cache.c,v 1.124 2008/08/23 15:13:39 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -500,8 +500,39 @@
 
 	hold = 0;
 	zap = 0;
+
+	/*
+	 * Calculate the hash key and setup as much of the new
+	 * namecache entry as possible before acquiring the lock.
+	 */
 	ncp = cache_alloc(cnp->cn_namelen);
+	ncp->nc_vp = vp;
+	ncp->nc_dvp = dvp;
+	len = ncp->nc_nlen = cnp->cn_namelen;
+	hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT);
+	bcopy(cnp->cn_nameptr, ncp->nc_name, len);
+	hash = fnv_32_buf(&dvp, sizeof(dvp), hash);
 	CACHE_LOCK();
+
+	/*
+	 * See if this vnode is already in the cache with this name.
+	 * This can happen with concurrent lookups of the same path
+	 * name.
+	 */
+	if (vp) {
+		struct namecache *n2;
+
+		TAILQ_FOREACH(n2, &vp->v_cache_dst, nc_dst) {
+			if (n2->nc_dvp == dvp &&
+			    n2->nc_nlen == cnp->cn_namelen &&
+			    !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) {
+				CACHE_UNLOCK();
+				cache_free(ncp);
+				return;
+			}
+		}
+	}	
+
 	numcache++;
 	if (!vp) {
 		numneg++;
@@ -513,16 +544,9 @@
 	}
 
 	/*
-	 * Set the rest of the namecache entry elements, calculate it's
-	 * hash key and insert it into the appropriate chain within
-	 * the cache entries table.
+	 * Insert the new namecache entry into the appropriate chain
+	 * within the cache entries table.
 	 */
-	ncp->nc_vp = vp;
-	ncp->nc_dvp = dvp;
-	len = ncp->nc_nlen = cnp->cn_namelen;
-	hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT);
-	bcopy(cnp->cn_nameptr, ncp->nc_name, len);
-	hash = fnv_32_buf(&dvp, sizeof(dvp), hash);
 	ncpp = NCHHASH(hash);
 	LIST_INSERT_HEAD(ncpp, ncp, nc_hash);
 	if (LIST_EMPTY(&dvp->v_cache_src)) {

==== //depot/projects/mpsafetty/sys/netinet/tcp_syncache.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netinet/tcp_syncache.c,v 1.152 2008/08/20 01:05:56 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/netinet/tcp_syncache.c,v 1.154 2008/08/23 14:22:12 bz Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -53,6 +53,7 @@
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <sys/syslog.h>
+#include <sys/ucred.h>
 #include <sys/vimage.h>
 
 #include <vm/uma.h>
@@ -146,6 +147,7 @@
 #ifdef MAC
 	struct label	*sc_label;		/* MAC label reference */
 #endif
+	struct ucred	*sc_cred;		/* cred cache for jail checks */
 };
 
 #ifdef TCP_OFFLOAD_DISABLE
@@ -264,6 +266,8 @@
 {
 	if (sc->sc_ipopts)
 		(void) m_free(sc->sc_ipopts);
+	if (sc->sc_cred)
+		crfree(sc->sc_cred);
 #ifdef MAC
 	mac_syncache_destroy(&sc->sc_label);
 #endif
@@ -1010,6 +1014,7 @@
 	struct label *maclabel;
 #endif
 	struct syncache scs;
+	struct ucred *cred;
 
 	INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
 	INP_WLOCK_ASSERT(inp);			/* listen socket */
@@ -1022,6 +1027,7 @@
 	 */
 	so = *lsop;
 	tp = sototcpcb(so);
+	cred = crhold(so->so_cred);
 
 #ifdef INET6
 	if (inc->inc_isipv6 &&
@@ -1034,6 +1040,7 @@
 	sb_hiwat = so->so_rcv.sb_hiwat;
 	noopt = (tp->t_flags & TF_NOOPT);
 
+	/* By the time we drop the lock these should no longer be used. */
 	so = NULL;
 	tp = NULL;
 
@@ -1150,6 +1157,8 @@
 #ifdef MAC
 	sc->sc_label = maclabel;
 #endif
+	sc->sc_cred = cred;
+	cred = NULL;
 	sc->sc_ipopts = ipopts;
 	sc->sc_inc.inc_fibnum = inp->inp_inc.inc_fibnum;
 	bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo));
@@ -1271,6 +1280,8 @@
 	}
 
 done:
+	if (cred != NULL)
+		crfree(cred);
 #ifdef MAC
 	if (sc == &scs)
 		mac_syncache_destroy(&maclabel);
@@ -1761,6 +1772,8 @@
 				SCH_UNLOCK(sch);
 				goto exit;
 			}
+			if (cr_cansee(req->td->td_ucred, sc->sc_cred) != 0)
+				continue;
 			bzero(&xt, sizeof(xt));
 			xt.xt_len = sizeof(xt);
 			if (sc->sc_inc.inc_isipv6)

==== //depot/projects/mpsafetty/sys/security/audit/audit_syscalls.c#4 (text) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/security/audit/audit_syscalls.c,v 1.28 2008/07/31 09:54:35 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/security/audit/audit_syscalls.c,v 1.29 2008/08/23 14:39:01 rwatson Exp $");
 
 #include "opt_mac.h"
 
@@ -508,7 +508,7 @@
 	if (error)
 		return (error);
 	if (td->td_ucred->cr_audit.ai_termid.at_type == AU_IPv6)
-		return (E2BIG);
+		return (EOVERFLOW);
 	bzero(&ai, sizeof(ai));
 	ai.ai_auid = td->td_ucred->cr_audit.ai_auid;
 	ai.ai_mask = td->td_ucred->cr_audit.ai_mask;

==== //depot/projects/mpsafetty/sys/sparc64/conf/GENERIC#7 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.140 2008/08/20 08:31:58 ed Exp $
+# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.142 2008/08/23 14:28:44 marius Exp $
 
 cpu		SUN4U
 ident		GENERIC
@@ -128,6 +128,8 @@
 device		atkbd		# AT keyboard
 device		psm		# PS/2 mouse
 
+device		kbdmux		# keyboard multiplexer
+
 # syscons is the default console driver, resembling an SCO console
 device		sc
 device		creator		# Creator, Creator3D and Elite3D framebuffers
@@ -139,7 +141,6 @@
 
 # Builtin hardware
 device		auxio		# auxiliary I/O device
-device		clkbrd		# Clock Board (blinkenlight on Sun Exx00)
 device		eeprom		# eeprom (really a front-end for the MK48Txx)
 device		mk48txx		# Mostek MK48Txx clocks
 device		rtc		# rtc (really a front-end for the MC146818)
@@ -157,7 +158,7 @@
 #device		plip		# TCP/IP over parallel
 #device		ppi		# Parallel port interface device
 #device		vpo		# Requires scbus and da
- 
+
 # PCI Ethernet NICs.
 #device		de		# DEC/Intel DC21x4x (``Tulip'')
 device		em		# Intel PRO/1000 adapter Gigabit Ethernet Card
@@ -192,8 +193,8 @@
 
 # Wireless NIC cards
 device		wlan		# 802.11 support
-options		IEEE80211_DEBUG	# enable debug msgs
-options		IEEE80211_AMPDU_AGE	# age frames in AMPDU reorder q's
+options 	IEEE80211_DEBUG	# enable debug msgs
+options 	IEEE80211_AMPDU_AGE	# age frames in AMPDU reorder q's
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

==== //depot/projects/mpsafetty/sys/sparc64/conf/NOTES#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/sparc64/conf/NOTES,v 1.31 2008/04/21 10:09:55 phk Exp $
+# $FreeBSD: src/sys/sparc64/conf/NOTES,v 1.32 2008/08/23 14:28:44 marius Exp $
 #
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
@@ -43,7 +43,6 @@
 #
 
 device		auxio		# auxiliary I/O device
-device		clkbrd		# Clock Board (blinkenlight on Sun Exx00)
 device		creator		# Creator, Creator3D and Elite3D framebuffers
 device		machfb		# ATI Mach64 framebuffers
 

==== //depot/projects/mpsafetty/sys/vm/uma_core.c#3 (text+ko) ====

@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.150 2008/08/23 01:35:36 nwhitehorn Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.151 2008/08/23 12:40:07 antoine Exp $");
 
 /* I should really use ktr.. */
 /*
@@ -249,13 +249,6 @@
 static int sysctl_vm_zone_count(SYSCTL_HANDLER_ARGS);
 static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS);
 
-#ifdef WITNESS
-static int nosleepwithlocks = 1;
-#else
-static int nosleepwithlocks = 0;
-#endif
-SYSCTL_INT(_debug, OID_AUTO, nosleepwithlocks, CTLFLAG_RW, &nosleepwithlocks,
-    0, "Convert M_WAITOK to M_NOWAIT to avoid lock-held-across-sleep paths");
 SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL);
 
 SYSCTL_PROC(_vm, OID_AUTO, zone_count, CTLFLAG_RD|CTLTYPE_INT,



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