svn commit: r234136 - in user/attilio/vmcontention: contrib/openbsm/libauditd etc/defaults etc/rc.d etc/root lib/libc/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sys lib/libcrypt lib/l...

Attilio Rao attilio at FreeBSD.org
Wed Apr 11 14:54:07 UTC 2012


Author: attilio
Date: Wed Apr 11 14:54:06 2012
New Revision: 234136
URL: http://svn.freebsd.org/changeset/base/234136

Log:
  MFC

Added:
  user/attilio/vmcontention/etc/rc.d/kfd
     - copied unchanged from r234135, head/etc/rc.d/kfd
  user/attilio/vmcontention/sys/dev/uart/uart_cpu_x86.c
     - copied unchanged from r234135, head/sys/dev/uart/uart_cpu_x86.c
Deleted:
  user/attilio/vmcontention/sys/dev/uart/uart_cpu_amd64.c
  user/attilio/vmcontention/sys/dev/uart/uart_cpu_i386.c
Modified:
  user/attilio/vmcontention/contrib/openbsm/libauditd/auditd_lib.c
  user/attilio/vmcontention/etc/defaults/rc.conf
  user/attilio/vmcontention/etc/rc.d/Makefile
  user/attilio/vmcontention/etc/root/dot.cshrc
  user/attilio/vmcontention/lib/libc/gen/sem_new.c
  user/attilio/vmcontention/lib/libc/powerpc/gen/_setjmp.S
  user/attilio/vmcontention/lib/libc/powerpc/gen/setjmp.S
  user/attilio/vmcontention/lib/libc/powerpc/gen/sigsetjmp.S
  user/attilio/vmcontention/lib/libc/powerpc64/gen/_setjmp.S
  user/attilio/vmcontention/lib/libc/powerpc64/gen/setjmp.S
  user/attilio/vmcontention/lib/libc/powerpc64/gen/sigsetjmp.S
  user/attilio/vmcontention/lib/libc/sys/chflags.2
  user/attilio/vmcontention/lib/libc/sys/dup.2
  user/attilio/vmcontention/lib/libc/sys/fcntl.2
  user/attilio/vmcontention/lib/libcrypt/crypt.3
  user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c
  user/attilio/vmcontention/lib/libgeom/libgeom.h
  user/attilio/vmcontention/sbin/bsdlabel/bsdlabel.c
  user/attilio/vmcontention/sbin/mdconfig/mdconfig.8
  user/attilio/vmcontention/sbin/savecore/savecore.c
  user/attilio/vmcontention/sbin/sysctl/sysctl.c
  user/attilio/vmcontention/share/examples/csh/dot.cshrc
  user/attilio/vmcontention/sys/amd64/amd64/identcpu.c
  user/attilio/vmcontention/sys/amd64/amd64/machdep.c
  user/attilio/vmcontention/sys/amd64/amd64/mp_machdep.c
  user/attilio/vmcontention/sys/conf/files.amd64
  user/attilio/vmcontention/sys/conf/files.i386
  user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h
  user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
  user/attilio/vmcontention/sys/dev/ath/if_ath.c
  user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c
  user/attilio/vmcontention/sys/dev/ath/if_athioctl.h
  user/attilio/vmcontention/sys/dev/ath/if_athvar.h
  user/attilio/vmcontention/sys/dev/bce/if_bce.c
  user/attilio/vmcontention/sys/dev/bce/if_bcereg.h
  user/attilio/vmcontention/sys/dev/isci/isci.h
  user/attilio/vmcontention/sys/dev/isci/isci_controller.c
  user/attilio/vmcontention/sys/dev/isci/isci_io_request.c
  user/attilio/vmcontention/sys/dev/isci/isci_remote_device.c
  user/attilio/vmcontention/sys/dev/sfxge/sfxge_rx.c
  user/attilio/vmcontention/sys/fs/ext2fs/ext2_vnops.c
  user/attilio/vmcontention/sys/i386/i386/identcpu.c
  user/attilio/vmcontention/sys/i386/i386/machdep.c
  user/attilio/vmcontention/sys/i386/i386/mp_machdep.c
  user/attilio/vmcontention/sys/kern/kern_descrip.c
  user/attilio/vmcontention/sys/kern/kern_sig.c
  user/attilio/vmcontention/sys/kern/sched_ule.c
  user/attilio/vmcontention/sys/net/if_media.h
  user/attilio/vmcontention/sys/netinet/in.c
  user/attilio/vmcontention/sys/netinet/ip_carp.c
  user/attilio/vmcontention/sys/ofed/drivers/net/mlx4/en_netdev.c
  user/attilio/vmcontention/sys/ofed/drivers/net/mlx4/en_port.c
  user/attilio/vmcontention/sys/ofed/drivers/net/mlx4/en_port.h
  user/attilio/vmcontention/sys/pci/intpm.c
  user/attilio/vmcontention/sys/powerpc/powerpc/exec_machdep.c
  user/attilio/vmcontention/sys/ufs/ffs/ffs_vfsops.c
  user/attilio/vmcontention/sys/ufs/ufs/ufs_vnops.c
  user/attilio/vmcontention/sys/vm/vm_mmap.c
  user/attilio/vmcontention/sys/vm/vm_reserv.c
  user/attilio/vmcontention/sys/x86/include/specialreg.h
  user/attilio/vmcontention/usr.bin/kdump/Makefile
  user/attilio/vmcontention/usr.bin/kdump/mkioctls
  user/attilio/vmcontention/usr.bin/lex/flex.skl
  user/attilio/vmcontention/usr.bin/truss/Makefile
  user/attilio/vmcontention/usr.sbin/powerd/powerd.c
Directory Properties:
  user/attilio/vmcontention/   (props changed)
  user/attilio/vmcontention/contrib/openbsm/   (props changed)
  user/attilio/vmcontention/lib/libc/   (props changed)
  user/attilio/vmcontention/sbin/   (props changed)
  user/attilio/vmcontention/sys/   (props changed)
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/sys/conf/   (props changed)

