Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 2009 15:29:39 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 167476 for review
Message-ID:  <200908181529.n7IFTdoV070399@repoman.freebsd.org>

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

Change 167476 by hselasky@hselasky_laptop001 on 2009/08/18 15:29:16

	
	IFC @167475

Affected files ...

.. //depot/projects/usb/src/sys/amd64/amd64/local_apic.c#19 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/mp_machdep.c#24 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/pmap.c#28 integrate
.. //depot/projects/usb/src/sys/amd64/amd64/trap.c#15 integrate
.. //depot/projects/usb/src/sys/amd64/conf/GENERIC#31 integrate
.. //depot/projects/usb/src/sys/amd64/conf/NOTES#20 integrate
.. //depot/projects/usb/src/sys/amd64/conf/XENHVM#3 integrate
.. //depot/projects/usb/src/sys/amd64/include/apicvar.h#9 integrate
.. //depot/projects/usb/src/sys/amd64/include/pmc_mdep.h#7 integrate
.. //depot/projects/usb/src/sys/amd64/include/smp.h#10 integrate
.. //depot/projects/usb/src/sys/arm/arm/pmap.c#20 integrate
.. //depot/projects/usb/src/sys/arm/at91/uart_dev_at91usart.c#12 integrate
.. //depot/projects/usb/src/sys/boot/i386/gptboot/gptboot.c#4 integrate
.. //depot/projects/usb/src/sys/cam/ata/ata_xpt.c#2 integrate
.. //depot/projects/usb/src/sys/cam/cam_ccb.h#7 integrate
.. //depot/projects/usb/src/sys/cam/cam_xpt.c#20 integrate
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/kern/opensolaris.c#5 integrate
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c#1 branch
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/rpc/xdr.h#3 delete
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/sys/taskq.h#3 delete
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/sys/taskq_impl.h#3 delete
.. //depot/projects/usb/src/sys/cddl/compat/opensolaris/sys/vnode.h#7 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c#4 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c#3 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c#6 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c#3 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h#3 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h#3 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c#7 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c#7 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c#6 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#13 integrate
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c#3 delete
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c#2 delete
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c#2 delete
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c#2 delete
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.h#4 delete
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h#1 branch
.. //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h#3 integrate
.. //depot/projects/usb/src/sys/conf/options#38 integrate
.. //depot/projects/usb/src/sys/conf/options.amd64#9 integrate
.. //depot/projects/usb/src/sys/conf/options.i386#10 integrate
.. //depot/projects/usb/src/sys/conf/options.pc98#8 integrate
.. //depot/projects/usb/src/sys/dev/drm/drm_pciids.h#10 integrate
.. //depot/projects/usb/src/sys/dev/drm/r600_cp.c#5 integrate
.. //depot/projects/usb/src/sys/dev/drm/radeon_drv.h#8 integrate
.. //depot/projects/usb/src/sys/dev/hwpmc/hwpmc_core.c#3 integrate
.. //depot/projects/usb/src/sys/dev/hwpmc/hwpmc_piv.c#8 integrate
.. //depot/projects/usb/src/sys/dev/hwpmc/hwpmc_ppro.c#7 integrate
.. //depot/projects/usb/src/sys/dev/hwpmc/hwpmc_x86.c#8 integrate
.. //depot/projects/usb/src/sys/dev/iscsi/initiator/isc_cam.c#4 integrate
.. //depot/projects/usb/src/sys/dev/isp/isp_freebsd.c#11 integrate
.. //depot/projects/usb/src/sys/dev/mfi/mfi_ioctl.h#6 integrate
.. //depot/projects/usb/src/sys/dev/mfi/mfireg.h#8 integrate
.. //depot/projects/usb/src/sys/dev/ppbus/vpo.c#8 integrate
.. //depot/projects/usb/src/sys/dev/usb/usb_process.c#11 integrate
.. //depot/projects/usb/src/sys/dev/usb/usb_process.h#9 integrate
.. //depot/projects/usb/src/sys/fs/nfsclient/nfs_clsubs.c#2 integrate
.. //depot/projects/usb/src/sys/geom/part/g_part_gpt.c#13 integrate
.. //depot/projects/usb/src/sys/i386/conf/GENERIC#30 integrate
.. //depot/projects/usb/src/sys/i386/conf/NOTES#24 integrate
.. //depot/projects/usb/src/sys/i386/i386/local_apic.c#19 integrate
.. //depot/projects/usb/src/sys/i386/i386/mp_machdep.c#20 integrate
.. //depot/projects/usb/src/sys/i386/i386/trap.c#13 integrate
.. //depot/projects/usb/src/sys/i386/include/apicvar.h#11 integrate
.. //depot/projects/usb/src/sys/i386/include/pmc_mdep.h#7 integrate
.. //depot/projects/usb/src/sys/i386/include/smp.h#10 integrate
.. //depot/projects/usb/src/sys/i386/xen/mp_machdep.c#12 integrate
.. //depot/projects/usb/src/sys/ia64/ia64/genassym.c#3 integrate
.. //depot/projects/usb/src/sys/ia64/ia64/interrupt.c#9 integrate
.. //depot/projects/usb/src/sys/ia64/ia64/machdep.c#12 integrate
.. //depot/projects/usb/src/sys/ia64/ia64/mp_machdep.c#11 integrate
.. //depot/projects/usb/src/sys/ia64/include/smp.h#3 integrate
.. //depot/projects/usb/src/sys/kern/kern_jail.c#29 integrate
.. //depot/projects/usb/src/sys/kern/kern_lock.c#17 integrate
.. //depot/projects/usb/src/sys/kern/kern_mutex.c#16 integrate
.. //depot/projects/usb/src/sys/kern/kern_poll.c#17 integrate
.. //depot/projects/usb/src/sys/kern/kern_rwlock.c#17 integrate
.. //depot/projects/usb/src/sys/kern/kern_shutdown.c#13 integrate
.. //depot/projects/usb/src/sys/kern/kern_sx.c#17 integrate
.. //depot/projects/usb/src/sys/kern/kern_sysctl.c#22 integrate
.. //depot/projects/usb/src/sys/kern/subr_bus.c#26 integrate
.. //depot/projects/usb/src/sys/kern/subr_kdb.c#7 integrate
.. //depot/projects/usb/src/sys/kern/subr_pcpu.c#7 integrate
.. //depot/projects/usb/src/sys/kern/subr_smp.c#13 integrate
.. //depot/projects/usb/src/sys/kern/subr_taskqueue.c#9 integrate
.. //depot/projects/usb/src/sys/kern/vfs_cache.c#26 integrate
.. //depot/projects/usb/src/sys/mips/include/smp.h#3 integrate
.. //depot/projects/usb/src/sys/mips/mips/mp_machdep.c#5 integrate
.. //depot/projects/usb/src/sys/modules/zfs/Makefile#11 integrate
.. //depot/projects/usb/src/sys/net/bpf.c#23 integrate
.. //depot/projects/usb/src/sys/net/bpf_buffer.c#3 integrate
.. //depot/projects/usb/src/sys/net/bpf_zerocopy.c#4 integrate
.. //depot/projects/usb/src/sys/net/bpfdesc.h#8 integrate
.. //depot/projects/usb/src/sys/net/flowtable.c#9 integrate
.. //depot/projects/usb/src/sys/net/if.c#38 integrate
.. //depot/projects/usb/src/sys/net/if_var.h#27 integrate
.. //depot/projects/usb/src/sys/net/rtsock.c#31 integrate
.. //depot/projects/usb/src/sys/net/vnet.c#4 integrate
.. //depot/projects/usb/src/sys/net/vnet.h#18 integrate
.. //depot/projects/usb/src/sys/net80211/ieee80211.c#29 integrate
.. //depot/projects/usb/src/sys/net80211/ieee80211_input.c#20 integrate
.. //depot/projects/usb/src/sys/netatalk/at_control.c#7 integrate
.. //depot/projects/usb/src/sys/netinet/ip_output.c#26 integrate
.. //depot/projects/usb/src/sys/netinet/ipfw/ip_fw2.c#9 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_indata.c#21 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_input.c#19 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_os_bsd.h#19 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_output.c#21 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_pcb.c#18 integrate
.. //depot/projects/usb/src/sys/netinet/sctp_timer.c#14 integrate
.. //depot/projects/usb/src/sys/netinet/sctputil.c#23 integrate
.. //depot/projects/usb/src/sys/netinet/sctputil.h#13 integrate
.. //depot/projects/usb/src/sys/netinet6/in6.c#31 integrate
.. //depot/projects/usb/src/sys/nfsclient/nfs_subs.c#12 integrate
.. //depot/projects/usb/src/sys/pc98/conf/NOTES#17 integrate
.. //depot/projects/usb/src/sys/powerpc/include/smp.h#6 integrate
.. //depot/projects/usb/src/sys/powerpc/powerpc/mp_machdep.c#9 integrate
.. //depot/projects/usb/src/sys/security/audit/audit.h#14 integrate
.. //depot/projects/usb/src/sys/sparc64/include/smp.h#7 integrate
.. //depot/projects/usb/src/sys/sun4v/include/smp.h#4 integrate
.. //depot/projects/usb/src/sys/sys/jail.h#19 integrate
.. //depot/projects/usb/src/sys/sys/lock.h#11 integrate
.. //depot/projects/usb/src/sys/sys/pcpu.h#14 integrate
.. //depot/projects/usb/src/sys/sys/smp.h#7 integrate
.. //depot/projects/usb/src/sys/sys/sysctl.h#22 integrate
.. //depot/projects/usb/src/sys/sys/systm.h#18 integrate
.. //depot/projects/usb/src/sys/sys/taskqueue.h#4 integrate
.. //depot/projects/usb/src/sys/ufs/ffs/ffs_softdep.c#14 integrate
.. //depot/projects/usb/src/sys/xdr/xdr_mbuf.c#5 integrate

Differences ...

==== //depot/projects/usb/src/sys/amd64/amd64/local_apic.c#19 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.58 2009/07/01 17:20:07 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.60 2009/08/14 21:05:08 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -123,7 +123,7 @@
 	{ 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 },	/* LINT1: NMI */
 	{ 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT },	/* Timer */
 	{ 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_ERROR_INT },	/* Error */
-	{ 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 },	/* PMC */
+	{ 1, 1, 1, 1, APIC_LVT_DM_NMI, 0 },	/* PMC */
 	{ 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_THERMAL_INT },	/* Thermal */
 };
 
@@ -305,11 +305,9 @@
 	lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0);
 	lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1);
 
-#ifdef	HWPMC_HOOKS
 	/* Program the PMC LVT entry if present. */
 	if (maxlvt >= LVT_PMC)
 		lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint);
-#endif
 
 	/* Program timer LVT and setup handler. */
 	lapic->lvt_timer = lvt_mode(la, LVT_TIMER, lapic->lvt_timer);
@@ -332,6 +330,88 @@
 	intr_restore(eflags);
 }
 
+void
+lapic_reenable_pmc(void)
+{
+#ifdef HWPMC_HOOKS
+	uint32_t value;
+
+	value =  lapic->lvt_pcint;
+	value &= ~APIC_LVT_M;
+	lapic->lvt_pcint = value;
+#endif
+}
+
+#ifdef HWPMC_HOOKS
+static void
+lapic_update_pmc(void *dummy)
+{
+	struct lapic *la;
+
+	la = &lapics[lapic_id()];
+	lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint);
+}
+#endif
+
+int
+lapic_enable_pmc(void)
+{
+#ifdef HWPMC_HOOKS
+	u_int32_t maxlvt;
+
+	/* Fail if the local APIC is not present. */
+	if (lapic == NULL)
+		return (0);
+
+	/* Fail if the PMC LVT is not present. */
+	maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT;
+	if (maxlvt < LVT_PMC)
+		return (0);
+
+	lvts[LVT_PMC].lvt_masked = 0;
+
+#ifdef SMP
+	/*
+	 * If hwpmc was loaded at boot time then the APs may not be
+	 * started yet.  In that case, don't forward the request to
+	 * them as they will program the lvt when they start.
+	 */
+	if (smp_started)
+		smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL);
+	else
+#endif
+		lapic_update_pmc(NULL);
+	return (1);
+#else
+	return (0);
+#endif
+}
+
+void
+lapic_disable_pmc(void)
+{
+#ifdef HWPMC_HOOKS
+	u_int32_t maxlvt;
+
+	/* Fail if the local APIC is not present. */
+	if (lapic == NULL)
+		return;
+
+	/* Fail if the PMC LVT is not present. */
+	maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT;
+	if (maxlvt < LVT_PMC)
+		return;
+
+	lvts[LVT_PMC].lvt_masked = 1;
+
+#ifdef SMP
+	/* The APs should always be started when hwpmc is unloaded. */
+	KASSERT(mp_ncpus == 1 || smp_started, ("hwpmc unloaded too early"));
+#endif
+	smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL);
+#endif
+}
+
 /*
  * Called by cpu_initclocks() on the BSP to setup the local APIC timer so
  * that it can drive hardclock, statclock, and profclock.  This function
@@ -1238,8 +1318,17 @@
 	KASSERT((vector & ~APIC_VECTOR_MASK) == 0,
 	    ("%s: invalid vector %d", __func__, vector));
 
-	icrlo = vector | APIC_DELMODE_FIXED | APIC_DESTMODE_PHY |
-	    APIC_LEVEL_DEASSERT | APIC_TRIGMOD_EDGE;
+	icrlo = APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE;
+
+	/*
+	 * IPI_STOP_HARD is just a "fake" vector used to send a NMI.
+	 * Use special rules regard NMI if passed, otherwise specify
+	 * the vector.
+	 */
+	if (vector == IPI_STOP_HARD)
+		icrlo |= APIC_DELMODE_NMI | APIC_LEVEL_ASSERT;
+	else
+		icrlo |= vector | APIC_DELMODE_FIXED | APIC_LEVEL_DEASSERT;
 	destfield = 0;
 	switch (dest) {
 	case APIC_IPI_DEST_SELF:

==== //depot/projects/usb/src/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.309 2009/06/23 22:42:39 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.310 2009/08/13 17:09:45 attilio Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"
@@ -114,31 +114,12 @@
 
 extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
-#ifdef STOP_NMI
-static volatile cpumask_t ipi_nmi_pending;
-
-static void	ipi_nmi_selected(cpumask_t cpus);
-#endif 
-
 /*
  * Local data and functions.
  */
 
-#ifdef STOP_NMI
-/* 
- * Provide an alternate method of stopping other CPUs. If another CPU has
- * disabled interrupts the conventional STOP IPI will be blocked. This 
- * NMI-based stop should get through in that case.
- */
-static int stop_cpus_with_nmi = 1;
-SYSCTL_INT(_debug, OID_AUTO, stop_cpus_with_nmi, CTLTYPE_INT | CTLFLAG_RW,
-    &stop_cpus_with_nmi, 0, "");
-TUNABLE_INT("debug.stop_cpus_with_nmi", &stop_cpus_with_nmi);
-#else
-#define	stop_cpus_with_nmi	0
-#endif
-
 static u_int logical_cpus;
+static volatile cpumask_t ipi_nmi_pending;
 
 /* used to hold the AP's until we are ready to release them */
 static struct mtx ap_boot_mtx;
@@ -1158,12 +1139,14 @@
 		ipi = IPI_BITMAP_VECTOR;
 	}
 