Modified: user/attilio/vmcontention/contrib/openbsm/libauditd/auditd_lib.c
==============================================================================
--- user/attilio/vmcontention/contrib/openbsm/libauditd/auditd_lib.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/contrib/openbsm/libauditd/auditd_lib.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -520,6 +520,7 @@ auditd_expire_trails(int (*warn_expired)
 				}
 
 		}
+		closedir(dirp);
 	}
 
 	oldest_time = current_time - expire_age;

Modified: user/attilio/vmcontention/etc/defaults/rc.conf
==============================================================================
--- user/attilio/vmcontention/etc/defaults/rc.conf	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/etc/defaults/rc.conf	Wed Apr 11 14:54:06 2012	(r234136)
@@ -297,6 +297,8 @@ kadmind5_server_enable="NO"	# Run kadmin
 kadmind5_server="/usr/libexec/kadmind"	# path to kerberos 5 admin daemon
 kpasswdd_server_enable="NO"	# Run kpasswdd (or NO)
 kpasswdd_server="/usr/libexec/kpasswdd"	# path to kerberos 5 passwd daemon
+kfd_server_enable="NO"		# Run kfd (or NO)
+kfd_server="/usr/libexec/kfd"	# path to kerberos 5 kfd daemon
 
 gssd_enable="NO"		# Run the gssd daemon (or NO).
 gssd_flags=""			# Flags for gssd.

Modified: user/attilio/vmcontention/etc/rc.d/Makefile
==============================================================================
--- user/attilio/vmcontention/etc/rc.d/Makefile	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/etc/rc.d/Makefile	Wed Apr 11 14:54:06 2012	(r234136)
@@ -66,6 +66,7 @@ FILES=	DAEMON \
 	kadmind \
 	kerberos \
 	keyserv \
+	kfd \
 	kld \
 	kldxref \
 	kpasswdd \

Copied: user/attilio/vmcontention/etc/rc.d/kfd (from r234135, head/etc/rc.d/kfd)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmcontention/etc/rc.d/kfd	Wed Apr 11 14:54:06 2012	(r234136, copy of r234135, head/etc/rc.d/kfd)
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: kfd
+# BEFORE: DAEMON
+
+. /etc/rc.subr
+
+name="kfd"
+load_rc_config $name
+rcvar="kfd_server_enable"
+unset start_cmd
+command="${kfd_server}"
+kfd_flags="-i"
+command_args="&"
+
+run_rc_command "$1"

Modified: user/attilio/vmcontention/etc/root/dot.cshrc
==============================================================================
--- user/attilio/vmcontention/etc/root/dot.cshrc	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/etc/root/dot.cshrc	Wed Apr 11 14:54:06 2012	(r234136)
@@ -23,12 +23,15 @@ setenv	BLOCKSIZE	K
 
 if ($?prompt) then
 	# An interactive shell -- set some stuff up
-	set prompt = "%n@%m:%c04%# "
+	if ($uid == 0) then
+		set user = root
+	endif
+	set prompt = "%n@%m:%/ %# "
 	set promptchars = "%#"
 
 	set filec
 	set history = 1000
-	set savehist = 1000
+	set savehist = (1000 merge)
 	set autolist = ambiguous
 	# Use history to aid expansion
 	set autoexpand
@@ -38,10 +41,6 @@ if ($?prompt) then
 		bindkey "^W" backward-delete-word
 		bindkey -k up history-search-backward
 		bindkey -k down history-search-forward
-
-		bindkey "\e[1~" beginning-of-line #make Home key work;
-		bindkey "\e[3~" delete-char #make Delete key work;
-		bindkey "\e[4~" end-of-line #make End key work;
 	endif
 
 endif

Modified: user/attilio/vmcontention/lib/libc/gen/sem_new.c
==============================================================================
--- user/attilio/vmcontention/lib/libc/gen/sem_new.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/gen/sem_new.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -162,10 +162,16 @@ _sem_open(const char *name, int flags, .
 	_pthread_mutex_lock(&sem_llock);
 	LIST_FOREACH(ni, &sem_list, next) {
 		if (strcmp(name, ni->name) == 0) {
-			ni->open_count++;
-			sem = ni->sem;
-			_pthread_mutex_unlock(&sem_llock);
-			return (sem);
+			if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) {
+				_pthread_mutex_unlock(&sem_llock);
+				errno = EEXIST;
+				return (SEM_FAILED);
+			} else {
+				ni->open_count++;
+				sem = ni->sem;
+				_pthread_mutex_unlock(&sem_llock);
+				return (sem);
+			}
 		}
 	}
 

Modified: user/attilio/vmcontention/lib/libc/powerpc/gen/_setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc/gen/_setjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc/gen/_setjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -63,7 +63,6 @@ ENTRY(_longjmp)
 	lmw	%r9,20(%r3)
 	mtlr	%r11
 	mtcr	%r12
-	mr	%r2,%r9
 	mr	%r1,%r10
 	or.	%r3,%r4,%r4
 	bnelr

Modified: user/attilio/vmcontention/lib/libc/powerpc/gen/setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc/gen/setjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc/gen/setjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -75,7 +75,6 @@ ENTRY(__longjmp)
 	mr	%r6,%r4			/* save val param */
 	mtlr	%r11			/* r11 -> link reg */
 	mtcr	%r12			/* r12 -> condition reg */
-	mr	%r2,%r9			/* r9  -> global ptr */
 	mr	%r1,%r10		/* r10 -> stackptr */
 	mr	%r4,%r3
 	li	%r3,3			/* SIG_SETMASK */

Modified: user/attilio/vmcontention/lib/libc/powerpc/gen/sigsetjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc/gen/sigsetjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc/gen/sigsetjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -80,7 +80,6 @@ ENTRY(siglongjmp)
 	mr	%r6,%r4
 	mtlr	%r11
 	mtcr	%r12
-	mr	%r2,%r9
 	mr	%r1,%r10
 	or.	%r7,%r7,%r7
 	beq	1f