-#ifdef STOP_NMI
-	if (ipi == IPI_STOP && stop_cpus_with_nmi) {
-		ipi_nmi_selected(cpus);
-		return;
-	}
-#endif
+	/*
+	 * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit
+	 * of help in order to understand what is the source.
+	 * Set the mask of receiving CPUs for this purpose.
+	 */
+	if (ipi == IPI_STOP_HARD)
+		atomic_set_int(&ipi_nmi_pending, cpus);
+
 	CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi);
 	while ((cpu = ffs(cpus)) != 0) {
 		cpu--;
@@ -1194,64 +1177,43 @@
 ipi_all_but_self(u_int ipi)
 {
 
-	if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) {
+	if (IPI_IS_BITMAPED(ipi)) {
 		ipi_selected(PCPU_GET(other_cpus), ipi);
 		return;
 	}
+
+	/*
+	 * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit
+	 * of help in order to understand what is the source.
+	 * Set the mask of receiving CPUs for this purpose.
+	 */
+	if (ipi == IPI_STOP_HARD)
+		atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus));
+
 	CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
 	lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
 }
 
-#ifdef STOP_NMI
-/*
- * send NMI IPI to selected CPUs
- */
-
-#define	BEFORE_SPIN	1000000
-
-static void
-ipi_nmi_selected(cpumask_t cpus)
-{
-	int cpu;
-	register_t icrlo;
-
-	icrlo = APIC_DELMODE_NMI | APIC_DESTMODE_PHY | APIC_LEVEL_ASSERT 
-		| APIC_TRIGMOD_EDGE; 
-	
-	CTR2(KTR_SMP, "%s: cpus: %x nmi", __func__, cpus);
-
-	atomic_set_int(&ipi_nmi_pending, cpus);
-
-	while ((cpu = ffs(cpus)) != 0) {
-		cpu--;
-		cpus &= ~(1 << cpu);
-
-		KASSERT(cpu_apic_ids[cpu] != -1,
-		    ("IPI NMI to non-existent CPU %d", cpu));
-		
-		/* Wait for an earlier IPI to finish. */
-		if (!lapic_ipi_wait(BEFORE_SPIN))
-			panic("ipi_nmi_selected: previous IPI has not cleared");
-
-		lapic_ipi_raw(icrlo, cpu_apic_ids[cpu]);
-	}
-}
-
 int
-ipi_nmi_handler(void)
+ipi_nmi_handler()
 {
-	int cpumask = PCPU_GET(cpumask);
+	cpumask_t cpumask;
 
-	if (!(ipi_nmi_pending & cpumask))
-		return 1;
+	/*
+	 * As long as there is not a simple way to know about a NMI's
+	 * source, if the bitmask for the current CPU is present in
+	 * the global pending bitword an IPI_STOP_HARD has been issued
+	 * and should be handled.
+	 */
+	cpumask = PCPU_GET(cpumask);
+	if ((ipi_nmi_pending & cpumask) == 0)
+		return (1);
 
 	atomic_clear_int(&ipi_nmi_pending, cpumask);
 	cpustop_handler();
-	return 0;
+	return (0);
 }
      
-#endif /* STOP_NMI */
-
 /*
  * Handle an IPI_STOP by saving our current context and spinning until we
  * are resumed.

==== //depot/projects/usb/src/sys/amd64/amd64/pmap.c#28 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.667 2009/07/24 13:50:29 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.668 2009/08/17 13:27:55 kib Exp $");
 
 /*
  *	Manages physical address maps.
@@ -2261,6 +2261,8 @@
 			    " in pmap %p", va, pmap);
 			return (FALSE);
 		}
+		if (va < VM_MAXUSER_ADDRESS)
+			pmap->pm_stats.resident_count++;
 	}
 	mptepa = VM_PAGE_TO_PHYS(mpte);
 	firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa);

==== //depot/projects/usb/src/sys/amd64/amd64/trap.c#15 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.332 2009/05/13 17:53:04 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.333 2009/08/13 17:09:45 attilio Exp $");
 
 /*
  * AMD64 Trap and System call handling
@@ -239,13 +239,11 @@
 	type = frame->tf_trapno;
 
 #ifdef SMP
-#ifdef STOP_NMI
 	/* Handler for NMI IPIs used for stopping CPUs. */
 	if (type == T_NMI) {
 	         if (ipi_nmi_handler() == 0)
 	                   goto out;
 	}