Modified: user/attilio/vmcontention/lib/libc/powerpc64/gen/_setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc64/gen/_setjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc64/gen/_setjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -86,7 +86,6 @@ ENTRY(_longjmp)
 	ld	%r10,40 + 1*8(%r3)
 	ld	%r11,40 + 2*8(%r3)
 	ld	%r12,40 + 3*8(%r3)
-	ld	%r13,40 + 4*8(%r3)
 	ld	%r14,40 + 5*8(%r3)
 	ld	%r15,40 + 6*8(%r3)
 	ld	%r16,40 + 7*8(%r3)

Modified: user/attilio/vmcontention/lib/libc/powerpc64/gen/setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc64/gen/setjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc64/gen/setjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -99,7 +99,6 @@ ENTRY(__longjmp)
 	ld	%r10,40 + 1*8(%r3)
 	ld	%r11,40 + 2*8(%r3)
 	ld	%r12,40 + 3*8(%r3)
-	ld	%r13,40 + 4*8(%r3)
 	ld	%r14,40 + 5*8(%r3)
 	ld	%r15,40 + 6*8(%r3)
 	ld	%r16,40 + 7*8(%r3)

Modified: user/attilio/vmcontention/lib/libc/powerpc64/gen/sigsetjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/powerpc64/gen/sigsetjmp.S	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/powerpc64/gen/sigsetjmp.S	Wed Apr 11 14:54:06 2012	(r234136)
@@ -103,7 +103,6 @@ ENTRY(siglongjmp)
 	ld	%r10,40 + 1*8(%r3)
 	ld	%r11,40 + 2*8(%r3)
 	ld	%r12,40 + 3*8(%r3)
-	ld	%r13,40 + 4*8(%r3)
 	ld	%r14,40 + 5*8(%r3)
 	ld	%r15,40 + 6*8(%r3)
 	ld	%r16,40 + 7*8(%r3)

Modified: user/attilio/vmcontention/lib/libc/sys/chflags.2
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/chflags.2	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/sys/chflags.2	Wed Apr 11 14:54:06 2012	(r234136)
@@ -28,7 +28,7 @@
 .\"	@(#)chflags.2	8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd Oct 29, 2010
+.Dd Apr 10, 2012
 .Dt CHFLAGS 2
 .Os
 .Sh NAME
@@ -114,8 +114,7 @@ The
 and
 .Dv SF_ARCHIVED
 flags may only be set or unset by the super-user.