-#endif /* STOP_NMI */
 #endif /* SMP */
 
 #ifdef KDB

==== //depot/projects/usb/src/sys/amd64/conf/GENERIC#31 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.531 2009/07/11 15:02:45 rpaulo Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.532 2009/08/13 17:09:45 attilio Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -69,7 +69,6 @@
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	PRINTF_BUFR_SIZE=128	# Prevent printf output being interspersed.
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework

==== //depot/projects/usb/src/sys/amd64/conf/NOTES#20 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.91 2009/06/08 20:07:16 jkim Exp $
+# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.92 2009/08/13 17:09:45 attilio Exp $
 #
 
 #
@@ -30,11 +30,6 @@
 #
 options 	MP_WATCHDOG
 
-# 
-# Debugging options.
-#
-options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
-
 
 
 #####################################################################

==== //depot/projects/usb/src/sys/amd64/conf/XENHVM#3 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/XENHVM,v 1.3 2009/05/10 00:00:25 kuriyama Exp $
+# $FreeBSD: src/sys/amd64/conf/XENHVM,v 1.4 2009/08/13 17:09:45 attilio Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -68,7 +68,6 @@
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in

==== //depot/projects/usb/src/sys/amd64/include/apicvar.h#9 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.29 2009/05/02 12:20:43 mav Exp $
+ * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.31 2009/08/14 21:05:08 jhb Exp $
  */
 
 #ifndef _MACHINE_APICVAR_H_
@@ -102,11 +102,6 @@
  * smp_ipi_mtx and waits for the completion of the IPI (Only one IPI user 
  * at a time) The second group uses a single interrupt and a bitmap to avoid
  * redundant IPI interrupts.
- *
- * Right now IPI_STOP used by kdb shares the interrupt priority class with
- * the two IPI groups mentioned above. As such IPI_STOP may cause a deadlock.
- * Eventually IPI_STOP should use NMI IPIs - this would eliminate this and
- * other deadlocks caused by IPI_STOP.
  */ 
 
 /* Interrupts for local APIC LVT entries other than the timer. */
@@ -134,6 +129,7 @@
 
 #define	IPI_STOP	(APIC_IPI_INTS + 7)	/* Stop CPU until restarted. */
 #define	IPI_SUSPEND	(APIC_IPI_INTS + 8)	/* Suspend CPU until restarted. */
+#define	IPI_STOP_HARD	(APIC_IPI_INTS + 9)	/* Stop CPU with a NMI. */
 
 /*
  * The spurious interrupt can share the priority class with the IPIs since
@@ -205,7 +201,9 @@
 int	ioapic_set_smi(void *cookie, u_int pin);
 void	lapic_create(u_int apic_id, int boot_cpu);
 void	lapic_disable(void);
+void	lapic_disable_pmc(void);
 void	lapic_dump(const char *str);
+int	lapic_enable_pmc(void);
 void	lapic_eoi(void);
 u_int	lapic_error(void);
 int	lapic_id(void);
@@ -216,6 +214,7 @@
 int	lapic_ipi_wait(int delay);
 void	lapic_handle_intr(int vector, struct trapframe *frame);
 void	lapic_handle_timer(struct trapframe *frame);
+void	lapic_reenable_pmc(void);
 void	lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id);
 int	lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked);
 int	lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode);

==== //depot/projects/usb/src/sys/amd64/include/pmc_mdep.h#7 (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/include/pmc_mdep.h,v 1.8 2008/11/27 09:00:47 jkoshy Exp $
+ * $FreeBSD: src/sys/amd64/include/pmc_mdep.h,v 1.9 2009/08/14 21:05:08 jhb Exp $
  */
 
 /* Machine dependent interfaces */
@@ -115,7 +115,6 @@
  */
 
 void	start_exceptions(void), end_exceptions(void);
-void	pmc_x86_lapic_enable_pmc_interrupt(void);
 
 struct pmc_mdep *pmc_amd_initialize(void);
 void	pmc_amd_finalize(struct pmc_mdep *_md);

==== //depot/projects/usb/src/sys/amd64/include/smp.h#10 (text+ko) ====

@@ -6,7 +6,7 @@
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * ----------------------------------------------------------------------------
  *
- * $FreeBSD: src/sys/amd64/include/smp.h,v 1.96 2009/05/14 17:43:00 attilio Exp $
+ * $FreeBSD: src/sys/amd64/include/smp.h,v 1.97 2009/08/13 17:09:45 attilio Exp $
  *
  */
 
@@ -52,6 +52,7 @@
 void	cpustop_handler(void);
 void	cpususpend_handler(void);
 void	init_secondary(void);
+int	ipi_nmi_handler(void);
 void	ipi_selected(cpumask_t cpus, u_int ipi);
 void	ipi_all_but_self(u_int ipi);
 void 	ipi_bitmap_handler(struct trapframe frame);
@@ -66,10 +67,6 @@
 void	smp_invltlb(void);
 void	smp_masked_invltlb(cpumask_t mask);
 
-#ifdef STOP_NMI
-int	ipi_nmi_handler(void);
-#endif
-
 #endif /* !LOCORE */
 #endif /* SMP */
 

==== //depot/projects/usb/src/sys/arm/arm/pmap.c#20 (text+ko) ====

@@ -147,7 +147,7 @@
 #include "opt_vm.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.113 2009/07/24 13:50:29 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.114 2009/08/13 15:56:09 raj Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -1212,7 +1212,7 @@
 		CTR4(KTR_PMAP, "pmap_l2cache_wbinv_range: pmap %p is_kernel %d "
 		    "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest);
 		if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep))
-			cpu_l2cache_wb_range(va, rest);
+			cpu_l2cache_wbinv_range(va, rest);
 
 		len -= rest;
 		va += rest;

==== //depot/projects/usb/src/sys/arm/at91/uart_dev_at91usart.c#12 (text) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.19 2009/01/22 21:56:41 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.20 2009/08/15 15:15:20 stas Exp $");
 
 #include "opt_comconsole.h"
 
@@ -307,6 +307,10 @@
 int
 at91_usart_bus_probe(struct uart_softc *sc)
 {
+
+	sc->sc_txfifosz = USART_BUFFER_SIZE;
+	sc->sc_rxfifosz = USART_BUFFER_SIZE;
+	sc->sc_hwiflow = 0;
 	return (0);
 }
 
@@ -344,10 +348,6 @@
 		atsc->flags |= HAS_TIMEOUT;
 	WR4(&sc->sc_bas, USART_IDR, 0xffffffff);
 