-Attempts to set these flags by non-super-users are rejected, attempts by
-non-superusers to clear flags that are already unset are silently ignored.
+Attempts to toggle these flags by non-super-users are rejected.
 These flags may be set at any time, but normally may only be unset when
 the system is in single-user mode.
 (See

Modified: user/attilio/vmcontention/lib/libc/sys/dup.2
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/dup.2	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/sys/dup.2	Wed Apr 11 14:54:06 2012	(r234136)
@@ -128,20 +128,27 @@ indicates the cause of the error.
 .Sh ERRORS
 The
 .Fn dup
-and
-.Fn dup2
-system calls fail if:
+system call fails if:
 .Bl -tag -width Er
 .It Bq Er EBADF
 The
 .Fa oldd
-or
-.Fa newd
 argument
 is not a valid active descriptor
 .It Bq Er EMFILE
 Too many descriptors are active.
 .El
+The
+.Fn dup2
+system call fails if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+The
+.Fa oldd
+argument is not a valid active descriptor or the
+.Fa newd
+argument is negative or exceeds the maximum allowable descriptor number
+.El
 .Sh SEE ALSO
 .Xr accept 2 ,
 .Xr cap_new 2 ,

Modified: user/attilio/vmcontention/lib/libc/sys/fcntl.2
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/fcntl.2	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libc/sys/fcntl.2	Wed Apr 11 14:54:06 2012	(r234136)
@@ -539,8 +539,6 @@ The argument
 .Fa cmd
 is
 .Dv F_DUPFD
-or
-.Dv F_DUP2FD
 and the maximum number of file descriptors permitted for the
 process are already in use,
 or no file descriptors greater than or equal to

Modified: user/attilio/vmcontention/lib/libcrypt/crypt.3
==============================================================================
--- user/attilio/vmcontention/lib/libcrypt/crypt.3	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libcrypt/crypt.3	Wed Apr 11 14:54:06 2012	(r234136)
@@ -187,6 +187,8 @@ Blowfish
 .It
 NT-Hash
 .It
+(unused)
+.It
 SHA-256
 .It
 SHA-512

Modified: user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c
==============================================================================
--- user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -55,56 +55,9 @@ struct mystate {
 	int			level;
 	struct sbuf		*sbuf[20];
 	struct gconf		*config;
-	unsigned		nident;
+	int			nident;
 };
 
-static void *
-internalize_ident(struct mystate *mt, const char *element, const char *str)
-{
-	struct gident *gip;
-	unsigned i;
-
-	if (mt->nident != 0 && mt->mesh->lg_ident == NULL) {
-		warn("Cannot continue due to previous memory exhaustion.");
-		return (NULL);
-	}
-
-	for (i = 0; i < mt->nident; i++) {
-		if (strcmp(mt->mesh->lg_ident[i].lg_id, str) != 0)
-			continue;
-		return ((void *)(uintptr_t)(i + 1));
-	}
-
-	i = mt->nident;
-	mt->nident++;
-	mt->mesh->lg_ident = reallocf(mt->mesh->lg_ident, (mt->nident + 1) * sizeof mt->mesh->lg_ident[0]);
-	if (mt->mesh->lg_ident == NULL) {
-		warn("Cannot allocate memory during processing of '%s' "
-		    "element for identifier '%s'", element, str);
-		return (NULL);
-	}
-
-	gip = &mt->mesh->lg_ident[i];
-	gip->lg_id = strdup(str);
-	if (gip->lg_id == NULL) {
-		free(mt->mesh->lg_ident);
-		mt->mesh->lg_ident = NULL;
-		warn("Cannot allocate memory during processing of '%s' "
-		    "element for identifier '%s'", element, str);
-		return (NULL);
-	}
-	gip->lg_ptr = NULL;
-	gip->lg_what = ISUNRESOLVED;
-
-	/* Terminator entry.  */
-	gip = &mt->mesh->lg_ident[i + 1];
-	gip->lg_id = NULL;
-	gip->lg_ptr = NULL;
-	gip->lg_what = ISUNRESOLVED;
-
-	return ((void *)(uintptr_t)(i + 1));
-}
-
 static void
 StartElement(void *userData, const char *name, const char **attr)
 {
@@ -120,9 +73,10 @@ StartElement(void *userData, const char 
 	ref = NULL;
 	for (i = 0; attr[i] != NULL; i += 2) {
 		if (!strcmp(attr[i], "id")) {
-			id = internalize_ident(mt, name, attr[i + 1]);
+			id = (void *)strtoul(attr[i + 1], NULL, 0);
+			mt->nident++;
 		} else if (!strcmp(attr[i], "ref")) {
-			ref = internalize_ident(mt, name, attr[i + 1]);
+			ref = (void *)strtoul(attr[i + 1], NULL, 0);
 		} else
 			printf("%*.*s[%s = %s]\n",
 			    mt->level + 1, mt->level + 1, "",
@@ -363,16 +317,11 @@ CharData(void *userData , const XML_Char
 struct gident *
 geom_lookupid(struct gmesh *gmp, const void *id)
 {
-	unsigned i;
-
-	if (gmp->lg_ident == NULL)
-		return (NULL);
+	struct gident *gip;
 
-	for (i = 0; gmp->lg_ident[i].lg_id != NULL; i++) {
-		if (i + 1 != (unsigned)(uintptr_t)id)
-			continue;
-		return (&gmp->lg_ident[i]);
-	}
+	for (gip = gmp->lg_ident; gip->lg_id != NULL; gip++)
+		if (gip->lg_id == id)
+			return (gip);
 	return (NULL);
 }
 
@@ -385,7 +334,6 @@ geom_xml2tree(struct gmesh *gmp, char *p
 	struct ggeom *ge;
 	struct gprovider *pr;
 	struct gconsumer *co;
-	struct gident *gip;
 	int i;
 
 	memset(gmp, 0, sizeof *gmp);
@@ -408,30 +356,33 @@ geom_xml2tree(struct gmesh *gmp, char *p
 		free(mt);
 		return (-1);
 	}
-	if (gmp->lg_ident == NULL && mt->nident != 0) {
-		free(mt);
-		return (ENOMEM);
-	}
+	gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1);
 	free(mt);
+	if (gmp->lg_ident == NULL)
+		return (ENOMEM);
+	i = 0;
 	/* Collect all identifiers */
 	LIST_FOREACH(cl, &gmp->lg_class, lg_class) {
-		gip = geom_lookupid(gmp, cl->lg_id);
-		gip->lg_ptr = cl;
-		gip->lg_what = ISCLASS;
-
+		gmp->lg_ident[i].lg_id = cl->lg_id;
+		gmp->lg_ident[i].lg_ptr = cl;
+		gmp->lg_ident[i].lg_what = ISCLASS;
+		i++;
 		LIST_FOREACH(ge, &cl->lg_geom, lg_geom) {
-			gip = geom_lookupid(gmp, ge->lg_id);
-			gip->lg_ptr = ge;
-			gip->lg_what = ISGEOM;
+			gmp->lg_ident[i].lg_id = ge->lg_id;
+			gmp->lg_ident[i].lg_ptr = ge;
+			gmp->lg_ident[i].lg_what = ISGEOM;
+			i++;
 			LIST_FOREACH(pr, &ge->lg_provider, lg_provider) {
-				gip = geom_lookupid(gmp, pr->lg_id);
-				gip->lg_ptr = pr;
-				gip->lg_what = ISPROVIDER;
+				gmp->lg_ident[i].lg_id = pr->lg_id;
+				gmp->lg_ident[i].lg_ptr = pr;
+				gmp->lg_ident[i].lg_what = ISPROVIDER;
+				i++;
 			}
 			LIST_FOREACH(co, &ge->lg_consumer, lg_consumer) {
-				gip = geom_lookupid(gmp, co->lg_id);
-				gip->lg_ptr = co;
-				gip->lg_what = ISCONSUMER;
+				gmp->lg_ident[i].lg_id = co->lg_id;
+				gmp->lg_ident[i].lg_ptr = co;
+				gmp->lg_ident[i].lg_what = ISCONSUMER;
+				i++;
 			}
 		}
 	}
@@ -498,10 +449,7 @@ geom_deletetree(struct gmesh *gmp)
 	struct ggeom *ge;
 	struct gprovider *pr;
 	struct gconsumer *co;
-	unsigned i;
 
-	for (i = 0; gmp->lg_ident[i].lg_id != NULL; i++)
-		free(gmp->lg_ident[i].lg_id);
 	free(gmp->lg_ident);
 	gmp->lg_ident = NULL;
 	for (;;) {

Modified: user/attilio/vmcontention/lib/libgeom/libgeom.h
==============================================================================
--- user/attilio/vmcontention/lib/libgeom/libgeom.h	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/lib/libgeom/libgeom.h	Wed Apr 11 14:54:06 2012	(r234136)
@@ -71,8 +71,7 @@ struct gident {
 	enum {	ISCLASS,
 		ISGEOM,
 		ISPROVIDER,
-		ISCONSUMER,
-		ISUNRESOLVED }	lg_what;
+		ISCONSUMER }	lg_what;
 };
 
 struct gmesh {

Modified: user/attilio/vmcontention/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- user/attilio/vmcontention/sbin/bsdlabel/bsdlabel.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sbin/bsdlabel/bsdlabel.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -1194,7 +1194,8 @@ checklabel(struct disklabel *lp)
 			lp->d_interleave = vl->d_interleave;
 		if (lp->d_secpercyl == 0)
 			lp->d_secpercyl = vl->d_secpercyl;
-		if (lp->d_secperunit == 0)
+		if (lp->d_secperunit == 0 ||
+		    lp->d_secperunit > vl->d_secperunit)
 			lp->d_secperunit = vl->d_secperunit;
 		if (lp->d_bbsize == 0)
 			lp->d_bbsize = vl->d_bbsize;

Modified: user/attilio/vmcontention/sbin/mdconfig/mdconfig.8
==============================================================================
--- user/attilio/vmcontention/sbin/mdconfig/mdconfig.8	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sbin/mdconfig/mdconfig.8	Wed Apr 11 14:54:06 2012	(r234136)
@@ -41,7 +41,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 21, 2008
+.Dd March 21, 2012
 .Dt MDCONFIG 8
 .Os
 .Sh NAME
@@ -87,7 +87,7 @@ parameters specified and attach it to th
 Detach a memory disk from the system and release all resources.
 .It Fl t Ar type
 Select the type of the memory disk.
-.Bl -tag -width "preload"
+.Bl -tag -width "malloc"
 .It Cm malloc
 Storage for this type of memory disk is allocated with
 .Xr malloc 9 .
@@ -104,31 +104,35 @@ becomes the backing store for this memor
 .It Cm swap
 Storage for this type of memory disk is allocated from buffer
 memory.
-Pages get pushed out to the swap when the system is under memory
+Pages get pushed out to swap when the system is under memory
 pressure, otherwise they stay in the operating memory.
 Using
 .Cm swap
-backing is generally preferable over
+backing is generally preferred instead of using
 .Cm malloc
 backing.
 .El
 .It Fl f Ar file
-Filename to use for the vnode type memory disk. Options
+Filename to use for the vnode type memory disk.
+The
 .Fl a
 and
 .Fl t Ar vnode
-are implied if not specified.
+options are implied if not specified.
 .It Fl l
 List configured devices.
 If given with
 .Fl u ,
 display details about that particular device.
-If
+If the
 .Fl v
-option specified, show all details.
+option is specified, show all details.
 .It Fl n
-When printing md device names, print only the unit number without the
-md prefix.
+When printing 
+.Xr md 4
+device names, print only the unit number without the
+.Xr md 4
+prefix.
 .It Fl s Ar size
 Size of the memory disk.
 .Ar Size
@@ -137,11 +141,12 @@ is the number of 512 byte sectors unless
 or
 .Cm t
 which
-denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. Options
+denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively.
+The
 .Fl a
 and
 .Fl t Ar swap
-are implied if not specified.
+options are implied if not specified.
 .It Fl S Ar sectorsize
 Sectorsize to use for malloc backed device.
 .It Fl x Ar sectors/track
@@ -175,12 +180,12 @@ Allocate and reserve all needed storage 
 .It Oo Cm no Oc Ns Cm cluster
 Enable clustering on this disk.
 .It Oo Cm no Oc Ns Cm compress
-Enable/Disable compression features to reduce memory usage.
+Enable/disable compression features to reduce memory usage.
 .It Oo Cm no Oc Ns Cm force
-Disable/Enable extra sanity checks to prevent the user from doing something
+Disable/enable extra sanity checks to prevent the user from doing something
 that might adversely affect the system.
 .It Oo Cm no Oc Ns Cm readonly
-Enable/Disable readonly mode.
+Enable/disable readonly mode.
 .El
 .It Fl u Ar unit
 Request a specific unit number for the
@@ -197,15 +202,15 @@ is provided for convenience as an abbrev
 .Fl t Ar vnode
 .Fl f Ar file .
 .Sh EXAMPLES
-To create a 4 megabyte
+Create a 4 megabyte
 .Xr malloc 9
 backed memory disk.
-The name of the allocated unit will be output on stdout like
+The name of the allocated unit will be printed on stdout, such as
 .Dq Li md3 :
 .Pp
 .Dl mdconfig -a -t malloc -s 4m
 .Pp
-To create a disk named
+Create a disk named
 .Pa /dev/md4
 with
 .Pa /tmp/boot.flp
@@ -213,12 +218,12 @@ as backing storage:
 .Pp
 .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4
 .Pp
-To detach and free all resources used by
+Detach and free all resources used by
 .Pa /dev/md4 :
 .Pp
 .Dl mdconfig -d -u 4
 .Pp
-To create a 128MByte swap backed disk, initialize an
+Create a 128MByte swap backed disk, initialize an
 .Xr ffs 7
 file system on it, and mount it on
 .Pa /tmp :
@@ -229,7 +234,7 @@ mount /dev/md10 /tmp
 chmod 1777 /tmp
 .Ed
 .Pp
-To create a 5MB file-backed disk
+Create a 5MB file-backed disk
 .Ns ( Fl a
 and
 .Fl t Ar vnode
@@ -242,7 +247,7 @@ newfs md0c
 mount /dev/md0c /mnt
 .Ed
 .Pp
-To create an
+Create an
 .Xr md 4
 device out of an ISO 9660 CD image file
 .Ns ( Fl a

Modified: user/attilio/vmcontention/sbin/savecore/savecore.c
==============================================================================
--- user/attilio/vmcontention/sbin/savecore/savecore.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sbin/savecore/savecore.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include <fcntl.h>
 #include <fstab.h>
 #include <paths.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>

Modified: user/attilio/vmcontention/sbin/sysctl/sysctl.c
==============================================================================
--- user/attilio/vmcontention/sbin/sysctl/sysctl.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sbin/sysctl/sysctl.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -419,7 +419,7 @@ S_vmtotal(int l2, void *p)
 	    v->t_vmshr * pageKilo, v->t_avmshr * pageKilo);
 	printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n",
 	    v->t_rmshr * pageKilo, v->t_armshr * pageKilo);
-	printf("Free Memory Pages:\t%dK\n", v->t_free * pageKilo);
+	printf("Free Memory:\t%dK\n", v->t_free * pageKilo);
 
 	return (0);
 }

Modified: user/attilio/vmcontention/share/examples/csh/dot.cshrc
==============================================================================
--- user/attilio/vmcontention/share/examples/csh/dot.cshrc	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/share/examples/csh/dot.cshrc	Wed Apr 11 14:54:06 2012	(r234136)
@@ -29,11 +29,11 @@ complete service  	'c/-/(e l r v)/' 'p/1
 complete kldunload	'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @'
 complete make           'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@'
 complete pkg_delete     'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@'
-complete pkg_info       'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@"
+complete pkg_info       'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@'
 complete kill		'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
 complete killall	'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/'
 complete dd		'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/='
-alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A
+alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1'
 alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*'
 complete portmaster   'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \
     clean-packages delete-build-only delete-packages force-config help \

Modified: user/attilio/vmcontention/sys/amd64/amd64/identcpu.c
==============================================================================
--- user/attilio/vmcontention/sys/amd64/amd64/identcpu.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/amd64/amd64/identcpu.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -303,7 +303,7 @@ printcpuinfo(void)
 				"\034OSXSAVE"	/* OS-Enabled State Management*/
 				"\035AVX"	/* Advanced Vector Extensions */
 				"\036F16C"	/* Half-precision conversions */
-				"\037<b30>"
+				"\037RDRAND"	/* RDRAND Instruction */
 				"\040HV"	/* Hypervisor */
 				);
 			}

Modified: user/attilio/vmcontention/sys/amd64/amd64/machdep.c
==============================================================================
--- user/attilio/vmcontention/sys/amd64/amd64/machdep.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/amd64/amd64/machdep.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -295,6 +295,13 @@ cpu_startup(dummy)
 	vm_pager_bufferinit();
 
 	cpu_setregs();
+
+#ifdef SMP
+	/*
+	 * Add BSP as an interrupt target.
+	 */
+	intr_add_cpu(0);
+#endif
 }
 
 /*

Modified: user/attilio/vmcontention/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- user/attilio/vmcontention/sys/amd64/amd64/mp_machdep.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/amd64/amd64/mp_machdep.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -785,8 +785,6 @@ init_secondary(void)
  * We tell the I/O APIC code about all the CPUs we want to receive
  * interrupts.  If we don't want certain CPUs to receive IRQs we
  * can simply not tell the I/O APIC code about them in this function.
- * We also do not tell it about the BSP since it tells itself about
- * the BSP internally to work with UP kernels and on UP machines.
  */
 static void
 set_interrupt_apic_ids(void)
@@ -797,8 +795,6 @@ set_interrupt_apic_ids(void)
 		apic_id = cpu_apic_ids[i];
 		if (apic_id == -1)
 			continue;
-		if (cpu_info[apic_id].cpu_bsp)
-			continue;
 		if (cpu_info[apic_id].cpu_disabled)
 			continue;
 

Modified: user/attilio/vmcontention/sys/conf/files.amd64
==============================================================================
--- user/attilio/vmcontention/sys/conf/files.amd64	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/conf/files.amd64	Wed Apr 11 14:54:06 2012	(r234136)
@@ -267,7 +267,7 @@ dev/syscons/scvtb.c		optional	sc
 dev/tpm/tpm.c			optional	tpm
 dev/tpm/tpm_acpi.c		optional	tpm acpi
 dev/tpm/tpm_isa.c		optional	tpm isa
-dev/uart/uart_cpu_amd64.c	optional	uart
+dev/uart/uart_cpu_x86.c		optional	uart
 dev/viawd/viawd.c		optional	viawd
 dev/wbwd/wbwd.c			optional	wbwd
 dev/wpi/if_wpi.c		optional	wpi

Modified: user/attilio/vmcontention/sys/conf/files.i386
==============================================================================
--- user/attilio/vmcontention/sys/conf/files.i386	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/conf/files.i386	Wed Apr 11 14:54:06 2012	(r234136)
@@ -244,7 +244,7 @@ dev/syscons/scvtb.c		optional sc
 dev/tpm/tpm.c			optional tpm
 dev/tpm/tpm_acpi.c		optional tpm acpi
 dev/tpm/tpm_isa.c		optional tpm isa
-dev/uart/uart_cpu_i386.c	optional uart
+dev/uart/uart_cpu_x86.c		optional uart
 dev/viawd/viawd.c		optional viawd
 dev/acpica/acpi_if.m		standard
 dev/acpi_support/acpi_wmi_if.m	standard

Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h	Wed Apr 11 14:54:06 2012	(r234136)
@@ -815,6 +815,7 @@ struct ath_hal {
 	uint16_t	*ah_eepromdata;	/* eeprom buffer, if needed */
 
 	uint32_t	ah_intrstate[8];	/* last int state */
+	uint32_t	ah_syncstate;		/* last sync intr state */
 
 	HAL_OPS_CONFIG ah_config;
 	const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *,

Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -75,6 +75,7 @@ ar5416GetPendingInterrupts(struct ath_ha
 	 * Blank the interrupt debugging area regardless.
 	 */
 	bzero(&ah->ah_intrstate, sizeof(ah->ah_intrstate));
+	ah->ah_syncstate = 0;
 #endif
 
 	/*
@@ -89,6 +90,9 @@ ar5416GetPendingInterrupts(struct ath_ha
 			isr = OS_REG_READ(ah, AR_ISR);
 		else
 			isr = 0;
+#ifdef	AH_INTERRUPT_DEBUGGING
+		ah->ah_syncstate =
+#endif
 		o_sync_cause = sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
 		sync_cause &= AR_INTR_SYNC_DEFAULT;
 		*masked = 0;

Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -200,7 +200,9 @@ static void	ath_chan_change(struct ath_s
 static void	ath_scan_start(struct ieee80211com *);
 static void	ath_scan_end(struct ieee80211com *);
 static void	ath_set_channel(struct ieee80211com *);
+#ifdef	ATH_ENABLE_11N
 static void	ath_update_chw(struct ieee80211com *);
+#endif	/* ATH_ENABLE_11N */
 static void	ath_calibrate(void *);
 static int	ath_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void	ath_setup_stationkey(struct ieee80211_node *);
@@ -804,8 +806,7 @@ ath_attach(u_int16_t devid, struct ath_s
 	ic->ic_scan_start = ath_scan_start;
 	ic->ic_scan_end = ath_scan_end;
 	ic->ic_set_channel = ath_set_channel;
-	ic->ic_update_chw = ath_update_chw;
-
+#ifdef	ATH_ENABLE_11N
 	/* 802.11n specific - but just override anyway */
 	sc->sc_addba_request = ic->ic_addba_request;
 	sc->sc_addba_response = ic->ic_addba_response;
@@ -819,6 +820,9 @@ ath_attach(u_int16_t devid, struct ath_s
 	ic->ic_addba_stop = ath_addba_stop;
 	ic->ic_bar_response = ath_bar_response;
 
+	ic->ic_update_chw = ath_update_chw;
+#endif	/* ATH_ENABLE_11N */
+
 	ieee80211_radiotap_attach(ic,
 	    &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th),
 		ATH_TX_RADIOTAP_PRESENT,
@@ -1491,6 +1495,15 @@ ath_intr(void *arg)
 	    ah->ah_intrstate[3],
 	    ah->ah_intrstate[6]);
 #endif
+
+	/* Squirrel away SYNC interrupt debugging */
+	if (ah->ah_syncstate != 0) {
+		int i;
+		for (i = 0; i < 32; i++)
+			if (ah->ah_syncstate & (i << i))
+				sc->sc_intr_stats.sync_intr[i]++;
+	}
+
 	status &= sc->sc_imask;			/* discard unasked for bits */
 
 	/* Short-circuit un-handled interrupts */
@@ -4893,6 +4906,9 @@ ath_tx_processq(struct ath_softc *sc, st
 	struct ath_tx_status *ts;
 	struct ieee80211_node *ni;
 	struct ath_node *an;
+#ifdef	IEEE80211_SUPPORT_SUPERG
+	struct ieee80211com *ic = sc->sc_ifp->if_l2com;
+#endif	/* IEEE80211_SUPPORT_SUPERG */
 	int nacked;
 	HAL_STATUS status;
 
@@ -5766,6 +5782,7 @@ ath_scan_end(struct ieee80211com *ic)
 		 sc->sc_curaid);
 }
 
+#ifdef	ATH_ENABLE_11N
 /*
  * For now, just do a channel change.
  *
@@ -5790,6 +5807,7 @@ ath_update_chw(struct ieee80211com *ic)
 	DPRINTF(sc, ATH_DEBUG_STATE, "%s: called\n", __func__);
 	ath_set_channel(ic);
 }
+#endif	/* ATH_ENABLE_11N */
 
 static void
 ath_set_channel(struct ieee80211com *ic)
@@ -6470,8 +6488,13 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
 		    ifr->ifr_data, sizeof (sc->sc_stats));
 	case SIOCZATHSTATS:
 		error = priv_check(curthread, PRIV_DRIVER);
-		if (error == 0)
+		if (error == 0) {
 			memset(&sc->sc_stats, 0, sizeof(sc->sc_stats));
+			memset(&sc->sc_aggr_stats, 0,
+			    sizeof(sc->sc_aggr_stats));
+			memset(&sc->sc_intr_stats, 0,
+			    sizeof(sc->sc_intr_stats));
+		}
 		break;
 #ifdef ATH_DIAGAPI
 	case SIOCGATHDIAG:

Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -655,6 +655,7 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARG
 		return 0;       /* Not clearing the stats is still valid */
 	memset(&sc->sc_stats, 0, sizeof(sc->sc_stats));
 	memset(&sc->sc_aggr_stats, 0, sizeof(sc->sc_aggr_stats));
+	memset(&sc->sc_intr_stats, 0, sizeof(sc->sc_intr_stats));
 
 	val = 0;
 	return 0;
@@ -677,6 +678,26 @@ ath_sysctl_stats_attach_rxphyerr(struct 
 	}
 }
 
+static void
+ath_sysctl_stats_attach_intr(struct ath_softc *sc,
+    struct sysctl_oid_list *parent)
+{
+	struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
+	struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
+	struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
+	int i;
+	char sn[8];
+
+	tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "sync_intr",
+	    CTLFLAG_RD, NULL, "Sync interrupt statistics");
+	child = SYSCTL_CHILDREN(tree);
+	for (i = 0; i < 32; i++) {
+		snprintf(sn, sizeof(sn), "%d", i);
+		SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD,
+		    &sc->sc_intr_stats.sync_intr[i], 0, "");
+	}
+}
+
 void
 ath_sysctl_stats_attach(struct ath_softc *sc)
 {
@@ -904,6 +925,9 @@ ath_sysctl_stats_attach(struct ath_softc
 	
 	/* Attach the RX phy error array */
 	ath_sysctl_stats_attach_rxphyerr(sc, child);
+
+	/* Attach the interrupt statistics array */
+	ath_sysctl_stats_attach_intr(sc, child);
 }
 
 /*

Modified: user/attilio/vmcontention/sys/dev/ath/if_athioctl.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_athioctl.h	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/if_athioctl.h	Wed Apr 11 14:54:06 2012	(r234136)
@@ -46,6 +46,10 @@ struct ath_tx_aggr_stats {
 	u_int32_t	aggr_rts_aggr_limited;
 };
 
+struct ath_intr_stats {
+	u_int32_t	sync_intr[32];
+};
+
 struct ath_stats {
 	u_int32_t	ast_watchdog;	/* device reset by watchdog */
 	u_int32_t	ast_hardware;	/* fatal hardware error interrupts */

Modified: user/attilio/vmcontention/sys/dev/ath/if_athvar.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_athvar.h	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/ath/if_athvar.h	Wed Apr 11 14:54:06 2012	(r234136)
@@ -206,18 +206,19 @@ struct ath_buf {
 		uint16_t bfs_nframes;	/* number of frames in aggregate */
 		uint16_t bfs_ndelim;	/* number of delims for padding */
 
-		int bfs_aggr:1;		/* part of aggregate? */
-		int bfs_aggrburst:1;	/* part of aggregate burst? */
-		int bfs_isretried:1;	/* retried frame? */
-		int bfs_dobaw:1;	/* actually check against BAW? */
-		int bfs_addedbaw:1;	/* has been added to the BAW */
-		int bfs_shpream:1;	/* use short preamble */
-		int bfs_istxfrag:1;	/* is fragmented */
-		int bfs_ismrr:1;	/* do multi-rate TX retry */
-		int bfs_doprot:1;	/* do RTS/CTS based protection */
-		int bfs_doratelookup:1;	/* do rate lookup before each TX */
-		int bfs_need_seqno:1;	/* need to assign a seqno for aggregation */
-		int bfs_seqno_assigned:1;	/* seqno has been assigned */
+		u_int32_t bfs_aggr:1,		/* part of aggregate? */
+		    bfs_aggrburst:1,	/* part of aggregate burst? */
+		    bfs_isretried:1,	/* retried frame? */
+		    bfs_dobaw:1,	/* actually check against BAW? */
+		    bfs_addedbaw:1,	/* has been added to the BAW */
+		    bfs_shpream:1,	/* use short preamble */
+		    bfs_istxfrag:1,	/* is fragmented */
+		    bfs_ismrr:1,	/* do multi-rate TX retry */
+		    bfs_doprot:1,	/* do RTS/CTS based protection */
+		    bfs_doratelookup:1,	/* do rate lookup before each TX */
+		    bfs_need_seqno:1,	/* need to assign a seqno for aggr */
+		    bfs_seqno_assigned:1;	/* seqno has been assigned */
+
 		int bfs_nfl;		/* next fragment length */
 
 		/*
@@ -349,6 +350,7 @@ struct ath_softc {
 	struct ifnet		*sc_ifp;	/* interface common */
 	struct ath_stats	sc_stats;	/* interface statistics */
 	struct ath_tx_aggr_stats	sc_aggr_stats;
+	struct ath_intr_stats	sc_intr_stats;
 	int			sc_debug;
 	int			sc_nvaps;	/* # vaps */
 	int			sc_nstavaps;	/* # station vaps */

Modified: user/attilio/vmcontention/sys/dev/bce/if_bce.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/bce/if_bce.c	Wed Apr 11 14:36:05 2012	(r234135)
+++ user/attilio/vmcontention/sys/dev/bce/if_bce.c	Wed Apr 11 14:54:06 2012	(r234136)
@@ -1982,7 +1982,6 @@ static void
 bce_miibus_statchg(device_t dev)
 {
 	struct bce_softc *sc;
-	struct ifnet *ifp;
 	struct mii_data *mii;
 	int val;
 
@@ -1990,57 +1989,42 @@ bce_miibus_statchg(device_t dev)
 
 	DBENTER(BCE_VERBOSE_PHY);
 
-	ifp = sc->bce_ifp;
 	mii = device_get_softc(sc->bce_miibus);
-	if (mii == NULL || ifp == NULL ||
-	    (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
-		return;
 
-	sc->bce_link_up = FALSE;
 	val = REG_RD(sc, BCE_EMAC_MODE);
 	val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX |
 	    BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK |
 	    BCE_EMAC_MODE_25G);
 
 	/* Set MII or GMII interface based on the PHY speed. */
-	if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
-	    (IFM_ACTIVE | IFM_AVALID)) {
-		switch (IFM_SUBTYPE(mii->mii_media_active)) {
-		case IFM_10_T:
-			if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) {
-				DBPRINT(sc, BCE_INFO_PHY,
-				    "Enabling 10Mb interface.\n");
-				val |= BCE_EMAC_MODE_PORT_MII_10;
-				sc->bce_link_up = TRUE;
-				break;
-			}
-			/* FALLTHROUGH */
-		case IFM_100_TX:
-			DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n");
-			val |= BCE_EMAC_MODE_PORT_MII;
-			sc->bce_link_up = TRUE;
-			break;
-		case IFM_2500_SX:
-			DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n");
-			val |= BCE_EMAC_MODE_25G;
-			/* FALLTHROUGH */
-		case IFM_1000_T:
-		case IFM_1000_SX:
-			DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n");
-			val |= BCE_EMAC_MODE_PORT_GMII;
-			sc->bce_link_up = TRUE;
-			if (bce_verbose || bootverbose)
-				BCE_PRINTF("Gigabit link up!\n");
-			break;
-		default:
-			DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed.\n");
+	switch (IFM_SUBTYPE(mii->mii_media_active)) {
+	case IFM_10_T:
+		if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) {
+			DBPRINT(sc, BCE_INFO_PHY,
+			    "Enabling 10Mb interface.\n");
+			val |= BCE_EMAC_MODE_PORT_MII_10;
 			break;
 		}
+		/* fall-through */
+	case IFM_100_TX:
+		DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n");
+		val |= BCE_EMAC_MODE_PORT_MII;
+		break;
+	case IFM_2500_SX:
+		DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n");
+		val |= BCE_EMAC_MODE_25G;
+		/* fall-through */
+	case IFM_1000_T:
+	case IFM_1000_SX:
+		DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n");
+		val |= BCE_EMAC_MODE_PORT_GMII;
+		break;
+	default:
+		DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling "
+		    "default GMII interface.\n");
+		val |= BCE_EMAC_MODE_PORT_GMII;
 	}
 
-	if (sc->bce_link_up == FALSE)
-		return;
-
 	/* Set half or full duplex based on PHY settings. */
 	if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) {
 		DBPRINT(sc, BCE_INFO_PHY,
@@ -2052,7 +2036,7 @@ bce_miibus_statchg(device_t dev)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list