-	sc->sc_txfifosz = USART_BUFFER_SIZE;
-	sc->sc_rxfifosz = USART_BUFFER_SIZE;
-	sc->sc_hwiflow = 0;
-
 #ifndef SKYEYE_WORKAROUNDS
 	/*
 	 * Allocate DMA tags and maps

==== //depot/projects/usb/src/sys/boot/i386/gptboot/gptboot.c#4 (text+ko) ====

@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/gptboot/gptboot.c,v 1.88 2008/08/08 19:41:20 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/gptboot/gptboot.c,v 1.89 2009/08/17 15:19:03 jhay Exp $");
 
 #include <sys/param.h>
 #include <sys/gpt.h>
@@ -466,16 +466,13 @@
 		dsk.type = i;
 		arg += 3;
 		dsk.unit = *arg - '0';
-		if (arg[1] != ',' || dsk.unit > 9)
+		if (arg[1] != 'p' || dsk.unit > 9)
 		    return -1;
 		arg += 2;
-		dsk.part = -1;
-		if (arg[1] == ',') {
-		    dsk.part = *arg - '0';
-		    if (dsk.part < 1 || dsk.part > 9)
-			return -1;
-		    arg += 2;
-		}
+		dsk.part = *arg - '0';
+		if (dsk.part < 1 || dsk.part > 9)
+		    return -1;
+		arg++;
 		if (arg[0] != ')')
 		    return -1;
 		arg++;

==== //depot/projects/usb/src/sys/cam/ata/ata_xpt.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/ata/ata_xpt.c,v 1.3 2009/07/13 21:21:30 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/ata/ata_xpt.c,v 1.4 2009/08/18 09:27:17 mav Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -370,10 +370,10 @@
 		cam_fill_ataio(ataio,
 		      1,
 		      probedone,
-		      /*flags*/CAM_DIR_IN,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/(u_int8_t *)ident_buf,
-		      /*dxfer_len*/sizeof(struct ata_params),
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
 		      30 * 1000);
 		ata_36bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0,
 		    ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6));

==== //depot/projects/usb/src/sys/cam/cam_ccb.h#7 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.37 2009/08/01 01:04:26 mjacob Exp $
+ * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.38 2009/08/18 08:46:54 mav Exp $
  */
 
 #ifndef _CAM_CAM_CCB_H
@@ -243,6 +243,7 @@
 	XPORT_ATA,	/* AT Attachment */
 	XPORT_SAS,	/* Serial Attached SCSI */
 	XPORT_SATA,	/* Serial AT Attachment */
+	XPORT_ISCSI,	/* iSCSI */
 } cam_xport;
 
 #define PROTO_VERSION_UNKNOWN (UINT_MAX - 1)

==== //depot/projects/usb/src/sys/cam/cam_xpt.c#20 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.217 2009/08/01 01:04:26 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.218 2009/08/18 08:46:54 mav Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -3803,6 +3803,8 @@
 		case XPORT_SAS:
 		case XPORT_FC:
 		case XPORT_USB:
+		case XPORT_ISCSI:
+		case XPORT_PPB:
 			new_bus->xport = scsi_get_xport();
 			break;
 		case XPORT_ATA:

==== //depot/projects/usb/src/sys/cddl/compat/opensolaris/kern/opensolaris.c#5 (text+ko) ====

@@ -22,7 +22,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris.c,v 1.4 2009/06/13 15:39:12 jamie Exp $
+ * $FreeBSD: src/sys/cddl/compat/opensolaris/kern/opensolaris.c,v 1.5 2009/08/13 12:28:30 trasz Exp $
  *
  */
 
@@ -49,10 +49,6 @@
 {
 	int i;
 
-	printf("This module (opensolaris) contains code covered by the\n");
-	printf("Common Development and Distribution License (CDDL)\n");
-	printf("see http://opensolaris.org/os/licensing/opensolaris_license/\n");
-
 	/*
 	 * "Enable" all CPUs even though they may not exist just so
 	 * that the asserts work. On FreeBSD, if a CPU exists, it is

==== //depot/projects/usb/src/sys/cddl/compat/opensolaris/sys/vnode.h#7 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cddl/compat/opensolaris/sys/vnode.h,v 1.12 2009/06/21 13:41:32 kib Exp $
+ * $FreeBSD: src/sys/cddl/compat/opensolaris/sys/vnode.h,v 1.13 2009/08/17 09:48:34 pjd Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_VNODE_H_
@@ -75,7 +75,6 @@
 #define	VN_HOLD(v)	vref(v)
 #define	VN_RELE(v)	vrele(v)
 #define	VN_URELE(v)	vput(v)
-#define	VN_RELE_ASYNC(v, tq)	vn_rele_async(v, tq); 
 
 #define	VOP_REALVP(vp, vpp, ct)	(*(vpp) = (vp), 0)
 

==== //depot/projects/usb/src/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c#4 (text+ko) ====

@@ -2523,14 +2523,15 @@
 {
 	if (nvs->nvs_op == NVS_OP_ENCODE) {
 		nvs_native_t *native = (nvs_native_t *)nvs->nvs_private;
-		nvlist_t *packed = (void *)
+		char *packed = (void *)
 		    (native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp));
 		/*
 		 * Null out the pointer that is meaningless in the packed
 		 * structure. The address may not be aligned, so we have
 		 * to use bzero.
 		 */
-		bzero(&packed->nvl_priv, sizeof (packed->nvl_priv));
+		bzero(packed + offsetof(nvlist_t, nvl_priv),
+		    sizeof(((nvlist_t *)NULL)->nvl_priv));
 	}
 
 	return (nvs_embedded(nvs, EMBEDDED_NVL(nvp)));

==== //depot/projects/usb/src/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c#3 (text+ko) ====

@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -36,12 +36,10 @@
  * contributors.
  */
 
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/proc.h>
+#include <sys/taskq.h>
 #include <sys/vnode.h>
 
 /* Extensible attribute (xva) routines. */
@@ -74,15 +72,12 @@
 	return (xoap);
 }
 
-static STAILQ_HEAD(, vnode) vn_rele_async_list;
-static struct mtx vn_rele_async_lock;
-static struct cv vn_rele_async_cv;
-static int vn_rele_list_length;
-static int vn_rele_async_thread_exit;
+static void
+vn_rele_inactive(vnode_t *vp)
+{
 
-typedef struct  {
-	struct vnode *stqe_next;
-} vnode_link_t;
+	vrele(vp);
+}
 
 /*
  * Like vn_rele() except if we are going to call VOP_INACTIVE() then do it
@@ -95,117 +90,16 @@
  * This is because taskqs throttle back allocation if too many are created.
  */
 void
-vn_rele_async(vnode_t *vp, taskq_t *taskq /* unused */)
+vn_rele_async(vnode_t *vp, taskq_t *taskq)
 {
-	
-	KASSERT(vp != NULL, ("vrele: null vp"));
-	VFS_ASSERT_GIANT(vp->v_mount);
+	VERIFY(vp->v_count > 0);
 	VI_LOCK(vp);
-
-	if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) &&
-	    vp->v_usecount == 1)) {
-		vp->v_usecount--;
-		vdropl(vp);
-		return;
-	}	
-	if (vp->v_usecount != 1) {
-#ifdef DIAGNOSTIC
-		vprint("vrele: negative ref count", vp);
-#endif
+	if (vp->v_count == 1 && !(vp->v_iflag & VI_DOINGINACT)) {
 		VI_UNLOCK(vp);
-		panic("vrele: negative ref cnt");
-	}
-	/*
-	 * We are exiting
-	 */
-	if (vn_rele_async_thread_exit != 0) {
-		vrele(vp);
+		VERIFY(taskq_dispatch((taskq_t *)taskq,
+		    (task_func_t *)vn_rele_inactive, vp, TQ_SLEEP) != 0);
 		return;
 	}
-	
-	mtx_lock(&vn_rele_async_lock);
-
-	/*  STAILQ_INSERT_TAIL 			*/
-	(*(vnode_link_t *)&vp->v_cstart).stqe_next = NULL;
-	*vn_rele_async_list.stqh_last = vp;
-	vn_rele_async_list.stqh_last =
-	    &((vnode_link_t *)&vp->v_cstart)->stqe_next;
-
-	/****************************************/
-	vn_rele_list_length++;
-	if ((vn_rele_list_length % 100) == 0)
-		cv_signal(&vn_rele_async_cv);
-	mtx_unlock(&vn_rele_async_lock);
-	VI_UNLOCK(vp);
-}
-
-static void
-vn_rele_async_init(void *arg)
-{
-
-	mtx_init(&vn_rele_async_lock, "valock", NULL, MTX_DEF);
-	STAILQ_INIT(&vn_rele_async_list);
-
-	/* cv_init(&vn_rele_async_cv, "vacv"); */
-	vn_rele_async_cv.cv_description = "vacv";
-	vn_rele_async_cv.cv_waiters = 0;
-}
-
-void
-vn_rele_async_fini(void)
-{
-
-	mtx_lock(&vn_rele_async_lock);
-	vn_rele_async_thread_exit = 1;
-	cv_signal(&vn_rele_async_cv);
-	while (vn_rele_async_thread_exit != 0)
-		cv_wait(&vn_rele_async_cv, &vn_rele_async_lock);
-	mtx_unlock(&vn_rele_async_lock);
-	mtx_destroy(&vn_rele_async_lock);
+	vp->v_usecount--;
+	vdropl(vp);
 }
-
-
-static void
-vn_rele_async_cleaner(void)
-{
-	STAILQ_HEAD(, vnode) vn_tmp_list;
-	struct vnode *curvnode;

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



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