From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 00:13:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEC6A106566B; Sun, 21 Mar 2010 00:13:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B38A38FC0C; Sun, 21 Mar 2010 00:13:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2L0DBsd029606; Sun, 21 Mar 2010 00:13:11 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2L0DBbi029603; Sun, 21 Mar 2010 00:13:11 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201003210013.o2L0DBbi029603@svn.freebsd.org> From: Alan Cox Date: Sun, 21 Mar 2010 00:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205402 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 00:13:12 -0000 Author: alc Date: Sun Mar 21 00:13:11 2010 New Revision: 205402 URL: http://svn.freebsd.org/changeset/base/205402 Log: I am told by AMD that the machine check hardware on the instruction TLB won't generate bogus exceptions. Therefore, the implementation of the "unofficial" workaround needn't mask L1TP errors by the instruction cache unit. Modified: head/sys/amd64/amd64/mca.c head/sys/amd64/include/specialreg.h Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Sun Mar 21 00:05:29 2010 (r205401) +++ head/sys/amd64/amd64/mca.c Sun Mar 21 00:13:11 2010 (r205402) @@ -565,19 +565,16 @@ mca_init(void) /* * Disable logging of level one TLB parity (L1TP) errors by - * the data and instruction caches as an alternative - * workaround for AMD Family 10h Erratum 383. Unlike the - * recommended workaround, there is no performance penalty to - * this workaround. However, L1TP errors will go unreported. + * the data cache as an alternative workaround for AMD Family + * 10h Erratum 383. Unlike the recommended workaround, there + * is no performance penalty to this workaround. However, + * L1TP errors will go unreported. */ if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) { mask = rdmsr(MSR_MC0_CTL_MASK); if ((mask & (1UL << 5)) == 0) wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); - mask = rdmsr(MSR_MC1_CTL_MASK); - if ((mask & (1UL << 5)) == 0) - wrmsr(MSR_MC1_CTL_MASK, mask | (1UL << 5)); } for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { /* By default enable logging of all errors. */ Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Sun Mar 21 00:05:29 2010 (r205401) +++ head/sys/amd64/include/specialreg.h Sun Mar 21 00:13:11 2010 (r205402) @@ -507,7 +507,6 @@ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 -#define MSR_MC1_CTL_MASK 0xc0010045 /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 00:22:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CC62106566B; Sun, 21 Mar 2010 00:22:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADD98FC19; Sun, 21 Mar 2010 00:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2L0Lx5P031693; Sun, 21 Mar 2010 00:21:59 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2L0LxjI031691; Sun, 21 Mar 2010 00:21:59 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201003210021.o2L0LxjI031691@svn.freebsd.org> From: Alan Cox Date: Sun, 21 Mar 2010 00:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205403 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 00:22:00 -0000 Author: alc Date: Sun Mar 21 00:21:59 2010 New Revision: 205403 URL: http://svn.freebsd.org/changeset/base/205403 Log: Eliminate a pointless TLB invalidation from pmap_bootstrap(). No mappings whatsoever are changed between the earlier load_cr3() and this invalidation. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Mar 21 00:13:11 2010 (r205402) +++ head/sys/amd64/amd64/pmap.c Sun Mar 21 00:21:59 2010 (r205403) @@ -576,8 +576,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) virtual_avail = va; - invltlb(); - /* Initialize the PAT MSR. */ pmap_init_pat(); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 10:15:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590E21065676; Sun, 21 Mar 2010 10:15:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 15D488FC0A; Sun, 21 Mar 2010 10:15:59 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id AA10446B7E; Sun, 21 Mar 2010 06:15:58 -0400 (EDT) Date: Sun, 21 Mar 2010 10:15:58 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kip Macy In-Reply-To: <201003201947.o2KJlUUA070546@svn.freebsd.org> Message-ID: References: <201003201947.o2KJlUUA070546@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205391 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 10:15:59 -0000 On Sat, 20 Mar 2010, Kip Macy wrote: > - spread tcp timer callout load evenly across cpus if net.inet.tcp.per_cpu_timers is set to 1 > - don't default to acquiring tcbinfo lock exclusively in rexmt > > MFC after: 7 days In the future, it would be helpful if you could make independent changes such as these as separate commits. It makes post-commit review easier, but also means that elements of the change can be more easily backed out or merged separately. My experience with TCP timer and locking changes is that 7 days is a very short merge time. I would generally suggest a minimum of a month -- while bugs crop up more slowly in HEAD testing, the bug reports are better and you're more likely to get people with expertise looking at them there (without the risk of taking out large numbers of systems :-). This is especially true currently, when several folks actively have their hands in TCP. For more complex changes, I've generally been going with a three month MFC timeout. > +static int per_cpu_timers = 0; > +SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, > + &per_cpu_timers , 0, "run tcp timers on all cpus"); > + > +#define INP_CPU(inp) (per_cpu_timers ? (!CPU_ABSENT(((inp)->inp_flowid % (mp_maxid+1))) ? \ > + ((inp)->inp_flowid % (mp_maxid+1)) : curcpu) : 0) The 'curcpu' case here violates an invariant we have been trying hard to maintain: that callouts for a single inpcb/tcpcb execute on only one CPU at a time. While I don't have any specific bugs in mind (well, perhaps other than the well-known TCP timer race that turns out does occur with moderate frequency), it is fairly certain that increasing single connection parallelism in callouts would significantly increase the chances of hitting those bugs/features. Long and hard experience suggests that changing assumptions in the TCP timer code can have subtle but ultimately catastrophic consequences (both Andre and I have run into this in the past decade). Since the 'curcpu' case above is somewhat unlikely in the hardware you're using, can I suggest changing it to fall back to CPU 0 in that case as well? This would maintain the parallelism you're trying to accomplish but avoid that edge case that could have hard to to track down consequences. This would increase my comfort level with an MFC before 8.1. > @@ -478,11 +485,22 @@ tcp_timer_rexmt(void * xtp) > if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { > tp->t_rxtshift = TCP_MAXRXTSHIFT; > TCPSTAT_INC(tcps_timeoutdrop); > + in_pcbref(inp); > + INP_INFO_RUNLOCK(&V_tcbinfo); > + INP_WUNLOCK(inp); > + INP_INFO_WLOCK(&V_tcbinfo); > + INP_WLOCK(inp); > + if (in_pcbrele(inp)) { > + INP_INFO_WUNLOCK(&V_tcbinfo); > + CURVNET_RESTORE(); > + return; > + } > tp = tcp_drop(tp, tp->t_softerror ? > tp->t_softerror : ETIMEDOUT); > + headlocked = 1; > goto out; > } > - INP_INFO_WUNLOCK(&V_tcbinfo); > + INP_INFO_RUNLOCK(&V_tcbinfo); > headlocked = 0; > if (tp->t_rxtshift == 1) { > /* Recent survey results for tcp_timer_race leave me a bit worried about changes that open up greater potential races in the TCP timer code, and this one does worry me. When tcp_timer_race occurs, holding tcbinfo continuously across the timer is what helps mitigate the race. With dozens of sites reporting significantly non-zero instance of the bug, I'm worried that this change could allow a conversion from "silently mitigated with a counter bump" to "the system panics or similar". I need to think a bit more about the exact nature of the bug, but it could be that MFC'ing this part of the change before tcp_timer_race is fixed could have unfortunate stability consequences. (Since you're working only with long-lived connections with relatively little turnover, you may not see this in testing -- however, you can check net.inet.tcp.timer_race to see if production systems see it). Interestingly, it wasn't just 8-core systems that appeared in the reports, there were also uniprocessor systems. On an unrelated note: I think it would be useful to rename 'headlocked' in this function to 'headwlocked', since it no longer tracks whether tcbinfo is locked at all, it just tracks whether it is write-locked. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 13:09:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 921B7106564A; Sun, 21 Mar 2010 13:09:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756D68FC18; Sun, 21 Mar 2010 13:09:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LD9tIl007028; Sun, 21 Mar 2010 13:09:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LD9tOU007026; Sun, 21 Mar 2010 13:09:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003211309.o2LD9tOU007026@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Mar 2010 13:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205409 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 13:09:55 -0000 Author: marius Date: Sun Mar 21 13:09:54 2010 New Revision: 205409 URL: http://svn.freebsd.org/changeset/base/205409 Log: - The firmware of Sun Fire V1280 has a misfeature of setting %wstate to 7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into it which totally screws us even when restoring %wstate afterwards as spill/fill traps can happen while in OFW. The rather hackish OpenBSD approach of just setting the equivalent of WSTATE_KERNEL to 7 also is no option as we treat %wstate as a bit field. So in order to deal with this problem actually implement spill/fill handlers for %wstate 7 which just act as the WSTATE_KERNEL ones except of theoretically also handling 32-bit, turn off interrupts completely so we don't even take IPIs while in OFW which should ensure we only take spill/fill traps at most and restore %wstate after calling into OFW once we have taken over the trap table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into OFW just like OpenSolaris does, which should at least help testing this change on non-V1280. - Remove comments referring to the %wstate usage in BSD/OS. - Remove the no longer used RSF_ALIGN_RETRY macro. - Correct some trap table addresses in comments. - Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table. - Ensure PSTATE_AM is off when entering or exiting to OFW as well as that interrupts are also completely off when exiting to OFW as the firmware trap table shouldn't be used to handle our interrupts. Modified: head/sys/sparc64/include/wstate.h head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/locore.S head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/include/wstate.h ============================================================================== --- head/sys/sparc64/include/wstate.h Sun Mar 21 10:50:08 2010 (r205408) +++ head/sys/sparc64/include/wstate.h Sun Mar 21 13:09:54 2010 (r205409) @@ -33,7 +33,7 @@ #define _MACHINE_WSTATE_H_ /* - * Window state register bits. + * Window state register bits * * There really are no bits per se, just the two fields WSTATE.NORMAL * and WSTATE.OTHER. The rest is up to software. @@ -42,37 +42,8 @@ * (whichever is currently in effect) and WSTATE_OTHER to represent * user mode saves (only). * - * We use the low bit to suggest 32-bit mode, with the next bit set - * once we succeed in saving in some mode. That is, if the WSTATE_ASSUME - * bit is set, the spill or fill handler we use will be one that makes - * an assumption about the proper window-save mode. If the spill or - * fill fails with an alignment fault, the spill or fill op should - * take the `assume' bit away retry the instruction that caused the - * spill or fill. This will use the new %wstate, which will test for - * which mode to use. The alignment fault code helps us out here by - * resuming the spill vector at offset +70, where we are allowed to - * execute two instructions (i.e., write to %wstate and RETRY). - * - * If the ASSUME bit is not set when the alignment fault occurs, the - * given stack pointer is hopelessly wrong (and the spill, if it is a - * spill, should be done as a sort of "panic spill") -- so those two - * instructions will be a branch sequence. - * * Note that locore.s assumes this same bit layout (since the translation * from "bits" to "{spill,fill}_N_{normal,other}" is done in hardware). - * - * The value 0 is preferred for unknown to make it easy to start in - * unknown state and continue in whichever state unknown succeeds in -- - * a successful "other" save, for instance, can just set %wstate to - * ASSUMExx << USERSHIFT and thus leave the kernel state "unknown". - * - * We also need values for managing the somewhat tricky transition from - * user to kernel and back, so we use the one remaining free bit to mean - * "although this looks like kernel mode, the window(s) involved are - * user windows and should be saved ASI_AIUP". Everything else is - * otherwise the same, but we need not bother with assumptions in this - * mode (we expect it to apply to at most one window spill or fill), - * i.e., WSTATE_TRANSITION can ignore WSTATE_ASSUME if it likes. */ #define WSTATE_NORMAL_MASK 1 /* wstate normal minus transition */ @@ -88,4 +59,8 @@ #define WSTATE_NESTED /* if set, spill must not fault */ \ (WSTATE_TRANSITION << WSTATE_OTHER_SHIFT) +/* Values used by the PROM and (Open)Solaris */ +#define WSTATE_PROM_KMIX 7 +#define WSTATE_PROM_MASK 7 + #endif /* !_MACHINE_WSTATE_H_ */ Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Sun Mar 21 10:50:08 2010 (r205408) +++ head/sys/sparc64/sparc64/exception.S Sun Mar 21 13:09:54 2010 (r205409) @@ -316,15 +316,6 @@ END(tl1_kstack_fault) #define RSF_FILL_INC tl0_ret_fill_end - tl0_ret_fill /* - * Retry a spill or fill with a different wstate due to an alignment fault. - * We may just be using the wrong stack offset. - */ -#define RSF_ALIGN_RETRY(ws) \ - wrpr %g0, (ws), %wstate ; \ - retry ; \ - .align 16 - -/* * Generate a T_SPILL or T_FILL trap if the window operation fails. */ #define RSF_TRAP(type) \ @@ -1716,6 +1707,19 @@ END(tl1_dmmu_prot_trap) RSF_SPILL_TOPCB .endm + .macro tl1_spill_7_n + btst 1, %sp + bnz,a,pn %xcc, tl1_spill_0_n + nop + srl %sp, 0, %sp + SPILL(stw, %sp, 4, EMPTY) + saved + retry + .align 32 + RSF_FATAL(T_SPILL) + RSF_FATAL(T_SPILL) + .endm + .macro tl1_spill_0_o wr %g0, ASI_AIUP, %asi SPILL(stxa, %sp + SPOFF, 8, %asi) @@ -1770,6 +1774,19 @@ END(tl1_dmmu_prot_trap) RSF_FILL_MAGIC .endm + .macro tl1_fill_7_n + btst 1, %sp + bnz,a,pt %xcc, tl1_fill_0_n + nop + srl %sp, 0, %sp + FILL(lduw, %sp, 4, EMPTY) + restored + retry + .align 32 + RSF_FATAL(T_FILL) + RSF_FATAL(T_FILL) + .endm + /* * This is used to spill windows that are still occupied with user * data on kernel entry to the pcb. @@ -2016,8 +2033,10 @@ tl1_spill_0_n: tl1_spill_2_n: tl1_spill_2_n ! 0x288 tl1_spill_3_n: - tl1_spill_3_n ! 0x29c - tl1_spill_bad 4 ! 0x290-0x29f + tl1_spill_3_n ! 0x28c + tl1_spill_bad 3 ! 0x290-0x29b +tl1_spill_7_n: + tl1_spill_7_n ! 0x29c tl1_spill_0_o: tl1_spill_0_o ! 0x2a0 tl1_spill_1_o: @@ -2029,10 +2048,13 @@ tl1_fill_0_n: tl1_fill_0_n ! 0x2c0 tl1_fill_bad 1 ! 0x2c4 tl1_fill_2_n: - tl1_fill_2_n ! 0x2d0 + tl1_fill_2_n ! 0x2c8 tl1_fill_3_n: - tl1_fill_3_n ! 0x2d4 - tl1_fill_bad 12 ! 0x2d8-0x2ff + tl1_fill_3_n ! 0x2cc + tl1_fill_bad 3 ! 0x2d0-0x2db +tl1_fill_7_n: + tl1_fill_7_n ! 0x2dc + tl1_fill_bad 8 ! 0x2e0-0x2ff tl1_reserved 1 ! 0x300 tl1_breakpoint: tl1_gen T_BREAKPOINT ! 0x301 @@ -2649,7 +2671,7 @@ END(tl0_ret) * Kernel trap entry point * * void tl1_trap(u_int type, u_long o1, u_long o2, u_long tar, u_long sfar, - * u_int sfsr) + * u_int sfsr) * * This is easy because the stack is already setup and the windows don't need * to be split. We build a trapframe and call trap(), the same as above, but Modified: head/sys/sparc64/sparc64/locore.S ============================================================================== --- head/sys/sparc64/sparc64/locore.S Sun Mar 21 10:50:08 2010 (r205408) +++ head/sys/sparc64/sparc64/locore.S Sun Mar 21 13:09:54 2010 (r205409) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -139,8 +140,12 @@ ENTRY(cpu_setregs) * Force trap level 1 and take over the trap table. */ SET(tl0_base, %o2, %o1) + SET(tba_taken_over, %o3, %o2) + mov 1, %o3 + wrpr %g0, WSTATE_KERNEL, %wstate wrpr %g0, 1, %tl wrpr %o1, 0, %tba + stw %o3, [%o2] /* * Re-enable interrupts. Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Sun Mar 21 10:50:08 2010 (r205408) +++ head/sys/sparc64/sparc64/machdep.c Sun Mar 21 13:09:54 2010 (r205409) @@ -138,6 +138,7 @@ struct kva_md_info kmi; u_long ofw_vec; u_long ofw_tba; +u_int tba_taken_over; char sparc64_model[32]; @@ -466,7 +467,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Determine the TLB slot maxima, which are expected to be * equal across all CPUs. - * NB: for Cheetah-class CPUs, these properties only refer + * NB: for cheetah-class CPUs, these properties only refer * to the t16s. */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Sun Mar 21 10:50:08 2010 (r205408) +++ head/sys/sparc64/sparc64/support.S Sun Mar 21 13:09:54 2010 (r205409) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -751,11 +752,20 @@ ENTRY(ofw_entry) save %sp, -CCFSZ, %sp SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 - rdpr %pil, %l7 - wrpr %g0, PIL_TICK, %pil - call %l6 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l5 + wrpr %l5, 0, %pstate + SET(tba_taken_over, %l5, %l4) + brz,pn %l4, 1f + rdpr %wstate, %l5 + andn %l5, WSTATE_PROM_MASK, %l3 + wrpr %l3, WSTATE_PROM_KMIX, %wstate +1: call %l6 mov %i0, %o0 - wrpr %l7, 0, %pil + brz,pn %l4, 1f + nop + wrpr %g0, %l5, %wstate +1: wrpr %l7, 0, %pstate ret restore %o0, %g0, %o0 END(ofw_entry) @@ -766,9 +776,14 @@ END(ofw_entry) ENTRY(ofw_exit) save %sp, -CCFSZ, %sp flushw - wrpr %g0, PIL_TICK, %pil SET(ofw_tba, %l7, %l5) ldx [%l5], %l5 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l7 + wrpr %l7, 0, %pstate + rdpr %wstate, %l7 + andn %l7, WSTATE_PROM_MASK, %l7 + wrpr %l7, WSTATE_PROM_KMIX, %wstate wrpr %l5, 0, %tba ! restore the OFW trap table SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 13:18:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9EC91065677; Sun, 21 Mar 2010 13:18:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2998FC16; Sun, 21 Mar 2010 13:18:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LDI8Mv008942; Sun, 21 Mar 2010 13:18:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LDI8YZ008941; Sun, 21 Mar 2010 13:18:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003211318.o2LDI8YZ008941@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Mar 2010 13:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205410 - head/lib/libc/sparc64/fpu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 13:18:08 -0000 Author: marius Date: Sun Mar 21 13:18:08 2010 New Revision: 205410 URL: http://svn.freebsd.org/changeset/base/205410 Log: Avoid aliasing which leads to incorrect results when compiling with the default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Modified: head/lib/libc/sparc64/fpu/fpu_explode.c Modified: head/lib/libc/sparc64/fpu/fpu_explode.c ============================================================================== --- head/lib/libc/sparc64/fpu/fpu_explode.c Sun Mar 21 13:09:54 2010 (r205409) +++ head/lib/libc/sparc64/fpu/fpu_explode.c Sun Mar 21 13:18:08 2010 (r205410) @@ -139,9 +139,9 @@ __fpu_xtof(fp, i) * a signed or unsigned entity. */ if (fp->fp_sign && (int64_t)i < 0) - *((int64_t*)fp->fp_mant) = -i; + *((int64_t *)fp->fp_mant) = -i; else - *((int64_t*)fp->fp_mant) = i; + *((int64_t *)fp->fp_mant) = i; fp->fp_mant[2] = 0; fp->fp_mant[3] = 0; __fpu_norm(fp); @@ -262,14 +262,12 @@ __fpu_explode(fe, fp, type, reg) struct fpn *fp; int type, reg; { - u_int32_t s, *sp; - u_int64_t l[2]; - void *vl = l; + u_int64_t l0, l1; + u_int32_t s; if (type == FTYPE_LNG || type == FTYPE_DBL || type == FTYPE_EXT) { - l[0] = __fpu_getreg64(reg & ~1); - sp = vl; - fp->fp_sign = sp[0] >> 31; + l0 = __fpu_getreg64(reg & ~1); + fp->fp_sign = l0 >> 63; } else { s = __fpu_getreg(reg); fp->fp_sign = s >> 31; @@ -277,7 +275,7 @@ __fpu_explode(fe, fp, type, reg) fp->fp_sticky = 0; switch (type) { case FTYPE_LNG: - s = __fpu_xtof(fp, l[0]); + s = __fpu_xtof(fp, l0); break; case FTYPE_INT: @@ -289,12 +287,13 @@ __fpu_explode(fe, fp, type, reg) break; case FTYPE_DBL: - s = __fpu_dtof(fp, sp[0], sp[1]); + s = __fpu_dtof(fp, l0 >> 32, l0 & 0xffffffff); break; case FTYPE_EXT: - l[1] = __fpu_getreg64((reg & ~1) + 2); - s = __fpu_qtof(fp, sp[0], sp[1], sp[2], sp[3]); + l1 = __fpu_getreg64((reg & ~1) + 2); + s = __fpu_qtof(fp, l0 >> 32, l0 & 0xffffffff, l1 >> 32, + l1 & 0xffffffff); break; default: From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:00:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD048106566B; Sun, 21 Mar 2010 15:00:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCDAC8FC08; Sun, 21 Mar 2010 15:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LF0XRZ033390; Sun, 21 Mar 2010 15:00:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LF0XRM033388; Sun, 21 Mar 2010 15:00:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003211500.o2LF0XRM033388@svn.freebsd.org> From: Ed Maste Date: Sun, 21 Mar 2010 15:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205411 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:00:34 -0000 Author: emaste Date: Sun Mar 21 15:00:33 2010 New Revision: 205411 URL: http://svn.freebsd.org/changeset/base/205411 Log: Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA ioctl call, as it may sleep. Reviewed by: rwatson Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sun Mar 21 13:18:08 2010 (r205410) +++ head/sys/net/if_vlan.c Sun Mar 21 15:00:33 2010 (r205411) @@ -1382,9 +1382,9 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd case SIOCGIFMEDIA: VLAN_LOCK(); if (TRUNK(ifv) != NULL) { - error = (*PARENT(ifv)->if_ioctl)(PARENT(ifv), - SIOCGIFMEDIA, data); + p = PARENT(ifv); VLAN_UNLOCK(); + error = (*p->if_ioctl)(p, SIOCGIFMEDIA, data); /* Limit the result to the parent's current config. */ if (error == 0) { struct ifmediareq *ifmr; From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:02:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 706961065675; Sun, 21 Mar 2010 15:02:47 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F5D08FC0A; Sun, 21 Mar 2010 15:02:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LF2lwu034081; Sun, 21 Mar 2010 15:02:47 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LF2lmq034078; Sun, 21 Mar 2010 15:02:47 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201003211502.o2LF2lmq034078@svn.freebsd.org> From: Matt Jacob Date: Sun, 21 Mar 2010 15:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205412 - in head: sbin/geom/class/multipath sys/geom/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:02:47 -0000 Author: mjacob Date: Sun Mar 21 15:02:47 2010 New Revision: 205412 URL: http://svn.freebsd.org/changeset/base/205412 Log: Add 'rotate' and 'getactive' verbs to provide some control and information about what the currently active path is. Sponsored by: Panasas MFC after: 1 month Modified: head/sbin/geom/class/multipath/geom_multipath.c head/sys/geom/multipath/g_multipath.c Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Sun Mar 21 15:00:33 2010 (r205411) +++ head/sbin/geom/class/multipath/geom_multipath.c Sun Mar 21 15:02:47 2010 (r205412) @@ -62,6 +62,14 @@ struct g_command class_commands[] = { "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, NULL, "[-v] prov ..." }, + { + "rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + NULL, "[-v] prov ..." + }, + { + "getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + NULL, "[-v] prov ..." + }, G_CMD_SENTINEL }; Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sun Mar 21 15:00:33 2010 (r205411) +++ head/sys/geom/multipath/g_multipath.c Sun Mar 21 15:02:47 2010 (r205412) @@ -70,6 +70,8 @@ static int g_multipath_destroy(struct g_ static int g_multipath_destroy_geom(struct gctl_req *, struct g_class *, struct g_geom *); +static int g_multipath_rotate(struct g_geom *); + static g_taste_t g_multipath_taste; static g_ctl_req_t g_multipath_config; static g_init_t g_multipath_init; @@ -406,6 +408,30 @@ g_multipath_destroy_geom(struct gctl_req return (g_multipath_destroy(gp)); } +static int +g_multipath_rotate(struct g_geom *gp) +{ + struct g_consumer *lcp; + struct g_multipath_softc *sc = gp->softc; + + g_topology_assert(); + if (sc == NULL) + return (ENXIO); + LIST_FOREACH(lcp, &gp->consumer, consumer) { + if ((lcp->index & MP_BAD) == 0) { + if (sc->cp_active != lcp) { + break; + } + } + } + if (lcp) { + sc->cp_active = lcp; + printf("GEOM_MULTIPATH: %s now active path in %s\n", + lcp->provider->name, sc->sc_name); + } + return (0); +} + static void g_multipath_init(struct g_class *mp) { @@ -723,6 +749,63 @@ g_multipath_ctl_destroy(struct gctl_req } static void +g_multipath_ctl_rotate(struct gctl_req *req, struct g_class *mp) +{ + struct g_geom *gp; + const char *name; + int error; + + g_topology_assert(); + + name = gctl_get_asciiparam(req, "arg0"); + if (name == NULL) { + gctl_error(req, "No 'arg0' argument"); + return; + } + gp = g_multipath_find_geom(mp, name); + if (gp == NULL) { + gctl_error(req, "Device %s is invalid", name); + return; + } + error = g_multipath_rotate(gp); + if (error != 0) { + gctl_error(req, "failed to rotate %s (err=%d)", name, error); + } +} + +static void +g_multipath_ctl_getactive(struct gctl_req *req, struct g_class *mp) +{ + struct sbuf *sb; + struct g_geom *gp; + struct g_multipath_softc *sc; + const char *name; + + sb = sbuf_new_auto(); + + g_topology_assert(); + name = gctl_get_asciiparam(req, "arg0"); + if (name == NULL) { + gctl_error(req, "No 'arg0' argument"); + return; + } + gp = g_multipath_find_geom(mp, name); + if (gp == NULL) { + gctl_error(req, "Device %s is invalid", name); + return; + } + sc = gp->softc; + if (sc->cp_active) { + sbuf_printf(sb, "%s\n", sc->cp_active->provider->name); + } else { + sbuf_printf(sb, "none\n"); + } + sbuf_finish(sb); + gctl_set_param_err(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); +} + +static void g_multipath_config(struct gctl_req *req, struct g_class *mp, const char *verb) { uint32_t *version; @@ -736,6 +819,10 @@ g_multipath_config(struct gctl_req *req, g_multipath_ctl_create(req, mp); } else if (strcmp(verb, "destroy") == 0) { g_multipath_ctl_destroy(req, mp); + } else if (strcmp(verb, "rotate") == 0) { + g_multipath_ctl_rotate(req, mp); + } else if (strcmp(verb, "getactive") == 0) { + g_multipath_ctl_getactive(req, mp); } else { gctl_error(req, "Unknown verb %s", verb); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:14:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18661106566C; Sun, 21 Mar 2010 15:14:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0769D8FC12; Sun, 21 Mar 2010 15:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LFEL6k037593; Sun, 21 Mar 2010 15:14:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LFELl9037590; Sun, 21 Mar 2010 15:14:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003211514.o2LFELl9037590@svn.freebsd.org> From: Alexander Motin Date: Sun, 21 Mar 2010 15:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205413 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:14:22 -0000 Author: mav Date: Sun Mar 21 15:14:21 2010 New Revision: 205413 URL: http://svn.freebsd.org/changeset/base/205413 Log: Add some more codec IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Mar 21 15:02:47 2010 (r205412) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Mar 21 15:14:21 2010 (r205413) @@ -619,10 +619,14 @@ static const struct { #define HDA_CODEC_ALC267 HDA_CODEC_CONSTRUCT(REALTEK, 0x0267) #define HDA_CODEC_ALC268 HDA_CODEC_CONSTRUCT(REALTEK, 0x0268) #define HDA_CODEC_ALC269 HDA_CODEC_CONSTRUCT(REALTEK, 0x0269) +#define HDA_CODEC_ALC270 HDA_CODEC_CONSTRUCT(REALTEK, 0x0270) #define HDA_CODEC_ALC272 HDA_CODEC_CONSTRUCT(REALTEK, 0x0272) +#define HDA_CODEC_ALC273 HDA_CODEC_CONSTRUCT(REALTEK, 0x0273) +#define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) +#define HDA_CODEC_ALC665 HDA_CODEC_CONSTRUCT(REALTEK, 0x0665) #define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861) #define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862) #define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880) @@ -632,6 +636,7 @@ static const struct { #define HDA_CODEC_ALC887 HDA_CODEC_CONSTRUCT(REALTEK, 0x0887) #define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888) #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) +#define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Analog Devices */ @@ -735,6 +740,7 @@ static const struct { #define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) #define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) +#define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -805,7 +811,8 @@ static const struct { #define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801) #define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) #define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) -#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) +#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x2804) +#define HDA_CODEC_INTELG45_5 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELQ57 HDA_CODEC_CONSTRUCT(INTEL, 0x0054) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) @@ -821,10 +828,14 @@ static const struct { { HDA_CODEC_ALC267, "Realtek ALC267" }, { HDA_CODEC_ALC268, "Realtek ALC268" }, { HDA_CODEC_ALC269, "Realtek ALC269" }, + { HDA_CODEC_ALC270, "Realtek ALC270" }, { HDA_CODEC_ALC272, "Realtek ALC272" }, + { HDA_CODEC_ALC273, "Realtek ALC273" }, + { HDA_CODEC_ALC275, "Realtek ALC275" }, { HDA_CODEC_ALC660, "Realtek ALC660" }, { HDA_CODEC_ALC662, "Realtek ALC662" }, { HDA_CODEC_ALC663, "Realtek ALC663" }, + { HDA_CODEC_ALC665, "Realtek ALC665" }, { HDA_CODEC_ALC861, "Realtek ALC861" }, { HDA_CODEC_ALC861VD, "Realtek ALC861-VD" }, { HDA_CODEC_ALC880, "Realtek ALC880" }, @@ -834,6 +845,7 @@ static const struct { { HDA_CODEC_ALC887, "Realtek ALC887" }, { HDA_CODEC_ALC888, "Realtek ALC888" }, { HDA_CODEC_ALC889, "Realtek ALC889" }, + { HDA_CODEC_ALC892, "Realtek ALC892" }, { HDA_CODEC_AD1882, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, "Analog Devices AD1883" }, @@ -907,6 +919,7 @@ static const struct { { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, + { HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -966,6 +979,7 @@ static const struct { { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_5, "Intel G45 HDMI" }, { HDA_CODEC_INTELQ57, "Intel Q57 HDMI" }, { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:52:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38EA71065672; Sun, 21 Mar 2010 15:52:56 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3FC8FC18; Sun, 21 Mar 2010 15:52:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LFqt9U046582; Sun, 21 Mar 2010 15:52:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LFqtpA046580; Sun, 21 Mar 2010 15:52:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003211552.o2LFqtpA046580@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 21 Mar 2010 15:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205414 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:52:56 -0000 Author: luigi Date: Sun Mar 21 15:52:55 2010 New Revision: 205414 URL: http://svn.freebsd.org/changeset/base/205414 Log: revise documentation Modified: head/sys/netinet/ipfw/dn_sched.h Modified: head/sys/netinet/ipfw/dn_sched.h ============================================================================== --- head/sys/netinet/ipfw/dn_sched.h Sun Mar 21 15:14:21 2010 (r205413) +++ head/sys/netinet/ipfw/dn_sched.h Sun Mar 21 15:52:55 2010 (r205414) @@ -68,6 +68,18 @@ struct dn_alg { * enqueue enqueue packet 'm' on scheduler 's', queue 'q'. * q is NULL for !MULTIQUEUE. * Return 0 on success, 1 on drop (packet consumed anyways). + * Note that q should be interpreted only as a hint + * on the flow that the mbuf belongs to: while a + * scheduler will normally enqueue m into q, it is ok + * to leave q alone and put the mbuf elsewhere. + * This function is called in two cases: + * - when a new packet arrives to the scheduler; + * - when a scheduler is reconfigured. In this case the + * call is issued by the new_queue callback, with a + * non empty queue (q) and m pointing to the first + * mbuf in the queue. For this reason, the function + * should internally check for (m != q->mq.head) + * before calling dn_enqueue(). * * dequeue Called when scheduler instance 's' can * dequeue a packet. Return NULL if none are available. @@ -94,8 +106,15 @@ struct dn_alg { * * new_queue called to set the per-queue parameters, * e.g. S and F, adjust sum of weights in the parent, etc. - * If the queue has packets in it, add them to the scheduler - * as well. + * + * The new_queue callback is normally called from when + * creating a new queue. In some cases (such as a + * scheduler change or reconfiguration) it can be called + * with a non empty queue. In this case, the queue + * In case of non empty queue, the new_queue callback could + * need to call the enqueue function. In this case, + * the callback should eventually call enqueue() passing + * as m the first element in the queue. * * free_queue actions related to a queue removal, e.g. undo * all the above. If the queue has data in it, also remove From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:54:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6393106566C; Sun, 21 Mar 2010 15:54:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAC78FC1A; Sun, 21 Mar 2010 15:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LFs7Ir046854; Sun, 21 Mar 2010 15:54:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LFs7HC046851; Sun, 21 Mar 2010 15:54:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003211554.o2LFs7HC046851@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 21 Mar 2010 15:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205415 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:54:07 -0000 Author: luigi Date: Sun Mar 21 15:54:07 2010 New Revision: 205415 URL: http://svn.freebsd.org/changeset/base/205415 Log: no need for ipfw_flush_tables(), we just need ipfw_destroy_tables() Modified: head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Sun Mar 21 15:52:55 2010 (r205414) +++ head/sys/netinet/ipfw/ip_fw_private.h Sun Mar 21 15:54:07 2010 (r205415) @@ -274,7 +274,6 @@ int ipfw_lookup_table(struct ip_fw_chain int ipfw_init_tables(struct ip_fw_chain *ch); void ipfw_destroy_tables(struct ip_fw_chain *ch); int ipfw_flush_table(struct ip_fw_chain *ch, uint16_t tbl); -void ipfw_flush_tables(struct ip_fw_chain *ch); int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint8_t mlen, uint32_t value); int ipfw_dump_table_entry(struct radix_node *rn, void *arg); Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Sun Mar 21 15:52:55 2010 (r205414) +++ head/sys/netinet/ipfw/ip_fw_table.c Sun Mar 21 15:54:07 2010 (r205415) @@ -176,14 +176,18 @@ ipfw_flush_table(struct ip_fw_chain *ch, } void -ipfw_flush_tables(struct ip_fw_chain *ch) +ipfw_destroy_tables(struct ip_fw_chain *ch) { uint16_t tbl; + struct radix_node_head *rnh; IPFW_WLOCK_ASSERT(ch); - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) + for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) { ipfw_flush_table(ch, tbl); + rnh = ch->tables[tbl]; + rn_detachhead((void **)&rnh); + } } int @@ -203,21 +207,6 @@ ipfw_init_tables(struct ip_fw_chain *ch) return (0); } -void -ipfw_destroy_tables(struct ip_fw_chain *ch) -{ - int tbl; - struct radix_node_head *rnh; - - IPFW_WLOCK_ASSERT(ch); - - ipfw_flush_tables(ch); - for (tbl = 0; tbl < IPFW_TABLES_MAX; tbl++) { - rnh = ch->tables[tbl]; - rn_detachhead((void **)&rnh); - } -} - int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint32_t *val) From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 16:14:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 285D41065672; Sun, 21 Mar 2010 16:14:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1862E8FC26; Sun, 21 Mar 2010 16:14:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LGEJSH051378; Sun, 21 Mar 2010 16:14:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LGEJ6K051376; Sun, 21 Mar 2010 16:14:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003211614.o2LGEJ6K051376@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Mar 2010 16:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205416 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 16:14:20 -0000 Author: kib Date: Sun Mar 21 16:14:19 2010 New Revision: 205416 URL: http://svn.freebsd.org/changeset/base/205416 Log: Correct the type for uio_resid. MFC after: 3 days Modified: head/share/man/man9/uio.9 Modified: head/share/man/man9/uio.9 ============================================================================== --- head/share/man/man9/uio.9 Sun Mar 21 15:54:07 2010 (r205415) +++ head/share/man/man9/uio.9 Sun Mar 21 16:14:19 2010 (r205416) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd March 21, 2010 .Os .Dt UIO 9 .Sh NAME @@ -41,7 +41,7 @@ struct uio { struct iovec *uio_iov; /* scatter/gather list */ int uio_iovcnt; /* length of scatter/gather list */ off_t uio_offset; /* offset in target object */ - int uio_resid; /* remaining bytes to copy */ + ssize_t uio_resid; /* remaining bytes to copy */ enum uio_seg uio_segflg; /* address space */ enum uio_rw uio_rw; /* operation */ struct thread *uio_td; /* owner */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 16:30:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ABA11065670; Sun, 21 Mar 2010 16:30:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78DE98FC1A; Sun, 21 Mar 2010 16:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LGUWPK054980; Sun, 21 Mar 2010 16:30:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LGUWD4054976; Sun, 21 Mar 2010 16:30:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003211630.o2LGUWD4054976@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 21 Mar 2010 16:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205417 - in head/sys: conf netinet/ipfw netinet/ipfw/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 16:30:32 -0000 Author: luigi Date: Sun Mar 21 16:30:32 2010 New Revision: 205417 URL: http://svn.freebsd.org/changeset/base/205417 Log: Add a priority-based packet scheduler. Sponsored by: The ONELAB2 Project Submitted by: Riccardo Panicucci Added: head/sys/netinet/ipfw/dn_sched_prio.c (contents, props changed) Modified: head/sys/conf/files head/sys/netinet/ipfw/test/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 21 16:14:19 2010 (r205416) +++ head/sys/conf/files Sun Mar 21 16:30:32 2010 (r205417) @@ -2494,9 +2494,10 @@ netinet/in_rmx.c optional inet netinet/ip_divert.c optional inet ipdivert ipfirewall netinet/ipfw/dn_heap.c optional inet dummynet netinet/ipfw/dn_sched_fifo.c optional inet dummynet +netinet/ipfw/dn_sched_prio.c optional inet dummynet +netinet/ipfw/dn_sched_qfq.c optional inet dummynet netinet/ipfw/dn_sched_rr.c optional inet dummynet netinet/ipfw/dn_sched_wf2q.c optional inet dummynet -netinet/ipfw/dn_sched_qfq.c optional inet dummynet netinet/ipfw/ip_dummynet.c optional inet dummynet netinet/ipfw/ip_dn_io.c optional inet dummynet netinet/ipfw/ip_dn_glue.c optional inet dummynet Added: head/sys/netinet/ipfw/dn_sched_prio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/ipfw/dn_sched_prio.c Sun Mar 21 16:30:32 2010 (r205417) @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2010 Riccardo Panicucci, Universita` di Pisa + * All rights reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * $FreeBSD$ + */ +#ifdef _KERNEL +#include +#include +#include +#include +#include +#include +#include /* IFNAMSIZ */ +#include +#include /* ipfw_rule_ref */ +#include /* flow_id */ +#include +#include +#include +#include +#else +#include +#endif + +#define DN_SCHED_PRIO 5 //XXX + +#if !defined(_KERNEL) || !defined(__linux__) +#define test_bit(ix, pData) ((*pData) & (1<<(ix))) +#define __set_bit(ix, pData) (*pData) |= (1<<(ix)) +#define __clear_bit(ix, pData) (*pData) &= ~(1<<(ix)) +#endif + +#ifdef __MIPSEL__ +#define __clear_bit(ix, pData) (*pData) &= ~(1<<(ix)) +#endif + +/* Size of the array of queues pointers. */ +#define BITMAP_T unsigned long +#define MAXPRIO (sizeof(BITMAP_T) * 8) + +/* + * The scheduler instance contains an array of pointers to queues, + * one for each priority, and a bitmap listing backlogged queues. + */ +struct prio_si { + BITMAP_T bitmap; /* array bitmap */ + struct dn_queue *q_array[MAXPRIO]; /* Array of queues pointers */ +}; + +/* + * If a queue with the same priority is already backlogged, use + * that one instead of the queue passed as argument. + */ +static int +prio_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m) +{ + struct prio_si *si = (struct prio_si *)(_si + 1); + int prio = q->fs->fs.par[0]; + + if (test_bit(prio, &si->bitmap) == 0) { + /* No queue with this priority, insert */ + __set_bit(prio, &si->bitmap); + si->q_array[prio] = q; + } else { /* use the existing queue */ + q = si->q_array[prio]; + } + if (dn_enqueue(q, m, 0)) + return 1; + return 0; +} + +/* + * Packets are dequeued only from the highest priority queue. + * The function ffs() return the lowest bit in the bitmap that rapresent + * the array index (-1) which contains the pointer to the highest priority + * queue. + * After the dequeue, if this queue become empty, it is index is removed + * from the bitmap. + * Scheduler is idle if the bitmap is empty + * + * NOTE: highest priority is 0, lowest is sched->max_prio_q + */ +static struct mbuf * +prio_dequeue(struct dn_sch_inst *_si) +{ + struct prio_si *si = (struct prio_si *)(_si + 1); + struct mbuf *m; + struct dn_queue *q; + int prio; + + if (si->bitmap == 0) /* scheduler idle */ + return NULL; + + prio = ffs(si->bitmap) - 1; + + /* Take the highest priority queue in the scheduler */ + q = si->q_array[prio]; + // assert(q) + + m = dn_dequeue(q); + if (q->mq.head == NULL) { + /* Queue is now empty, remove from scheduler + * and mark it + */ + si->q_array[prio] = NULL; + __clear_bit(prio, &si->bitmap); + } + return m; +} + +static int +prio_new_sched(struct dn_sch_inst *_si) +{ + struct prio_si *si = (struct prio_si *)(_si + 1); + + bzero(si->q_array, sizeof(si->q_array)); + si->bitmap = 0; + + return 0; +} + +static int +prio_new_fsk(struct dn_fsk *fs) +{ + /* Check if the prioritiy is between 0 and MAXPRIO-1 */ + ipdn_bound_var(&fs->fs.par[0], 0, 0, MAXPRIO - 1, "PRIO priority"); + return 0; +} + +static int +prio_new_queue(struct dn_queue *q) +{ + struct prio_si *si = (struct prio_si *)(q->_si + 1); + int prio = q->fs->fs.par[0]; + struct dn_queue *oldq; + + q->ni.oid.subtype = DN_SCHED_PRIO; + + if (q->mq.head == NULL) + return 0; + + /* Queue already full, must insert in the scheduler or append + * mbufs to existing queue. This partly duplicates prio_enqueue + */ + if (test_bit(prio, &si->bitmap) == 0) { + /* No queue with this priority, insert */ + __set_bit(prio, &si->bitmap); + si->q_array[prio] = q; + } else if ( (oldq = si->q_array[prio]) != q) { + /* must append to the existing queue. + * can simply append q->mq.head to q2->... + * and add the counters to those of q2 + */ + oldq->mq.tail->m_nextpkt = q->mq.head; + oldq->mq.tail = q->mq.tail; + oldq->ni.length += q->ni.length; + q->ni.length = 0; + oldq->ni.len_bytes += q->ni.len_bytes; + q->ni.len_bytes = 0; + q->mq.tail = q->mq.head = NULL; + } + return 0; +} + +static int +prio_free_queue(struct dn_queue *q) +{ + int prio = q->fs->fs.par[0]; + struct prio_si *si = (struct prio_si *)(q->_si + 1); + + if (si->q_array[prio] == q) { + si->q_array[prio] = NULL; + __clear_bit(prio, &si->bitmap); + } + return 0; +} + + +static struct dn_alg prio_desc = { + _SI( .type = ) DN_SCHED_PRIO, + _SI( .name = ) "PRIO", + _SI( .flags = ) DN_MULTIQUEUE, + + /* we need extra space in the si and the queue */ + _SI( .schk_datalen = ) 0, + _SI( .si_datalen = ) sizeof(struct prio_si), + _SI( .q_datalen = ) 0, + + _SI( .enqueue = ) prio_enqueue, + _SI( .dequeue = ) prio_dequeue, + + _SI( .config = ) NULL, + _SI( .destroy = ) NULL, + _SI( .new_sched = ) prio_new_sched, + _SI( .free_sched = ) NULL, + + _SI( .new_fsk = ) prio_new_fsk, + _SI( .free_fsk = ) NULL, + + _SI( .new_queue = ) prio_new_queue, + _SI( .free_queue = ) prio_free_queue, +}; + + +DECLARE_DNSCHED_MODULE(dn_prio, &prio_desc); Modified: head/sys/netinet/ipfw/test/Makefile ============================================================================== --- head/sys/netinet/ipfw/test/Makefile Sun Mar 21 16:14:19 2010 (r205416) +++ head/sys/netinet/ipfw/test/Makefile Sun Mar 21 16:30:32 2010 (r205417) @@ -6,9 +6,10 @@ SCHED_SRCS = test_dn_sched.c SCHED_SRCS += dn_sched_fifo.c -SCHED_SRCS += dn_sched_wf2q.c +SCHED_SRCS += dn_sched_prio.c SCHED_SRCS += dn_sched_qfq.c SCHED_SRCS += dn_sched_rr.c +SCHED_SRCS += dn_sched_wf2q.c SCHED_SRCS += dn_heap.c SCHED_SRCS += main.c From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 17:53:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2D891065673; Sun, 21 Mar 2010 17:53:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C26A38FC1B; Sun, 21 Mar 2010 17:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LHrsvm073312; Sun, 21 Mar 2010 17:53:54 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LHrsen073310; Sun, 21 Mar 2010 17:53:54 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <201003211753.o2LHrsen073310@svn.freebsd.org> From: Sam Leffler Date: Sun, 21 Mar 2010 17:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205421 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 17:53:54 -0000 Author: sam Date: Sun Mar 21 17:53:54 2010 New Revision: 205421 URL: http://svn.freebsd.org/changeset/base/205421 Log: remove pre-vap examples Modified: head/share/man/man4/ath.4 Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Sun Mar 21 17:05:41 2010 (r205420) +++ head/share/man/man4/ath.4 Sun Mar 21 17:53:54 2010 (r205421) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd July 8, 2009 +.Dd March 21, 2010 .Dt ATH 4 .Os .Sh NAME @@ -145,15 +145,6 @@ except those that are based on the AR500 A list of cards that are supported can be found at .Pa http://customerproducts.atheros.com/customerproducts/default.asp . .Sh EXAMPLES -Join an existing BSS network (ie: connect to an access point): -.Pp -.Dl "ifconfig ath0 inet 192.168.0.20 netmask 0xffffff00" -.Pp -Join a specific BSS network with network name -.Dq Li my_net : -.Pp -.Dl "ifconfig ath0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net" -.Pp Join a specific BSS network with WEP encryption: .Bd -literal -offset indent ifconfig wlan0 create wlandev ath0 From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 18:18:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293521065670; Sun, 21 Mar 2010 18:18:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F21978FC17; Sun, 21 Mar 2010 18:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LIIwKN078837; Sun, 21 Mar 2010 18:18:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LIIwde078835; Sun, 21 Mar 2010 18:18:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003211818.o2LIIwde078835@svn.freebsd.org> From: Alexander Motin Date: Sun, 21 Mar 2010 18:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205422 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 18:18:59 -0000 Author: mav Date: Sun Mar 21 18:18:58 2010 New Revision: 205422 URL: http://svn.freebsd.org/changeset/base/205422 Log: - Spec tells that CCC interrupt is edge triggered. Acknowledge it as such. - Do not try to enable CCC if it is not supported. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Mar 21 17:53:54 2010 (r205421) +++ head/sys/dev/ahci/ahci.c Sun Mar 21 18:18:58 2010 (r205422) @@ -66,6 +66,7 @@ static void ahci_ch_pm(void *arg); static void ahci_ch_intr_locked(void *data); static void ahci_ch_intr(void *data); static int ahci_ctlr_reset(device_t dev); +static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); static void ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void ahci_execute_transaction(struct ahci_slot *slot); @@ -372,6 +373,9 @@ ahci_attach(device_t dev) ctlr->caps &= ~AHCI_CAP_SPM; if (ctlr->quirks & AHCI_Q_NONCQ) ctlr->caps &= ~AHCI_CAP_SNCQ; + if ((ctlr->caps & AHCI_CAP_CCCS) == 0) + ctlr->ccc = 0; + ahci_ctlr_setup(dev); /* Setup interrupts. */ if (ahci_setup_interrupt(dev)) { bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); @@ -501,6 +505,13 @@ ahci_ctlr_reset(device_t dev) } /* Reenable AHCI mode */ ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); + return (0); +} + +static int +ahci_ctlr_setup(device_t dev) +{ + struct ahci_controller *ctlr = device_get_softc(dev); /* Clear interrupts */ ATA_OUTL(ctlr->r_mem, AHCI_IS, ATA_INL(ctlr->r_mem, AHCI_IS)); /* Configure CCC */ @@ -543,6 +554,7 @@ ahci_resume(device_t dev) if ((res = ahci_ctlr_reset(dev)) != 0) return (res); + ahci_ctlr_setup(dev); return (bus_generic_resume(dev)); } @@ -615,7 +627,7 @@ ahci_intr(void *data) { struct ahci_controller_irq *irq = data; struct ahci_controller *ctlr = irq->ctlr; - u_int32_t is; + u_int32_t is, ise = 0; void *arg; int unit; @@ -629,9 +641,14 @@ ahci_intr(void *data) unit = irq->r_irq_rid - 1; is = ATA_INL(ctlr->r_mem, AHCI_IS); } + /* CCC interrupt is edge triggered. */ + if (ctlr->ccc) + ise = 1 << ctlr->cccv; /* Some controllers have edge triggered IS. */ if (ctlr->quirks & AHCI_Q_EDGEIS) - ATA_OUTL(ctlr->r_mem, AHCI_IS, is); + ise |= is; + if (ise != 0) + ATA_OUTL(ctlr->r_mem, AHCI_IS, ise); for (; unit < ctlr->channels; unit++) { if ((is & (1 << unit)) != 0 && (arg = ctlr->interrupt[unit].argument)) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 20:43:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B26106566C; Sun, 21 Mar 2010 20:43:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1620E8FC18; Sun, 21 Mar 2010 20:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LKhNFb010703; Sun, 21 Mar 2010 20:43:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LKhNsO010698; Sun, 21 Mar 2010 20:43:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201003212043.o2LKhNsO010698@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Mar 2010 20:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205423 - in head: lib/libc/sys sys/compat/linux sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 20:43:24 -0000 Author: ed Date: Sun Mar 21 20:43:23 2010 New Revision: 205423 URL: http://svn.freebsd.org/changeset/base/205423 Log: Actually make O_DIRECTORY work. According to POSIX open() must return ENOTDIR when the path name does not refer to a path name. Change vn_open() to respect this flag. This also simplifies the Linuxolator a bit. Modified: head/lib/libc/sys/open.2 head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Sun Mar 21 18:18:58 2010 (r205422) +++ head/lib/libc/sys/open.2 Sun Mar 21 20:43:23 2010 (r205423) @@ -117,6 +117,7 @@ O_SYNC synchronous writes O_NOFOLLOW do not follow symlinks O_NOCTTY don't assign controlling terminal O_TTY_INIT restore default terminal attributes +O_DIRECTORY error if file is not a directory .Ed .Pp Opening a file with @@ -222,6 +223,14 @@ The initial call to on a TTY will always restore default terminal attributes on .Fx . .Pp +.Dv O_DIRECTORY +may be used to ensure the resulting file descriptor refers to a +directory. +This flag can be used to prevent applications with elevated privileges +from opening files which are even unsafe to open with +.Dv O_RDONLY , +such as device nodes. +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. @@ -413,6 +422,9 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Eq ENOTDIR +.Dv O_DIRECTORY +is specified and the file is not a directory. .El .Sh SEE ALSO .Xr chmod 2 , Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sun Mar 21 18:18:58 2010 (r205422) +++ head/sys/compat/linux/linux_file.c Sun Mar 21 20:43:23 2010 (r205423) @@ -128,6 +128,8 @@ linux_common_open(struct thread *td, int bsd_flags |= O_DIRECT; if (l_flags & LINUX_O_NOFOLLOW) bsd_flags |= O_NOFOLLOW; + if (l_flags & LINUX_O_DIRECTORY) + bsd_flags |= O_DIRECTORY; /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); @@ -154,12 +156,6 @@ linux_common_open(struct thread *td, int PROC_UNLOCK(p); sx_sunlock(&proctree_lock); } - if (l_flags & LINUX_O_DIRECTORY) { - if (fp->f_type != DTYPE_VNODE || - fp->f_vnode->v_type != VDIR) { - error = ENOTDIR; - } - } fdrop(fp, td); /* * XXX as above, fdrop()/kern_close() pair is racy. Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Mar 21 18:18:58 2010 (r205422) +++ head/sys/kern/vfs_syscalls.c Sun Mar 21 20:43:23 2010 (r205423) @@ -4428,6 +4428,10 @@ fhopen(td, uap) error = EOPNOTSUPP; goto bad; } + if (vp->v_type != VDIR && fmode & O_DIRECTORY) { + error = ENOTDIR; + goto bad; + } accmode = 0; if (fmode & (FWRITE | O_TRUNC)) { if (vp->v_type == VDIR) { Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Mar 21 18:18:58 2010 (r205422) +++ head/sys/kern/vfs_vnops.c Sun Mar 21 20:43:23 2010 (r205423) @@ -200,6 +200,10 @@ restart: error = EOPNOTSUPP; goto bad; } + if (vp->v_type != VDIR && fmode & O_DIRECTORY) { + error = ENOTDIR; + goto bad; + } accmode = 0; if (fmode & (FWRITE | O_TRUNC)) { if (vp->v_type == VDIR) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 20:45:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14DC106566C; Sun, 21 Mar 2010 20:45:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0B098FC0A; Sun, 21 Mar 2010 20:45:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LKj6LF011114; Sun, 21 Mar 2010 20:45:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LKj636011112; Sun, 21 Mar 2010 20:45:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201003212045.o2LKj636011112@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Mar 2010 20:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205424 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 20:45:06 -0000 Author: ed Date: Sun Mar 21 20:45:06 2010 New Revision: 205424 URL: http://svn.freebsd.org/changeset/base/205424 Log: Let opendir() use O_DIRECTORY. I am not removing the fstat() calls here, since we cannot yet assume people will always run kernels that respect O_DIRECTORY. Modified: head/lib/libc/gen/opendir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Sun Mar 21 20:43:23 2010 (r205423) +++ head/lib/libc/gen/opendir.c Sun Mar 21 20:45:06 2010 (r205424) @@ -86,7 +86,7 @@ __opendir2(const char *name, int flags) errno = ENOTDIR; return (NULL); } - if ((fd = _open(name, O_RDONLY | O_NONBLOCK)) == -1) + if ((fd = _open(name, O_RDONLY | O_NONBLOCK | O_DIRECTORY)) == -1) return (NULL); return __opendir_common(fd, name, flags); @@ -200,7 +200,7 @@ __opendir_common(int fd, const char *nam */ if (flags & DTF_REWIND) { (void)_close(fd); - if ((fd = _open(name, O_RDONLY)) == -1) { + if ((fd = _open(name, O_RDONLY | O_DIRECTORY)) == -1) { saved_errno = errno; free(buf); free(dirp); From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 21:03:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4605106564A; Sun, 21 Mar 2010 21:03:35 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D37878FC15; Sun, 21 Mar 2010 21:03:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LL3ZDX015217; Sun, 21 Mar 2010 21:03:35 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LL3ZWB015215; Sun, 21 Mar 2010 21:03:35 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201003212103.o2LL3ZWB015215@svn.freebsd.org> From: Olivier Houchard Date: Sun, 21 Mar 2010 21:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205425 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 21:03:36 -0000 Author: cognet Date: Sun Mar 21 21:03:35 2010 New Revision: 205425 URL: http://svn.freebsd.org/changeset/base/205425 Log: Make sure we insert and remove the PV entries related to unmanaged kernel mappings into the kernel pmap, not into the pmap related to the pmap_enter_pv()/pmap_remove_pv() call. Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sun Mar 21 20:45:06 2010 (r205424) +++ head/sys/arm/arm/pmap.c Sun Mar 21 21:03:35 2010 (r205425) @@ -1605,10 +1605,11 @@ pmap_enter_pv(struct vm_page *pg, struct pve->pv_flags = PVF_WRITE | PVF_UNMAN; pg->md.pv_kva = 0; + if (!(km = PMAP_OWNED(pmap_kernel()))) + PMAP_LOCK(pmap_kernel()); TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); - TAILQ_INSERT_HEAD(&pm->pm_pvlist, pve, pv_plist); - if ((km = PMAP_OWNED(pmap_kernel()))) - PMAP_UNLOCK(pmap_kernel()); + TAILQ_INSERT_HEAD(&pve->pv_pmap->pm_pvlist, pve, pv_plist); + PMAP_UNLOCK(pmap_kernel()); vm_page_unlock_queues(); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); @@ -1712,6 +1713,7 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t pv = TAILQ_FIRST(&pg->md.pv_list); if (pv != NULL && (pv->pv_flags & PVF_UNMAN) && TAILQ_NEXT(pv, pv_list) == NULL) { + pm = kernel_pmap; pg->md.pv_kva = pv->pv_va; /* a recursive pmap_nuke_pv */ TAILQ_REMOVE(&pg->md.pv_list, pv, pv_list); From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 21:33:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01DE3106566B; Sun, 21 Mar 2010 21:33:22 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E30D58FC0A; Sun, 21 Mar 2010 21:33:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LLXLnZ021844; Sun, 21 Mar 2010 21:33:21 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LLXLbd021840; Sun, 21 Mar 2010 21:33:21 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003212133.o2LLXLbd021840@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 21 Mar 2010 21:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205427 - in head: tools/regression/usr.bin/ncal usr.bin/ncal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 21:33:22 -0000 Author: edwin Date: Sun Mar 21 21:33:21 2010 New Revision: 205427 URL: http://svn.freebsd.org/changeset/base/205427 Log: Replace -b with -C and -B (as proposed by Alexander). Add -3, -A and -B to the usage. Update regression test for the new parameters. Modified: head/tools/regression/usr.bin/ncal/regress.sh head/usr.bin/ncal/ncal.1 head/usr.bin/ncal/ncal.c Modified: head/tools/regression/usr.bin/ncal/regress.sh ============================================================================== --- head/tools/regression/usr.bin/ncal/regress.sh Sun Mar 21 21:25:35 2010 (r205426) +++ head/tools/regression/usr.bin/ncal/regress.sh Sun Mar 21 21:33:21 2010 (r205427) @@ -1,7 +1,8 @@ # $FreeBSD$ CAL_BIN="ncal" -CAL="${CAL_BIN}" +CAL="${CAL_BIN} -C" +NCAL="${CAL_BIN} -N" YEARS="2008 2009 2010 2011" ONEYEAR="2009" @@ -18,13 +19,13 @@ echo 1..16 for y in ${YEARS}; do # Regular calendar, Month days, No-highlight - REGRESSION_TEST(`r-y${y}-md-nhl', `$CAL -h ${y}') + REGRESSION_TEST(`r-y${y}-md-nhl', `$NCAL -h ${y}') # Backwards calendar, Month days, No-highlight - REGRESSION_TEST(`b-y${y}-md-nhl', `$CAL -bh ${y}') + REGRESSION_TEST(`b-y${y}-md-nhl', `$CAL -h ${y}') # Regular calendar, Julian days, No-highlight - REGRESSION_TEST(`r-y${y}-jd-nhl', `$CAL -jh ${y}') + REGRESSION_TEST(`r-y${y}-jd-nhl', `$NCAL -jh ${y}') # Backwards calendar, Julian days, No-highlight - REGRESSION_TEST(`b-y${y}-jd-nhl', `$CAL -jbh ${y}') + REGRESSION_TEST(`b-y${y}-jd-nhl', `$CAL -jh ${y}') done # 3 month calendars @@ -33,13 +34,15 @@ echo 17 .. 29 for m in $(jot -w %02d 12); do # Regular calendar, Month days, No-highlight - REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl', `$CAL -h3 ${m} ${ONEYEAR}') + REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl', + `$NCAL -h3 ${m} ${ONEYEAR}') # Backwards calendar, Month days, No-highlight - REGRESSION_TEST(`b-3m${ONEYEAR}${m}-md-nhl', `$CAL -bh3 ${m} ${ONEYEAR}') + REGRESSION_TEST(`b-3m${ONEYEAR}${m}-md-nhl', `$CAL -h3 ${m} ${ONEYEAR}') # Regular calendar, Julian days, No-highlight - REGRESSION_TEST(`r-3m${ONEYEAR}${m}-jd-nhl', `$CAL -jh3 ${m} ${ONEYEAR}') + REGRESSION_TEST(`r-3m${ONEYEAR}${m}-jd-nhl', + `$NCAL -jh3 ${m} ${ONEYEAR}') # Backwards calendar, Julian days, No-highlight - REGRESSION_TEST(`b-3m${ONEYEAR}${m}-jd-nhl', `$CAL -jbh3 ${m} ${ONEYEAR}') + REGRESSION_TEST(`b-3m${ONEYEAR}${m}-jd-nhl', `$CAL -jh3 ${m} ${ONEYEAR}') done # @@ -47,33 +50,33 @@ done # # These should fail -REGRESSION_TEST(`f-3y-nhl', `$CAL -3 -y 2>&1') -REGRESSION_TEST(`f-3A-nhl', `$CAL -3 -A 3 2>&1') -REGRESSION_TEST(`f-3B-nhl', `$CAL -3 -B 3 2>&1') -REGRESSION_TEST(`f-3gy-nhl', `$CAL -3 2008 2>&1') -REGRESSION_TEST(`f-3AB-nhl', `$CAL -3 -A 3 -B 3 2>&1') -REGRESSION_TEST(`f-mgm-nhl', `$CAL -m 3 2 2008 2>&1') -REGRESSION_TEST(`f-ym-nhl', `$CAL -y -m 2 2>&1') -REGRESSION_TEST(`f-ygm-nhl', `$CAL -y 2 2008 2>&1') -REGRESSION_TEST(`f-yA-nhl', `$CAL -y -A 3 2>&1') -REGRESSION_TEST(`f-yB-nhl', `$CAL -y -B 3 2>&1') -REGRESSION_TEST(`f-yAB-nhl', `$CAL -y -A 3 -B 3 2>&1') +REGRESSION_TEST(`f-3y-nhl', `$NCAL -3 -y 2>&1') +REGRESSION_TEST(`f-3A-nhl', `$NCAL -3 -A 3 2>&1') +REGRESSION_TEST(`f-3B-nhl', `$NCAL -3 -B 3 2>&1') +REGRESSION_TEST(`f-3gy-nhl', `$NCAL -3 2008 2>&1') +REGRESSION_TEST(`f-3AB-nhl', `$NCAL -3 -A 3 -B 3 2>&1') +REGRESSION_TEST(`f-mgm-nhl', `$NCAL -m 3 2 2008 2>&1') +REGRESSION_TEST(`f-ym-nhl', `$NCAL -y -m 2 2>&1') +REGRESSION_TEST(`f-ygm-nhl', `$NCAL -y 2 2008 2>&1') +REGRESSION_TEST(`f-yA-nhl', `$NCAL -y -A 3 2>&1') +REGRESSION_TEST(`f-yB-nhl', `$NCAL -y -B 3 2>&1') +REGRESSION_TEST(`f-yAB-nhl', `$NCAL -y -A 3 -B 3 2>&1') # These should be successful -REGRESSION_TEST(`s-b-3-nhl', `$CAL -b -d 2008.03 -3') -REGRESSION_TEST(`s-b-A-nhl', `$CAL -b -d 2008.03 -A 1') -REGRESSION_TEST(`s-b-B-nhl', `$CAL -b -d 2008.03 -B 1') -REGRESSION_TEST(`s-b-AB-nhl', `$CAL -b -d 2008.03 -A 1 -B 1') -REGRESSION_TEST(`s-b-m-nhl', `$CAL -b -d 2008.03 -m 1') -REGRESSION_TEST(`s-b-mgy-nhl', `$CAL -b -d 2008.03 -m 1 2007') -REGRESSION_TEST(`s-b-gmgy-nhl', `$CAL -b -d 2008.03 1 2007') -REGRESSION_TEST(`s-r-3-nhl', `$CAL -d 2008.03 -3') -REGRESSION_TEST(`s-r-A-nhl', `$CAL -d 2008.03 -A 1') -REGRESSION_TEST(`s-r-B-nhl', `$CAL -d 2008.03 -B 1') -REGRESSION_TEST(`s-r-AB-nhl', `$CAL -d 2008.03 -A 1 -B 1') -REGRESSION_TEST(`s-r-m-nhl', `$CAL -d 2008.03 -m 1') -REGRESSION_TEST(`s-r-mgy-nhl', `$CAL -d 2008.03 -m 1 2007') -REGRESSION_TEST(`s-r-gmgy-nhl', `$CAL -d 2008.03 1 2007') +REGRESSION_TEST(`s-b-3-nhl', `$CAL -d 2008.03 -3') +REGRESSION_TEST(`s-b-A-nhl', `$CAL -d 2008.03 -A 1') +REGRESSION_TEST(`s-b-B-nhl', `$CAL -d 2008.03 -B 1') +REGRESSION_TEST(`s-b-AB-nhl', `$CAL -d 2008.03 -A 1 -B 1') +REGRESSION_TEST(`s-b-m-nhl', `$CAL -d 2008.03 -m 1') +REGRESSION_TEST(`s-b-mgy-nhl', `$CAL -d 2008.03 -m 1 2007') +REGRESSION_TEST(`s-b-gmgy-nhl', `$CAL -d 2008.03 1 2007') +REGRESSION_TEST(`s-r-3-nhl', `$NCAL -d 2008.03 -3') +REGRESSION_TEST(`s-r-A-nhl', `$NCAL -d 2008.03 -A 1') +REGRESSION_TEST(`s-r-B-nhl', `$NCAL -d 2008.03 -B 1') +REGRESSION_TEST(`s-r-AB-nhl', `$NCAL -d 2008.03 -A 1 -B 1') +REGRESSION_TEST(`s-r-m-nhl', `$NCAL -d 2008.03 -m 1') +REGRESSION_TEST(`s-r-mgy-nhl', `$NCAL -d 2008.03 -m 1 2007') +REGRESSION_TEST(`s-r-gmgy-nhl', `$NCAL -d 2008.03 1 2007') REGRESSION_END() Modified: head/usr.bin/ncal/ncal.1 ============================================================================== --- head/usr.bin/ncal/ncal.1 Sun Mar 21 21:25:35 2010 (r205426) +++ head/usr.bin/ncal/ncal.1 Sun Mar 21 21:33:21 2010 (r205427) @@ -60,6 +60,10 @@ .Op Fl A Ar number .Op Fl B Ar number .Op Ar year +.Nm ncal +.Op Fl CN +.Op Fl H Ar yyyy-mm-dd +.Op Fl d Ar yyyy-mm .Sh DESCRIPTION The .Nm @@ -127,8 +131,14 @@ of months after the current month. Display the .Ar number of months before the current month. -.It Fl b -Switch to backwards compatibility mode (for debugging). +.It Fl C +Switch to +.Nm cal +mode. +.It Fl N +Switch to +.Nm ncal +mode. .It Fl d Ar yyyy-mm Use .Ar yyyy-mm Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Sun Mar 21 21:25:35 2010 (r205426) +++ head/usr.bin/ncal/ncal.c Sun Mar 21 21:33:21 2010 (r205427) @@ -256,7 +256,7 @@ main(int argc, char *argv[]) before = after = -1; - while ((ch = getopt(argc, argv, "A:B:3Jbd:eH:hjm:ops:wy")) != -1) + while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wy")) != -1) switch (ch) { case '3': flag_3months = 1; @@ -283,9 +283,12 @@ main(int argc, char *argv[]) nswitch = ndaysj(&never); flag_julian_cal = 1; break; - case 'b': + case 'C': flag_backward = 1; break; + case 'N': + flag_backward = 0; + break; case 'd': flag_today = optarg; break; @@ -500,11 +503,12 @@ usage(void) { fputs( - "usage: cal [-hjy] [[month] year]\n" - " cal [-hj] [-m month] [year]\n" - " ncal [-hJjpwy] [-s country_code] [[month] year]\n" - " ncal [-hJeo] [year]\n" - "for debug the highlighting: [-b] [-H yyyy-mm-dd] [-d yyyy-mm]\n", +"Usage: cal [general options] [-hjy] [[month] year]\n" +" cal [general options] [-hj] [-m month] [year]\n" +" ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" +" ncal [general options] [-hJeo] [year]\n" +"General options: [-NC3] [-A months] [-B months]\n" +"For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", stderr); exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 22:33:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 478631065673; Sun, 21 Mar 2010 22:33:10 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36AC88FC27; Sun, 21 Mar 2010 22:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LMXAMR034916; Sun, 21 Mar 2010 22:33:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LMXAV0034913; Sun, 21 Mar 2010 22:33:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003212233.o2LMXAV0034913@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 21 Mar 2010 22:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205428 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 22:33:10 -0000 Author: marcel Date: Sun Mar 21 22:33:09 2010 New Revision: 205428 URL: http://svn.freebsd.org/changeset/base/205428 Log: Don't include when _MACHINE_REGSET_H_ in defined. This is not for multiple inclusion purposes, because _regset.h already handles this, but to enable inclusion of the MD header by cross-tools on non-ia64 installations. The cross-tool can include _regset.h itself before including MD headers that depend on it. Modified: head/sys/ia64/include/frame.h head/sys/ia64/include/pcb.h Modified: head/sys/ia64/include/frame.h ============================================================================== --- head/sys/ia64/include/frame.h Sun Mar 21 21:33:21 2010 (r205427) +++ head/sys/ia64/include/frame.h Sun Mar 21 22:33:09 2010 (r205428) @@ -29,7 +29,9 @@ #ifndef _MACHINE_FRAME_H_ #define _MACHINE_FRAME_H_ +#ifndef _MACHINE_REGSET_H_ #include +#endif /* * Software trap, exception, and syscall frame. Modified: head/sys/ia64/include/pcb.h ============================================================================== --- head/sys/ia64/include/pcb.h Sun Mar 21 21:33:21 2010 (r205427) +++ head/sys/ia64/include/pcb.h Sun Mar 21 22:33:09 2010 (r205428) @@ -30,7 +30,9 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ +#ifndef _MACHINE_REGSET_H_ #include +#endif /* * PCB: process control block From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 22:39:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC362106564A; Sun, 21 Mar 2010 22:39:11 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBBBD8FC15; Sun, 21 Mar 2010 22:39:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LMdBdu036249; Sun, 21 Mar 2010 22:39:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LMdBw4036247; Sun, 21 Mar 2010 22:39:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003212239.o2LMdBw4036247@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 21 Mar 2010 22:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205429 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 22:39:11 -0000 Author: marcel Date: Sun Mar 21 22:39:11 2010 New Revision: 205429 URL: http://svn.freebsd.org/changeset/base/205429 Log: Print MD fields in the pcpu to aid debugging. Modified: head/sys/ia64/ia64/db_machdep.c Modified: head/sys/ia64/ia64/db_machdep.c ============================================================================== --- head/sys/ia64/ia64/db_machdep.c Sun Mar 21 22:33:09 2010 (r205428) +++ head/sys/ia64/ia64/db_machdep.c Sun Mar 21 22:39:11 2010 (r205429) @@ -577,6 +577,13 @@ db_write_bytes(vm_offset_t addr, size_t void db_show_mdpcpu(struct pcpu *pc) { + struct pcpu_md *md = &pc->pc_md; + + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 02:01:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D131065670; Mon, 22 Mar 2010 02:01:34 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0218FC15; Mon, 22 Mar 2010 02:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2M21YRq080702; Mon, 22 Mar 2010 02:01:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M21YVZ080700; Mon, 22 Mar 2010 02:01:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003220201.o2M21YVZ080700@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 02:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205431 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 02:01:34 -0000 Author: marcel Date: Mon Mar 22 02:01:33 2010 New Revision: 205431 URL: http://svn.freebsd.org/changeset/base/205431 Log: Define curthread as an inline function that loads the thread pointer directly from r13, the pcpu pointer. This guarantees correct behaviour when the thread migrates to a different CPU. Modified: head/sys/ia64/include/pcpu.h Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Mon Mar 22 00:11:31 2010 (r205430) +++ head/sys/ia64/include/pcpu.h Mon Mar 22 02:01:33 2010 (r205431) @@ -70,6 +70,16 @@ struct pcpu; register struct pcpu *pcpup __asm__("r13"); +static __inline struct thread * +__curthread(void) +{ + struct thread *td; + + __asm __volatile("ld8.acq %0=[r13]" : "=r"(td)); + return (td); +} +#define curthread (__curthread()) + #define PCPU_GET(member) (pcpup->pc_ ## member) /* From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 03:06:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049C0106566B; Mon, 22 Mar 2010 03:06:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87BE8FC14; Mon, 22 Mar 2010 03:06:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2M36Bhg095029; Mon, 22 Mar 2010 03:06:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M36B1h095027; Mon, 22 Mar 2010 03:06:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003220306.o2M36B1h095027@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 03:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205432 - head/sys/ia64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 03:06:12 -0000 Author: marcel Date: Mon Mar 22 03:06:11 2010 New Revision: 205432 URL: http://svn.freebsd.org/changeset/base/205432 Log: Disable interrupts when calling into SAL for PCI configuration cycles. This serves 2 purposes: 1. It prevents preemption and CPU migration while running SAL code. 2. It reduces the chance of stack overflows: we're supposed to enter SAL with at least 16KB of either memory- or register stack space, which we can't do without switching to a different stack. Modified: head/sys/ia64/pci/pci_cfgreg.c Modified: head/sys/ia64/pci/pci_cfgreg.c ============================================================================== --- head/sys/ia64/pci/pci_cfgreg.c Mon Mar 22 02:01:33 2010 (r205431) +++ head/sys/ia64/pci/pci_cfgreg.c Mon Mar 22 03:06:11 2010 (r205432) @@ -28,6 +28,7 @@ */ #include +#include #include #include @@ -66,6 +67,7 @@ uint32_t pci_cfgregread(int bus, int slot, int func, int reg, int len) { struct ia64_sal_result res; + register_t is; u_long addr; addr = pci_sal_address(0, bus, slot, func, reg); @@ -75,17 +77,18 @@ pci_cfgregread(int bus, int slot, int fu if (!pci_valid_access(reg, len)) return (~0); + is = intr_disable(); res = ia64_sal_entry(SAL_PCI_CONFIG_READ, addr, len, 0, 0, 0, 0, 0); - if (res.sal_status < 0) - return (~0); + intr_restore(is); - return (res.sal_result[0]); + return ((res.sal_status < 0) ? ~0 : res.sal_result[0]); } void pci_cfgregwrite(int bus, int slot, int func, int reg, uint32_t data, int len) { struct ia64_sal_result res; + register_t is; u_long addr; addr = pci_sal_address(0, bus, slot, func, reg); @@ -95,5 +98,7 @@ pci_cfgregwrite(int bus, int slot, int f if (!pci_valid_access(reg, len)) return; + is = intr_disable(); res = ia64_sal_entry(SAL_PCI_CONFIG_WRITE, addr, len, data, 0, 0, 0, 0); + intr_restore(is); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 03:55:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5BD31065677; Mon, 22 Mar 2010 03:55:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE0D18FC1E; Mon, 22 Mar 2010 03:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2M3tIhX006026; Mon, 22 Mar 2010 03:55:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M3tIQE006021; Mon, 22 Mar 2010 03:55:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003220355.o2M3tIQE006021@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 03:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205433 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 03:55:19 -0000 Author: marcel Date: Mon Mar 22 03:55:18 2010 New Revision: 205433 URL: http://svn.freebsd.org/changeset/base/205433 Log: Fix interrupt handling by extending the critical region so that preemption doesn't happen until after all pending interrupt have been services. While here again, simplify the EOI handling by doing it after we call the XIV-specific handlers, rather than in each of them. The original thought was that we may want to do an EOI first and the actual IPI handling next, but that's mostly a micro-optimization. Modified: head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/exception.S head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Mon Mar 22 03:06:11 2010 (r205432) +++ head/sys/ia64/ia64/clock.c Mon Mar 22 03:55:18 2010 (r205433) @@ -90,13 +90,9 @@ ia64_ih_clock(struct thread *td, u_int x int64_t delta; int count; - ia64_set_eoi(0); - PCPU_INC(md.stats.pcs_nclks); intrcnt[INTRCNT_CLOCK]++; - ia64_srlz_d(); - itc = ia64_get_itc(); adj = PCPU_GET(md.clockadj); @@ -120,6 +116,7 @@ ia64_ih_clock(struct thread *td, u_int x count++; } ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj); + ia64_srlz_d(); if (count > 0) { adjust_lost += count - 1; if (delta > (ia64_clock_reload >> 3)) { @@ -134,7 +131,6 @@ ia64_ih_clock(struct thread *td, u_int x } PCPU_SET(md.clock, clk); PCPU_SET(md.clockadj, adj); - ia64_srlz_d(); return (0); } @@ -150,7 +146,7 @@ pcpu_initclock(void) } /* - * Start the real-time and statistics clocks. We use cr.itc and cr.itm + * Start the real-time and statistics clocks. We use ar.itc and cr.itm * to implement a 1000hz clock. */ void Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Mon Mar 22 03:06:11 2010 (r205432) +++ head/sys/ia64/ia64/exception.S Mon Mar 22 03:55:18 2010 (r205433) @@ -1303,7 +1303,7 @@ IVT_END(Break_Instruction) IVT_ENTRY(External_Interrupt, 0x3000) { .mib - mov r17=cr.ivr // Put the XIV in the trapframe. + mov r17=ar.itc // Put the ITC in the trapframe. mov r16=ip br.sptk exception_save ;; Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Mon Mar 22 03:06:11 2010 (r205432) +++ head/sys/ia64/ia64/interrupt.c Mon Mar 22 03:55:18 2010 (r205433) @@ -288,30 +288,32 @@ void ia64_handle_intr(struct trapframe *tf) { struct thread *td; - u_int rfi, xiv; + u_int xiv; td = curthread; ia64_set_fpsr(IA64_FPSR_DEFAULT); PCPU_INC(cnt.v_intr); - xiv = tf->tf_special.ifa; + xiv = ia64_get_ivr(); + ia64_srlz_d(); if (xiv == 15) { PCPU_INC(md.stats.pcs_nstrays); goto out; } - while (xiv != 15) { - CTR1(KTR_INTR, "INTR: XIV=%u", xiv); - critical_enter(); - rfi = (ia64_handler[xiv])(td, xiv, tf); - if (rfi) { - critical_exit(); - return; - } + critical_enter(); + + do { + CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", + (u_int)tf->tf_special.ifa, xiv); + (ia64_handler[xiv])(td, xiv, tf); + ia64_set_eoi(0); + ia64_srlz_d(); xiv = ia64_get_ivr(); - critical_exit(); ia64_srlz_d(); - } + } while (xiv != 15); + + critical_exit(); out: if (TRAPF_USERMODE(tf)) { @@ -327,10 +329,8 @@ static u_int ia64_ih_invalid(struct thread *td, u_int xiv, struct trapframe *tf) { - ia64_set_eoi(0); - ia64_srlz_d(); panic("invalid XIV: %u", xiv); - return (1); + return (0); } static u_int @@ -354,8 +354,7 @@ ia64_ih_irq(struct thread *td, u_int xiv ia64_intr_mask((void *)(uintptr_t)xiv); log(LOG_ERR, "stray irq%u\n", i->irq); } - ia64_set_eoi(0); - ia64_srlz_d(); + return (0); } Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Mon Mar 22 03:06:11 2010 (r205432) +++ head/sys/ia64/ia64/mp_machdep.c Mon Mar 22 03:55:18 2010 (r205433) @@ -90,10 +90,8 @@ static u_int ia64_ih_ast(struct thread *td, u_int xiv, struct trapframe *tf) { - ia64_set_eoi(0); PCPU_INC(md.stats.pcs_nasts); CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); - ia64_srlz_d(); return (0); } @@ -101,10 +99,8 @@ static u_int ia64_ih_highfp(struct thread *td, u_int xiv, struct trapframe *tf) { - ia64_set_eoi(0); PCPU_INC(md.stats.pcs_nhighfps); ia64_highfp_save_ipi(); - ia64_srlz_d(); return (0); } @@ -112,11 +108,9 @@ static u_int ia64_ih_preempt(struct thread *td, u_int xiv, struct trapframe *tf) { - ia64_set_eoi(0); PCPU_INC(md.stats.pcs_npreempts); CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); sched_preempt(curthread); - ia64_srlz_d(); return (0); } @@ -124,11 +118,9 @@ static u_int ia64_ih_rndzvs(struct thread *td, u_int xiv, struct trapframe *tf) { - ia64_set_eoi(0); PCPU_INC(md.stats.pcs_nrdvs); CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); smp_rendezvous_action(); - ia64_srlz_d(); return (0); } @@ -137,10 +129,8 @@ ia64_ih_stop(struct thread *td, u_int xi { cpumask_t mybit; - ia64_set_eoi(0); PCPU_INC(md.stats.pcs_nstops); mybit = PCPU_GET(cpumask); - ia64_srlz_d(); savectx(PCPU_PTR(md.pcb)); From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 04:01:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84002106566C; Mon, 22 Mar 2010 04:01:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73DF78FC12; Mon, 22 Mar 2010 04:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2M41jdn007486; Mon, 22 Mar 2010 04:01:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M41jYG007484; Mon, 22 Mar 2010 04:01:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003220401.o2M41jYG007484@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 04:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205434 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 04:01:45 -0000 Author: marcel Date: Mon Mar 22 04:01:45 2010 New Revision: 205434 URL: http://svn.freebsd.org/changeset/base/205434 Log: With preemption, the high FP registers may get enabled by cpu_switch() before we grab the mutex. Don't assert that they must be disabled at that point. We pretty much bypass all logic in that case anyway and leave immediately, so there's no harm. Modified: head/sys/ia64/ia64/highfp.c Modified: head/sys/ia64/ia64/highfp.c ============================================================================== --- head/sys/ia64/ia64/highfp.c Mon Mar 22 03:55:18 2010 (r205433) +++ head/sys/ia64/ia64/highfp.c Mon Mar 22 04:01:45 2010 (r205434) @@ -92,8 +92,6 @@ ia64_highfp_enable(struct thread *td, st pcb = td->td_pcb; mtx_lock_spin(&ia64_highfp_mtx); - KASSERT((tf->tf_special.psr & IA64_PSR_DFH) != 0, - ("(tf->tf_special.psr & IA64_PSR_DFH) == 0")); cpu = pcb->pcb_fpcpu; #ifdef SMP if (cpu != NULL && cpu != pcpup) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 04:24:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCECE1065670; Mon, 22 Mar 2010 04:24:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0908FC0C; Mon, 22 Mar 2010 04:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2M4OJo2012404; Mon, 22 Mar 2010 04:24:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M4OJxV012402; Mon, 22 Mar 2010 04:24:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003220424.o2M4OJxV012402@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 04:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205435 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 04:24:19 -0000 Author: marcel Date: Mon Mar 22 04:24:19 2010 New Revision: 205435 URL: http://svn.freebsd.org/changeset/base/205435 Log: Drop the pmap argument to pmap_invalidate_page(). It's not used other than in a KASSERT. The KASSERT is broken in that it's done outside the critical section and as such isn't protected against CPU migration. Improve pmap_invalidate_page() as follows: o calculate vhpt_ofs inside the critical region for exactly the same reason. o calculate the tag outside the FOREACH loop, as it's loop-invariant. This is more efficient. o Replace the test and set with an atomic cmpset operation because we are changing other CPU's VHPT tables and this avoids invalidating after the entry got modified. Not necessarily a problem, but better safe than sorry. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Mar 22 04:01:45 2010 (r205434) +++ head/sys/ia64/ia64/pmap.c Mon Mar 22 04:24:19 2010 (r205435) @@ -536,21 +536,19 @@ pmap_init(void) ***************************************************/ static void -pmap_invalidate_page(pmap_t pmap, vm_offset_t va) +pmap_invalidate_page(vm_offset_t va) { struct ia64_lpte *pte; struct pcpu *pc; + uint64_t tag; u_int vhpt_ofs; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("invalidating TLB for non-current pmap")); - - vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt); critical_enter(); + vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt); + tag = ia64_ttag(va); SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { pte = (struct ia64_lpte *)(pc->pc_md.vhpt + vhpt_ofs); - if (pte->tag == ia64_ttag(va)) - pte->tag = 1UL << 63; + atomic_cmpset_64(&pte->tag, tag, 1UL << 63); } critical_exit(); mtx_lock_spin(&pmap_ptcmutex); @@ -794,7 +792,7 @@ retry: pte = pmap_find_vhpt(va); KASSERT(pte != NULL, ("pte")); pmap_remove_vhpt(va); - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(va); pmap_switch(oldpmap); if (pmap_accessed(pte)) vm_page_flag_set(m, PG_REFERENCED); @@ -1170,7 +1168,7 @@ pmap_remove_pte(pmap_t pmap, struct ia64 if (error) return (error); - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(va); if (pmap_wired(pte)) pmap->pm_stats.wired_count -= 1; @@ -1238,7 +1236,7 @@ pmap_qenter(vm_offset_t va, vm_page_t *m for (i = 0; i < count; i++) { pte = pmap_find_kpte(va); if (pmap_present(pte)) - pmap_invalidate_page(kernel_pmap, va); + pmap_invalidate_page(va); else pmap_enter_vhpt(pte, va); pmap_pte_prot(kernel_pmap, pte, VM_PROT_ALL); @@ -1261,7 +1259,7 @@ pmap_qremove(vm_offset_t va, int count) pte = pmap_find_kpte(va); if (pmap_present(pte)) { pmap_remove_vhpt(va); - pmap_invalidate_page(kernel_pmap, va); + pmap_invalidate_page(va); pmap_clear_present(pte); } va += PAGE_SIZE; @@ -1279,7 +1277,7 @@ pmap_kenter(vm_offset_t va, vm_offset_t pte = pmap_find_kpte(va); if (pmap_present(pte)) - pmap_invalidate_page(kernel_pmap, va); + pmap_invalidate_page(va); else pmap_enter_vhpt(pte, va); pmap_pte_prot(kernel_pmap, pte, VM_PROT_ALL); @@ -1297,7 +1295,7 @@ pmap_kremove(vm_offset_t va) pte = pmap_find_kpte(va); if (pmap_present(pte)) { pmap_remove_vhpt(va); - pmap_invalidate_page(kernel_pmap, va); + pmap_invalidate_page(va); pmap_clear_present(pte); } } @@ -1491,7 +1489,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv ia64_sync_icache(sva, PAGE_SIZE); pmap_pte_prot(pmap, pte, prot); - pmap_invalidate_page(pmap, sva); + pmap_invalidate_page(sva); } vm_page_unlock_queues(); pmap_switch(oldpmap); @@ -1582,7 +1580,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, else if (pmap_exec(&origpte)) icache_inval = FALSE; - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(va); goto validate; } @@ -1984,7 +1982,7 @@ pmap_ts_referenced(vm_page_t m) if (pmap_accessed(pte)) { count++; pmap_clear_accessed(pte); - pmap_invalidate_page(pv->pv_pmap, pv->pv_va); + pmap_invalidate_page(pv->pv_va); } pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); @@ -2063,7 +2061,7 @@ pmap_clear_modify(vm_page_t m) KASSERT(pte != NULL, ("pte")); if (pmap_dirty(pte)) { pmap_clear_dirty(pte); - pmap_invalidate_page(pv->pv_pmap, pv->pv_va); + pmap_invalidate_page(pv->pv_va); } pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); @@ -2092,7 +2090,7 @@ pmap_clear_reference(vm_page_t m) KASSERT(pte != NULL, ("pte")); if (pmap_accessed(pte)) { pmap_clear_accessed(pte); - pmap_invalidate_page(pv->pv_pmap, pv->pv_va); + pmap_invalidate_page(pv->pv_va); } pmap_switch(oldpmap); PMAP_UNLOCK(pv->pv_pmap); @@ -2128,7 +2126,7 @@ pmap_remove_write(vm_page_t m) } prot &= ~VM_PROT_WRITE; pmap_pte_prot(pmap, pte, prot); - pmap_invalidate_page(pmap, pv->pv_va); + pmap_invalidate_page(pv->pv_va); } pmap_switch(oldpmap); PMAP_UNLOCK(pmap); From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 11:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9391F1065673; Mon, 22 Mar 2010 11:00:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D338FC08; Mon, 22 Mar 2010 11:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MB0vi5001167; Mon, 22 Mar 2010 11:00:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MB0vjM001165; Mon, 22 Mar 2010 11:00:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201003221100.o2MB0vjM001165@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 22 Mar 2010 11:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205441 - head/contrib/openpam/include/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 11:00:57 -0000 Author: des Date: Mon Mar 22 11:00:57 2010 New Revision: 205441 URL: http://svn.freebsd.org/changeset/base/205441 Log: Merge upstream r432: pam_end() already contains a NULL check, and it is not unreasonable to call it with a NULL pamh in a cleanup / error-handling situation. Remove OPENPAM_NONNULL, which may cause gcc to optimize away the NULL check. This fixes a potential NULL pointer dereference in error-handling code in passwd(1). Modified: head/contrib/openpam/include/security/pam_appl.h Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/include/security/pam_appl.h ============================================================================== --- head/contrib/openpam/include/security/pam_appl.h Mon Mar 22 10:58:16 2010 (r205440) +++ head/contrib/openpam/include/security/pam_appl.h Mon Mar 22 11:00:57 2010 (r205441) @@ -72,8 +72,7 @@ pam_close_session(pam_handle_t *_pamh, int pam_end(pam_handle_t *_pamh, - int _status) - OPENPAM_NONNULL((1)); + int _status); int pam_get_data(const pam_handle_t *_pamh, From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 11:32:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A58106566C; Mon, 22 Mar 2010 11:32:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF1F8FC08; Mon, 22 Mar 2010 11:32:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MBWJCU008185; Mon, 22 Mar 2010 11:32:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MBWJG3008183; Mon, 22 Mar 2010 11:32:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201003221132.o2MBWJG3008183@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 22 Mar 2010 11:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205443 - head/contrib/openpam/include/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 11:32:19 -0000 Author: des Date: Mon Mar 22 11:32:19 2010 New Revision: 205443 URL: http://svn.freebsd.org/changeset/base/205443 Log: Forced commit to register MFC reminder. MFC after: 2 weeks Modified: head/contrib/openpam/include/security/pam_appl.h Modified: head/contrib/openpam/include/security/pam_appl.h ============================================================================== From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 11:52:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CF841065677; Mon, 22 Mar 2010 11:52:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DAB68FC14; Mon, 22 Mar 2010 11:52:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MBqswE012771; Mon, 22 Mar 2010 11:52:54 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MBqs9M012769; Mon, 22 Mar 2010 11:52:54 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003221152.o2MBqs9M012769@svn.freebsd.org> From: Ed Maste Date: Mon, 22 Mar 2010 11:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205444 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 11:52:54 -0000 Author: emaste Date: Mon Mar 22 11:52:53 2010 New Revision: 205444 URL: http://svn.freebsd.org/changeset/base/205444 Log: Merge r197455 from amd64: Add a backtrace to the "fpudna in kernel mode!" case, to help track down where this comes from. Reviewed by: bde Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Mar 22 11:32:19 2010 (r205443) +++ head/sys/i386/i386/trap.c Mon Mar 22 11:52:53 2010 (r205444) @@ -540,6 +540,10 @@ trap(struct trapframe *frame) * XXX this should be fatal unless the kernel has * registered such use. */ + printf("npxdna in kernel mode!\n"); +#ifdef KDB + kdb_backtrace(); +#endif if (npxdna()) goto out; #endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 14:09:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD7E2106564A; Mon, 22 Mar 2010 14:09:07 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE [128.176.192.19]) by mx1.freebsd.org (Postfix) with ESMTP id D9F2A8FC16; Mon, 22 Mar 2010 14:09:06 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.51,287,1267398000"; d="scan'208";a="29041819" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 22 Mar 2010 15:09:05 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 949BC1B0768; Mon, 22 Mar 2010 15:09:05 +0100 (CET) Date: Mon, 22 Mar 2010 15:09:04 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Edwin Groothuis Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r205427 - in head: tools/regression/usr.bin/ncal usr.bin/ncal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 14:09:07 -0000 thanks. :) a small correction to the commit message: "Replace -b with -C and -N (as proposed by Alexander)." ;) -- Alexander Best From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 14:51:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4580C106564A; Mon, 22 Mar 2010 14:51:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D4CEB8FC15; Mon, 22 Mar 2010 14:51:04 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8821046B45; Mon, 22 Mar 2010 10:51:04 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 9DFC98A026; Mon, 22 Mar 2010 10:51:03 -0400 (EDT) From: John Baldwin To: Ed Maste Date: Mon, 22 Mar 2010 08:49:36 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201003221152.o2MBqs9M012769@svn.freebsd.org> In-Reply-To: <201003221152.o2MBqs9M012769@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003220849.36246.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 22 Mar 2010 10:51:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205444 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 14:51:05 -0000 On Monday 22 March 2010 7:52:54 am Ed Maste wrote: > Author: emaste > Date: Mon Mar 22 11:52:53 2010 > New Revision: 205444 > URL: http://svn.freebsd.org/changeset/base/205444 > > Log: > Merge r197455 from amd64: > > Add a backtrace to the "fpudna in kernel mode!" case, to help track down > where this comes from. > > Reviewed by: bde Should we make this a panic instead perhaps? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 15:08:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03A3F1065678; Mon, 22 Mar 2010 15:08:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5A6D8FC17; Mon, 22 Mar 2010 15:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MF8QdK056438; Mon, 22 Mar 2010 15:08:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MF8QeX056435; Mon, 22 Mar 2010 15:08:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003221508.o2MF8QeX056435@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Mar 2010 15:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205448 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 15:08:27 -0000 Author: jhb Date: Mon Mar 22 15:08:26 2010 New Revision: 205448 URL: http://svn.freebsd.org/changeset/base/205448 Log: Remove unneeded type specifiers from 64-bit constants. The compiler infers their natural type from the constants' values. Submitted by: bde MFC after: 3 days Modified: head/sys/amd64/include/specialreg.h head/sys/i386/include/specialreg.h Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon Mar 22 14:50:08 2010 (r205447) +++ head/sys/amd64/include/specialreg.h Mon Mar 22 15:08:26 2010 (r205448) @@ -321,16 +321,16 @@ #define MTRR_N64K 8 /* numbers of fixed-size entries */ #define MTRR_N16K 16 #define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400UL -#define MTRR_CAP_FIXED 0x0000000000000100UL -#define MTRR_CAP_VCNT 0x00000000000000ffUL -#define MTRR_DEF_ENABLE 0x0000000000000800UL -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400UL -#define MTRR_DEF_TYPE 0x00000000000000ffUL -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000UL -#define MTRR_PHYSBASE_TYPE 0x00000000000000ffUL -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000UL -#define MTRR_PHYSMASK_VALID 0x0000000000000800UL +#define MTRR_CAP_WC 0x0000000000000400 +#define MTRR_CAP_FIXED 0x0000000000000100 +#define MTRR_CAP_VCNT 0x00000000000000ff +#define MTRR_DEF_ENABLE 0x0000000000000800 +#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 +#define MTRR_DEF_TYPE 0x00000000000000ff +#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 +#define MTRR_PHYSBASE_TYPE 0x00000000000000ff +#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 +#define MTRR_PHYSMASK_VALID 0x0000000000000800 /* Performance Control Register (5x86 only). */ #define PCR0 0x20 @@ -360,31 +360,31 @@ #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 -#define MCG_CTL_ENABLE 0xffffffffffffffffUL -#define MCG_CTL_DISABLE 0x0000000000000000UL +#define MCG_CTL_ENABLE 0xffffffffffffffff +#define MCG_CTL_DISABLE 0x0000000000000000 #define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4) #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) #define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_MCA_ERROR 0x000000000000ffffUL -#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000UL -#define MC_STATUS_OTHER_INFO 0x01ffffff00000000UL -#define MC_STATUS_COR_COUNT 0x001fffc000000000UL /* If MCG_CAP_TES_P */ -#define MC_STATUS_TES_STATUS 0x0060000000000000UL /* If MCG_CAP_TES_P */ -#define MC_STATUS_AR 0x0080000000000000UL /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_S 0x0100000000000000UL /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_PCC 0x0200000000000000UL -#define MC_STATUS_ADDRV 0x0400000000000000UL -#define MC_STATUS_MISCV 0x0800000000000000UL -#define MC_STATUS_EN 0x1000000000000000UL -#define MC_STATUS_UC 0x2000000000000000UL -#define MC_STATUS_OVER 0x4000000000000000UL -#define MC_STATUS_VAL 0x8000000000000000UL -#define MC_MISC_RA_LSB 0x000000000000003fUL /* If MCG_CAP_SER_P */ -#define MC_MISC_ADDRESS_MODE 0x00000000000001c0UL /* If MCG_CAP_SER_P */ -#define MC_CTL2_THRESHOLD 0x0000000000003fffUL -#define MC_CTL2_CMCI_EN 0x0000000040000000UL +#define MC_STATUS_MCA_ERROR 0x000000000000ffff +#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 +#define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_PCC 0x0200000000000000 +#define MC_STATUS_ADDRV 0x0400000000000000 +#define MC_STATUS_MISCV 0x0800000000000000 +#define MC_STATUS_EN 0x1000000000000000 +#define MC_STATUS_UC 0x2000000000000000 +#define MC_STATUS_OVER 0x4000000000000000 +#define MC_STATUS_VAL 0x8000000000000000 +#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ +#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ +#define MC_CTL2_THRESHOLD 0x0000000000003fff +#define MC_CTL2_CMCI_EN 0x0000000040000000 /* * The following four 3-byte registers control the non-cacheable regions. Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Mon Mar 22 14:50:08 2010 (r205447) +++ head/sys/i386/include/specialreg.h Mon Mar 22 15:08:26 2010 (r205448) @@ -327,16 +327,16 @@ #define MTRR_N64K 8 /* numbers of fixed-size entries */ #define MTRR_N16K 16 #define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400ULL -#define MTRR_CAP_FIXED 0x0000000000000100ULL -#define MTRR_CAP_VCNT 0x00000000000000ffULL -#define MTRR_DEF_ENABLE 0x0000000000000800ULL -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400ULL -#define MTRR_DEF_TYPE 0x00000000000000ffULL -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000ULL -#define MTRR_PHYSBASE_TYPE 0x00000000000000ffULL -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000ULL -#define MTRR_PHYSMASK_VALID 0x0000000000000800ULL +#define MTRR_CAP_WC 0x0000000000000400 +#define MTRR_CAP_FIXED 0x0000000000000100 +#define MTRR_CAP_VCNT 0x00000000000000ff +#define MTRR_DEF_ENABLE 0x0000000000000800 +#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 +#define MTRR_DEF_TYPE 0x00000000000000ff +#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 +#define MTRR_PHYSBASE_TYPE 0x00000000000000ff +#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 +#define MTRR_PHYSMASK_VALID 0x0000000000000800 /* * Cyrix configuration registers, accessible as IO ports. @@ -429,31 +429,31 @@ #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 -#define MCG_CTL_ENABLE 0xffffffffffffffffULL -#define MCG_CTL_DISABLE 0x0000000000000000ULL +#define MCG_CTL_ENABLE 0xffffffffffffffff +#define MCG_CTL_DISABLE 0x0000000000000000 #define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4) #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) #define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_MCA_ERROR 0x000000000000ffffULL -#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000ULL -#define MC_STATUS_OTHER_INFO 0x01ffffff00000000ULL -#define MC_STATUS_COR_COUNT 0x001fffc000000000ULL /* If MCG_CAP_TES_P */ -#define MC_STATUS_TES_STATUS 0x0060000000000000ULL /* If MCG_CAP_TES_P */ -#define MC_STATUS_AR 0x0080000000000000ULL /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_S 0x0100000000000000ULL /* If MCG_CAP_CMCI_P */ -#define MC_STATUS_PCC 0x0200000000000000ULL -#define MC_STATUS_ADDRV 0x0400000000000000ULL -#define MC_STATUS_MISCV 0x0800000000000000ULL -#define MC_STATUS_EN 0x1000000000000000ULL -#define MC_STATUS_UC 0x2000000000000000ULL -#define MC_STATUS_OVER 0x4000000000000000ULL -#define MC_STATUS_VAL 0x8000000000000000ULL -#define MC_MISC_RA_LSB 0x000000000000003fULL /* If MCG_CAP_SER_P */ -#define MC_MISC_ADDRESS_MODE 0x00000000000001c0ULL /* If MCG_CAP_SER_P */ -#define MC_CTL2_THRESHOLD 0x0000000000003fffULL -#define MC_CTL2_CMCI_EN 0x0000000040000000ULL +#define MC_STATUS_MCA_ERROR 0x000000000000ffff +#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 +#define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_PCC 0x0200000000000000 +#define MC_STATUS_ADDRV 0x0400000000000000 +#define MC_STATUS_MISCV 0x0800000000000000 +#define MC_STATUS_EN 0x1000000000000000 +#define MC_STATUS_UC 0x2000000000000000 +#define MC_STATUS_OVER 0x4000000000000000 +#define MC_STATUS_VAL 0x8000000000000000 +#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ +#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ +#define MC_CTL2_THRESHOLD 0x0000000000003fff +#define MC_CTL2_CMCI_EN 0x0000000040000000 /* * The following four 3-byte registers control the non-cacheable regions. From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 15:23:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84FA0106566C; Mon, 22 Mar 2010 15:23:35 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 45B058FC1E; Mon, 22 Mar 2010 15:23:34 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Mar 2010 11:23:31 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 5AC9B1164E; Mon, 22 Mar 2010 11:23:34 -0400 (EDT) Date: Mon, 22 Mar 2010 11:23:34 -0400 From: Ed Maste To: John Baldwin Message-ID: <20100322152334.GA24534@sandvine.com> References: <201003221152.o2MBqs9M012769@svn.freebsd.org> <201003220849.36246.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201003220849.36246.jhb@freebsd.org> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 22 Mar 2010 15:23:31.0950 (UTC) FILETIME=[A19290E0:01CAC9D3] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Maste Subject: Re: svn commit: r205444 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 15:23:35 -0000 On Mon, Mar 22, 2010 at 08:49:36AM -0400, John Baldwin wrote: > On Monday 22 March 2010 7:52:54 am Ed Maste wrote: > > Author: emaste > > Date: Mon Mar 22 11:52:53 2010 > > New Revision: 205444 > > URL: http://svn.freebsd.org/changeset/base/205444 > > > > Log: > > Merge r197455 from amd64: > > > > Add a backtrace to the "fpudna in kernel mode!" case, to help track down > > where this comes from. > > > > Reviewed by: bde > > Should we make this a panic instead perhaps? I was just about to follow up with a comment to that effect. We do want it to become a panic, but I would prefer to hold off until we address the known issue with padlock(4). http://www.freebsd.org/cgi/query-pr.cgi?pr=amd64/135014 Bruce Evans' comment in that PR is: > The printf should always have been a panic, but changing to a panic > now would be too drastic. -Ed From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 16:02:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8195A106566B; Mon, 22 Mar 2010 16:02:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 529418FC21; Mon, 22 Mar 2010 16:02:43 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EAFCF46B2C; Mon, 22 Mar 2010 12:02:42 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 3AA398A01F; Mon, 22 Mar 2010 12:02:42 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 22 Mar 2010 11:10:54 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201003221508.o2MF8QeX056435@svn.freebsd.org> In-Reply-To: <201003221508.o2MF8QeX056435@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003221110.54807.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 22 Mar 2010 12:02:42 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r205448 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 16:02:43 -0000 On Monday 22 March 2010 11:08:26 am John Baldwin wrote: > Author: jhb > Date: Mon Mar 22 15:08:26 2010 > New Revision: 205448 > URL: http://svn.freebsd.org/changeset/base/205448 > > Log: > Remove unneeded type specifiers from 64-bit constants. The compiler > infers their natural type from the constants' values. > > Submitted by: bde > MFC after: 3 days Verified that *_mem.o did not change MD5 sums (MTRR-related constants). mca.o did change MD5 sum on both architectures, but it was a harmless change. A 'shr' instruction became a 'sar' instruction. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 17:30:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 300FB106566C; Mon, 22 Mar 2010 17:30:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D8538FC15; Mon, 22 Mar 2010 17:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MHUYXI090210; Mon, 22 Mar 2010 17:30:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MHUY1g090209; Mon, 22 Mar 2010 17:30:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003221730.o2MHUY1g090209@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 22 Mar 2010 17:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205452 - head/sys/compat/x86bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 17:30:35 -0000 Author: jkim Date: Mon Mar 22 17:30:34 2010 New Revision: 205452 URL: http://svn.freebsd.org/changeset/base/205452 Log: Fix i386 PAE kernel build. Reported by: tinderbox Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Mar 22 16:40:10 2010 (r205451) +++ head/sys/compat/x86bios/x86bios.c Mon Mar 22 17:30:34 2010 (r205452) @@ -555,7 +555,7 @@ x86bios_map_mem(void) printf("x86bios: ROM 0x%06x-0x%06x at %p\n", X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1, (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE - - x86bios_rom_phys)); + (vm_offset_t)x86bios_rom_phys)); printf("x86bios: HIMEM 0x%06x-0x%06x at %p\n", X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE, X86BIOS_MEM_SIZE - 1, (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE - From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 18:24:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88AFD106564A; Mon, 22 Mar 2010 18:24:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B96B8FC16; Mon, 22 Mar 2010 18:24:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MIOhWf003186; Mon, 22 Mar 2010 18:24:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MIOh2q003185; Mon, 22 Mar 2010 18:24:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003221824.o2MIOh2q003185@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 22 Mar 2010 18:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205454 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 18:24:43 -0000 Author: marcel Date: Mon Mar 22 18:24:42 2010 New Revision: 205454 URL: http://svn.freebsd.org/changeset/base/205454 Log: o Remove the pmap argument to pmap_invalidate_all() as it's not used other than in a potentially dangerous KASSERT. o Hand-inline pmap_remove_page() as it's only called from 1 place and the abstraction that pmap_remove_page() provides is not enough to warrant the obfuscation. Eliminate the dangerous KASSERT in the process. o In pmap_remove_pte(), remove the KASSERT for pmap being the current one as it's not safe in the face of CPU migration. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Mar 22 17:57:00 2010 (r205453) +++ head/sys/ia64/ia64/pmap.c Mon Mar 22 18:24:42 2010 (r205454) @@ -238,7 +238,7 @@ static pv_entry_t get_pv_entry(pmap_t lo static void pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot); static void pmap_free_pte(struct ia64_lpte *pte, vm_offset_t va); -static void pmap_invalidate_all(pmap_t pmap); +static void pmap_invalidate_all(void); static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va, pv_entry_t pv, int freepte); static int pmap_remove_vhpt(vm_offset_t va); @@ -475,7 +475,7 @@ pmap_bootstrap() /* * Clear out any random TLB entries left over from booting. */ - pmap_invalidate_all(kernel_pmap); + pmap_invalidate_all(); map_gateway_page(); } @@ -575,16 +575,14 @@ pmap_invalidate_all_1(void *arg) } static void -pmap_invalidate_all(pmap_t pmap) +pmap_invalidate_all(void) { - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("invalidating TLB for non-current pmap")); - #ifdef SMP - if (mp_ncpus > 1) + if (mp_ncpus > 1) { smp_rendezvous(NULL, pmap_invalidate_all_1, NULL, NULL); - else + return; + } #endif pmap_invalidate_all_1(NULL); } @@ -1158,9 +1156,6 @@ pmap_remove_pte(pmap_t pmap, struct ia64 int error; vm_page_t m; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("removing pte for non-current pmap")); - /* * First remove from the VHPT. */ @@ -1319,23 +1314,6 @@ pmap_map(vm_offset_t *virt, vm_offset_t } /* - * Remove a single page from a process address space - */ -static void -pmap_remove_page(pmap_t pmap, vm_offset_t va) -{ - struct ia64_lpte *pte; - - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), - ("removing page for non-current pmap")); - - pte = pmap_find_vhpt(va); - if (pte != NULL) - pmap_remove_pte(pmap, pte, va, 0, 1); - return; -} - -/* * Remove the given range of addresses from the specified map. * * It is assumed that the start and end are properly @@ -1362,7 +1340,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * code. */ if (sva + PAGE_SIZE == eva) { - pmap_remove_page(pmap, sva); + pte = pmap_find_vhpt(sva); + if (pte != NULL) + pmap_remove_pte(pmap, pte, sva, 0, 1); goto out; } @@ -1927,7 +1907,8 @@ pmap_remove_pages(pmap_t pmap) pv_entry_t pv, npv; if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: pmap_remove_pages called with non-current pmap\n"); + printf("warning: %s called with non-current pmap\n", + __func__); return; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 18:43:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27F1A1065670; Mon, 22 Mar 2010 18:43:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0A138FC12; Mon, 22 Mar 2010 18:43:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MIha8j007389; Mon, 22 Mar 2010 18:43:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MIhaUY007387; Mon, 22 Mar 2010 18:43:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003221843.o2MIhaUY007387@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 22 Mar 2010 18:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205455 - head/sys/compat/x86bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 18:43:37 -0000 Author: jkim Date: Mon Mar 22 18:43:36 2010 New Revision: 205455 URL: http://svn.freebsd.org/changeset/base/205455 Log: Support memory wraparound instead of high memory as VM86 mode does. Suggested by: delphij Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Mar 22 18:24:42 2010 (r205454) +++ head/sys/compat/x86bios/x86bios.c Mon Mar 22 18:43:36 2010 (r205455) @@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ #define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ -#define X86BIOS_MEM_SIZE (0x00100000 + X86BIOS_SEG_SIZE) - /* 1M + 64K (high memory) */ +#define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ #define X86BIOS_IVT_BASE 0x00000000 #define X86BIOS_RAM_BASE 0x00001000 @@ -115,9 +114,11 @@ x86bios_get_pages(uint32_t offset, size_ { int i; - if (offset + size > X86BIOS_MEM_SIZE) + if (offset + size > X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE) return (NULL); + if (offset >= X86BIOS_MEM_SIZE) + offset -= X86BIOS_MEM_SIZE; i = offset / X86BIOS_PAGE_SIZE; if (x86bios_map[i] != 0) return ((void *)(x86bios_map[i] + offset - @@ -526,13 +527,6 @@ x86bios_map_mem(void) return (1); } #endif - /* Change attribute for high memory. */ - if (pmap_change_attr((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE - - X86BIOS_SEG_SIZE, X86BIOS_SEG_SIZE, PAT_WRITE_BACK) != 0) { - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); - pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); - return (1); - } x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0); @@ -556,10 +550,6 @@ x86bios_map_mem(void) X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1, (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE - (vm_offset_t)x86bios_rom_phys)); - printf("x86bios: HIMEM 0x%06x-0x%06x at %p\n", - X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE, X86BIOS_MEM_SIZE - 1, - (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE - - X86BIOS_SEG_SIZE)); } return (0); From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 21:11:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23075106566B; Mon, 22 Mar 2010 21:11:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 107428FC14; Mon, 22 Mar 2010 21:11:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MLBtS2041283; Mon, 22 Mar 2010 21:11:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MLBtua041275; Mon, 22 Mar 2010 21:11:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003222111.o2MLBtua041275@svn.freebsd.org> From: Xin LI Date: Mon, 22 Mar 2010 21:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205471 - in head: . lib/libz lib/libz/contrib lib/libz/doc sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 21:11:56 -0000 Author: delphij Date: Mon Mar 22 21:11:55 2010 New Revision: 205471 URL: http://svn.freebsd.org/changeset/base/205471 Log: Update to zlib 1.2.4 and add versioned symbols to the library. Sponsored by: iXsystems, Inc. Added: head/lib/libz/Symbol.map - copied unchanged from r205470, user/delphij/libz/Symbol.map head/lib/libz/Versions.def - copied unchanged from r205470, user/delphij/libz/Versions.def head/lib/libz/contrib/ - copied from r205470, user/delphij/libz/contrib/ head/lib/libz/doc/ - copied from r205470, user/delphij/libz/doc/ head/lib/libz/gzclose.c - copied unchanged from r205470, user/delphij/libz/gzclose.c head/lib/libz/gzguts.h - copied unchanged from r205470, user/delphij/libz/gzguts.h head/lib/libz/gzlib.c - copied unchanged from r205470, user/delphij/libz/gzlib.c head/lib/libz/gzread.c - copied unchanged from r205470, user/delphij/libz/gzread.c head/lib/libz/gzwrite.c - copied unchanged from r205470, user/delphij/libz/gzwrite.c Deleted: head/lib/libz/algorithm.txt head/lib/libz/gzio.c Modified: head/ObsoleteFiles.inc head/lib/libz/ChangeLog head/lib/libz/FAQ head/lib/libz/Makefile head/lib/libz/README head/lib/libz/adler32.c head/lib/libz/compress.c head/lib/libz/crc32.c head/lib/libz/deflate.c head/lib/libz/deflate.h head/lib/libz/example.c head/lib/libz/infback.c head/lib/libz/inffast.c head/lib/libz/inflate.c head/lib/libz/inflate.h head/lib/libz/inftrees.c head/lib/libz/inftrees.h head/lib/libz/minigzip.c (contents, props changed) head/lib/libz/trees.c head/lib/libz/uncompr.c head/lib/libz/zconf.h head/lib/libz/zlib.3 head/lib/libz/zlib.h head/lib/libz/zutil.c head/lib/libz/zutil.h head/sys/sys/param.h Directory Properties: head/lib/libz/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Mar 22 20:52:52 2010 (r205470) +++ head/ObsoleteFiles.inc Mon Mar 22 21:11:55 2010 (r205471) @@ -14,6 +14,11 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100322: libz update +OLD_LIBS+=lib/libz.so.5 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libz.so.5 +.endif # 20100314: removal of regexp.h OLD_FILES+=usr/include/regexp.h OLD_FILES+=usr/share/man/man3/regexp.3.gz Modified: head/lib/libz/ChangeLog ============================================================================== --- head/lib/libz/ChangeLog Mon Mar 22 20:52:52 2010 (r205470) +++ head/lib/libz/ChangeLog Mon Mar 22 21:11:55 2010 (r205471) @@ -1,6 +1,281 @@ ChangeLog file for zlib +Changes in 1.2.4 (14 Mar 2010) +- Fix VER3 extraction in configure for no fourth subversion +- Update zlib.3, add docs to Makefile.in to make .pdf out of it +- Add zlib.3.pdf to distribution +- Don't set error code in gzerror() if passed pointer is NULL +- Apply destination directory fixes to CMakeLists.txt [Lowman] +- Move #cmakedefine's to a new zconf.in.cmakein +- Restore zconf.h for builds that don't use configure or cmake +- Add distclean to dummy Makefile for convenience +- Update and improve INDEX, README, and FAQ +- Update CMakeLists.txt for the return of zconf.h [Lowman] +- Update contrib/vstudio/vc9 and vc10 [Vollant] +- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc +- Apply license and readme changes to contrib/asm686 [Raiter] +- Check file name lengths and add -c option in minigzip.c [Li] +- Update contrib/amd64 and contrib/masmx86/ [Vollant] +- Avoid use of "eof" parameter in trees.c to not shadow library variable +- Update make_vms.com for removal of zlibdefs.h [Zinser] +- Update assembler code and vstudio projects in contrib [Vollant] +- Remove outdated assembler code contrib/masm686 and contrib/asm586 +- Remove old vc7 and vc8 from contrib/vstudio +- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe] +- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open() +- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant] +- Remove *64 functions from win32/zlib.def (they're not 64-bit yet) +- Fix bug in void-returning vsprintf() case in gzwrite.c +- Fix name change from inflate.h in contrib/inflate86/inffas86.c +- Check if temporary file exists before removing in make_vms.com [Zinser] +- Fix make install and uninstall for --static option +- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta] +- Update readme.txt in contrib/masmx64 and masmx86 to assemble + +Changes in 1.2.3.9 (21 Feb 2010) +- Expunge gzio.c +- Move as400 build information to old +- Fix updates in contrib/minizip and contrib/vstudio +- Add const to vsnprintf test in configure to avoid warnings [Weigelt] +- Delete zconf.h (made by configure) [Weigelt] +- Change zconf.in.h to zconf.h.in per convention [Weigelt] +- Check for NULL buf in gzgets() +- Return empty string for gzgets() with len == 1 (like fgets()) +- Fix description of gzgets() in zlib.h for end-of-file, NULL return +- Update minizip to 1.1 [Vollant] +- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c +- Note in zlib.h that gzerror() should be used to distinguish from EOF +- Remove use of snprintf() from gzlib.c +- Fix bug in gzseek() +- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant] +- Fix zconf.h generation in CMakeLists.txt [Lowman] +- Improve comments in zconf.h where modified by configure + +Changes in 1.2.3.8 (13 Feb 2010) +- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer] +- Use z_off64_t in gz_zero() and gz_skip() to match state->skip +- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t) +- Revert to Makefile.in from 1.2.3.6 (live with the clutter) +- Fix missing error return in gzflush(), add zlib.h note +- Add *64 functions to zlib.map [Levin] +- Fix signed/unsigned comparison in gz_comp() +- Use SFLAGS when testing shared linking in configure +- Add --64 option to ./configure to use -m64 with gcc +- Fix ./configure --help to correctly name options +- Have make fail if a test fails [Levin] +- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson] +- Remove assembler object files from contrib + +Changes in 1.2.3.7 (24 Jan 2010) +- Always gzopen() with O_LARGEFILE if available +- Fix gzdirect() to work immediately after gzopen() or gzdopen() +- Make gzdirect() more precise when the state changes while reading +- Improve zlib.h documentation in many places +- Catch memory allocation failure in gz_open() +- Complete close operation if seek forward in gzclose_w() fails +- Return Z_ERRNO from gzclose_r() if close() fails +- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL +- Return zero for gzwrite() errors to match zlib.h description +- Return -1 on gzputs() error to match zlib.h description +- Add zconf.in.h to allow recovery from configure modification [Weigelt] +- Fix static library permissions in Makefile.in [Weigelt] +- Avoid warnings in configure tests that hide functionality [Weigelt] +- Add *BSD and DragonFly to Linux case in configure [gentoo 123571] +- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212] +- Avoid access of uninitialized data for first inflateReset2 call [Gomes] +- Keep object files in subdirectories to reduce the clutter somewhat +- Remove default Makefile and zlibdefs.h, add dummy Makefile +- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_ +- Remove zlibdefs.h completely -- modify zconf.h instead + +Changes in 1.2.3.6 (17 Jan 2010) +- Avoid void * arithmetic in gzread.c and gzwrite.c +- Make compilers happier with const char * for gz_error message +- Avoid unused parameter warning in inflate.c +- Avoid signed-unsigned comparison warning in inflate.c +- Indent #pragma's for traditional C +- Fix usage of strwinerror() in glib.c, change to gz_strwinerror() +- Correct email address in configure for system options +- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser] +- Update zlib.map [Brown] +- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Tšršk] +- Apply various fixes to CMakeLists.txt [Lowman] +- Add checks on len in gzread() and gzwrite() +- Add error message for no more room for gzungetc() +- Remove zlib version check in gzwrite() +- Defer compression of gzprintf() result until need to +- Use snprintf() in gzdopen() if available +- Remove USE_MMAP configuration determination (only used by minigzip) +- Remove examples/pigz.c (available separately) +- Update examples/gun.c to 1.6 + +Changes in 1.2.3.5 (8 Jan 2010) +- Add space after #if in zutil.h for some compilers +- Fix relatively harmless bug in deflate_fast() [Exarevsky] +- Fix same problem in deflate_slow() +- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown] +- Add deflate_rle() for faster Z_RLE strategy run-length encoding +- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding +- Change name of "write" variable in inffast.c to avoid library collisions +- Fix premature EOF from gzread() in gzio.c [Brown] +- Use zlib header window size if windowBits is 0 in inflateInit2() +- Remove compressBound() call in deflate.c to avoid linking compress.o +- Replace use of errno in gz* with functions, support WinCE [Alves] +- Provide alternative to perror() in minigzip.c for WinCE [Alves] +- Don't use _vsnprintf on later versions of MSVC [Lowman] +- Add CMake build script and input file [Lowman] +- Update contrib/minizip to 1.1 [Svensson, Vollant] +- Moved nintendods directory from contrib to . +- Replace gzio.c with a new set of routines with the same functionality +- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above +- Update contrib/minizip to 1.1b +- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h + +Changes in 1.2.3.4 (21 Dec 2009) +- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility +- Update comments in configure and Makefile.in for default --shared +- Fix test -z's in configure [Marquess] +- Build examplesh and minigzipsh when not testing +- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h +- Import LDFLAGS from the environment in configure +- Fix configure to populate SFLAGS with discovered CFLAGS options +- Adapt make_vms.com to the new Makefile.in [Zinser] +- Add zlib2ansi script for C++ compilation [Marquess] +- Add _FILE_OFFSET_BITS=64 test to make test (when applicable) +- Add AMD64 assembler code for longest match to contrib [Teterin] +- Include options from $SFLAGS when doing $LDSHARED +- Simplify 64-bit file support by introducing z_off64_t type +- Make shared object files in objs directory to work around old Sun cc +- Use only three-part version number for Darwin shared compiles +- Add rc option to ar in Makefile.in for when ./configure not run +- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4* +- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile +- Protect against _FILE_OFFSET_BITS being defined when compiling zlib +- Rename Makefile.in targets allstatic to static and allshared to shared +- Fix static and shared Makefile.in targets to be independent +- Correct error return bug in gz_open() by setting state [Brown] +- Put spaces before ;;'s in configure for better sh compatibility +- Add pigz.c (parallel implementation of gzip) to examples/ +- Correct constant in crc32.c to UL [Leventhal] +- Reject negative lengths in crc32_combine() +- Add inflateReset2() function to work like inflateEnd()/inflateInit2() +- Include sys/types.h for _LARGEFILE64_SOURCE [Brown] +- Correct typo in doc/algorithm.txt [Janik] +- Fix bug in adler32_combine() [Zhu] +- Catch missing-end-of-block-code error in all inflates and in puff + Assures that random input to inflate eventually results in an error +- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/ +- Update ENOUGH and its usage to reflect discovered bounds +- Fix gzerror() error report on empty input file [Brown] +- Add ush casts in trees.c to avoid pedantic runtime errors +- Fix typo in zlib.h uncompress() description [Reiss] +- Correct inflate() comments with regard to automatic header detection +- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays) +- Put new version of gzlog (2.0) in examples with interruption recovery +- Add puff compile option to permit invalid distance-too-far streams +- Add puff TEST command options, ability to read piped input +- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but + _LARGEFILE64_SOURCE not defined +- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart +- Fix deflateSetDictionary() to use all 32K for output consistency +- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h) +- Clear bytes after deflate lookahead to avoid use of uninitialized data +- Change a limit in inftrees.c to be more transparent to Coverity Prevent +- Update win32/zlib.def with exported symbols from zlib.h +- Correct spelling error in zlib.h [Willem] +- Allow Z_BLOCK for deflate() to force a new block +- Allow negative bits in inflatePrime() to delete existing bit buffer +- Add Z_TREES flush option to inflate() to return at end of trees +- Add inflateMark() to return current state information for random access +- Add Makefile for NintendoDS to contrib [Costa] +- Add -w in configure compile tests to avoid spurious warnings [Beucler] +- Fix typos in zlib.h comments for deflateSetDictionary() +- Fix EOF detection in transparent gzread() [Maier] + +Changes in 1.2.3.3 (2 October 2006) +- Make --shared the default for configure, add a --static option +- Add compile option to permit invalid distance-too-far streams +- Add inflateUndermine() function which is required to enable above +- Remove use of "this" variable name for C++ compatibility [Marquess] +- Add testing of shared library in make test, if shared library built +- Use ftello() and fseeko() if available instead of ftell() and fseek() +- Provide two versions of all functions that use the z_off_t type for + binary compatibility -- a normal version and a 64-bit offset version, + per the Large File Support Extension when _LARGEFILE64_SOURCE is + defined; use the 64-bit versions by default when _FILE_OFFSET_BITS + is defined to be 64 +- Add a --uname= option to configure to perhaps help with cross-compiling + +Changes in 1.2.3.2 (3 September 2006) +- Turn off silly Borland warnings [Hay] +- Use off64_t and define _LARGEFILE64_SOURCE when present +- Fix missing dependency on inffixed.h in Makefile.in +- Rig configure --shared to build both shared and static [Teredesai, Truta] +- Remove zconf.in.h and instead create a new zlibdefs.h file +- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant] +- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt] + +Changes in 1.2.3.1 (16 August 2006) +- Add watcom directory with OpenWatcom make files [Daniel] +- Remove #undef of FAR in zconf.in.h for MVS [Fedtke] +- Update make_vms.com [Zinser] +- Use -fPIC for shared build in configure [Teredesai, Nicholson] +- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen] +- Use fdopen() (not _fdopen()) for Interix in zutil.h [BŠck] +- Add some FAQ entries about the contrib directory +- Update the MVS question in the FAQ +- Avoid extraneous reads after EOF in gzio.c [Brown] +- Correct spelling of "successfully" in gzio.c [Randers-Pehrson] +- Add comments to zlib.h about gzerror() usage [Brown] +- Set extra flags in gzip header in gzopen() like deflate() does +- Make configure options more compatible with double-dash conventions + [Weigelt] +- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen] +- Fix uninstall target in Makefile.in [Truta] +- Add pkgconfig support [Weigelt] +- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt] +- Replace set_data_type() with a more accurate detect_data_type() in + trees.c, according to the txtvsbin.txt document [Truta] +- Swap the order of #include and #include "zlib.h" in + gzio.c, example.c and minigzip.c [Truta] +- Shut up annoying VS2005 warnings about standard C deprecation [Rowe, + Truta] (where?) +- Fix target "clean" from win32/Makefile.bor [Truta] +- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe] +- Update zlib www home address in win32/DLL_FAQ.txt [Truta] +- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove] +- Enable browse info in the "Debug" and "ASM Debug" configurations in + the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta] +- Add pkgconfig support [Weigelt] +- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h, + for use in win32/zlib1.rc [Polushin, Rowe, Truta] +- Add a document that explains the new text detection scheme to + doc/txtvsbin.txt [Truta] +- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta] +- Move algorithm.txt into doc/ [Truta] +- Synchronize FAQ with website +- Fix compressBound(), was low for some pathological cases [Fearnley] +- Take into account wrapper variations in deflateBound() +- Set examples/zpipe.c input and output to binary mode for Windows +- Update examples/zlib_how.html with new zpipe.c (also web site) +- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems + that gcc became pickier in 4.0) +- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain + un-versioned, the patch adds versioning only for symbols introduced in + zlib-1.2.0 or later. It also declares as local those symbols which are + not designed to be exported." [Levin] +- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure +- Do not initialize global static by default in trees.c, add a response + NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess] +- Don't use strerror() in gzio.c under WinCE [Yakimov] +- Don't use errno.h in zutil.h under WinCE [Yakimov] +- Move arguments for AR to its usage to allow replacing ar [Marot] +- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson] +- Improve inflateInit() and inflateInit2() documentation +- Fix structure size comment in inflate.h +- Change configure help option from --h* to --help [Santos] + Changes in 1.2.3 (18 July 2005) - Apply security vulnerability fixes to contrib/infback9 as well - Clean up some text files (carriage returns, trailing space) @@ -13,7 +288,7 @@ Changes in 1.2.2.4 (11 July 2005) compile - Fix some spelling errors in comments [Betts] - Correct inflateInit2() error return documentation in zlib.h -- Added zran.c example of compressed data random access to examples +- Add zran.c example of compressed data random access to examples directory, shows use of inflatePrime() - Fix cast for assignments to strm->state in inflate.c and infback.c - Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] Modified: head/lib/libz/FAQ ============================================================================== --- head/lib/libz/FAQ Mon Mar 22 20:52:52 2010 (r205470) +++ head/lib/libz/FAQ Mon Mar 22 21:11:55 2010 (r205471) @@ -3,8 +3,8 @@ If your question is not there, please check the zlib home page -http://www.zlib.org which may have more recent information. -The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html +http://zlib.net/ which may have more recent information. +The lastest zlib FAQ is at http://zlib.net/zlib_faq.html 1. Is zlib Y2K-compliant? @@ -13,54 +13,51 @@ The lastest zlib FAQ is at http://www.gz 2. Where can I get a Windows DLL version? - The zlib sources can be compiled without change to produce a DLL. - See the file win32/DLL_FAQ.txt in the zlib distribution. - Pointers to the precompiled DLL are found in the zlib web site at - http://www.zlib.org. + The zlib sources can be compiled without change to produce a DLL. See the + file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the + precompiled DLL are found in the zlib web site at http://zlib.net/ . 3. Where can I get a Visual Basic interface to zlib? See - * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm - * contrib/visual-basic.txt in the zlib distribution + * http://marknelson.us/1997/01/01/zlib-engine/ * win32/DLL_FAQ.txt in the zlib distribution 4. compress() returns Z_BUF_ERROR. - Make sure that before the call of compress, the length of the compressed - buffer is equal to the total size of the compressed buffer and not - zero. For Visual Basic, check that this parameter is passed by reference + Make sure that before the call of compress(), the length of the compressed + buffer is equal to the available size of the compressed buffer and not + zero. For Visual Basic, check that this parameter is passed by reference ("as any"), not by value ("as long"). 5. deflate() or inflate() returns Z_BUF_ERROR. - Before making the call, make sure that avail_in and avail_out are not - zero. When setting the parameter flush equal to Z_FINISH, also make sure - that avail_out is big enough to allow processing all pending input. - Note that a Z_BUF_ERROR is not fatal--another call to deflate() or - inflate() can be made with more input or output space. A Z_BUF_ERROR - may in fact be unavoidable depending on how the functions are used, since - it is not possible to tell whether or not there is more output pending - when strm.avail_out returns with zero. + Before making the call, make sure that avail_in and avail_out are not zero. + When setting the parameter flush equal to Z_FINISH, also make sure that + avail_out is big enough to allow processing all pending input. Note that a + Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be + made with more input or output space. A Z_BUF_ERROR may in fact be + unavoidable depending on how the functions are used, since it is not + possible to tell whether or not there is more output pending when + strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a + heavily annotated example. 6. Where's the zlib documentation (man pages, etc.)? - It's in zlib.h for the moment, and Francis S. Lin has converted it to a - web page zlib.html. Volunteers to transform this to Unix-style man pages, - please contact us (zlib@gzip.org). Examples of zlib usage are in the files - example.c and minigzip.c. + It's in zlib.h . Examples of zlib usage are in the files example.c and + minigzip.c, with more in examples/ . 7. Why don't you use GNU autoconf or libtool or ...? - Because we would like to keep zlib as a very small and simple - package. zlib is rather portable and doesn't need much configuration. + Because we would like to keep zlib as a very small and simple package. + zlib is rather portable and doesn't need much configuration. 8. I found a bug in zlib. - Most of the time, such problems are due to an incorrect usage of - zlib. Please try to reproduce the problem with a small program and send - the corresponding source to us at zlib@gzip.org . Do not send - multi-megabyte data files without prior agreement. + Most of the time, such problems are due to an incorrect usage of zlib. + Please try to reproduce the problem with a small program and send the + corresponding source to us at zlib@gzip.org . Do not send multi-megabyte + data files without prior agreement. 9. Why do I get "undefined reference to gzputc"? @@ -82,7 +79,7 @@ The lastest zlib FAQ is at http://www.gz 12. Can zlib handle .Z files? - No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt + No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt the code of uncompress on your own. 13. How can I make a Unix shared library? @@ -99,8 +96,10 @@ The lastest zlib FAQ is at http://www.gz However, many flavors of Unix come with a shared zlib already installed. Before going to the trouble of compiling a shared version of zlib and - trying to install it, you may want to check if it's already there! If you - can #include , it's there. The -lz option will probably link to it. + trying to install it, you may want to check if it's already there! If you + can #include , it's there. The -lz option will probably link to + it. You can check the version at the top of zlib.h or with the + ZLIB_VERSION symbol defined in zlib.h . 15. I have a question about OttoPDF. @@ -109,8 +108,8 @@ The lastest zlib FAQ is at http://www.gz 16. Can zlib decode Flate data in an Adobe PDF file? - Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . - To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . + Yes. See http://www.pdflib.com/ . To modify PDF forms, see + http://sourceforge.net/projects/acroformtool/ . 17. Why am I getting this "register_frame_info not found" error on Solaris? @@ -121,67 +120,67 @@ The lastest zlib FAQ is at http://www.gz symbol __register_frame_info: referenced symbol not found The symbol __register_frame_info is not part of zlib, it is generated by - the C compiler (cc or gcc). You must recompile applications using zlib - which have this problem. This problem is specific to Solaris. See + the C compiler (cc or gcc). You must recompile applications using zlib + which have this problem. This problem is specific to Solaris. See http://www.sunfreeware.com for Solaris versions of zlib and applications using zlib. 18. Why does gzip give an error on a file I make with compress/deflate? The compress and deflate functions produce data in the zlib format, which - is different and incompatible with the gzip format. The gz* functions in - zlib on the other hand use the gzip format. Both the zlib and gzip - formats use the same compressed data format internally, but have different - headers and trailers around the compressed data. + is different and incompatible with the gzip format. The gz* functions in + zlib on the other hand use the gzip format. Both the zlib and gzip formats + use the same compressed data format internally, but have different headers + and trailers around the compressed data. 19. Ok, so why are there two different formats? - The gzip format was designed to retain the directory information about - a single file, such as the name and last modification date. The zlib - format on the other hand was designed for in-memory and communication - channel applications, and has a much more compact header and trailer and - uses a faster integrity check than gzip. + The gzip format was designed to retain the directory information about a + single file, such as the name and last modification date. The zlib format + on the other hand was designed for in-memory and communication channel + applications, and has a much more compact header and trailer and uses a + faster integrity check than gzip. 20. Well that's nice, but how do I make a gzip file in memory? You can request that deflate write the gzip format instead of the zlib - format using deflateInit2(). You can also request that inflate decode - the gzip format using inflateInit2(). Read zlib.h for more details. + format using deflateInit2(). You can also request that inflate decode the + gzip format using inflateInit2(). Read zlib.h for more details. 21. Is zlib thread-safe? - Yes. However any library routines that zlib uses and any application- - provided memory allocation routines must also be thread-safe. zlib's gz* + Yes. However any library routines that zlib uses and any application- + provided memory allocation routines must also be thread-safe. zlib's gz* functions use stdio library routines, and most of zlib's functions use the - library memory allocation routines by default. zlib's Init functions allow - for the application to provide custom memory allocation routines. + library memory allocation routines by default. zlib's *Init* functions + allow for the application to provide custom memory allocation routines. Of course, you should only operate on any given zlib or gzip stream from a single thread at a time. 22. Can I use zlib in my commercial application? - Yes. Please read the license in zlib.h. + Yes. Please read the license in zlib.h. 23. Is zlib under the GNU license? - No. Please read the license in zlib.h. + No. Please read the license in zlib.h. 24. The license says that altered source versions must be "plainly marked". So what exactly do I need to do to meet that requirement? - You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In + You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In particular, the final version number needs to be changed to "f", and an - identification string should be appended to ZLIB_VERSION. Version numbers + identification string should be appended to ZLIB_VERSION. Version numbers x.x.x.f are reserved for modifications to zlib by others than the zlib - maintainers. For example, if the version of the base zlib you are altering + maintainers. For example, if the version of the base zlib you are altering is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and - ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also + ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also update the version strings in deflate.c and inftrees.c. For altered source distributions, you should also note the origin and nature of the changes in zlib.h, as well as in ChangeLog and README, along - with the dates of the alterations. The origin should include at least your + with the dates of the alterations. The origin should include at least your name (or your company's name), and an email address to contact for help or issues with the library. @@ -197,105 +196,112 @@ The lastest zlib FAQ is at http://www.gz 26. Will zlib work on a 64-bit machine? - It should. It has been tested on 64-bit machines, and has no dependence - on any data types being limited to 32-bits in length. If you have any + Yes. It has been tested on 64-bit machines, and has no dependence on any + data types being limited to 32-bits in length. If you have any difficulties, please provide a complete problem report to zlib@gzip.org 27. Will zlib decompress data from the PKWare Data Compression Library? - No. The PKWare DCL uses a completely different compressed data format - than does PKZIP and zlib. However, you can look in zlib's contrib/blast + No. The PKWare DCL uses a completely different compressed data format than + does PKZIP and zlib. However, you can look in zlib's contrib/blast directory for a possible solution to your problem. 28. Can I access data randomly in a compressed stream? - No, not without some preparation. If when compressing you periodically - use Z_FULL_FLUSH, carefully write all the pending data at those points, - and keep an index of those locations, then you can start decompression - at those points. You have to be careful to not use Z_FULL_FLUSH too - often, since it can significantly degrade compression. + No, not without some preparation. If when compressing you periodically use + Z_FULL_FLUSH, carefully write all the pending data at those points, and + keep an index of those locations, then you can start decompression at those + points. You have to be careful to not use Z_FULL_FLUSH too often, since it + can significantly degrade compression. Alternatively, you can scan a + deflate stream once to generate an index, and then use that index for + random access. See examples/zran.c . 29. Does zlib work on MVS, OS/390, CICS, etc.? - We don't know for sure. We have heard occasional reports of success on - these systems. If you do use it on one of these, please provide us with - a report, instructions, and patches that we can reference when we get - these questions. Thanks. + It has in the past, but we have not heard of any recent evidence. There + were working ports of zlib 1.1.4 to MVS, but those links no longer work. + If you know of recent, successful applications of zlib on these operating + systems, please let us know. Thanks. -30. Is there some simpler, easier to read version of inflate I can look at - to understand the deflate format? +30. Is there some simpler, easier to read version of inflate I can look at to + understand the deflate format? - First off, you should read RFC 1951. Second, yes. Look in zlib's + First off, you should read RFC 1951. Second, yes. Look in zlib's contrib/puff directory. 31. Does zlib infringe on any patents? - As far as we know, no. In fact, that was originally the whole point behind - zlib. Look here for some more information: + As far as we know, no. In fact, that was originally the whole point behind + zlib. Look here for some more information: http://www.gzip.org/#faq11 32. Can zlib work with greater than 4 GB of data? - Yes. inflate() and deflate() will process any amount of data correctly. + Yes. inflate() and deflate() will process any amount of data correctly. Each call of inflate() or deflate() is limited to input and output chunks of the maximum value that can be stored in the compiler's "unsigned int" - type, but there is no limit to the number of chunks. Note however that the - strm.total_in and strm_total_out counters may be limited to 4 GB. These + type, but there is no limit to the number of chunks. Note however that the + strm.total_in and strm_total_out counters may be limited to 4 GB. These counters are provided as a convenience and are not used internally by - inflate() or deflate(). The application can easily set up its own counters + inflate() or deflate(). The application can easily set up its own counters updated after each call of inflate() or deflate() to count beyond 4 GB. compress() and uncompress() may be limited to 4 GB, since they operate in a - single call. gzseek() and gztell() may be limited to 4 GB depending on how - zlib is compiled. See the zlibCompileFlags() function in zlib.h. + single call. gzseek() and gztell() may be limited to 4 GB depending on how + zlib is compiled. See the zlibCompileFlags() function in zlib.h. - The word "may" appears several times above since there is a 4 GB limit - only if the compiler's "long" type is 32 bits. If the compiler's "long" - type is 64 bits, then the limit is 16 exabytes. + The word "may" appears several times above since there is a 4 GB limit only + if the compiler's "long" type is 32 bits. If the compiler's "long" type is + 64 bits, then the limit is 16 exabytes. 33. Does zlib have any security vulnerabilities? - The only one that we are aware of is potentially in gzprintf(). If zlib - is compiled to use sprintf() or vsprintf(), then there is no protection - against a buffer overflow of a 4K string space, other than the caller of - gzprintf() assuring that the output will not exceed 4K. On the other - hand, if zlib is compiled to use snprintf() or vsnprintf(), which should - normally be the case, then there is no vulnerability. The ./configure - script will display warnings if an insecure variation of sprintf() will - be used by gzprintf(). Also the zlibCompileFlags() function will return - information on what variant of sprintf() is used by gzprintf(). + The only one that we are aware of is potentially in gzprintf(). If zlib is + compiled to use sprintf() or vsprintf(), then there is no protection + against a buffer overflow of an 8K string space (or other value as set by + gzbuffer()), other than the caller of gzprintf() assuring that the output + will not exceed 8K. On the other hand, if zlib is compiled to use + snprintf() or vsnprintf(), which should normally be the case, then there is + no vulnerability. The ./configure script will display warnings if an + insecure variation of sprintf() will be used by gzprintf(). Also the + zlibCompileFlags() function will return information on what variant of + sprintf() is used by gzprintf(). If you don't have snprintf() or vsnprintf() and would like one, you can find a portable implementation here: http://www.ijs.si/software/snprintf/ - Note that you should be using the most recent version of zlib. Versions - 1.1.3 and before were subject to a double-free vulnerability. + Note that you should be using the most recent version of zlib. Versions + 1.1.3 and before were subject to a double-free vulnerability, and versions + 1.2.1 and 1.2.2 were subject to an access exception when decompressing + invalid compressed data. 34. Is there a Java version of zlib? Probably what you want is to use zlib in Java. zlib is already included as part of the Java SDK in the java.util.zip package. If you really want a version of zlib written in the Java language, look on the zlib home - page for links: http://www.zlib.org/ + page for links: http://zlib.net/ . 35. I get this or that compiler or source-code scanner warning when I crank it up to maximally-pedantic. Can't you guys write proper code? Many years ago, we gave up attempting to avoid warnings on every compiler - in the universe. It just got to be a waste of time, and some compilers - were downright silly. So now, we simply make sure that the code always - works. + in the universe. It just got to be a waste of time, and some compilers + were downright silly as well as contradicted each other. So now, we simply + make sure that the code always works. 36. Valgrind (or some similar memory access checker) says that deflate is performing a conditional jump that depends on an uninitialized value. Isn't that a bug? - No. That is intentional for performance reasons, and the output of - deflate is not affected. This only started showing up recently since - zlib 1.2.x uses malloc() by default for allocations, whereas earlier - versions used calloc(), which zeros out the allocated memory. + No. That is intentional for performance reasons, and the output of deflate + is not affected. This only started showing up recently since zlib 1.2.x + uses malloc() by default for allocations, whereas earlier versions used + calloc(), which zeros out the allocated memory. Even though the code was + correct, versions 1.2.4 and later was changed to not stimulate these + checkers. 37. Will zlib read the (insert any ancient or arcane format here) compressed data format? @@ -305,20 +311,21 @@ The lastest zlib FAQ is at http://www.gz 38. How can I encrypt/decrypt zip files with zlib? - zlib doesn't support encryption. The original PKZIP encryption is very weak - and can be broken with freely available programs. To get strong encryption, - use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. - For PKZIP compatible "encryption", look at http://www.info-zip.org/ + zlib doesn't support encryption. The original PKZIP encryption is very + weak and can be broken with freely available programs. To get strong + encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib + compression. For PKZIP compatible "encryption", look at + http://www.info-zip.org/ 39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? - "gzip" is the gzip format, and "deflate" is the zlib format. They should - probably have called the second one "zlib" instead to avoid confusion - with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 + "gzip" is the gzip format, and "deflate" is the zlib format. They should + probably have called the second one "zlib" instead to avoid confusion with + the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 correctly points to the zlib specification in RFC 1950 for the "deflate" transfer encoding, there have been reports of servers and browsers that incorrectly produce or expect raw deflate data per the deflate - specficiation in RFC 1951, most notably Microsoft. So even though the + specficiation in RFC 1951, most notably Microsoft. So even though the "deflate" transfer encoding using the zlib format would be the more efficient approach (and in fact exactly what the zlib format was designed for), using the "gzip" transfer encoding is probably more reliable due to @@ -328,12 +335,32 @@ The lastest zlib FAQ is at http://www.gz 40. Does zlib support the new "Deflate64" format introduced by PKWare? - No. PKWare has apparently decided to keep that format proprietary, since - they have not documented it as they have previous compression formats. - In any case, the compression improvements are so modest compared to other - more modern approaches, that it's not worth the effort to implement. + No. PKWare has apparently decided to keep that format proprietary, since + they have not documented it as they have previous compression formats. In + any case, the compression improvements are so modest compared to other more + modern approaches, that it's not worth the effort to implement. -41. Can you please sign these lengthy legal documents and fax them back to us +41. I'm having a problem with the zip functions in zlib, can you help? + + There are no zip functions in zlib. You are probably using minizip by + Giles Vollant, which is found in the contrib directory of zlib. It is not + part of zlib. In fact none of the stuff in contrib is part of zlib. The + files in there are not supported by the zlib authors. You need to contact + the authors of the respective contribution for help. + +42. The match.asm code in contrib is under the GNU General Public License. + Since it's part of zlib, doesn't that mean that all of zlib falls under the + GNU GPL? + + No. The files in contrib are not part of zlib. They were contributed by + other authors and are provided as a convenience to the user within the zlib + distribution. Each item in contrib has its own license. + +43. Is zlib subject to export controls? What is its ECCN? + + zlib is not subject to export controls, and so is classified as EAR99. + +44. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? No. Go away. Shoo. Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Mon Mar 22 20:52:52 2010 (r205470) +++ head/lib/libz/Makefile Mon Mar 22 21:11:55 2010 (r205471) @@ -4,21 +4,53 @@ LIB= z SHLIBDIR?= /lib +SHLIB_MAJOR= 6 MAN= zlib.3 -#CFLAGS+= -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 -#CFLAGS+= -g -DDEBUG -#CFLAGS+= -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -# -Wstrict-prototypes -Wmissing-prototypes +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes -CFLAGS+= -DHAS_snprintf -DHAS_vsnprintf +CFLAGS+= -DHAS_snprintf -DHAS_vsnprintf -I${.CURDIR} WARNS?= 3 CLEANFILES+= example.o example foo.gz minigzip.o minigzip -SRCS = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c trees.c \ - zutil.c inflate.c inftrees.c inffast.c zopen.c infback.c +SRCS+= adler32.c +SRCS+= compress.c +SRCS+= crc32.c +SRCS+= deflate.c +SRCS+= gzclose.c +SRCS+= gzlib.c +SRCS+= gzread.c +SRCS+= gzwrite.c +SRCS+= infback.c +SRCS+= inffast.c +SRCS+= inflate.c +SRCS+= inftrees.c +SRCS+= trees.c +SRCS+= uncompr.c +SRCS+= zopen.c +SRCS+= zutil.c + +.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} +.PATH: ${.CURDIR}/contrib/asm686 +SRCS+= match.S +CFLAGS+= -DASMV -DNO_UNDERLINE +.endif + +.if ${MACHINE_ARCH} == "amd64" +.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +SRCS+= gvmat64.S +CFLAGS+= -DASMV -DNO_UNDERLINE +.endif + +VERSION_DEF= ${.CURDIR}/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map +CFLAGS+= -DSYMBOL_VERSIONING + INCS= zconf.h zlib.h minigzip: all minigzip.o Modified: head/lib/libz/README ============================================================================== --- head/lib/libz/README Mon Mar 22 20:52:52 2010 (r205470) +++ head/lib/libz/README Mon Mar 22 21:11:55 2010 (r205471) @@ -1,56 +1,51 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.3 is a general purpose data compression library. All the code is +zlib 1.2.4 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). These documents are also available in other -formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html +and rfc1952.txt (gzip format). All functions of the compression library are documented in the file zlib.h -(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example +(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The +is working correctly. Another example is given in the file minigzip.c. The compression library itself is composed of all source files except example.c and minigzip.c. To compile all files and run the test program, follow the instructions given at -the top of Makefile. In short "make test; make install" should work for most -machines. For Unix: "./configure; make test; make install". For MSDOS, use one -of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. +the top of Makefile.in. In short "./configure; make test", and if that goes +well, "make install" should work for most flavors of Unix. For Windows, use one +of the special makefiles in win32/ or projects/ . For VMS, use make_vms.com. Questions about zlib should be sent to , or to Gilles Vollant - for the Windows DLL version. The zlib home page is -http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem, -please check this site to verify that you have the latest version of zlib; -otherwise get the latest version and check whether the problem still exists or -not. - -PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking -for help. - -Mark Nelson wrote an article about zlib for the Jan. 1997 -issue of Dr. Dobb's Journal; a copy of the article is available in -http://dogma.net/markn/articles/zlibtool/zlibtool.htm - -The changes made in version 1.2.3 are documented in the file ChangeLog. - -Unsupported third party contributions are provided in directory "contrib". - -A Java implementation of zlib is available in the Java Development Kit -http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html -See the zlib home page http://www.zlib.org for details. - -A Perl interface to zlib written by Paul Marquess is in the -CPAN (Comprehensive Perl Archive Network) sites -http://www.cpan.org/modules/by-module/Compress/ + for the Windows DLL version. The zlib home page is +http://zlib.net/ . Before reporting a problem, please check this site to +verify that you have the latest version of zlib; otherwise get the latest +version and check whether the problem still exists or not. + +PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. + +Mark Nelson wrote an article about zlib for the Jan. 1997 +issue of Dr. Dobb's Journal; a copy of the article is available at +http://marknelson.us/1997/01/01/zlib-engine/ . + +The changes made in version 1.2.4 are documented in the file ChangeLog. + +Unsupported third party contributions are provided in directory contrib/ . + +zlib is available in Java using the java.util.zip package, documented at +http://java.sun.com/developer/technicalArticles/Programming/compression/ . + +A Perl interface to zlib written by Paul Marquess is available +at CPAN (Comprehensive Perl Archive Network) sites, including +http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . A Python interface to zlib written by A.M. Kuchling is available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html +http://www.python.org/doc/lib/module-zlib.html . -A zlib binding for TCL written by Andreas Kupries is -availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html +zlib is built into tcl: http://wiki.tcl.tk/4610 . An experimental package to read and write files in .zip format, written on top of zlib by Gilles Vollant , is available in the @@ -74,25 +69,21 @@ Notes for some targets: - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with other compilers. Use "make test" to check your compiler. -- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. +- gzdopen is not supported on RISCOS or BEOS. - For PalmOs, see http://palmzlib.sourceforge.net/ -- When building a shared, i.e. dynamic library on Mac OS X, the library must be - installed before testing (do "make install" before "make test"), since the - library location is specified in the library. - Acknowledgments: - The deflate format used by zlib was defined by Phil Katz. The deflate - and zlib specifications were written by L. Peter Deutsch. Thanks to all the - people who reported problems and suggested various improvements in zlib; - they are too numerous to cite here. + The deflate format used by zlib was defined by Phil Katz. The deflate and + zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; they + are too numerous to cite here. Copyright notice: - (C) 1995-2004 Jean-loup Gailly and Mark Adler + (C) 1995-2010 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -113,13 +104,11 @@ Copyright notice: Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu -If you use the zlib library in a product, we would appreciate *not* -receiving lengthy legal documents to sign. The sources are provided -for free but without warranty of any kind. The library has been -entirely written by Jean-loup Gailly and Mark Adler; it does not -include third-party code. - -If you redistribute modified sources, we would appreciate that you include -in the file ChangeLog history information documenting your changes. Please -read the FAQ for more information on the distribution of modified source -versions. +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. Copied: head/lib/libz/Symbol.map (from r205470, user/delphij/libz/Symbol.map) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libz/Symbol.map Mon Mar 22 21:11:55 2010 (r205471, copy of r205470, user/delphij/libz/Symbol.map) @@ -0,0 +1,96 @@ +/* + * $FreeBSD$ + */ + +ZLIB_1.2.4.0 { + adler32; + adler32_combine64; + compress; + compress2; + compressBound; + crc32; + crc32_combine64; + deflate; + deflateBound; + deflateCopy; + deflateEnd; + deflateInit2_; + deflateInit_; + deflateParams; + deflatePrime; + deflateReset; + deflateSetDictionary; + deflateSetHeader; + deflateTune; + get_crc_table; + gzbuffer; + gzclearerr; + gzclose; + gzclose_r; + gzclose_w; + gzdirect; + gzdopen; + gzeof; + gzerror; + gzflush; + gzgetc; + gzgets; + gzoffset64; + gzopen64; + gzprintf; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 21:19:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A5D1065673; Mon, 22 Mar 2010 21:19:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01F748FC1C; Mon, 22 Mar 2010 21:19:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MLJH1V042946; Mon, 22 Mar 2010 21:19:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MLJHF1042944; Mon, 22 Mar 2010 21:19:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003222119.o2MLJHF1042944@svn.freebsd.org> From: Xin LI Date: Mon, 22 Mar 2010 21:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205472 - head/usr.bin/minigzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 21:19:18 -0000 Author: delphij Date: Mon Mar 22 21:19:17 2010 New Revision: 205472 URL: http://svn.freebsd.org/changeset/base/205472 Log: Enable mmap for minigzip(1). Modified: head/usr.bin/minigzip/Makefile Modified: head/usr.bin/minigzip/Makefile ============================================================================== --- head/usr.bin/minigzip/Makefile Mon Mar 22 21:11:55 2010 (r205471) +++ head/usr.bin/minigzip/Makefile Mon Mar 22 21:19:17 2010 (r205472) @@ -1,10 +1,13 @@ # $FreeBSD$ +SRCDIR= ${.CURDIR}/../../lib/libz +.PATH: ${SRCDIR} + PROG= minigzip -LDADD= -lz -DPADD= ${LIBZ} -.PATH: ${.CURDIR}/../../lib/libz WARNS?= 5 +CFLAGS+=-DUSE_MMAP +DPADD= ${LIBZ} +LDADD= -lz .include From owner-svn-src-head@FreeBSD.ORG Mon Mar 22 21:27:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1CC10656F3; Mon, 22 Mar 2010 21:27:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6381B8FC1B; Mon, 22 Mar 2010 21:27:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MLRpxk044990; Mon, 22 Mar 2010 21:27:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MLRpIV044985; Mon, 22 Mar 2010 21:27:51 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003222127.o2MLRpIV044985@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 22 Mar 2010 21:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205475 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 21:27:51 -0000 Author: edwin Date: Mon Mar 22 21:27:51 2010 New Revision: 205475 URL: http://svn.freebsd.org/changeset/base/205475 Log: MFV of tzdata2010f: The Australian Antartic Division: - Macquarie Island will stay on UTC+11 for winter and not switch back from DST. - Casey station reverted to its normal time of UTC+8 on 5 March 2010. - Davis station will revert to its normal time of UTC+7 at 10 March 2010 - Mawson station stays on UTC+5. Syria will start DST on Thursday 1 April 2010 at midnight. Correct Samao DST start date (26 Sep vs 24 Oct) Modified: head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Mon Mar 22 21:26:12 2010 (r205474) +++ head/contrib/tzdata/antarctica Mon Mar 22 21:27:51 2010 (r205475) @@ -1,5 +1,5 @@ #
-# @(#)antarctica	8.7
+# @(#)antarctica	8.8
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -57,6 +57,33 @@ Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	
 Rule	ChileAQ	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u	0	-
 
+# These rules are stolen from the `australasia' file.
+Rule	AusAQ	1917	only	-	Jan	 1	0:01	1:00	-
+Rule	AusAQ	1917	only	-	Mar	25	2:00	0	-
+Rule	AusAQ	1942	only	-	Jan	 1	2:00	1:00	-
+Rule	AusAQ	1942	only	-	Mar	29	2:00	0	-
+Rule	AusAQ	1942	only	-	Sep	27	2:00	1:00	-
+Rule	AusAQ	1943	1944	-	Mar	lastSun	2:00	0	-
+Rule	AusAQ	1943	only	-	Oct	 3	2:00	1:00	-
+Rule	ATAQ	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1968	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1968	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1969	1971	-	Mar	Sun>=8	2:00s	0	-
+Rule	ATAQ	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	ATAQ	1973	1981	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1982	1983	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1984	1986	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
+Rule	ATAQ	1987	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	ATAQ	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
+Rule	ATAQ	1988	1990	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1991	2005	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	ATAQ	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	ATAQ	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2008	max	-	Apr	Sun>=1	2:00s	0	-
 
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -98,20 +125,52 @@ Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u
 # http://www.timeanddate.com/news/time/antarctica-new-times.html
 # 
 
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+#
+# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
+# The change to UTC+11 is being considered as a regular summer thing but
+# has not been decided yet.
+#
+# - Davis station will revert to its normal time of UTC+7 at 10 March 2010
+# 20:00 UTC.
+#
+# - Mawson station stays on UTC+5.
+#
+# In addition to the Rule changes for Casey/Davis, it means that Macquarie
+# will no longer be like Hobart and will have to have its own Zone created.
+#
+# Background:
+# 
+# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
+# 
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Casey	0	-	zzz	1969
 			8:00	-	WST	2009 Oct 18 2:00
 						# Western (Aus) Standard Time
-			11:00	-	CAST	# Casey Time
+			11:00	-	CAST	2010 Mar 5 2:00
+						# Casey Time
+			8:00	-	WST
 Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
 			7:00	-	DAVT	1964 Nov # Davis Time
 			0	-	zzz	1969 Feb
 			7:00	-	DAVT	2009 Oct 18 2:00
-			5:00	-	DAVT
+			5:00	-	DAVT	2010 Mar 10 20:00u
+			7:00	-	DAVT
 Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
 			6:00	-	MAWT	2009 Oct 18 2:00
 						# Mawson Time
 			5:00	-	MAWT
+Zone Antarctica/Macquarie 0	-	zzz	1911
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	AusAQ	EST	1967
+			10:00	ATAQ	EST	2010 Apr 4 3:00
+			11:00	-	MIST	# Macquarie Island Time
 # References:
 # 
 # Casey Weather (1998-02-26)

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Mon Mar 22 21:26:12 2010	(r205474)
+++ head/contrib/tzdata/asia	Mon Mar 22 21:27:51 2010	(r205475)
@@ -1,4 +1,4 @@
-# @(#)asia	8.55
+# @(#)asia	8.56
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2438,9 +2438,18 @@ Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	
 # Thursday of the month or the start of the last Friday of the month or
 # something else. For now, use the start of the last Friday.
 
+# From Steffen Thorsen (2010-03-17):
+# The "Syrian News Station" reported on 2010-03-16 that the Council of
+# Ministers has decided that Syria will start DST on midnight Thursday
+# 2010-04-01: (midnight between Thursday and Friday):
+# 
+# http://sns.sy/sns/?path=news/read/11421 (Arabic)
+# 
+
 Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2008	only	-	Nov	1	0:00	0	-
-Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2009	only	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2010	max	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2009	max	-	Oct	lastFri	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Mon Mar 22 21:26:12 2010	(r205474)
+++ head/contrib/tzdata/australasia	Mon Mar 22 21:27:51 2010	(r205475)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.16
+# @(#)australasia	8.17
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -490,7 +490,7 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST	2010 Oct 24
+			-11:00	-	WST	2010 Sep 26
 			-11:00	1:00	WSDT	2011 Apr 3
 			-11:00	-	WST
 

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Mon Mar 22 21:26:12 2010	(r205474)
+++ head/contrib/tzdata/zone.tab	Mon Mar 22 21:27:51 2010	(r205475)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.33
+# @(#)zone.tab	8.34
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -44,6 +44,7 @@ AQ	-6617+11031	Antarctica/Casey	Casey St
 AQ	-7824+10654	Antarctica/Vostok	Vostok Station, S Magnetic Pole
 AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
 AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
+AQ	-5430+15857	Antarctica/Macquarie	Macquarie Island Station, Macquarie Island
 AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
 AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
 AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)

From owner-svn-src-head@FreeBSD.ORG  Mon Mar 22 22:05:59 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 570951065679;
	Mon, 22 Mar 2010 22:05:59 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CF2B8FC20;
	Mon, 22 Mar 2010 22:05:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MM5xYv054010;
	Mon, 22 Mar 2010 22:05:59 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MM5x9q054009;
	Mon, 22 Mar 2010 22:05:59 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003222205.o2MM5x9q054009@svn.freebsd.org>
From: Xin LI 
Date: Mon, 22 Mar 2010 22:05:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205484 - head/lib/libz
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 22 Mar 2010 22:05:59 -0000

Author: delphij
Date: Mon Mar 22 22:05:58 2010
New Revision: 205484
URL: http://svn.freebsd.org/changeset/base/205484

Log:
  Note that we are the same with the vendor tree.

Modified:
Directory Properties:
  head/lib/libz/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Mon Mar 22 22:12:28 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DB291065670;
	Mon, 22 Mar 2010 22:12:28 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 439E68FC0C;
	Mon, 22 Mar 2010 22:12:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MMCSKc055542;
	Mon, 22 Mar 2010 22:12:28 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MMCSdN055541;
	Mon, 22 Mar 2010 22:12:28 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003222212.o2MMCSdN055541@svn.freebsd.org>
From: Xin LI 
Date: Mon, 22 Mar 2010 22:12:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205486 - head/lib/libz
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 22 Mar 2010 22:12:28 -0000

Author: delphij
Date: Mon Mar 22 22:12:27 2010
New Revision: 205486
URL: http://svn.freebsd.org/changeset/base/205486

Log:
  Expand $FreeBSD$.

Modified:
Directory Properties:
  head/lib/libz/Symbol.map   (props changed)
  head/lib/libz/Versions.def   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Mon Mar 22 22:39:33 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0280E106564A;
	Mon, 22 Mar 2010 22:39:33 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E6BEB8FC0C;
	Mon, 22 Mar 2010 22:39:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MMdWAo061586;
	Mon, 22 Mar 2010 22:39:32 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MMdWZi061585;
	Mon, 22 Mar 2010 22:39:32 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003222239.o2MMdWZi061585@svn.freebsd.org>
From: Kip Macy 
Date: Mon, 22 Mar 2010 22:39:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205487 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 22 Mar 2010 22:39:33 -0000

Author: kmacy
Date: Mon Mar 22 22:39:32 2010
New Revision: 205487
URL: http://svn.freebsd.org/changeset/base/205487

Log:
  - enable alignment on amd64 only
  - only align pcpu caches and the volatile portion of uma_zone

Modified:
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_int.h
==============================================================================
--- head/sys/vm/uma_int.h	Mon Mar 22 22:12:27 2010	(r205486)
+++ head/sys/vm/uma_int.h	Mon Mar 22 22:39:32 2010	(r205487)
@@ -162,7 +162,11 @@ struct uma_hash {
 /*
  * align field or structure to cache line
  */
+#if defined(__amd64__)
+#define UMA_ALIGN	__aligned(CACHE_LINE_SIZE)
+#else
 #define UMA_ALIGN
+#endif
 
 /*
  * Structures for per cpu queues.
@@ -173,7 +177,7 @@ struct uma_bucket {
 	int16_t	ub_cnt;				/* Count of free items. */
 	int16_t	ub_entries;			/* Max items. */
 	void	*ub_bucket[];			/* actual allocation storage */
-} UMA_ALIGN;
+};
 
 typedef struct uma_bucket * uma_bucket_t;
 
@@ -330,7 +334,7 @@ struct uma_zone {
 	 * This HAS to be the last item because we adjust the zone size
 	 * based on NCPU and then allocate the space for the zones.
 	 */
-	struct uma_cache	uz_cpu[1] UMA_ALIGN; /* Per cpu caches */
+	struct uma_cache	uz_cpu[1]; /* Per cpu caches */
 };
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Mon Mar 22 23:04:13 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E427106564A;
	Mon, 22 Mar 2010 23:04:13 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D2118FC0C;
	Mon, 22 Mar 2010 23:04:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2MN4DCc067014;
	Mon, 22 Mar 2010 23:04:13 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MN4CYU067011;
	Mon, 22 Mar 2010 23:04:12 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201003222304.o2MN4CYU067011@svn.freebsd.org>
From: Kip Macy 
Date: Mon, 22 Mar 2010 23:04:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205488 - in head/sys: net netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 22 Mar 2010 23:04:13 -0000

Author: kmacy
Date: Mon Mar 22 23:04:12 2010
New Revision: 205488
URL: http://svn.freebsd.org/changeset/base/205488

Log:
  - boot-time size the ipv4 flowtable and the maximum number of flows
  - increase flow cleaning frequency and decrease flow caching time
    when near the flow limit
  - stop allocating new flows when within 3% of maxflows don't start
    allocating again until below 12.5%
  
  MFC after:	7 days

Modified:
  head/sys/net/flowtable.c
  head/sys/netinet/ip_input.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Mon Mar 22 22:39:32 2010	(r205487)
+++ head/sys/net/flowtable.c	Mon Mar 22 23:04:12 2010	(r205488)
@@ -155,30 +155,33 @@ struct flowtable_stats {
 	uint64_t	ft_frees;
 	uint64_t	ft_hits;
 	uint64_t	ft_lookups;
-} __aligned(128);
+} __aligned(CACHE_LINE_SIZE);
 
 struct flowtable {
 	struct	flowtable_stats ft_stats[MAXCPU];
 	int 		ft_size;
 	int 		ft_lock_count;
 	uint32_t	ft_flags;
-
-	uint32_t	ft_udp_idle;
-	uint32_t	ft_fin_wait_idle;
-	uint32_t	ft_syn_idle;
-	uint32_t	ft_tcp_idle;
-
 	char		*ft_name;
 	fl_lock_t	*ft_lock;
 	fl_lock_t 	*ft_unlock;
 	fl_rtalloc_t	*ft_rtalloc;
+	/*
+	 * XXX need to pad out 
+	 */ 
 	struct mtx	*ft_locks;
-
 	union flentryp	ft_table;
 	bitstr_t 	*ft_masks[MAXCPU];
 	bitstr_t	*ft_tmpmask;
 	struct flowtable *ft_next;
-} __aligned(128);
+
+	uint32_t	ft_count __aligned(CACHE_LINE_SIZE);
+	uint32_t	ft_udp_idle __aligned(CACHE_LINE_SIZE);
+	uint32_t	ft_fin_wait_idle;
+	uint32_t	ft_syn_idle;
+	uint32_t	ft_tcp_idle;
+	boolean_t	ft_full;
+} __aligned(CACHE_LINE_SIZE);
 
 static struct proc *flowcleanerproc;
 static VNET_DEFINE(struct flowtable *, flow_list_head);
@@ -191,9 +194,11 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6
 #define	V_flow_ipv4_zone	VNET(flow_ipv4_zone)
 #define	V_flow_ipv6_zone	VNET(flow_ipv6_zone)
 
+
 static struct cv 	flowclean_cv;
 static struct mtx	flowclean_lock;
 static uint32_t		flowclean_cycles;
+static uint32_t		flowclean_freq;
 
 #ifdef FLOWTABLE_DEBUG
 #define FLDPRINTF(ft, flags, fmt, ...) 		\
@@ -230,7 +235,7 @@ static VNET_DEFINE(int, flowtable_syn_ex
 static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE;
 static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE;
 static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE;
-static VNET_DEFINE(int, flowtable_nmbflows) = 4096;
+static VNET_DEFINE(int, flowtable_nmbflows);
 static VNET_DEFINE(int, flowtable_ready) = 0;
 
 #define	V_flowtable_enable		VNET(flowtable_enable)
@@ -905,6 +910,61 @@ flowtable_set_hashkey(struct flentry *fl
 		hashkey[i] = key[i];
 }
 
+static struct flentry *
+flow_alloc(struct flowtable *ft)
+{
+	struct flentry *newfle;
+	uma_zone_t zone;
+
+	newfle = NULL;
+	zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone;
+
+	newfle = uma_zalloc(zone, M_NOWAIT | M_ZERO);
+	if (newfle != NULL)
+		atomic_add_int(&ft->ft_count, 1);
+	return (newfle);
+}
+
+static void
+flow_free(struct flentry *fle, struct flowtable *ft)
+{
+	uma_zone_t zone;
+
+	zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone;
+	atomic_add_int(&ft->ft_count, -1);
+	uma_zfree(zone, fle);
+}
+
+static int
+flow_full(struct flowtable *ft)
+{
+	boolean_t full;
+	uint32_t count;
+	
+	full = ft->ft_full;
+	count = ft->ft_count;
+
+	if (full && (count < (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 3))))
+		ft->ft_full = FALSE;
+	else if (!full && (count > (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 5))))
+		ft->ft_full = TRUE;
+	
+	if (full && !ft->ft_full) {
+		flowclean_freq = 4*hz;
+		if ((ft->ft_flags & FL_HASH_ALL) == 0)
+			ft->ft_udp_idle = ft->ft_fin_wait_idle =
+			    ft->ft_syn_idle = ft->ft_tcp_idle = 5;
+		cv_broadcast(&flowclean_cv);
+	} else if (!full && ft->ft_full) {
+		flowclean_freq = 20*hz;
+		if ((ft->ft_flags & FL_HASH_ALL) == 0)
+			ft->ft_udp_idle = ft->ft_fin_wait_idle =
+			    ft->ft_syn_idle = ft->ft_tcp_idle = 30;
+	}
+
+	return (ft->ft_full);
+}
+
 static int
 flowtable_insert(struct flowtable *ft, uint32_t hash, uint32_t *key,
     uint32_t fibnum, struct route *ro, uint16_t flags)
@@ -912,12 +972,10 @@ flowtable_insert(struct flowtable *ft, u
 	struct flentry *fle, *fletail, *newfle, **flep;
 	struct flowtable_stats *fs = &ft->ft_stats[curcpu];
 	int depth;
-	uma_zone_t flezone;
 	bitstr_t *mask;
 	uint8_t proto;
 
-	flezone = (flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone;
-	newfle = uma_zalloc(flezone, M_NOWAIT | M_ZERO);
+	newfle = flow_alloc(ft);
 	if (newfle == NULL)
 		return (ENOMEM);
 
@@ -948,9 +1006,8 @@ flowtable_insert(struct flowtable *ft, u
 			 * or we lost a race to insert
 			 */
 			FL_ENTRY_UNLOCK(ft, hash);
-			uma_zfree((newfle->f_flags & FL_IPV6) ?
-			    V_flow_ipv6_zone : V_flow_ipv4_zone, newfle);
-
+			flow_free(newfle, ft);
+			
 			if (flags & FL_OVERWRITE) 
 				goto skip;
 			return (EEXIST);
@@ -1147,7 +1204,7 @@ keycheck:	
 	}
 	FL_ENTRY_UNLOCK(ft, hash);
 uncached:
-	if (flags & FL_NOAUTO)
+	if (flags & FL_NOAUTO || flow_full(ft))
 		return (NULL);
 
 	fs->ft_misses++;
@@ -1325,7 +1382,7 @@ flowtable_alloc(char *name, int nentry, 
  * 
  */
 static void
-fle_free(struct flentry *fle)
+fle_free(struct flentry *fle, struct flowtable *ft)
 {
 	struct rtentry *rt;
 	struct llentry *lle;
@@ -1334,8 +1391,7 @@ fle_free(struct flentry *fle)
 	lle = __DEVOLATILE(struct llentry *, fle->f_lle);
 	RTFREE(rt);
 	LLE_FREE(lle);
-	uma_zfree((fle->f_flags & FL_IPV6) ?
-	    V_flow_ipv6_zone : V_flow_ipv4_zone, fle);
+	flow_free(fle, ft);
 }
 
 static void
@@ -1426,7 +1482,7 @@ flowtable_free_stale(struct flowtable *f
 		flefreehead = fle->f_next;
 		count++;
 		fs->ft_frees++;
-		fle_free(fle);
+		fle_free(fle, ft);
 	}
 	if (V_flowtable_debug && count)
 		log(LOG_DEBUG, "freed %d flow entries\n", count);
@@ -1518,7 +1574,7 @@ flowtable_cleaner(void)
 		 */
 		mtx_lock(&flowclean_lock);
 		cv_broadcast(&flowclean_cv);
-		cv_timedwait(&flowclean_cv, &flowclean_lock, 10*hz);
+		cv_timedwait(&flowclean_cv, &flowclean_lock, flowclean_freq);
 		mtx_unlock(&flowclean_lock);
 	}
 }
@@ -1548,6 +1604,7 @@ static void
 flowtable_init_vnet(const void *unused __unused)
 {
 
+	V_flowtable_nmbflows = 1024 + maxusers * 64 * mp_ncpus;
 	V_flow_ipv4_zone = uma_zcreate("ip4flow", sizeof(struct flentry_v4),
 	    NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET);
 	V_flow_ipv6_zone = uma_zcreate("ip6flow", sizeof(struct flentry_v6),
@@ -1556,7 +1613,7 @@ flowtable_init_vnet(const void *unused _
 	uma_zone_set_max(V_flow_ipv6_zone, V_flowtable_nmbflows);
 	V_flowtable_ready = 1;
 }
-VNET_SYSINIT(flowtable_init_vnet, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE,
+VNET_SYSINIT(flowtable_init_vnet, SI_SUB_SMP, SI_ORDER_ANY,
     flowtable_init_vnet, NULL);
 
 static void
@@ -1567,8 +1624,9 @@ flowtable_init(const void *unused __unus
 	mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF);
 	EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL,
 	    EVENTHANDLER_PRI_ANY);
+	flowclean_freq = 20*hz;
 }
-SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY,
+SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE,
     flowtable_init, NULL);
 
 

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Mon Mar 22 22:39:32 2010	(r205487)
+++ head/sys/netinet/ip_input.c	Mon Mar 22 23:04:12 2010	(r205488)
@@ -327,8 +327,20 @@ ip_init(void)
 			"error %d\n", __func__, i);
 
 #ifdef FLOWTABLE
-	TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size",
-	    &V_ip_output_flowtable_size);
+	if (TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size",
+		&V_ip_output_flowtable_size)) {
+		if (V_ip_output_flowtable_size < 256)
+			V_ip_output_flowtable_size = 256;
+		if (!powerof2(V_ip_output_flowtable_size)) {
+			printf("flowtable must be power of 2 size\n");
+			V_ip_output_flowtable_size = 2048;
+		}
+	} else {
+		/*
+		 * round up to the next power of 2
+		 */
+		V_ip_output_flowtable_size = 1 << fls((1024 + maxusers * 64)-1);
+	}
 	V_ip_ft = flowtable_alloc("ipv4", V_ip_output_flowtable_size, FL_PCPU);
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 01:07:30 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 972FF106566B;
	Tue, 23 Mar 2010 01:07:30 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85C278FC16;
	Tue, 23 Mar 2010 01:07:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N17UeV095411;
	Tue, 23 Mar 2010 01:07:30 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N17UwV095409;
	Tue, 23 Mar 2010 01:07:30 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003230107.o2N17UwV095409@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 23 Mar 2010 01:07:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205495 - head/sys/powerpc/booke
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 01:07:30 -0000

Author: marcel
Date: Tue Mar 23 01:07:30 2010
New Revision: 205495
URL: http://svn.freebsd.org/changeset/base/205495

Log:
  Actually pass a pointer to the trapframe to powerpc_extr_interrupt().

Modified:
  head/sys/powerpc/booke/trap_subr.S

Modified: head/sys/powerpc/booke/trap_subr.S
==============================================================================
--- head/sys/powerpc/booke/trap_subr.S	Tue Mar 23 00:31:56 2010	(r205494)
+++ head/sys/powerpc/booke/trap_subr.S	Tue Mar 23 01:07:30 2010	(r205495)
@@ -441,6 +441,7 @@ INTERRUPT(int_instr_storage)
 INTERRUPT(int_external_input)
 	STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1)
 	FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_EXI)
+	addi	%r3, %r1, 8
 	bl	CNAME(powerpc_extr_interrupt)
 	b	trapexit
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 01:09:45 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F031D106564A;
	Tue, 23 Mar 2010 01:09:45 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6F128FC08;
	Tue, 23 Mar 2010 01:09:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N19jCH096144;
	Tue, 23 Mar 2010 01:09:45 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N19jWV096141;
	Tue, 23 Mar 2010 01:09:45 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003230109.o2N19jWV096141@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 23 Mar 2010 01:09:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205496 - in head/sys: dev/ofw powerpc/ofw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 01:09:46 -0000

Author: nwhitehorn
Date: Tue Mar 23 01:09:45 2010
New Revision: 205496
URL: http://svn.freebsd.org/changeset/base/205496

Log:
  Do not declare the various OFW command buffers static. It does not
  appear to be necessary on either sparc64 or powerpc, and is a
  concurrency nightmare.
  
  Reviewed by:	marius

Modified:
  head/sys/dev/ofw/ofw_standard.c
  head/sys/powerpc/ofw/ofw_real.c

Modified: head/sys/dev/ofw/ofw_standard.c
==============================================================================
--- head/sys/dev/ofw/ofw_standard.c	Tue Mar 23 01:07:30 2010	(r205495)
+++ head/sys/dev/ofw/ofw_standard.c	Tue Mar 23 01:09:45 2010	(r205496)
@@ -165,7 +165,7 @@ ofw_std_init(ofw_t ofw, void *openfirm)
 static int
 ofw_std_test(ofw_t ofw, const char *name)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -187,7 +187,7 @@ static int
 ofw_std_interpret(ofw_t ofw, const char *cmd, int nreturns,
     unsigned long *returns)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -217,7 +217,7 @@ ofw_std_interpret(ofw_t ofw, const char 
 static phandle_t
 ofw_std_peer(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -239,7 +239,7 @@ ofw_std_peer(ofw_t ofw, phandle_t node)
 static phandle_t
 ofw_std_child(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -261,7 +261,7 @@ ofw_std_child(ofw_t ofw, phandle_t node)
 static phandle_t
 ofw_std_parent(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -283,7 +283,7 @@ ofw_std_parent(ofw_t ofw, phandle_t node
 static phandle_t
 ofw_std_instance_to_package(ofw_t ofw, ihandle_t instance)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -305,7 +305,7 @@ ofw_std_instance_to_package(ofw_t ofw, i
 static ssize_t
 ofw_std_getproplen(ofw_t ofw, phandle_t package, const char *propname)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -330,7 +330,7 @@ static ssize_t
 ofw_std_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf,
     size_t buflen)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -359,7 +359,7 @@ static int
 ofw_std_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf,
     size_t size)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -387,7 +387,7 @@ static int
 ofw_std_setprop(ofw_t ofw, phandle_t package, const char *propname,
     const void *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -415,7 +415,7 @@ ofw_std_setprop(ofw_t ofw, phandle_t pac
 static ssize_t
 ofw_std_canon(ofw_t ofw, const char *device, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -441,7 +441,7 @@ ofw_std_canon(ofw_t ofw, const char *dev
 static phandle_t
 ofw_std_finddevice(ofw_t ofw, const char *device)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -463,7 +463,7 @@ ofw_std_finddevice(ofw_t ofw, const char
 static ssize_t
 ofw_std_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -489,7 +489,7 @@ ofw_std_instance_to_path(ofw_t ofw, ihan
 static ssize_t
 ofw_std_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -516,7 +516,7 @@ static int
 ofw_std_call_method(ofw_t ofw, ihandle_t instance, const char *method,
     int nargs, int nreturns, unsigned long *args_and_returns)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -559,7 +559,7 @@ ofw_std_call_method(ofw_t ofw, ihandle_t
 static ihandle_t
 ofw_std_open(ofw_t ofw, const char *device)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -581,7 +581,7 @@ ofw_std_open(ofw_t ofw, const char *devi
 static void
 ofw_std_close(ofw_t ofw, ihandle_t instance)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -599,7 +599,7 @@ ofw_std_close(ofw_t ofw, ihandle_t insta
 static ssize_t
 ofw_std_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -626,7 +626,7 @@ ofw_std_read(ofw_t ofw, ihandle_t instan
 static ssize_t
 ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -652,7 +652,7 @@ ofw_std_write(ofw_t ofw, ihandle_t insta
 static int
 ofw_std_seek(ofw_t ofw, ihandle_t instance, uint64_t pos)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -682,7 +682,7 @@ ofw_std_seek(ofw_t ofw, ihandle_t instan
 static caddr_t
 ofw_std_claim(ofw_t ofw, void *virt, size_t size, u_int align)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -708,7 +708,7 @@ ofw_std_claim(ofw_t ofw, void *virt, siz
 static void
 ofw_std_release(ofw_t ofw, void *virt, size_t size)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -732,7 +732,7 @@ ofw_std_release(ofw_t ofw, void *virt, s
 static void
 ofw_std_enter(ofw_t ofw)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -748,7 +748,7 @@ ofw_std_enter(ofw_t ofw)
 static void
 ofw_std_exit(ofw_t ofw)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;

Modified: head/sys/powerpc/ofw/ofw_real.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_real.c	Tue Mar 23 01:07:30 2010	(r205495)
+++ head/sys/powerpc/ofw/ofw_real.c	Tue Mar 23 01:09:45 2010	(r205496)
@@ -273,7 +273,7 @@ ofw_real_init(ofw_t ofw, void *openfirm)
 static int
 ofw_real_test(ofw_t ofw, const char *name)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -304,7 +304,7 @@ ofw_real_test(ofw_t ofw, const char *nam
 static phandle_t
 ofw_real_peer(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -326,7 +326,7 @@ ofw_real_peer(ofw_t ofw, phandle_t node)
 static phandle_t
 ofw_real_child(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -348,7 +348,7 @@ ofw_real_child(ofw_t ofw, phandle_t node
 static phandle_t
 ofw_real_parent(ofw_t ofw, phandle_t node)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -370,7 +370,7 @@ ofw_real_parent(ofw_t ofw, phandle_t nod
 static phandle_t
 ofw_real_instance_to_package(ofw_t ofw, ihandle_t instance)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -392,7 +392,7 @@ ofw_real_instance_to_package(ofw_t ofw, 
 static ssize_t
 ofw_real_getproplen(ofw_t ofw, phandle_t package, const char *propname)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -422,7 +422,7 @@ static ssize_t
 ofw_real_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, 
     size_t buflen)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -458,7 +458,7 @@ static int
 ofw_real_nextprop(ofw_t ofw, phandle_t package, const char *previous, 
     char *buf, size_t size)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -493,7 +493,7 @@ static int
 ofw_real_setprop(ofw_t ofw, phandle_t package, const char *propname,
     const void *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -526,7 +526,7 @@ ofw_real_setprop(ofw_t ofw, phandle_t pa
 static ssize_t
 ofw_real_canon(ofw_t ofw, const char *device, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -559,7 +559,7 @@ ofw_real_canon(ofw_t ofw, const char *de
 static phandle_t
 ofw_real_finddevice(ofw_t ofw, const char *device)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -586,7 +586,7 @@ ofw_real_finddevice(ofw_t ofw, const cha
 static ssize_t
 ofw_real_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -619,7 +619,7 @@ ofw_real_instance_to_path(ofw_t ofw, iha
 static ssize_t
 ofw_real_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -653,7 +653,7 @@ static int
 ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, 
     int nargs, int nreturns, unsigned long *args_and_returns)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -701,7 +701,7 @@ ofw_real_call_method(ofw_t ofw, ihandle_
 static ihandle_t
 ofw_real_open(ofw_t ofw, const char *device)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -729,7 +729,7 @@ ofw_real_open(ofw_t ofw, const char *dev
 static void
 ofw_real_close(ofw_t ofw, ihandle_t instance)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -747,7 +747,7 @@ ofw_real_close(ofw_t ofw, ihandle_t inst
 static ssize_t
 ofw_real_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -780,7 +780,7 @@ ofw_real_read(ofw_t ofw, ihandle_t insta
 static ssize_t
 ofw_real_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -811,7 +811,7 @@ ofw_real_write(ofw_t ofw, ihandle_t inst
 static int
 ofw_real_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -841,7 +841,7 @@ ofw_real_seek(ofw_t ofw, ihandle_t insta
 static caddr_t
 ofw_real_claim(ofw_t ofw, void *virt, size_t size, u_int align)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -867,7 +867,7 @@ ofw_real_claim(ofw_t ofw, void *virt, si
 static void
 ofw_real_release(ofw_t ofw, void *virt, size_t size)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -891,7 +891,7 @@ ofw_real_release(ofw_t ofw, void *virt, 
 static void
 ofw_real_enter(ofw_t ofw)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;
@@ -907,7 +907,7 @@ ofw_real_enter(ofw_t ofw)
 static void
 ofw_real_exit(ofw_t ofw)
 {
-	static struct {
+	struct {
 		cell_t name;
 		cell_t nargs;
 		cell_t nreturns;

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 01:11:10 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77ACA106566C;
	Tue, 23 Mar 2010 01:11:10 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 663438FC14;
	Tue, 23 Mar 2010 01:11:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N1BA0f096614;
	Tue, 23 Mar 2010 01:11:10 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N1BAQB096612;
	Tue, 23 Mar 2010 01:11:10 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003230111.o2N1BAQB096612@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 23 Mar 2010 01:11:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205497 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 01:11:10 -0000

Author: nwhitehorn
Date: Tue Mar 23 01:11:10 2010
New Revision: 205497
URL: http://svn.freebsd.org/changeset/base/205497

Log:
  Open Firmware on powerpc is generally non-reetrant, so serialize all
  OF calls with a mutex.

Modified:
  head/sys/powerpc/aim/ofw_machdep.c

Modified: head/sys/powerpc/aim/ofw_machdep.c
==============================================================================
--- head/sys/powerpc/aim/ofw_machdep.c	Tue Mar 23 01:09:45 2010	(r205496)
+++ head/sys/powerpc/aim/ofw_machdep.c	Tue Mar 23 01:11:10 2010	(r205497)
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
 static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3];
 static struct mem_region OFfree[OFMEM_REGIONS + 3];
 
+static struct mtx ofw_mutex;
+
 struct mem_region64 {
         vm_offset_t     mr_start_hi;
         vm_offset_t     mr_start_lo;
@@ -281,6 +283,8 @@ OF_bootstrap()
 {
 	boolean_t status = FALSE;
 
+	mtx_init(&ofw_mutex, "open firmware", NULL, MTX_DEF);
+
 	if (ofwcall != NULL) {
 		if (ofw_real_mode)
 			status = OF_install(OFW_STD_REAL, 0);
@@ -314,6 +318,8 @@ openfirmware(void *args)
 	if (pmap_bootstrapped && ofw_real_mode)
 		args = (void *)pmap_kextract((vm_offset_t)args);
 
+	mtx_lock(&ofw_mutex);
+
 	__asm __volatile(	"\t"
 		"sync\n\t"
 		"mfmsr  %0\n\t"
@@ -366,6 +372,8 @@ openfirmware(void *args)
 		: : "r" (oldmsr)
 	);
 
+	mtx_unlock(&ofw_mutex);
+
 	return (result);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 01:36:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A28221065673;
	Tue, 23 Mar 2010 01:36:50 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 907428FC17;
	Tue, 23 Mar 2010 01:36:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N1ao0a004869;
	Tue, 23 Mar 2010 01:36:50 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N1aoO1004865;
	Tue, 23 Mar 2010 01:36:50 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201003230136.o2N1aoO1004865@svn.freebsd.org>
From: Randall Stewart 
Date: Tue, 23 Mar 2010 01:36:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205502 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 01:36:50 -0000

Author: rrs
Date: Tue Mar 23 01:36:50 2010
New Revision: 205502
URL: http://svn.freebsd.org/changeset/base/205502

Log:
  Fixes a bug where SACKs in the face of
  mapping_array expansion would break. Basically
  once we expanded the array we no longer had both
  mapping arrays in sync which the sack processing code depends on.
  This would mean we were randomly referring to memory that was probably
  not there. This mostly just gave us bad sack results going back to the peer.
  If INVARIENTS was on of course we would hit the panic routine in the sack_check
  call.
  
  We also add a print routine for the place where one would panic in
  invarients so one can see what the main mapping array holds.
  
  Reviewed by: tuexen@freebsd.org
  MFC after:	2 weeks

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctputil.c
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Tue Mar 23 01:35:46 2010	(r205501)
+++ head/sys/netinet/sctp_indata.c	Tue Mar 23 01:36:50 2010	(r205502)
@@ -2540,15 +2540,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 	/* int nr_at; */
 	/* int nr_last_all_ones = 0; */
 	/* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */
-
 	uint32_t old_cumack, old_base, old_highest;
-	unsigned char aux_array[64];
-
-	/*
-	 * EY! Don't think this is required but I am immitating the code for
-	 * map just to make sure
-	 */
-	unsigned char nr_aux_array[64];
 
 	asoc = &stcb->asoc;
 	at = 0;
@@ -2556,33 +2548,6 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 	old_cumack = asoc->cumulative_tsn;
 	old_base = asoc->mapping_array_base_tsn;
 	old_highest = asoc->highest_tsn_inside_map;
-	if (asoc->mapping_array_size < 64)
-		memcpy(aux_array, asoc->mapping_array,
-		    asoc->mapping_array_size);
-	else
-		memcpy(aux_array, asoc->mapping_array, 64);
-	/* EY do the same for nr_mapping_array */
-	if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) {
-		if (asoc->nr_mapping_array_size != asoc->mapping_array_size) {
-			/*
-			 * printf("\nEY-IN sack_check method: \nEY-" "The
-			 * size of map and nr_map are inconsitent")
-			 */ ;
-		}
-		if (asoc->nr_mapping_array_base_tsn != asoc->mapping_array_base_tsn) {
-			/*
-			 * printf("\nEY-IN sack_check method VERY CRUCIAL
-			 * error: \nEY-" "The base tsns of map and nr_map
-			 * are inconsitent")
-			 */ ;
-		}
-		/* EY! just immitating the above code */
-		if (asoc->nr_mapping_array_size < 64)
-			memcpy(nr_aux_array, asoc->nr_mapping_array,
-			    asoc->nr_mapping_array_size);
-		else
-			memcpy(aux_array, asoc->nr_mapping_array, 64);
-	}
 	/*
 	 * We could probably improve this a small bit by calculating the
 	 * offset of the current cum-ack as the starting point.
@@ -2618,6 +2583,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 #else
 		SCTP_PRINTF("huh, cumack 0x%x greater than high-tsn 0x%x in map - should panic?\n",
 		    asoc->cumulative_tsn, asoc->highest_tsn_inside_map);
+		sctp_print_mapping_array(asoc);
 		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
 			sctp_log_map(0, 6, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
 		}

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Tue Mar 23 01:35:46 2010	(r205501)
+++ head/sys/netinet/sctputil.c	Tue Mar 23 01:36:50 2010	(r205502)
@@ -1180,6 +1180,25 @@ sctp_init_asoc(struct sctp_inpcb *m, str
 	return (0);
 }
 
+void
+sctp_print_mapping_array(struct sctp_association *asoc)
+{
+	int i;
+
+	printf("Mapping size:%d baseTSN:%8.8x cumAck:%8.8x highestTSN:%8.8x\n",
+	    asoc->mapping_array_size,
+	    asoc->mapping_array_base_tsn,
+	    asoc->cumulative_tsn,
+	    asoc->highest_tsn_inside_map
+	    );
+	for (i = 0; i < asoc->mapping_array_size; i++) {
+		printf("%8.8x ", asoc->mapping_array[i]);
+		if (((i + 1) % 8) == 0)
+			printf("\n");
+	}
+	printf("\n");
+}
+
 int
 sctp_expand_mapping_array(struct sctp_association *asoc, uint32_t needed)
 {
@@ -1187,7 +1206,9 @@ sctp_expand_mapping_array(struct sctp_as
 	uint8_t *new_array;
 	uint32_t new_size;
 
+
 	new_size = asoc->mapping_array_size + ((needed + 7) / 8 + SCTP_MAPPING_ARRAY_INCR);
+
 	SCTP_MALLOC(new_array, uint8_t *, new_size, SCTP_M_MAP);
 	if (new_array == NULL) {
 		/* can't get more, forget it */
@@ -1200,21 +1221,19 @@ sctp_expand_mapping_array(struct sctp_as
 	SCTP_FREE(asoc->mapping_array, SCTP_M_MAP);
 	asoc->mapping_array = new_array;
 	asoc->mapping_array_size = new_size;
-	if (asoc->peer_supports_nr_sack) {
-		new_size = asoc->nr_mapping_array_size + ((needed + 7) / 8 + SCTP_NR_MAPPING_ARRAY_INCR);
-		SCTP_MALLOC(new_array, uint8_t *, new_size, SCTP_M_MAP);
-		if (new_array == NULL) {
-			/* can't get more, forget it */
-			SCTP_PRINTF("No memory for expansion of SCTP mapping array %d\n",
-			    new_size);
-			return (-1);
-		}
-		memset(new_array, 0, new_size);
-		memcpy(new_array, asoc->nr_mapping_array, asoc->nr_mapping_array_size);
-		SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP);
-		asoc->nr_mapping_array = new_array;
-		asoc->nr_mapping_array_size = new_size;
+	new_size = asoc->nr_mapping_array_size + ((needed + 7) / 8 + SCTP_NR_MAPPING_ARRAY_INCR);
+	SCTP_MALLOC(new_array, uint8_t *, new_size, SCTP_M_MAP);
+	if (new_array == NULL) {
+		/* can't get more, forget it */
+		SCTP_PRINTF("No memory for expansion of SCTP mapping array %d\n",
+		    new_size);
+		return (-1);
 	}
+	memset(new_array, 0, new_size);
+	memcpy(new_array, asoc->nr_mapping_array, asoc->nr_mapping_array_size);
+	SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP);
+	asoc->nr_mapping_array = new_array;
+	asoc->nr_mapping_array_size = new_size;
 	return (0);
 }
 

Modified: head/sys/netinet/sctputil.h
==============================================================================
--- head/sys/netinet/sctputil.h	Tue Mar 23 01:35:46 2010	(r205501)
+++ head/sys/netinet/sctputil.h	Tue Mar 23 01:36:50 2010	(r205502)
@@ -376,7 +376,7 @@ int sctp_fill_stat_log(void *, size_t *)
 void sctp_log_fr(uint32_t, uint32_t, uint32_t, int);
 void sctp_log_sack(uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, int);
 void sctp_log_map(uint32_t, uint32_t, uint32_t, int);
-
+void sctp_print_mapping_array(struct sctp_association *asoc);
 void sctp_clr_stat_log(void);
 
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 03:14:44 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2CC21065670;
	Tue, 23 Mar 2010 03:14:44 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F4C98FC17;
	Tue, 23 Mar 2010 03:14:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N3EiLl035539;
	Tue, 23 Mar 2010 03:14:44 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N3Ei11035533;
	Tue, 23 Mar 2010 03:14:44 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003230314.o2N3Ei11035533@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 23 Mar 2010 03:14:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205506 - in head/sys/powerpc: aim powermac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 03:14:44 -0000

Author: nwhitehorn
Date: Tue Mar 23 03:14:44 2010
New Revision: 205506
URL: http://svn.freebsd.org/changeset/base/205506

Log:
  Get nexus(4) out of the RTC business. The interface used by nexus(4)
  in Open Firmware was Apple-specific, and we have complete coverage of Apple
  system controllers, so move RTC responsibilities into the system controller
  drivers. This avoids interesting problems from manipulating these devices
  through Open Firmware behind the backs of their drivers.
  
  Obtained from:	NetBSD
  MFC after:	2 weeks

Modified:
  head/sys/powerpc/aim/nexus.c
  head/sys/powerpc/powermac/cuda.c
  head/sys/powerpc/powermac/cudavar.h
  head/sys/powerpc/powermac/pmu.c
  head/sys/powerpc/powermac/smu.c

Modified: head/sys/powerpc/aim/nexus.c
==============================================================================
--- head/sys/powerpc/aim/nexus.c	Tue Mar 23 02:18:12 2010	(r205505)
+++ head/sys/powerpc/aim/nexus.c	Tue Mar 23 03:14:44 2010	(r205506)
@@ -60,7 +60,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -74,7 +73,6 @@
 
 #include 
 
-#include "clock_if.h"
 #include "ofw_bus_if.h"
 #include "pic_if.h"
 
@@ -143,12 +141,6 @@ static const char	*nexus_ofw_get_type(de
 static const char	*nexus_ofw_get_compat(device_t, device_t);
 
 /*
- * Clock interface.
- */
-static int nexus_gettime(device_t, struct timespec *);
-static int nexus_settime(device_t, struct timespec *);
-
-/*
  * Local routines
  */
 static device_t	nexus_device_from_node(device_t, phandle_t);
@@ -181,10 +173,6 @@ static device_method_t nexus_methods[] =
 	DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type),
 	DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat),
 
-	/* Clock interface */
-	DEVMETHOD(clock_gettime,	nexus_gettime),
-	DEVMETHOD(clock_settime,	nexus_settime),
-
 	{ 0, 0 }
 };
 
@@ -240,7 +228,6 @@ nexus_attach(device_t dev)
 
 	}
 
-	clock_register(dev, 1000);
 	return (bus_generic_attach(dev));
 }
 
@@ -512,50 +499,3 @@ nexus_ofw_get_compat(device_t bus, devic
 	return (dinfo->ndi_compatible);
 }
 
-#define	DIFF19041970	2082844800
-
-static int
-nexus_gettime(device_t dev, struct timespec *ts)
-{
-	char path[128];
-	ihandle_t ih;
-	phandle_t ph;
-	u_int rtc;
-
-	ph = OF_finddevice("rtc");
-	if (ph == -1)
-		return (ENOENT);
-
-	OF_package_to_path(ph, path, sizeof(path));
-	ih = OF_open(path);
-	if (ih == -1)
-		return (ENXIO);
-
-	if (OF_call_method("read-rtc", ih, 0, 1, &rtc))
-		return (EIO);
-
-	ts->tv_sec = rtc - DIFF19041970;
-	ts->tv_nsec = 0;
-	return (0);
-}
-
-static int
-nexus_settime(device_t dev, struct timespec *ts)
-{
-	char path[128];
-	ihandle_t ih;
-	phandle_t ph;     
-	u_int rtc;
-
-	ph = OF_finddevice("rtc");     
-	if (ph == -1)     
-		return (ENOENT);
-
-	OF_package_to_path(ph, path, sizeof(path));                   
-	ih = OF_open(path);
-	if (ih == -1)
-		return (ENXIO);
-
-	rtc = ts->tv_sec + DIFF19041970;
-	return ((OF_call_method("write-rtc", ih, 1, 0, rtc) != 0) ? EIO : 0);
-}

Modified: head/sys/powerpc/powermac/cuda.c
==============================================================================
--- head/sys/powerpc/powermac/cuda.c	Tue Mar 23 02:18:12 2010	(r205505)
+++ head/sys/powerpc/powermac/cuda.c	Tue Mar 23 03:14:44 2010	(r205506)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include "clock_if.h"
 #include "cudavar.h"
 #include "viareg.h"
 
@@ -72,6 +74,12 @@ static u_int	cuda_poll(device_t dev);
 static void	cuda_send_inbound(struct cuda_softc *sc);
 static void	cuda_send_outbound(struct cuda_softc *sc);
 
+/*
+ * Clock interface
+ */
+static int cuda_gettime(device_t dev, struct timespec *ts);
+static int cuda_settime(device_t dev, struct timespec *ts);
+
 static device_method_t  cuda_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		cuda_probe),
@@ -90,6 +98,10 @@ static device_method_t  cuda_methods[] =
 	DEVMETHOD(adb_hb_controller_poll,	cuda_poll),
 	DEVMETHOD(adb_hb_set_autopoll_mask,	cuda_adb_autopoll),
 
+	/* Clock interface */
+	DEVMETHOD(clock_gettime,	cuda_gettime),
+	DEVMETHOD(clock_settime,	cuda_settime),
+
 	{ 0, 0 },
 };
 
@@ -173,6 +185,7 @@ cuda_attach(device_t dev)
 	sc->sc_polling = 0;
 	sc->sc_state = CUDA_NOTREADY;
 	sc->sc_autopoll = 0;
+	sc->sc_rtc = -1;
 
 	STAILQ_INIT(&sc->sc_inq);
 	STAILQ_INIT(&sc->sc_outq);
@@ -236,6 +249,8 @@ cuda_attach(device_t dev)
 		}
 	}
 
+	clock_register(dev, 1000);
+
 	return (bus_generic_attach(dev));
 }
 
@@ -444,8 +459,18 @@ cuda_send_inbound(struct cuda_softc *sc)
 			break;
 		   case CUDA_PSEUDO:
 			mtx_lock(&sc->sc_mutex);
-			if (pkt->data[0] == CMD_AUTOPOLL)
+			switch (pkt->data[1]) {
+			case CMD_AUTOPOLL:
 				sc->sc_autopoll = 1;
+				break;
+			case CMD_READ_RTC:
+				memcpy(&sc->sc_rtc, &pkt->data[2],
+				    sizeof(sc->sc_rtc));
+				wakeup(&sc->sc_rtc);
+				break;
+			case CMD_WRITE_RTC:
+				break;
+			}
 			mtx_unlock(&sc->sc_mutex);
 			break;
 		   case CUDA_ERROR:
@@ -715,3 +740,41 @@ cuda_adb_autopoll(device_t dev, uint16_t
 	return (0);
 }
 
+#define DIFF19041970	2082844800
+
+static int
+cuda_gettime(device_t dev, struct timespec *ts)
+{
+	struct cuda_softc *sc = device_get_softc(dev);
+	uint8_t cmd[] = {CUDA_PSEUDO, CMD_READ_RTC};
+
+	mtx_lock(&sc->sc_mutex);
+	sc->sc_rtc = -1;
+	cuda_send(sc, 1, 2, cmd);
+	if (sc->sc_rtc == -1)
+		mtx_sleep(&sc->sc_rtc, &sc->sc_mutex, 0, "rtc", 100);
+
+	ts->tv_sec = sc->sc_rtc - DIFF19041970;
+	ts->tv_nsec = 0;
+	mtx_unlock(&sc->sc_mutex);
+
+	return (0);
+}
+
+static int
+cuda_settime(device_t dev, struct timespec *ts)
+{
+	struct cuda_softc *sc = device_get_softc(dev);
+	uint8_t cmd[] = {CUDA_PSEUDO, CMD_WRITE_RTC, 0, 0, 0, 0};
+	uint32_t sec;
+
+	sec = ts->tv_sec + DIFF19041970;
+	memcpy(&cmd[2], &sec, sizeof(sec));
+
+	mtx_lock(&sc->sc_mutex);
+	cuda_send(sc, 0, 6, cmd);
+	mtx_unlock(&sc->sc_mutex);
+
+	return (0);
+}
+

Modified: head/sys/powerpc/powermac/cudavar.h
==============================================================================
--- head/sys/powerpc/powermac/cudavar.h	Tue Mar 23 02:18:12 2010	(r205505)
+++ head/sys/powerpc/powermac/cudavar.h	Tue Mar 23 03:14:44 2010	(r205506)
@@ -90,6 +90,7 @@ struct cuda_softc {
 	int		sc_polling;
 	int		sc_iic_done;
 	volatile int	sc_autopoll;
+	uint32_t	sc_rtc;
 
 	int sc_i2c_read_len;
 

Modified: head/sys/powerpc/powermac/pmu.c
==============================================================================
--- head/sys/powerpc/powermac/pmu.c	Tue Mar 23 02:18:12 2010	(r205505)
+++ head/sys/powerpc/powermac/pmu.c	Tue Mar 23 03:14:44 2010	(r205506)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -55,16 +56,27 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include "clock_if.h"
 #include "pmuvar.h"
 #include "viareg.h"
 
 /*
- * MacIO interface
+ * Bus interface
  */
 static int	pmu_probe(device_t);
 static int	pmu_attach(device_t);
 static int	pmu_detach(device_t);
 
+/*
+ * Clock interface
+ */
+static int	pmu_gettime(device_t dev, struct timespec *ts);
+static int	pmu_settime(device_t dev, struct timespec *ts);
+
+/*
+ * ADB Interface
+ */
+
 static u_int	pmu_adb_send(device_t dev, u_char command_byte, int len, 
 		    u_char *data, u_char poll);
 static u_int	pmu_adb_autopoll(device_t dev, uint16_t mask);
@@ -110,6 +122,10 @@ static device_method_t  pmu_methods[] = 
 	DEVMETHOD(adb_hb_controller_poll,   pmu_poll),
 	DEVMETHOD(adb_hb_set_autopoll_mask, pmu_adb_autopoll),
 
+	/* Clock interface */
+	DEVMETHOD(clock_gettime,	pmu_gettime),
+	DEVMETHOD(clock_settime,	pmu_settime),
+
 	{ 0, 0 },
 };
 
@@ -453,6 +469,12 @@ pmu_attach(device_t dev)
 
 	sc->sc_leddev = led_create(pmu_set_sleepled, sc, "sleepled");
 
+	/*
+	 * Register RTC
+	 */
+
+	clock_register(dev, 1000);
+
 	return (bus_generic_attach(dev));
 }
 
@@ -926,3 +948,38 @@ pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS
 	return (error);
 }
 
+#define DIFF19041970	2082844800
+
+static int
+pmu_gettime(device_t dev, struct timespec *ts)
+{
+	struct pmu_softc *sc = device_get_softc(dev);
+	uint8_t resp[16];
+	uint32_t sec;
+
+	mtx_lock(&sc->sc_mutex);
+	pmu_send(sc, PMU_READ_RTC, 0, NULL, 16, resp);
+	mtx_unlock(&sc->sc_mutex);
+
+	memcpy(&sec, &resp[1], 4);
+	ts->tv_sec = sec - DIFF19041970;
+	ts->tv_nsec = 0;
+
+	return (0);
+}
+
+static int
+pmu_settime(device_t dev, struct timespec *ts)
+{
+	struct pmu_softc *sc = device_get_softc(dev);
+	uint32_t sec;
+
+	sec = ts->tv_sec + DIFF19041970;
+
+	mtx_lock(&sc->sc_mutex);
+	pmu_send(sc, PMU_SET_RTC, sizeof(sec), (uint8_t *)&sec, 0, NULL);
+	mtx_unlock(&sc->sc_mutex);
+
+	return (0);
+}
+

Modified: head/sys/powerpc/powermac/smu.c
==============================================================================
--- head/sys/powerpc/powermac/smu.c	Tue Mar 23 02:18:12 2010	(r205505)
+++ head/sys/powerpc/powermac/smu.c	Tue Mar 23 03:14:44 2010	(r205506)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,6 +52,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "clock_if.h"
+
 struct smu_cmd {
 	volatile uint8_t cmd;
 	uint8_t		len;
@@ -140,6 +143,10 @@ static int	smu_attach(device_t);
 static void	smu_cpufreq_pre_change(device_t, const struct cf_level *level);
 static void	smu_cpufreq_post_change(device_t, const struct cf_level *level);
 
+/* clock interface */
+static int	smu_gettime(device_t dev, struct timespec *ts);
+static int	smu_settime(device_t dev, struct timespec *ts);
+
 /* utility functions */
 static int	smu_run_cmd(device_t dev, struct smu_cmd *cmd, int wait);
 static int	smu_get_datablock(device_t dev, int8_t id, uint8_t *buf,
@@ -160,6 +167,10 @@ static device_method_t  smu_methods[] = 
 	/* Device interface */
 	DEVMETHOD(device_probe,		smu_probe),
 	DEVMETHOD(device_attach,	smu_attach),
+
+	/* Clock interface */
+	DEVMETHOD(clock_gettime,	smu_gettime),
+	DEVMETHOD(clock_settime,	smu_settime),
 	{ 0, 0 },
 };
 
@@ -192,6 +203,9 @@ MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor 
 #define  SMU_PWR_GET_POWERUP	0x00
 #define  SMU_PWR_SET_POWERUP	0x01
 #define  SMU_PWR_CLR_POWERUP	0x02
+#define SMU_RTC			0x8e
+#define  SMU_RTC_GET		0x81
+#define  SMU_RTC_SET		0x80
 
 /* Power event types */
 #define SMU_WAKEUP_KEYPRESS	0x01
@@ -349,6 +363,11 @@ smu_attach(device_t dev)
 	powerpc_config_intr(rman_get_start(sc->sc_doorbellirq),
 	    INTR_TRIGGER_EDGE, INTR_POLARITY_LOW);
 
+	/*
+	 * Connect RTC interface.
+	 */
+	clock_register(dev, 1000);
+
 	return (0);
 }
 
@@ -1043,3 +1062,51 @@ smu_server_mode(SYSCTL_HANDLER_ARGS)
 	return (smu_run_cmd(smu, &cmd, 1));
 }
 
+static int
+smu_gettime(device_t dev, struct timespec *ts)
+{
+	struct smu_cmd cmd;
+	struct clocktime ct;
+
+	cmd.cmd = SMU_RTC;
+	cmd.len = 1;
+	cmd.data[0] = SMU_RTC_GET;
+
+	if (smu_run_cmd(dev, &cmd, 1) != 0)
+		return (ENXIO);
+
+	ct.nsec	= 0;
+	ct.sec	= bcd2bin(cmd.data[0]);
+	ct.min	= bcd2bin(cmd.data[1]);
+	ct.hour	= bcd2bin(cmd.data[2]);
+	ct.dow	= bcd2bin(cmd.data[3]);
+	ct.day	= bcd2bin(cmd.data[4]);
+	ct.mon	= bcd2bin(cmd.data[5]);
+	ct.year	= bcd2bin(cmd.data[6]) + 2000;
+
+	return (clock_ct_to_ts(&ct, ts));
+}
+
+static int
+smu_settime(device_t dev, struct timespec *ts)
+{
+	struct smu_cmd cmd;
+	struct clocktime ct;
+
+	cmd.cmd = SMU_RTC;
+	cmd.len = 8;
+	cmd.data[0] = SMU_RTC_SET;
+
+	clock_ts_to_ct(ts, &ct);
+
+	cmd.data[1] = bin2bcd(ct.sec);
+	cmd.data[2] = bin2bcd(ct.min);
+	cmd.data[3] = bin2bcd(ct.hour);
+	cmd.data[4] = bin2bcd(ct.dow);
+	cmd.data[5] = bin2bcd(ct.day);
+	cmd.data[6] = bin2bcd(ct.mon);
+	cmd.data[7] = bin2bcd(ct.year - 2000);
+
+	return (smu_run_cmd(dev, &cmd, 1));
+}
+

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 06:19:44 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D0DA106564A;
	Tue, 23 Mar 2010 06:19:44 +0000 (UTC)
	(envelope-from joerg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 482AB8FC1A;
	Tue, 23 Mar 2010 06:19:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2N6JiET088994;
	Tue, 23 Mar 2010 06:19:44 GMT (envelope-from joerg@svn.freebsd.org)
Received: (from joerg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2N6Ji7h088992;
	Tue, 23 Mar 2010 06:19:44 GMT (envelope-from joerg@svn.freebsd.org)
Message-Id: <201003230619.o2N6Ji7h088992@svn.freebsd.org>
From: Joerg Wunsch 
Date: Tue, 23 Mar 2010 06:19:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205509 - head/etc/defaults
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 06:19:44 -0000

Author: joerg
Date: Tue Mar 23 06:19:44 2010
New Revision: 205509
URL: http://svn.freebsd.org/changeset/base/205509

Log:
  Add .snap to daily_clean_tmps_ignore; /tmp/.snap ist not supposed to
  be auto-removed (and /tmp is a filesystem of its own now by default).
  
  MFC after:	3 days

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==============================================================================
--- head/etc/defaults/periodic.conf	Tue Mar 23 04:07:49 2010	(r205508)
+++ head/etc/defaults/periodic.conf	Tue Mar 23 06:19:44 2010	(r205509)
@@ -46,7 +46,7 @@ daily_clean_tmps_enable="NO"				# Delete
 daily_clean_tmps_dirs="/tmp"				# Delete under here
 daily_clean_tmps_days="3"				# If not accessed for
 daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
-daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group"
+daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group .snap"
 							# Don't delete these
 daily_clean_tmps_verbose="YES"				# Mention files deleted
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 06:34:00 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD9F31065674;
	Tue, 23 Mar 2010 06:34:00 +0000 (UTC)
	(envelope-from yanefbsd@gmail.com)
Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com
	[74.125.83.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F1EC8FC1A;
	Tue, 23 Mar 2010 06:34:00 +0000 (UTC)
Received: by pvc7 with SMTP id 7so1938681pvc.13
	for ; Mon, 22 Mar 2010 23:33:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=65v4HA2CCArJEsyAtQqw0fv1yahWiC7sNrg7l5UeiMc=;
	b=sfsgkkgZwZ8MA2bdjY7KfXdsFpNVAYefOBORYZ5U4bo7LkbnGmekGy/tp9dGBi9SRF
	agHdj+gWrJpYLF4929x+tLEyftUmQi6YQPqFtU/7nFU1EQGCy//1uEo7DX5m8g7uY5L9
	SB2w4lHhTF2KtV3IA5l5oJ3Ya/2mUb3+Q7byI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=C/11TgMC70+S6TEFgUrK1MfWa+TZ7dsHt4JJXiWZMC6bL2hl2PGn+TX7xTmgTulxvz
	hB3ZEIWAMOgItBY4qV/PAQC5kWcKQYfKlcPakiWJvF7yAn6J8j1653rwpsiOU5mpgYhT
	yRpSzqNRsqt/X3tCK46PPV+lX17iJ9Nve4zNc=
MIME-Version: 1.0
Received: by 10.114.250.39 with SMTP id x39mr7074822wah.179.1269326039696; 
	Mon, 22 Mar 2010 23:33:59 -0700 (PDT)
In-Reply-To: <201003230619.o2N6Ji7h088992@svn.freebsd.org>
References: <201003230619.o2N6Ji7h088992@svn.freebsd.org>
Date: Mon, 22 Mar 2010 23:33:59 -0700
Message-ID: <7d6fde3d1003222333q786310c7v3d4e1eb5be1138ee@mail.gmail.com>
From: Garrett Cooper 
To: Joerg Wunsch 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205509 - head/etc/defaults
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 06:34:00 -0000

On Mon, Mar 22, 2010 at 11:19 PM, Joerg Wunsch  wrote:
> Author: joerg
> Date: Tue Mar 23 06:19:44 2010
> New Revision: 205509
> URL: http://svn.freebsd.org/changeset/base/205509
>
> Log:
> =A0Add .snap to daily_clean_tmps_ignore; /tmp/.snap ist not supposed to
> =A0be auto-removed (and /tmp is a filesystem of its own now by default).
>
> =A0MFC after: =A0 =A03 days
>
> Modified:
> =A0head/etc/defaults/periodic.conf
>
> Modified: head/etc/defaults/periodic.conf
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/etc/defaults/periodic.conf =A0 =A0 Tue Mar 23 04:07:49 2010 =A0 =
=A0 =A0 =A0(r205508)
> +++ head/etc/defaults/periodic.conf =A0 =A0 Tue Mar 23 06:19:44 2010 =A0 =
=A0 =A0 =A0(r205509)
> @@ -46,7 +46,7 @@ daily_clean_tmps_enable=3D"NO" =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0# Delete
> =A0daily_clean_tmps_dirs=3D"/tmp" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 # Delete under here
> =A0daily_clean_tmps_days=3D"3" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0# If not accessed for
> =A0daily_clean_tmps_ignore=3D".X*-lock .X11-unix .ICE-unix .font-unix .XI=
M-unix"
> -daily_clean_tmps_ignore=3D"$daily_clean_tmps_ignore quota.user quota.gro=
up"
> +daily_clean_tmps_ignore=3D"$daily_clean_tmps_ignore quota.user quota.gro=
up .snap"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Don't delete these
> =A0daily_clean_tmps_verbose=3D"YES" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 # Mention files deleted

Good catch.. thanks!
-Garrett

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 09:57:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E550106564A;
	Tue, 23 Mar 2010 09:57:51 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 72DC28FC08;
	Tue, 23 Mar 2010 09:57:50 +0000 (UTC)
Received: by wwf26 with SMTP id 26so748193wwf.13
	for ; Tue, 23 Mar 2010 02:57:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:from:date:x-google-sender-auth:message-id:subject:to:cc
	:content-type:content-transfer-encoding;
	bh=zDQSOufpZGo5SO7Hao4WGXVmJWaV3A2x9TqWqeTij/w=;
	b=mMU2P1bUW5hIObiX+OsqYOogH3Ff7NOwrJGWOhCDZzGXSEp8pN7a5TVj8ZdtJ3M9oM
	vZIzor0nMehx9iN5N/28/P2M9n9Wq0ucelJmAIE/0L0ry3p8MgboWk8SvZIRNW4rqPh0
	EK91MBlu6PMlUNbM2adgvUmGBA0VU4cOfpT30=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=TupaDBAnvUT6tEKWHk15wFD646l3BFJuYY2DFUAJ8IepYqzdhAZYqVyJu7E7aa+6r/
	IZgijLB3q/s7DdWbQIlwd28X50qTN8odsqM2qA97DEHcw9y3LXCw8BJnr9snm54sAhlx
	JEfl5bgHp6OxzlhBqULQ/kCU/6hPzertaAYBs=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.216.88.202 with SMTP id a52mr3209729wef.101.1269338269309; 
	Tue, 23 Mar 2010 02:57:49 -0700 (PDT)
In-Reply-To: <201003222239.o2MMdWZi061585@svn.freebsd.org>
References: <201003222239.o2MMdWZi061585@svn.freebsd.org>
From: Ivan Voras 
Date: Tue, 23 Mar 2010 10:57:29 +0100
X-Google-Sender-Auth: 7b14ed5cdbb3bfdb
Message-ID: <9bbcef731003230257n17fa2b28i68da4bd2f01abb5c@mail.gmail.com>
To: Kip Macy 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205487 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 09:57:51 -0000

On 22 March 2010 23:39, Kip Macy  wrote:
> Author: kmacy
> Date: Mon Mar 22 22:39:32 2010
> New Revision: 205487
> URL: http://svn.freebsd.org/changeset/base/205487
>
> Log:
> =C2=A0- enable alignment on amd64 only

Does this mean you have determined that aligning these structures is
not as beneficial on i386 or is there something else going on?

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 10:33:53 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F93D1065676;
	Tue, 23 Mar 2010 10:33:53 +0000 (UTC)
	(envelope-from kmatthew.macy@gmail.com)
Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com
	[209.85.221.172])
	by mx1.freebsd.org (Postfix) with ESMTP id DBA418FC19;
	Tue, 23 Mar 2010 10:33:52 +0000 (UTC)
Received: by qyk2 with SMTP id 2so1952266qyk.14
	for ; Tue, 23 Mar 2010 03:33:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:reply-to:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=/hgAr4adxn1WIfK85+daHFuj6LiQwTM5pPbqK9taqIA=;
	b=SdncmTJ83zzGR50uOI1BODfYF0zfb2f2Mc7c8O/dN47SqcwBNskx0rN4nndlPNa9Nl
	KLe6V/5ddAmwiAIgNpABisdMspX1BM4zheZN1igqZ8Bi39oUlh0t35s1OyP//qBAmo7g
	zaPCuq6KllXGsl4zAc16vpEW3f5tUQKK6AqLE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:reply-to:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=I8wFUF+zCAYUlUFBGc94MGA7mz+OqFMD8mjQCB8BlHdV8uoDHsSlHw/HiJPyFGWmn7
	DndFa2gjhkBlYcXjdxWDov2fQQZDc/OJIoo22alPkpf37I1YvgivCbTZllHG+/AMPul6
	W2Humi+bfNC84CWlfQ8XCGeiHXH4Exyj0MNqg=
MIME-Version: 1.0
Sender: kmatthew.macy@gmail.com
Received: by 10.229.184.195 with SMTP id cl3mr1630642qcb.106.1269340431970; 
	Tue, 23 Mar 2010 03:33:51 -0700 (PDT)
In-Reply-To: <9bbcef731003230257n17fa2b28i68da4bd2f01abb5c@mail.gmail.com>
References: <201003222239.o2MMdWZi061585@svn.freebsd.org>
	<9bbcef731003230257n17fa2b28i68da4bd2f01abb5c@mail.gmail.com>
Date: Tue, 23 Mar 2010 03:33:51 -0700
X-Google-Sender-Auth: 7b5a2e13267104da
Message-ID: <82c4140e1003230333p40ad6d6es1f1e08da4148fab3@mail.gmail.com>
From: "K. Macy" 
To: Ivan Voras 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Kip Macy 
Subject: Re: svn commit: r205487 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: kmacy@freebsd.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 10:33:53 -0000

The size change causes the initialization path to change in a way that
currently causes crashes.

On Mar 23, 2010 2:57 AM, "Ivan Voras"  wrote:

On 22 March 2010 23:39, Kip Macy  wrote:
> Author: kmacy
> Date: Mon Mar 22 22:39...
Does this mean you have determined that aligning these structures is
not as beneficial on i386 or is there something else going on?

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 11:33:08 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C101D106564A;
	Tue, 23 Mar 2010 11:33:08 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B0EF48FC12;
	Tue, 23 Mar 2010 11:33:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NBX8Qs059156;
	Tue, 23 Mar 2010 11:33:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NBX8rF059155;
	Tue, 23 Mar 2010 11:33:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003231133.o2NBX8rF059155@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 23 Mar 2010 11:33:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205512 - head/lib/libpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 11:33:08 -0000

Author: rpaulo
Date: Tue Mar 23 11:33:08 2010
New Revision: 205512
URL: http://svn.freebsd.org/changeset/base/205512

Log:
  Finish the much belated Intel XScale hwpmc(4) man page.

Modified:
  head/lib/libpmc/pmc.xscale.3

Modified: head/lib/libpmc/pmc.xscale.3
==============================================================================
--- head/lib/libpmc/pmc.xscale.3	Tue Mar 23 09:58:59 2010	(r205511)
+++ head/lib/libpmc/pmc.xscale.3	Tue Mar 23 11:33:08 2010	(r205512)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009 Rui Paulo.  All rights reserved.
+.\" Copyright (c) 2009, 2010 Rui Paulo.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -9,7 +9,7 @@
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
 .\"
-.\" This software is provided by Joseph Koshy ``as is'' and
+.\" This software is provided by Rui Paulo ``as is'' and
 .\" any express or implied warranties, including, but not limited to, the
 .\" implied warranties of merchantability and fitness for a particular purpose
 .\" are disclaimed.  in no event shall Joseph Koshy be liable
@@ -37,3 +37,120 @@ family CPUs
 .Sh SYNOPSIS
 .In pmc.h
 .Sh DESCRIPTION
+.Tn Intel XScale
+CPUs are ARM CPUs based on the ARMv5e core.
+.Pp
+Second generation cores have 2 counters, while third generation cores
+have 4 counters.
+Third generation cores also have an increased number of PMC events.
+.Pp
+.Tn Intel XScale
+PMCs are documented in 
+.Rs
+.%B "3rd Generation Intel XScale Microarchitecture Developer's Manual"
+.%D May 2007
+.Re
+.Ss Event Specifiers (Programmable PMCs)
+.Tn Intel XScale
+programmable PMCs support the following events:
+.Bl -tag -width indent
+.It Li IC_FETCH
+External memory fetch due to L1 instruction cache miss.
+.It Li IC_MISS
+Instruction cache or TLB miss.
+.It Li DATA_DEPENDENCY_STALLED
+A data dependency stalled
+.It Li ITLB_MISS
+Instruction TLB miss.
+.It Li DTLB_MISS
+Data TLB miss.
+.It Li BRANCH_RETIRED
+Branch instruction retired (executed).
+.It Li BRANCH_MISPRED
+Branch mispredicted.
+.It Li INSTR_RETIRED
+Instructions retired (executed).
+.It Li DC_FULL_CYCLE
+L1 data cache buffer full stall.
+Event occurs on every cycle the
+condition is present.
+.It Li DC_FULL_CONTIG
+L1 data cache buffer full stall.
+Event occurs once for each contiguous sequence of this type of stall.
+.It Li DC_ACCESS
+L1 data cache access, not including cache operations.
+.It Li DC_MISS
+L1 data cache miss, not including cache operations.
+.It Li DC_WRITEBACK
+L1 data cache write-back.
+Occurs for each cache line that's written back from the cache.
+.It Li PC_CHANGE
+Software changed the program counter.
+.It Li BRANCH_RETIRED_ALL
+Branch instruction retired (executed).
+This event counts all branch instructions, indirect or direct.
+.It Li INSTR_CYCLE
+Count the number of microarchitecture cycles each instruction requires
+to issue.
+.It Li CP_STALL
+Coprocessor stalled the instruction pipeline.
+.It Li PC_CHANGE_ALL
+Software changed the program counter (includes exceptions).
+.It Li PIPELINE_FLUSH
+Pipeline flushes due to mispredictions or exceptions.
+.It Li BACKEND_STALL
+Backend stalled the instruction pipeline.
+.It Li MULTIPLIER_USE
+Multiplier used.
+.It Li MULTIPLIER_STALLED
+Multiplier stalled the instruction pipeline.
+.It Li DATA_CACHE_STALLED
+Data cache stalled the instruction pipeline.
+.It Li L2_CACHE_REQ
+L2 cache request, not inclusing cache operations.
+.It Li L2_CACHE_MISS
+L2 cache miss, not including cache operations.
+.It Li ADDRESS_BUS_TRANS
+Address bus transaction.
+.It Li SELF_ADDRESS_BUS_TRANS
+Self initiated address bus transaction.
+.It Li DATA_BUS_TRANS
+Data bus transaction.
+.El
+.Ss Event Name Aliases  
+The following table shows the mapping between the PMC-independent
+aliases supported by
+.Lb libpmc
+and the underlying hardware events used.
+.Bl -column "branch-mispredicts" "BRANCH_MISPRED"
+.It Em Alias Ta Em Event Ta
+.It Li branches Ta Li BRANCH_RETIRED Ta
+.It Li branch-mispredicts Ta Li BRANCH_MISPRED Ta
+.It Li dc-misses Ta Li DC_MISS Ta
+.It Li ic-misses Ta Li IC_MISS Ta
+.It Li instructions Ta Li INSTR_RETIRED Ta
+.El
+.Sh SEE ALSO
+.Xr pmc 3 ,
+.Xr pmc_cpuinfo 3 ,
+.Xr pmclog 3 ,
+.Xr hwpmc 4
+.Sh CAVEATS
+The Intel XScale code does not yet support sampling.
+.Sh HISTORY
+The
+.Nm pmc
+library first appeared in
+.Fx 6.0 .
+Intel XScale support first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Lb libpmc
+library was written by
+.An "Joseph Koshy"
+.Aq jkoshy@FreeBSD.org .
+.Pp
+Intel XScale support was added by
+.An "Rui Paulo"
+.Aq rpaulo@FreeBSD.org .

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 12:03:09 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A145C1065673;
	Tue, 23 Mar 2010 12:03:09 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8597A8FC20;
	Tue, 23 Mar 2010 12:03:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NC39Hr065982;
	Tue, 23 Mar 2010 12:03:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NC39gt065978;
	Tue, 23 Mar 2010 12:03:09 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003231203.o2NC39gt065978@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 23 Mar 2010 12:03:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205513 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 12:03:09 -0000

Author: rpaulo
Date: Tue Mar 23 12:03:09 2010
New Revision: 205513
URL: http://svn.freebsd.org/changeset/base/205513

Log:
  Add a new field for extended HT capabilities.
  
  Submitted by:	Alexander Egorenkov 
  MFC after:	2 weeks
  Sponsored by:	iXsystems, inc.

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Tue Mar 23 11:33:08 2010	(r205512)
+++ head/sys/net80211/ieee80211.c	Tue Mar 23 12:03:09 2010	(r205513)
@@ -404,6 +404,7 @@ ieee80211_vap_setup(struct ieee80211com 
 	vap->iv_flags_ven = ic->ic_flags_ven;
 	vap->iv_caps = ic->ic_caps &~ IEEE80211_C_OPMODE;
 	vap->iv_htcaps = ic->ic_htcaps;
+	vap->iv_htextcaps = ic->ic_htextcaps;
 	vap->iv_opmode = opmode;
 	vap->iv_caps |= ieee80211_opcap[opmode];
 	switch (opmode) {

Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c	Tue Mar 23 11:33:08 2010	(r205512)
+++ head/sys/net80211/ieee80211_ht.c	Tue Mar 23 12:03:09 2010	(r205513)
@@ -2346,7 +2346,7 @@ ieee80211_add_htcap_body(uint8_t *frm, s
 	frm += 2;				\
 } while (0)
 	struct ieee80211vap *vap = ni->ni_vap;
-	uint16_t caps;
+	uint16_t caps, extcaps;
 	int rxmax, density;
 
 	/* HT capabilities */
@@ -2404,8 +2404,17 @@ ieee80211_add_htcap_body(uint8_t *frm, s
 	 */
 	ieee80211_set_htrates(frm, &ieee80211_rateset_11n);
 
-	frm += sizeof(struct ieee80211_ie_htcap) -
+	frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) -
 		__offsetof(struct ieee80211_ie_htcap, hc_mcsset);
+
+	/* HT extended capabilities */
+	extcaps = vap->iv_htextcaps & 0xffff;
+
+	ADDSHORT(frm, extcaps);
+
+	frm += sizeof(struct ieee80211_ie_htcap) -
+		__offsetof(struct ieee80211_ie_htcap, hc_txbf);
+
 	return frm;
 #undef ADDSHORT
 }

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Tue Mar 23 11:33:08 2010	(r205512)
+++ head/sys/net80211/ieee80211_var.h	Tue Mar 23 12:03:09 2010	(r205513)
@@ -137,6 +137,7 @@ struct ieee80211com {
 	uint32_t		ic_flags_ven;	/* vendor state flags */
 	uint32_t		ic_caps;	/* capabilities */
 	uint32_t		ic_htcaps;	/* HT capabilities */
+	uint32_t		ic_htextcaps;	/* HT extended capabilities */
 	uint32_t		ic_cryptocaps;	/* crypto capabilities */
 	uint8_t			ic_modecaps[2];	/* set of mode capabilities */
 	uint8_t			ic_promisc;	/* vap's needing promisc mode */
@@ -313,7 +314,8 @@ struct ieee80211com {
 				    int batimeout, int baseqctl);
 	void			(*ic_ampdu_rx_stop)(struct ieee80211_node *,
 				    struct ieee80211_rx_ampdu *);
-	uint64_t		ic_spare[8];
+	uint64_t		ic_spare[7];
+	uint32_t		ic_spare2;
 };
 
 struct ieee80211_aclator;
@@ -340,6 +342,7 @@ struct ieee80211vap {
 	uint32_t		iv_flags_ven;	/* vendor state flags */
 	uint32_t		iv_caps;	/* capabilities */
 	uint32_t		iv_htcaps;	/* HT capabilities */
+	uint32_t		iv_htextcaps;	/* HT extended capabilities */
 	enum ieee80211_opmode	iv_opmode;	/* operation mode */
 	enum ieee80211_state	iv_state;	/* state machine state */
 	enum ieee80211_state	iv_nstate;	/* pending state */

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 12:05:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75DF91065677;
	Tue, 23 Mar 2010 12:05:25 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 660398FC24;
	Tue, 23 Mar 2010 12:05:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NC5Pl1066508;
	Tue, 23 Mar 2010 12:05:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NC5PxK066506;
	Tue, 23 Mar 2010 12:05:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003231205.o2NC5PxK066506@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 23 Mar 2010 12:05:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205514 - head/sbin/ifconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 12:05:25 -0000

Author: rpaulo
Date: Tue Mar 23 12:05:25 2010
New Revision: 205514
URL: http://svn.freebsd.org/changeset/base/205514

Log:
  Add a missing LINE_BREAK() after printing the roaming parameters in
  verbose mode.
  
  Sponsored by:	iXsystems, inc.
  MFC after:	2 weeks

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c	Tue Mar 23 12:03:09 2010	(r205513)
+++ head/sbin/ifconfig/ifieee80211.c	Tue Mar 23 12:05:25 2010	(r205514)
@@ -4509,6 +4509,7 @@ end:
 		} else {
 			LINE_BREAK();
 			list_roam(s);
+			LINE_BREAK();
 		}
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 13:15:12 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 023BD106564A;
	Tue, 23 Mar 2010 13:15:12 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E59B18FC13;
	Tue, 23 Mar 2010 13:15:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NDFBNa081853;
	Tue, 23 Mar 2010 13:15:11 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NDFBmX081839;
	Tue, 23 Mar 2010 13:15:11 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003231315.o2NDFBmX081839@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 23 Mar 2010 13:15:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205515 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 13:15:12 -0000

Author: rpaulo
Date: Tue Mar 23 13:15:11 2010
New Revision: 205515
URL: http://svn.freebsd.org/changeset/base/205515

Log:
  Add MCS to the list of media types.
  
  Sponsored by:	iXsystems, inc.

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==============================================================================
--- head/sys/net/if_media.h	Tue Mar 23 12:05:25 2010	(r205514)
+++ head/sys/net/if_media.h	Tue Mar 23 13:15:11 2010	(r205515)
@@ -462,6 +462,7 @@ struct ifmedia_description {
 	{ IFM_IEEE80211_OFDM3, "OFDM/3Mbps" },				\
 	{ IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" },			\
 	{ IFM_IEEE80211_OFDM27, "OFDM/27Mbps" },			\
+	{ IFM_IEEE80211_MCS, "MCS" },					\
 	{ 0, NULL },							\
 }
 
@@ -500,6 +501,7 @@ struct ifmedia_description {
 	{ IFM_IEEE80211_OFDM3, "OFDM3" },				\
 	{ IFM_IEEE80211_OFDM4, "OFDM4.5" },				\
 	{ IFM_IEEE80211_OFDM27, "OFDM27" },				\
+	{ IFM_IEEE80211_MCS, "MCS" },					\
 	{ 0, NULL },							\
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 14:27:55 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C54D11065670;
	Tue, 23 Mar 2010 14:27:55 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 956BE8FC16;
	Tue, 23 Mar 2010 14:27:55 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 45A3E46B8C;
	Tue, 23 Mar 2010 10:27:55 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 042708A01F;
	Tue, 23 Mar 2010 10:27:54 -0400 (EDT)
From: John Baldwin 
To: kmacy@freebsd.org
Date: Tue, 23 Mar 2010 09:54:00 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003222239.o2MMdWZi061585@svn.freebsd.org>
	<9bbcef731003230257n17fa2b28i68da4bd2f01abb5c@mail.gmail.com>
	<82c4140e1003230333p40ad6d6es1f1e08da4148fab3@mail.gmail.com>
In-Reply-To: <82c4140e1003230333p40ad6d6es1f1e08da4148fab3@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201003230954.00135.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 23 Mar 2010 10:27:54 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ivan Voras 
Subject: Re: svn commit: r205487 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 14:27:55 -0000

On Tuesday 23 March 2010 6:33:51 am K. Macy wrote:
> The size change causes the initialization path to change in a way that
> currently causes crashes.

Are you planning on debugging it further?  Does UMA_BOOTPAGES or NKPT need to 
be larger?

> On Mar 23, 2010 2:57 AM, "Ivan Voras"  wrote:
> 
> On 22 March 2010 23:39, Kip Macy  wrote:
> > Author: kmacy
> > Date: Mon Mar 22 22:39...
> Does this mean you have determined that aligning these structures is
> not as beneficial on i386 or is there something else going on?
> 

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 14:31:32 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4346B1065676;
	Tue, 23 Mar 2010 14:31:32 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32FF48FC17;
	Tue, 23 Mar 2010 14:31:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NEVVUV098876;
	Tue, 23 Mar 2010 14:31:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NEVV8o098875;
	Tue, 23 Mar 2010 14:31:31 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003231431.o2NEVV8o098875@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 23 Mar 2010 14:31:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205516 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 14:31:32 -0000

Author: rpaulo
Date: Tue Mar 23 14:31:31 2010
New Revision: 205516
URL: http://svn.freebsd.org/changeset/base/205516

Log:
  When receiving a management frame, pass the mbuf to bpf before calling
  iv_recv_mgmt(). iv_recv_mgmt() will generate management frame responses
  and pass them to bpf before the management frame that triggered the
  response.
  
  PR:		144323
  Submitted by:	Alexander Egorenkov 
  MFC after:	2 weeks
  Sponsored by:	iXsystems, inc.

Modified:
  head/sys/net80211/ieee80211_hostap.c

Modified: head/sys/net80211/ieee80211_hostap.c
==============================================================================
--- head/sys/net80211/ieee80211_hostap.c	Tue Mar 23 13:15:11 2010	(r205515)
+++ head/sys/net80211/ieee80211_hostap.c	Tue Mar 23 14:31:31 2010	(r205516)
@@ -883,6 +883,9 @@ hostap_input(struct ieee80211_node *ni, 
 			wh = mtod(m, struct ieee80211_frame *);
 			wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
 		}
+		if (ieee80211_radiotap_active_vap(vap))
+			ieee80211_radiotap_rx(vap, m);
+		need_tap = 0;
 		vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
 		goto out;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 16:47:23 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 559F81065673;
	Tue, 23 Mar 2010 16:47:23 +0000 (UTC)
	(envelope-from kmatthew.macy@gmail.com)
Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com
	[209.85.221.172])
	by mx1.freebsd.org (Postfix) with ESMTP id A29E58FC0C;
	Tue, 23 Mar 2010 16:47:22 +0000 (UTC)
Received: by qyk2 with SMTP id 2so139590qyk.13
	for ; Tue, 23 Mar 2010 09:47:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:reply-to:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=fm4zaFQ5vgZRgc/6fXMMTufAHeUj3DG7zg0xtZbehOY=;
	b=qQsibyKIC5UXq2pfHdDMT5fWNEAI0/tAFn5eJb58ISjnhevUtfNJtPGxh+9YE5lXU2
	1qOELIdNIuMW66VWGcEaFIZU2CjB6mVihH1C5Rz8bujKg2mIJVeotVZJhp/i0f32GfdB
	b12aUTAje88RBw+qeb9seoMVUu8Fd9CEWu6to=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:reply-to:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=XY63pZbVYZ0P6od9Jn2Y48skTAUKGym18ZwpZaOG6xB+oFuBah85djNK84nWZ6gtlP
	OnYzwJ0cNoPPoLdiMkTkyePYgjD5XSZT1TdTOMlWzh4jWPQJcgziijVY1uIucDqHYGxh
	19WlaQQjahP7q68INHSL01pvK3mbTgkxqSMHU=
MIME-Version: 1.0
Sender: kmatthew.macy@gmail.com
Received: by 10.229.235.193 with SMTP id kh1mr1150442qcb.77.1269362841397; 
	Tue, 23 Mar 2010 09:47:21 -0700 (PDT)
In-Reply-To: <201003230954.00135.jhb@freebsd.org>
References: <201003222239.o2MMdWZi061585@svn.freebsd.org>
	<9bbcef731003230257n17fa2b28i68da4bd2f01abb5c@mail.gmail.com>
	<82c4140e1003230333p40ad6d6es1f1e08da4148fab3@mail.gmail.com>
	<201003230954.00135.jhb@freebsd.org>
Date: Tue, 23 Mar 2010 09:47:21 -0700
X-Google-Sender-Auth: eaae3eb4ae010e6a
Message-ID: <82c4140e1003230947g2c37357ej6b8f04d94d1d264c@mail.gmail.com>
From: "K. Macy" 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ivan Voras 
Subject: Re: svn commit: r205487 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: kmacy@freebsd.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 16:47:23 -0000

On Tue, Mar 23, 2010 at 6:54 AM, John Baldwin  wrote:
> On Tuesday 23 March 2010 6:33:51 am K. Macy wrote:
>> The size change causes the initialization path to change in a way that
>> currently causes crashes.
>
> Are you planning on debugging it further? =A0Does UMA_BOOTPAGES or NKPT n=
eed to
> be larger?
>
>> On Mar 23, 2010 2:57 AM, "Ivan Voras"  wrote:
>>
>> On 22 March 2010 23:39, Kip Macy  wrote:
>> > Author: kmacy
>> > Date: Mon Mar 22 22:39...
>> Does this mean you have determined that aligning these structures is
>> not as beneficial on i386 or is there something else going on?
>>
>
> --
> John Baldwin


>From a mail I sent to Jeff:

This pushes things through keg_large_init (whereas previously it went
through keg_small_init) which breaks things on i386.
I can workaround the fact that hash_alloc gets called before hashzone
is initialized but trying to allocate a slab while during
initialization of the slab zone is problematic. Suggestions are
welcome.


(gdb) bt
#0  keg_alloc_slab (keg=3D0xc0ab3000, zone=3D0xc0547c80, wait=3D2)
   at /usr/home/kmacy/svn_checkouts/head_flowtable/sys/vm/uma_core.c:823
#1  0xc02dbfaf in keg_fetch_slab (keg=3D0xc0ab3000, zone=3D0xc0547c80, flag=
s=3D2)
   at /usr/home/kmacy/svn_checkouts/head_flowtable/sys/vm/uma_core.c:2159
#2  0xc02dc2cc in zone_fetch_slab (zone=3D0xc0547c80, keg=3D0xc0ab3000, fla=
gs=3D2)
   at /usr/home/kmacy/svn_checkouts/head_flowtable/sys/vm/uma_core.c:2219
#3  0xc02db3ab in zone_alloc_item (zone=3D0xc0547c80, udata=3D0xc073cc48, f=
lags=3D2)
   at /usr/home/kmacy/svn_checkouts/head_flowtable/sys/vm/uma_core.c:2475
#4  0xc02db74f in uma_zcreate (name=3D0xc037ef33 "UMA Slabs", size=3D284,
ctor=3D0, dtor=3D0, uminit=3D0,
   fini=3D0, align=3D3, flags=3D536870912)
   at /usr/home/kmacy/svn_checkouts/head_flowtable/sys/vm/uma_core.c:1827
#5  0xc02dcc6b in uma_startup (bootmem=3D0xc0a64000, boot_pages=3D80)

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 18:00:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 099F31065679;
	Tue, 23 Mar 2010 18:00:51 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED3128FC13;
	Tue, 23 Mar 2010 18:00:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NI0otQ045871;
	Tue, 23 Mar 2010 18:00:50 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NI0oac045869;
	Tue, 23 Mar 2010 18:00:50 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003231800.o2NI0oac045869@svn.freebsd.org>
From: Xin LI 
Date: Tue, 23 Mar 2010 18:00:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205520 - head/share/man/man3
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 18:00:51 -0000

Author: delphij
Date: Tue Mar 23 18:00:50 2010
New Revision: 205520
URL: http://svn.freebsd.org/changeset/base/205520

Log:
  Correct cross reference.
  
  MFC after:	2 weeks

Modified:
  head/share/man/man3/pthread_affinity_np.3

Modified: head/share/man/man3/pthread_affinity_np.3
==============================================================================
--- head/share/man/man3/pthread_affinity_np.3	Tue Mar 23 17:14:50 2010	(r205519)
+++ head/share/man/man3/pthread_affinity_np.3	Tue Mar 23 18:00:50 2010	(r205520)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2010
+.Dd March 23, 2010
 .Dt PTHREAD_AFFINITY_NP 3
 .Os
 .Sh NAME
@@ -125,8 +125,8 @@ operation.
 .Xr cpuset_setid 2 ,
 .Xr CPU_SET 3 ,
 .Xr pthread 3 ,
-.Xr pthread_attr_get_affinity_np 3 ,
-.Xr pthread_attr_set_affinity_np 3
+.Xr pthread_attr_getaffinity_np 3 ,
+.Xr pthread_attr_setaffinity_np 3
 .Sh STANDARDS
 The
 .Nm pthread_getaffinity_np

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 19:21:32 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FA0D1065674;
	Tue, 23 Mar 2010 19:21:32 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa])
	by mx1.freebsd.org (Postfix) with ESMTP id D2F948FC0C;
	Tue, 23 Mar 2010 19:21:31 +0000 (UTC)
Received: by mx0.hoeg.nl (Postfix, from userid 1000)
	id 3A2052A290BA; Tue, 23 Mar 2010 20:21:31 +0100 (CET)
Date: Tue, 23 Mar 2010 20:21:31 +0100
From: Ed Schouten 
To: Ed Maste 
Message-ID: <20100323192131.GF32142@hoeg.nl>
References: <201003221152.o2MBqs9M012769@svn.freebsd.org>
	<201003220849.36246.jhb@freebsd.org>
	<20100322152334.GA24534@sandvine.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="o5hfEDzsoqw8wJwC"
Content-Disposition: inline
In-Reply-To: <20100322152334.GA24534@sandvine.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r205444 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 19:21:32 -0000


--o5hfEDzsoqw8wJwC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ed Maste  wrote:
> I was just about to follow up with a comment to that effect.  We do want
> it to become a panic, but I would prefer to hold off until we address
> the known issue with padlock(4).

I have seen this message appear when using the ndisulator as well. How
are we going to solve it in this case? Could the ndisulator be extended
to prepare a FPU context using kib's new API?

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--o5hfEDzsoqw8wJwC
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAkupFLoACgkQ52SDGA2eCwWniACfUUuQRzr3+KB7x3ZciNoV2/I+
wFcAn16i4d8AOMsilFrVM8zGIz4HPZp6
=e2eW
-----END PGP SIGNATURE-----

--o5hfEDzsoqw8wJwC--

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 19:30:57 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 887341065670;
	Tue, 23 Mar 2010 19:30:57 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D8F88FC13;
	Tue, 23 Mar 2010 19:30:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NJUvRJ065978;
	Tue, 23 Mar 2010 19:30:57 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJUvbv065977;
	Tue, 23 Mar 2010 19:30:57 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003231930.o2NJUvbv065977@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 23 Mar 2010 19:30:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205527 - in head/sys/powerpc: booke powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 19:30:57 -0000

Author: marcel
Date: Tue Mar 23 19:30:56 2010
New Revision: 205527
URL: http://svn.freebsd.org/changeset/base/205527

Log:
  Enable power management for E500 cores. Use "doze" for now to make
  sure the caches remain coherent. For single-core configurations and
  with busdma changes we could eventually switch to "nap" and force
  a D-cache invalidation as part of the DMA completion. To this end,
  clear PSL_WE until after we handled the decrementer or external
  interrupt as it tells us whether we just woke up or not.

Modified:
  head/sys/powerpc/booke/interrupt.c
  head/sys/powerpc/booke/machdep.c
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/booke/interrupt.c
==============================================================================
--- head/sys/powerpc/booke/interrupt.c	Tue Mar 23 19:30:15 2010	(r205526)
+++ head/sys/powerpc/booke/interrupt.c	Tue Mar 23 19:30:56 2010	(r205527)
@@ -123,6 +123,7 @@ powerpc_decr_interrupt(struct trapframe 
 	decr_intr(framep);
 	atomic_subtract_int(&td->td_intr_nesting_level, 1);
 	critical_exit();
+	framep->srr1 &= ~PSL_WE;
 }
 
 /*
@@ -135,4 +136,5 @@ powerpc_extr_interrupt(struct trapframe 
 	critical_enter();
 	PIC_DISPATCH(pic, framep);
 	critical_exit();
+	framep->srr1 &= ~PSL_WE;
 }

Modified: head/sys/powerpc/booke/machdep.c
==============================================================================
--- head/sys/powerpc/booke/machdep.c	Tue Mar 23 19:30:15 2010	(r205526)
+++ head/sys/powerpc/booke/machdep.c	Tue Mar 23 19:30:56 2010	(r205527)
@@ -706,6 +706,7 @@ cpu_idle (int busy)
 	register_t msr;
 
 	msr = mfmsr();
+
 #ifdef INVARIANTS
 	if ((msr & PSL_EE) != PSL_EE) {
 		struct thread *td = curthread;
@@ -713,19 +714,10 @@ cpu_idle (int busy)
 		panic("ints disabled in idleproc!");
 	}
 #endif
-#if 0
-	/*
-	 * Freescale E500 core RM section 6.4.1
-	 */
-	msr = msr | PSL_WE;
 
-	__asm__("	msync;"
-		"	mtmsr	%0;"
-		"	isync;"
-		"loop:	b	loop" :
-		/* no output */	:
-		"r" (msr));
-#endif
+	/* Freescale E500 core RM section 6.4.1. */
+	msr = msr | PSL_WE;
+	__asm __volatile("msync; mtmsr %0; isync" :: "r" (msr));
 }
 
 int

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Tue Mar 23 19:30:15 2010	(r205526)
+++ head/sys/powerpc/powerpc/cpu.c	Tue Mar 23 19:30:56 2010	(r205527)
@@ -433,6 +433,13 @@ cpu_e500_setup(int cpuid, uint16_t vers)
 	register_t hid0;
 
 	hid0 = mfspr(SPR_HID0);
+
+	/* Programe power-management mode. */
+	hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
+	hid0 |= HID0_DOZE;
+
+	mtspr(SPR_HID0, hid0);
+
 	printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 20:03:04 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 166EF106566B;
	Tue, 23 Mar 2010 20:03:04 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 634278FC0A;
	Tue, 23 Mar 2010 20:03:02 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o2NK2sju020276
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 23 Mar 2010 22:02:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o2NK2sgi092982; Tue, 23 Mar 2010 22:02:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o2NK2s4u092981; 
	Tue, 23 Mar 2010 22:02:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Tue, 23 Mar 2010 22:02:54 +0200
From: Kostik Belousov 
To: Ed Schouten 
Message-ID: <20100323200253.GF2415@deviant.kiev.zoral.com.ua>
References: <201003221152.o2MBqs9M012769@svn.freebsd.org>
	<201003220849.36246.jhb@freebsd.org>
	<20100322152334.GA24534@sandvine.com>
	<20100323192131.GF32142@hoeg.nl>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="f61P+fpdnY2FZS1u"
Content-Disposition: inline
In-Reply-To: <20100323192131.GF32142@hoeg.nl>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Maste ,
	John Baldwin 
Subject: Re: svn commit: r205444 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 20:03:04 -0000


--f61P+fpdnY2FZS1u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 23, 2010 at 08:21:31PM +0100, Ed Schouten wrote:
> * Ed Maste  wrote:
> > I was just about to follow up with a comment to that effect.  We do want
> > it to become a panic, but I would prefer to hold off until we address
> > the known issue with padlock(4).
>=20
> I have seen this message appear when using the ndisulator as well. How
> are we going to solve it in this case? Could the ndisulator be extended
> to prepare a FPU context using kib's new API?

I looked at http://msdn.microsoft.com/en-us/library/aa489566.aspx
after someone mentioned ndisulator. It seems that windows requires
that i386 drivers carefully use braces for use of FPU, while amd64
code allowed to use it freely. That suggests that windows clears
TS on kernel mode entry or driver calls, that seems to be too
wastefull.

I would very much appreciate the help with changing both ndis and
padlock to use fpu_kern_enter/leave KPI, since I do not use them.
I need some time to polish the patch before.

--f61P+fpdnY2FZS1u
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkupHm0ACgkQC3+MBN1Mb4gZrACg8DoPl2jtGLRsr2vKymLRiO4z
Q5sAoIpz34Wt9kNiqjI5gR0hd6Ueer1T
=zYmq
-----END PGP SIGNATURE-----

--f61P+fpdnY2FZS1u--

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 20:08:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41BB6106576E;
	Tue, 23 Mar 2010 20:08:19 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3162F8FC12;
	Tue, 23 Mar 2010 20:08:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NK8JTe074507;
	Tue, 23 Mar 2010 20:08:19 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NK8Jqw074505;
	Tue, 23 Mar 2010 20:08:19 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003232008.o2NK8Jqw074505@svn.freebsd.org>
From: Xin LI 
Date: Tue, 23 Mar 2010 20:08:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205534 - head/sys/dev/ppc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 20:08:19 -0000

Author: delphij
Date: Tue Mar 23 20:08:18 2010
New Revision: 205534
URL: http://svn.freebsd.org/changeset/base/205534

Log:
  Add PCI ID for MCS9901's parallel port.
  
  PR:		kern/144713
  Submitted by:	gcooper
  MFC after:	2 weeks

Modified:
  head/sys/dev/ppc/ppc_pci.c

Modified: head/sys/dev/ppc/ppc_pci.c
==============================================================================
--- head/sys/dev/ppc/ppc_pci.c	Tue Mar 23 19:58:20 2010	(r205533)
+++ head/sys/dev/ppc/ppc_pci.c	Tue Mar 23 20:08:18 2010	(r205534)
@@ -89,6 +89,7 @@ static struct pci_id pci_ids[] = {
 	{ 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 },
 	{ 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 },
 	{ 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 },
+	{ 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 },
 	{ 0xffff }
 };
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 20:12:53 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 657691065673;
	Tue, 23 Mar 2010 20:12:53 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B73E8FC1F;
	Tue, 23 Mar 2010 20:12:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NKCr3x075567;
	Tue, 23 Mar 2010 20:12:53 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NKCrsh075564;
	Tue, 23 Mar 2010 20:12:53 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003232012.o2NKCrsh075564@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 23 Mar 2010 20:12:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205535 - head/sys/powerpc/mpc85xx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 20:12:53 -0000

Author: marcel
Date: Tue Mar 23 20:12:53 2010
New Revision: 205535
URL: http://svn.freebsd.org/changeset/base/205535

Log:
  Add definitions for a 4th PCI host controller. No Freescale processor
  has all 4 implemented, but across the processors we now support all the
  combinations. For example, the MPC8533 doesn't have a PCI controller
  at 0xA0000, but does at 0xB0000.

Modified:
  head/sys/powerpc/mpc85xx/ocpbus.c
  head/sys/powerpc/mpc85xx/ocpbus.h

Modified: head/sys/powerpc/mpc85xx/ocpbus.c
==============================================================================
--- head/sys/powerpc/mpc85xx/ocpbus.c	Tue Mar 23 20:08:18 2010	(r205534)
+++ head/sys/powerpc/mpc85xx/ocpbus.c	Tue Mar 23 20:12:53 2010	(r205535)
@@ -152,6 +152,10 @@ ocpbus_write_law(int trgt, int type, u_l
 			addr = 0xA0000000;
 			size = 0x10000000;
 			break;
+		case OCP85XX_TGTIF_PCI3:
+			addr = 0xB0000000;
+			size = 0x10000000;
+			break;
 		default:
 			return (EINVAL);
 		}
@@ -170,6 +174,10 @@ ocpbus_write_law(int trgt, int type, u_l
 			addr = 0xfee20000;
 			size = 0x00010000;
 			break;
+		case OCP85XX_TGTIF_PCI3:
+			addr = 0xfee30000;
+			size = 0x00010000;
+			break;
 		default:
 			return (EINVAL);
 		}
@@ -188,7 +196,7 @@ static int
 ocpbus_probe(device_t dev)
 {
 
-	device_set_desc(dev, "On-Chip Peripherals bus");
+	device_set_desc(dev, "Freescale on-chip peripherals bus");
 	return (BUS_PROBE_DEFAULT);
 }
 
@@ -210,6 +218,7 @@ ocpbus_attach(device_t dev)
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 0);
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 1);
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 2);
+	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 3);
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 0);
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 1);
 	ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 2);
@@ -338,6 +347,10 @@ const struct ocp_resource mpc8555_resour
 	    OCP85XX_PCI_SIZE},
 	{OCPBUS_DEVTYPE_PCIB, 2, SYS_RES_MEMORY, 1, 0, OCP85XX_TGTIF_PCI2},
 	{OCPBUS_DEVTYPE_PCIB, 2, SYS_RES_IOPORT, 1, 0, OCP85XX_TGTIF_PCI2},
+	{OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_MEMORY, 0, OCP85XX_PCI3_OFF,
+	    OCP85XX_PCI_SIZE},
+	{OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_MEMORY, 1, 0, OCP85XX_TGTIF_PCI3},
+	{OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_IOPORT, 1, 0, OCP85XX_TGTIF_PCI3},
 
 	{OCPBUS_DEVTYPE_LBC, 0, SYS_RES_MEMORY, 0, OCP85XX_LBC_OFF,
 	    OCP85XX_LBC_SIZE},

Modified: head/sys/powerpc/mpc85xx/ocpbus.h
==============================================================================
--- head/sys/powerpc/mpc85xx/ocpbus.h	Tue Mar 23 20:08:18 2010	(r205534)
+++ head/sys/powerpc/mpc85xx/ocpbus.h	Tue Mar 23 20:12:53 2010	(r205535)
@@ -50,6 +50,7 @@
 #define	OCP85XX_TGTIF_PCI0	0
 #define	OCP85XX_TGTIF_PCI1	1
 #define	OCP85XX_TGTIF_PCI2	2
+#define	OCP85XX_TGTIF_PCI3	3
 #define	OCP85XX_TGTIF_LBC	4
 #define	OCP85XX_TGTIF_RAM_INTL	11
 #define	OCP85XX_TGTIF_RIO	12
@@ -86,6 +87,7 @@
 #define	OCP85XX_PCI0_OFF	0x08000
 #define	OCP85XX_PCI1_OFF	0x09000
 #define	OCP85XX_PCI2_OFF	0x0A000
+#define	OCP85XX_PCI3_OFF	0x0B000
 #define	OCP85XX_PCI_SIZE	0x1000
 #define	OCP85XX_TSEC0_OFF	0x24000
 #define	OCP85XX_TSEC1_OFF	0x25000

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 20:35:11 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EA69106564A;
	Tue, 23 Mar 2010 20:35:11 +0000 (UTC)
	(envelope-from onemda@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FE718FC12;
	Tue, 23 Mar 2010 20:35:10 +0000 (UTC)
Received: by wyb33 with SMTP id 33so3341419wyb.13
	for ; Tue, 23 Mar 2010 13:35:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=ng+MlqvNviOTQHeTaLIaQ+LULxgqC/kWm0DlB4V/LTM=;
	b=IOxs6wF0UdDJgn6iCbY+G5grOWEBaUjtC5/jXMAfOcmXTb5JInBuW8wTCYsmlrlggY
	JEcKRv/TUrrr69x8FHNiJ7+0LrD7NlyPNCY3cTe9pPDv2icZfcRkY6yRFOvTb4kPzjh8
	EJPuM69AlPMqAVkIrq2G1PSL0CtEVuA6YUnpw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=xkizARGZXJfEa4WWGP6MExEfz1fOqkYygNyAqItG5wvjWCCCZzaYnszgvYoDmvUDXQ
	oBigKuz98SK0tQabGXF3jZWmvVJaRqIAWLx01u357ue3KNOC1wm4nH9tOkDYuNtCoAiB
	Ououoo56QiSBXA+EvgCAYQZGChUBXpZPvmbQ4=
MIME-Version: 1.0
Received: by 10.216.165.148 with SMTP id e20mr42043wel.29.1269376509324; Tue, 
	23 Mar 2010 13:35:09 -0700 (PDT)
In-Reply-To: <20100323200253.GF2415@deviant.kiev.zoral.com.ua>
References: <201003221152.o2MBqs9M012769@svn.freebsd.org>
	<201003220849.36246.jhb@freebsd.org>
	<20100322152334.GA24534@sandvine.com> <20100323192131.GF32142@hoeg.nl>
	<20100323200253.GF2415@deviant.kiev.zoral.com.ua>
Date: Tue, 23 Mar 2010 21:35:09 +0100
Message-ID: <3a142e751003231335x58179a0aqcbd6ea328c04409d@mail.gmail.com>
From: Paul B Mahol 
To: Kostik Belousov 
Content-Type: text/plain; charset=ISO-8859-1
Cc: Ed Schouten , src-committers@freebsd.org,
	Ed Maste , John Baldwin ,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r205444 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 20:35:11 -0000

On 3/23/10, Kostik Belousov  wrote:
> On Tue, Mar 23, 2010 at 08:21:31PM +0100, Ed Schouten wrote:
>> * Ed Maste  wrote:
>> > I was just about to follow up with a comment to that effect.  We do want
>> > it to become a panic, but I would prefer to hold off until we address
>> > the known issue with padlock(4).
>>
>> I have seen this message appear when using the ndisulator as well. How
>> are we going to solve it in this case? Could the ndisulator be extended
>> to prepare a FPU context using kib's new API?
>
> I looked at http://msdn.microsoft.com/en-us/library/aa489566.aspx
> after someone mentioned ndisulator. It seems that windows requires
> that i386 drivers carefully use braces for use of FPU, while amd64
> code allowed to use it freely. That suggests that windows clears
> TS on kernel mode entry or driver calls, that seems to be too
> wastefull.
>
> I would very much appreciate the help with changing both ndis and
> padlock to use fpu_kern_enter/leave KPI, since I do not use them.
> I need some time to polish the patch before.
>

I saw fpudna only on amd64, but I never managed to get ndisulator
fully working on amd64 (at least with broadcom card/driver).

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 20:51:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 967F3106566B;
	Tue, 23 Mar 2010 20:51:21 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 176418FC0A;
	Tue, 23 Mar 2010 20:51:20 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o2NKpHe9023695
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 23 Mar 2010 22:51:17 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o2NKpHsC093186; Tue, 23 Mar 2010 22:51:17 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o2NKpHu6093185; 
	Tue, 23 Mar 2010 22:51:17 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Tue, 23 Mar 2010 22:51:17 +0200
From: Kostik Belousov 
To: Paul B Mahol 
Message-ID: <20100323205117.GG2415@deviant.kiev.zoral.com.ua>
References: <201003221152.o2MBqs9M012769@svn.freebsd.org>
	<201003220849.36246.jhb@freebsd.org>
	<20100322152334.GA24534@sandvine.com>
	<20100323192131.GF32142@hoeg.nl>
	<20100323200253.GF2415@deviant.kiev.zoral.com.ua>
	<3a142e751003231335x58179a0aqcbd6ea328c04409d@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="/i8j2F0k9BYX4qLc"
Content-Disposition: inline
In-Reply-To: <3a142e751003231335x58179a0aqcbd6ea328c04409d@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: Ed Schouten , src-committers@freebsd.org,
	Ed Maste , John Baldwin ,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r205444 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 20:51:21 -0000


--/i8j2F0k9BYX4qLc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 23, 2010 at 09:35:09PM +0100, Paul B Mahol wrote:
> On 3/23/10, Kostik Belousov  wrote:
> > On Tue, Mar 23, 2010 at 08:21:31PM +0100, Ed Schouten wrote:
> >> * Ed Maste  wrote:
> >> > I was just about to follow up with a comment to that effect.  We do =
want
> >> > it to become a panic, but I would prefer to hold off until we address
> >> > the known issue with padlock(4).
> >>
> >> I have seen this message appear when using the ndisulator as well. How
> >> are we going to solve it in this case? Could the ndisulator be extended
> >> to prepare a FPU context using kib's new API?
> >
> > I looked at http://msdn.microsoft.com/en-us/library/aa489566.aspx
> > after someone mentioned ndisulator. It seems that windows requires
> > that i386 drivers carefully use braces for use of FPU, while amd64
> > code allowed to use it freely. That suggests that windows clears
> > TS on kernel mode entry or driver calls, that seems to be too
> > wastefull.
> >
> > I would very much appreciate the help with changing both ndis and
> > padlock to use fpu_kern_enter/leave KPI, since I do not use them.
> > I need some time to polish the patch before.
> >
>=20
> I saw fpudna only on amd64, but I never managed to get ndisulator
> fully working on amd64 (at least with broadcom card/driver).

I cannot find KeSaveFloatingPointState symbol defined by ndisulator.
Could it be that it is a macro or inline function that expands to
proper assembly for i386, and nop on amd64 ? That would explain
your observation.

--/i8j2F0k9BYX4qLc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkupKcUACgkQC3+MBN1Mb4ggvQCgiwcovlcACPE4b7OWW9+nISv0
v4wAni5C9pNHChXbguSKIlLGUUYCFtcA
=Em2q
-----END PGP SIGNATURE-----

--/i8j2F0k9BYX4qLc--

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 21:08:07 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B7D461065670;
	Tue, 23 Mar 2010 21:08:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A78E58FC15;
	Tue, 23 Mar 2010 21:08:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NL872Y087810;
	Tue, 23 Mar 2010 21:08:07 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NL87IW087807;
	Tue, 23 Mar 2010 21:08:07 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003232108.o2NL87IW087807@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 23 Mar 2010 21:08:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205536 - in head: lib/libc/sys sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 21:08:07 -0000

Author: jhb
Date: Tue Mar 23 21:08:07 2010
New Revision: 205536
URL: http://svn.freebsd.org/changeset/base/205536

Log:
  Reject attempts to create a MAP_ANON mapping with a non-zero offset.
  
  PR:		kern/71258
  Submitted by:	Alexander Best
  MFC after:	2 weeks

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mmap.2
==============================================================================
--- head/lib/libc/sys/mmap.2	Tue Mar 23 20:12:53 2010	(r205535)
+++ head/lib/libc/sys/mmap.2	Tue Mar 23 21:08:07 2010	(r205536)
@@ -105,7 +105,7 @@ The file descriptor used for creating
 must be \-1.
 The
 .Fa offset
-argument is ignored.
+argument must be 0.
 .\".It Dv MAP_FILE
 .\"Mapped from a regular file or character-special device memory.
 .It Dv MAP_ANONYMOUS
@@ -316,6 +316,11 @@ was equal to zero.
 was specified and the
 .Fa fd
 argument was not -1.
+.It Bq Er EINVAL
+.Dv MAP_ANON
+was specified and the
+.Fa offset
+argument was not 0.
 .It Bq Er ENODEV
 .Dv MAP_ANON
 has not been specified and

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Tue Mar 23 20:12:53 2010	(r205535)
+++ head/sys/vm/vm_mmap.c	Tue Mar 23 21:08:07 2010	(r205536)
@@ -233,7 +233,7 @@ mmap(td, uap)
 	/* Make sure mapping fits into numeric range, etc. */
 	if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) &&
 	     curproc->p_osrel >= 800104) ||
-	    ((flags & MAP_ANON) && uap->fd != -1))
+	    ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0)))
 		return (EINVAL);
 
 	if (flags & MAP_STACK) {
@@ -300,7 +300,6 @@ mmap(td, uap)
 		handle = NULL;
 		handle_type = OBJT_DEFAULT;
 		maxprot = VM_PROT_ALL;
-		pos = 0;
 	} else {
 		/*
 		 * Mapping file, get fp for validation and

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 21:27:57 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D6071065673;
	Tue, 23 Mar 2010 21:27:57 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F3A08FC23;
	Tue, 23 Mar 2010 21:27:57 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 037F546B03;
	Tue, 23 Mar 2010 17:27:57 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 5BC6A8A01F;
	Tue, 23 Mar 2010 17:27:56 -0400 (EDT)
From: John Baldwin 
To: src-committers@freebsd.org
Date: Tue, 23 Mar 2010 17:25:47 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003232108.o2NL87IW087807@svn.freebsd.org>
In-Reply-To: <201003232108.o2NL87IW087807@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201003231725.47645.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 23 Mar 2010 17:27:56 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r205536 - in head: lib/libc/sys sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 21:27:57 -0000

On Tuesday 23 March 2010 5:08:07 pm John Baldwin wrote:
> Author: jhb
> Date: Tue Mar 23 21:08:07 2010
> New Revision: 205536
> URL: http://svn.freebsd.org/changeset/base/205536
> 
> Log:
>   Reject attempts to create a MAP_ANON mapping with a non-zero offset.
>   
>   PR:		kern/71258
>   Submitted by:	Alexander Best
>   MFC after:	2 weeks

It is probably worth thinking about whether or not we should be allowing non-
page-aligned offsets (both file and for MAP_FIXED) at all given that POSIX 
does not require them to function and other OS's do not support them.  Alan 
brought that up in one of the threads about this bug.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 21:49:34 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35321106566C;
	Tue, 23 Mar 2010 21:49:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2495F8FC13;
	Tue, 23 Mar 2010 21:49:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NLnYi7097220;
	Tue, 23 Mar 2010 21:49:34 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NLnYfs097218;
	Tue, 23 Mar 2010 21:49:34 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003232149.o2NLnYfs097218@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 23 Mar 2010 21:49:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205541 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 21:49:34 -0000

Author: jhb
Date: Tue Mar 23 21:49:33 2010
New Revision: 205541
URL: http://svn.freebsd.org/changeset/base/205541

Log:
  Implement /proc/filesystems.
  
  Submitted by:	Fernando Apesteguia fernando.apesteguia (gmail)

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:43:01 2010	(r205540)
+++ head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:49:33 2010	(r205541)
@@ -1227,6 +1227,22 @@ linprocfs_docmdline(PFS_FILL_ARGS)
 	return (0);
 }
 
+/*
+ * Filler function for proc/filesystems
+ */
+static int
+linprocfs_dofilesystems(PFS_FILL_ARGS)
+{
+	struct vfsconf *vfsp;
+
+	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
+		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
+			sbuf_printf(sb, "nodev");
+		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
+	}
+	return(0);
+}
+
 #if 0
 /*
  * Filler function for proc/modules
@@ -1276,6 +1292,8 @@ linprocfs_init(PFS_INIT_ARGS)
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "devices", &linprocfs_dodevices,
 	    NULL, NULL, NULL, PFS_RD);
+	pfs_create_file(root, "filesystems", &linprocfs_dofilesystems,
+	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "loadavg", &linprocfs_doloadavg,
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "meminfo", &linprocfs_domeminfo,

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 21:55:58 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C053A106564A;
	Tue, 23 Mar 2010 21:55:58 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E6578FC16;
	Tue, 23 Mar 2010 21:55:57 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o2NLtsaP028194
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 23 Mar 2010 23:55:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o2NLtsfw027078; Tue, 23 Mar 2010 23:55:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o2NLtsIC027077; 
	Tue, 23 Mar 2010 23:55:54 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Tue, 23 Mar 2010 23:55:54 +0200
From: Kostik Belousov 
To: John Baldwin 
Message-ID: <20100323215554.GH2415@deviant.kiev.zoral.com.ua>
References: <201003232149.o2NLnYfs097218@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="hAW+M2+FUO+onfmf"
Content-Disposition: inline
In-Reply-To: <201003232149.o2NLnYfs097218@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205541 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 21:55:58 -0000


--hAW+M2+FUO+onfmf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 23, 2010 at 09:49:34PM +0000, John Baldwin wrote:
> Author: jhb
> Date: Tue Mar 23 21:49:33 2010
> New Revision: 205541
> URL: http://svn.freebsd.org/changeset/base/205541
>=20
> Log:
>   Implement /proc/filesystems.
>  =20
>   Submitted by:	Fernando Apesteguia fernando.apesteguia (gmail)
>=20
> Modified:
>   head/sys/compat/linprocfs/linprocfs.c
>=20
> Modified: head/sys/compat/linprocfs/linprocfs.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:43:01 2010	(r2055=
40)
> +++ head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:49:33 2010	(r2055=
41)
> @@ -1227,6 +1227,22 @@ linprocfs_docmdline(PFS_FILL_ARGS)
>  	return (0);
>  }
> =20
> +/*
> + * Filler function for proc/filesystems
> + */
> +static int
> +linprocfs_dofilesystems(PFS_FILL_ARGS)
> +{
> +	struct vfsconf *vfsp;
> +
> +	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
> +		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
> +			sbuf_printf(sb, "nodev");
> +		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
> +	}
> +	return(0);
> +}
I think the list iteration should be protected by Giant.
Am I mistaken ?

--hAW+M2+FUO+onfmf
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkupOOgACgkQC3+MBN1Mb4h57QCg23Y+hINPTvNqv+n+mZLrkRMr
YG8AmwbDmVij6X/k9JG8s+45gybWv5G8
=tR7F
-----END PGP SIGNATURE-----

--hAW+M2+FUO+onfmf--

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 22:16:57 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B170F1065673;
	Tue, 23 Mar 2010 22:16:57 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A0F128FC1C;
	Tue, 23 Mar 2010 22:16:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NMGvhi004201;
	Tue, 23 Mar 2010 22:16:57 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMGvvE004199;
	Tue, 23 Mar 2010 22:16:57 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003232216.o2NMGvvE004199@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 23 Mar 2010 22:16:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205550 - head/sys/dev/syscons
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 22:16:57 -0000

Author: jkim
Date: Tue Mar 23 22:16:57 2010
New Revision: 205550
URL: http://svn.freebsd.org/changeset/base/205550

Log:
  Separate 24-bit pixel draw from 32-bit case.  Although it is slower, we do
  not want to write a useless zero to inaccessible memory region.

Modified:
  head/sys/dev/syscons/scvgarndr.c

Modified: head/sys/dev/syscons/scvgarndr.c
==============================================================================
--- head/sys/dev/syscons/scvgarndr.c	Tue Mar 23 22:16:12 2010	(r205549)
+++ head/sys/dev/syscons/scvgarndr.c	Tue Mar 23 22:16:57 2010	(r205550)
@@ -181,9 +181,12 @@ static u_short mouse_or_mask[16] = {
 #define	vga_drawpxl(pos, color)						\
 	switch (scp->sc->adp->va_info.vi_depth) {			\
 		case 32:						\
-		case 24:						\
 			writel(pos, vga_palette32[color]);		\
 			break;						\
+		case 24:						\
+			writew(pos, vga_palette32[color]);		\
+			writeb(pos + 2, vga_palette32[color] >> 16);	\
+			break;						\
 		case 16:						\
 			if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\
 				writew(pos, vga_palette15[color]);	\

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 22:25:44 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6C07106564A;
	Tue, 23 Mar 2010 22:25:44 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-relay1.uni-muenster.de (ZIVM-RELAY1.UNI-MUENSTER.DE
	[128.176.192.12])
	by mx1.freebsd.org (Postfix) with ESMTP id C78248FC08;
	Tue, 23 Mar 2010 22:25:43 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.51,297,1267398000"; d="scan'208";a="299953913"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay1.uni-muenster.de with ESMTP; 23 Mar 2010 23:25:41 +0100
Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id 772E91B0768; Tue, 23 Mar 2010 23:25:41 +0100 (CET)
Date: Tue, 23 Mar 2010 23:25:41 +0100 (CET)
From: Alexander Best 
Sender: 
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: John Baldwin 
Message-ID: 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r205536 - in head: lib/libc/sys sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 22:25:44 -0000

thanks a bunch. :)

-- 
Alexander Best

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 22:35:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA53F106566B;
	Tue, 23 Mar 2010 22:35:52 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A99358FC18;
	Tue, 23 Mar 2010 22:35:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NMZqnd008827;
	Tue, 23 Mar 2010 22:35:52 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMZqB3008825;
	Tue, 23 Mar 2010 22:35:52 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003232235.o2NMZqB3008825@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 23 Mar 2010 22:35:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205557 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 22:35:52 -0000

Author: jkim
Date: Tue Mar 23 22:35:52 2010
New Revision: 205557
URL: http://svn.freebsd.org/changeset/base/205557

Log:
  Map entire video memory again.  This is a partial backout of r203535.
  Although we do not use them all directly, it seems VGA render may access
  unmapped memory region and cause kernel panic.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Mar 23 22:24:02 2010	(r205556)
+++ head/sys/dev/fb/vesa.c	Tue Mar 23 22:35:52 2010	(r205557)
@@ -1209,7 +1209,7 @@ vesa_set_mode(video_adapter_t *adp, int 
 			int10_set_mode(adp->va_initial_bios_mode);
 			if (adp->va_info.vi_flags & V_INFO_LINEAR)
 				pmap_unmapdev(adp->va_buffer,
-				    adp->va_buffer_size);
+				    vesa_adp_info->v_memsize * 64 * 1024);
 			/* 
 			 * Once (*prevvidsw->get_info)() succeeded, 
 			 * (*prevvidsw->set_mode)() below won't fail...
@@ -1246,7 +1246,8 @@ vesa_set_mode(video_adapter_t *adp, int 
 		adp->va_flags |= V_ADP_DAC8;
 
 	if (adp->va_info.vi_flags & V_INFO_LINEAR)
-		pmap_unmapdev(adp->va_buffer, adp->va_buffer_size);
+		pmap_unmapdev(adp->va_buffer,
+		    vesa_adp_info->v_memsize * 64 * 1024);
 
 #if VESA_DEBUG > 0
 	printf("VESA: mode set!\n");
@@ -1263,7 +1264,7 @@ vesa_set_mode(video_adapter_t *adp, int 
 #endif
 		vesa_adp->va_buffer =
 		    (vm_offset_t)pmap_mapdev_attr(info.vi_buffer,
-		    info.vi_buffer_size, PAT_WRITE_COMBINING);
+		    vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING);
 		vesa_adp->va_window = vesa_adp->va_buffer;
 		vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes;
 		vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes;

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 22:50:23 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11B6C106566B;
	Tue, 23 Mar 2010 22:50:23 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB07E8FC14;
	Tue, 23 Mar 2010 22:50:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NMoMgo012109;
	Tue, 23 Mar 2010 22:50:22 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMoMWL012107;
	Tue, 23 Mar 2010 22:50:22 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003232250.o2NMoMWL012107@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 23 Mar 2010 22:50:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205558 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 22:50:23 -0000

Author: jkim
Date: Tue Mar 23 22:50:22 2010
New Revision: 205558
URL: http://svn.freebsd.org/changeset/base/205558

Log:
  Fall back to VGA palette functions if VESA function failed and DAC is still
  in 6-bit mode.  Although we have to check non-VGA compatibility bit here,
  it seems there are too many broken VESA BIOSes out to rely on it.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Mar 23 22:35:52 2010	(r205557)
+++ head/sys/dev/fb/vesa.c	Tue Mar 23 22:50:22 2010	(r205558)
@@ -1241,7 +1241,6 @@ vesa_set_mode(video_adapter_t *adp, int 
 
 	if ((vesa_adp_info->v_flags & V_DAC8) != 0 &&
 	    (info.vi_flags & V_INFO_GRAPHICS) != 0 &&
-	    (info.vi_flags & V_INFO_NONVGA) != 0 &&
 	    vesa_bios_set_dac(8) > 6)
 		adp->va_flags |= V_ADP_DAC8;
 
@@ -1323,10 +1322,12 @@ vesa_save_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_save_palette(0, 256, palette, bits));
+		if (vesa_bios_save_palette(0, 256, palette, bits) == 0)
+			return (0);
+		if (bits > 6)
+			return (1);
 	}
 
 	return ((*prevvidsw->save_palette)(adp, palette));
@@ -1337,10 +1338,12 @@ vesa_load_palette(video_adapter_t *adp, 
 {
 	int bits;
 
-	if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
-	    (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+	if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
-		return (vesa_bios_load_palette(0, 256, palette, bits));
+		if (vesa_bios_load_palette(0, 256, palette, bits) == 0)
+			return (0);
+		if (bits > 6)
+			return (1);
 	}
 
 	return ((*prevvidsw->load_palette)(adp, palette));
@@ -1545,8 +1548,6 @@ get_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);
@@ -1583,8 +1584,6 @@ set_palette(video_adapter_t *adp, int ba
 		return (1);
 	if (!VESA_MODE(adp->va_mode))
 		return (1);
-	if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
-		return (1);
 
 	bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 	r = malloc(count * 3, M_DEVBUF, M_WAITOK);

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:00:35 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2E6A1065670;
	Tue, 23 Mar 2010 23:00:35 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1E258FC0A;
	Tue, 23 Mar 2010 23:00:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NN0ZAj014549;
	Tue, 23 Mar 2010 23:00:35 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NN0ZTj014546;
	Tue, 23 Mar 2010 23:00:35 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003232300.o2NN0ZTj014546@svn.freebsd.org>
From: Xin LI 
Date: Tue, 23 Mar 2010 23:00:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205561 - head/contrib/netcat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:00:36 -0000

Author: delphij
Date: Tue Mar 23 23:00:35 2010
New Revision: 205561
URL: http://svn.freebsd.org/changeset/base/205561

Log:
  MFV: Update nc to the version from OpenBSD 4.7.
  
  MFC after:	1 month

Modified:
  head/contrib/netcat/nc.1
  head/contrib/netcat/netcat.c
Directory Properties:
  head/contrib/netcat/   (props changed)

Modified: head/contrib/netcat/nc.1
==============================================================================
--- head/contrib/netcat/nc.1	Tue Mar 23 22:56:53 2010	(r205560)
+++ head/contrib/netcat/nc.1	Tue Mar 23 23:00:35 2010	(r205561)
@@ -1,4 +1,4 @@
-.\"     $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $
+.\"     $OpenBSD: nc.1,v 1.53 2010/02/23 23:00:52 schwarze Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 5 2009
+.Dd February 23, 2010
 .Dt NC 1
 .Os
 .Sh NAME
@@ -51,8 +51,8 @@
 .Op Fl X Ar proxy_protocol
 .Oo Xo
 .Fl x Ar proxy_address Ns Oo : Ns
-.Ar port Oc Oc
-.Xc
+.Ar port Oc
+.Xc Oc
 .Op Ar hostname
 .Op Ar port
 .Ek
@@ -206,7 +206,9 @@ This makes it possible to use
 .Nm
 to script telnet sessions.
 .It Fl U
-Specifies to use Unix Domain Sockets.
+Specifies to use
+.Ux Ns -domain
+sockets.
 .It Fl u
 Use UDP instead of the default option of TCP.
 .It Fl V Ar fib
@@ -428,7 +430,9 @@ outgoing traffic only.
 .Pp
 .Dl $ nc -e 'out ipsec esp/transport//require' host.example.com 42
 .Pp
-Create and listen on a Unix Domain Socket:
+Create and listen on a
+.Ux Ns -domain
+socket:
 .Pp
 .Dl $ nc -lU /var/tmp/dsocket
 .Pp

Modified: head/contrib/netcat/netcat.c
==============================================================================
--- head/contrib/netcat/netcat.c	Tue Mar 23 22:56:53 2010	(r205560)
+++ head/contrib/netcat/netcat.c	Tue Mar 23 23:00:35 2010	(r205561)
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */
+/* $OpenBSD: netcat.c,v 1.95 2010/02/27 00:58:56 nicm Exp $ */
 /*
  * Copyright (c) 2001 Eric Jackson 
  *
@@ -455,8 +455,10 @@ main(int argc, char *argv[])
 					    uflag ? "udp" : "tcp");
 				}
 
-				printf("Connection to %s %s port [%s/%s] succeeded!\n",
-				    host, portlist[i], uflag ? "udp" : "tcp",
+				fprintf(stderr,
+				    "Connection to %s %s port [%s/%s] "
+				    "succeeded!\n", host, portlist[i],
+				    uflag ? "udp" : "tcp",
 				    sv ? sv->s_name : "*");
 			}
 			if (!zflag)
@@ -749,27 +751,27 @@ atelnet(int nfd, unsigned char *buf, uns
 	unsigned char *p, *end;
 	unsigned char obuf[4];
 
-	end = buf + size;
-	obuf[0] = '\0';
+	if (size < 3)
+		return;
+	end = buf + size - 2;
 
 	for (p = buf; p < end; p++) {
 		if (*p != IAC)
-			break;
+			continue;
 
 		obuf[0] = IAC;
 		p++;
 		if ((*p == WILL) || (*p == WONT))
 			obuf[1] = DONT;
-		if ((*p == DO) || (*p == DONT))
+		else if ((*p == DO) || (*p == DONT))
 			obuf[1] = WONT;
-		if (obuf) {
-			p++;
-			obuf[2] = *p;
-			obuf[3] = '\0';
-			if (atomicio(vwrite, nfd, obuf, 3) != 3)
-				warn("Write Error!");
-			obuf[0] = '\0';
-		}
+		else
+			continue;
+
+		p++;
+		obuf[2] = *p;
+		if (atomicio(vwrite, nfd, obuf, 3) != 3)
+			warn("Write Error!");
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:03:31 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E228106564A;
	Tue, 23 Mar 2010 23:03:31 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D7BC8FC1C;
	Tue, 23 Mar 2010 23:03:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NN3VjM015211;
	Tue, 23 Mar 2010 23:03:31 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NN3Vfx015209;
	Tue, 23 Mar 2010 23:03:31 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201003232303.o2NN3Vfx015209@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 23 Mar 2010 23:03:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205562 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:03:31 -0000

Author: rmacklem
Date: Tue Mar 23 23:03:30 2010
New Revision: 205562
URL: http://svn.freebsd.org/changeset/base/205562

Log:
  When the regular NFS server replied to a UDP client out of the replay
  cache, it did not free the request argument mbuf list, resulting in a leak.
  This patch fixes that leak.
  
  Tested by:	danny AT cs.huji.ac.il
  PR:		kern/144330
  Submitted by:	to.my.trociny AT gmail.com (earlier version)
  Reviewed by:	dfr
  MFC after:	2 weeks

Modified:
  head/sys/rpc/svc.c

Modified: head/sys/rpc/svc.c
==============================================================================
--- head/sys/rpc/svc.c	Tue Mar 23 23:00:35 2010	(r205561)
+++ head/sys/rpc/svc.c	Tue Mar 23 23:03:30 2010	(r205562)
@@ -819,9 +819,11 @@ svc_getreq(SVCXPRT *xprt, struct svc_req
 					free(r->rq_addr, M_SONAME);
 					r->rq_addr = NULL;
 				}
+				m_freem(args);
 				goto call_done;
 
 			default:
+				m_freem(args);
 				goto call_done;
 			}
 		}

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:10:17 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86810106566C;
	Tue, 23 Mar 2010 23:10:17 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 74EB18FC18;
	Tue, 23 Mar 2010 23:10:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NNAHbO016765;
	Tue, 23 Mar 2010 23:10:17 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NNAHAD016763;
	Tue, 23 Mar 2010 23:10:17 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003232310.o2NNAHAD016763@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 23 Mar 2010 23:10:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205564 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:10:17 -0000

Author: jkim
Date: Tue Mar 23 23:10:17 2010
New Revision: 205564
URL: http://svn.freebsd.org/changeset/base/205564

Log:
  Be extremely careful when we determine bytes per scan line information.
  First, we compare mode table data against minimum value.  If the mode table
  does not make sense, we set the minimum in the mode info.  When we actually
  set the mode, we try VESA BIOS function and compare it against the previous
  value.  If it makes more sense, update the information.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Mar 23 23:09:38 2010	(r205563)
+++ head/sys/dev/fb/vesa.c	Tue Mar 23 23:10:17 2010	(r205564)
@@ -188,9 +188,7 @@ static int vesa_bios_load_palette2(int s
 #define STATE_ALL	(STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
 static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
-#if 0
 static int vesa_bios_get_line_length(void);
-#endif
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
 #if 0
 static int vesa_bios_get_start(int *x, int *y);
@@ -199,6 +197,7 @@ static int vesa_bios_set_start(int x, in
 static int vesa_map_gen_mode_num(int type, int color, int mode);
 static int vesa_translate_flags(u_int16_t vflags);
 static int vesa_translate_mmodel(u_int8_t vmodel);
+static int vesa_get_bpscanline(struct vesa_mode *vmode);
 static int vesa_bios_init(void);
 static void vesa_clear_modes(video_info_t *info, int color);
 
@@ -558,7 +557,6 @@ vesa_bios_save_restore(int code, void *p
 	return (regs.R_AX != 0x004f);
 }
 
-#if 0
 static int
 vesa_bios_get_line_length(void)
 {
@@ -575,7 +573,6 @@ vesa_bios_get_line_length(void)
 
 	return (regs.R_BX);
 }
-#endif
 
 static int
 vesa_bios_set_line_length(int pixel, int *bytes, int *lines)
@@ -709,6 +706,43 @@ vesa_translate_mmodel(u_int8_t vmodel)
 	return (V_INFO_MM_OTHER);
 }
 
+static int
+vesa_get_bpscanline(struct vesa_mode *vmode)
+{
+	int bpsl;
+
+	if ((vmode->v_modeattr & V_MODEGRAPHICS) != 0) {
+		/* Find the minimum length. */
+		switch (vmode->v_bpp / vmode->v_planes) {
+		case 1:
+			bpsl = vmode->v_width / 8;
+			break;
+		case 2:
+			bpsl = vmode->v_width / 4;
+			break;
+		case 4:
+			bpsl = vmode->v_width / 2;
+			break;
+		default:
+			bpsl = vmode->v_width * ((vmode->v_bpp + 7) / 8);
+			bpsl /= vmode->v_planes;
+			break;
+		}
+
+		/* Use VBE 3.0 information if it looks sane. */
+		if ((vmode->v_modeattr & V_MODELFB) != 0 &&
+		    vesa_adp_info->v_version >= 0x0300 &&
+		    vmode->v_linbpscanline > bpsl)
+			return (vmode->v_linbpscanline);
+
+		/* Return the minimum if the mode table looks absurd. */
+		if (vmode->v_bpscanline < bpsl)
+			return (bpsl);
+	}
+
+	return (vmode->v_bpscanline);
+}
+
 #define	VESA_MAXSTR		256
 
 #define	VESA_STRCPY(dst, src)	do {				\
@@ -733,7 +767,6 @@ vesa_bios_init(void)
 	void *vmbuf;
 	uint32_t offs;
 	uint16_t vers;
-	int bpsl;
 	int is_via_cle266;
 	int modes;
 	int i;
@@ -858,9 +891,7 @@ vesa_bios_init(void)
 		}
 #endif
 
-		bpsl = (vmode.v_modeattr & V_MODELFB) != 0 && vers >= 0x0300 ?
-		    vmode.v_linbpscanline : vmode.v_bpscanline;
-		bsize = bpsl * vmode.v_height;
+		bsize = vesa_get_bpscanline(&vmode) * vmode.v_height;
 		if ((vmode.v_modeattr & V_MODEGRAPHICS) != 0)
 			bsize *= vmode.v_planes;
 
@@ -1181,6 +1212,7 @@ static int
 vesa_set_mode(video_adapter_t *adp, int mode)
 {
 	video_info_t info;
+	int bpsl;
 
 	if (adp != vesa_adp)
 		return ((*prevvidsw->set_mode)(adp, mode));
@@ -1257,6 +1289,20 @@ vesa_set_mode(video_adapter_t *adp, int 
 		(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
 	vesa_adp->va_crtc_addr =
 		(vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
+
+	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
+	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+		vesa_adp->va_line_width /= info.vi_planes;
+
+	/* If VBE function returns bigger bytes per scan line, use it. */
+	bpsl = vesa_bios_get_line_length();
+	if (bpsl > vesa_adp->va_line_width) {
+		vesa_adp->va_line_width = bpsl;
+		info.vi_buffer_size = bpsl * info.vi_height;
+		if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+			info.vi_buffer_size *= info.vi_planes;
+	}
+
 	if (info.vi_flags & V_INFO_LINEAR) {
 #if VESA_DEBUG > 1
 		printf("VESA: setting up LFB\n");
@@ -1275,9 +1321,6 @@ vesa_set_mode(video_adapter_t *adp, int 
 	}
 	vesa_adp->va_buffer_size = info.vi_buffer_size;
 	vesa_adp->va_window_orig = 0;
-	vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height;
-	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
-		vesa_adp->va_line_width /= info.vi_planes;
 	vesa_adp->va_disp_start.x = 0;
 	vesa_adp->va_disp_start.y = 0;
 #if VESA_DEBUG > 0

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:19:23 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 70526106564A;
	Tue, 23 Mar 2010 23:19:23 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5FB948FC1C;
	Tue, 23 Mar 2010 23:19:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NNJNZd018926;
	Tue, 23 Mar 2010 23:19:23 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NNJNs9018924;
	Tue, 23 Mar 2010 23:19:23 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003232319.o2NNJNs9018924@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 23 Mar 2010 23:19:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205566 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:19:23 -0000

Author: jkim
Date: Tue Mar 23 23:19:23 2010
New Revision: 205566
URL: http://svn.freebsd.org/changeset/base/205566

Log:
  Add my copyright here.  It seems I have contributed enough code. :-)

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Mar 23 23:16:35 2010	(r205565)
+++ head/sys/dev/fb/vesa.c	Tue Mar 23 23:19:23 2010	(r205566)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
+ * Copyright (c) 2009-2010 Jung-uk Kim 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:46:29 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C99E106566B;
	Tue, 23 Mar 2010 23:46:29 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E54F68FC13;
	Tue, 23 Mar 2010 23:46:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NNkS1s025083;
	Tue, 23 Mar 2010 23:46:28 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NNkSEK025081;
	Tue, 23 Mar 2010 23:46:28 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003232346.o2NNkSEK025081@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 23 Mar 2010 23:46:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205569 - head/sys/powerpc/mpc85xx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:46:29 -0000

Author: marcel
Date: Tue Mar 23 23:46:28 2010
New Revision: 205569
URL: http://svn.freebsd.org/changeset/base/205569

Log:
  Fix an off-by-one bug for the number of slots on a PCI/PCI-X bus.
  We failed to setup PCI devices on slot 31 and that's where the
  SATA controller is for the P2020 eval board.

Modified:
  head/sys/powerpc/mpc85xx/pci_ocp.c

Modified: head/sys/powerpc/mpc85xx/pci_ocp.c
==============================================================================
--- head/sys/powerpc/mpc85xx/pci_ocp.c	Tue Mar 23 23:28:14 2010	(r205568)
+++ head/sys/powerpc/mpc85xx/pci_ocp.c	Tue Mar 23 23:46:28 2010	(r205569)
@@ -264,7 +264,7 @@ pci_ocp_maxslots(device_t dev)
 {
 	struct pci_ocp_softc *sc = device_get_softc(dev);
 
-	return ((sc->sc_pcie_cap) ? 0 : 30);
+	return ((sc->sc_pcie_cap) ? 0 : 31);
 }
 
 static uint32_t
@@ -328,6 +328,7 @@ pci_ocp_probe(device_t dev)
 		return (ENXIO);
 
 	sc = device_get_softc(dev);
+	sc->sc_dev = dev;
 
 	sc->sc_rid = 0;
 	sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid,
@@ -492,7 +493,7 @@ pci_ocp_route_int(struct pci_ocp_softc *
 }
 
 static int
-pci_ocp_init(struct pci_ocp_softc *sc, int bus, int maxslot)
+pci_ocp_init(struct pci_ocp_softc *sc, int bus, int nslots)
 {
 	int secbus, slot;
 	int func, maxfunc;
@@ -502,7 +503,7 @@ pci_ocp_init(struct pci_ocp_softc *sc, i
 	uint8_t intline, intpin;
 
 	secbus = bus;
-	for (slot = 0; slot < maxslot; slot++) {
+	for (slot = 0; slot < nslots; slot++) {
 		maxfunc = 0;
 		for (func = 0; func <= maxfunc; func++) {
 			hdrtype = pci_ocp_read_config(sc->sc_dev, bus, slot,
@@ -599,7 +600,7 @@ pci_ocp_init(struct pci_ocp_softc *sc, i
 			    PCIR_SUBBUS_1, 0xff, 1);
 
 			secbus = pci_ocp_init(sc, secbus,
-			    (subclass == PCIS_BRIDGE_PCI) ? 31 : 1);
+			    (subclass == PCIS_BRIDGE_PCI) ? 32 : 1);
 
 			pci_ocp_write_config(sc->sc_dev, bus, slot, func,
 			    PCIR_SUBBUS_1, secbus, 1);
@@ -721,7 +722,7 @@ pci_ocp_attach(device_t dev)
 {
 	struct pci_ocp_softc *sc;
 	uint32_t cfgreg;
-	int error, maxslot;
+	int error, nslots;
 
 	sc = device_get_softc(dev);
 	sc->sc_dev = dev;
@@ -765,8 +766,8 @@ pci_ocp_attach(device_t dev)
 			return (0);
 	}
 
-	maxslot = (sc->sc_pcie_cap) ? 1 : 31;
-	pci_ocp_init(sc, sc->sc_busnr, maxslot);
+	nslots = (sc->sc_pcie_cap) ? 1 : 32;
+	pci_ocp_init(sc, sc->sc_busnr, nslots);
 
 	device_add_child(dev, "pci", -1);
 	return (bus_generic_attach(dev));

From owner-svn-src-head@FreeBSD.ORG  Tue Mar 23 23:56:22 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C1FCE106564A;
	Tue, 23 Mar 2010 23:56:22 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B101F8FC13;
	Tue, 23 Mar 2010 23:56:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2NNuMSj027264;
	Tue, 23 Mar 2010 23:56:22 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NNuMVA027261;
	Tue, 23 Mar 2010 23:56:22 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003232356.o2NNuMVA027261@svn.freebsd.org>
From: Xin LI 
Date: Tue, 23 Mar 2010 23:56:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205570 - head/contrib/netcat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 23 Mar 2010 23:56:22 -0000

Author: delphij
Date: Tue Mar 23 23:56:22 2010
New Revision: 205570
URL: http://svn.freebsd.org/changeset/base/205570

Log:
  Update metadata information as well as upgrade instructions.

Modified:
  head/contrib/netcat/FREEBSD-upgrade
  head/contrib/netcat/FREEBSD-vendor

Modified: head/contrib/netcat/FREEBSD-upgrade
==============================================================================
--- head/contrib/netcat/FREEBSD-upgrade	Tue Mar 23 23:46:28 2010	(r205569)
+++ head/contrib/netcat/FREEBSD-upgrade	Tue Mar 23 23:56:22 2010	(r205570)
@@ -1,19 +1,14 @@
 $FreeBSD$
 
-1. Export from OpenBSD's nc(1) into an empty directory (say "v-nc").
-2. while read pattern; do rm ${pattern} ; done < FREEBSD-Xlist
-3. Checkout our contrib/netcat to another directory (say "f-nc"),
-   with -rOPENBSD, and usr.bin/nc to its ../../
-4. copy the files from v-nc to f-nc
-5. do cvs up -A in f-nc
-6. If there is conflicits, try to resolve them.
-7. do build in f-nc/../../usr.bin/nc
-8. If everything seems ok, do the actual import in v-nc:
-	cvs -n import src/contrib/netcat OPENBSD OPENBSD_
-   Everything appears be Ok? Do:
-	cvs import src/contrib/netcat OPENBSD OPENBSD_
-   (note: recently we import from OpenBSD's release branches
-    rather than importing -HEAD snapshots)
-9. Resolve the conflicits with the patchset obtained in step 6.
+Most of the instructions is outlined on FreeBSD wiki at:
 
-delphij@FreeBSD.org - 21 Apr 2008
+	http://wiki.freebsd.org/SubversionPrimer/VendorImports
+
+nc(1) is very small and most of code are just copied as-is from OpenBSD.  With a
+few exceptions:
+
+ * --no-tcpopt: Local feature specific to FreeBSD.
+ * -V: We use FIB to map what OpenBSD do for "rdomain"
+ * -E, -e: These are mostly self contained IPsec extensions
+
+delphij@FreeBSD.org - Mar 23, 2010

Modified: head/contrib/netcat/FREEBSD-vendor
==============================================================================
--- head/contrib/netcat/FREEBSD-vendor	Tue Mar 23 23:46:28 2010	(r205569)
+++ head/contrib/netcat/FREEBSD-vendor	Tue Mar 23 23:56:22 2010	(r205570)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 Project:	netcat (aka src/usr.bin/nc in OpenBSD)
 ProjectURL:	http://www.openbsd.org/
-Version:	4.6
+Version:	4.7
 License:	BSD

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 02:02:02 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97FC2106566C;
	Wed, 24 Mar 2010 02:02:02 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 872198FC08;
	Wed, 24 Mar 2010 02:02:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2O222Vs055173;
	Wed, 24 Mar 2010 02:02:02 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2O222m4055171;
	Wed, 24 Mar 2010 02:02:02 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201003240202.o2O222m4055171@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 24 Mar 2010 02:02:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205572 - head/sys/fs/nfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 02:02:02 -0000

Author: rmacklem
Date: Wed Mar 24 02:02:02 2010
New Revision: 205572
URL: http://svn.freebsd.org/changeset/base/205572

Log:
  Fix the experimental NFS subsystem so that it uses the correct
  preprocessor macro name for not requiring strict data alignment.
  
  Suggested by:	marius
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonport.c

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Wed Mar 24 01:37:00 2010	(r205571)
+++ head/sys/fs/nfs/nfs_commonport.c	Wed Mar 24 02:02:02 2010	(r205572)
@@ -117,7 +117,7 @@ struct mtx nfs_slock_mutex;
 /* local functions */
 static int nfssvc_call(struct thread *, struct nfssvc_args *, struct ucred *);
 
-#if defined(__i386__)
+#ifdef __NO_STRICT_ALIGNMENT
 /*
  * These architectures don't need re-alignment, so just return.
  */
@@ -127,7 +127,7 @@ newnfs_realign(struct mbuf **pm)
 
 	return;
 }
-#else
+#else	/* !__NO_STRICT_ALIGNMENT */
 /*
  *	newnfs_realign:
  *
@@ -185,7 +185,7 @@ newnfs_realign(struct mbuf **pm)
 		pm = &m->m_next;
 	}
 }
-#endif	/* !__i386__ */
+#endif	/* __NO_STRICT_ALIGNMENT */
 
 #ifdef notdef
 static void

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 02:23:00 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD002106566C;
	Wed, 24 Mar 2010 02:23:00 +0000 (UTC)
	(envelope-from onemda@gmail.com)
Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54])
	by mx1.freebsd.org (Postfix) with ESMTP id A91E08FC1B;
	Wed, 24 Mar 2010 02:22:59 +0000 (UTC)
Received: by wwf26 with SMTP id 26so1437549wwf.13
	for ; Tue, 23 Mar 2010 19:22:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=qfYnfqEOKklY/7aEhLyskpPotHljiWs3A4ri216tTpI=;
	b=X9k8XEBr9rH43YYc01+tcWO3QG0l3u0AbbwE5mhVzz5FZKB3CVyf1qu3amVnOTQpmB
	KZ+WJ612nKRDD96a58rg+mjHPa15YSaEsNnaEIEMYvvQe0YtdGQF+DKAohbEFrQLVY3o
	JY1WXjLrpRpJOrxDRhQWaqcctYYDyYSwlpcSU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=dPfl2Z4vgj5iT7w2OJWm7E5jhU0/AlGPr6TOGKA1dkYRCA3MWgMvdWfDnhYl8cUfBb
	2nohalHQYuWjBBdv355fVrUMlyURNOccEDvyS3/IkM+6s9HWRkk64CbgamNoZ5r+rbdI
	yzt19M4wcJA0i86ZIKdNP0U05O9bUpJ+5KYbU=
MIME-Version: 1.0
Received: by 10.216.87.67 with SMTP id x45mr942426wee.18.1269397378290; Tue, 
	23 Mar 2010 19:22:58 -0700 (PDT)
In-Reply-To: <20100323205117.GG2415@deviant.kiev.zoral.com.ua>
References: <201003221152.o2MBqs9M012769@svn.freebsd.org>
	<201003220849.36246.jhb@freebsd.org>
	<20100322152334.GA24534@sandvine.com> <20100323192131.GF32142@hoeg.nl>
	<20100323200253.GF2415@deviant.kiev.zoral.com.ua>
	<3a142e751003231335x58179a0aqcbd6ea328c04409d@mail.gmail.com>
	<20100323205117.GG2415@deviant.kiev.zoral.com.ua>
Date: Wed, 24 Mar 2010 03:22:57 +0100
Message-ID: <3a142e751003231922q39386b7elb6cd6945652a7291@mail.gmail.com>
From: Paul B Mahol 
To: Kostik Belousov 
Content-Type: text/plain; charset=ISO-8859-1
Cc: Ed Schouten , src-committers@freebsd.org,
	Ed Maste , John Baldwin ,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r205444 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 02:23:00 -0000

On 3/23/10, Kostik Belousov  wrote:
> On Tue, Mar 23, 2010 at 09:35:09PM +0100, Paul B Mahol wrote:
>> On 3/23/10, Kostik Belousov  wrote:
>> > On Tue, Mar 23, 2010 at 08:21:31PM +0100, Ed Schouten wrote:
>> >> * Ed Maste  wrote:
>> >> > I was just about to follow up with a comment to that effect.  We do
>> >> > want
>> >> > it to become a panic, but I would prefer to hold off until we address
>> >> > the known issue with padlock(4).
>> >>
>> >> I have seen this message appear when using the ndisulator as well. How
>> >> are we going to solve it in this case? Could the ndisulator be extended
>> >> to prepare a FPU context using kib's new API?
>> >
>> > I looked at http://msdn.microsoft.com/en-us/library/aa489566.aspx
>> > after someone mentioned ndisulator. It seems that windows requires
>> > that i386 drivers carefully use braces for use of FPU, while amd64
>> > code allowed to use it freely. That suggests that windows clears
>> > TS on kernel mode entry or driver calls, that seems to be too
>> > wastefull.
>> >
>> > I would very much appreciate the help with changing both ndis and
>> > padlock to use fpu_kern_enter/leave KPI, since I do not use them.
>> > I need some time to polish the patch before.
>> >
>>
>> I saw fpudna only on amd64, but I never managed to get ndisulator
>> fully working on amd64 (at least with broadcom card/driver).
>
> I cannot find KeSaveFloatingPointState symbol defined by ndisulator.
> Could it be that it is a macro or inline function that expands to
> proper assembly for i386, and nop on amd64 ? That would explain
> your observation.

I have never found any driver that reports such symbol missing when loaded.

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 03:07:36 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 142771065672;
	Wed, 24 Mar 2010 03:07:36 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 026558FC12;
	Wed, 24 Mar 2010 03:07:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2O37Zht069683;
	Wed, 24 Mar 2010 03:07:35 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2O37ZdI069679;
	Wed, 24 Mar 2010 03:07:35 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201003240307.o2O37ZdI069679@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 24 Mar 2010 03:07:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205573 - in head/sys/i386: i386 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 03:07:36 -0000

Author: alc
Date: Wed Mar 24 03:07:35 2010
New Revision: 205573
URL: http://svn.freebsd.org/changeset/base/205573

Log:
  Adapt r204907 and r205402, the amd64 implementation of the workaround for
  AMD Family 10h Erratum 383, to i386.
  
  Enable machine check exceptions by default, just like r204913 for amd64.
  
  Enable superpage promotion only if the processor actually supports large
  pages, i.e., PG_PS.
  
  MFC after:	2 weeks

Modified:
  head/sys/i386/i386/mca.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/include/md_var.h
  head/sys/i386/include/specialreg.h

Modified: head/sys/i386/i386/mca.c
==============================================================================
--- head/sys/i386/i386/mca.c	Wed Mar 24 02:02:02 2010	(r205572)
+++ head/sys/i386/i386/mca.c	Wed Mar 24 03:07:35 2010	(r205573)
@@ -60,11 +60,20 @@ static int mca_count;		/* Number of reco
 
 SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, "Machine Check Architecture");
 
-static int mca_enabled = 0;
+static int mca_enabled = 1;
 TUNABLE_INT("hw.mca.enabled", &mca_enabled);
 SYSCTL_INT(_hw_mca, OID_AUTO, enabled, CTLFLAG_RDTUN, &mca_enabled, 0,
     "Administrative toggle for machine check support");
 
+static int amd10h_L1TP = 1;
+TUNABLE_INT("hw.mca.amd10h_L1TP", &amd10h_L1TP);
+SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0,
+    "Administrative toggle for logging of level one TLB parity (L1TP) errors");
+
+int workaround_erratum383;
+SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0,
+    "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?");
+
 static STAILQ_HEAD(, mca_internal) mca_records;
 static struct callout mca_timer;
 static int mca_ticks = 3600;	/* Check hourly by default. */
@@ -527,7 +536,7 @@ void
 mca_init(void)
 {
 	uint64_t mcg_cap;
-	uint64_t ctl;
+	uint64_t ctl, mask;
 	int skip;
 	int i;
 
@@ -535,6 +544,15 @@ mca_init(void)
 	if (!mca_enabled || !(cpu_feature & CPUID_MCE))
 		return;
 
+	/*
+	 * On AMD Family 10h processors, unless logging of level one TLB
+	 * parity (L1TP) errors is disabled, enable the recommended workaround
+	 * for Erratum 383.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_AMD &&
+	    CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP)
+		workaround_erratum383 = 1;
+
 	if (cpu_feature & CPUID_MCA) {
 		if (PCPU_GET(cpuid) == 0)
 			mca_setup();
@@ -545,6 +563,19 @@ mca_init(void)
 			/* Enable MCA features. */
 			wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE);
 
+		/*
+		 * Disable logging of level one TLB parity (L1TP) errors by
+		 * the data cache as an alternative workaround for AMD Family
+		 * 10h Erratum 383.  Unlike the recommended workaround, there
+		 * is no performance penalty to this workaround.  However,
+		 * L1TP errors will go unreported.
+		 */
+		if (cpu_vendor_id == CPU_VENDOR_AMD &&
+		    CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) {
+			mask = rdmsr(MSR_MC0_CTL_MASK);
+			if ((mask & (1UL << 5)) == 0)
+				wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5));
+		}
 		for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) {
 			/* By default enable logging of all errors. */
 			ctl = 0xffffffffffffffffUL;

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Mar 24 02:02:02 2010	(r205572)
+++ head/sys/i386/i386/pmap.c	Wed Mar 24 03:07:35 2010	(r205573)
@@ -5,7 +5,7 @@
  * All rights reserved.
  * Copyright (c) 1994 David Greenman
  * All rights reserved.
- * Copyright (c) 2005-2008 Alan L. Cox 
+ * Copyright (c) 2005-2010 Alan L. Cox 
  * All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
@@ -297,6 +297,7 @@ static void pmap_insert_pt_page(pmap_t p
 static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte);
 static boolean_t pmap_is_modified_pvh(struct md_page *pvh);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
+static void pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde);
 static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va);
 static void pmap_pde_attr(pd_entry_t *pde, int cache_bits);
 static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va);
@@ -315,6 +316,9 @@ static void pmap_remove_entry(struct pma
 static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m);
 static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va,
     vm_page_t m);
+static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde,
+    pd_entry_t newpde);
+static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde);
 
 static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags);
 
@@ -380,6 +384,13 @@ pmap_bootstrap(vm_paddr_t firstaddr)
 	kernel_pmap->pm_active = -1;	/* don't allow deactivation */
 	TAILQ_INIT(&kernel_pmap->pm_pvchunk);
 	LIST_INIT(&allpmaps);
+
+	/*
+	 * Request a spin mutex so that changes to allpmaps cannot be
+	 * preempted by smp_rendezvous_cpus().  Otherwise,
+	 * pmap_update_pde_kernel() could access allpmaps while it is
+	 * being changed.
+	 */
 	mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN);
 	mtx_lock_spin(&allpmaps_lock);
 	LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list);
@@ -692,19 +703,21 @@ pmap_init(void)
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 
 	/*
-	 * Disable large page mappings by default if the kernel is running in
-	 * a virtual machine on an AMD Family 10h processor.  This is a work-
-	 * around for Erratum 383.
+	 * If the kernel is running in a virtual machine on an AMD Family 10h
+	 * processor, then it must assume that MCA is enabled by the virtual
+	 * machine monitor.
 	 */
 	if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD &&
 	    CPUID_TO_FAMILY(cpu_id) == 0x10)
-		pg_ps_enabled = 0;
+		workaround_erratum383 = 1;
 
 	/*
-	 * Are large page mappings enabled?
+	 * Are large page mappings supported and enabled?
 	 */
 	TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled);
-	if (pg_ps_enabled) {
+	if (pseflag == 0)
+		pg_ps_enabled = 0;
+	else if (pg_ps_enabled) {
 		KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0,
 		    ("pmap_init: can't assign to pagesizes[1]"));
 		pagesizes[1] = NBPDR;
@@ -850,6 +863,66 @@ pmap_cache_bits(int mode, boolean_t is_p
 		cache_bits |= PG_NC_PWT;
 	return (cache_bits);
 }
+
+/*
+ * The caller is responsible for maintaining TLB consistency.
+ */
+static void
+pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde)
+{
+	pd_entry_t *pde;
+	pmap_t pmap;
+	boolean_t PTD_updated;
+
+	PTD_updated = FALSE;
+	mtx_lock_spin(&allpmaps_lock);
+	LIST_FOREACH(pmap, &allpmaps, pm_list) {
+		if ((pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] &
+		    PG_FRAME))
+			PTD_updated = TRUE;
+		pde = pmap_pde(pmap, va);
+		pde_store(pde, newpde);
+	}
+	mtx_unlock_spin(&allpmaps_lock);
+	KASSERT(PTD_updated,
+	    ("pmap_kenter_pde: current page table is not in allpmaps"));
+}
+
+/*
+ * After changing the page size for the specified virtual address in the page
+ * table, flush the corresponding entries from the processor's TLB.  Only the
+ * calling processor's TLB is affected.
+ *
+ * The calling thread must be pinned to a processor.
+ */
+static void
+pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde)
+{
+	u_long cr4;
+
+	if ((newpde & PG_PS) == 0)
+		/* Demotion: flush a specific 2MB page mapping. */
+		invlpg(va);
+	else if ((newpde & PG_G) == 0)
+		/*
+		 * Promotion: flush every 4KB page mapping from the TLB
+		 * because there are too many to flush individually.
+		 */
+		invltlb();
+	else {
+		/*
+		 * Promotion: flush every 4KB page mapping from the TLB,
+		 * including any global (PG_G) mappings.
+		 */
+		cr4 = rcr4();
+		load_cr4(cr4 & ~CR4_PGE);
+		/*
+		 * Although preemption at this point could be detrimental to
+		 * performance, it would not lead to an error.
+		 */
+		load_cr4(cr4);
+	}
+}
 #ifdef SMP
 /*
  * For SMP, these functions have to use the IPI mechanism for coherence.
@@ -946,6 +1019,92 @@ pmap_invalidate_cache(void)
 	smp_cache_flush();
 	sched_unpin();
 }
+
+struct pde_action {
+	cpumask_t store;	/* processor that updates the PDE */
+	cpumask_t invalidate;	/* processors that invalidate their TLB */
+	vm_offset_t va;
+	pd_entry_t *pde;
+	pd_entry_t newpde;
+};
+
+static void
+pmap_update_pde_kernel(void *arg)
+{
+	struct pde_action *act = arg;
+	pd_entry_t *pde;
+	pmap_t pmap;
+
+	if (act->store == PCPU_GET(cpumask))
+		/*
+		 * Elsewhere, this operation requires allpmaps_lock for
+		 * synchronization.  Here, it does not because it is being
+		 * performed in the context of an all_cpus rendezvous.
+		 */
+		LIST_FOREACH(pmap, &allpmaps, pm_list) {
+			pde = pmap_pde(pmap, act->va);
+			pde_store(pde, act->newpde);
+		}
+}
+
+static void
+pmap_update_pde_user(void *arg)
+{
+	struct pde_action *act = arg;
+
+	if (act->store == PCPU_GET(cpumask))
+		pde_store(act->pde, act->newpde);
+}
+
+static void
+pmap_update_pde_teardown(void *arg)
+{
+	struct pde_action *act = arg;
+
+	if ((act->invalidate & PCPU_GET(cpumask)) != 0)
+		pmap_update_pde_invalidate(act->va, act->newpde);
+}
+
+/*
+ * Change the page size for the specified virtual address in a way that
+ * prevents any possibility of the TLB ever having two entries that map the
+ * same virtual address using different page sizes.  This is the recommended
+ * workaround for Erratum 383 on AMD Family 10h processors.  It prevents a
+ * machine check exception for a TLB state that is improperly diagnosed as a
+ * hardware error.
+ */
+static void
+pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
+{
+	struct pde_action act;
+	cpumask_t active, cpumask;
+
+	sched_pin();
+	cpumask = PCPU_GET(cpumask);
+	if (pmap == kernel_pmap)
+		active = all_cpus;
+	else
+		active = pmap->pm_active;
+	if ((active & PCPU_GET(other_cpus)) != 0) {
+		act.store = cpumask;
+		act.invalidate = active;
+		act.va = va;
+		act.pde = pde;
+		act.newpde = newpde;
+		smp_rendezvous_cpus(cpumask | active,
+		    smp_no_rendevous_barrier, pmap == kernel_pmap ?
+		    pmap_update_pde_kernel : pmap_update_pde_user,
+		    pmap_update_pde_teardown, &act);
+	} else {
+		if (pmap == kernel_pmap)
+			pmap_kenter_pde(va, newpde);
+		else
+			pde_store(pde, newpde);
+		if ((active & cpumask) != 0)
+			pmap_update_pde_invalidate(va, newpde);
+	}
+	sched_unpin();
+}
 #else /* !SMP */
 /*
  * Normal, non-SMP, 486+ invalidation functions.
@@ -983,6 +1142,18 @@ pmap_invalidate_cache(void)
 
 	wbinvd();
 }
+
+static void
+pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
+{
+
+	if (pmap == kernel_pmap)
+		pmap_kenter_pde(va, newpde);
+	else
+		pde_store(pde, newpde);
+	if (pmap == kernel_pmap || pmap->pm_active)
+		pmap_update_pde_invalidate(va, newpde);
+}
 #endif /* !SMP */
 
 void
@@ -1856,12 +2027,9 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTL
 void
 pmap_growkernel(vm_offset_t addr)
 {
-	struct pmap *pmap;
 	vm_paddr_t ptppaddr;
 	vm_page_t nkpg;
 	pd_entry_t newpdir;
-	pt_entry_t *pde;
-	boolean_t updated_PTD;
 
 	mtx_assert(&kernel_map->system_mtx, MA_OWNED);
 	if (kernel_vm_end == 0) {
@@ -1903,18 +2071,7 @@ pmap_growkernel(vm_offset_t addr)
 		newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M);
 		pdir_pde(KPTD, kernel_vm_end) = pgeflag | newpdir;
 
-		updated_PTD = FALSE;
-		mtx_lock_spin(&allpmaps_lock);
-		LIST_FOREACH(pmap, &allpmaps, pm_list) {
-			if ((pmap->pm_pdir[PTDPTDI] & PG_FRAME) == (PTDpde[0] &
-			    PG_FRAME))
-				updated_PTD = TRUE;
-			pde = pmap_pde(pmap, kernel_vm_end);
-			pde_store(pde, newpdir);
-		}
-		mtx_unlock_spin(&allpmaps_lock);
-		KASSERT(updated_PTD,
-		    ("pmap_growkernel: current page table is not in allpmaps"));
+		pmap_kenter_pde(kernel_vm_end, newpdir);
 		kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
 		if (kernel_vm_end - 1 >= kernel_map->max_offset) {
 			kernel_vm_end = kernel_map->max_offset;
@@ -2358,7 +2515,6 @@ static boolean_t
 pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va)
 {
 	pd_entry_t newpde, oldpde;
-	pmap_t allpmaps_entry;
 	pt_entry_t *firstpte, newpte;
 	vm_paddr_t mptepa;
 	vm_page_t free, mpte;
@@ -2464,25 +2620,11 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t 
 	 * processor changing the setting of PG_A and/or PG_M between
 	 * the read above and the store below. 
 	 */
-	if (pmap == kernel_pmap) {
-		/*
-		 * A harmless race exists between this loop and the bcopy()
-		 * in pmap_pinit() that initializes the kernel segment of
-		 * the new page table directory.  Specifically, that bcopy()
-		 * may copy the new PDE from the PTD to the new page table
-		 * before this loop updates that new page table.
-		 */
-		mtx_lock_spin(&allpmaps_lock);
-		LIST_FOREACH(allpmaps_entry, &allpmaps, pm_list) {
-			pde = pmap_pde(allpmaps_entry, va);
-			KASSERT(*pde == newpde || (*pde & PG_PTE_PROMOTE) ==
-			    (oldpde & PG_PTE_PROMOTE),
-			    ("pmap_demote_pde: pde was %#jx, expected %#jx",
-			    (uintmax_t)*pde, (uintmax_t)oldpde));
-			pde_store(pde, newpde);
-		}
-		mtx_unlock_spin(&allpmaps_lock);
-	} else
+	if (workaround_erratum383)
+		pmap_update_pde(pmap, va, pde, newpde);
+	else if (pmap == kernel_pmap)
+		pmap_kenter_pde(va, newpde);
+	else
 		pde_store(pde, newpde);	
 	if (firstpte == PADDR2)
 		mtx_unlock(&PMAP2mutex);
@@ -3001,7 +3143,6 @@ static void
 pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va)
 {
 	pd_entry_t newpde;
-	pmap_t allpmaps_entry;
 	pt_entry_t *firstpte, oldpte, pa, *pte;
 	vm_offset_t oldpteva;
 	vm_page_t mpte;
@@ -3105,14 +3246,11 @@ setpte:
 	/*
 	 * Map the superpage.
 	 */
-	if (pmap == kernel_pmap) {
-		mtx_lock_spin(&allpmaps_lock);
-		LIST_FOREACH(allpmaps_entry, &allpmaps, pm_list) {
-			pde = pmap_pde(allpmaps_entry, va);
-			pde_store(pde, PG_PS | newpde);
-		}
-		mtx_unlock_spin(&allpmaps_lock);
-	} else
+	if (workaround_erratum383)
+		pmap_update_pde(pmap, va, pde, PG_PS | newpde);
+	else if (pmap == kernel_pmap)
+		pmap_kenter_pde(va, PG_PS | newpde);
+	else
 		pde_store(pde, PG_PS | newpde);
 
 	pmap_pde_promotions++;

Modified: head/sys/i386/include/md_var.h
==============================================================================
--- head/sys/i386/include/md_var.h	Wed Mar 24 02:02:02 2010	(r205572)
+++ head/sys/i386/include/md_var.h	Wed Mar 24 03:07:35 2010	(r205573)
@@ -73,6 +73,7 @@ extern	int	szosigcode;
 #endif
 extern	uint32_t *vm_page_dump;
 extern	int	vm_page_dump_size;
+extern	int	workaround_erratum383;
 
 typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
 struct	thread;

Modified: head/sys/i386/include/specialreg.h
==============================================================================
--- head/sys/i386/include/specialreg.h	Wed Mar 24 02:02:02 2010	(r205572)
+++ head/sys/i386/include/specialreg.h	Wed Mar 24 03:07:35 2010	(r205573)
@@ -551,6 +551,7 @@
 /* AMD64 MSR's */
 #define	MSR_EFER	0xc0000080	/* extended features */
 #define	MSR_K8_UCODE_UPDATE	0xc0010020	/* update microcode */
+#define	MSR_MC0_CTL_MASK	0xc0010044
 
 /* VIA ACE crypto featureset: for via_feature_rng */
 #define	VIA_HAS_RNG		1	/* cpu has RNG */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 03:13:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CA2E106564A;
	Wed, 24 Mar 2010 03:13:25 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C0D88FC1D;
	Wed, 24 Mar 2010 03:13:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2O3DPVw071174;
	Wed, 24 Mar 2010 03:13:25 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2O3DOL2071172;
	Wed, 24 Mar 2010 03:13:24 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003240313.o2O3DOL2071172@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 24 Mar 2010 03:13:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205574 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 03:13:25 -0000

Author: nwhitehorn
Date: Wed Mar 24 03:13:24 2010
New Revision: 205574
URL: http://svn.freebsd.org/changeset/base/205574

Log:
  The nargvstr and nenvstr properties of arginfo are ints, not longs,
  so should be copied to userspace with suword32() instead of suword().
  This alleviates problems on 64-bit big-endian architectures, and is a
  no-op on all 32-bit architectures.
  
  Tested on:	amd64, sparc64, powerpc64

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Wed Mar 24 03:07:35 2010	(r205573)
+++ head/sys/kern/kern_exec.c	Wed Mar 24 03:13:24 2010	(r205574)
@@ -1260,7 +1260,7 @@ exec_copyout_strings(imgp)
 	 * Fill in "ps_strings" struct for ps, w, etc.
 	 */
 	suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp);
-	suword(&arginfo->ps_nargvstr, argc);
+	suword32(&arginfo->ps_nargvstr, argc);
 
 	/*
 	 * Fill in argument portion of vector table.
@@ -1276,7 +1276,7 @@ exec_copyout_strings(imgp)
 	suword(vectp++, 0);
 
 	suword(&arginfo->ps_envstr, (long)(intptr_t)vectp);
-	suword(&arginfo->ps_nenvstr, envc);
+	suword32(&arginfo->ps_nenvstr, envc);
 
 	/*
 	 * Fill in environment portion of vector table.

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 04:52:15 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 694A8106564A;
	Wed, 24 Mar 2010 04:52:15 +0000 (UTC)
	(envelope-from neel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D2848FC0C;
	Wed, 24 Mar 2010 04:52:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2O4qFO2092842;
	Wed, 24 Mar 2010 04:52:15 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2O4qF54092840;
	Wed, 24 Mar 2010 04:52:15 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201003240452.o2O4qF54092840@svn.freebsd.org>
From: Neel Natu 
Date: Wed, 24 Mar 2010 04:52:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205576 - head/sys/mips/mips
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 04:52:15 -0000

Author: neel
Date: Wed Mar 24 04:52:15 2010
New Revision: 205576
URL: http://svn.freebsd.org/changeset/base/205576

Log:
  Fix periodic "t_delta 16.01359db7eb5eb3c0 too long" messages on the console by
  accounting for the "lost time" between when the timer interrupt fired
  and when clock_intr() actually started executing.

Modified:
  head/sys/mips/mips/tick.c

Modified: head/sys/mips/mips/tick.c
==============================================================================
--- head/sys/mips/mips/tick.c	Wed Mar 24 04:37:19 2010	(r205575)
+++ head/sys/mips/mips/tick.c	Wed Mar 24 04:52:15 2010	(r205576)
@@ -63,17 +63,14 @@ static uint64_t cycles_per_hz, cycles_pe
 static u_int32_t counter_upper = 0;
 static u_int32_t counter_lower_last = 0;
 
-struct clk_ticks
-{
+struct clk_ticks {
 	u_long hard_ticks;
 	u_long stat_ticks;
 	u_long prof_ticks;
-	/*
-	 * pad for cache line alignment of pcpu info
-	 * cache-line-size - number of used bytes
-	 */
-	char   pad[32-(3*sizeof (u_long))];
-} static pcpu_ticks[MAXCPU];
+	uint32_t compare_ticks;
+} __aligned(CACHE_LINE_SIZE);
+
+static struct clk_ticks pcpu_ticks[MAXCPU];
 
 /*
  * Device methods
@@ -260,25 +257,47 @@ clock_intr(void *arg)
 {
 	struct clk_ticks *cpu_ticks;
 	struct trapframe *tf;
-	uint32_t ltick;
+	uint32_t count, compare, delta;
+
+	cpu_ticks = &pcpu_ticks[PCPU_GET(cpuid)];
+
 	/*
 	 * Set next clock edge.
 	 */
-	ltick = mips_rd_count();
-	mips_wr_compare(ltick + cycles_per_tick);
-	cpu_ticks = &pcpu_ticks[PCPU_GET(cpuid)];
+	count = mips_rd_count();
+	compare = cpu_ticks->compare_ticks;
+	cpu_ticks->compare_ticks = count + cycles_per_tick;
+	mips_wr_compare(cpu_ticks->compare_ticks);
 	critical_enter();
-	if (ltick < counter_lower_last) {
+	if (count < counter_lower_last) {
 		counter_upper++;
-		counter_lower_last = ltick;
+		counter_lower_last = count;
 	}
 	/*
 	 * Magic.  Setting up with an arg of NULL means we get passed tf.
 	 */
 	tf = (struct trapframe *)arg;
 
+	delta = cycles_per_tick;
+
+	/*
+	 * Account for the "lost time" between when the timer interrupt fired
+	 * and when 'clock_intr' actually started executing.
+	 */
+	delta += count - compare;
+
+	/*
+	 * If the COUNT and COMPARE registers are no longer in sync then make
+	 * up some reasonable value for the 'delta'.
+	 *
+	 * This could happen, for e.g., after we resume normal operations after
+	 * exiting the debugger.
+	 */
+	if (delta > cycles_per_hz)
+		delta = cycles_per_hz;
+
 	/* Fire hardclock at hz. */
-	cpu_ticks->hard_ticks += cycles_per_tick;
+	cpu_ticks->hard_ticks += delta;
 	if (cpu_ticks->hard_ticks >= cycles_per_hz) {
 	        cpu_ticks->hard_ticks -= cycles_per_hz;
 		if (PCPU_GET(cpuid) == 0)
@@ -288,14 +307,14 @@ clock_intr(void *arg)
 	}
 
 	/* Fire statclock at stathz. */
-	cpu_ticks->stat_ticks += cycles_per_tick;
+	cpu_ticks->stat_ticks += delta;
 	if (cpu_ticks->stat_ticks >= cycles_per_stathz) {
 		cpu_ticks->stat_ticks -= cycles_per_stathz;
 		statclock(USERMODE(tf->sr));
 	}
 
 	/* Fire profclock at profhz, but only when needed. */
-	cpu_ticks->prof_ticks += cycles_per_tick;
+	cpu_ticks->prof_ticks += delta;
 	if (cpu_ticks->prof_ticks >= cycles_per_profhz) {
 		cpu_ticks->prof_ticks -= cycles_per_profhz;
 		if (profprocs != 0)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 06:08:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E105106564A;
	Wed, 24 Mar 2010 06:08:52 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0BA538FC12;
	Wed, 24 Mar 2010 06:08:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2O68pF8009763;
	Wed, 24 Mar 2010 06:08:51 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2O68pLX009761;
	Wed, 24 Mar 2010 06:08:51 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201003240608.o2O68pLX009761@svn.freebsd.org>
From: Maxim Konovalov 
Date: Wed, 24 Mar 2010 06:08:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205578 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 06:08:52 -0000

Author: maxim
Date: Wed Mar 24 06:08:51 2010
New Revision: 205578
URL: http://svn.freebsd.org/changeset/base/205578

Log:
  o FreeBSD 7.3 added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==============================================================================
--- head/share/misc/bsd-family-tree	Wed Mar 24 05:55:45 2010	(r205577)
+++ head/share/misc/bsd-family-tree	Wed Mar 24 06:08:51 2010	(r205578)
@@ -228,14 +228,14 @@ FreeBSD 5.2           |      |          
  |  FreeBSD 7.1       |      |                 |                       |
  |     |              |      |                 |                DragonFly 2.2.0
  |  FreeBSD 7.2       |   NetBSD 5.0       OpenBSD 4.5                 |
- |     |              |      |                 |                       |
- |     |              |      |                 |                DragonFly 2.4.0
- |     V              |      |             OpenBSD 4.6                 |
- |                    |      |                 |                       |
- *--FreeBSD           |      |                 |                       |
- |    8.0             |      |                 |                       |
- |     |              |      |                 |                       |
- |     V              |      |                 |                       |
+ |             \      |      |                 |                       |
+ |              |     |      |                 |                DragonFly 2.4.0
+ |              |     |      |             OpenBSD 4.6                 |
+ |              |     |      |                 |                       |
+ *--FreeBSD     |     |      |                 |                       |
+ |    8.0       |     |      |                 |                       |
+ |     |    FreeBSD   |      |                 |                       |
+ |     V      7.3     |      |                 |                       |
  |                    |      |                 |                       |
 FreeBSD 9 -current    |  NetBSD -current  OpenBSD -current             |
  |                    |      |                 |                       |
@@ -511,6 +511,7 @@ FreeBSD 7.2		2009-05-04 [FBD]
 DragonFly 2.4.0		2009-09-16 [DFB]
 OpenBSD 4.6		2009-10-18 [OBD]
 FreeBSD 8.0		2009-11-26 [FBD]
+FreeBSD 7.3		2010-03-23 [FBD]
 
 Bibliography
 ------------------------

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 11:21:33 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B89D01065672;
	Wed, 24 Mar 2010 11:21:33 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 725098FC13;
	Wed, 24 Mar 2010 11:21:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OBLXdW081114;
	Wed, 24 Mar 2010 11:21:33 GMT (envelope-from phk@svn.freebsd.org)
Received: (from phk@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OBLXqr081111;
	Wed, 24 Mar 2010 11:21:33 GMT (envelope-from phk@svn.freebsd.org)
Message-Id: <201003241121.o2OBLXqr081111@svn.freebsd.org>
From: Poul-Henning Kamp 
Date: Wed, 24 Mar 2010 11:21:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205584 - head/tools/tools/nanobsd/Files/root
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 11:21:33 -0000

Author: phk
Date: Wed Mar 24 11:21:33 2010
New Revision: 205584
URL: http://svn.freebsd.org/changeset/base/205584

Log:
  Use gpart(8) to set the active boot partition.

Modified:
  head/tools/tools/nanobsd/Files/root/updatep1
  head/tools/tools/nanobsd/Files/root/updatep2

Modified: head/tools/tools/nanobsd/Files/root/updatep1
==============================================================================
--- head/tools/tools/nanobsd/Files/root/updatep1	Wed Mar 24 10:02:10 2010	(r205583)
+++ head/tools/tools/nanobsd/Files/root/updatep1	Wed Mar 24 11:21:33 2010	(r205584)
@@ -51,4 +51,4 @@ dd of=/dev/${NANO_DRIVE}s1 obs=64k
 # Check that it worked
 fsck_ffs -n /dev/${NANO_DRIVE}s1a
 
-boot0cfg -s 1 -v ${NANO_DRIVE}
+gpart set -a active -i 1 ${NANO_DRIVE}

Modified: head/tools/tools/nanobsd/Files/root/updatep2
==============================================================================
--- head/tools/tools/nanobsd/Files/root/updatep2	Wed Mar 24 10:02:10 2010	(r205583)
+++ head/tools/tools/nanobsd/Files/root/updatep2	Wed Mar 24 11:21:33 2010	(r205584)
@@ -58,4 +58,4 @@ sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIV
 sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/" /mnt/etc/fstab
 umount /mnt
 trap 1 2 15 EXIT
-boot0cfg -s 2 -v ${NANO_DRIVE}
+gpart set -a active -i 2 ${NANO_DRIVE}

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 14:15:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B02F1065690;
	Wed, 24 Mar 2010 14:15:50 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B7248FC20;
	Wed, 24 Mar 2010 14:15:50 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id D1A8D46B3B;
	Wed, 24 Mar 2010 10:15:49 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 246168A01F;
	Wed, 24 Mar 2010 10:15:46 -0400 (EDT)
From: John Baldwin 
To: Kostik Belousov 
Date: Wed, 24 Mar 2010 10:07:22 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003232149.o2NLnYfs097218@svn.freebsd.org>
	<20100323215554.GH2415@deviant.kiev.zoral.com.ua>
In-Reply-To: <20100323215554.GH2415@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201003241007.22189.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 24 Mar 2010 10:15:46 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205541 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 14:15:50 -0000

On Tuesday 23 March 2010 5:55:54 pm Kostik Belousov wrote:
> On Tue, Mar 23, 2010 at 09:49:34PM +0000, John Baldwin wrote:
> > Author: jhb
> > Date: Tue Mar 23 21:49:33 2010
> > New Revision: 205541
> > URL: http://svn.freebsd.org/changeset/base/205541
> > 
> > Log:
> >   Implement /proc/filesystems.
> >   
> >   Submitted by:	Fernando Apesteguia fernando.apesteguia (gmail)
> > 
> > Modified:
> >   head/sys/compat/linprocfs/linprocfs.c
> > 
> > Modified: head/sys/compat/linprocfs/linprocfs.c
> > ==============================================================================
> > --- head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:43:01 2010	(r205540)
> > +++ head/sys/compat/linprocfs/linprocfs.c	Tue Mar 23 21:49:33 2010	(r205541)
> > @@ -1227,6 +1227,22 @@ linprocfs_docmdline(PFS_FILL_ARGS)
> >  	return (0);
> >  }
> >  
> > +/*
> > + * Filler function for proc/filesystems
> > + */
> > +static int
> > +linprocfs_dofilesystems(PFS_FILL_ARGS)
> > +{
> > +	struct vfsconf *vfsp;
> > +
> > +	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
> > +		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
> > +			sbuf_printf(sb, "nodev");
> > +		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
> > +	}
> > +	return(0);
> > +}
> I think the list iteration should be protected by Giant.
> Am I mistaken ?

Oh, yeah, that is true.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 14:20:37 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 724D4106564A;
	Wed, 24 Mar 2010 14:20:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61B9F8FC0A;
	Wed, 24 Mar 2010 14:20:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OEKboe021971;
	Wed, 24 Mar 2010 14:20:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OEKbeV021969;
	Wed, 24 Mar 2010 14:20:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003241420.o2OEKbeV021969@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 24 Mar 2010 14:20:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205592 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 14:20:37 -0000

Author: jhb
Date: Wed Mar 24 14:20:37 2010
New Revision: 205592
URL: http://svn.freebsd.org/changeset/base/205592

Log:
  Add missing Giant locking for the vfsconf list.
  
  Submitted by:	kib

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Wed Mar 24 14:18:10 2010	(r205591)
+++ head/sys/compat/linprocfs/linprocfs.c	Wed Mar 24 14:20:37 2010	(r205592)
@@ -1235,11 +1235,13 @@ linprocfs_dofilesystems(PFS_FILL_ARGS)
 {
 	struct vfsconf *vfsp;
 
+	mtx_lock(&Giant);
 	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
 		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
 			sbuf_printf(sb, "nodev");
 		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
 	}
+	mtx_unlock(&Giant);
 	return(0);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 15:16:06 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39A721065675;
	Wed, 24 Mar 2010 15:16:06 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0DDAF8FC19;
	Wed, 24 Mar 2010 15:16:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OFG50t034554;
	Wed, 24 Mar 2010 15:16:05 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OFG5F8034553;
	Wed, 24 Mar 2010 15:16:05 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201003241516.o2OFG5F8034553@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 24 Mar 2010 15:16:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205601 - in head: crypto/openssl/crypto/camellia/asm
	tools/tools/nanobsd/pcengines/Pkg usr.sbin/ntp/ntptrace
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 15:16:06 -0000

Author: ed
Date: Wed Mar 24 15:16:05 2010
New Revision: 205601
URL: http://svn.freebsd.org/changeset/base/205601

Log:
  Prune empty directories.

Deleted:
  head/crypto/openssl/crypto/camellia/asm/
  head/tools/tools/nanobsd/pcengines/Pkg/
  head/usr.sbin/ntp/ntptrace/

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 15:16:59 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5EBE1106564A;
	Wed, 24 Mar 2010 15:16:59 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E3598FC1A;
	Wed, 24 Mar 2010 15:16:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OFGxZ7034783;
	Wed, 24 Mar 2010 15:16:59 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OFGx27034781;
	Wed, 24 Mar 2010 15:16:59 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201003241516.o2OFGx27034781@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 24 Mar 2010 15:16:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205602 - head/sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 15:16:59 -0000

Author: luigi
Date: Wed Mar 24 15:16:59 2010
New Revision: 205602
URL: http://svn.freebsd.org/changeset/base/205602

Log:
  Honor ip.fw.one_pass when a packet comes out of a pipe without being delayed.
  I forgot to handle this case when i did the mtag cleanup three months ago.
  
  PR:		145004

Modified:
  head/sys/netinet/ipfw/ip_dn_io.c

Modified: head/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dn_io.c	Wed Mar 24 15:16:05 2010	(r205601)
+++ head/sys/netinet/ipfw/ip_dn_io.c	Wed Mar 24 15:16:59 2010	(r205602)
@@ -762,7 +762,11 @@ dummynet_io(struct mbuf **m0, int dir, s
 	 *     
 	 */
 	if (/*dn_cfg.io_fast &&*/ m == *m0 && (dir & PROTO_LAYER2) == 0 ) {
-		/* fast io */
+		/* fast io, rename the tag * to carry reinject info. */
+		struct m_tag *tag = m_tag_first(m);
+
+		tag->m_tag_cookie = MTAG_IPFW_RULE;
+		tag->m_tag_id = 0;
 		io_pkt_fast++;
 		if (m->m_nextpkt != NULL) {
 			printf("dummynet: fast io: pkt chain detected!\n");

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 15:37:47 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 763FC106564A;
	Wed, 24 Mar 2010 15:37:47 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 652F28FC08;
	Wed, 24 Mar 2010 15:37:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OFblIj039479;
	Wed, 24 Mar 2010 15:37:47 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OFblTu039476;
	Wed, 24 Mar 2010 15:37:47 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003241537.o2OFblTu039476@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 24 Mar 2010 15:37:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205604 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 15:37:47 -0000

Author: jkim
Date: Wed Mar 24 15:37:47 2010
New Revision: 205604
URL: http://svn.freebsd.org/changeset/base/205604

Log:
  Teach VGA framebuffer about 8-bit palette format for VESA.

Modified:
  head/sys/dev/fb/vesa.c
  head/sys/dev/fb/vga.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Wed Mar 24 15:19:47 2010	(r205603)
+++ head/sys/dev/fb/vesa.c	Wed Mar 24 15:37:47 2010	(r205604)
@@ -1370,8 +1370,6 @@ vesa_save_palette(video_adapter_t *adp, 
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 		if (vesa_bios_save_palette(0, 256, palette, bits) == 0)
 			return (0);
-		if (bits > 6)
-			return (1);
 	}
 
 	return ((*prevvidsw->save_palette)(adp, palette));
@@ -1386,8 +1384,6 @@ vesa_load_palette(video_adapter_t *adp, 
 		bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
 		if (vesa_bios_load_palette(0, 256, palette, bits) == 0)
 			return (0);
-		if (bits > 6)
-			return (1);
 	}
 
 	return ((*prevvidsw->load_palette)(adp, palette));

Modified: head/sys/dev/fb/vga.c
==============================================================================
--- head/sys/dev/fb/vga.c	Wed Mar 24 15:19:47 2010	(r205603)
+++ head/sys/dev/fb/vga.c	Wed Mar 24 15:37:47 2010	(r205604)
@@ -1979,6 +1979,7 @@ vga_show_font(video_adapter_t *adp, int 
 static int
 vga_save_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
@@ -1988,8 +1989,9 @@ vga_save_palette(video_adapter_t *adp, u
      * VGA has 6 bit DAC .
      */
     outb(PALRADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	palette[i] = inb(PALDATA) << 2; 
+	palette[i] = inb(PALDATA) << bits; 
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     return 0;
 }
@@ -1998,15 +2000,17 @@ static int
 vga_save_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PALRADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	r[i] = inb(PALDATA) << 2; 
-	g[i] = inb(PALDATA) << 2; 
-	b[i] = inb(PALDATA) << 2; 
+	r[i] = inb(PALDATA) << bits; 
+	g[i] = inb(PALDATA) << bits; 
+	b[i] = inb(PALDATA) << bits;
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     return 0;
@@ -2021,14 +2025,16 @@ vga_save_palette2(video_adapter_t *adp, 
 static int
 vga_load_palette(video_adapter_t *adp, u_char *palette)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, 0x00);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < 256*3; ++i)
-	outb(PALDATA, palette[i] >> 2);
+	outb(PALDATA, palette[i] >> bits);
     inb(adp->va_crtc_addr + 6);	/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */
     return 0;
@@ -2038,16 +2044,18 @@ static int
 vga_load_palette2(video_adapter_t *adp, int base, int count,
 		  u_char *r, u_char *g, u_char *b)
 {
+    int bits;
     int i;
 
     prologue(adp, V_ADP_PALETTE, ENODEV);
 
     outb(PIXMASK, 0xff);		/* no pixelmask */
     outb(PALWADR, base);
+    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
     for (i = 0; i < count; ++i) {
-	outb(PALDATA, r[i] >> 2);
-	outb(PALDATA, g[i] >> 2);
-	outb(PALDATA, b[i] >> 2);
+	outb(PALDATA, r[i] >> bits);
+	outb(PALDATA, g[i] >> bits);
+	outb(PALDATA, b[i] >> bits);
     }
     inb(adp->va_crtc_addr + 6);		/* reset flip/flop */
     outb(ATC, 0x20);			/* enable palette */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 15:40:18 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B9ED106566B;
	Wed, 24 Mar 2010 15:40:18 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6AC9C8FC18;
	Wed, 24 Mar 2010 15:40:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OFeIhf040126;
	Wed, 24 Mar 2010 15:40:18 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OFeIjO040124;
	Wed, 24 Mar 2010 15:40:18 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003241540.o2OFeIjO040124@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 24 Mar 2010 15:40:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205605 - head/sys/dev/syscons
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 15:40:18 -0000

Author: jkim
Date: Wed Mar 24 15:40:18 2010
New Revision: 205605
URL: http://svn.freebsd.org/changeset/base/205605

Log:
  Align memory access of 24-bit pixel renderer to word boundary.

Modified:
  head/sys/dev/syscons/scvgarndr.c

Modified: head/sys/dev/syscons/scvgarndr.c
==============================================================================
--- head/sys/dev/syscons/scvgarndr.c	Wed Mar 24 15:37:47 2010	(r205604)
+++ head/sys/dev/syscons/scvgarndr.c	Wed Mar 24 15:40:18 2010	(r205605)
@@ -184,8 +184,13 @@ static u_short mouse_or_mask[16] = {
 			writel(pos, vga_palette32[color]);		\
 			break;						\
 		case 24:						\
-			writew(pos, vga_palette32[color]);		\
-			writeb(pos + 2, vga_palette32[color] >> 16);	\
+			if (((pos) & 1) == 0) {				\
+				writew(pos, vga_palette32[color]);	\
+				writeb(pos + 2, vga_palette32[color] >> 16);\
+			} else {					\
+				writeb(pos, vga_palette32[color]);	\
+				writew(pos + 1, vga_palette32[color] >> 8);\
+			}						\
 			break;						\
 		case 16:						\
 			if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 15:59:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27B091065670;
	Wed, 24 Mar 2010 15:59:52 +0000 (UTC)
	(envelope-from gahr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F03318FC18;
	Wed, 24 Mar 2010 15:59:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OFxpP3044851;
	Wed, 24 Mar 2010 15:59:51 GMT (envelope-from gahr@svn.freebsd.org)
Received: (from gahr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OFxpWB044846;
	Wed, 24 Mar 2010 15:59:51 GMT (envelope-from gahr@svn.freebsd.org)
Message-Id: <201003241559.o2OFxpWB044846@svn.freebsd.org>
From: Pietro Cerutti 
Date: Wed, 24 Mar 2010 15:59:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205606 - in head: include lib/libc/gen libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 15:59:52 -0000

Author: gahr (ports committer)
Date: Wed Mar 24 15:59:51 2010
New Revision: 205606
URL: http://svn.freebsd.org/changeset/base/205606

Log:
  - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.
  
  Approved by:	cognet
  MFC after:	1 week

Modified:
  head/include/dlfcn.h
  head/lib/libc/gen/dlfcn.c
  head/lib/libc/gen/dlopen.3
  head/libexec/rtld-elf/rtld.c

Modified: head/include/dlfcn.h
==============================================================================
--- head/include/dlfcn.h	Wed Mar 24 15:40:18 2010	(r205605)
+++ head/include/dlfcn.h	Wed Mar 24 15:59:51 2010	(r205606)
@@ -113,8 +113,7 @@ typedef struct  dl_serinfo {
 __BEGIN_DECLS
 /* XSI functions first. */
 int	 dlclose(void *);
-const char *
-	 dlerror(void);
+char	*dlerror(void);
 void	*dlopen(const char *, int);
 void	*dlsym(void * __restrict, const char * __restrict);
 

Modified: head/lib/libc/gen/dlfcn.c
==============================================================================
--- head/lib/libc/gen/dlfcn.c	Wed Mar 24 15:40:18 2010	(r205605)
+++ head/lib/libc/gen/dlfcn.c	Wed Mar 24 15:59:51 2010	(r205606)
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static const char sorry[] = "Service unavailable";
+static char sorry[] = "Service unavailable";
 
 /*
  * For ELF, the dynamic linker directly resolves references to its
@@ -69,7 +69,7 @@ dlclose(void *handle)
 }
 
 #pragma weak dlerror
-const char *
+char *
 dlerror(void)
 {
 	return sorry;

Modified: head/lib/libc/gen/dlopen.3
==============================================================================
--- head/lib/libc/gen/dlopen.3	Wed Mar 24 15:40:18 2010	(r205605)
+++ head/lib/libc/gen/dlopen.3	Wed Mar 24 15:59:51 2010	(r205606)
@@ -52,7 +52,7 @@
 .Fn dlsym "void * restrict handle" "const char * restrict symbol"
 .Ft dlfunc_t
 .Fn dlfunc "void * restrict handle" "const char * restrict symbol"
-.Ft const char *
+.Ft char *
 .Fn dlerror "void"
 .Ft int
 .Fn dlclose "void *handle"

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Wed Mar 24 15:40:18 2010	(r205605)
+++ head/libexec/rtld-elf/rtld.c	Wed Mar 24 15:59:51 2010	(r205606)
@@ -1961,7 +1961,7 @@ dlclose(void *handle)
     return 0;
 }
 
-const char *
+char *
 dlerror(void)
 {
     char *msg = error_message;

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 16:07:34 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 477D9106566B;
	Wed, 24 Mar 2010 16:07:34 +0000 (UTC)
	(envelope-from syrinx@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 353978FC15;
	Wed, 24 Mar 2010 16:07:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OG7Yv2046601;
	Wed, 24 Mar 2010 16:07:34 GMT (envelope-from syrinx@svn.freebsd.org)
Received: (from syrinx@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OG7Y4B046596;
	Wed, 24 Mar 2010 16:07:34 GMT (envelope-from syrinx@svn.freebsd.org)
Message-Id: <201003241607.o2OG7Y4B046596@svn.freebsd.org>
From: Shteryana Shopova 
Date: Wed, 24 Mar 2010 16:07:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205607 - head/usr.sbin/bsnmpd/modules/snmp_pf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 16:07:34 -0000

Author: syrinx
Date: Wed Mar 24 16:07:33 2010
New Revision: 205607
URL: http://svn.freebsd.org/changeset/base/205607

Log:
  Now actually implement reading/refreshing/returning data from the pfTablesAddrTable
  and modify the BEGEMOT-PF-MIB to add support for IPV6 address' statistics in the PF
  tables via pfTablesAddrNetType and pfTablesAddrNet. While here, upgrade the
  pf_tree.def file to the new format that includes enumerated values. Also make sure
  to return SNMP_ERR_NOSUCHNAME for ALTQ objects, if ALTQ is disabled, so that the agent
  will know to skip the pfAltq subtree when servicing GETNEXT requests from SNMP clients
  (otherwise snmpwalk on begemotPf would stop at the pfAltq subtree with bsnmpd returning
  SNMP_ERR_GENERR).

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt
  head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile
  head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
  head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def

Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt	Wed Mar 24 15:59:51 2010	(r205606)
+++ head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt	Wed Mar 24 16:07:33 2010	(r205607)
@@ -17,11 +17,13 @@ IMPORTS
 	FROM SNMPv2-SMI
     TruthValue
 	FROM SNMPv2-TC
+    InetAddress, InetAddressType, InetAddressPrefixLength
+	FROM INET-ADDRESS-MIB
     begemot
 	FROM BEGEMOT-MIB;
 
 begemotPf MODULE-IDENTITY
-    LAST-UPDATED "201003170000Z"
+    LAST-UPDATED "201003180000Z"
     ORGANIZATION "NixSys BVBA"
     CONTACT-INFO
 	    "		Philip Paeps
@@ -34,6 +36,12 @@ begemotPf MODULE-IDENTITY
 	     E-Mail:	philip@FreeBSD.org"
     DESCRIPTION
 	    "The Begemot MIB for the pf packet filter."
+    REVISION	"201003180000Z"
+    DESCRIPTION
+		"Modified pfTablesAddrEntry to support IPv6
+		addresses - added pfTablesAddrNetType column
+		and modified type of pfTablesAddrNet to
+		InetAddress."
     REVISION	"200912050000Z"
     DESCRIPTION
 	    "Added support for retrieving counters of labeled
@@ -1025,8 +1033,9 @@ pfTablesAddrEntry OBJECT-TYPE
 
 PfTablesAddrEntry ::= SEQUENCE {
     pfTablesAddrIndex		    Integer32,
-    pfTablesAddrNet		    IpAddress,
-    pfTablesAddrMask		    Integer32,
+    pfTablesAddrNetType		    InetAddressType,
+    pfTablesAddrNet		    InetAddress,
+    pfTablesAddrPrefix		    InetAddressPrefixLength,
     pfTablesAddrTZero		    TimeTicks,
     pfTablesAddrBytesInPass	    Counter64,
     pfTablesAddrBytesInBlock	    Counter64,
@@ -1046,21 +1055,29 @@ pfTablesAddrIndex OBJECT-TYPE
         "A unique value, greater than zero, for each address."
     ::= { pfTablesAddrEntry 1 }
 
+pfTablesAddrNetType OBJECT-TYPE
+    SYNTAX	InetAddressType
+    MAX-ACCESS	read-only
+    STATUS	current
+    DESCRIPTION
+	"The type of address in the corresponding pfTablesAddrNet object."
+    ::= { pfTablesAddrEntry 2 }
+
 pfTablesAddrNet OBJECT-TYPE
-    SYNTAX	IpAddress
+    SYNTAX	InetAddress
     MAX-ACCESS  read-only
     STATUS	current
     DESCRIPTION
         "The IP address of this particular table entry."
-    ::= { pfTablesAddrEntry 2 }
+    ::= { pfTablesAddrEntry 3 }
 
-pfTablesAddrMask OBJECT-TYPE
-    SYNTAX	Integer32 (0..32)
+pfTablesAddrPrefix OBJECT-TYPE
+    SYNTAX	InetAddressPrefixLength
     MAX-ACCESS  read-only
     STATUS	current
     DESCRIPTION
         "The CIDR netmask of this particular table entry."
-    ::= { pfTablesAddrEntry 3 }
+    ::= { pfTablesAddrEntry 4 }
 
 pfTablesAddrTZero OBJECT-TYPE
     SYNTAX	TimeTicks
@@ -1071,7 +1088,7 @@ pfTablesAddrTZero OBJECT-TYPE
         "The time passed since this entry's statistics were last
 	cleared, or the time passed since this entry was loaded
 	into the table, whichever is sooner."
-    ::= { pfTablesAddrEntry 4 }
+    ::= { pfTablesAddrEntry 5 }
 
 pfTablesAddrBytesInPass OBJECT-TYPE
     SYNTAX	Counter64
@@ -1079,7 +1096,7 @@ pfTablesAddrBytesInPass OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of inbound bytes passed as a result of this entry."
-    ::= { pfTablesAddrEntry 5 }
+    ::= { pfTablesAddrEntry 6 }
 
 pfTablesAddrBytesInBlock OBJECT-TYPE
     SYNTAX	Counter64
@@ -1087,7 +1104,7 @@ pfTablesAddrBytesInBlock OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of inbound bytes blocked as a result of this entry."
-    ::= { pfTablesAddrEntry 6 }
+    ::= { pfTablesAddrEntry 7 }
 
 pfTablesAddrBytesOutPass OBJECT-TYPE
     SYNTAX	Counter64
@@ -1095,7 +1112,7 @@ pfTablesAddrBytesOutPass OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of outbound bytes passed as a result of this entry."
-    ::= { pfTablesAddrEntry 7 }
+    ::= { pfTablesAddrEntry 8 }
 
 pfTablesAddrBytesOutBlock OBJECT-TYPE
     SYNTAX	Counter64
@@ -1103,7 +1120,7 @@ pfTablesAddrBytesOutBlock OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of outbound bytes blocked as a result of this entry."
-    ::= { pfTablesAddrEntry 8 }
+    ::= { pfTablesAddrEntry 9 }
 
 pfTablesAddrPktsInPass OBJECT-TYPE
     SYNTAX	Counter64
@@ -1111,7 +1128,7 @@ pfTablesAddrPktsInPass OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of inbound packets passed as a result of this entry."
-    ::= { pfTablesAddrEntry 9 }
+    ::= { pfTablesAddrEntry 10 }
 
 pfTablesAddrPktsInBlock OBJECT-TYPE
     SYNTAX	Counter64
@@ -1119,7 +1136,7 @@ pfTablesAddrPktsInBlock OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of inbound packets blocked as a result of this entry."
-    ::= { pfTablesAddrEntry 10 }
+    ::= { pfTablesAddrEntry 11 }
 
 pfTablesAddrPktsOutPass OBJECT-TYPE
     SYNTAX	Counter64
@@ -1127,7 +1144,7 @@ pfTablesAddrPktsOutPass OBJECT-TYPE
     STATUS	current
     DESCRIPTION
         "The number of outbound packets passed as a result of this entry."
-    ::= { pfTablesAddrEntry 11 }
+    ::= { pfTablesAddrEntry 12 }
 
 pfTablesAddrPktsOutBlock OBJECT-TYPE
     SYNTAX	Counter64
@@ -1136,7 +1153,7 @@ pfTablesAddrPktsOutBlock OBJECT-TYPE
     DESCRIPTION
         "The number of outbound packets blocked as a result of this
         entry."
-    ::= { pfTablesAddrEntry 12 }
+    ::= { pfTablesAddrEntry 13 }
 
 -- --------------------------------------------------------------------------
 

Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile	Wed Mar 24 15:59:51 2010	(r205606)
+++ head/usr.sbin/bsnmpd/modules/snmp_pf/Makefile	Wed Mar 24 16:07:33 2010	(r205607)
@@ -4,6 +4,7 @@
 
 MOD=	pf
 SRCS=	pf_snmp.c
+CFLAGS+= -DSNMPTREE_TYPES
 
 XSYM=	begemotPf
 DEFS=	${MOD}_tree.def

Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c	Wed Mar 24 15:59:51 2010	(r205606)
+++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c	Wed Mar 24 16:07:33 2010	(r205607)
@@ -85,6 +85,19 @@ static int pft_table_count;
 
 #define PFT_TABLE_MAXAGE	5
 
+struct pfa_entry {
+	struct pfr_astats pfas;
+	u_int		index;
+	TAILQ_ENTRY(pfa_entry) link;
+};
+TAILQ_HEAD(pfa_table, pfa_entry);
+
+static struct pfa_table pfa_table;
+static time_t pfa_table_age;
+static int pfa_table_count;
+
+#define	PFA_TABLE_MAXAGE	5
+
 struct pfq_entry {
 	struct pf_altq	altq;
 	u_int		index;
@@ -121,10 +134,12 @@ static int pfi_refresh(void);
 static int pfq_refresh(void);
 static int pfs_refresh(void);
 static int pft_refresh(void);
+static int pfa_refresh(void);
 static int pfl_refresh(void);
 static struct pfi_entry * pfi_table_find(u_int idx);
 static struct pfq_entry * pfq_table_find(u_int idx);
 static struct pft_entry * pft_table_find(u_int idx);
+static struct pfa_entry * pfa_table_find(u_int idx);
 static struct pfl_entry * pfl_table_find(u_int idx);
 
 static int altq_is_enabled(int pfdevice);
@@ -794,7 +809,98 @@ int
 pf_tbladdr(struct snmp_context __unused *ctx, struct snmp_value __unused *val,
 	u_int __unused sub, u_int __unused vindex, enum snmp_op __unused op)
 {
-	return (SNMP_ERR_GENERR);
+	asn_subid_t	which = val->var.subs[sub - 1];
+	struct pfa_entry *e = NULL;
+
+	if ((time(NULL) - pfa_table_age) > PFA_TABLE_MAXAGE)
+		pfa_refresh();
+
+	switch (op) {
+		case SNMP_OP_SET:
+			return (SNMP_ERR_NOT_WRITEABLE);
+		case SNMP_OP_GETNEXT:
+			if ((e = NEXT_OBJECT_INT(&pfa_table,
+			    &val->var, sub)) == NULL)
+				return (SNMP_ERR_NOSUCHNAME);
+			val->var.len = sub + 1;
+			val->var.subs[sub] = e->index;
+			break;
+		case SNMP_OP_GET:
+			if (val->var.len - sub != 1)
+				return (SNMP_ERR_NOSUCHNAME);
+			if ((e = pfa_table_find(val->var.subs[sub])) == NULL)
+				return (SNMP_ERR_NOSUCHNAME);
+			break;
+
+		case SNMP_OP_COMMIT:
+		case SNMP_OP_ROLLBACK:
+		default:
+			abort();
+	}
+
+	switch (which) {
+		case LEAF_pfTablesAddrNetType:
+			if (e->pfas.pfras_a.pfra_af == AF_INET)
+				val->v.integer = pfTablesAddrNetType_ipv4;
+			else if (e->pfas.pfras_a.pfra_af == AF_INET6)
+				val->v.integer = pfTablesAddrNetType_ipv6;
+			else
+				return (SNMP_ERR_GENERR);
+			break;
+		case LEAF_pfTablesAddrNet:
+			if (e->pfas.pfras_a.pfra_af == AF_INET) {
+				return (string_get(val,
+				    (u_char *)&e->pfas.pfras_a.pfra_ip4addr, 4));
+			} else if (e->pfas.pfras_a.pfra_af == AF_INET6)
+				return (string_get(val,
+				    (u_char *)&e->pfas.pfras_a.pfra_ip6addr, 16));
+			else
+				return (SNMP_ERR_GENERR);
+			break;
+		case LEAF_pfTablesAddrPrefix:
+			val->v.integer = (int32_t) e->pfas.pfras_a.pfra_net;
+			break;
+		case LEAF_pfTablesAddrTZero:
+			val->v.uint32 =
+			    (time(NULL) - e->pfas.pfras_tzero) * 100;
+			break;
+		case LEAF_pfTablesAddrBytesInPass:
+			val->v.counter64 =
+			    e->pfas.pfras_bytes[PFR_DIR_IN][PFR_OP_PASS];
+			break;
+		case LEAF_pfTablesAddrBytesInBlock:
+			val->v.counter64 =
+			    e->pfas.pfras_bytes[PFR_DIR_IN][PFR_OP_BLOCK];
+			break;
+		case LEAF_pfTablesAddrBytesOutPass:
+			val->v.counter64 =
+			    e->pfas.pfras_bytes[PFR_DIR_OUT][PFR_OP_PASS];
+			break;
+		case LEAF_pfTablesAddrBytesOutBlock:
+			val->v.counter64 =
+			    e->pfas.pfras_bytes[PFR_DIR_OUT][PFR_OP_BLOCK];
+			break;
+		case LEAF_pfTablesAddrPktsInPass:
+			val->v.counter64 =
+			    e->pfas.pfras_packets[PFR_DIR_IN][PFR_OP_PASS];
+			break;
+		case LEAF_pfTablesAddrPktsInBlock:
+			val->v.counter64 =
+			    e->pfas.pfras_packets[PFR_DIR_IN][PFR_OP_BLOCK];
+			break;
+		case LEAF_pfTablesAddrPktsOutPass:
+			val->v.counter64 =
+			    e->pfas.pfras_packets[PFR_DIR_OUT][PFR_OP_PASS];
+			break;
+		case LEAF_pfTablesAddrPktsOutBlock:
+			val->v.counter64 =
+			    e->pfas.pfras_packets[PFR_DIR_OUT][PFR_OP_BLOCK];
+			break;
+		default:
+			return (SNMP_ERR_NOSUCHNAME);
+	}
+
+	return (SNMP_ERR_NOERROR);
 }
 
 int
@@ -803,9 +909,8 @@ pf_altq(struct snmp_context __unused *ct
 {
 	asn_subid_t	which = val->var.subs[sub - 1];
 
-	if (!altq_enabled) {
-	   return (SNMP_ERR_NOERROR);
-	}
+	if (!altq_enabled)
+	   return (SNMP_ERR_NOSUCHNAME);
 
 	if (op == SNMP_OP_SET)
 		return (SNMP_ERR_NOT_WRITEABLE);
@@ -838,9 +943,8 @@ pf_altqq(struct snmp_context __unused *c
 	asn_subid_t	which = val->var.subs[sub - 1];
 	struct pfq_entry *e = NULL;
 
-	if (!altq_enabled) {
-	   return (SNMP_ERR_NOERROR);
-	}
+	if (!altq_enabled)
+	   return (SNMP_ERR_NOSUCHNAME);
 
 	if ((time(NULL) - pfq_table_age) > PFQ_TABLE_MAXAGE)
 		pfq_refresh();
@@ -1014,6 +1118,17 @@ pft_table_find(u_int idx)
 	return (NULL);
 }
 
+static struct pfa_entry *
+pfa_table_find(u_int idx)
+{
+	struct pfa_entry *e;
+
+	TAILQ_FOREACH(e, &pfa_table, link)
+		if (e->index == idx)
+			return (e);
+	return (NULL);
+}
+
 static struct pfl_entry *
 pfl_table_find(u_int idx)
 {
@@ -1249,6 +1364,149 @@ err2:
 }
 
 static int
+pfa_table_addrs(u_int sidx, struct pfr_table *pt)
+{
+	struct pfioc_table io;
+	struct pfr_astats *t = NULL;
+	struct pfa_entry *e;
+	int i, numaddrs = 1;
+
+	if (pt == NULL)
+		return (-1);
+
+	memset(&io, 0, sizeof(io));
+	strlcpy(io.pfrio_table.pfrt_name, pt->pfrt_name,
+	    sizeof(io.pfrio_table.pfrt_name));
+
+	for (;;) {
+		t = reallocf(t, numaddrs * sizeof(struct pfr_astats));
+		if (t == NULL) {
+			syslog(LOG_ERR, "pfa_table_addrs(): reallocf(): %s",
+			    strerror(errno));
+			numaddrs = -1;
+			goto error;
+		}
+
+		memset(t, 0, sizeof(*t));
+		io.pfrio_size = numaddrs;
+		io.pfrio_buffer = t;
+		io.pfrio_esize = sizeof(struct pfr_astats);
+
+		if (ioctl(dev, DIOCRGETASTATS, &io)) {
+			syslog(LOG_ERR, "pfa_table_addrs(): ioctl() on %s: %s",
+			    pt->pfrt_name, strerror(errno));
+			numaddrs = -1;
+			break;
+		}
+
+		if (numaddrs >= io.pfrio_size)
+			break;
+
+		numaddrs = io.pfrio_size;
+	}
+
+	for (i = 0; i < numaddrs; i++) {
+		if ((t + i)->pfras_a.pfra_af != AF_INET &&
+		    (t + i)->pfras_a.pfra_af != AF_INET6) {
+			numaddrs = i;
+			break;
+		}
+
+		e = (struct pfa_entry *)malloc(sizeof(struct pfa_entry));
+		if (e == NULL) {
+			syslog(LOG_ERR, "pfa_table_addrs(): malloc(): %s",
+			    strerror(errno));
+			numaddrs = -1;
+			break;
+		}
+		e->index = sidx + i;
+		memcpy(&e->pfas, t + i, sizeof(struct pfr_astats));
+		TAILQ_INSERT_TAIL(&pfa_table, e, link);
+	}
+
+	free(t);
+error:
+	return (numaddrs);
+}
+
+static int
+pfa_refresh(void)
+{
+	struct pfioc_table io;
+	struct pfr_table *pt = NULL, *it = NULL;
+	struct pfa_entry *e;
+	int i, numtbls = 1, cidx, naddrs;
+
+	if (started && this_tick <= pf_tick)
+		return (0);
+
+	while (!TAILQ_EMPTY(&pfa_table)) {
+		e = TAILQ_FIRST(&pfa_table);
+		TAILQ_REMOVE(&pfa_table, e, link);
+		free(e);
+	}
+
+	memset(&io, 0, sizeof(io));
+	io.pfrio_esize = sizeof(struct pfr_table);
+
+	for (;;) {
+		pt = reallocf(pt, numtbls * sizeof(struct pfr_table));
+		if (pt == NULL) {
+			syslog(LOG_ERR, "pfa_refresh(): reallocf() %s",
+			    strerror(errno));
+			return (-1);
+		}
+		memset(pt, 0, sizeof(*pt));
+		io.pfrio_size = numtbls;
+		io.pfrio_buffer = pt;
+
+		if (ioctl(dev, DIOCRGETTABLES, &io)) {
+			syslog(LOG_ERR, "pfa_refresh(): ioctl(): %s",
+			    strerror(errno));
+			goto err2;
+		}
+
+		if (numtbls >= io.pfrio_size)
+			break;
+
+		numtbls = io.pfrio_size;
+	}
+
+	cidx = 1;
+
+	for (it = pt, i = 0; i < numtbls; it++, i++) {
+		/*
+		 * Skip the table if not active - ioctl(DIOCRGETASTATS) will
+		 * return ESRCH for this entry anyway.
+		 */
+		if (!(it->pfrt_flags & PFR_TFLAG_ACTIVE))
+			continue;
+
+		if ((naddrs = pfa_table_addrs(cidx, it)) < 0)
+			goto err1;
+
+		cidx += naddrs;
+	}
+
+	pfa_table_age = time(NULL);
+	pfa_table_count = cidx;
+	pf_tick = this_tick;
+
+	free(pt);
+	return (0);
+err1:
+	while (!TAILQ_EMPTY(&pfa_table)) {
+		e = TAILQ_FIRST(&pfa_table);
+		TAILQ_REMOVE(&pfa_table, e, link);
+		free(e);
+	}
+
+err2:
+	free(pt);
+	return (-1);
+}
+
+static int
 pfl_scan_ruleset(const char *path)
 {
 	struct pfioc_rule pr;
@@ -1423,6 +1681,7 @@ pf_init(struct lmodule *mod, int __unuse
 	TAILQ_INIT(&pfi_table);
 	TAILQ_INIT(&pfq_table);
 	TAILQ_INIT(&pft_table);
+	TAILQ_INIT(&pfa_table);
 	TAILQ_INIT(&pfl_table);
 
 	pfi_refresh();
@@ -1432,6 +1691,7 @@ pf_init(struct lmodule *mod, int __unuse
 
 	pfs_refresh();
 	pft_refresh();
+	pfa_refresh();
 	pfl_refresh();
 
 	started = 1;
@@ -1445,6 +1705,7 @@ pf_fini(void)
 	struct pfi_entry *i1, *i2;
 	struct pfq_entry *q1, *q2;
 	struct pft_entry *t1, *t2;
+	struct pfa_entry *a1, *a2;
 	struct pfl_entry *l1, *l2;
 
 	/* Empty the list of interfaces */
@@ -1471,6 +1732,14 @@ pf_fini(void)
 		t1 = t2;
 	}
 
+	/* List of table addresses */
+	a1 = TAILQ_FIRST(&pfa_table);
+	while (a1 != NULL) {
+		a2 = TAILQ_NEXT(a1, link);
+		free(a1);
+		a1 = a2;
+	}
+
 	/* And the list of labeled filter rules */
 	l1 = TAILQ_FIRST(&pfl_table);
 	while (l1 != NULL) {
@@ -1491,6 +1760,7 @@ pf_dump(void)
 		pfq_refresh();
 	}
 	pft_refresh();
+	pfa_refresh();
 	pfl_refresh();
 
 	syslog(LOG_ERR, "Dump: pfi_table_age = %jd",
@@ -1508,6 +1778,11 @@ pf_dump(void)
 	syslog(LOG_ERR, "Dump: pft_table_count = %d",
 	    pft_table_count);
 
+	syslog(LOG_ERR, "Dump: pfa_table_age = %jd",
+	    (intmax_t)pfa_table_age);
+	syslog(LOG_ERR, "Dump: pfa_table_count = %d",
+	    pfa_table_count);
+
 	syslog(LOG_ERR, "Dump: pfl_table_age = %jd",
 	    (intmax_t)pfl_table_age);
 	syslog(LOG_ERR, "Dump: pfl_table_count = %d",

Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def	Wed Mar 24 15:59:51 2010	(r205606)
+++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def	Wed Mar 24 16:07:33 2010	(r205607)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005 Philip Paeps 
+# Copyright (c) 2010 Philip Paeps 
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -34,9 +34,9 @@
           (200 begemotPf
             (1 begemotPfObjects
               (1 pfStatus
-                (1 pfStatusRunning INTEGER pf_status GET)
+                (1 pfStatusRunning ENUM ( 1 true 2 false ) pf_status GET)
                 (2 pfStatusRuntime TIMETICKS pf_status GET)
-                (3 pfStatusDebug INTEGER pf_status GET)
+                (3 pfStatusDebug ENUM ( 0 none 1 urgent 2 misc 3 loud ) pf_status GET)
                 (4 pfStatusHostId OCTETSTRING pf_status GET)
               )
               (2 pfCounter
@@ -106,7 +106,7 @@
                   (1 pfInterfacesIfEntry : INTEGER32 pf_iftable
                     (1 pfInterfacesIfIndex INTEGER32)
                     (2 pfInterfacesIfDescr OCTETSTRING GET)
-                    (3 pfInterfacesIfType INTEGER GET)
+                    (3 pfInterfacesIfType ENUM ( 0 group 1 instance 2 detached ) GET)
 		    (4 pfInterfacesIfTZero TIMETICKS GET)
                     (5 pfInterfacesIfRefsState UNSIGNED32 GET)
                     (6 pfInterfacesIfRefsRule UNSIGNED32 GET)
@@ -158,17 +158,18 @@
 		(3 pfTablesAddrTable
 		  (1 pfTablesAddrEntry : INTEGER32 pf_tbladdr
 		    (1 pfTablesAddrIndex INTEGER32)
-		    (2 pfTablesAddrNet IPADDRESS GET)
-		    (3 pfTablesAddrMask INTEGER32 GET)
-		    (4 pfTablesAddrTZero TIMETICKS GET)
-		    (5 pfTablesAddrBytesInPass COUNTER64 GET)
-		    (6 pfTablesAddrBytesInBlock COUNTER64 GET)
-		    (7 pfTablesAddrBytesOutPass COUNTER64 GET)
-		    (8 pfTablesAddrBytesOutBlock COUNTER64 GET)
-		    (9 pfTablesAddrPktsInPass COUNTER64 GET)
-		    (10 pfTablesAddrPktsInBlock COUNTER64 GET)
-		    (11 pfTablesAddrPktsOutPass COUNTER64 GET)
-		    (12 pfTablesAddrPktsOutBlock COUNTER64 GET)
+		    (2 pfTablesAddrNetType ENUM ( 0 unknown 1 ipv4 2 ipv6) GET)
+		    (3 pfTablesAddrNet OCTETSTRING | InetAddress GET)
+		    (4 pfTablesAddrPrefix UNSIGNED32 GET)
+		    (5 pfTablesAddrTZero TIMETICKS GET)
+		    (6 pfTablesAddrBytesInPass COUNTER64 GET)
+		    (7 pfTablesAddrBytesInBlock COUNTER64 GET)
+		    (8 pfTablesAddrBytesOutPass COUNTER64 GET)
+		    (9 pfTablesAddrBytesOutBlock COUNTER64 GET)
+		    (10 pfTablesAddrPktsInPass COUNTER64 GET)
+		    (11 pfTablesAddrPktsInBlock COUNTER64 GET)
+		    (12 pfTablesAddrPktsOutPass COUNTER64 GET)
+		    (13 pfTablesAddrPktsOutBlock COUNTER64 GET)
 		  )
 		)
 	      )
@@ -179,7 +180,7 @@
 		    (1 pfAltqQueueIndex INTEGER32)
 		    (2 pfAltqQueueDescr OCTETSTRING GET)
 		    (3 pfAltqQueueParent OCTETSTRING GET)
-		    (4 pfAltqQueueScheduler INTEGER GET)
+		    (4 pfAltqQueueScheduler ENUM ( 1 cbq 8 hfsc 11 priq ) GET)
 		    (5 pfAltqQueueBandwidth UNSIGNED32 GET)
 		    (6 pfAltqQueuePriority INTEGER32 GET)
 		    (7 pfAltqQueueLimit INTEGER32 GET)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 16:42:02 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E68E1065675;
	Wed, 24 Mar 2010 16:42:02 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-relay1.uni-muenster.de (ZIVM-RELAY1.UNI-MUENSTER.DE
	[128.176.192.12])
	by mx1.freebsd.org (Postfix) with ESMTP id BDECE8FC16;
	Wed, 24 Mar 2010 16:42:01 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.51,301,1267398000"; d="scan'208";a="300036242"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER05.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay1.uni-muenster.de with ESMTP; 24 Mar 2010 17:42:00 +0100
Received: by ZIVMAILUSER05.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id 8E3431B07E7; Wed, 24 Mar 2010 17:42:00 +0100 (CET)
Date: Wed, 24 Mar 2010 17:41:59 +0100 (CET)
From: Alexander Best 
Sender: 
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: John Baldwin 
Message-ID: 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r205592 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 16:42:02 -0000

while you're at it could you have a peek at this patch:
http://www.mail-archive.com/freebsd-emulation@freebsd.org/msg00077.html
(kern/56451) for linprocfs? basically this replaces the broken /proc/cpuinfo
output with CPUID_TO_* macros (which are known to work -> r205013).

thanks

-- 
Alexander Best

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 18:04:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0FD51065672;
	Wed, 24 Mar 2010 18:04:25 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B01558FC13;
	Wed, 24 Mar 2010 18:04:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OI4P5k073359;
	Wed, 24 Mar 2010 18:04:25 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OI4PNJ073357;
	Wed, 24 Mar 2010 18:04:25 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003241804.o2OI4PNJ073357@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 24 Mar 2010 18:04:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205619 - head/sys/geom
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 18:04:25 -0000

Author: mav
Date: Wed Mar 24 18:04:25 2010
New Revision: 205619
URL: http://svn.freebsd.org/changeset/base/205619

Log:
  Do not fetch precise time of request start when stats collection disabled.
  
  Reviewed by:	pjd, phk

Modified:
  head/sys/geom/geom_io.c

Modified: head/sys/geom/geom_io.c
==============================================================================
--- head/sys/geom/geom_io.c	Wed Mar 24 17:38:08 2010	(r205618)
+++ head/sys/geom/geom_io.c	Wed Mar 24 18:04:25 2010	(r205619)
@@ -443,7 +443,10 @@ g_io_request(struct bio *bp, struct g_co
 	    ("Bio already on queue bp=%p", bp));
 	bp->bio_flags |= BIO_ONQUEUE;
 
-	binuptime(&bp->bio_t0);
+	if (g_collectstats)
+		binuptime(&bp->bio_t0);
+	else
+		getbinuptime(&bp->bio_t0);
 
 	/*
 	 * The statistics collection is lockless, as such, but we

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 18:35:32 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B0FD10656EA;
	Wed, 24 Mar 2010 18:35:32 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A1F38FC08;
	Wed, 24 Mar 2010 18:35:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OIZVOJ080307;
	Wed, 24 Mar 2010 18:35:31 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OIZVqB080305;
	Wed, 24 Mar 2010 18:35:31 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201003241835.o2OIZVqB080305@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 24 Mar 2010 18:35:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205620 - head/sys/modules/dummynet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 18:35:32 -0000

Author: luigi
Date: Wed Mar 24 18:35:31 2010
New Revision: 205620
URL: http://svn.freebsd.org/changeset/base/205620

Log:
  make the module loadable
  
  Submitted by:	Marcin Wisnicki

Modified:
  head/sys/modules/dummynet/Makefile

Modified: head/sys/modules/dummynet/Makefile
==============================================================================
--- head/sys/modules/dummynet/Makefile	Wed Mar 24 18:04:25 2010	(r205619)
+++ head/sys/modules/dummynet/Makefile	Wed Mar 24 18:35:31 2010	(r205620)
@@ -5,6 +5,8 @@
 .PATH:  ${.CURDIR}/../../netinet/ipfw
 KMOD=   dummynet
 SRCS=   ip_dummynet.c
+SRCS+= ip_dn_glue.c ip_dn_io.c
+SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c 
 SRCS+=	opt_inet6.h
 
 .if !defined(KERNBUILDDIR)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 18:35:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 250DD1065680;
	Wed, 24 Mar 2010 18:35:52 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au
	[211.29.132.191])
	by mx1.freebsd.org (Postfix) with ESMTP id 955818FC0C;
	Wed, 24 Mar 2010 18:35:48 +0000 (UTC)
Received: from besplex.bde.org (c122-106-174-6.carlnfd1.nsw.optusnet.com.au
	[122.106.174.6])
	by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o2OIZlFs025576
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 25 Mar 2010 05:35:47 +1100
Date: Thu, 25 Mar 2010 05:35:47 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: John Baldwin 
In-Reply-To: <201003221110.54807.jhb@freebsd.org>
Message-ID: <20100325053532.B739@besplex.bde.org>
References: <201003221508.o2MF8QeX056435@svn.freebsd.org>
	<201003221110.54807.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205448 - in head/sys: amd64/include i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 18:35:52 -0000

On Mon, 22 Mar 2010, John Baldwin wrote:

> On Monday 22 March 2010 11:08:26 am John Baldwin wrote:
>> Log:
>>   Remove unneeded type specifiers from 64-bit constants.  The compiler
>>   infers their natural type from the constants' values.
>>
>>   Submitted by:	bde
>>   MFC after:	3 days
>
> Verified that *_mem.o did not change MD5 sums (MTRR-related constants).  mca.o
> did change MD5 sum on both architectures, but it was a harmless change.  A
> 'shr' instruction became a 'sar' instruction.

Thanks.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 18:40:58 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BBCC106566C;
	Wed, 24 Mar 2010 18:40:58 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B38B8FC14;
	Wed, 24 Mar 2010 18:40:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OIev5n081560;
	Wed, 24 Mar 2010 18:40:57 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OIevsb081558;
	Wed, 24 Mar 2010 18:40:57 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003241840.o2OIevsb081558@svn.freebsd.org>
From: Xin LI 
Date: Wed, 24 Mar 2010 18:40:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205622 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 18:40:58 -0000

Author: delphij
Date: Wed Mar 24 18:40:57 2010
New Revision: 205622
URL: http://svn.freebsd.org/changeset/base/205622

Log:
  Expose MACHINE_CPU while building lib32 target.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Mar 24 18:37:58 2010	(r205621)
+++ head/Makefile.inc1	Wed Mar 24 18:40:57 2010	(r205622)
@@ -283,6 +283,7 @@ LIB32WMAKEENV=	MAKEOBJDIRPREFIX=${OBJTRE
 		VERSION="${VERSION}" \
 		MACHINE=i386 \
 		MACHINE_ARCH=i386 \
+		MACHINE_CPU="i686 mmx sse sse2" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH} \
 		CC="${CC} ${LIB32FLAGS}" \

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 19:21:26 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF3581065673;
	Wed, 24 Mar 2010 19:21:26 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BF0238FC1E;
	Wed, 24 Mar 2010 19:21:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OJLQ3D090741;
	Wed, 24 Mar 2010 19:21:26 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OJLQTC090739;
	Wed, 24 Mar 2010 19:21:26 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201003241921.o2OJLQTC090739@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 24 Mar 2010 19:21:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205626 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 19:21:26 -0000

Author: bz
Date: Wed Mar 24 19:21:26 2010
New Revision: 205626
URL: http://svn.freebsd.org/changeset/base/205626

Log:
  Print the pointer to the lock with the panic message. The previous
  	panic: rw lock not unlocked
  was not really helpful for debugging. Now one can at least call
  	show lock 
  form ddb to learn more about the lock.
  
  MFC after:	3 days

Modified:
  head/sys/kern/kern_rwlock.c

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Wed Mar 24 19:20:49 2010	(r205625)
+++ head/sys/kern/kern_rwlock.c	Wed Mar 24 19:21:26 2010	(r205626)
@@ -199,8 +199,8 @@ void
 rw_destroy(struct rwlock *rw)
 {
 
-	KASSERT(rw->rw_lock == RW_UNLOCKED, ("rw lock not unlocked"));
-	KASSERT(rw->rw_recurse == 0, ("rw lock still recursed"));
+	KASSERT(rw->rw_lock == RW_UNLOCKED, ("rw lock %p not unlocked", rw));
+	KASSERT(rw->rw_recurse == 0, ("rw lock %p still recursed", rw));
 	rw->rw_lock = RW_DESTROYED;
 	lock_destroy(&rw->lock_object);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 19:45:36 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8525D1065670;
	Wed, 24 Mar 2010 19:45:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73E7D8FC23;
	Wed, 24 Mar 2010 19:45:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OJjaEI096107;
	Wed, 24 Mar 2010 19:45:36 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OJjaga096104;
	Wed, 24 Mar 2010 19:45:36 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201003241945.o2OJjaga096104@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 24 Mar 2010 19:45:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205627 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 19:45:36 -0000

Author: rrs
Date: Wed Mar 24 19:45:36 2010
New Revision: 205627
URL: http://svn.freebsd.org/changeset/base/205627

Log:
  Fix for NR-Sack code. The code was NOT working properly when
  enabled. Basically most of the operations were incorrect causing
  bad sacks when you enabled nr-sack. The fixes range across
  4 files and unifiy most of the processing so that we only test
  nr_sack flags to decide which type of sack to generate.
  
  Optimization left for this is to combine the sack generation
  code and make it capable of generating either sack thus shrinking
  out a routine.
  
  Reviewed by:	tuexen@freebsd.org

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Wed Mar 24 19:21:26 2010	(r205626)
+++ head/sys/netinet/sctp_indata.c	Wed Mar 24 19:45:36 2010	(r205627)
@@ -46,24 +46,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #define SCTP_CALC_TSN_TO_GAP(gap, tsn, mapping_tsn) do { \
-					if ((compare_with_wrap(tsn, mapping_tsn, MAX_TSN)) || \
-                        (tsn == mapping_tsn)) { \
+	                if (tsn >= mapping_tsn) { \
 						gap = tsn - mapping_tsn; \
 					} else { \
 						gap = (MAX_TSN - mapping_tsn) + tsn + 1; \
 					} \
                   } while(0)
 
-#define SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc) do { \
-                    if (asoc->mapping_array_base_tsn == asoc->nr_mapping_array_base_tsn) { \
-                       SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, nr_gap); \
-                    } else {\
-                       int lgap; \
-                       SCTP_CALC_TSN_TO_GAP(lgap, tsn, asoc->mapping_array_base_tsn); \
-                       SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, lgap); \
-                    } \
-                  } while(0)
-
 /*
  * NOTES: On the outbound side of things I need to check the sack timer to
  * see if I should generate a sack into the chunk queue (if I have data to
@@ -304,6 +293,44 @@ sctp_build_ctl_cchunk(struct sctp_inpcb 
 	return (buf);
 }
 
+static void
+sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn)
+{
+	uint32_t gap, i;
+	int fnd = 0;
+
+	if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) {
+		return;
+	}
+	SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn);
+#ifdef INVARIANTS
+	if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) {
+		printf("gap:%x tsn:%x\n", gap, tsn);
+		sctp_print_mapping_array(asoc);
+		panic("Things are really messed up now!!");
+	}
+#endif
+	SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+	SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap);
+	if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+		asoc->highest_tsn_inside_nr_map = tsn;
+	}
+	if (tsn == asoc->highest_tsn_inside_map) {
+		/* We must back down to see what the new highest is */
+		for (i = tsn - 1; compare_with_wrap(i, asoc->mapping_array_base_tsn, MAX_TSN); i--) {
+			SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn);
+			if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) {
+				asoc->highest_tsn_inside_map = i;
+				fnd = 1;
+				break;
+			}
+		}
+		if (!fnd) {
+			asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1;
+		}
+	}
+}
+
 
 /*
  * We are delivering currently from the reassembly queue. We must continue to
@@ -319,9 +346,6 @@ sctp_service_reassembly(struct sctp_tcb 
 	int end = 0;
 	int cntDel;
 
-	/* EY if any out-of-order delivered, then tag it nr on nr_map */
-	uint32_t nr_tsn, nr_gap;
-
 	struct sctp_queued_to_read *control, *ctl, *ctlat;
 
 	if (stcb == NULL)
@@ -430,39 +454,7 @@ abandon:
 		}
 		/* pull it we did it */
 		TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
-		/*
-		 * EY this is the chunk that should be tagged nr gapped
-		 * calculate the gap and such then tag this TSN nr
-		 * chk->rec.data.TSN_seq
-		 */
-		/*
-		 * EY!-TODO- this tsn should be tagged nr only if it is
-		 * out-of-order, the if statement should be modified
-		 */
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-		    asoc->peer_supports_nr_sack) {
-			nr_tsn = chk->rec.data.TSN_seq;
-			SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-			if ((nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-				/*
-				 * EY The 1st should never happen, as in
-				 * process_a_data_chunk method this check
-				 * should be done
-				 */
-				/*
-				 * EY The 2nd should never happen, because
-				 * nr_mapping_array is always expanded when
-				 * mapping_array is expanded
-				 */
-				printf("Impossible nr_gap ack range failed\n");
-			} else {
-				SCTP_TCB_LOCK_ASSERT(stcb);
-				SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-				SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-				if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN))
-					asoc->highest_tsn_inside_nr_map = nr_tsn;
-			}
-		}
+		sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq);
 		if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) {
 			asoc->fragmented_delivery_inprogress = 0;
 			if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0) {
@@ -509,67 +501,11 @@ abandon:
 						asoc->size_on_all_streams -= ctl->length;
 						sctp_ucount_decr(asoc->cnt_on_all_streams);
 						strm->last_sequence_delivered++;
-						/*
-						 * EY will be used to
-						 * calculate nr-gap
-						 */
-						nr_tsn = ctl->sinfo_tsn;
 						sctp_add_to_readq(stcb->sctp_ep, stcb,
 						    ctl,
 						    &stcb->sctp_socket->so_rcv, 1,
 						    SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
-						/*
-						 * EY -now something is
-						 * delivered, calculate
-						 * nr_gap and tag this tsn
-						 * NR
-						 */
-						if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-						    asoc->peer_supports_nr_sack) {
-							SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-							if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) ||
-							    (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-								/*
-								 * EY The
-								 * 1st
-								 * should
-								 * never
-								 * happen,
-								 * as in
-								 * process_a_
-								 * data_chunk
-								 *  method
-								 * this
-								 * check
-								 * should be
-								 * done
-								 */
-								/*
-								 * EY The
-								 * 2nd
-								 * should
-								 * never
-								 * happen,
-								 * because
-								 * nr_mapping
-								 * _array is
-								 * always
-								 * expanded
-								 * when
-								 * mapping_ar
-								 * ray is
-								 * expanded
-								 */
-							} else {
-								SCTP_TCB_LOCK_ASSERT(stcb);
-								SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-								SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-								if (compare_with_wrap(nr_tsn,
-								    asoc->highest_tsn_inside_nr_map,
-								    MAX_TSN))
-									asoc->highest_tsn_inside_nr_map = nr_tsn;
-							}
-						}
+						sctp_mark_non_revokable(asoc, ctl->sinfo_tsn);
 						ctl = ctlat;
 					} else {
 						break;
@@ -618,9 +554,6 @@ sctp_queue_data_to_stream(struct sctp_tc
 	uint16_t nxt_todel;
 	struct mbuf *oper;
 
-	/* EY- will be used to calculate nr-gap for a tsn */
-	uint32_t nr_tsn, nr_gap;
-
 	queue_needed = 1;
 	asoc->size_on_all_streams += control->length;
 	sctp_ucount_incr(asoc->cnt_on_all_streams);
@@ -682,41 +615,12 @@ protocol_error:
 		asoc->size_on_all_streams -= control->length;
 		sctp_ucount_decr(asoc->cnt_on_all_streams);
 		strm->last_sequence_delivered++;
-		/* EY will be used to calculate nr-gap */
-		nr_tsn = control->sinfo_tsn;
+
 		sctp_add_to_readq(stcb->sctp_ep, stcb,
 		    control,
 		    &stcb->sctp_socket->so_rcv, 1,
 		    SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
-		/*
-		 * EY this is the chunk that should be tagged nr gapped
-		 * calculate the gap and such then tag this TSN nr
-		 * chk->rec.data.TSN_seq
-		 */
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-		    asoc->peer_supports_nr_sack) {
-			SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-			if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) ||
-			    (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-				printf("Impossible nr_tsn set 2?\n");
-				/*
-				 * EY The 1st should never happen, as in
-				 * process_a_data_chunk method this check
-				 * should be done
-				 */
-				/*
-				 * EY The 2nd should never happen, because
-				 * nr_mapping_array is always expanded when
-				 * mapping_array is expanded
-				 */
-			} else {
-				SCTP_TCB_LOCK_ASSERT(stcb);
-				SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-				SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-				if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN))
-					asoc->highest_tsn_inside_nr_map = nr_tsn;
-			}
-		}
+		sctp_mark_non_revokable(asoc, control->sinfo_tsn);
 		control = TAILQ_FIRST(&strm->inqueue);
 		while (control != NULL) {
 			/* all delivered */
@@ -738,47 +642,12 @@ protocol_error:
 					    SCTP_STR_LOG_FROM_IMMED_DEL);
 				}
 				/* EY will be used to calculate nr-gap */
-				nr_tsn = control->sinfo_tsn;
 				sctp_add_to_readq(stcb->sctp_ep, stcb,
 				    control,
 				    &stcb->sctp_socket->so_rcv, 1,
 				    SCTP_READ_LOCK_NOT_HELD,
 				    SCTP_SO_NOT_LOCKED);
-				/*
-				 * EY this is the chunk that should be
-				 * tagged nr gapped calculate the gap and
-				 * such then tag this TSN nr
-				 * chk->rec.data.TSN_seq
-				 */
-				if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-				    asoc->peer_supports_nr_sack) {
-					SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-					if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) ||
-					    (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-						/*
-						 * EY The 1st should never
-						 * happen, as in
-						 * process_a_data_chunk
-						 * method this check should
-						 * be done
-						 */
-						/*
-						 * EY The 2nd should never
-						 * happen, because
-						 * nr_mapping_array is
-						 * always expanded when
-						 * mapping_array is expanded
-						 */
-					} else {
-						SCTP_TCB_LOCK_ASSERT(stcb);
-						SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-						SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-						if (compare_with_wrap(nr_tsn,
-						    asoc->highest_tsn_inside_nr_map,
-						    MAX_TSN))
-							asoc->highest_tsn_inside_nr_map = nr_tsn;
-					}
-				}
+				sctp_mark_non_revokable(asoc, control->sinfo_tsn);
 				control = at;
 				continue;
 			}
@@ -1586,9 +1455,6 @@ sctp_process_a_data_chunk(struct sctp_tc
 	/* struct sctp_tmit_chunk *chk; */
 	struct sctp_tmit_chunk *chk;
 	uint32_t tsn, gap;
-
-	/* EY - for nr_sack */
-	uint32_t nr_gap;
 	struct mbuf *dmbuf;
 	int indx, the_len;
 	int need_reasm_check = 0;
@@ -1640,14 +1506,12 @@ sctp_process_a_data_chunk(struct sctp_tc
 			return (0);
 		}
 	}
-	/* EY - for nr_sack */
-	nr_gap = gap;
-
 	if (compare_with_wrap(tsn, *high_tsn, MAX_TSN)) {
 		*high_tsn = tsn;
 	}
 	/* See if we have received this one already */
-	if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) {
+	if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap) ||
+	    SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, gap)) {
 		SCTP_STAT_INCR(sctps_recvdupdata);
 		if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) {
 			/* Record a dup for the next outbound sack */
@@ -1714,7 +1578,8 @@ sctp_process_a_data_chunk(struct sctp_tc
 #endif
 		}
 		/* now is it in the mapping array of what we have accepted? */
-		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) {
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN) &&
+		    compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
 			/* Nope not in the valid range dump it */
 			sctp_set_rwnd(stcb, asoc);
 			if ((asoc->cnt_on_all_streams +
@@ -1758,23 +1623,10 @@ sctp_process_a_data_chunk(struct sctp_tc
 		}
 		SCTP_STAT_INCR(sctps_badsid);
 		SCTP_TCB_LOCK_ASSERT(stcb);
-		SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap);
-		/* EY set this tsn present in  nr_sack's nr_mapping_array */
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-		    asoc->peer_supports_nr_sack) {
-			SCTP_TCB_LOCK_ASSERT(stcb);
-			SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
-			SCTP_REVERSE_OUT_TSN_PRES(gap, tsn, asoc);
-		}
-		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) {
-			/* we have a new high score */
-			asoc->highest_tsn_inside_map = tsn;
-			/* EY nr_sack version of the above */
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack)
-				asoc->highest_tsn_inside_nr_map = tsn;
-			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
-				sctp_log_map(0, 2, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
-			}
+
+		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+			asoc->highest_tsn_inside_nr_map = tsn;
 		}
 		if (tsn == (asoc->cumulative_tsn + 1)) {
 			/* Update cum-ack */
@@ -1925,48 +1777,6 @@ sctp_process_a_data_chunk(struct sctp_tc
 		    control, &stcb->sctp_socket->so_rcv,
 		    1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
 
-		/*
-		 * EY here I should check if this delivered tsn is
-		 * out_of_order, if yes then update the nr_map
-		 */
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) {
-			/*
-			 * EY check if the mapping_array and nr_mapping
-			 * array are consistent
-			 */
-			if (asoc->mapping_array_base_tsn != asoc->nr_mapping_array_base_tsn)
-				/*
-				 * printf("EY-IN
-				 * sctp_process_a_data_chunk(5): Something
-				 * is wrong the map base tsn" "\nEY-and
-				 * nr_map base tsn should be equal.");
-				 */
-				/* EY debugging block */
-			{
-				/*
-				 * printf("\nEY-Calculating an
-				 * nr_gap!!\nmapping_array_size = %d
-				 * nr_mapping_array_size = %d"
-				 * "\nEY-mapping_array_base = %d
-				 * nr_mapping_array_base =
-				 * %d\nEY-highest_tsn_inside_map = %d"
-				 * "highest_tsn_inside_nr_map = %d\nEY-TSN =
-				 * %d nr_gap = %d",asoc->mapping_array_size,
-				 * asoc->nr_mapping_array_size,
-				 * asoc->mapping_array_base_tsn,
-				 * asoc->nr_mapping_array_base_tsn,
-				 * asoc->highest_tsn_inside_map,
-				 * asoc->highest_tsn_inside_nr_map,tsn,nr_gap
-				 * );
-				 */
-			}
-			/* EY - not %100 sure about the lock thing */
-			SCTP_TCB_LOCK_ASSERT(stcb);
-			SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-			SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc);
-			if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN))
-				asoc->highest_tsn_inside_nr_map = tsn;
-		}
 		if ((chunk_flags & SCTP_DATA_UNORDERED) == 0) {
 			/* for ordered, bump what we delivered */
 			asoc->strmin[strmno].last_sequence_delivered++;
@@ -1977,6 +1787,10 @@ sctp_process_a_data_chunk(struct sctp_tc
 			    SCTP_STR_LOG_FROM_EXPRS_DEL);
 		}
 		control = NULL;
+		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+			asoc->highest_tsn_inside_nr_map = tsn;
+		}
 		goto finish_express_del;
 	}
 failed_express_del:
@@ -2012,39 +1826,9 @@ failed_express_del:
 				SCTP_PRINTF("Append fails end:%d\n", end);
 				goto failed_pdapi_express_del;
 			}
-			/*
-			 * EY It is appended to the read queue in prev if
-			 * block here I should check if this delivered tsn
-			 * is out_of_order, if yes then update the nr_map
-			 */
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-			    asoc->peer_supports_nr_sack) {
-				/* EY debugging block */
-				{
-					/*
-					 * printf("\nEY-Calculating an
-					 * nr_gap!!\nEY-mapping_array_size =
-					 * %d nr_mapping_array_size = %d"
-					 * "\nEY-mapping_array_base = %d
-					 * nr_mapping_array_base =
-					 * %d\nEY-highest_tsn_inside_map =
-					 * %d" "highest_tsn_inside_nr_map =
-					 * %d\nEY-TSN = %d nr_gap =
-					 * %d",asoc->mapping_array_size,
-					 * asoc->nr_mapping_array_size,
-					 * asoc->mapping_array_base_tsn,
-					 * asoc->nr_mapping_array_base_tsn,
-					 * asoc->highest_tsn_inside_map,
-					 * asoc->highest_tsn_inside_nr_map,ts
-					 * n,nr_gap);
-					 */
-				}
-				/* EY - not %100 sure about the lock thing */
-				SCTP_TCB_LOCK_ASSERT(stcb);
-				SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-				SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc);
-				if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN))
-					asoc->highest_tsn_inside_nr_map = tsn;
+			SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+			if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+				asoc->highest_tsn_inside_nr_map = tsn;
 			}
 			SCTP_STAT_INCR(sctps_recvexpressm);
 			control->sinfo_tsn = tsn;
@@ -2069,12 +1853,27 @@ failed_express_del:
 					need_reasm_check = 1;
 				}
 			}
+			SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+			if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+				asoc->highest_tsn_inside_nr_map = tsn;
+			}
 			control = NULL;
 			goto finish_express_del;
 		}
 	}
 failed_pdapi_express_del:
 	control = NULL;
+	if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) {
+		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+			asoc->highest_tsn_inside_nr_map = tsn;
+		}
+	} else {
+		SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap);
+		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) {
+			asoc->highest_tsn_inside_map = tsn;
+		}
+	}
 	if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
 		sctp_alloc_a_chunk(stcb, chk);
 		if (chk == NULL) {
@@ -2263,56 +2062,7 @@ failed_pdapi_express_del:
 			sctp_add_to_readq(stcb->sctp_ep, stcb,
 			    control,
 			    &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
-			/*
-			 * EY It is added to the read queue in prev if block
-			 * here I should check if this delivered tsn is
-			 * out_of_order, if yes then update the nr_map
-			 */
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-			    asoc->peer_supports_nr_sack) {
-				/*
-				 * EY check if the mapping_array and
-				 * nr_mapping array are consistent
-				 */
-				if (asoc->mapping_array_base_tsn != asoc->nr_mapping_array_base_tsn)
-					/*
-					 * printf("EY-IN
-					 * sctp_process_a_data_chunk(6):
-					 * Something is wrong the map base
-					 * tsn" "\nEY-and nr_map base tsn
-					 * should be equal.");
-					 */
-					/*
-					 * EY - not %100 sure about the lock
-					 * thing, i think we don't need the
-					 * below,
-					 */
-					/* SCTP_TCB_LOCK_ASSERT(stcb); */
-				{
-					/*
-					 * printf("\nEY-Calculating an
-					 * nr_gap!!\nEY-mapping_array_size =
-					 * %d nr_mapping_array_size = %d"
-					 * "\nEY-mapping_array_base = %d
-					 * nr_mapping_array_base =
-					 * %d\nEY-highest_tsn_inside_map =
-					 * %d" "highest_tsn_inside_nr_map =
-					 * %d\nEY-TSN = %d nr_gap =
-					 * %d",asoc->mapping_array_size,
-					 * asoc->nr_mapping_array_size,
-					 * asoc->mapping_array_base_tsn,
-					 * asoc->nr_mapping_array_base_tsn,
-					 * asoc->highest_tsn_inside_map,
-					 * asoc->highest_tsn_inside_nr_map,ts
-					 * n,nr_gap);
-					 */
-				}
-				SCTP_TCB_LOCK_ASSERT(stcb);
-				SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-				SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc);
-				if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN))
-					asoc->highest_tsn_inside_nr_map = tsn;
-			}
+
 		} else {
 			/*
 			 * Special check for when streams are resetting. We
@@ -2384,13 +2134,6 @@ failed_pdapi_express_del:
 		}
 	}
 finish_express_del:
-	if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) {
-		/* we have a new high score */
-		asoc->highest_tsn_inside_map = tsn;
-		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
-			sctp_log_map(0, 2, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
-		}
-	}
 	if (tsn == (asoc->cumulative_tsn + 1)) {
 		/* Update cum-ack */
 		asoc->cumulative_tsn = tsn;
@@ -2412,22 +2155,6 @@ finish_express_del:
 		sctp_log_map(asoc->mapping_array_base_tsn, asoc->cumulative_tsn,
 		    asoc->highest_tsn_inside_map, SCTP_MAP_PREPARE_SLIDE);
 	}
-	SCTP_TCB_LOCK_ASSERT(stcb);
-	SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap);
-
-	/*
-	 * EY - set tsn present in nr-map if  doing nr-sacks and the tsn is
-	 * non-renegable
-	 */
-	if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-	    asoc->peer_supports_nr_sack &&
-	    (SCTP_BASE_SYSCTL(sctp_do_drain) == 0)) {
-		SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap);
-		SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc);
-		if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
-			asoc->highest_tsn_inside_nr_map = tsn;
-		}
-	}
 	/* check the special flag for stream resets */
 	if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) &&
 	    ((compare_with_wrap(asoc->cumulative_tsn, liste->tsn, MAX_TSN)) ||
@@ -2532,7 +2259,6 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 	 */
 	struct sctp_association *asoc;
 	int at;
-	uint8_t comb_byte;
 	int last_all_ones = 0;
 	int slide_from, slide_end, lgap, distance;
 
@@ -2540,7 +2266,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 	/* int nr_at; */
 	/* int nr_last_all_ones = 0; */
 	/* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */
-	uint32_t old_cumack, old_base, old_highest;
+	uint32_t old_cumack, old_base, old_highest, highest_tsn;
 
 	asoc = &stcb->asoc;
 	at = 0;
@@ -2553,30 +2279,23 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 	 * offset of the current cum-ack as the starting point.
 	 */
 	at = 0;
-	for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) {
-		/*
-		 * We must combine the renegable and non-renegable arrays
-		 * here to form a unified view of what is acked right now
-		 * (since they are kept separate
-		 */
-		comb_byte = asoc->mapping_array[slide_from] | asoc->nr_mapping_array[slide_from];
-		if (comb_byte == 0xff) {
+	for (slide_from = 0; slide_from < stcb->asoc.nr_mapping_array_size; slide_from++) {
+		if (asoc->nr_mapping_array[slide_from] == 0xff) {
 			at += 8;
 			last_all_ones = 1;
 		} else {
 			/* there is a 0 bit */
-			at += sctp_map_lookup_tab[comb_byte];
+			at += sctp_map_lookup_tab[asoc->nr_mapping_array[slide_from]];
 			last_all_ones = 0;
 			break;
 		}
 	}
-	asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - last_all_ones);
-	/* at is one off, since in the table a embedded -1 is present */
+	asoc->cumulative_tsn = asoc->nr_mapping_array_base_tsn + (at - last_all_ones);
 	at++;
 
-	if (compare_with_wrap(asoc->cumulative_tsn,
-	    asoc->highest_tsn_inside_map,
-	    MAX_TSN)) {
+	if (compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_map, MAX_TSN) &&
+	    compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)
+	    ) {
 #ifdef INVARIANTS
 		panic("huh, cumack 0x%x greater than high-tsn 0x%x in map",
 		    asoc->cumulative_tsn, asoc->highest_tsn_inside_map);
@@ -2591,37 +2310,29 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 		asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn;
 #endif
 	}
-	if ((asoc->cumulative_tsn == asoc->highest_tsn_inside_map) && (at >= 8)) {
+	if (compare_with_wrap(asoc->highest_tsn_inside_nr_map,
+	    asoc->highest_tsn_inside_map,
+	    MAX_TSN)) {
+		highest_tsn = asoc->highest_tsn_inside_nr_map;
+	} else {
+		highest_tsn = asoc->highest_tsn_inside_map;
+	}
+	if ((asoc->cumulative_tsn == highest_tsn) && (at >= 8)) {
 		/* The complete array was completed by a single FR */
-		/* higest becomes the cum-ack */
+		/* highest becomes the cum-ack */
 		int clr;
 
-		asoc->cumulative_tsn = asoc->highest_tsn_inside_map;
 		/* clear the array */
 		clr = (at >> 3) + 1;
 		if (clr > asoc->mapping_array_size) {
 			clr = asoc->mapping_array_size;
 		}
 		memset(asoc->mapping_array, 0, clr);
-		/* base becomes one ahead of the cum-ack */
-		asoc->mapping_array_base_tsn = asoc->cumulative_tsn + 1;
-
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) {
-
-			if (clr > asoc->nr_mapping_array_size)
-				clr = asoc->nr_mapping_array_size;
+		memset(asoc->nr_mapping_array, 0, clr);
 
-			memset(asoc->nr_mapping_array, 0, clr);
-			/* base becomes one ahead of the cum-ack */
-			asoc->nr_mapping_array_base_tsn = asoc->cumulative_tsn + 1;
-			asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn;
-		}
-		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
-			sctp_log_map(old_base, old_cumack, old_highest,
-			    SCTP_MAP_PREPARE_SLIDE);
-			sctp_log_map(asoc->mapping_array_base_tsn, asoc->cumulative_tsn,
-			    asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_CLEARED);
-		}
+		asoc->mapping_array_base_tsn = asoc->cumulative_tsn + 1;
+		asoc->nr_mapping_array_base_tsn = asoc->cumulative_tsn + 1;
+		asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map = asoc->cumulative_tsn;
 	} else if (at >= 8) {
 		/* we can slide the mapping array down */
 		/* slide_from holds where we hit the first NON 0xff byte */
@@ -2630,19 +2341,15 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 		 * now calculate the ceiling of the move using our highest
 		 * TSN value
 		 */
-		if (asoc->highest_tsn_inside_map >= asoc->mapping_array_base_tsn) {
-			lgap = asoc->highest_tsn_inside_map -
-			    asoc->mapping_array_base_tsn;
-		} else {
-			lgap = (MAX_TSN - asoc->mapping_array_base_tsn) +
-			    asoc->highest_tsn_inside_map + 1;
-		}
-		slide_end = lgap >> 3;
+		SCTP_CALC_TSN_TO_GAP(lgap, highest_tsn, asoc->mapping_array_base_tsn);
+		slide_end = (lgap >> 3);
 		if (slide_end < slide_from) {
+			sctp_print_mapping_array(asoc);
 #ifdef INVARIANTS
 			panic("impossible slide");
 #else
-			printf("impossible slide?\n");
+			printf("impossible slide lgap:%x slide_end:%x slide_from:%x? at:%d\n",
+			    lgap, slide_end, slide_from, at);
 			return;
 #endif
 		}
@@ -2682,30 +2389,21 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 			for (ii = 0; ii < distance; ii++) {
 				asoc->mapping_array[ii] =
 				    asoc->mapping_array[slide_from + ii];
+				asoc->nr_mapping_array[ii] =
+				    asoc->nr_mapping_array[slide_from + ii];
+
 			}
 			for (ii = distance; ii <= slide_end; ii++) {
 				asoc->mapping_array[ii] = 0;
+				asoc->nr_mapping_array[ii] = 0;
 			}
 			asoc->mapping_array_base_tsn += (slide_from << 3);
+			asoc->nr_mapping_array_base_tsn += (slide_from << 3);
 			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
 				sctp_log_map(asoc->mapping_array_base_tsn,
 				    asoc->cumulative_tsn, asoc->highest_tsn_inside_map,
 				    SCTP_MAP_SLIDE_RESULT);
 			}
-			/*
-			 * EY if doing nr_sacks then slide the
-			 * nr_mapping_array accordingly please
-			 */
-			if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) {
-				for (ii = 0; ii < distance; ii++) {
-					asoc->nr_mapping_array[ii] =
-					    asoc->nr_mapping_array[slide_from + ii];
-				}
-				for (ii = distance; ii <= slide_end; ii++) {
-					asoc->nr_mapping_array[ii] = 0;
-				}
-				asoc->nr_mapping_array_base_tsn += (slide_from << 3);
-			}
 		}
 	}
 	/*
@@ -2736,8 +2434,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 			int is_a_gap;
 
 			/* is there a gap now ? */
-			is_a_gap = compare_with_wrap(stcb->asoc.highest_tsn_inside_map,
-			    stcb->asoc.cumulative_tsn, MAX_TSN);
+			is_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN);
 
 			/*
 			 * CMT DAC algorithm: increase number of packets
@@ -5742,9 +5439,6 @@ sctp_kick_prsctp_reorder_queue(struct sc
 	struct sctp_association *asoc;
 	int tt;
 
-	/* EY -used to calculate nr_gap information */
-	uint32_t nr_tsn, nr_gap;
-
 	asoc = &stcb->asoc;
 	tt = strmin->last_sequence_delivered;
 	/*
@@ -5764,82 +5458,10 @@ sctp_kick_prsctp_reorder_queue(struct sc
 			/* deliver it to at least the delivery-q */
 			if (stcb->sctp_socket) {
 				/* EY need the tsn info for calculating nr */
-				nr_tsn = ctl->sinfo_tsn;
 				sctp_add_to_readq(stcb->sctp_ep, stcb,
 				    ctl,
 				    &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED);
-				/*
-				 * EY this is the chunk that should be
-				 * tagged nr gapped calculate the gap and
-				 * such then tag this TSN nr
-				 * chk->rec.data.TSN_seq
-				 */
-				if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-				    asoc->peer_supports_nr_sack) {
-					SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-					if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) ||
-					    (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-						/*
-						 * EY These should never
-						 * happen- explained before
-						 */
-					} else {
-						SCTP_TCB_LOCK_ASSERT(stcb);
-						SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-						SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-						if (compare_with_wrap(nr_tsn,
-						    asoc->highest_tsn_inside_nr_map,
-						    MAX_TSN))
-							asoc->highest_tsn_inside_nr_map = nr_tsn;
-					}
-					if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, nr_gap))
-						/*
-						 * printf("In
-						 * sctp_kick_prsctp_reorder_q
-						 * ueue(7): Something wrong,
-						 * the TSN to be tagged"
-						 * "\nas NR is not even in
-						 * the mapping_array, or map
-						 * and nr_map are
-						 * inconsistent");
-						 */
-						/*
-						 * EY - not %100 sure about
-						 * the lock thing, don't
-						 * think its required
-						 */
-						/*
-						 * SCTP_TCB_LOCK_ASSERT(stcb)
-						 * ;
-						 */
-					{
-						/*
-						 * printf("\nCalculating an
-						 * nr_gap!!\nmapping_array_si
-						 * ze = %d
-						 * nr_mapping_array_size =
-						 * %d" "\nmapping_array_base
-						 * = %d
-						 * nr_mapping_array_base =
-						 * %d\nhighest_tsn_inside_map
-						 *  = %d"
-						 * "highest_tsn_inside_nr_map
-						 *  = %d\nTSN = %d nr_gap =
-						 * %d",asoc->mapping_array_si
-						 * ze,
-						 * asoc->nr_mapping_array_siz
-						 * e,
-						 * asoc->mapping_array_base_t
-						 * sn,
-						 * asoc->nr_mapping_array_bas
-						 * e_tsn,
-						 * asoc->highest_tsn_inside_m
-						 * ap,
-						 * asoc->highest_tsn_inside_n
-						 * r_map,tsn,nr_gap);
-						 */
-					}
-				}
+				sctp_mark_non_revokable(asoc, ctl->sinfo_tsn);
 			}
 		} else {
 			/* no more delivery now. */
@@ -5864,82 +5486,11 @@ sctp_kick_prsctp_reorder_queue(struct sc
 			/* deliver it to at least the delivery-q */
 			strmin->last_sequence_delivered = ctl->sinfo_ssn;
 			if (stcb->sctp_socket) {
-				/* EY */
-				nr_tsn = ctl->sinfo_tsn;
 				sctp_add_to_readq(stcb->sctp_ep, stcb,
 				    ctl,
 				    &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED);
-				/*
-				 * EY this is the chunk that should be
-				 * tagged nr gapped calculate the gap and
-				 * such then tag this TSN nr
-				 * chk->rec.data.TSN_seq
-				 */
-				if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-				    asoc->peer_supports_nr_sack) {
-					SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn);
-					if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) ||
-					    (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) {
-						/*
-						 * EY These should never
-						 * happen, explained before
-						 */
-					} else {
-						SCTP_TCB_LOCK_ASSERT(stcb);
-						SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap);
-						SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc);
-						if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map,
-						    MAX_TSN))
-							asoc->highest_tsn_inside_nr_map = nr_tsn;
-					}
-					if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, nr_gap))
-						/*
-						 * printf("In
-						 * sctp_kick_prsctp_reorder_q
-						 * ueue(8): Something wrong,
-						 * the TSN to be tagged"
-						 * "\nas NR is not even in
-						 * the mapping_array, or map
-						 * and nr_map are
-						 * inconsistent");
-						 */
-						/*
-						 * EY - not %100 sure about
-						 * the lock thing, don't
-						 * think its required
-						 */
-						/*
-						 * SCTP_TCB_LOCK_ASSERT(stcb)
-						 * ;
-						 */
-					{
-						/*
-						 * printf("\nCalculating an
-						 * nr_gap!!\nmapping_array_si
-						 * ze = %d
-						 * nr_mapping_array_size =
-						 * %d" "\nmapping_array_base
-						 * = %d
-						 * nr_mapping_array_base =
-						 * %d\nhighest_tsn_inside_map
-						 *  = %d"
-						 * "highest_tsn_inside_nr_map
-						 *  = %d\nTSN = %d nr_gap =
-						 * %d",asoc->mapping_array_si
-						 * ze,
-						 * asoc->nr_mapping_array_siz
-						 * e,
-						 * asoc->mapping_array_base_t
-						 * sn,
-						 * asoc->nr_mapping_array_bas
-						 * e_tsn,
-						 * asoc->highest_tsn_inside_m
-						 * ap,
-						 * asoc->highest_tsn_inside_n
-						 * r_map,tsn,nr_gap);
-						 */
-					}
-				}
+				sctp_mark_non_revokable(asoc, ctl->sinfo_tsn);
+
 			}
 			tt = strmin->last_sequence_delivered + 1;
 		} else {
@@ -6096,25 +5647,19 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 	if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_map,
 	    MAX_TSN)) {
 		asoc->highest_tsn_inside_map = new_cum_tsn;
-		/* EY nr_mapping_array version of the above */
-		/*
-		 * if(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
-		 * asoc->peer_supports_nr_sack)
-		 */
+
+	}
+	if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_nr_map,
+	    MAX_TSN)) {
 		asoc->highest_tsn_inside_nr_map = new_cum_tsn;
-		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
-			sctp_log_map(0, 0, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
-		}
 	}
 	/*
 	 * now we know the new TSN is more advanced, let's find the actual
 	 * gap
 	 */
-	SCTP_CALC_TSN_TO_GAP(gap, new_cum_tsn, asoc->mapping_array_base_tsn);
+	SCTP_CALC_TSN_TO_GAP(gap, new_cum_tsn, asoc->nr_mapping_array_base_tsn);
+	asoc->cumulative_tsn = new_cum_tsn;
 	if (gap >= m_size) {
-		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
-			sctp_log_map(0, 0, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
-		}
 		if ((long)gap > sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv)) {
 			struct mbuf *oper;
 
@@ -6147,23 +5692,15 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 			return;
 		}
 		SCTP_STAT_INCR(sctps_fwdtsn_map_over);
+
 		memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
-		cumack_set_flag = 1;
 		asoc->mapping_array_base_tsn = new_cum_tsn + 1;
-		asoc->cumulative_tsn = asoc->highest_tsn_inside_map = new_cum_tsn;
-		/* EY - nr_sack: nr_mapping_array version of the above */
-		if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) {
-			memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);
-			asoc->nr_mapping_array_base_tsn = new_cum_tsn + 1;
-			asoc->highest_tsn_inside_nr_map = new_cum_tsn;
-			if (asoc->nr_mapping_array_size != asoc->mapping_array_size) {
-				/*
-				 * printf("IN sctp_handle_forward_tsn:
-				 * Something is wrong the size of" "map and
-				 * nr_map should be equal!")
-				 */ ;
-			}
-		}
+		asoc->highest_tsn_inside_map = new_cum_tsn;
+
+		memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.nr_mapping_array_size);

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

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 20:01:14 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BB8F106564A;
	Wed, 24 Mar 2010 20:01:14 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BED88FC1A;
	Wed, 24 Mar 2010 20:01:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OK1Eor099569;
	Wed, 24 Mar 2010 20:01:14 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OK1EWL099567;
	Wed, 24 Mar 2010 20:01:14 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201003242001.o2OK1EWL099567@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 24 Mar 2010 20:01:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205628 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 20:01:14 -0000

Author: rrs
Date: Wed Mar 24 20:01:14 2010
New Revision: 205628
URL: http://svn.freebsd.org/changeset/base/205628

Log:
  lagging file I forgot to commit with my nr-sack fixes... opps
  
  Reviewed by:	tuexen@freebsd.org

Modified:
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctputil.h
==============================================================================
--- head/sys/netinet/sctputil.h	Wed Mar 24 19:45:36 2010	(r205627)
+++ head/sys/netinet/sctputil.h	Wed Mar 24 20:01:14 2010	(r205628)
@@ -169,8 +169,6 @@ sctp_report_all_outbound(struct sctp_tcb
 
 int sctp_expand_mapping_array(struct sctp_association *, uint32_t);
 
-/* EY nr_sack version of the above method, expands nr_mapping_array */
-int sctp_expand_nr_mapping_array(struct sctp_association *, uint32_t);
 void 
 sctp_abort_notification(struct sctp_tcb *, int, int
 #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 20:02:40 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E42FF1065673;
	Wed, 24 Mar 2010 20:02:40 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2F188FC1B;
	Wed, 24 Mar 2010 20:02:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OK2eYK099932;
	Wed, 24 Mar 2010 20:02:40 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OK2eZZ099926;
	Wed, 24 Mar 2010 20:02:40 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201003242002.o2OK2eZZ099926@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 24 Mar 2010 20:02:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205629 - in head/sys: conf netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 20:02:41 -0000

Author: rrs
Date: Wed Mar 24 20:02:40 2010
New Revision: 205629
URL: http://svn.freebsd.org/changeset/base/205629

Log:
  Adds the option of keeping per-cpu statistics in SCTP. This
  may be useful since it gets rid of atomics but I want it to
  remain an option until I can do further testing on if it really
  speeds things up.

Modified:
  head/sys/conf/options
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_pcb.h
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_uio.h

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed Mar 24 20:01:14 2010	(r205628)
+++ head/sys/conf/options	Wed Mar 24 20:02:40 2010	(r205629)
@@ -437,6 +437,7 @@ SCTP_MBCNT_LOGGING	opt_sctp.h # Log to K
 SCTP_PACKET_LOGGING	opt_sctp.h # Log to a packet buffer last N packets
 SCTP_LTRACE_CHUNKS	opt_sctp.h # Log to KTR chunks processed
 SCTP_LTRACE_ERRORS	opt_sctp.h # Log to KTR error returns.
+SCTP_USE_PERCPU_STAT    opt_sctp.h # Use per cpu stats.
 #
 #
 #

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Wed Mar 24 20:01:14 2010	(r205628)
+++ head/sys/netinet/sctp_pcb.c	Wed Mar 24 20:02:40 2010	(r205629)
@@ -5425,8 +5425,13 @@ sctp_pcb_init()
 	bzero(&SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log));
 #endif
 	(void)SCTP_GETTIME_TIMEVAL(&tv);
+#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+	SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec;
+	SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec;
+#else
 	SCTP_BASE_STAT(sctps_discontinuitytime).tv_sec = (uint32_t) tv.tv_sec;
 	SCTP_BASE_STAT(sctps_discontinuitytime).tv_usec = (uint32_t) tv.tv_usec;
+#endif
 	/* init the empty list of (All) Endpoints */
 	LIST_INIT(&SCTP_BASE_INFO(listhead));
 

Modified: head/sys/netinet/sctp_pcb.h
==============================================================================
--- head/sys/netinet/sctp_pcb.h	Wed Mar 24 20:01:14 2010	(r205628)
+++ head/sys/netinet/sctp_pcb.h	Wed Mar 24 20:02:40 2010	(r205629)
@@ -246,7 +246,11 @@ struct sctp_base_info {
 	 * All static structures that anchor the system must be here.
 	 */
 	struct sctp_epinfo sctppcbinfo;
+#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+	struct sctpstat sctpstat[MAXCPU];
+#else
 	struct sctpstat sctpstat;
+#endif
 	struct sctp_sysctl sctpsysctl;
 	uint8_t first_time;
 	char sctp_pcb_initialized;

Modified: head/sys/netinet/sctp_sysctl.c
==============================================================================
--- head/sys/netinet/sctp_sysctl.c	Wed Mar 24 20:01:14 2010	(r205628)
+++ head/sys/netinet/sctp_sysctl.c	Wed Mar 24 20:02:40 2010	(r205629)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 /*
  * sysctl tunable variables
@@ -627,7 +628,158 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 	return (error);
 }
 
+#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+static int
+sysctl_stat_get(SYSCTL_HANDLER_ARGS)
+{
+	int cpu, error;
+	struct sctpstat sb, *sarry;
 
+	memset(&sb, 0, sizeof(sb));
+	for (cpu = 0; cpu < mp_ncpus; cpu++) {
+		sarry = &SCTP_BASE_STATS[cpu];
+		if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) {
+			sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec;
+			sb.sctps_discontinuitytime.tv_usec = sarry->sctps_discontinuitytime.tv_usec;
+		}
+		sb.sctps_currestab += sarry->sctps_currestab;
+		sb.sctps_activeestab += sarry->sctps_activeestab;
+		sb.sctps_restartestab += sarry->sctps_restartestab;
+		sb.sctps_collisionestab += sarry->sctps_collisionestab;
+		sb.sctps_passiveestab += sarry->sctps_passiveestab;
+		sb.sctps_aborted += sarry->sctps_aborted;
+		sb.sctps_shutdown += sarry->sctps_shutdown;
+		sb.sctps_outoftheblue += sarry->sctps_outoftheblue;
+		sb.sctps_checksumerrors += sarry->sctps_checksumerrors;
+		sb.sctps_outcontrolchunks += sarry->sctps_outcontrolchunks;
+		sb.sctps_outorderchunks += sarry->sctps_outorderchunks;
+		sb.sctps_outunorderchunks += sarry->sctps_outunorderchunks;
+		sb.sctps_incontrolchunks += sarry->sctps_incontrolchunks;
+		sb.sctps_inorderchunks += sarry->sctps_inorderchunks;
+		sb.sctps_inunorderchunks += sarry->sctps_inunorderchunks;
+		sb.sctps_fragusrmsgs += sarry->sctps_fragusrmsgs;
+		sb.sctps_reasmusrmsgs += sarry->sctps_reasmusrmsgs;
+		sb.sctps_outpackets += sarry->sctps_outpackets;
+		sb.sctps_inpackets += sarry->sctps_inpackets;
+		sb.sctps_recvpackets += sarry->sctps_recvpackets;
+		sb.sctps_recvdatagrams += sarry->sctps_recvdatagrams;
+		sb.sctps_recvpktwithdata += sarry->sctps_recvpktwithdata;
+		sb.sctps_recvsacks += sarry->sctps_recvsacks;
+		sb.sctps_recvdata += sarry->sctps_recvdata;
+		sb.sctps_recvdupdata += sarry->sctps_recvdupdata;
+		sb.sctps_recvheartbeat += sarry->sctps_recvheartbeat;
+		sb.sctps_recvheartbeatack += sarry->sctps_recvheartbeatack;
+		sb.sctps_recvecne += sarry->sctps_recvecne;
+		sb.sctps_recvauth += sarry->sctps_recvauth;
+		sb.sctps_recvauthmissing += sarry->sctps_recvauthmissing;
+		sb.sctps_recvivalhmacid += sarry->sctps_recvivalhmacid;
+		sb.sctps_recvivalkeyid += sarry->sctps_recvivalkeyid;
+		sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed;
+		sb.sctps_recvexpress += sarry->sctps_recvexpress;
+		sb.sctps_recvexpressm += sarry->sctps_recvexpressm;
+		sb.sctps_recvnocrc += sarry->sctps_recvnocrc;
+		sb.sctps_recvswcrc += sarry->sctps_recvswcrc;
+		sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc;
+		sb.sctps_sendpackets += sarry->sctps_sendpackets;
+		sb.sctps_sendsacks += sarry->sctps_sendsacks;
+		sb.sctps_senddata += sarry->sctps_senddata;
+		sb.sctps_sendretransdata += sarry->sctps_sendretransdata;
+		sb.sctps_sendfastretrans += sarry->sctps_sendfastretrans;
+		sb.sctps_sendmultfastretrans += sarry->sctps_sendmultfastretrans;
+		sb.sctps_sendheartbeat += sarry->sctps_sendheartbeat;
+		sb.sctps_sendecne += sarry->sctps_sendecne;
+		sb.sctps_sendauth += sarry->sctps_sendauth;
+		sb.sctps_senderrors += sarry->sctps_senderrors;
+		sb.sctps_sendnocrc += sarry->sctps_sendnocrc;
+		sb.sctps_sendswcrc += sarry->sctps_sendswcrc;
+		sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc;
+		sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox;
+		sb.sctps_pdrpfehos += sarry->sctps_pdrpfehos;
+		sb.sctps_pdrpmbda += sarry->sctps_pdrpmbda;
+		sb.sctps_pdrpmbct += sarry->sctps_pdrpmbct;
+		sb.sctps_pdrpbwrpt += sarry->sctps_pdrpbwrpt;
+		sb.sctps_pdrpcrupt += sarry->sctps_pdrpcrupt;
+		sb.sctps_pdrpnedat += sarry->sctps_pdrpnedat;
+		sb.sctps_pdrppdbrk += sarry->sctps_pdrppdbrk;
+		sb.sctps_pdrptsnnf += sarry->sctps_pdrptsnnf;
+		sb.sctps_pdrpdnfnd += sarry->sctps_pdrpdnfnd;
+		sb.sctps_pdrpdiwnp += sarry->sctps_pdrpdiwnp;
+		sb.sctps_pdrpdizrw += sarry->sctps_pdrpdizrw;
+		sb.sctps_pdrpbadd += sarry->sctps_pdrpbadd;
+		sb.sctps_pdrpmark += sarry->sctps_pdrpmark;
+		sb.sctps_timoiterator += sarry->sctps_timoiterator;
+		sb.sctps_timodata += sarry->sctps_timodata;
+		sb.sctps_timowindowprobe += sarry->sctps_timowindowprobe;
+		sb.sctps_timoinit += sarry->sctps_timoinit;
+		sb.sctps_timosack += sarry->sctps_timosack;
+		sb.sctps_timoshutdown += sarry->sctps_timoshutdown;
+		sb.sctps_timoheartbeat += sarry->sctps_timoheartbeat;
+		sb.sctps_timocookie += sarry->sctps_timocookie;
+		sb.sctps_timosecret += sarry->sctps_timosecret;
+		sb.sctps_timopathmtu += sarry->sctps_timopathmtu;
+		sb.sctps_timoshutdownack += sarry->sctps_timoshutdownack;
+		sb.sctps_timoshutdownguard += sarry->sctps_timoshutdownguard;
+		sb.sctps_timostrmrst += sarry->sctps_timostrmrst;
+		sb.sctps_timoearlyfr += sarry->sctps_timoearlyfr;
+		sb.sctps_timoasconf += sarry->sctps_timoasconf;
+		sb.sctps_timodelprim += sarry->sctps_timodelprim;
+		sb.sctps_timoautoclose += sarry->sctps_timoautoclose;
+		sb.sctps_timoassockill += sarry->sctps_timoassockill;
+		sb.sctps_timoinpkill += sarry->sctps_timoinpkill;
+		sb.sctps_earlyfrstart += sarry->sctps_earlyfrstart;
+		sb.sctps_earlyfrstop += sarry->sctps_earlyfrstop;
+		sb.sctps_earlyfrmrkretrans += sarry->sctps_earlyfrmrkretrans;
+		sb.sctps_earlyfrstpout += sarry->sctps_earlyfrstpout;
+		sb.sctps_earlyfrstpidsck1 += sarry->sctps_earlyfrstpidsck1;
+		sb.sctps_earlyfrstpidsck2 += sarry->sctps_earlyfrstpidsck2;
+		sb.sctps_earlyfrstpidsck3 += sarry->sctps_earlyfrstpidsck3;
+		sb.sctps_earlyfrstpidsck4 += sarry->sctps_earlyfrstpidsck4;
+		sb.sctps_earlyfrstrid += sarry->sctps_earlyfrstrid;
+		sb.sctps_earlyfrstrout += sarry->sctps_earlyfrstrout;
+		sb.sctps_earlyfrstrtmr += sarry->sctps_earlyfrstrtmr;
+		sb.sctps_hdrops += sarry->sctps_hdrops;
+		sb.sctps_badsum += sarry->sctps_badsum;
+		sb.sctps_noport += sarry->sctps_noport;
+		sb.sctps_badvtag += sarry->sctps_badvtag;
+		sb.sctps_badsid += sarry->sctps_badsid;
+		sb.sctps_nomem += sarry->sctps_nomem;
+		sb.sctps_fastretransinrtt += sarry->sctps_fastretransinrtt;
+		sb.sctps_markedretrans += sarry->sctps_markedretrans;
+		sb.sctps_naglesent += sarry->sctps_naglesent;
+		sb.sctps_naglequeued += sarry->sctps_naglequeued;
+		sb.sctps_maxburstqueued += sarry->sctps_maxburstqueued;
+		sb.sctps_ifnomemqueued += sarry->sctps_ifnomemqueued;
+		sb.sctps_windowprobed += sarry->sctps_windowprobed;
+		sb.sctps_lowlevelerr += sarry->sctps_lowlevelerr;
+		sb.sctps_lowlevelerrusr += sarry->sctps_lowlevelerrusr;
+		sb.sctps_datadropchklmt += sarry->sctps_datadropchklmt;
+		sb.sctps_datadroprwnd += sarry->sctps_datadroprwnd;
+		sb.sctps_ecnereducedcwnd += sarry->sctps_ecnereducedcwnd;
+		sb.sctps_vtagexpress += sarry->sctps_vtagexpress;
+		sb.sctps_vtagbogus += sarry->sctps_vtagbogus;
+		sb.sctps_primary_randry += sarry->sctps_primary_randry;
+		sb.sctps_cmt_randry += sarry->sctps_cmt_randry;
+		sb.sctps_slowpath_sack += sarry->sctps_slowpath_sack;
+		sb.sctps_wu_sacks_sent += sarry->sctps_wu_sacks_sent;
+		sb.sctps_sends_with_flags += sarry->sctps_sends_with_flags;
+		sb.sctps_sends_with_unord += sarry->sctps_sends_with_unord;
+		sb.sctps_sends_with_eof += sarry->sctps_sends_with_eof;
+		sb.sctps_sends_with_abort += sarry->sctps_sends_with_abort;
+		sb.sctps_protocol_drain_calls += sarry->sctps_protocol_drain_calls;
+		sb.sctps_protocol_drains_done += sarry->sctps_protocol_drains_done;
+		sb.sctps_read_peeks += sarry->sctps_read_peeks;
+		sb.sctps_cached_chk += sarry->sctps_cached_chk;
+		sb.sctps_cached_strmoq += sarry->sctps_cached_strmoq;
+		sb.sctps_left_abandon += sarry->sctps_left_abandon;
+		sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid;
+		sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid;
+		sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over;
+	}
+	error = SYSCTL_OUT(req, &sb, sizeof(sb));
+	return (error);
+}
+
+#endif
 
 #if defined(SCTP_LOCAL_TRACE_BUF)
 static int
@@ -916,10 +1068,16 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ou
     &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU",
     SCTPCTL_OUTPUT_UNLOCKED_DESC);
 #endif
-
+#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats,
+    CTLTYPE_STRUCT | CTLFLAG_RD,
+    0, 0, sysctl_stat_get, "S,sctpstat",
+    "SCTP statistics (struct sctp_stat)");
+#else
 SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW,
     &SCTP_BASE_STATS_SYSCTL, sctpstat,
     "SCTP statistics (struct sctp_stat)");
+#endif
 
 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD,
     0, 0, sctp_assoclist,

Modified: head/sys/netinet/sctp_uio.h
==============================================================================
--- head/sys/netinet/sctp_uio.h	Wed Mar 24 20:01:14 2010	(r205628)
+++ head/sys/netinet/sctp_uio.h	Wed Mar 24 20:02:40 2010	(r205629)
@@ -957,9 +957,13 @@ struct sctpstat {
 
 #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1)
 #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1)
+#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
+#define SCTP_STAT_INCR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x += _d)
+#define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -= _d)
+#else
 #define SCTP_STAT_INCR_BY(_x,_d) atomic_add_int(&SCTP_BASE_STAT(_x), _d)
 #define SCTP_STAT_DECR_BY(_x,_d) atomic_subtract_int(&SCTP_BASE_STAT(_x), _d)
-
+#endif
 /* The following macros are for handling MIB values, */
 #define SCTP_STAT_INCR_COUNTER32(_x) SCTP_STAT_INCR(_x)
 #define SCTP_STAT_INCR_COUNTER64(_x) SCTP_STAT_INCR(_x)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 20:20:28 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3DCC106564A;
	Wed, 24 Mar 2010 20:20:28 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A441D8FC0C;
	Wed, 24 Mar 2010 20:20:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OKKS9E004077;
	Wed, 24 Mar 2010 20:20:28 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OKKSlj004075;
	Wed, 24 Mar 2010 20:20:28 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201003242020.o2OKKSlj004075@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 24 Mar 2010 20:20:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205630 - head/gnu/usr.bin/cpio
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 20:20:28 -0000

Author: imp
Date: Wed Mar 24 20:20:28 2010
New Revision: 205630
URL: http://svn.freebsd.org/changeset/base/205630

Log:
  This broke when we went to gnu99 as the default standard.  Fix the build
  by reverting to the gnu89 standard.

Modified:
  head/gnu/usr.bin/cpio/Makefile

Modified: head/gnu/usr.bin/cpio/Makefile
==============================================================================
--- head/gnu/usr.bin/cpio/Makefile	Wed Mar 24 20:02:40 2010	(r205629)
+++ head/gnu/usr.bin/cpio/Makefile	Wed Mar 24 20:20:28 2010	(r205630)
@@ -58,6 +58,7 @@ SRCS=   copyin.c \
 	xstrndup.c \
 	alloca.h \
 	getopt.h
+CSTD=gnu89
 
 CLEANFILES+= alloca.h getopt.h
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 21:13:05 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11495106566B;
	Wed, 24 Mar 2010 21:13:05 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id D7C4B8FC19;
	Wed, 24 Mar 2010 21:13:04 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 703B346B37;
	Wed, 24 Mar 2010 17:13:04 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id A266D8A021;
	Wed, 24 Mar 2010 17:13:03 -0400 (EDT)
From: John Baldwin 
To: "Bjoern A. Zeeb" 
Date: Wed, 24 Mar 2010 16:20:20 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003241921.o2OJLQTC090739@svn.freebsd.org>
In-Reply-To: <201003241921.o2OJLQTC090739@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201003241620.20516.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 24 Mar 2010 17:13:03 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205626 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 21:13:05 -0000

On Wednesday 24 March 2010 3:21:26 pm Bjoern A. Zeeb wrote:
> Author: bz
> Date: Wed Mar 24 19:21:26 2010
> New Revision: 205626
> URL: http://svn.freebsd.org/changeset/base/205626
> 
> Log:
>   Print the pointer to the lock with the panic message. The previous
>   	panic: rw lock not unlocked
>   was not really helpful for debugging. Now one can at least call
>   	show lock 
>   form ddb to learn more about the lock.

Hmm, for consistency you may wish to fix similar panic messages in 
sx_destroy() and mtx_destroy().  There are many, many other panic messages in 
mtx, sx, and rwlock that do not include the lock pointer (though many do 
include the file/line which is nearly as useful).

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Mar 24 23:06:18 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2891F106566C;
	Wed, 24 Mar 2010 23:06:18 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F2E7D8FC14;
	Wed, 24 Mar 2010 23:06:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2ON6HkG042174;
	Wed, 24 Mar 2010 23:06:17 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2ON6HWp042173;
	Wed, 24 Mar 2010 23:06:17 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201003242306.o2ON6HWp042173@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 24 Mar 2010 23:06:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205631 - head/sbin/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 24 Mar 2010 23:06:18 -0000

Author: luigi
Date: Wed Mar 24 23:06:16 2010
New Revision: 205631
URL: http://svn.freebsd.org/changeset/base/205631

Log:
  fix another bug in "ipfw set N ..."
  
  Submitted by:	Marcin Wisnicki

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Wed Mar 24 20:20:28 2010	(r205630)
+++ head/sbin/ipfw/ipfw2.c	Wed Mar 24 23:06:16 2010	(r205631)
@@ -2656,7 +2656,7 @@ ipfw_add(char *av[])
 	}
 
 	/* [set N]	-- set number (0..RESVD_SET), optional */
-	if (av[0] && !av[1] && _substrcmp(*av, "set") == 0) {
+	if (av[0] && av[1] && _substrcmp(*av, "set") == 0) {
 		int set = strtoul(av[1], NULL, 10);
 		if (set < 0 || set > RESVD_SET)
 			errx(EX_DATAERR, "illegal set %s", av[1]);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 10:13:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D209C106564A;
	Thu, 25 Mar 2010 10:13:21 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C148E8FC2A;
	Thu, 25 Mar 2010 10:13:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PADLMl016782;
	Thu, 25 Mar 2010 10:13:21 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PADLUf016780;
	Thu, 25 Mar 2010 10:13:21 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201003251013.o2PADLUf016780@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Thu, 25 Mar 2010 10:13:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205636 - head/sys/netgraph/netflow
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 10:13:21 -0000

Author: glebius
Date: Thu Mar 25 10:13:21 2010
New Revision: 205636
URL: http://svn.freebsd.org/changeset/base/205636

Log:
  Remove disabled code. In 99% cases exports are send to ng_ksocket(4), which
  already forces queued mode, so what was suggested in disabled code is already
  done.

Modified:
  head/sys/netgraph/netflow/ng_netflow.c

Modified: head/sys/netgraph/netflow/ng_netflow.c
==============================================================================
--- head/sys/netgraph/netflow/ng_netflow.c	Thu Mar 25 08:33:56 2010	(r205635)
+++ head/sys/netgraph/netflow/ng_netflow.c	Thu Mar 25 10:13:21 2010	(r205636)
@@ -286,15 +286,6 @@ ng_netflow_newhook(node_p node, hook_p h
 
 		priv->export = hook;
 
-#if 0	/* TODO: profile & test first */
-		/*
-		 * We send export dgrams in interrupt handlers and in
-		 * callout threads. We'd better queue data for later
-		 * netgraph ISR processing.
-		 */
-		NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
-#endif
-
 		/* Exporter is ready. Let's schedule expiry. */
 		callout_reset(&priv->exp_callout, (1*hz), &ng_netflow_expire,
 		    (void *)priv);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 10:29:00 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67D171065673;
	Thu, 25 Mar 2010 10:29:00 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 574318FC14;
	Thu, 25 Mar 2010 10:29:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PAT0Ch031468;
	Thu, 25 Mar 2010 10:29:00 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PAT0AW031465;
	Thu, 25 Mar 2010 10:29:00 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201003251029.o2PAT0AW031465@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 25 Mar 2010 10:29:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205637 - head/sys/netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 10:29:00 -0000

Author: bz
Date: Thu Mar 25 10:29:00 2010
New Revision: 205637
URL: http://svn.freebsd.org/changeset/base/205637

Log:
  We are holding a write lock here so avoid aquiring it twice calling
  the "locked" version rather than the wrapper function.
  
  MFC after:	6 days

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Thu Mar 25 10:13:21 2010	(r205636)
+++ head/sys/netinet6/nd6.c	Thu Mar 25 10:29:00 2010	(r205637)
@@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct 
 
  	ln->ln_state = ND6_LLINFO_REACHABLE;
 	if (!ND6_LLINFO_PERMANENT(ln)) {
-		nd6_llinfo_settimer(ln,
+		nd6_llinfo_settimer_locked(ln,
 		    (long)ND_IFINFO(rt->rt_ifp)->reachable * hz);
 	}
 done:

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 13:47:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97E1E1065670;
	Thu, 25 Mar 2010 13:47:21 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7EC178FC29;
	Thu, 25 Mar 2010 13:47:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PDlLij021452;
	Thu, 25 Mar 2010 13:47:21 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PDlLNZ021449;
	Thu, 25 Mar 2010 13:47:21 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003251347.o2PDlLNZ021449@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 25 Mar 2010 13:47:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205640 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 13:47:21 -0000

Author: netchild
Date: Thu Mar 25 13:47:21 2010
New Revision: 205640
URL: http://svn.freebsd.org/changeset/base/205640

Log:
  Propagate CONF_CFLAGS (from makeoptions) to the module build too.
  
  Discussed with:	jhb (on arch@)

Modified:
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk	Thu Mar 25 13:15:55 2010	(r205639)
+++ head/sys/conf/kern.post.mk	Thu Mar 25 13:47:21 2010	(r205640)
@@ -15,6 +15,10 @@ MKMODULESENV+=	DESTDIR="${DESTDIR}"
 SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
 MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
+.if defined(CONF_CFLAGS)
+MKMODULESENV+=	CONF_CFLAGS="${CONF_CFLAGS}"
+.endif
+
 .MAIN: all
 
 .for target in all clean cleandepend cleandir clobber depend install \

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Thu Mar 25 13:15:55 2010	(r205639)
+++ head/sys/conf/kmod.mk	Thu Mar 25 13:47:21 2010	(r205640)
@@ -325,6 +325,9 @@ ${_src}:
 .endfor
 .endif
 
+# Repsect configuration-specific C flags.
+CFLAGS+=	${CONF_CFLAGS}
+
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
 	dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
 	dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 14:21:22 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACB421065680;
	Thu, 25 Mar 2010 14:21:22 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 817768FC18;
	Thu, 25 Mar 2010 14:21:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PELMTp046989;
	Thu, 25 Mar 2010 14:21:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PELMra046987;
	Thu, 25 Mar 2010 14:21:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003251421.o2PELMra046987@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 25 Mar 2010 14:21:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205641 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 14:21:22 -0000

Author: nwhitehorn
Date: Thu Mar 25 14:21:22 2010
New Revision: 205641
URL: http://svn.freebsd.org/changeset/base/205641

Log:
  Change the way text_addr and data_addr are computed to use the
  executable status of segments instead of detecting the main text segment
  by which segment contains the program entry point. This affects
  obreak() and is required for correct operation of that function
  on 64-bit PowerPC systems. The previous behavior was apparently
  required only for the Alpha, which is no longer supported.
  
  Reviewed by:	jhb
  Tested on:	amd64, sparc64, powerpc

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Thu Mar 25 13:47:21 2010	(r205640)
+++ head/sys/kern/imgact_elf.c	Thu Mar 25 14:21:22 2010	(r205641)
@@ -832,13 +832,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 			    phdr[i].p_vaddr + et_dyn_addr - seg_addr);
 
 			/*
-			 * Is this .text or .data?  We can't use
-			 * VM_PROT_WRITE or VM_PROT_EXEC, it breaks the
-			 * alpha terribly and possibly does other bad
-			 * things so we stick to the old way of figuring
-			 * it out:  If the segment contains the program
-			 * entry point, it's a text segment, otherwise it
-			 * is a data segment.
+			 * Make the largest executable segment the official
+			 * text segment and all others data.
 			 *
 			 * Note that obreak() assumes that data_addr + 
 			 * data_size == end of data load area, and the ELF
@@ -846,12 +841,10 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 			 * address.  If multiple data segments exist, the
 			 * last one will be used.
 			 */
-			if (hdr->e_entry >= phdr[i].p_vaddr &&
-			    hdr->e_entry < (phdr[i].p_vaddr +
-			    phdr[i].p_memsz)) {
+
+			if (phdr[i].p_flags & PF_X && text_size < seg_size) {
 				text_size = seg_size;
 				text_addr = seg_addr;
-				entry = (u_long)hdr->e_entry + et_dyn_addr;
 			} else {
 				data_size = seg_size;
 				data_addr = seg_addr;
@@ -871,6 +864,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 		data_size = text_size;
 	}
 
+	entry = (u_long)hdr->e_entry + et_dyn_addr;
+
 	/*
 	 * Check limits.  It should be safe to check the
 	 * limits after loading the segments since we do

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 14:24:01 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 013DA106566C;
	Thu, 25 Mar 2010 14:24:01 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E04688FC0A;
	Thu, 25 Mar 2010 14:24:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PEO0A6047622;
	Thu, 25 Mar 2010 14:24:00 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PEO0wf047603;
	Thu, 25 Mar 2010 14:24:00 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003251424.o2PEO0wf047603@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 25 Mar 2010 14:24:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205642 - in head/sys: amd64/amd64 amd64/ia32
	amd64/linux32 arm/arm compat/ia32 i386/i386 i386/linux
	ia64/ia32 ia64/ia64 kern mips/mips pc98/pc98 powerpc/aim
	powerpc/booke sparc64/sparc...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 14:24:01 -0000

Author: nwhitehorn
Date: Thu Mar 25 14:24:00 2010
New Revision: 205642
URL: http://svn.freebsd.org/changeset/base/205642

Log:
  Change the arguments of exec_setregs() so that it receives a pointer
  to the image_params struct instead of several members of that struct
  individually. This makes it easier to expand its arguments in the future
  without touching all platforms.
  
  Reviewed by:	jhb

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/machdep.c
  head/sys/compat/ia32/ia32_signal.h
  head/sys/i386/i386/machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/ia64/ia32/ia32_signal.c
  head/sys/ia64/ia64/machdep.c
  head/sys/kern/kern_exec.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/booke/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sun4v/sun4v/machdep.c
  head/sys/sys/imgact.h
  head/sys/sys/sysent.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/amd64/amd64/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -841,11 +841,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -863,7 +859,7 @@ exec_setregs(td, entry, stack, ps_string
 	pcb->pcb_full_iret = 1;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = ((stack - 8) & ~0xFul) + 8;
 	regs->tf_rdi = stack;		/* argv */
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);

Modified: head/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- head/sys/amd64/ia32/ia32_signal.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/amd64/ia32/ia32_signal.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -701,11 +701,7 @@ freebsd32_sigreturn(td, uap)
  * Clear registers on exec
  */
 void
-ia32_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -721,12 +717,12 @@ ia32_setregs(td, entry, stack, ps_string
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_ss = _udatasel;
 	regs->tf_cs = _ucode32sel;
-	regs->tf_rbx = ps_strings;
+	regs->tf_rbx = imgp->ps_strings;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
 	regs->tf_fs = _ufssel;

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -124,8 +124,8 @@ static register_t *linux_copyout_strings
 static void	linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
 		    caddr_t *params);
 static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static void	exec_linux_setregs(struct thread *td, u_long entry,
-				   u_long stack, u_long ps_strings);
+static void	exec_linux_setregs(struct thread *td, 
+				   struct image_params *imgp, u_long stack);
 static void	linux32_fixlimit(struct rlimit *rl, int which);
 static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -828,11 +828,7 @@ exec_linux_imgact_try(struct image_param
  * XXX copied from ia32_signal.c.
  */
 static void
-exec_linux_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -852,7 +848,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_gs = _ugssel;
@@ -862,7 +858,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	regs->tf_ss = _udatasel;
 	regs->tf_flags = TF_HASSEGS;
 	regs->tf_cs = _ucode32sel;
-	regs->tf_rbx = ps_strings;
+	regs->tf_rbx = imgp->ps_strings;
 	td->td_pcb->pcb_full_iret = 1;
 	load_cr0(rcr0() | CR0_MP | CR0_TS);
 	fpstate_drop(td);

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/arm/arm/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -516,15 +516,15 @@ spinlock_exit(void)
  * Clear registers on exec
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf = td->td_frame;
 
 	memset(tf, 0, sizeof(*tf));
 	tf->tf_usr_sp = stack;
-	tf->tf_usr_lr = entry;
+	tf->tf_usr_lr = imgp->entry_addr;
 	tf->tf_svc_lr = 0x77777777;
-	tf->tf_pc = entry;
+	tf->tf_pc = imgp->entry_addr;
 	tf->tf_spsr = PSR_USR32_MODE;
 }
 

Modified: head/sys/compat/ia32/ia32_signal.h
==============================================================================
--- head/sys/compat/ia32/ia32_signal.h	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/compat/ia32/ia32_signal.h	Thu Mar 25 14:24:00 2010	(r205642)
@@ -185,5 +185,5 @@ extern char freebsd4_ia32_sigcode[];
 extern int sz_ia32_sigcode;
 extern int sz_freebsd4_ia32_sigcode;
 extern void ia32_sendsig(sig_t, struct ksiginfo *, sigset_t *);
-extern void ia32_setregs(struct thread *td, u_long entry, u_long stack,
-    u_long ps_strings);
+extern void ia32_setregs(struct thread *td, struct image_params *imgp,
+    u_long stack);

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/i386/i386/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -1461,11 +1461,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -1481,7 +1477,7 @@ exec_setregs(td, entry, stack, ps_string
 		mtx_unlock_spin(&dt_lock);
   
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_eip = entry;
+	regs->tf_eip = imgp->entry_addr;
 	regs->tf_esp = stack;
 	regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T);
 	regs->tf_ss = _udatasel;
@@ -1491,7 +1487,7 @@ exec_setregs(td, entry, stack, ps_string
 	regs->tf_cs = _ucodesel;
 
 	/* PS_STRINGS value for BSD/OS binaries.  It is 0 for non-BSD/OS. */
-	regs->tf_ebx = ps_strings;
+	regs->tf_ebx = imgp->ps_strings;
 
         /*
          * Reset the hardware debug registers if they were in use.

Modified: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/i386/linux/linux_sysvec.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -105,8 +105,8 @@ static int	elf_linux_fixup(register_t **
 static void	linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
 		    caddr_t *params);
 static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static void	exec_linux_setregs(struct thread *td, u_long entry,
-				   u_long stack, u_long ps_strings);
+static void	exec_linux_setregs(struct thread *td,
+		    struct image_params *imgp, u_long stack);
 static register_t *linux_copyout_strings(struct image_params *imgp);
 static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -927,12 +927,11 @@ exec_linux_imgact_try(struct image_param
  * override the exec_setregs default(s) here.
  */
 static void
-exec_linux_setregs(struct thread *td, u_long entry,
-		   u_long stack, u_long ps_strings)
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct pcb *pcb = td->td_pcb;
 
-	exec_setregs(td, entry, stack, ps_strings);
+	exec_setregs(td, imgp, stack);
 
 	/* Linux sets %gs to 0, we default to _udatasel */
 	pcb->pcb_gs = 0;

Modified: head/sys/ia64/ia32/ia32_signal.c
==============================================================================
--- head/sys/ia64/ia32/ia32_signal.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/ia64/ia32/ia32_signal.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -120,7 +120,7 @@ freebsd32_sigreturn(struct thread *td, s
 
 
 void
-ia32_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf = td->td_frame;
 	vm_offset_t gdt, ldt;
@@ -129,7 +129,7 @@ ia32_setregs(struct thread *td, u_long e
 	struct segment_descriptor desc;
 	struct vmspace *vmspace = td->td_proc->p_vmspace;
 
-	exec_setregs(td, entry, stack, ps_strings);
+	exec_setregs(td, imgp, stack);
 
 	/* Non-syscall frames are cleared by exec_setregs() */
 	if (tf->tf_flags & FRAME_SYSCALL) {

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/ia64/ia64/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -1328,7 +1328,7 @@ set_mcontext(struct thread *td, const mc
  * Clear registers on exec.
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	uint64_t *ksttop, *kst;
@@ -1366,7 +1366,7 @@ exec_setregs(struct thread *td, u_long e
 		*kst-- = 0;
 		if (((uintptr_t)kst & 0x1ff) == 0x1f8)
 			*kst-- = 0;
-		*kst-- = ps_strings;
+		*kst-- = imgp->ps_strings;
 		if (((uintptr_t)kst & 0x1ff) == 0x1f8)
 			*kst-- = 0;
 		*kst = stack;
@@ -1385,7 +1385,7 @@ exec_setregs(struct thread *td, u_long e
 		suword((caddr_t)tf->tf_special.bspstore -  8, 0);
 	}
 
-	tf->tf_special.iip = entry;
+	tf->tf_special.iip = imgp->entry_addr;
 	tf->tf_special.sp = (stack & ~15) - 16;
 	tf->tf_special.rsc = 0xf;
 	tf->tf_special.fpsr = IA64_FPSR_DEFAULT;

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/kern/kern_exec.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -799,11 +799,10 @@ interpret:
 
 	/* Set values passed into the program in registers. */
 	if (p->p_sysent->sv_setregs)
-		(*p->p_sysent->sv_setregs)(td, imgp->entry_addr,
-		    (u_long)(uintptr_t)stack_base, imgp->ps_strings);
+		(*p->p_sysent->sv_setregs)(td, imgp, 
+		    (u_long)(uintptr_t)stack_base);
 	else
-		exec_setregs(td, imgp->entry_addr,
-		    (u_long)(uintptr_t)stack_base, imgp->ps_strings);
+		exec_setregs(td, imgp, (u_long)(uintptr_t)stack_base);
 
 	vfs_mark_atime(imgp->vp, td->td_ucred);
 

Modified: head/sys/mips/mips/pm_machdep.c
==============================================================================
--- head/sys/mips/mips/pm_machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/mips/mips/pm_machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -472,7 +472,7 @@ set_fpregs(struct thread *td, struct fpr
  * code by the MIPS elf abi).
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 
 	bzero((caddr_t)td->td_frame, sizeof(struct trapframe));
@@ -481,8 +481,8 @@ exec_setregs(struct thread *td, u_long e
 	 * Make sp 64-bit aligned.
 	 */
 	td->td_frame->sp = ((register_t) stack) & ~(sizeof(__int64_t) - 1);
-	td->td_frame->pc = entry & ~3;
-	td->td_frame->t9 = entry & ~3; /* abicall req */
+	td->td_frame->pc = imgp->entry_addr & ~3;
+	td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */
 #if 0
 //	td->td_frame->sr = SR_KSU_USER | SR_EXL | SR_INT_ENAB;
 //?	td->td_frame->sr |=  idle_mask & ALL_INT_MASK;
@@ -511,7 +511,7 @@ exec_setregs(struct thread *td, u_long e
 	td->td_frame->a0 = (register_t) stack;
 	td->td_frame->a1 = 0;
 	td->td_frame->a2 = 0;
-	td->td_frame->a3 = (register_t)ps_strings;
+	td->td_frame->a3 = (register_t)imgp->ps_strings;
 
 	td->td_md.md_flags &= ~MDTD_FPUSED;
 	if (PCPU_GET(fpcurthread) == td)

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/pc98/pc98/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -1172,11 +1172,7 @@ void (*cpu_idle_hook)(void) = cpu_idle_d
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -1192,7 +1188,7 @@ exec_setregs(td, entry, stack, ps_string
 		mtx_unlock_spin(&dt_lock);
   
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_eip = entry;
+	regs->tf_eip = imgp->entry_addr;
 	regs->tf_esp = stack;
 	regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T);
 	regs->tf_ss = _udatasel;
@@ -1202,7 +1198,7 @@ exec_setregs(td, entry, stack, ps_string
 	regs->tf_cs = _ucodesel;
 
 	/* PS_STRINGS value for BSD/OS binaries.  It is 0 for non-BSD/OS. */
-	regs->tf_ebx = ps_strings;
+	regs->tf_ebx = imgp->ps_strings;
 
         /*
          * Reset the hardware debug registers if they were in use.

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/powerpc/aim/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -951,7 +951,7 @@ cpu_idle_wakeup(int cpu)
  * Set set up registers on exec.
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe	*tf;
 	struct ps_strings	arginfo;
@@ -995,7 +995,7 @@ exec_setregs(struct thread *td, u_long e
 	tf->fixreg[7] = 0;			/* termination vector */
 	tf->fixreg[8] = (register_t)PS_STRINGS;	/* NetBSD extension */
 
-	tf->srr0 = entry;
+	tf->srr0 = imgp->entry_addr;
 	tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
 	td->td_pcb->pcb_flags = 0;
 }

Modified: head/sys/powerpc/booke/machdep.c
==============================================================================
--- head/sys/powerpc/booke/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/powerpc/booke/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -509,7 +509,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu
 
 /* Set set up registers on exec. */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	struct ps_strings arginfo;
@@ -553,7 +553,7 @@ exec_setregs(struct thread *td, u_long e
 	tf->fixreg[7] = 0;			/* termination vector */
 	tf->fixreg[8] = (register_t)PS_STRINGS;	/* NetBSD extension */
 
-	tf->srr0 = entry;
+	tf->srr0 = imgp->entry_addr;
 	tf->srr1 = PSL_USERSET;
 	td->td_pcb->pcb_flags = 0;
 }

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/sparc64/sparc64/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -969,7 +969,7 @@ ptrace_clear_single_step(struct thread *
 }
 
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	struct pcb *pcb;
@@ -992,8 +992,8 @@ exec_setregs(struct thread *td, u_long e
 	tf->tf_out[0] = stack;
 	tf->tf_out[3] = p->p_sysent->sv_psstrings;
 	tf->tf_out[6] = sp - SPOFF - sizeof(struct frame);
-	tf->tf_tnpc = entry + 4;
-	tf->tf_tpc = entry;
+	tf->tf_tnpc = imgp->entry_addr + 4;
+	tf->tf_tpc = imgp->entry_addr;
 	tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO;
 
 	td->td_retval[0] = tf->tf_out[0];

Modified: head/sys/sun4v/sun4v/machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/machdep.c	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/sun4v/sun4v/machdep.c	Thu Mar 25 14:24:00 2010	(r205642)
@@ -869,7 +869,7 @@ ptrace_clear_single_step(struct thread *
 }
 
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	struct pcb *pcb;
@@ -897,8 +897,8 @@ exec_setregs(struct thread *td, u_long e
 	tf->tf_out[3] = p->p_sysent->sv_psstrings;
 	tf->tf_out[6] = sp - SPOFF - sizeof(struct frame);
 
-	tf->tf_tnpc = entry + 4;
-	tf->tf_tpc = entry;
+	tf->tf_tnpc = imgp->entry_addr + 4;
+	tf->tf_tpc = imgp->entry_addr;
 	tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO;
 
 	td->td_retval[0] = tf->tf_out[0];

Modified: head/sys/sys/imgact.h
==============================================================================
--- head/sys/sys/imgact.h	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/sys/imgact.h	Thu Mar 25 14:24:00 2010	(r205642)
@@ -80,7 +80,7 @@ struct thread;
 int	exec_check_permissions(struct image_params *);
 register_t *exec_copyout_strings(struct image_params *);
 int	exec_new_vmspace(struct image_params *, struct sysentvec *);
-void	exec_setregs(struct thread *, u_long, u_long, u_long);
+void	exec_setregs(struct thread *, struct image_params *, u_long);
 int	exec_shell_imgact(struct image_params *);
 int	exec_copyin_args(struct image_args *, char *, enum uio_seg,
 	char **, char **);

Modified: head/sys/sys/sysent.h
==============================================================================
--- head/sys/sys/sysent.h	Thu Mar 25 14:21:22 2010	(r205641)
+++ head/sys/sys/sysent.h	Thu Mar 25 14:24:00 2010	(r205642)
@@ -98,7 +98,8 @@ struct sysentvec {
 	vm_offset_t	sv_psstrings;	/* PS_STRINGS */
 	int		sv_stackprot;	/* vm protection for stack */
 	register_t	*(*sv_copyout_strings)(struct image_params *);
-	void		(*sv_setregs)(struct thread *, u_long, u_long, u_long);
+	void		(*sv_setregs)(struct thread *, struct image_params *,
+			    u_long);
 	void		(*sv_fixlimit)(struct rlimit *, int);
 	u_long		*sv_maxssiz;
 	u_int		sv_flags;

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 14:31:27 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11DB51065670;
	Thu, 25 Mar 2010 14:31:27 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 00D0D8FC2A;
	Thu, 25 Mar 2010 14:31:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PEVQq8049311;
	Thu, 25 Mar 2010 14:31:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PEVQs2049307;
	Thu, 25 Mar 2010 14:31:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003251431.o2PEVQs2049307@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 25 Mar 2010 14:31:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205643 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 14:31:27 -0000

Author: nwhitehorn
Date: Thu Mar 25 14:31:26 2010
New Revision: 205643
URL: http://svn.freebsd.org/changeset/base/205643

Log:
  Add the ELF relocation base to struct image_params. This will be
  required to correctly relocate the executable entry point's function
  descriptor on powerpc64.

Modified:
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/sys/imgact.h

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Thu Mar 25 14:24:00 2010	(r205642)
+++ head/sys/kern/imgact_elf.c	Thu Mar 25 14:31:26 2010	(r205643)
@@ -943,6 +943,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 
 	imgp->auxargs = elf_auxargs;
 	imgp->interpreted = 0;
+	imgp->reloc_base = addr;
 	imgp->proc->p_osrel = osrel;
 
 	return (error);

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Thu Mar 25 14:24:00 2010	(r205642)
+++ head/sys/kern/kern_exec.c	Thu Mar 25 14:31:26 2010	(r205643)
@@ -372,6 +372,7 @@ do_execve(td, args, mac_p)
 	imgp->execlabel = NULL;
 	imgp->attr = &attr;
 	imgp->entry_addr = 0;
+	imgp->reloc_base = 0;
 	imgp->vmspace_destroyed = 0;
 	imgp->interpreted = 0;
 	imgp->opened = 0;

Modified: head/sys/sys/imgact.h
==============================================================================
--- head/sys/sys/imgact.h	Thu Mar 25 14:24:00 2010	(r205642)
+++ head/sys/sys/imgact.h	Thu Mar 25 14:31:26 2010	(r205643)
@@ -56,6 +56,7 @@ struct image_params {
 	struct vattr *attr;	/* attributes of file */
 	const char *image_header; /* head of file to exec */
 	unsigned long entry_addr; /* entry address of target executable */
+	unsigned long reloc_base; /* load address of image */
 	char vmspace_destroyed;	/* flag - we've blown away original vm space */
 	char interpreted;	/* flag - this executable is interpreted */
 	char opened;		/* flag - we have opened executable vnode */

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 15:56:04 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA820106567E;
	Thu, 25 Mar 2010 15:56:04 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA7628FC1E;
	Thu, 25 Mar 2010 15:56:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PFu4Cx068038;
	Thu, 25 Mar 2010 15:56:04 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PFu4rp068036;
	Thu, 25 Mar 2010 15:56:04 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003251556.o2PFu4rp068036@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 25 Mar 2010 15:56:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205647 - head/sys/compat/x86bios
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 15:56:04 -0000

Author: jkim
Date: Thu Mar 25 15:56:04 2010
New Revision: 205647
URL: http://svn.freebsd.org/changeset/base/205647

Log:
  Fix stupid typos.  Some VESA BIOSes directly call BIOS interrupt handlers
  within the VBE interrupt handler.  Unfortunately it was causing real mode
  page faults because we were fetching instructions from bogus addresses.
  Pass me the pointyhat, please.
  
  PR:		kern/144654
  MFC after:	3 days

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==============================================================================
--- head/sys/compat/x86bios/x86bios.c	Thu Mar 25 15:53:02 2010	(r205646)
+++ head/sys/compat/x86bios/x86bios.c	Thu Mar 25 15:56:04 2010	(r205647)
@@ -307,8 +307,8 @@ x86bios_emu_get_intr(struct x86emu *emu,
 	sp[2] = htole16(emu->x86.R_FLG);
 
 	iv = x86bios_get_intr(intno);
-	emu->x86.R_IP = iv & 0x000f;
-	emu->x86.R_CS = (iv >> 12) & 0xffff;
+	emu->x86.R_IP = iv & 0xffff;
+	emu->x86.R_CS = (iv >> 16) & 0xffff;
 	emu->x86.R_FLG &= ~(F_IF | F_TF);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:03:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF6F41065675;
	Thu, 25 Mar 2010 17:03:52 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DFDB58FC1F;
	Thu, 25 Mar 2010 17:03:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PH3qdi083076;
	Thu, 25 Mar 2010 17:03:52 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PH3q2Q083074;
	Thu, 25 Mar 2010 17:03:52 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003251703.o2PH3q2Q083074@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 25 Mar 2010 17:03:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205649 - head/sys/compat/x86bios
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:03:53 -0000

Author: jkim
Date: Thu Mar 25 17:03:52 2010
New Revision: 205649
URL: http://svn.freebsd.org/changeset/base/205649

Log:
  Optimize real mode page table lookup.

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==============================================================================
--- head/sys/compat/x86bios/x86bios.c	Thu Mar 25 16:31:05 2010	(r205648)
+++ head/sys/compat/x86bios/x86bios.c	Thu Mar 25 17:03:52 2010	(r205649)
@@ -112,17 +112,16 @@ x86bios_set_fault(struct x86emu *emu, ui
 static void *
 x86bios_get_pages(uint32_t offset, size_t size)
 {
-	int i;
+	vm_offset_t page;
 
 	if (offset + size > X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE)
 		return (NULL);
 
 	if (offset >= X86BIOS_MEM_SIZE)
 		offset -= X86BIOS_MEM_SIZE;
-	i = offset / X86BIOS_PAGE_SIZE;
-	if (x86bios_map[i] != 0)
-		return ((void *)(x86bios_map[i] + offset -
-		    i * X86BIOS_PAGE_SIZE));
+	page = x86bios_map[offset / X86BIOS_PAGE_SIZE];
+	if (page != 0)
+		return ((void *)(page + offset % X86BIOS_PAGE_SIZE));
 
 	return (NULL);
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:06:39 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 05FA2106566B;
	Thu, 25 Mar 2010 17:06:39 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com
	[209.85.218.216])
	by mx1.freebsd.org (Postfix) with ESMTP id 005308FC1B;
	Thu, 25 Mar 2010 17:06:37 +0000 (UTC)
Received: by bwz8 with SMTP id 8so2265801bwz.3
	for ; Thu, 25 Mar 2010 10:06:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=/UnJ+z/goiZvbBkr+D9d1NK6k1W3LaKt0W7NiRlUlmY=;
	b=Ao+HiogI7PMWZkx2X92pijdNyv7W15XZ1lzVJXdAEqq9sXyCfj/otywW2ljoEvxvDi
	2mlcfw5tMKDFRXvQT01IRYflrs4DKAGeAYjyijbhe2huLDYRxqZabcDcgP7/KBjeEI7V
	efziShWu288bHSgJ0JNziM/Rw73ZXYJFmwtN4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=xn9bBAmPgwR7TieaCmIVyEuUlvtBguBpDBq9c9UZ6CA5KFKuxj4ZlPKvUVlkGVG1PK
	HGzbSS5yFHEuryBZWqRfh58oZJguPCWUMPhmpmWQ5aGCTNhKcRO3+X0DyvKQlXYRvtvX
	oGVrNJiH9vgTxIu90Zt0lGyRHBy89QEscvvss=
Received: by 10.204.134.70 with SMTP id i6mr1185722bkt.74.1269536796484;
	Thu, 25 Mar 2010 10:06:36 -0700 (PDT)
Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by mx.google.com with ESMTPS id a11sm11500351bkc.21.2010.03.25.10.06.35
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Thu, 25 Mar 2010 10:06:35 -0700 (PDT)
Sender: Rui Paulo 
Mime-Version: 1.0 (Apple Message framework v1077)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <201003251029.o2PAT0AW031465@svn.freebsd.org>
Date: Thu, 25 Mar 2010 17:06:33 +0000
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201003251029.o2PAT0AW031465@svn.freebsd.org>
To: Bjoern A. Zeeb 
X-Mailer: Apple Mail (2.1077)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205637 - head/sys/netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:06:39 -0000


On 25 Mar 2010, at 10:29, Bjoern A. Zeeb wrote:

> Author: bz
> Date: Thu Mar 25 10:29:00 2010
> New Revision: 205637
> URL: http://svn.freebsd.org/changeset/base/205637
>=20
> Log:
>  We are holding a write lock here so avoid aquiring it twice calling
>  the "locked" version rather than the wrapper function.
>=20
>  MFC after:	6 days
>=20
> Modified:
>  head/sys/netinet6/nd6.c
>=20
> Modified: head/sys/netinet6/nd6.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/netinet6/nd6.c	Thu Mar 25 10:13:21 2010	=
(r205636)
> +++ head/sys/netinet6/nd6.c	Thu Mar 25 10:29:00 2010	=
(r205637)
> @@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct=20


This code is probably missing a:
                LLE_WLOCK_ASSERT(lle);
at the beginning.

>=20
>  	ln->ln_state =3D ND6_LLINFO_REACHABLE;
> 	if (!ND6_LLINFO_PERMANENT(ln)) {
> -		nd6_llinfo_settimer(ln,
> +		nd6_llinfo_settimer_locked(ln,
> 		    (long)ND_IFINFO(rt->rt_ifp)->reachable * hz);
> 	}
> done:

--
Rui Paulo


From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:14:48 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26782106564A;
	Thu, 25 Mar 2010 17:14:48 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 170C78FC18;
	Thu, 25 Mar 2010 17:14:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PHElIm085550;
	Thu, 25 Mar 2010 17:14:47 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PHElte085548;
	Thu, 25 Mar 2010 17:14:47 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003251714.o2PHElte085548@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 25 Mar 2010 17:14:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205650 - head/sys/compat/x86bios
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:14:48 -0000

Author: jkim
Date: Thu Mar 25 17:14:47 2010
New Revision: 205650
URL: http://svn.freebsd.org/changeset/base/205650

Log:
  Revert accidentally committed initial real mode %sp change of r205347.
  Note I am keeping %ds change because X.org int10 handler does it and
  it seems reasonable.

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==============================================================================
--- head/sys/compat/x86bios/x86bios.c	Thu Mar 25 17:03:52 2010	(r205649)
+++ head/sys/compat/x86bios/x86bios.c	Thu Mar 25 17:14:47 2010	(r205650)
@@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$");
 
 #define	X86BIOS_R_DS		_pad1
 #define	X86BIOS_R_SS		_pad2
-#define	X86BIOS_R_SP		_pad3.I16_reg.x_reg
 
 static struct x86emu x86bios_emu;
 
@@ -354,7 +353,6 @@ x86bios_init_regs(struct x86regs *regs)
 	bzero(regs, sizeof(*regs));
 	regs->X86BIOS_R_DS = 0x40;
 	regs->X86BIOS_R_SS = x86bios_seg_phys >> 4;
-	regs->X86BIOS_R_SP = 0xfffe;
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:17:35 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FC6D106566C;
	Thu, 25 Mar 2010 17:17:35 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8037A8FC25;
	Thu, 25 Mar 2010 17:17:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PHHZWB086224;
	Thu, 25 Mar 2010 17:17:35 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PHHZWr086222;
	Thu, 25 Mar 2010 17:17:35 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201003251717.o2PHHZWr086222@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 25 Mar 2010 17:17:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205651 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:17:35 -0000

Author: yongari
Date: Thu Mar 25 17:17:35 2010
New Revision: 205651
URL: http://svn.freebsd.org/changeset/base/205651

Log:
  Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Thu Mar 25 17:14:47 2010	(r205650)
+++ head/sys/dev/bge/if_bge.c	Thu Mar 25 17:17:35 2010	(r205651)
@@ -421,7 +421,6 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
-static void bge_set_max_readrq(struct bge_softc *);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -561,32 +560,6 @@ bge_writemem_ind(struct bge_softc *sc, i
 	pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
-/*
- * PCI Express only
- */
-static void
-bge_set_max_readrq(struct bge_softc *sc)
-{
-	device_t dev;
-	uint16_t val;
-
-	dev = sc->bge_dev;
-
-	val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2);
-	if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) !=
-	    BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
-		if (bootverbose)
-			device_printf(dev, "adjust device control 0x%04x ",
-			    val);
-		val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST;
-		val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
-		pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL,
-		    val, 2);
-		if (bootverbose)
-			printf("-> 0x%04x\n", val);
-	}
-}
-
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -2695,7 +2668,8 @@ bge_attach(device_t dev)
 		 */
 		sc->bge_flags |= BGE_FLAG_PCIE;
 		sc->bge_expcap = reg;
-		bge_set_max_readrq(sc);
+		if (pci_get_max_read_req(dev) != 4096)
+			pci_set_max_read_req(dev, 4096);
 	} else {
 		/*
 		 * Check if the device is in PCI-X Mode.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:24:04 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E35B1065672;
	Thu, 25 Mar 2010 17:24:04 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F1298FC15;
	Thu, 25 Mar 2010 17:24:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PHO3q7087683;
	Thu, 25 Mar 2010 17:24:03 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PHO3KC087681;
	Thu, 25 Mar 2010 17:24:03 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201003251724.o2PHO3KC087681@svn.freebsd.org>
From: Alan Cox 
Date: Thu, 25 Mar 2010 17:24:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205652 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:24:04 -0000

Author: alc
Date: Thu Mar 25 17:24:03 2010
New Revision: 205652
URL: http://svn.freebsd.org/changeset/base/205652

Log:
  A ptrace(2) by one processor may trigger a promotion in the address space
  of another process.  Modify pmap_promote_pde() to handle this.  (This is
  not a problem on amd64 due to implementation differences.)
  
  Reported by:	jh@
  MFC after:	1 week

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Thu Mar 25 17:17:35 2010	(r205651)
+++ head/sys/i386/i386/pmap.c	Thu Mar 25 17:24:03 2010	(r205652)
@@ -3154,7 +3154,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t
 	 * either invalid, unused, or does not map the first 4KB physical page
 	 * within a 2- or 4MB page.
 	 */
-	firstpte = vtopte(trunc_4mpage(va));
+	firstpte = pmap_pte_quick(pmap, trunc_4mpage(va));
 setpde:
 	newpde = *firstpte;
 	if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V)) {

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 17:51:05 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADA31106566B;
	Thu, 25 Mar 2010 17:51:05 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 839D68FC17;
	Thu, 25 Mar 2010 17:51:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PHp5kC093572;
	Thu, 25 Mar 2010 17:51:05 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PHp5hu093570;
	Thu, 25 Mar 2010 17:51:05 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003251751.o2PHp5hu093570@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 25 Mar 2010 17:51:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205653 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 17:51:05 -0000

Author: jkim
Date: Thu Mar 25 17:51:05 2010
New Revision: 205653
URL: http://svn.freebsd.org/changeset/base/205653

Log:
  Do not penalize correct or correctable VESA mode tables by calling another
  VBE function.  Most problems should be corrected by the mode table sanity
  check and we only need the paranoid in extremely rare cases.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Thu Mar 25 17:24:03 2010	(r205652)
+++ head/sys/dev/fb/vesa.c	Thu Mar 25 17:51:05 2010	(r205653)
@@ -189,7 +189,9 @@ static int vesa_bios_load_palette2(int s
 #define STATE_ALL	(STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
 static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
+#ifdef MODE_TABLE_BROKEN
 static int vesa_bios_get_line_length(void);
+#endif
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
 #if 0
 static int vesa_bios_get_start(int *x, int *y);
@@ -558,6 +560,7 @@ vesa_bios_save_restore(int code, void *p
 	return (regs.R_AX != 0x004f);
 }
 
+#ifdef MODE_TABLE_BROKEN
 static int
 vesa_bios_get_line_length(void)
 {
@@ -574,6 +577,7 @@ vesa_bios_get_line_length(void)
 
 	return (regs.R_BX);
 }
+#endif
 
 static int
 vesa_bios_set_line_length(int pixel, int *bytes, int *lines)
@@ -1213,7 +1217,6 @@ static int
 vesa_set_mode(video_adapter_t *adp, int mode)
 {
 	video_info_t info;
-	int bpsl;
 
 	if (adp != vesa_adp)
 		return ((*prevvidsw->set_mode)(adp, mode));
@@ -1295,14 +1298,18 @@ vesa_set_mode(video_adapter_t *adp, int 
 	if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
 		vesa_adp->va_line_width /= info.vi_planes;
 
+#ifdef MODE_TABLE_BROKEN
 	/* If VBE function returns bigger bytes per scan line, use it. */
-	bpsl = vesa_bios_get_line_length();
-	if (bpsl > vesa_adp->va_line_width) {
-		vesa_adp->va_line_width = bpsl;
-		info.vi_buffer_size = bpsl * info.vi_height;
-		if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
-			info.vi_buffer_size *= info.vi_planes;
+	{
+		int bpsl = vesa_bios_get_line_length();
+		if (bpsl > vesa_adp->va_line_width) {
+			vesa_adp->va_line_width = bpsl;
+			info.vi_buffer_size = bpsl * info.vi_height;
+			if ((info.vi_flags & V_INFO_GRAPHICS) != 0)
+				info.vi_buffer_size *= info.vi_planes;
+		}
 	}
+#endif
 
 	if (info.vi_flags & V_INFO_LINEAR) {
 #if VESA_DEBUG > 1

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 20:02:54 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DD30106564A;
	Thu, 25 Mar 2010 20:02:54 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D22A8FC17;
	Thu, 25 Mar 2010 20:02:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PK2sZO022901;
	Thu, 25 Mar 2010 20:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PK2sJm022899;
	Thu, 25 Mar 2010 20:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003252002.o2PK2sJm022899@svn.freebsd.org>
From: Xin LI 
Date: Thu, 25 Mar 2010 20:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205654 - head/contrib/cpio/lib
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 20:02:54 -0000

Author: delphij
Date: Thu Mar 25 20:02:54 2010
New Revision: 205654
URL: http://svn.freebsd.org/changeset/base/205654

Log:
  The rmt client in GNU cpio could have a heap overflow when a malicious
  remote tape service returns deliberately crafted packets containing
  more data than requested.
  
  Fix this by checking the returned amount of data and bail out when it
  is more than what we requested.
  
  PR:		gnu/145010
  Submitted by:	naddy
  Reviewed by:	imp
  MFC after:	immediately
  Security:	CVE-2010-0624

Modified:
  head/contrib/cpio/lib/rtapelib.c

Modified: head/contrib/cpio/lib/rtapelib.c
==============================================================================
--- head/contrib/cpio/lib/rtapelib.c	Thu Mar 25 17:51:05 2010	(r205653)
+++ head/contrib/cpio/lib/rtapelib.c	Thu Mar 25 20:02:54 2010	(r205654)
@@ -570,7 +570,8 @@ rmt_read__ (int handle, char *buffer, si
 
   sprintf (command_buffer, "R%lu\n", (unsigned long) length);
   if (do_command (handle, command_buffer) == -1
-      || (status = get_status (handle)) == SAFE_READ_ERROR)
+      || (status = get_status (handle)) == SAFE_READ_ERROR
+      || status > length)
     return SAFE_READ_ERROR;
 
   for (counter = 0; counter < status; counter += rlen, buffer += rlen)

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 20:15:07 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F818106566B;
	Thu, 25 Mar 2010 20:15:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A0AA8FC1D;
	Thu, 25 Mar 2010 20:15:07 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id AB2A241C756;
	Thu, 25 Mar 2010 21:15:06 +0100 (CET)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([192.168.74.103])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id EBC5iO+2jYWo; Thu, 25 Mar 2010 21:15:05 +0100 (CET)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id D18CB41C6DB; Thu, 25 Mar 2010 21:15:05 +0100 (CET)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id D7C894448EC;
	Thu, 25 Mar 2010 20:14:58 +0000 (UTC)
Date: Thu, 25 Mar 2010 20:14:58 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Rui Paulo 
In-Reply-To: 
Message-ID: <20100325201233.J33454@maildrop.int.zabbadoz.net>
References: <201003251029.o2PAT0AW031465@svn.freebsd.org>
	
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205637 - head/sys/netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 20:15:07 -0000

On Thu, 25 Mar 2010, Rui Paulo wrote:

>
> On 25 Mar 2010, at 10:29, Bjoern A. Zeeb wrote:
>
>> Author: bz
>> Date: Thu Mar 25 10:29:00 2010
>> New Revision: 205637
>> URL: http://svn.freebsd.org/changeset/base/205637
>>
>> Log:
>>  We are holding a write lock here so avoid aquiring it twice calling
>>  the "locked" version rather than the wrapper function.
>>
>>  MFC after:	6 days
>>
>> Modified:
>>  head/sys/netinet6/nd6.c
>>
>> Modified: head/sys/netinet6/nd6.c
>> ==============================================================================
>> --- head/sys/netinet6/nd6.c	Thu Mar 25 10:13:21 2010	(r205636)
>> +++ head/sys/netinet6/nd6.c	Thu Mar 25 10:29:00 2010	(r205637)
>> @@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct
>
>
> This code is probably missing a:
>                LLE_WLOCK_ASSERT(lle);
> at the beginning.

No, the lock is acquired in
 	ln = nd6_lookup(dst6, ND6_EXCLUSIVE, NULL);
 	calling into lla_lookup().. ending in in6_lltable_lookup()
and hold if the ln is not NULL.


>>
>>  	ln->ln_state = ND6_LLINFO_REACHABLE;
>> 	if (!ND6_LLINFO_PERMANENT(ln)) {
>> -		nd6_llinfo_settimer(ln,
>> +		nd6_llinfo_settimer_locked(ln,
>> 		    (long)ND_IFINFO(rt->rt_ifp)->reachable * hz);
>> 	}
>> done:
>
> --
> Rui Paulo
>

-- 
Bjoern A. Zeeb         It will not break if you know what you are doing.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar 25 22:41:02 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 19DBC106566B;
	Thu, 25 Mar 2010 22:41:02 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 088238FC0A;
	Thu, 25 Mar 2010 22:41:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2PMf1lO057821;
	Thu, 25 Mar 2010 22:41:01 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PMf1aX057819;
	Thu, 25 Mar 2010 22:41:01 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003252241.o2PMf1aX057819@svn.freebsd.org>
From: Xin LI 
Date: Thu, 25 Mar 2010 22:41:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205656 - head/libexec/ftpd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 25 Mar 2010 22:41:02 -0000

Author: delphij
Date: Thu Mar 25 22:41:01 2010
New Revision: 205656
URL: http://svn.freebsd.org/changeset/base/205656

Log:
  Check that gl_pathc is bigger than zero before derefencing gl_pathv.
  When gl_pathc == 0, the content of gl_pathv is undefined.
  
  PR:		bin/144761
  Submitted by:	David BERARD 
  Obtained from:	OpenBSD
  MFC after:	1 week

Modified:
  head/libexec/ftpd/popen.c

Modified: head/libexec/ftpd/popen.c
==============================================================================
--- head/libexec/ftpd/popen.c	Thu Mar 25 20:07:30 2010	(r205655)
+++ head/libexec/ftpd/popen.c	Thu Mar 25 22:41:01 2010	(r205656)
@@ -110,10 +110,11 @@ ftpd_popen(char *program, char *type)
 		flags |= GLOB_LIMIT;
 		if (glob(argv[argc], flags, NULL, &gl))
 			gargv[gargc++] = strdup(argv[argc]);
-		else
+		else if (gl.gl_pathc > 0) {
 			for (pop = gl.gl_pathv; *pop && gargc < (MAXGLOBARGS-1);
 			     pop++)
 				gargv[gargc++] = strdup(*pop);
+		}
 		globfree(&gl);
 	}
 	gargv[gargc] = NULL;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 00:49:06 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9D181065674;
	Fri, 26 Mar 2010 00:49:06 +0000 (UTC)
	(envelope-from danger@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95B668FC1C;
	Fri, 26 Mar 2010 00:49:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q0n6Vj085982;
	Fri, 26 Mar 2010 00:49:06 GMT (envelope-from danger@svn.freebsd.org)
Received: (from danger@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q0n6rX085979;
	Fri, 26 Mar 2010 00:49:06 GMT (envelope-from danger@svn.freebsd.org)
Message-Id: <201003260049.o2Q0n6rX085979@svn.freebsd.org>
From: Daniel Gerzo 
Date: Fri, 26 Mar 2010 00:49:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205659 - in head/cddl/contrib/opensolaris/cmd: zfs
	zpool
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 00:49:06 -0000

Author: danger (doc committer)
Date: Fri Mar 26 00:49:06 2010
New Revision: 205659
URL: http://svn.freebsd.org/changeset/base/205659

Log:
  - update zfs and zpool manual pages to match the current state of the source
  
  PR:		144984
  Submitted by:	mm@
  Approved by:	pjd@
  Obtained from:	OpenSolaris
  MFC after:	4 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Fri Mar 26 00:05:42 2010	(r205658)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Fri Mar 26 00:49:06 2010	(r205659)
@@ -1,24 +1,9 @@
 '\" te
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").  
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
-.TH zfs 1M "8 Apr 2008" "SunOS 5.11" "System Administration Commands"
+.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH zfs 1M "14 Feb 2009" "SunOS 5.11" "System Administration Commands"
 .SH NAME
 zfs \- configures ZFS file systems
 .SH SYNOPSIS
@@ -44,7 +29,8 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
+\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... 
+      \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
 .fi
 
 .LP
@@ -54,7 +40,7 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBclone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
+\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -65,7 +51,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR 
-    \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
+     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
 .fi
 
 .LP
@@ -81,23 +67,23 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
-    [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
+     [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...
+\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|snapshot ...
 .fi
 
 .LP
 .nf
 \fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...]
-     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
+      \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...
+\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
 .fi
 
 .LP
@@ -132,12 +118,12 @@ zfs \- configures ZFS file systems
 
 .LP
 .nf
-\fBzfs\fR \fBunshare\fR  \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
+\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
 .fi
 
 .LP
 .nf
-\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fB-iI\fR] \fIsnapshot\fR] \fIsnapshot\fR
+\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
 .fi
 
 .LP
@@ -153,7 +139,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] 
-    \fIfilesystem\fR|\fIvolume\fR
+     \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -174,7 +160,7 @@ zfs \- configures ZFS file systems
 .LP
 .nf
 \fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] 
-    \fIfilesystem\fR|\fIvolume\fR
+     \fIfilesystem\fR|\fIvolume\fR
 .fi
 
 .LP
@@ -192,20 +178,10 @@ zfs \- configures ZFS file systems
 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
 .fi
 
-.LP
-.nf
-\fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
-.fi
-.LP
-.nf
-\fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
-.fi
-
 .SH DESCRIPTION
 .sp
 .LP
-The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A
-dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
+The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
 .sp
 .in +2
 .nf
@@ -226,9 +202,9 @@ A dataset can be one of the following:
 .na
 \fB\fIfile system\fR\fR
 .ad
-.RS 15n
-.rt  
-A standard \fBPOSIX\fR file system. \fBZFS\fR file systems can be mounted within the standard file system namespace and behave like any other file system.
+.sp .6
+.RS 4n
+A \fBZFS\fR dataset of type "filesystem" that can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space.
 .RE
 
 .sp
@@ -237,8 +213,8 @@ A standard \fBPOSIX\fR file system. \fBZ
 .na
 \fB\fIvolume\fR\fR
 .ad
-.RS 15n
-.rt  
+.sp .6
+.RS 4n
 A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. Volumes cannot be used in a non-global zone.
 .RE
 
@@ -248,8 +224,8 @@ A logical volume exported as a raw or bl
 .na
 \fB\fIsnapshot\fR\fR
 .ad
-.RS 15n
-.rt  
+.sp .6
+.RS 4n
 A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
 .RE
 
@@ -272,20 +248,17 @@ A snapshot is a read-only copy of a file
 Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
 .sp
 .LP
-File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir"
-property.
+File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir" property.
 .SS "Clones"
 .sp
 .LP
 A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
 .sp
 .LP
-Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin"
-property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
+Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin" property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
 .sp
 .LP
-The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone
-was created from.
+The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from.
 .SS "Mount Points"
 .sp
 .LP
@@ -301,8 +274,7 @@ A file system can also have a mount poin
 A file system mountpoint property of "none" prevents the file system from being mounted.
 .sp
 .LP
-If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage
-the file system, and the administrator is responsible for mounting and unmounting the file system.
+If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
 .SS "Zones"
 .sp
 .LP
@@ -312,8 +284,7 @@ A \fBZFS\fR file system can be added to 
 The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted.
 .sp
 .LP
-A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or
-any of its children. However, the "quota" property is controlled by the global administrator.
+A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or any of its children. However, the "quota" property is controlled by the global administrator.
 .sp
 .LP
 A \fBZFS\fR volume can be added as a device to a non-global zone by using zonecfg's "\fBadd device\fR" subcommand. However, its physical properties can only be modified by the global administrator.
@@ -329,15 +300,13 @@ The global administrator can forcibly cl
 .SS "Native Properties"
 .sp
 .LP
-Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior,
-but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
+Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
 .sp
 .LP
-Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Snapshot properties can not be edited; they always inherit their inheritable properties. Properties
-that are not applicable to snapshots are not displayed.
+Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Some properties only apply to certain types of datasets (file systems, volumes or snapshots).
 .sp
 .LP
-The values of numeric properties can be specified using the following human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
+The values of numeric properties can be specified using human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
 .sp
 .in +2
 .nf
@@ -360,8 +329,7 @@ The following native properties consist 
 .ad
 .sp .6
 .RS 4n
-The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets
-within the pool.
+The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool.
 .sp
 This property can also be referred to by its shortened column name, "avail".
 .RE
@@ -418,8 +386,7 @@ For cloned file systems or volumes, the 
 .ad
 .sp .6
 .RS 4n
-The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are
-identical.
+The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
 .sp
 This property can also be referred to by its shortened column name, "refer".
 .RE
@@ -432,7 +399,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-The type of dataset: "filesystem", "volume", "snapshot", or "clone".
+The type of dataset: "filesystem", "volume", or "snapshot".
 .RE
 
 .sp
@@ -443,11 +410,9 @@ The type of dataset: "filesystem", "volu
 .ad
 .sp .6
 .RS 4n
-The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets.
-The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
+The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
 .sp
-When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in
-the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
+When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
 .sp
 The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
 .RE
@@ -456,12 +421,66 @@ The amount of space used, available, or 
 .ne 2
 .mk
 .na
+\fBusedby*\fR
+.ad
+.sp .6
+.RS 4n
+The \fBusedby*\fR snapshots decompose the "used" properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on zpool "version 13" pools.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbychildren\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbydataset\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbyrefreservation\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBusedbysnapshots\fR
+.ad
+.sp .6
+.RS 4n
+The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' "used" properties because space can be shared by multiple snapshots
+.RE
+
+.sp
+.ne 2
+.mk
+.na
 \fBvolblocksize=\fIblocksize\fR\fR
 .ad
 .sp .6
 .RS 4n
-For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes
-to 128 Kbytes is valid.
+For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
 .sp
 This property can also be referred to by its shortened column name, "volblock".
 .RE
@@ -473,15 +492,13 @@ The following native properties can be u
 .ne 2
 .mk
 .na
-\fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR\fR
+\fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
 .ad
 .sp .6
 .RS 4n
-Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit"
-property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBrestricted\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited.
+Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit" property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBrestricted\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an "aclinherit" property value of "\fBpassthrough-x\fR" has the same meaning as "\fBpassthrough\fR", except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit.
 .sp
-When the property value is set to "\fBpassthrough\fR," files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode
-from the application.
+When the property value is set to "\fBpassthrough\fR," files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode from the application.
 .RE
 
 .sp
@@ -492,9 +509,7 @@ from the application.
 .ad
 .sp .6
 .RS 4n
-Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR"
-deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission
-bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
+Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR" deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
 .RE
 
 .sp
@@ -505,8 +520,7 @@ bits, unless it is a user entry that has
 .ad
 .sp .6
 .RS 4n
-Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value
-is "on".
+Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is "on".
 .RE
 
 .sp
@@ -517,12 +531,9 @@ is "on".
 .ad
 .sp .6
 .RS 4n
-If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". Setting this property to "\fBoff\fR" is similar to setting the "mountpoint"
-property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "\fBoff\fR" allows datasets to be used solely as a mechanism to inherit properties. One example
-of setting canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
+If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". Setting this property to "\fBoff\fR" is similar to setting the "mountpoint" property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "\fBoff\fR" allows datasets to be used solely as a mechanism to inherit properties. One example of setting canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
 .sp
-When the "\fBnoauto\fR" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "\fBzfs mount -a\fR" command or unmounted
-by the "\fBzfs unmount -a\fR" command. 
+When the "\fBnoauto\fR" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "\fBzfs mount -a\fR" command or unmounted by the "\fBzfs unmount -a\fR" command. 
 .sp
 This property is not inherited.
 .RE
@@ -535,8 +546,7 @@ This property is not inherited.
 .ad
 .sp .6
 .RS 4n
-Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher4\fR, but this may change in future releases). The value "off" disables integrity
-checking on user data. Disabling checksums is NOT a recommended practice.
+Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice.
 .RE
 
 .sp
@@ -547,9 +557,7 @@ checking on user data. Disabling checksu
 .ad
 .sp .6
 .RS 4n
-Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip"
-compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is
-an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
+Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip" compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
 .sp
 This property can also be referred to by its shortened column name "compress".
 .RE
@@ -562,8 +570,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated
-file and dataset, changing the "used" property and counting against quotas and reservations.
+Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the "used" property and counting against quotas and reservations.
 .sp
 Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "\fB-o\fR copies=" option.
 .RE
@@ -600,8 +607,7 @@ Controls whether processes can be execut
 .RS 4n
 Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
 .sp
-When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was
-previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
+When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
 .RE
 
 .sp
@@ -612,7 +618,18 @@ previously "legacy" or "none", or if the
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system should be mounted with "\fBnbmand\fR" (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. 	Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on "\fBnbmand\fR" mounts.
+Controls whether the file system should be mounted with "\fBnbmand\fR" (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on "\fBnbmand\fR" mounts.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBprimarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
+.ad
+.sp .6
+.RS 4n
+Controls what is cached in the primary cache (ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
 .RE
 
 .sp
@@ -623,8 +640,7 @@ Controls whether the file system should 
 .ad
 .sp .6
 .RS 4n
-Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already
-has a quota does not override the ancestor's quota, but rather imposes an additional limit.
+Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit.
 .sp
 Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
 .RE
@@ -650,11 +666,9 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical
-access patterns. 
+Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical access patterns. 
 .sp
-For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general
-purpose file systems is strongly discouraged, and may adversely affect performance.
+For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance.
 .sp
 The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
 .sp
@@ -682,8 +696,7 @@ Limits the amount of space a dataset can
 .ad
 .sp .6
 .RS 4n
-The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation
-is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
+The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
 .sp
 If \fBrefreservation\fR is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
 .sp
@@ -698,8 +711,7 @@ This property can also be referred to by
 .ad
 .sp .6
 .RS 4n
-The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space
-used, and count against the parent datasets' quotas and reservations.
+The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
 .sp
 This property can also be referred to by its shortened column name, "reserv".
 .RE
@@ -708,6 +720,17 @@ This property can also be referred to by
 .ne 2
 .mk
 .na
+\fBsecondarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
+.ad
+.sp .6
+.RS 4n
+Controls what is cached in the secondary cache (L2ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
 \fBsetuid=\fIon\fR | \fIoff\fR\fR
 .ad
 .sp .6
@@ -723,8 +746,7 @@ Controls whether the set-\fBUID\fR bit i
 .ad
 .sp .6
 .RS 4n
-Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk".
-The default value is "off". In the future, other target types might be supported. For example, "tape".
+Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk". The default value is "off". In the future, other target types might be supported. For example, "tape".
 .sp
 You might want to set "shareiscsi=on" for a file system so that all \fBZFS\fR volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
 .RE
@@ -737,15 +759,13 @@ You might want to set "shareiscsi=on" fo
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the "\fBsharesmb\fR" property set to "off" is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the "zfs share" and "zfs unshare" commands. If the property is set to "on",
-the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
+Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the "\fBsharesmb\fR" property set to "off" is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
+.sp
+Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore (\fB_\fR) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset \fBdata/home/john\fR is set to \fBname=john\fR, then \fBdata/home/john\fR has a resource name of \fBjohn\fR. If a child dataset of \fBdata/home/john/backups\fR, it has a resource name of \fBjohn_backups\fR.
 .sp
-Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore
-(_) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset "\fBdata/home/john\fR"
-is set to "name=john", then "\fBdata/home/john\fR" has a resource name of "john". If a child dataset of "\fBdata/home/john/backups\fR", it has a resource name of "john_backups".
+When SMB shares are created, the SMB share name appears as an entry in the \fB\&.zfs/shares\fR directory. You can use the \fBls\fR or \fBchmod\fR command to display the share-level ACLs on the entries in this directory.
 .sp
-When the "sharesmb" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to "off", or if they were shared before the property was changed. If the new property
-is set to "off", the file systems are unshared.
+When the \fBsharesmb\fR property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to \fBoff\fR, or if they were shared before the property was changed. If the new property is set to \fBoff\fR, the file systems are unshared.
 .RE
 
 .sp
@@ -756,11 +776,9 @@ is set to "off", the file systems are un
 .ad
 .sp .6
 .RS 4n
-Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on",
-the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
+Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on", the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
 .sp
-When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off",
-the file systems are unshared.
+When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off", the file systems are unshared.
 .RE
 
 .sp
@@ -793,14 +811,11 @@ The on-disk version of this file system,
 .ad
 .sp .6
 .RS 4n
-For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are
-reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
+For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
 .sp
-The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when
-the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
+The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
 .sp
-Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created.
-A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
+Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created. A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
 .RE
 
 .sp
@@ -838,8 +853,7 @@ Controls whether the dataset is managed 
 
 .sp
 .LP
-The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the "\fBzfs create\fR" command, these properties are inherited from the parent dataset.
-If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
+The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the "\fBzfs create\fR" or "\fBzpool create\fR" commands, these properties are inherited from the parent dataset. If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
 .sp
 .ne 2
 .mk
@@ -848,11 +862,9 @@ If the parent dataset lacks these proper
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the "\fBcasesensitivity\fR" property is "\fBsensitive\fR."
-Traditionally, UNIX and POSIX file systems have case-sensitive file names.
+Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the "\fBcasesensitivity\fR" property is "\fBsensitive\fR." Traditionally, UNIX and POSIX file systems have case-sensitive file names.
 .sp
-The "\fBmixed\fR" value for the "\fBcasesensitivity\fR" property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system
-that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the "mixed" value behavior, see the \fIZFS Administration Guide\fR.
+The "\fBmixed\fR" value for the "\fBcasesensitivity\fR" property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the "mixed" value behavior, see the \fIZFS Administration Guide\fR.
 .RE
 
 .sp
@@ -863,20 +875,7 @@ that supports mixed behavior is limited 
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison
-process. If this property is set to a legal value other than "\fBnone\fR," and the "\fButf8only\fR" property was left unspecified, the "\fButf8only\fR" property is automatically set to "\fBon\fR."
-The default value of the "\fBnormalization\fR" property is "\fBnone\fR." This property cannot be changed after the file system is created.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBjailed =\fIon\fR | \fIoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the dataset is managed from within a jail. The default value is "off".
+Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison process. If this property is set to a legal value other than "\fBnone\fR," and the "\fButf8only\fR" property was left unspecified, the "\fButf8only\fR" property is automatically set to "\fBon\fR." The default value of the "\fBnormalization\fR" property is "\fBnone\fR." This property cannot be changed after the file system is created.
 .RE
 
 .sp
@@ -887,63 +886,52 @@ Controls whether the dataset is managed 
 .ad
 .sp .6
 .RS 4n
-Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to "\fBoff\fR," the normalization property must either not be
-explicitly set or be set to "\fBnone\fR." The default value for the "\fButf8only\fR" property is "off." This property cannot be changed after the file system is created.
+Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to "\fBoff\fR," the normalization property must either not be explicitly set or be set to "\fBnone\fR." The default value for the "\fButf8only\fR" property is "off." This property cannot be changed after the file system is created.
 .RE
 
 .sp
 .LP
-The "\fBcasesensitivity\fR," "\fBnormalization\fR," and "\fButf8only\fR" properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration
-feature.
+The "\fBcasesensitivity\fR," "\fBnormalization\fR," and "\fButf8only\fR" properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration feature.
 .SS "Temporary Mount Point Properties"
 .sp
 .LP
-When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems,
-its mount options are set according to its properties. The correlation between properties and mount options is as follows:
+When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems, its mount options are set according to its properties. The correlation between properties and mount options is as follows:
 .sp
 .in +2
 .nf
     PROPERTY                MOUNT OPTION
-    devices                 devices/nodevices
-    exec                    exec/noexec
-    readonly                ro/rw
-    setuid                  setuid/nosetuid
-    xattr                   xattr/noxattr
+     devices                 devices/nodevices
+     exec                    exec/noexec
+     readonly                ro/rw
+     setuid                  setuid/nosetuid
+     xattr                   xattr/noxattr
 .fi
 .in -2
 .sp
 
 .sp
 .LP
-In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid".
-These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
+In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid". These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
 .SS "User Properties"
 .sp
 .LP
-In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets.
-.sp
-.LP
-User property names must contain a colon (":") character, to distinguish them from native properties. They might contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore
-("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters,
-and cannot begin with a dash ("-").
+In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets (file systems, volumes, and snapshots).
 .sp
 .LP
-When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for
-different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
+User property names must contain a colon (":") character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore ("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters, and cannot begin with a dash ("-").
 .sp
 .LP
-The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties.
-Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
-.SS "Volumes as Swap or Dump Devices"
+When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
 .sp
 .LP
-To set up a swap area, create a \fBZFS\fR volume of a specific size and then enable swap on that device. For more information, see the EXAMPLES section.
+The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties. Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
+.SS "ZFS Volumes as Swap or Dump Devices"
 .sp
 .LP
-Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
+During an initial installation or a live upgrade from a \fBUFS\fR file system, a swap device and dump device are created on \fBZFS\fR volumes in the \fBZFS\fR root pool. By default, the swap area size is based on 1/2 the size of physical memory up to 2 Gbytes. The size of the dump device depends on the kernel's requirements at installation time. Separate \fBZFS\fR volumes must be used for the swap area and dump devices. Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported. 
 .sp
 .LP
-Using a \fBZFS\fR volume as a dump device is not supported.
+If you need to change your swap area or dump device after the system is installed or upgraded, use the \fBswap\fR(1M) and \fBdumpadm\fR(1M) commands. If you need to change the size of your swap area or dump device, see the \fISolaris ZFS Administration Guide\fR.
 .SH SUBCOMMANDS
 .sp
 .LP
@@ -974,10 +962,9 @@ Creates a new \fBZFS\fR file system. The
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 21n
-.rt  
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
-the target filesystem already exists, the operation completes successfully.
+.sp .6
+.RS 4n
+Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
 .RE
 
 .sp
@@ -986,10 +973,9 @@ the target filesystem already exists, th
 .na
 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
 .ad
-.RS 21n
-.rt  
-Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
-error results if the same property is specified in multiple \fB-o\fR options.
+.sp .6
+.RS 4n
+Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
 .RE
 
 .RE
@@ -1002,8 +988,7 @@ error results if the same property is sp
 .ad
 .sp .6
 .RS 4n
-Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents
-the logical size as exported by the device. By default, a reservation of equal size is created.
+Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
 .sp
 \fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
 .sp
@@ -1012,10 +997,9 @@ the logical size as exported by the devi
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 21n
-.rt  
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
-the target filesystem already exists, the operation completes successfully.
+.sp .6
+.RS 4n
+Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
 .RE
 
 .sp
@@ -1024,8 +1008,8 @@ the target filesystem already exists, th
 .na
 \fB\fB-s\fR\fR
 .ad
-.RS 21n
-.rt  
+.sp .6
+.RS 4n
 Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
 .RE
 
@@ -1035,10 +1019,9 @@ Creates a sparse volume with no reservat
 .na
 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
 .ad
-.RS 21n
-.rt  
-Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
-error results if the same property is specified in multiple \fB-o\fR options.
+.sp .6
+.RS 4n
+Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
 .RE
 
 .sp
@@ -1047,10 +1030,9 @@ error results if the same property is sp
 .na
 \fB\fB-b\fR \fIblocksize\fR\fR
 .ad
-.RS 21n
-.rt  
-Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting
-behavior is undefined.
+.sp .6
+.RS 4n
+Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting behavior is undefined.
 .RE
 
 .RE
@@ -1070,8 +1052,8 @@ Destroys the given dataset. By default, 
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
 .RE
 
@@ -1081,8 +1063,8 @@ Recursively destroy all children. If a s
 .na
 \fB\fB-R\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
 .RE
 
@@ -1092,8 +1074,8 @@ Recursively destroy all dependents, incl
 .na
 \fB\fB-f\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Force an unmount of any file systems using the "\fBunmount -f\fR" command. This option has no effect on non-file systems or unmounted file systems.
 .RE
 
@@ -1104,7 +1086,7 @@ Extreme care should be taken when applyi
 .ne 2
 .mk
 .na
-\fB\fBzfs snapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
+\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
 .ad
 .sp .6
 .RS 4n
@@ -1115,11 +1097,22 @@ Creates a snapshot with the given name. 
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively create snapshots of all descendent datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
 .RE
 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the specified property; see "\fBzfs create\fR" for details.
+.RE
+
 .RE
 
 .sp
@@ -1130,16 +1123,15 @@ Recursively create snapshots of all desc
 .ad
 .sp .6
 .RS 4n
-Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than
-the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
+Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
 .sp
 .ne 2
 .mk
 .na
 \fB\fB-r\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy any snapshots more recent than the one specified.
 .RE
 
@@ -1149,8 +1141,8 @@ Recursively destroy any snapshots more r
 .na
 \fB\fB-R\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
 .RE
 
@@ -1160,8 +1152,8 @@ Recursively destroy any more recent snap
 .na
 \fB\fB-f\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
 .RE
 
@@ -1171,7 +1163,7 @@ Used with the \fB-R\fR option to force a
 .ne 2
 .mk
 .na
-\fB\fBzfs clone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
+\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
 .ad
 .sp .6
 .RS 4n
@@ -1182,11 +1174,22 @@ Creates a clone of the given snapshot. S
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
 .RE
 
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the specified property; see "\fBzfs create\fR" for details.
+.RE
+
 .RE
 
 .sp
@@ -1197,11 +1200,9 @@ Creates all the non-existing parent data
 .ad
 .sp .6
 .RS 4n
-Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system
-becomes a clone of the specified file system. 
+Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system becomes a clone of the specified file system. 
 .sp
-The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed
-by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
+The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
 .RE
 
 .sp
@@ -1216,21 +1217,19 @@ by this operation, but the space account
 .ad
 .br
 .na
-\fB\fBzfs
-rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
+\fB\fBzfs rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
 .ad
 .sp .6
 .RS 4n
-Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does
-not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
+Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
 .sp
 .ne 2
 .mk
 .na
 \fB\fB-p\fR\fR
 .ad
-.RS 6n
-.rt  
+.sp .6
+.RS 4n
 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent.
 .RE
 
@@ -1259,7 +1258,7 @@ Recursively rename the snapshots of all 
 .ad
 .sp .6
 .RS 4n
-Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all datasets are displayed and contain the following fields:
+Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all file systems and volumes are displayed. Snapshots are displayed if the "listsnaps" property is "on" (the default is "off") . The following fields are displayed:

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

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 00:53:14 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 251A5106566B;
	Fri, 26 Mar 2010 00:53:14 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 13D518FC0C;
	Fri, 26 Mar 2010 00:53:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q0rDgN086896;
	Fri, 26 Mar 2010 00:53:13 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q0rDgk086894;
	Fri, 26 Mar 2010 00:53:13 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201003260053.o2Q0rDgk086894@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 26 Mar 2010 00:53:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205660 - head/sys/ia64/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 00:53:14 -0000

Author: nwhitehorn
Date: Fri Mar 26 00:53:13 2010
New Revision: 205660
URL: http://svn.freebsd.org/changeset/base/205660

Log:
  Fix the ia64 build.
  
  Pointy hat to: me

Modified:
  head/sys/ia64/ia64/machdep.c

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Fri Mar 26 00:49:06 2010	(r205659)
+++ head/sys/ia64/ia64/machdep.c	Fri Mar 26 00:53:13 2010	(r205660)
@@ -1381,7 +1381,7 @@ exec_setregs(struct thread *td, struct i
 		 * Assumes that (bspstore & 0x1f8) < 0x1e0.
 		 */
 		suword((caddr_t)tf->tf_special.bspstore - 24, stack);
-		suword((caddr_t)tf->tf_special.bspstore - 16, ps_strings);
+		suword((caddr_t)tf->tf_special.bspstore - 16, imgp->ps_strings);
 		suword((caddr_t)tf->tf_special.bspstore -  8, 0);
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 01:19:29 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BF6221065672;
	Fri, 26 Mar 2010 01:19:29 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AEA418FC0C;
	Fri, 26 Mar 2010 01:19:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q1JTub092733;
	Fri, 26 Mar 2010 01:19:29 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q1JT3N092731;
	Fri, 26 Mar 2010 01:19:29 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201003260119.o2Q1JT3N092731@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 26 Mar 2010 01:19:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205661 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 01:19:29 -0000

Author: rmacklem
Date: Fri Mar 26 01:19:29 2010
New Revision: 205661
URL: http://svn.freebsd.org/changeset/base/205661

Log:
  Patch the regular NFS server so that it returns ESTALE to the client
  for all errors returned by VFS_FHTOVP(). This is required to ensure
  that EIO doesn't get returned to the client when ZFS is used as the
  server file system.
  
  Tested by:	korvus AT comcast.net
  Reviewed by:	jhb
  MFC after:	2 weeks

Modified:
  head/sys/nfsserver/nfs_srvsubs.c

Modified: head/sys/nfsserver/nfs_srvsubs.c
==============================================================================
--- head/sys/nfsserver/nfs_srvsubs.c	Fri Mar 26 00:53:13 2010	(r205660)
+++ head/sys/nfsserver/nfs_srvsubs.c	Fri Mar 26 01:19:29 2010	(r205661)
@@ -1128,6 +1128,9 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla
 		}
 	}
 	error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
+	if (error != 0)
+		/* Make sure the server replies ESTALE to the client. */
+		error = ESTALE;
 	vfs_unbusy(mp);
 	if (error)
 		goto out;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 01:30:54 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E7671065670;
	Fri, 26 Mar 2010 01:30:54 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32EA78FC18;
	Fri, 26 Mar 2010 01:30:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q1UsVW095280;
	Fri, 26 Mar 2010 01:30:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q1Usjd095276;
	Fri, 26 Mar 2010 01:30:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003260130.o2Q1Usjd095276@svn.freebsd.org>
From: Xin LI 
Date: Fri, 26 Mar 2010 01:30:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205662 - in head/sys/boot/i386: boot2 gptboot zfsboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 01:30:54 -0000

Author: delphij
Date: Fri Mar 26 01:30:53 2010
New Revision: 205662
URL: http://svn.freebsd.org/changeset/base/205662

Log:
  Our boot loader is capable of booting both i386 and amd64 kernels so
  call it "x86" instead of "i386".
  
  Suggested by:	jhb in response to Alexander Best's loader proposal
  MFC after:	1 month

Modified:
  head/sys/boot/i386/boot2/boot2.c
  head/sys/boot/i386/gptboot/gptboot.c
  head/sys/boot/i386/zfsboot/zfsboot.c

Modified: head/sys/boot/i386/boot2/boot2.c
==============================================================================
--- head/sys/boot/i386/boot2/boot2.c	Fri Mar 26 01:19:29 2010	(r205661)
+++ head/sys/boot/i386/boot2/boot2.c	Fri Mar 26 01:30:53 2010	(r205662)
@@ -283,7 +283,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %u:%s(%u,%c)%s\n"
 		   "boot: ",
 		   dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: head/sys/boot/i386/gptboot/gptboot.c
==============================================================================
--- head/sys/boot/i386/gptboot/gptboot.c	Fri Mar 26 01:19:29 2010	(r205661)
+++ head/sys/boot/i386/gptboot/gptboot.c	Fri Mar 26 01:30:53 2010	(r205662)
@@ -281,7 +281,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %u:%s(%up%u)%s\n"
 		   "boot: ",
 		   dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: head/sys/boot/i386/zfsboot/zfsboot.c
==============================================================================
--- head/sys/boot/i386/zfsboot/zfsboot.c	Fri Mar 26 01:19:29 2010	(r205661)
+++ head/sys/boot/i386/zfsboot/zfsboot.c	Fri Mar 26 01:30:53 2010	(r205662)
@@ -730,7 +730,7 @@ main(void)
 
     for (;;) {
 	if (!autoboot || !OPT_CHECK(RBX_QUIET))
-	    printf("\nFreeBSD/i386 boot\n"
+	    printf("\nFreeBSD/x86 boot\n"
 		   "Default: %s:%s\n"
 		   "boot: ",
 		   spa->spa_name, kname);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 01:35:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E5D7106564A;
	Fri, 26 Mar 2010 01:35:19 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4DB808FC0A;
	Fri, 26 Mar 2010 01:35:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q1ZJQS096278;
	Fri, 26 Mar 2010 01:35:19 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q1ZJXL096276;
	Fri, 26 Mar 2010 01:35:19 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201003260135.o2Q1ZJXL096276@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 26 Mar 2010 01:35:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205663 - head/sys/fs/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 01:35:19 -0000

Author: rmacklem
Date: Fri Mar 26 01:35:19 2010
New Revision: 205663
URL: http://svn.freebsd.org/changeset/base/205663

Log:
  Patch the experimental NFS server in a manner analagous to r205661
  for the regular NFS server, to ensure that ESTALE is
  returned to the client for all errors returned by VFS_FHTOVP().
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Mar 26 01:30:53 2010	(r205662)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Mar 26 01:35:19 2010	(r205663)
@@ -2443,6 +2443,9 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
 	*credp = NULL;
 	exp->nes_numsecflavor = 0;
 	error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
+	if (error != 0)
+		/* Make sure the server replies ESTALE to the client. */
+		error = ESTALE;
 	if (nam && !error) {
 		error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp,
 		    &exp->nes_numsecflavor, &secflavors);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 02:29:15 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2FCD106564A;
	Fri, 26 Mar 2010 02:29:15 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1D698FC15;
	Fri, 26 Mar 2010 02:29:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q2TFiF008351;
	Fri, 26 Mar 2010 02:29:15 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q2TFS1008347;
	Fri, 26 Mar 2010 02:29:15 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003260229.o2Q2TFS1008347@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 26 Mar 2010 02:29:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205665 - in head/sys/ia64: ia64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 02:29:15 -0000

Author: marcel
Date: Fri Mar 26 02:29:15 2010
New Revision: 205665
URL: http://svn.freebsd.org/changeset/base/205665

Log:
  Only use the interval timer for clock interrupts on the BSP and
  have the BSP use IPIs to trigger clock interrupts on the APs.
  This allows us to run on hardware configurations for which the
  ITC has non-uniform frequencies across CPUs.
  
  While here, change the clock XIV to type IPI so as to protect
  the interrupt delivery against CPU re-balancing once that's
  implemented.

Modified:
  head/sys/ia64/ia64/clock.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/include/pcpu.h

Modified: head/sys/ia64/ia64/clock.c
==============================================================================
--- head/sys/ia64/ia64/clock.c	Fri Mar 26 01:57:12 2010	(r205664)
+++ head/sys/ia64/ia64/clock.c	Fri Mar 26 02:29:15 2010	(r205665)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics");
 
@@ -91,58 +92,61 @@ ia64_ih_clock(struct thread *td, u_int x
 	int count;
 
 	PCPU_INC(md.stats.pcs_nclks);
-	intrcnt[INTRCNT_CLOCK]++;
 
-	itc = ia64_get_itc();
-
-	adj = PCPU_GET(md.clockadj);
-	clk = PCPU_GET(md.clock);
-
-	delta = itc - clk;
-	count = 0;
-	while (delta >= ia64_clock_reload) {
-		/* Only the BSP runs the real clock */
-		if (PCPU_GET(cpuid) == 0)
+	if (PCPU_GET(cpuid) == 0) {
+		/*
+		 * Clock processing on the BSP.
+		 */
+		intrcnt[INTRCNT_CLOCK]++;
+
+		itc = ia64_get_itc();
+
+		adj = PCPU_GET(md.clockadj);
+		clk = PCPU_GET(md.clock);
+
+		delta = itc - clk;
+		count = 0;
+		while (delta >= ia64_clock_reload) {
+#ifdef SMP
+			ipi_all_but_self(ia64_clock_xiv);
+#endif
 			hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
-		else
-			hardclock_cpu(TRAPF_USERMODE(tf));
+			if (profprocs != 0)
+				profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
+			statclock(TRAPF_USERMODE(tf));
+			delta -= ia64_clock_reload;
+			clk += ia64_clock_reload;
+			if (adj != 0)
+				adjust_ticks++;
+			count++;
+		}
+		ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj);
+		ia64_srlz_d();
+		if (count > 0) {
+			adjust_lost += count - 1;
+			if (delta > (ia64_clock_reload >> 3)) {
+				if (adj == 0)
+					adjust_edges++;
+				adj = ia64_clock_reload >> 4;
+			} else
+				adj = 0;
+		} else {
+			adj = 0;
+			adjust_excess++;
+		}
+		PCPU_SET(md.clock, clk);
+		PCPU_SET(md.clockadj, adj);
+	} else {
+		/*
+		 * Clock processing on the BSP.
+		 */
+		hardclock_cpu(TRAPF_USERMODE(tf));
 		if (profprocs != 0)
 			profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
 		statclock(TRAPF_USERMODE(tf));
-		delta -= ia64_clock_reload;
-		clk += ia64_clock_reload;
-		if (adj != 0)
-			adjust_ticks++;
-		count++;
 	}
-	ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj);
-	ia64_srlz_d();
-	if (count > 0) {
-		adjust_lost += count - 1;
-		if (delta > (ia64_clock_reload >> 3)) {
-			if (adj == 0)
-				adjust_edges++;
-			adj = ia64_clock_reload >> 4;
-		} else
-			adj = 0;
-	} else {
-		adj = 0;
-		adjust_excess++;
-	}
-	PCPU_SET(md.clock, clk);
-	PCPU_SET(md.clockadj, adj);
-	return (0);
-}
 
-void
-pcpu_initclock(void)
-{
-
-	PCPU_SET(md.clockadj, 0);
-	PCPU_SET(md.clock, ia64_get_itc());
-	ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload);
-	ia64_set_itv(ia64_clock_xiv);
-	ia64_srlz_d();
+	return (0);
 }
 
 /*
@@ -154,7 +158,7 @@ cpu_initclocks()
 {
 	u_long itc_freq;
 
-	ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IRQ,
+	ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI,
 	    ia64_ih_clock);
 	if (ia64_clock_xiv == 0)
 		panic("No XIV for clock interrupts");
@@ -169,7 +173,11 @@ cpu_initclocks()
 	tc_init(&ia64_timecounter);
 #endif
 
-	pcpu_initclock();
+	PCPU_SET(md.clockadj, 0);
+	PCPU_SET(md.clock, ia64_get_itc());
+	ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload);
+	ia64_set_itv(ia64_clock_xiv);
+	ia64_srlz_d();
 }
 
 void

Modified: head/sys/ia64/ia64/mp_machdep.c
==============================================================================
--- head/sys/ia64/ia64/mp_machdep.c	Fri Mar 26 01:57:12 2010	(r205664)
+++ head/sys/ia64/ia64/mp_machdep.c	Fri Mar 26 02:29:15 2010	(r205665)
@@ -206,9 +206,8 @@ ia64_ap_startup(void)
 
 	CTR1(KTR_SMP, "SMP: cpu%d launched", PCPU_GET(cpuid));
 
-	/* kick off the clock on this AP */
-	pcpu_initclock();
-
+	/* Mask interval timer interrupts on APs. */
+	ia64_set_itv(0x10000);
 	ia64_set_tpr(0);
 	ia64_srlz_d();
 	enable_intr();

Modified: head/sys/ia64/include/pcpu.h
==============================================================================
--- head/sys/ia64/include/pcpu.h	Fri Mar 26 01:57:12 2010	(r205664)
+++ head/sys/ia64/include/pcpu.h	Fri Mar 26 02:29:15 2010	(r205665)
@@ -91,8 +91,6 @@ __curthread(void)
 #define	PCPU_PTR(member)	(&pcpup->pc_ ## member)
 #define	PCPU_SET(member,value)	(pcpup->pc_ ## member = (value))
 
-void pcpu_initclock(void);
-
 #endif	/* _KERNEL */
 
 #endif	/* !_MACHINE_PCPU_H_ */

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 05:34:13 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0991106564A;
	Fri, 26 Mar 2010 05:34:13 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FB018FC0C;
	Fri, 26 Mar 2010 05:34:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q5YDDu051476;
	Fri, 26 Mar 2010 05:34:13 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q5YD2D051474;
	Fri, 26 Mar 2010 05:34:13 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201003260534.o2Q5YD2D051474@svn.freebsd.org>
From: Maxim Konovalov 
Date: Fri, 26 Mar 2010 05:34:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205671 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 05:34:13 -0000

Author: maxim
Date: Fri Mar 26 05:34:13 2010
New Revision: 205671
URL: http://svn.freebsd.org/changeset/base/205671

Log:
  o Trim leading w/space.
  
  PR:		docs/145030
  Submitted by:	olgeni
  MFC after:	1 week

Modified:
  head/usr.sbin/sysinstall/sysinstall.8

Modified: head/usr.sbin/sysinstall/sysinstall.8
==============================================================================
--- head/usr.sbin/sysinstall/sysinstall.8	Fri Mar 26 05:20:59 2010	(r205670)
+++ head/usr.sbin/sysinstall/sysinstall.8	Fri Mar 26 05:34:13 2010	(r205671)
@@ -541,7 +541,7 @@ Commit any rc.conf changes to disk.
 Preserve existing rc.conf parameters.
 This is useful if you have a post-install script which modifies rc.conf.
 .El
- .It installExpress
+.It installExpress
 Start an "express" installation, asking few questions of
 the user.
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 05:35:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD08C106566B;
	Fri, 26 Mar 2010 05:35:25 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C89C8FC1D;
	Fri, 26 Mar 2010 05:35:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q5ZPYg051784;
	Fri, 26 Mar 2010 05:35:25 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q5ZPTP051782;
	Fri, 26 Mar 2010 05:35:25 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <201003260535.o2Q5ZPTP051782@svn.freebsd.org>
From: Maxim Konovalov 
Date: Fri, 26 Mar 2010 05:35:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205672 - head/sbin/setkey
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 05:35:25 -0000

Author: maxim
Date: Fri Mar 26 05:35:25 2010
New Revision: 205672
URL: http://svn.freebsd.org/changeset/base/205672

Log:
  o Fix typo.
  
  PR:		docs/145031
  Submitted by:	olgeni
  MFC after:	1 week

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==============================================================================
--- head/sbin/setkey/setkey.8	Fri Mar 26 05:34:13 2010	(r205671)
+++ head/sbin/setkey/setkey.8	Fri Mar 26 05:35:25 2010	(r205672)
@@ -674,7 +674,7 @@ add 10.0.11.41 10.0.11.33 esp 0x10001
 	-A hmac-md5 "authentication!!" ;
 
 .Ed
-Get the SA information assocaited with first example above:
+Get the SA information associated with first example above:
 .Bd -literal -offset
 get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 07:15:27 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9EB57106566B;
	Fri, 26 Mar 2010 07:15:27 +0000 (UTC)
	(envelope-from neel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C3EC8FC08;
	Fri, 26 Mar 2010 07:15:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q7FRKA073906;
	Fri, 26 Mar 2010 07:15:27 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q7FRFn073901;
	Fri, 26 Mar 2010 07:15:27 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201003260715.o2Q7FRFn073901@svn.freebsd.org>
From: Neel Natu 
Date: Fri, 26 Mar 2010 07:15:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205675 - in head/sys/mips: include mips sibyte
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 07:15:27 -0000

Author: neel
Date: Fri Mar 26 07:15:27 2010
New Revision: 205675
URL: http://svn.freebsd.org/changeset/base/205675

Log:
  Replace sb_store64()/sb_load64() with mips3_sd()/mips3_ld() respectively.
  
  Obtained from NetBSD.
  
  Suggested by: jmallett@

Modified:
  head/sys/mips/include/cpufunc.h
  head/sys/mips/mips/support.S
  head/sys/mips/sibyte/sb_asm.S
  head/sys/mips/sibyte/sb_scd.c

Modified: head/sys/mips/include/cpufunc.h
==============================================================================
--- head/sys/mips/include/cpufunc.h	Fri Mar 26 06:06:20 2010	(r205674)
+++ head/sys/mips/include/cpufunc.h	Fri Mar 26 07:15:27 2010	(r205675)
@@ -283,6 +283,35 @@ breakpoint(void)
 	__asm __volatile ("break");
 }
 
+#if defined(__GNUC__) && !defined(__mips_o32)
+static inline uint64_t
+mips3_ld(const volatile uint64_t *va)
+{
+	uint64_t rv;
+
+#if defined(_LP64)
+	rv = *va;
+#else
+	__asm volatile("ld	%0,0(%1)" : "=d"(rv) : "r"(va));
+#endif
+
+	return (rv);
+}
+
+static inline void
+mips3_sd(volatile uint64_t *va, uint64_t v)
+{
+#if defined(_LP64)
+	*va = v;
+#else
+	__asm volatile("sd	%0,0(%1)" :: "r"(v), "r"(va));
+#endif
+}
+#else
+uint64_t mips3_ld(volatile uint64_t *va);
+void mips3_sd(volatile uint64_t *, uint64_t);
+#endif	/* __GNUC__ */
+
 #endif /* _KERNEL */
 
 #define	readb(va)	(*(volatile uint8_t *) (va))

Modified: head/sys/mips/mips/support.S
==============================================================================
--- head/sys/mips/mips/support.S	Fri Mar 26 06:06:20 2010	(r205674)
+++ head/sys/mips/mips/support.S	Fri Mar 26 07:15:27 2010	(r205675)
@@ -51,6 +51,38 @@
  */
 
 /*
+ * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Jonathan R. Stone for
+ *      the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
  *	Contains code that is the first executed at boot time plus
  *	assembly language support routines.
  */
@@ -61,6 +93,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "assym.s"
 
@@ -1586,3 +1619,78 @@ LEAF(octeon_get_control)
         .set	mips0
 END(octeon_get_control)
 #endif
+
+LEAF(mips3_ld)
+	.set push
+	.set noreorder
+	.set mips64
+#if defined(__mips_o32)
+	mfc0	t0, MIPS_COP_0_STATUS		# turn off interrupts
+	and	t1, t0, ~(MIPS_SR_INT_IE)
+	mtc0	t1, MIPS_COP_0_STATUS
+	COP0_SYNC
+	nop
+	nop
+	nop
+
+	ld	v0, 0(a0)
+#if _BYTE_ORDER == _BIG_ENDIAN
+	dsll	v1, v0, 32
+	dsra	v1, v1, 32			# low word in v1
+	dsra	v0, v0, 32			# high word in v0
+#else
+	dsra	v1, v0, 32			# high word in v1
+	dsll	v0, v0, 32
+	dsra	v0, v0, 32			# low word in v0
+#endif
+
+	mtc0	t0, MIPS_COP_0_STATUS		# restore intr status.
+	COP0_SYNC
+	nop
+#else /* !__mips_o32 */
+	ld	v0, 0(a0)
+#endif /* !__mips_o32 */
+
+	jr	ra
+	nop
+	.set pop
+END(mips3_ld)
+
+LEAF(mips3_sd)
+	.set push
+	.set mips64
+	.set noreorder
+#if defined(__mips_o32)
+	mfc0	t0, MIPS_COP_0_STATUS		# turn off interrupts
+	and	t1, t0, ~(MIPS_SR_INT_IE)
+	mtc0	t1, MIPS_COP_0_STATUS
+	COP0_SYNC
+	nop
+	nop
+	nop
+
+	# NOTE: a1 is padding!
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+	dsll	a2, a2, 32			# high word in a2
+	dsll	a3, a3, 32			# low word in a3
+	dsrl	a3, a3, 32
+#else
+	dsll	a2, a2, 32			# low word in a2
+	dsrl	a2, a2, 32
+	dsll	a3, a3, 32			# high word in a3
+#endif
+	or	a1, a2, a3
+	sd	a1, 0(a0)
+
+	mtc0	t0, MIPS_COP_0_STATUS		# restore intr status.
+	COP0_SYNC
+	nop
+#else /* !__mips_o32 */
+	sd	a1, 0(a0)
+#endif /* !__mips_o32 */
+
+	jr	ra
+	nop
+	.set pop
+END(mips3_sd)

Modified: head/sys/mips/sibyte/sb_asm.S
==============================================================================
--- head/sys/mips/sibyte/sb_asm.S	Fri Mar 26 06:06:20 2010	(r205674)
+++ head/sys/mips/sibyte/sb_asm.S	Fri Mar 26 07:15:27 2010	(r205675)
@@ -28,61 +28,11 @@
 
 #include 
 #include 
-#include 
-
-/*
- * We compile a 32-bit kernel to run on the SB-1 processor which is a 64-bit
- * processor. It has some registers that must be accessed using 64-bit load
- * and store instructions.
- *
- * So we have to resort to assembly because the compiler does not emit the
- * 'ld' and 'sd' instructions since it thinks that it is compiling for a
- * 32-bit mips processor.
- */
 
 .set	mips64
 .set	noat
 .set	noreorder
 
-/*
- * Parameters:		uint32_t ptr
- * Return value: 	*(uint64_t *)ptr
- */
-LEAF(sb_load64)
-	ld      v1, 0(a0)	/* result = *(uint64_t *)ptr */
-	move	v0, v1
-#if _BYTE_ORDER == _BIG_ENDIAN
-	dsll32	v1, v1, 0
-	dsra32	v1, v1, 0	/* v1 = lower_uint32(result) */
-	jr	ra
-	dsra32	v0, v0, 0	/* v0 = upper_uint32(result) */
-#else
-	dsll32	v0, v0, 0
-	dsra32	v0, v0, 0	/* v0 = lower_uint32(result) */
-	jr	ra
-	dsra32	v1, v1, 0	/* v1 = upper_uint32(result) */
-#endif
-END(sb_load64)
-
-/*
- * Parameters:		uint32_t ptr, uint64_t val
- * Return value:	void
- */
-LEAF(sb_store64)
-#if _BYTE_ORDER == _BIG_ENDIAN
-	dsll32	a2, a2, 0	/* a2 = upper_uint32(val) */
-	dsll32	a3, a3, 0	/* a3 = lower_uint32(val) */
-	dsrl32	a3, a3, 0
-#else
-	dsll32	a3, a3, 0	/* a3 = upper_uint32(val) */
-	dsll32	a2, a2, 0	/* a2 = lower_uint32(val) */
-	dsrl32	a2, a2, 0
-#endif
-	or	t0, a2, a3
-	jr	ra
-	sd	t0, 0(a0)
-END(sb_store64)
-
 #ifdef SMP
 /*
  * This function must be implemented in assembly because it is called early

Modified: head/sys/mips/sibyte/sb_scd.c
==============================================================================
--- head/sys/mips/sibyte/sb_scd.c	Fri Mar 26 06:06:20 2010	(r205674)
+++ head/sys/mips/sibyte/sb_scd.c	Fri Mar 26 07:15:27 2010	(r205675)
@@ -38,8 +38,15 @@ __FBSDID("$FreeBSD$");
 
 #include "sb_scd.h"
 
-extern void	sb_store64(uint32_t addr, uint64_t val);
-extern uint64_t	sb_load64(uint32_t addr);
+/*
+ * We compile a 32-bit kernel to run on the SB-1 processor which is a 64-bit
+ * processor. It has some registers that must be accessed using 64-bit load
+ * and store instructions.
+ *
+ * We use the mips_ld() and mips_sd() functions to do this for us.
+ */
+#define	sb_store64(addr, val)	mips3_sd((uint64_t *)(addr), (val))
+#define	sb_load64(addr)		mips3_ld((uint64_t *)(addr))
 
 /*
  * System Control and Debug (SCD) unit on the Sibyte ZBbus.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 08:42:11 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADA97106564A;
	Fri, 26 Mar 2010 08:42:11 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C2E38FC13;
	Fri, 26 Mar 2010 08:42:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q8gBcE093027;
	Fri, 26 Mar 2010 08:42:11 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q8gBfZ093025;
	Fri, 26 Mar 2010 08:42:11 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003260842.o2Q8gBfZ093025@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 26 Mar 2010 08:42:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205678 - head/sys/compat/linux
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 08:42:11 -0000

Author: netchild
Date: Fri Mar 26 08:42:11 2010
New Revision: 205678
URL: http://svn.freebsd.org/changeset/base/205678

Log:
  Fix some problems which may lead to a panic:
   - right order of src and dst in memcpy
   - NULL out the clips after freeing to prevent an accident
  
  Noticed by:	hselasky

Modified:
  head/sys/compat/linux/linux_ioctl.c

Modified: head/sys/compat/linux/linux_ioctl.c
==============================================================================
--- head/sys/compat/linux/linux_ioctl.c	Fri Mar 26 08:05:30 2010	(r205677)
+++ head/sys/compat/linux/linux_ioctl.c	Fri Mar 26 08:42:11 2010	(r205678)
@@ -2711,7 +2711,7 @@ linux_v4l_clip_copy(void *lvc, struct vi
 	/* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */
 	if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL)
 		return (ENOMEM);    /* XXX: linux has no ENOMEM here */
-	memcpy(&vclip, *ppvc, sizeof(vclip));
+	memcpy(*ppvc, &vclip, sizeof(vclip));
 	(*ppvc)->next = NULL;
 	return (0);
 }
@@ -2726,6 +2726,8 @@ linux_v4l_cliplist_free(struct video_win
 		ppvc_next = &((*ppvc)->next);
 		free(*ppvc, M_LINUX);
 	}
+	vw->clips = NULL;
+
 	return (0);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 08:47:07 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9580B1065670;
	Fri, 26 Mar 2010 08:47:07 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8485B8FC1D;
	Fri, 26 Mar 2010 08:47:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2Q8l79k094126;
	Fri, 26 Mar 2010 08:47:07 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q8l7HN094124;
	Fri, 26 Mar 2010 08:47:07 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003260847.o2Q8l7HN094124@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 26 Mar 2010 08:47:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205679 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 08:47:07 -0000

Author: netchild
Date: Fri Mar 26 08:47:07 2010
New Revision: 205679
URL: http://svn.freebsd.org/changeset/base/205679

Log:
  Fix a typo in a comment.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Fri Mar 26 08:42:11 2010	(r205678)
+++ head/sys/conf/kmod.mk	Fri Mar 26 08:47:07 2010	(r205679)
@@ -325,7 +325,7 @@ ${_src}:
 .endfor
 .endif
 
-# Repsect configuration-specific C flags.
+# Respect configuration-specific C flags.
 CFLAGS+=	${CONF_CFLAGS}
 
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 10:18:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99970106566C;
	Fri, 26 Mar 2010 10:18:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 88EF58FC0C;
	Fri, 26 Mar 2010 10:18:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QAIJHm014406;
	Fri, 26 Mar 2010 10:18:19 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QAIJfN014404;
	Fri, 26 Mar 2010 10:18:19 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003261018.o2QAIJfN014404@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 26 Mar 2010 10:18:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205680 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 10:18:19 -0000

Author: mav
Date: Fri Mar 26 10:18:19 2010
New Revision: 205680
URL: http://svn.freebsd.org/changeset/base/205680

Log:
  Use last 16 bytes of serial number in metadata instead of first ones,
  same as Intel MatrixRAID does.
  
  PR:		kern/124064

Modified:
  head/sys/dev/ata/ata-raid.c

Modified: head/sys/dev/ata/ata-raid.c
==============================================================================
--- head/sys/dev/ata/ata-raid.c	Fri Mar 26 08:47:07 2010	(r205679)
+++ head/sys/dev/ata/ata-raid.c	Fri Mar 26 10:18:19 2010	(r205680)
@@ -2568,8 +2568,15 @@ ata_raid_intel_read_meta(device_t dev, s
 	if (meta->generation >= raid->generation) {
 	    for (disk = 0; disk < raid->total_disks; disk++) {
 		struct ata_device *atadev = device_get_softc(parent);
+		int len;
 
-		if (!strncmp(raid->disks[disk].serial, atadev->param.serial,
+		for (len = 0; len < sizeof(atadev->param.serial); len++) {
+		    if (atadev->param.serial[len] < 0x20)
+			break;
+		}
+		len = (len > sizeof(raid->disks[disk].serial)) ?
+		    len - sizeof(raid->disks[disk].serial) : 0;
+		if (!strncmp(raid->disks[disk].serial, atadev->param.serial + len,
 		    sizeof(raid->disks[disk].serial))) {
 		    raid->disks[disk].dev = parent;
 		    raid->disks[disk].flags |= (AR_DF_PRESENT | AR_DF_ONLINE);
@@ -2639,8 +2646,15 @@ ata_raid_intel_write_meta(struct ar_soft
 		device_get_softc(device_get_parent(rdp->disks[disk].dev));
 	    struct ata_device *atadev =
 		device_get_softc(rdp->disks[disk].dev);
+	    int len;
 
-	    bcopy(atadev->param.serial, meta->disk[disk].serial,
+	    for (len = 0; len < sizeof(atadev->param.serial); len++) {
+		if (atadev->param.serial[len] < 0x20)
+		    break;
+	    }
+	    len = (len > sizeof(rdp->disks[disk].serial)) ?
+	        len - sizeof(rdp->disks[disk].serial) : 0;
+	    bcopy(atadev->param.serial + len, meta->disk[disk].serial,
 		  sizeof(rdp->disks[disk].serial));
 	    meta->disk[disk].sectors = rdp->disks[disk].sectors;
 	    meta->disk[disk].id = (ch->unit << 16) | atadev->unit;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 10:41:16 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99D58106564A;
	Fri, 26 Mar 2010 10:41:16 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE
	[128.176.192.19])
	by mx1.freebsd.org (Postfix) with ESMTP id B3AD48FC08;
	Fri, 26 Mar 2010 10:41:15 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.51,313,1267398000"; 
	d="txt'?scan'208";a="29408466"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay3.uni-muenster.de with ESMTP; 26 Mar 2010 11:41:01 +0100
Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id 6E6A71B07C1; Fri, 26 Mar 2010 11:41:01 +0100 (CET)
Date: Fri, 26 Mar 2010 11:40:53 +0100 (CET)
From: Alexander Best 
Sender: 
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: Xin LI 
Message-ID: 
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary=+permail-2010032610405380e26a0b00002d60-a_best01+
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r205662 - in head/sys/boot/i386: boot2 gptboot
 zfsboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 10:41:16 -0000

  This is a MIME encoded multipart message.

--+permail-2010032610405380e26a0b00002d60-a_best01+
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

thanks a lot. :)

were the following changes to the bootstrap loader left out on purpose?

-- 
Alexander Best

--+permail-2010032610405380e26a0b00002d60-a_best01+
Content-Type: text/plain
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="loadermakefile.patch.txt"

SW5kZXg6IHN5cy9ib290L2kzODYvbG9hZGVyL01ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9i
b290L2kzODYvbG9hZGVyL01ha2VmaWxlCShyZXZpc2lvbiAyMDU2NTgpCisrKyBzeXMvYm9vdC9p
Mzg2L2xvYWRlci9NYWtlZmlsZQkod29ya2luZyBjb3B5KQpAQCAtNiw3ICs2LDcgQEAKIExPQURF
Uj89CWxvYWRlcgogUFJPRz0JCSR7TE9BREVSfS5zeW0KIElOVEVSTkFMUFJPRz0KLU5FV1ZFUlNX
SEFUPz0JImJvb3RzdHJhcCBsb2FkZXIiIGkzODYKK05FV1ZFUlNXSEFUPz0JImJvb3RzdHJhcCBs
b2FkZXIiIHg4NgogCiAjIGFyY2hpdGVjdHVyZS1zcGVjaWZpYyBsb2FkZXIgY29kZQogU1JDUz0J
CW1haW4uYyBjb25mLmMgdmVycy5jCg==

--+permail-2010032610405380e26a0b00002d60-a_best01+--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 11:02:01 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B733E106566C;
	Fri, 26 Mar 2010 11:02:01 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A60568FC15;
	Fri, 26 Mar 2010 11:02:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QB21lt025576;
	Fri, 26 Mar 2010 11:02:01 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QB21RF025573;
	Fri, 26 Mar 2010 11:02:01 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003261102.o2QB21RF025573@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 26 Mar 2010 11:02:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205681 - in head/sys/dev/usb: . quirk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 11:02:01 -0000

Author: netchild
Date: Fri Mar 26 11:02:01 2010
New Revision: 205681
URL: http://svn.freebsd.org/changeset/base/205681

Log:
  - add some usb devices (scanner, printer, usb storage)
  - add quirks for the usb storage
  
  Reviewed by:	hselasky

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- head/sys/dev/usb/quirk/usb_quirk.c	Fri Mar 26 10:18:19 2010	(r205680)
+++ head/sys/dev/usb/quirk/usb_quirk.c	Fri Mar 26 11:02:01 2010	(r205681)
@@ -227,6 +227,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI,
 	    UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */
+	USB_QUIRK(JMICRON, JM20336, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI,
 	    UQ_MSC_NO_SYNC_CACHE),
@@ -442,6 +443,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(ACTIONS, MP4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
+	USB_QUIRK(UNKNOWN4, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 };
 #undef USB_QUIRK_VP
 #undef USB_QUIRK

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Fri Mar 26 10:18:19 2010	(r205680)
+++ head/sys/dev/usb/usbdevs	Fri Mar 26 11:02:01 2010	(r205681)
@@ -58,6 +58,7 @@ $FreeBSD$
 vendor UNKNOWN1		0x0053	Unknown vendor
 vendor UNKNOWN2		0x0105	Unknown vendor
 vendor EGALAX2		0x0123	eGalax, Inc.
+vendor UNKNOWN4		0x0204	Unknown vendor
 vendor HUMAX		0x02ad	HUMAX
 vendor LTS		0x0386	LTS
 vendor BWCT		0x03da	Bernd Walter Computer Technology
@@ -1098,6 +1099,7 @@ product BROADCOM BCM2033	0x2033	BCM2033 
 
 /* Brother Industries products */
 product BROTHER HL1050		0x0002	HL-1050 laser printer
+product BROTHER MFC8600_9650	0x0100	MFC8600/9650 multifunction device
 
 /* Behavior Technology Computer products */
 product BTC BTC7932		0x6782	Keyboard with mouse port
@@ -1812,6 +1814,7 @@ product JABLOTRON PC60B		0x0001	PC-60B
 product JATON EDA		0x5704	Ethernet
 
 /* JMicron products */
+product JMICRON JM20336		0x2336	USB to SATA Bridge
 product JMICRON JM20337		0x2338	USB to ATA/ATAPI Bridge
 
 /* JVC products */
@@ -2127,6 +2130,7 @@ product MUSTEK 1200UB		0x0006	1200 UB sc
 product MUSTEK 1200USBPLUS	0x0007	1200 USB Plus scanner
 product MUSTEK 1200CUPLUS	0x0008	1200 CU Plus scanner
 product MUSTEK BEARPAW1200F	0x0010	BearPaw 1200F scanner
+product MUSTEK BEARPAW2400TA	0x0218	BearPaw 2400TA scanner
 product MUSTEK BEARPAW1200TA	0x021e	BearPaw 1200TA scanner
 product MUSTEK 600USB		0x0873	600 USB scanner
 product MUSTEK MDC800		0xa800	MDC-800 digital camera
@@ -3023,6 +3027,9 @@ product UMEDIA AR5523_2_NF	0x3206	AR5523
 /* Universal Access products */
 product UNIACCESS PANACHE	0x0101	Panache Surf USB ISDN Adapter
 
+/* Unknown vendors */
+product UNKNOWN4 USBMEMSTICK	0x6025	Flash Disk CBM
+
 /* U.S. Robotics products */
 product USR USR5423		0x0121	USR5423 WLAN
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 11:33:13 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 328EC106564A;
	Fri, 26 Mar 2010 11:33:13 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 222708FC22;
	Fri, 26 Mar 2010 11:33:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QBXDss032454;
	Fri, 26 Mar 2010 11:33:13 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QBXCn4032452;
	Fri, 26 Mar 2010 11:33:12 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201003261133.o2QBXCn4032452@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 26 Mar 2010 11:33:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205682 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 11:33:13 -0000

Author: jh
Date: Fri Mar 26 11:33:12 2010
New Revision: 205682
URL: http://svn.freebsd.org/changeset/base/205682

Log:
  Support only LOOKUP operation for "/" in relookup() because lookup()
  can't succeed for CREATE, DELETE and RENAME.
  
  Discussed with:	bde

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Fri Mar 26 11:02:01 2010	(r205681)
+++ head/sys/kern/vfs_lookup.c	Fri Mar 26 11:33:12 2010	(r205682)
@@ -948,19 +948,17 @@ relookup(struct vnode *dvp, struct vnode
 #endif
 
 	/*
-	 * Check for degenerate name (e.g. / or "")
-	 * which is a way of talking about a directory,
-	 * e.g. like "/." or ".".
+	 * Check for "" which represents the root directory after slash
+	 * removal.
 	 */
 	if (cnp->cn_nameptr[0] == '\0') {
-		if (cnp->cn_nameiop != LOOKUP || wantparent) {
-			error = EISDIR;
-			goto bad;
-		}
-		if (dp->v_type != VDIR) {
-			error = ENOTDIR;
-			goto bad;
-		}
+		/*
+		 * Support only LOOKUP for "/" because lookup()
+		 * can't succeed for CREATE, DELETE and RENAME.
+		 */
+		KASSERT(cnp->cn_nameiop == LOOKUP, ("nameiop must be LOOKUP"));
+		KASSERT(dp->v_type == VDIR, ("dp is not a directory"));
+
 		if (!(cnp->cn_flags & LOCKLEAF))
 			VOP_UNLOCK(dp, 0);
 		*vpp = dp;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 11:43:15 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC900106564A;
	Fri, 26 Mar 2010 11:43:15 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9ADB58FC1C;
	Fri, 26 Mar 2010 11:43:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QBhF9F034690;
	Fri, 26 Mar 2010 11:43:15 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QBhFhK034688;
	Fri, 26 Mar 2010 11:43:15 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003261143.o2QBhFhK034688@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 26 Mar 2010 11:43:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205683 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 11:43:15 -0000

Author: netchild
Date: Fri Mar 26 11:43:15 2010
New Revision: 205683
URL: http://svn.freebsd.org/changeset/base/205683

Log:
  Fix some bogus values in linprocfs.
  
  Submitted by:	Petr Salinger 
  Verified on:	GNU/kFreeBSD debian 8.0-1-686 (by submitter)
  PR:		144584

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:33:12 2010	(r205682)
+++ head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:43:15 2010	(r205683)
@@ -110,13 +110,36 @@ __FBSDID("$FreeBSD$");
 /*
  * Various conversion macros
  */
+
+/* The LINUX_USER_HZ is assumed 100 for now */
+
+#if defined(__i386__) && defined(__GNUCLIKE_ASM)
+/* we need intermediate result as 64 bit, otherwise it overflows too early */
+#define DO64_MULDIV(v,m,d)       \
+({                              \
+   unsigned long rv0;           \
+   unsigned long rv1;           \
+   __asm__ __volatile__(        \
+                "mull %1\n\t"   \
+                "divl %2\n\t"   \
+                :"=a" (rv0), "=d" (rv1) \
+                :"r" (d), "0" (v), "1" (m) \
+                :"cc" ); \
+  rv0; \
+})
+
+#define T2J(x) DO64_MULDIV((x), 100UL, (stathz ? stathz : hz)) /* ticks to jiffies */
+#else
 #define T2J(x) (((x) * 100UL) / (stathz ? stathz : hz))	/* ticks to jiffies */
+#endif
 #define T2S(x) ((x) / (stathz ? stathz : hz))		/* ticks to seconds */
 #define B2K(x) ((x) >> 10)				/* bytes to kbytes */
 #define B2P(x) ((x) >> PAGE_SHIFT)			/* bytes to pages */
 #define P2B(x) ((x) << PAGE_SHIFT)			/* pages to bytes */
 #define P2K(x) ((x) << (PAGE_SHIFT - 10))		/* pages to kbytes */
 
+#define TV2J(x)	(((x)->tv_sec) * 100UL + ((x)->tv_usec) / 10000)
+
 /**
  * @brief Mapping of ki_stat in struct kinfo_proc to the linux state
  *
@@ -502,12 +525,24 @@ linprocfs_douptime(PFS_FILL_ARGS)
 {
 	long cp_time[CPUSTATES];
 	struct timeval tv;
+	int cnt, i;
 
 	getmicrouptime(&tv);
 	read_cpu_time(cp_time);
-	sbuf_printf(sb, "%lld.%02ld %ld.%02ld\n",
+
+	for (cnt = 0, i = 0; i <= mp_maxid; ++i)
+		if (!(CPU_ABSENT(i)))
+		    cnt++;
+
+	if (!cnt)
+	    cnt = 1;
+
+	i = ((cp_time[CP_IDLE])/cnt) % (stathz ? stathz : hz);
+	i = (i * 100) / (stathz ? stathz : hz);
+
+	sbuf_printf(sb, "%lld.%02ld %ld.%02d\n",
 	    (long long)tv.tv_sec, tv.tv_usec / 10000,
-	    T2S(cp_time[CP_IDLE]), T2J(cp_time[CP_IDLE]) % 100);
+	    T2S((cp_time[CP_IDLE]/cnt)), i);
 	return (0);
 }
 
@@ -613,9 +648,17 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
 	struct kinfo_proc kp;
 	char state;
 	static int ratelimit = 0;
+	unsigned long startcode, startdata;
 
 	PROC_LOCK(p);
 	fill_kinfo_proc(p, &kp);
+	if (p->p_vmspace) {
+	   startcode = (unsigned long) p->p_vmspace->vm_taddr;
+	   startdata = (unsigned long) p->p_vmspace->vm_daddr;
+	} else {
+	   startcode = 0;
+	   startdata = 0;
+	};
 	sbuf_printf(sb, "%d", p->p_pid);
 #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg)
 	PS_ADD("comm",		"(%s)",	p->p_comm);
@@ -634,30 +677,27 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
 	PS_ADD("pgrp",		"%d",	p->p_pgid);
 	PS_ADD("session",	"%d",	p->p_session->s_sid);
 	PROC_UNLOCK(p);
-	PS_ADD("tty",		"%d",	0); /* XXX */
+	PS_ADD("tty",		"%d",	kp.ki_tdev);
 	PS_ADD("tpgid",		"%d",	kp.ki_tpgid);
 	PS_ADD("flags",		"%u",	0); /* XXX */
 	PS_ADD("minflt",	"%lu",	kp.ki_rusage.ru_minflt);
 	PS_ADD("cminflt",	"%lu",	kp.ki_rusage_ch.ru_minflt);
 	PS_ADD("majflt",	"%lu",	kp.ki_rusage.ru_majflt);
 	PS_ADD("cmajflt",	"%lu",	kp.ki_rusage_ch.ru_majflt);
-	PS_ADD("utime",		"%ld",	T2J(tvtohz(&kp.ki_rusage.ru_utime)));
-	PS_ADD("stime",		"%ld",	T2J(tvtohz(&kp.ki_rusage.ru_stime)));
-	PS_ADD("cutime",	"%ld",	T2J(tvtohz(&kp.ki_rusage_ch.ru_utime)));
-	PS_ADD("cstime",	"%ld",	T2J(tvtohz(&kp.ki_rusage_ch.ru_stime)));
+	PS_ADD("utime",		"%ld",	TV2J((&kp.ki_rusage.ru_utime)));
+	PS_ADD("stime",		"%ld",	TV2J((&kp.ki_rusage.ru_stime)));
+	PS_ADD("cutime",	"%ld",	TV2J((&kp.ki_rusage_ch.ru_utime)));
+	PS_ADD("cstime",	"%ld",	TV2J((&kp.ki_rusage_ch.ru_stime)));
 	PS_ADD("priority",	"%d",	kp.ki_pri.pri_user);
 	PS_ADD("nice",		"%d",	kp.ki_nice); /* 19 (nicest) to -19 */
 	PS_ADD("0",		"%d",	0); /* removed field */
 	PS_ADD("itrealvalue",	"%d",	0); /* XXX */
-	/* XXX: starttime is not right, it is the _same_ for _every_ process.
-	   It should be the number of jiffies between system boot and process
-	   start. */
-	PS_ADD("starttime",	"%lu",	T2J(tvtohz(&kp.ki_start)));
+	PS_ADD("starttime",	"%lu",	TV2J((&kp.ki_start)) - TV2J((&boottime)));
 	PS_ADD("vsize",		"%ju",	P2K((uintmax_t)kp.ki_size));
 	PS_ADD("rss",		"%ju",	(uintmax_t)kp.ki_rssize);
 	PS_ADD("rlim",		"%lu",	kp.ki_rusage.ru_maxrss);
-	PS_ADD("startcode",	"%u",	(unsigned)0);
-	PS_ADD("endcode",	"%u",	0); /* XXX */
+	PS_ADD("startcode",	"%lu",	startcode);
+	PS_ADD("endcode",	"%lu",	startdata);
 	PS_ADD("startstack",	"%u",	0); /* XXX */
 	PS_ADD("kstkesp",	"%u",	0); /* XXX */
 	PS_ADD("kstkeip",	"%u",	0); /* XXX */
@@ -800,7 +840,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS)
 	 */
 	sbuf_printf(sb, "VmSize:\t%8ju kB\n",	B2K((uintmax_t)kp.ki_size));
 	sbuf_printf(sb, "VmLck:\t%8u kB\n",	P2K(0)); /* XXX */
-	sbuf_printf(sb, "VmRss:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_rssize));
+	sbuf_printf(sb, "VmRSS:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_rssize));
 	sbuf_printf(sb, "VmData:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_dsize));
 	sbuf_printf(sb, "VmStk:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_ssize));
 	sbuf_printf(sb, "VmExe:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_tsize));

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 11:49:30 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 46EF91065670;
	Fri, 26 Mar 2010 11:49:30 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id CE8BD8FC13;
	Fri, 26 Mar 2010 11:49:29 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o2QBnP77022458
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 26 Mar 2010 13:49:25 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	o2QBnPjH086882; Fri, 26 Mar 2010 13:49:25 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o2QBnPlL086881; 
	Fri, 26 Mar 2010 13:49:25 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Fri, 26 Mar 2010 13:49:25 +0200
From: Kostik Belousov 
To: Alexander Leidinger 
Message-ID: <20100326114925.GS2415@deviant.kiev.zoral.com.ua>
References: <201003261143.o2QBhFhK034688@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="R+WA+n3pAWWgNWUs"
Content-Disposition: inline
In-Reply-To: <201003261143.o2QBhFhK034688@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205683 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 11:49:30 -0000


--R+WA+n3pAWWgNWUs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 26, 2010 at 11:43:15AM +0000, Alexander Leidinger wrote:
> Author: netchild
> Date: Fri Mar 26 11:43:15 2010
> New Revision: 205683
> URL: http://svn.freebsd.org/changeset/base/205683
>=20
> Log:
>   Fix some bogus values in linprocfs.
>  =20
>   Submitted by:	Petr Salinger 
>   Verified on:	GNU/kFreeBSD debian 8.0-1-686 (by submitter)
>   PR:		144584
>=20
> Modified:
>   head/sys/compat/linprocfs/linprocfs.c
>=20
> Modified: head/sys/compat/linprocfs/linprocfs.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:33:12 2010	(r2056=
82)
> +++ head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:43:15 2010	(r2056=
83)
> @@ -110,13 +110,36 @@ __FBSDID("$FreeBSD$");
>  /*
>   * Various conversion macros
>   */
> +
> +/* The LINUX_USER_HZ is assumed 100 for now */
> +
> +#if defined(__i386__) && defined(__GNUCLIKE_ASM)
> +/* we need intermediate result as 64 bit, otherwise it overflows too ear=
ly */
> +#define DO64_MULDIV(v,m,d)       \
> +({                              \
> +   unsigned long rv0;           \
> +   unsigned long rv1;           \
> +   __asm__ __volatile__(        \
> +                "mull %1\n\t"   \
> +                "divl %2\n\t"   \
> +                :"=3Da" (rv0), "=3Dd" (rv1) \
> +                :"r" (d), "0" (v), "1" (m) \
> +                :"cc" ); \
> +  rv0; \
> +})

Why it is impossible to express the calculation in C ?

--R+WA+n3pAWWgNWUs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkusn0QACgkQC3+MBN1Mb4ho4wCg1UBNY2v9VC6QDpzHGFv7RHqH
RYoAoNU3Z4R5BNy8HQjeuTjWtm8E1ibC
=JYT5
-----END PGP SIGNATURE-----

--R+WA+n3pAWWgNWUs--

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 12:56:03 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 811811065673;
	Fri, 26 Mar 2010 12:56:03 +0000 (UTC)
	(envelope-from netchild@freebsd.org)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 30B518FC19;
	Fri, 26 Mar 2010 12:56:02 +0000 (UTC)
Received: from outgoing.leidinger.net (pD9E2C1F3.dip.t-dialin.net
	[217.226.193.243])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 5B40F844054;
	Fri, 26 Mar 2010 13:36:21 +0100 (CET)
Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102])
	by outgoing.leidinger.net (Postfix) with ESMTP id EC412512C;
	Fri, 26 Mar 2010 13:36:17 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o2QCaHXZ055211;
	Fri, 26 Mar 2010 13:36:17 +0100 (CET)
	(envelope-from netchild@FreeBSD.org)
Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Fri, 26 Mar 2010
	13:36:17 +0100
Message-ID: <20100326133617.34413032k064412c@webmail.leidinger.net>
Date: Fri, 26 Mar 2010 13:36:17 +0100
From: Alexander Leidinger 
To: Kostik Belousov , Petr Salinger
	
References: <201003261143.o2QBhFhK034688@svn.freebsd.org>
	<20100326114925.GS2415@deviant.kiev.zoral.com.ua>
In-Reply-To: <20100326114925.GS2415@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: 5B40F844054.AF25A
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=-1.363, required 6,
	autolearn=disabled, ALL_TRUSTED -1.44, TW_SV 0.08)
X-EBL-MailScanner-From: netchild@freebsd.org
X-EBL-MailScanner-Watermark: 1270211782.3622@cXXEANNTM9oCBNhXSYnK+A
X-EBL-Spam-Status: No
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r205683 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 12:56:03 -0000

Quoting Kostik Belousov  (from Fri, 26 Mar 2010  
13:49:25 +0200):

> On Fri, Mar 26, 2010 at 11:43:15AM +0000, Alexander Leidinger wrote:
>> Author: netchild
>> Date: Fri Mar 26 11:43:15 2010
>> New Revision: 205683
>> URL: http://svn.freebsd.org/changeset/base/205683
>>
>> Log:
>>   Fix some bogus values in linprocfs.
>>
>>   Submitted by:	Petr Salinger 
>>   Verified on:	GNU/kFreeBSD debian 8.0-1-686 (by submitter)
>>   PR:		144584
>>
>> Modified:
>>   head/sys/compat/linprocfs/linprocfs.c
>>
>> Modified: head/sys/compat/linprocfs/linprocfs.c
>> ==============================================================================
>> --- head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:33:12 2010	(r205682)
>> +++ head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:43:15 2010	(r205683)
>> @@ -110,13 +110,36 @@ __FBSDID("$FreeBSD$");
>>  /*
>>   * Various conversion macros
>>   */
>> +
>> +/* The LINUX_USER_HZ is assumed 100 for now */
>> +
>> +#if defined(__i386__) && defined(__GNUCLIKE_ASM)
>> +/* we need intermediate result as 64 bit, otherwise it overflows  
>> too early */
>> +#define DO64_MULDIV(v,m,d)       \
>> +({                              \
>> +   unsigned long rv0;           \
>> +   unsigned long rv1;           \
>> +   __asm__ __volatile__(        \
>> +                "mull %1\n\t"   \
>> +                "divl %2\n\t"   \
>> +                :"=a" (rv0), "=d" (rv1) \
>> +                :"r" (d), "0" (v), "1" (m) \
>> +                :"cc" ); \
>> +  rv0; \
>> +})
>
> Why it is impossible to express the calculation in C ?

You forgot to CC the submitter... CCed.

What do you have in mind, (unsinged long)((uint64_t)v * (uint64_t)m /  
(uint64_t)d)? Conditionally on the architecture or not?

Bye,
Alexander.

-- 
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
When reviewing your notes before an exam, the most
important ones will be illegible.


From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 12:59:15 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD645106566B;
	Fri, 26 Mar 2010 12:59:15 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD7B58FC17;
	Fri, 26 Mar 2010 12:59:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QCxFe8051657;
	Fri, 26 Mar 2010 12:59:15 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QCxF2b051655;
	Fri, 26 Mar 2010 12:59:15 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201003261259.o2QCxF2b051655@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Fri, 26 Mar 2010 12:59:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205686 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 12:59:15 -0000

Author: des
Date: Fri Mar 26 12:59:15 2010
New Revision: 205686
URL: http://svn.freebsd.org/changeset/base/205686

Log:
  Tighten my grip on pseudofs, procfs, linprocfs.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==============================================================================
--- head/MAINTAINERS	Fri Mar 26 12:53:46 2010	(r205685)
+++ head/MAINTAINERS	Fri Mar 26 12:59:15 2010	(r205686)
@@ -57,9 +57,9 @@ libfetch	des	Advance notification reques
 fetch		des	Advance notification requested.
 libpam		des	Pre-commit review requested.
 openssh		des	Pre-commit review requested.
-pseudofs	des	Advance notification requested.
-procfs		des	Advance notification requested.
-linprocfs	des	Advance notification requested.
+pseudofs	des	Pre-commit review requested.
+procfs		des	Pre-commit review requested.
+linprocfs	des	Pre-commit review requested.
 lpr		gad	Pre-commit review requested, particularly for
 			lpd/recvjob.c and lpd/printjob.c.
 newsyslog(8)	gad	Heads-up appreciated.  I'm going thru the PR's for it.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 13:37:46 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B7E6D1065670;
	Fri, 26 Mar 2010 13:37:46 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 89A3A8FC1A;
	Fri, 26 Mar 2010 13:37:46 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 293F946B29;
	Fri, 26 Mar 2010 09:37:46 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 6561B8A01F;
	Fri, 26 Mar 2010 09:37:45 -0400 (EDT)
From: John Baldwin 
To: Xin LI 
Date: Fri, 26 Mar 2010 07:40:21 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003260130.o2Q1Usjd095276@svn.freebsd.org>
In-Reply-To: <201003260130.o2Q1Usjd095276@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201003260740.21414.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Fri, 26 Mar 2010 09:37:45 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205662 - in head/sys/boot/i386: boot2 gptboot
	zfsboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 13:37:46 -0000

On Thursday 25 March 2010 9:30:54 pm Xin LI wrote:
> Author: delphij
> Date: Fri Mar 26 01:30:53 2010
> New Revision: 205662
> URL: http://svn.freebsd.org/changeset/base/205662
> 
> Log:
>   Our boot loader is capable of booting both i386 and amd64 kernels so
>   call it "x86" instead of "i386".
>   
>   Suggested by:	jhb in response to Alexander Best's loader proposal
>   MFC after:	1 month

I think NEWVERSWHAT in sys/boot/i386/{zfs,}loader/Makefile also needs to be 
changed.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 13:37:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1255106564A;
	Fri, 26 Mar 2010 13:37:50 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C3848FC19;
	Fri, 26 Mar 2010 13:37:50 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id E7EFF46B29;
	Fri, 26 Mar 2010 09:37:49 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id B63E38A026;
	Fri, 26 Mar 2010 09:37:48 -0400 (EDT)
From: John Baldwin 
To: Alexander Leidinger 
Date: Fri, 26 Mar 2010 09:37:09 -0400
User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; )
References: <201003261143.o2QBhFhK034688@svn.freebsd.org>
In-Reply-To: <201003261143.o2QBhFhK034688@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201003260937.09848.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Fri, 26 Mar 2010 09:37:48 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205683 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 13:37:50 -0000

On Friday 26 March 2010 7:43:15 am Alexander Leidinger wrote:
> Author: netchild
> Date: Fri Mar 26 11:43:15 2010
> New Revision: 205683
> URL: http://svn.freebsd.org/changeset/base/205683
> 
> Log:
>   Fix some bogus values in linprocfs.
>   
>   Submitted by:	Petr Salinger 
>   Verified on:	GNU/kFreeBSD debian 8.0-1-686 (by submitter)
>   PR:		144584
> 
> Modified:
>   head/sys/compat/linprocfs/linprocfs.c
> 
> Modified: head/sys/compat/linprocfs/linprocfs.c
> 
==============================================================================
> --- head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:33:12 2010	(r205682)
> +++ head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 11:43:15 2010	(r205683)
> @@ -110,13 +110,36 @@ __FBSDID("$FreeBSD$");
>  /*
>   * Various conversion macros
>   */
> +
> +/* The LINUX_USER_HZ is assumed 100 for now */
> +
> +#if defined(__i386__) && defined(__GNUCLIKE_ASM)
> +/* we need intermediate result as 64 bit, otherwise it overflows too early 
*/
> +#define DO64_MULDIV(v,m,d)       \
> +({                              \
> +   unsigned long rv0;           \
> +   unsigned long rv1;           \
> +   __asm__ __volatile__(        \
> +                "mull %1\n\t"   \
> +                "divl %2\n\t"   \
> +                :"=a" (rv0), "=d" (rv1) \
> +                :"r" (d), "0" (v), "1" (m) \
> +                :"cc" ); \
> +  rv0; \
> +})
> +
> +#define T2J(x) DO64_MULDIV((x), 100UL, (stathz ? stathz : hz)) /* ticks to 
jiffies */
> +#else
>  #define T2J(x) (((x) * 100UL) / (stathz ? stathz : hz))	/* ticks to jiffies 
*/
> +#endif

This is very bogus.  Just use a uint64_t cast or the like.

Extraneous ()'s around (x)->tv_sec and (x)->tv_usec in TV2J() as well.

> @@ -502,12 +525,24 @@ linprocfs_douptime(PFS_FILL_ARGS)
>  {
>  	long cp_time[CPUSTATES];
>  	struct timeval tv;
> +	int cnt, i;
>  
>  	getmicrouptime(&tv);
>  	read_cpu_time(cp_time);
> -	sbuf_printf(sb, "%lld.%02ld %ld.%02ld\n",
> +
> +	for (cnt = 0, i = 0; i <= mp_maxid; ++i)
> +		if (!(CPU_ABSENT(i)))
> +		    cnt++;
> +
> +	if (!cnt)
> +	    cnt = 1;
> +
> +	i = ((cp_time[CP_IDLE])/cnt) % (stathz ? stathz : hz);
> +	i = (i * 100) / (stathz ? stathz : hz);
> +
> +	sbuf_printf(sb, "%lld.%02ld %ld.%02d\n",
>  	    (long long)tv.tv_sec, tv.tv_usec / 10000,
> -	    T2S(cp_time[CP_IDLE]), T2J(cp_time[CP_IDLE]) % 100);
> +	    T2S((cp_time[CP_IDLE]/cnt)), i);
>  	return (0);

What's wrong with mp_ncpus?

Also, I don't understand how the machinations for i vs the original code 
(assuming you add in a divisor of the raw cp_time by mp_ncpus) give a 
different value.

> @@ -613,9 +648,17 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
>  	struct kinfo_proc kp;
>  	char state;
>  	static int ratelimit = 0;
> +	unsigned long startcode, startdata;

Why not make these a vm_offset_t and then print them with %j?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 14:29:58 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8A19C106567B;
	Fri, 26 Mar 2010 14:29:58 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 79A4A8FC20;
	Fri, 26 Mar 2010 14:29:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QETw8i072126;
	Fri, 26 Mar 2010 14:29:58 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QETwWQ072124;
	Fri, 26 Mar 2010 14:29:58 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003261429.o2QETwWQ072124@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 26 Mar 2010 14:29:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205693 - head/usr.sbin/pmcstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 14:29:58 -0000

Author: fabient
Date: Fri Mar 26 14:29:57 2010
New Revision: 205693
URL: http://svn.freebsd.org/changeset/base/205693

Log:
  Do not overflow the term in the case of multi-line display.
  
  MFC after: 3days

Modified:
  head/usr.sbin/pmcstat/pmcpl_calltree.c

Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcpl_calltree.c	Fri Mar 26 14:08:21 2010	(r205692)
+++ head/usr.sbin/pmcstat/pmcpl_calltree.c	Fri Mar 26 14:29:57 2010	(r205693)
@@ -366,7 +366,7 @@ pmcpl_ct_node_cleartag(void)
 
 static int
 pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct,
-    struct pmcpl_ct_sample *rsamples, int x, int *y)
+    struct pmcpl_ct_sample *rsamples, int x, int *y, int maxy)
 {
 	int i;
 
@@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 	if (ct->pct_narc == 0) {
 		pmcpl_ct_topscreen[x+1][*y] = NULL;
 		if (*y >= PMCPL_CT_MAXLINE ||
-		    *y >= pmcstat_displayheight)
+		    *y >= maxy)
 			return 1;
 		*y = *y + 1;
 		for (i=0; i < x; i++)
@@ -407,7 +407,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 		    &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) {
 			if (pmcpl_ct_node_dumptop(pmcin,
 			        ct->pct_arc[i].pcta_child,
-			        rsamples, x+1, y))
+			        rsamples, x+1, y, maxy))
 				return 1;
 		}
 	}
@@ -472,6 +472,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 			/* Check for line wrap. */
 			width += ns_len + is_len + vs_len + 1;
 			if (width >= pmcstat_displaywidth) {
+				maxy--;
+				if (y >= maxy)
+					break;
 				PMCSTAT_PRINTW("\n%*s", indentwidth, space);
 				width = indentwidth + ns_len + is_len + vs_len;
 			}
@@ -515,7 +518,7 @@ pmcpl_ct_topdisplay(void)
 		for (i = 0; i < pmcpl_ct_root->pct_narc; i++) {
 			if (pmcpl_ct_node_dumptop(pmcin,
 			        pmcpl_ct_root->pct_arc[i].pcta_child,
-			        &rsamples, x, &y)) {
+			        &rsamples, x, &y, pmcstat_displayheight - 2)) {
 				break;
 			}
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 14:35:48 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 623E01065674;
	Fri, 26 Mar 2010 14:35:48 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 520308FC08;
	Fri, 26 Mar 2010 14:35:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QEZmDv073444;
	Fri, 26 Mar 2010 14:35:48 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QEZmv5073442;
	Fri, 26 Mar 2010 14:35:48 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003261435.o2QEZmv5073442@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 26 Mar 2010 14:35:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205694 - head/sys/dev/hwpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 14:35:48 -0000

Author: fabient
Date: Fri Mar 26 14:35:48 2010
New Revision: 205694
URL: http://svn.freebsd.org/changeset/base/205694

Log:
  Handling SIGPIPE will cause deadlock/crash.
  Return an error immediatly in case of hard shutdown.
  
  MFC after: 3days

Modified:
  head/sys/dev/hwpmc/hwpmc_logging.c

Modified: head/sys/dev/hwpmc/hwpmc_logging.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_logging.c	Fri Mar 26 14:29:57 2010	(r205693)
+++ head/sys/dev/hwpmc/hwpmc_logging.c	Fri Mar 26 14:35:48 2010	(r205694)
@@ -298,7 +298,6 @@ pmclog_loop(void *arg)
 
 		mtx_unlock(&pmc_kthread_mtx);
 
-sigpipe_retry:
 		/* process the request */
 		PMCDBG(LOG,WRI,2, "po=%p base=%p ptr=%p", po,
 		    lb->plb_base, lb->plb_ptr);
@@ -322,9 +321,6 @@ sigpipe_retry:
 
 		if (error) {
 			/* XXX some errors are recoverable */
-			if (error == EPIPE)
-				goto sigpipe_retry;
-
 			/* send a SIGIO to the owner and exit */
 			PROC_LOCK(p);
 			psignal(p, SIGIO);

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 14:36:17 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0303E1065676;
	Fri, 26 Mar 2010 14:36:17 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E5FFB8FC12;
	Fri, 26 Mar 2010 14:36:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QEaGIt073590;
	Fri, 26 Mar 2010 14:36:16 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QEaG2d073588;
	Fri, 26 Mar 2010 14:36:16 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201003261436.o2QEaG2d073588@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 26 Mar 2010 14:36:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205695 - head/sys/compat/linprocfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 14:36:17 -0000

Author: netchild
Date: Fri Mar 26 14:36:16 2010
New Revision: 205695
URL: http://svn.freebsd.org/changeset/base/205695

Log:
  Revert r205683 to resolve some code quality issues which do not affect the
  build or use of linprocfs, before committing the reworked patch again.
  
  Requested by:	des

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 14:35:48 2010	(r205694)
+++ head/sys/compat/linprocfs/linprocfs.c	Fri Mar 26 14:36:16 2010	(r205695)
@@ -110,36 +110,13 @@ __FBSDID("$FreeBSD$");
 /*
  * Various conversion macros
  */
-
-/* The LINUX_USER_HZ is assumed 100 for now */
-
-#if defined(__i386__) && defined(__GNUCLIKE_ASM)
-/* we need intermediate result as 64 bit, otherwise it overflows too early */
-#define DO64_MULDIV(v,m,d)       \
-({                              \
-   unsigned long rv0;           \
-   unsigned long rv1;           \
-   __asm__ __volatile__(        \
-                "mull %1\n\t"   \
-                "divl %2\n\t"   \
-                :"=a" (rv0), "=d" (rv1) \
-                :"r" (d), "0" (v), "1" (m) \
-                :"cc" ); \
-  rv0; \
-})
-
-#define T2J(x) DO64_MULDIV((x), 100UL, (stathz ? stathz : hz)) /* ticks to jiffies */
-#else
 #define T2J(x) (((x) * 100UL) / (stathz ? stathz : hz))	/* ticks to jiffies */
-#endif
 #define T2S(x) ((x) / (stathz ? stathz : hz))		/* ticks to seconds */
 #define B2K(x) ((x) >> 10)				/* bytes to kbytes */
 #define B2P(x) ((x) >> PAGE_SHIFT)			/* bytes to pages */
 #define P2B(x) ((x) << PAGE_SHIFT)			/* pages to bytes */
 #define P2K(x) ((x) << (PAGE_SHIFT - 10))		/* pages to kbytes */
 
-#define TV2J(x)	(((x)->tv_sec) * 100UL + ((x)->tv_usec) / 10000)
-
 /**
  * @brief Mapping of ki_stat in struct kinfo_proc to the linux state
  *
@@ -525,24 +502,12 @@ linprocfs_douptime(PFS_FILL_ARGS)
 {
 	long cp_time[CPUSTATES];
 	struct timeval tv;
-	int cnt, i;
 
 	getmicrouptime(&tv);
 	read_cpu_time(cp_time);
-
-	for (cnt = 0, i = 0; i <= mp_maxid; ++i)
-		if (!(CPU_ABSENT(i)))
-		    cnt++;
-
-	if (!cnt)
-	    cnt = 1;
-
-	i = ((cp_time[CP_IDLE])/cnt) % (stathz ? stathz : hz);
-	i = (i * 100) / (stathz ? stathz : hz);
-
-	sbuf_printf(sb, "%lld.%02ld %ld.%02d\n",
+	sbuf_printf(sb, "%lld.%02ld %ld.%02ld\n",
 	    (long long)tv.tv_sec, tv.tv_usec / 10000,
-	    T2S((cp_time[CP_IDLE]/cnt)), i);
+	    T2S(cp_time[CP_IDLE]), T2J(cp_time[CP_IDLE]) % 100);
 	return (0);
 }
 
@@ -648,17 +613,9 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
 	struct kinfo_proc kp;
 	char state;
 	static int ratelimit = 0;
-	unsigned long startcode, startdata;
 
 	PROC_LOCK(p);
 	fill_kinfo_proc(p, &kp);
-	if (p->p_vmspace) {
-	   startcode = (unsigned long) p->p_vmspace->vm_taddr;
-	   startdata = (unsigned long) p->p_vmspace->vm_daddr;
-	} else {
-	   startcode = 0;
-	   startdata = 0;
-	};
 	sbuf_printf(sb, "%d", p->p_pid);
 #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg)
 	PS_ADD("comm",		"(%s)",	p->p_comm);
@@ -677,27 +634,30 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
 	PS_ADD("pgrp",		"%d",	p->p_pgid);
 	PS_ADD("session",	"%d",	p->p_session->s_sid);
 	PROC_UNLOCK(p);
-	PS_ADD("tty",		"%d",	kp.ki_tdev);
+	PS_ADD("tty",		"%d",	0); /* XXX */
 	PS_ADD("tpgid",		"%d",	kp.ki_tpgid);
 	PS_ADD("flags",		"%u",	0); /* XXX */
 	PS_ADD("minflt",	"%lu",	kp.ki_rusage.ru_minflt);
 	PS_ADD("cminflt",	"%lu",	kp.ki_rusage_ch.ru_minflt);
 	PS_ADD("majflt",	"%lu",	kp.ki_rusage.ru_majflt);
 	PS_ADD("cmajflt",	"%lu",	kp.ki_rusage_ch.ru_majflt);
-	PS_ADD("utime",		"%ld",	TV2J((&kp.ki_rusage.ru_utime)));
-	PS_ADD("stime",		"%ld",	TV2J((&kp.ki_rusage.ru_stime)));
-	PS_ADD("cutime",	"%ld",	TV2J((&kp.ki_rusage_ch.ru_utime)));
-	PS_ADD("cstime",	"%ld",	TV2J((&kp.ki_rusage_ch.ru_stime)));
+	PS_ADD("utime",		"%ld",	T2J(tvtohz(&kp.ki_rusage.ru_utime)));
+	PS_ADD("stime",		"%ld",	T2J(tvtohz(&kp.ki_rusage.ru_stime)));
+	PS_ADD("cutime",	"%ld",	T2J(tvtohz(&kp.ki_rusage_ch.ru_utime)));
+	PS_ADD("cstime",	"%ld",	T2J(tvtohz(&kp.ki_rusage_ch.ru_stime)));
 	PS_ADD("priority",	"%d",	kp.ki_pri.pri_user);
 	PS_ADD("nice",		"%d",	kp.ki_nice); /* 19 (nicest) to -19 */
 	PS_ADD("0",		"%d",	0); /* removed field */
 	PS_ADD("itrealvalue",	"%d",	0); /* XXX */
-	PS_ADD("starttime",	"%lu",	TV2J((&kp.ki_start)) - TV2J((&boottime)));
+	/* XXX: starttime is not right, it is the _same_ for _every_ process.
+	   It should be the number of jiffies between system boot and process
+	   start. */
+	PS_ADD("starttime",	"%lu",	T2J(tvtohz(&kp.ki_start)));
 	PS_ADD("vsize",		"%ju",	P2K((uintmax_t)kp.ki_size));
 	PS_ADD("rss",		"%ju",	(uintmax_t)kp.ki_rssize);
 	PS_ADD("rlim",		"%lu",	kp.ki_rusage.ru_maxrss);
-	PS_ADD("startcode",	"%lu",	startcode);
-	PS_ADD("endcode",	"%lu",	startdata);
+	PS_ADD("startcode",	"%u",	(unsigned)0);
+	PS_ADD("endcode",	"%u",	0); /* XXX */
 	PS_ADD("startstack",	"%u",	0); /* XXX */
 	PS_ADD("kstkesp",	"%u",	0); /* XXX */
 	PS_ADD("kstkeip",	"%u",	0); /* XXX */
@@ -840,7 +800,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS)
 	 */
 	sbuf_printf(sb, "VmSize:\t%8ju kB\n",	B2K((uintmax_t)kp.ki_size));
 	sbuf_printf(sb, "VmLck:\t%8u kB\n",	P2K(0)); /* XXX */
-	sbuf_printf(sb, "VmRSS:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_rssize));
+	sbuf_printf(sb, "VmRss:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_rssize));
 	sbuf_printf(sb, "VmData:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_dsize));
 	sbuf_printf(sb, "VmStk:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_ssize));
 	sbuf_printf(sb, "VmExe:\t%8ju kB\n",	P2K((uintmax_t)kp.ki_tsize));

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 15:13:31 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C12EA1065676;
	Fri, 26 Mar 2010 15:13:31 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AECB68FC2A;
	Fri, 26 Mar 2010 15:13:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QFDVPc081987;
	Fri, 26 Mar 2010 15:13:31 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QFDVfO081982;
	Fri, 26 Mar 2010 15:13:31 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201003261513.o2QFDVfO081982@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 26 Mar 2010 15:13:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205698 - head/sys/dev/isp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 15:13:31 -0000

Author: mjacob
Date: Fri Mar 26 15:13:31 2010
New Revision: 205698
URL: http://svn.freebsd.org/changeset/base/205698

Log:
  Clean up some printing stuff so that we can have a bit finer control
  on debug output. Add a new platform function requirement to allow
  for printing based upon the ITL nexus instead of the isp unit plus
  channel, target and lun. This allows some printouts and error messages
  from the core code to appear in the same format as the platform's
  subsystem (in FreeBSD's case, CAM path).
  
  MFC after:	1 week

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==============================================================================
--- head/sys/dev/isp/isp.c	Fri Mar 26 14:52:58 2010	(r205697)
+++ head/sys/dev/isp/isp.c	Fri Mar 26 15:13:31 2010	(r205698)
@@ -74,14 +74,9 @@ __FBSDID("$FreeBSD$");
  */
 static const char fconf[] = "Chan %d PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)";
 static const char notresp[] = "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d";
-static const char xact1[] = "HBA attempted queued transaction with disconnect not set for %d.%d.%d";
-static const char xact2[] = "HBA attempted queued transaction to target routine %d on target %d bus %d";
-static const char xact3[] = "HBA attempted queued cmd for %d.%d.%d when queueing disabled";
-static const char pskip[] = "SCSI phase skipped for target %d.%d.%d";
 static const char topology[] = "Chan %d WWPN 0x%08x%08x PortID 0x%06x N-Port Handle %d, Connection '%s'";
-static const char finmsg[] = "%d.%d.%d: FIN dl%d resid %ld STS 0x%x SKEY %c XS_ERR=0x%x";
 static const char sc4[] = "NVRAM";
-static const char bun[] = "bad underrun for %d.%d (count %d, resid %d, status %s)";
+static const char bun[] = "bad underrun (count %d, resid %d, status %s)";
 static const char lipd[] = "Chan %d LIP destroyed %d active commands";
 static const char sacq[] = "unable to acquire scratch area";
 
@@ -107,6 +102,7 @@ static const uint8_t alpa_map[] = {
 /*
  * Local function prototypes.
  */
+static void isp_prt_endcmd(ispsoftc_t *, XS_T *);
 static int isp_parse_async(ispsoftc_t *, uint16_t);
 static int isp_parse_async_fc(ispsoftc_t *, uint16_t);
 static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *);
@@ -1431,10 +1427,8 @@ isp_scsi_channel_init(ispsoftc_t *isp, i
 			    (sdp->isp_devparam[tgt].goal_offset << 8) |
 			    (sdp->isp_devparam[tgt].goal_period);
 		}
-		isp_prt(isp, ISP_LOGDEBUG0,
-		    "Initial Settings bus%d tgt%d flags 0x%x off 0x%x per 0x%x",
-		    chan, tgt, mbs.param[2], mbs.param[3] >> 8,
-		    mbs.param[3] & 0xff);
+		isp_prt(isp, ISP_LOGDEBUG0, "Initial Settings bus%d tgt%d flags 0x%x off 0x%x per 0x%x",
+		    chan, tgt, mbs.param[2], mbs.param[3] >> 8, mbs.param[3] & 0xff);
 		isp_mboxcmd(isp, &mbs);
 		if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
 			sdf = DPARM_SAFE_DFLT;
@@ -1705,8 +1699,7 @@ isp_fibre_init(ispsoftc_t *isp)
 		isp_prt(isp, ISP_LOGERR, sacq);
 		return;
 	}
-	isp_prt(isp, ISP_LOGDEBUG0,
-	    "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x",
+	isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x",
 	    icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions);
 
 	isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch);
@@ -4435,7 +4428,7 @@ isp_start(XS_T *xs)
 		 */
 		return (dmaresult);
 	}
-	isp_prt(isp, ISP_LOGDEBUG0, "START cmd for %d.%d.%d cmd 0x%x datalen %ld", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), XS_CDBP(xs)[0], (long) XS_XFRLEN(xs));
+	isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "START cmd cdb[0]=0x%x datalen %ld", XS_CDBP(xs)[0], (long) XS_XFRLEN(xs));
 	isp->isp_nactive++;
 	return (CMD_QUEUED);
 }
@@ -5248,7 +5241,7 @@ again:
 				} else {
 					ptr = rnames[resp[FCP_RSPNS_CODE_OFFSET]];
 				}
-				isp_prt(isp, ISP_LOGWARN, "%d.%d.%d FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), rlen, ptr, XS_CDBP(xs)[0] & 0xff);
+				isp_xs_prt(isp, xs, ISP_LOGWARN, "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", rlen, ptr, XS_CDBP(xs)[0] & 0xff);
 				if (resp[FCP_RSPNS_CODE_OFFSET] != 0) {
 					XS_SETERR(xs, HBA_BOTCH);
 				}
@@ -5325,25 +5318,9 @@ again:
 		isp_destroy_handle(isp, sp->req_handle);
 
 		if (((isp->isp_dblev & (ISP_LOGDEBUG1|ISP_LOGDEBUG2|ISP_LOGDEBUG3))) ||
-		    ((isp->isp_dblev & ISP_LOGDEBUG0) && ((!XS_NOERR(xs)) ||
-		    (*XS_STSP(xs) != SCSI_GOOD)))) {
-			char skey;
-			if (req_state_flags & RQSF_GOT_SENSE) {
-				skey = XS_SNSKEY(xs) & 0xf;
-				if (skey < 10)
-					skey += '0';
-				else
-					skey += 'a' - 10;
-			} else if (*XS_STSP(xs) == SCSI_CHECK) {
-				skey = '?';
-			} else {
-				skey = '.';
-			}
-			isp_prt(isp, ISP_LOGALL, finmsg, XS_CHANNEL(xs),
-			    XS_TGT(xs), XS_LUN(xs), XS_XFRLEN(xs), (long) XS_GET_RESID(xs),
-			    *XS_STSP(xs), skey, XS_ERR(xs));
+		    ((isp->isp_dblev & (ISP_LOGDEBUG0|ISP_LOG_CWARN) && ((!XS_NOERR(xs)) || (*XS_STSP(xs) != SCSI_GOOD))))) {
+			isp_prt_endcmd(isp, xs);
 		}
-
 		if (isp->isp_nactive > 0) {
 		    isp->isp_nactive--;
 		}
@@ -5393,6 +5370,25 @@ out:
  * Support routines.
  */
 
+static void
+isp_prt_endcmd(ispsoftc_t *isp, XS_T *xs)
+{
+	char cdbstr[16 * 5 + 1];
+	int i, lim;
+
+	lim = XS_CDBLEN(xs) > 16? 16 : XS_CDBLEN(xs);
+	ISP_SNPRINTF(cdbstr, sizeof (cdbstr), "0x%02x ", XS_CDBP(xs)[0]);
+	for (i = 1; i < lim; i++) {
+		ISP_SNPRINTF(cdbstr, sizeof (cdbstr), "%s0x%02x ", cdbstr, XS_CDBP(xs)[i]);
+	}
+	if (XS_SENSE_VALID(xs)) {
+		isp_xs_prt(isp, xs, ISP_LOGALL, "FIN dl%d resid %ld CDB=%s KEY/ASC/ASCQ=0x%02x/0x%02x/0x%02x",
+		    XS_XFRLEN(xs), (long) XS_GET_RESID(xs), cdbstr, XS_SNSKEY(xs), XS_SNSASC(xs), XS_SNSASCQ(xs));
+	} else {
+		isp_xs_prt(isp, xs, ISP_LOGALL, "FIN dl%d resid %ld CDB=%s STS 0x%x XS_ERR=0x%x", XS_XFRLEN(xs), (long) XS_GET_RESID(xs), cdbstr, *XS_STSP(xs), XS_ERR(xs));
+	}
+}
+
 /*
  * Parse an ASYNC mailbox complete
  *
@@ -5937,8 +5933,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
  */
 
 static int
-isp_handle_other_response(ispsoftc_t *isp, int type,
-    isphdr_t *hp, uint32_t *optrp)
+isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *optrp)
 {
 	switch (type) {
 	case RQSTYPE_STATUS_CONT:
@@ -6010,24 +6005,18 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 
 	case RQCS_INCOMPLETE:
 		if ((sp->req_state_flags & RQSF_GOT_TARGET) == 0) {
-			isp_prt(isp, ISP_LOGDEBUG1,
-			    "Selection Timeout for %d.%d.%d",
-			    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+			isp_xs_prt(isp, xs, ISP_LOGDEBUG1, "Selection Timeout");
 			if (XS_NOERR(xs)) {
 				XS_SETERR(xs, HBA_SELTIMEOUT);
 				*rp = XS_XFRLEN(xs);
 			}
 			return;
 		}
-		isp_prt(isp, ISP_LOGERR,
-		    "command incomplete for %d.%d.%d, state 0x%x",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs),
-		    sp->req_state_flags);
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Command Incomplete, state 0x%x", sp->req_state_flags);
 		break;
 
 	case RQCS_DMA_ERROR:
-		isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "DMA Error");
 		*rp = XS_XFRLEN(xs);
 		break;
 
@@ -6081,18 +6070,14 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		if (sp->req_status_flags & RQSTF_NEGOTIATION) {
 			ISP_SNPRINTF(buf, sizeof (buf), "%s Negotiation", buf);
 		}
-		isp_prt(isp, ISP_LOGERR, "%s", buf);
-		isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d:\n%s",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), buf);
+		isp_xs_prt(isp, xs,  ISP_LOGERR, "Transport Error: %s", buf);
 		*rp = XS_XFRLEN(xs);
 		break;
 	}
 	case RQCS_RESET_OCCURRED:
 	{
 		int chan;
-		isp_prt(isp, ISP_LOGWARN,
-		    "bus reset destroyed command for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGWARN, "Bus Reset destroyed command");
 		for (chan = 0; chan < isp->isp_nchan; chan++) {
 			FCPARAM(isp, chan)->sendmarker = 1;
 		}
@@ -6103,8 +6088,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		return;
 	}
 	case RQCS_ABORTED:
-		isp_prt(isp, ISP_LOGERR, "command aborted for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Command Aborted");
 		ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1);
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_ABORTED);
@@ -6112,8 +6096,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		return;
 
 	case RQCS_TIMEOUT:
-		isp_prt(isp, ISP_LOGWARN, "command timed out for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGWARN, "Command timed out");
 		/*
 	 	 * XXX: Check to see if we logged out of the device.
 		 */
@@ -6124,83 +6107,62 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 
 	case RQCS_DATA_OVERRUN:
 		XS_SET_RESID(xs, sp->req_resid);
-		isp_prt(isp, ISP_LOGERR, "data overrun (%ld) for command on %d.%d.%d",
-		    (long) XS_GET_RESID(xs), XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "data overrun (%ld)", (long) XS_GET_RESID(xs));
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_DATAOVR);
 		}
 		return;
 
 	case RQCS_COMMAND_OVERRUN:
-		isp_prt(isp, ISP_LOGERR,
-		    "command overrun for command on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "command overrun");
 		break;
 
 	case RQCS_STATUS_OVERRUN:
-		isp_prt(isp, ISP_LOGERR,
-		    "status overrun for command on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "status overrun");
 		break;
 
 	case RQCS_BAD_MESSAGE:
-		isp_prt(isp, ISP_LOGERR,
-		    "msg not COMMAND COMPLETE after status %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "msg not COMMAND COMPLETE after status");
 		break;
 
 	case RQCS_NO_MESSAGE_OUT:
-		isp_prt(isp, ISP_LOGERR,
-		    "No MESSAGE OUT phase after selection on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "No MESSAGE OUT phase after selection");
 		break;
 
 	case RQCS_EXT_ID_FAILED:
-		isp_prt(isp, ISP_LOGERR, "EXTENDED IDENTIFY failed %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "EXTENDED IDENTIFY failed");
 		break;
 
 	case RQCS_IDE_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR,
-		    "INITIATOR DETECTED ERROR rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "INITIATOR DETECTED ERROR rejected");
 		break;
 
 	case RQCS_ABORT_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR, "ABORT OPERATION rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "ABORT OPERATION rejected");
 		break;
 
 	case RQCS_REJECT_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR, "MESSAGE REJECT rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "MESSAGE REJECT rejected");
 		break;
 
 	case RQCS_NOP_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR, "NOP rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "NOP rejected");
 		break;
 
 	case RQCS_PARITY_ERROR_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR,
-		    "MESSAGE PARITY ERROR rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "MESSAGE PARITY ERROR rejected");
 		break;
 
 	case RQCS_DEVICE_RESET_MSG_FAILED:
-		isp_prt(isp, ISP_LOGWARN,
-		    "BUS DEVICE RESET rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGWARN, "BUS DEVICE RESET rejected");
 		break;
 
 	case RQCS_ID_MSG_FAILED:
-		isp_prt(isp, ISP_LOGERR, "IDENTIFY rejected by %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "IDENTIFY rejected");
 		break;
 
 	case RQCS_UNEXP_BUS_FREE:
-		isp_prt(isp, ISP_LOGERR, "%d.%d.%d had an unexpected bus free",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Unexpected Bus Free");
 		break;
 
 	case RQCS_DATA_UNDERRUN:
@@ -6208,9 +6170,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		if (IS_FC(isp)) {
 			int ru_marked = (sp->req_scsi_status & RQCS_RU) != 0;
 			if (!ru_marked || sp->req_resid > XS_XFRLEN(xs)) {
-				isp_prt(isp, ISP_LOGWARN, bun, XS_TGT(xs),
-				    XS_LUN(xs), XS_XFRLEN(xs), sp->req_resid,
-				    (ru_marked)? "marked" : "not marked");
+				isp_xs_prt(isp, xs, ISP_LOGWARN, bun, XS_XFRLEN(xs), sp->req_resid, (ru_marked)? "marked" : "not marked");
 				if (XS_NOERR(xs)) {
 					XS_SETERR(xs, HBA_BOTCH);
 				}
@@ -6225,18 +6185,15 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 	}
 
 	case RQCS_XACT_ERR1:
-		isp_prt(isp, ISP_LOGERR, xact1, XS_CHANNEL(xs),
-		    XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction with disconnect not set");
 		break;
 
 	case RQCS_XACT_ERR2:
-		isp_prt(isp, ISP_LOGERR, xact2,
-		    XS_LUN(xs), XS_TGT(xs), XS_CHANNEL(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction to target routine %d", XS_LUN(xs));
 		break;
 
 	case RQCS_XACT_ERR3:
-		isp_prt(isp, ISP_LOGERR, xact3,
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued cmd when queueing disabled");
 		break;
 
 	case RQCS_BAD_ENTRY:
@@ -6244,9 +6201,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		break;
 
 	case RQCS_QUEUE_FULL:
-		isp_prt(isp, ISP_LOGDEBUG0,
-		    "internal queues full for %d.%d.%d status 0x%x",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), *XS_STSP(xs));
+		isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "internal queues full status 0x%x", *XS_STSP(xs));
 
 		/*
 		 * If QFULL or some other status byte is set, then this
@@ -6270,23 +6225,18 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		return;
 
 	case RQCS_PHASE_SKIPPED:
-		isp_prt(isp, ISP_LOGERR, pskip, XS_CHANNEL(xs),
-		    XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "SCSI phase skipped");
 		break;
 
 	case RQCS_ARQS_FAILED:
-		isp_prt(isp, ISP_LOGERR,
-		    "Auto Request Sense failed for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Auto Request Sense Failed");
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_ARQFAIL);
 		}
 		return;
 
 	case RQCS_WIDE_FAILED:
-		isp_prt(isp, ISP_LOGERR,
-		    "Wide Negotiation failed for %d.%d.%d",
-		    XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Wide Negotiation Failed");
 		if (IS_SCSI(isp)) {
 			sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs));
 			sdp->isp_devparam[XS_TGT(xs)].goal_flags &= ~DPARM_WIDE;
@@ -6299,9 +6249,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		return;
 
 	case RQCS_SYNCXFER_FAILED:
-		isp_prt(isp, ISP_LOGERR,
-		    "SDTR Message failed for target %d.%d.%d",
-		    XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "SDTR Message Failed");
 		if (IS_SCSI(isp)) {
 			sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs));
 			sdp += XS_CHANNEL(xs);
@@ -6312,9 +6260,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 		break;
 
 	case RQCS_LVD_BUSERR:
-		isp_prt(isp, ISP_LOGERR,
-		    "Bad LVD condition while talking to %d.%d.%d",
-		    XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Bad LVD condition");
 		break;
 
 	case RQCS_PORT_UNAVAILABLE:
@@ -6384,8 +6330,7 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 }
 
 static void
-isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp,
-    XS_T *xs, long *rp)
+isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, XS_T *xs, long *rp)
 {
 	int ru_marked, sv_marked;
 	int chan = XS_CHANNEL(xs);
@@ -6398,19 +6343,15 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 		return;
 
 	case RQCS_DMA_ERROR:
-		isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "DMA error");
 		break;
 
 	case RQCS_TRANSPORT_ERROR:
-		isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs,  ISP_LOGERR, "Transport Error");
 		break;
 
 	case RQCS_RESET_OCCURRED:
-		isp_prt(isp, ISP_LOGWARN,
-		    "reset destroyed command for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGWARN, "reset destroyed command");
 		FCPARAM(isp, chan)->sendmarker = 1;
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_BUSRESET);
@@ -6418,8 +6359,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 		return;
 
 	case RQCS_ABORTED:
-		isp_prt(isp, ISP_LOGERR, "command aborted for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Command Aborted");
 		FCPARAM(isp, chan)->sendmarker = 1;
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_ABORTED);
@@ -6427,8 +6367,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 		return;
 
 	case RQCS_TIMEOUT:
-		isp_prt(isp, ISP_LOGWARN, "command timed out for %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGWARN, "Command Timed Out");
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_CMDTIMEOUT);
 		}
@@ -6436,9 +6375,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 
 	case RQCS_DATA_OVERRUN:
 		XS_SET_RESID(xs, sp->req_resid);
-		isp_prt(isp, ISP_LOGERR,
-		    "data overrun for command on %d.%d.%d",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
+		isp_xs_prt(isp, xs, ISP_LOGERR, "Data Overrun");
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_DATAOVR);
 		}
@@ -6471,19 +6408,14 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 		sv_marked = (sp->req_scsi_status & (RQCS_SV|RQCS_RV)) != 0;
 		if ((ru_marked == 0 && sv_marked == 0) ||
 		    (sp->req_resid > XS_XFRLEN(xs))) {
-			isp_prt(isp, ISP_LOGWARN, bun, XS_TGT(xs),
-			    XS_LUN(xs), XS_XFRLEN(xs), sp->req_resid,
-			    (ru_marked)? "marked" : "not marked");
+			isp_xs_prt(isp, xs, ISP_LOGWARN, bun, XS_XFRLEN(xs), sp->req_resid, (ru_marked)? "marked" : "not marked");
 			if (XS_NOERR(xs)) {
 				XS_SETERR(xs, HBA_BOTCH);
 			}
 			return;
 		}
 		XS_SET_RESID(xs, sp->req_resid);
-		isp_prt(isp, ISP_LOGDEBUG0,
-		    "%d.%d.%d data underrun (%d) for command 0x%x",
-		    XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs),
-		    sp->req_resid, XS_CDBP(xs)[0] & 0xff);
+		isp_xs_prt(isp, xs, ISP_LOGDEBUG0, "Data Underrun (%d) for command 0x%x", sp->req_resid, XS_CDBP(xs)[0] & 0xff);
 		if (XS_NOERR(xs)) {
 			XS_SETERR(xs, HBA_NOERROR);
 		}
@@ -7384,8 +7316,7 @@ isp_spi_update(ispsoftc_t *isp, int chan
 		if (sdp->isp_devparam[tgt].dev_enable == 0) {
 			sdp->isp_devparam[tgt].dev_update = 0;
 			sdp->isp_devparam[tgt].dev_refresh = 0;
-			isp_prt(isp, ISP_LOGDEBUG0,
-	 		    "skipping target %d bus %d update", tgt, chan);
+			isp_prt(isp, ISP_LOGDEBUG0, "skipping target %d bus %d update", tgt, chan);
 			continue;
 		}
 		/*
@@ -7441,10 +7372,8 @@ isp_spi_update(ispsoftc_t *isp, int chan
 			sdp->isp_devparam[tgt].actv_flags &= ~DPARM_TQING;
 			sdp->isp_devparam[tgt].actv_flags |=
 			    (sdp->isp_devparam[tgt].goal_flags & DPARM_TQING);
-			isp_prt(isp, ISP_LOGDEBUG0,
-			    "bus %d set tgt %d flags 0x%x off 0x%x period 0x%x",
-			    chan, tgt, mbs.param[2], mbs.param[3] >> 8,
-			    mbs.param[3] & 0xff);
+			isp_prt(isp, ISP_LOGDEBUG0, "bus %d set tgt %d flags 0x%x off 0x%x period 0x%x",
+			    chan, tgt, mbs.param[2], mbs.param[3] >> 8, mbs.param[3] & 0xff);
 			get = 0;
 		} else {
 			continue;
@@ -7778,8 +7707,7 @@ isp_read_nvram(ispsoftc_t *isp, int bus)
 	    nvram_data[2] != 'P') {
 		if (isp->isp_bustype != ISP_BT_SBUS) {
 			isp_prt(isp, ISP_LOGWARN, "invalid NVRAM header");
-			isp_prt(isp, ISP_LOGDEBUG0, "%x %x %x",
-			    nvram_data[0], nvram_data[1], nvram_data[2]);
+			isp_prt(isp, ISP_LOGDEBUG0, "%x %x %x", nvram_data[0], nvram_data[1], nvram_data[2]);
 		}
 		retval = -1;
 		goto out;
@@ -8294,8 +8222,7 @@ isp_parse_nvram_2100(ispsoftc_t *isp, ui
 	    ISP2100_NVRAM_TOV(nvram_data));
 	fcp->isp_xfwoptions = ISP2100_XFW_OPTIONS(nvram_data);
 	fcp->isp_zfwoptions = ISP2100_ZFW_OPTIONS(nvram_data);
-	isp_prt(isp, ISP_LOGDEBUG0,
-	    "xfwoptions 0x%x zfw options 0x%x",
+	isp_prt(isp, ISP_LOGDEBUG0, "xfwoptions 0x%x zfw options 0x%x",
 	    ISP2100_XFW_OPTIONS(nvram_data), ISP2100_ZFW_OPTIONS(nvram_data));
 }
 

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Fri Mar 26 14:52:58 2010	(r205697)
+++ head/sys/dev/isp/isp_freebsd.c	Fri Mar 26 15:13:31 2010	(r205698)
@@ -5432,6 +5432,20 @@ isp_prt(ispsoftc_t *isp, int level, cons
 	printf("\n");
 }
 
+void
+isp_xs_prt(ispsoftc_t *isp, XS_T *xs, int level, const char *fmt, ...)
+{
+	va_list ap;
+	if (level != ISP_LOGALL && (level & isp->isp_dblev) == 0) {
+		return;
+	}
+	xpt_print_path(xs->ccb_h.path);
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
+	printf("\n");
+}
+
 uint64_t
 isp_nanotime_sub(struct timespec *b, struct timespec *a)
 {

Modified: head/sys/dev/isp/isp_freebsd.h
==============================================================================
--- head/sys/dev/isp/isp_freebsd.h	Fri Mar 26 14:52:58 2010	(r205697)
+++ head/sys/dev/isp/isp_freebsd.h	Fri Mar 26 15:13:31 2010	(r205698)
@@ -424,6 +424,8 @@ default:							\
 	imin((sizeof((ccb)->sense_data)), ccb->sense_len)
 
 #define	XS_SNSKEY(ccb)		((ccb)->sense_data.flags & 0xf)
+#define	XS_SNSASC(ccb)		((ccb)->sense_data.add_sense_code)
+#define	XS_SNSASCQ(ccb)		((ccb)->sense_data.add_sense_code_qual)
 #define	XS_TAG_P(ccb)	\
 	(((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \
 	 (ccb)->tag_action != CAM_TAG_ACTION_NONE)
@@ -461,7 +463,7 @@ default:							\
 	(xs)->ccb_h.status |= CAM_AUTOSNS_VALID;	\
 	memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs), sense_len))
 
-#define	XS_SET_STATE_STAT(a, b, c)
+#define	XS_SENSE_VALID(xs)	(((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)
 
 #define	DEFAULT_FRAMESIZE(isp)		isp->isp_osinfo.framesize
 #define	DEFAULT_EXEC_THROTTLE(isp)	isp->isp_osinfo.exec_throttle
@@ -593,6 +595,7 @@ extern int isp_autoconfig;
  * Platform Library Functions
  */
 void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4);
+void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) __printflike(4, 5);
 uint64_t isp_nanotime_sub(struct timespec *, struct timespec *);
 int isp_mbox_acquire(ispsoftc_t *);
 void isp_mbox_wait_complete(ispsoftc_t *, mbreg_t *);

Modified: head/sys/dev/isp/ispvar.h
==============================================================================
--- head/sys/dev/isp/ispvar.h	Fri Mar 26 14:52:58 2010	(r205697)
+++ head/sys/dev/isp/ispvar.h	Fri Mar 26 15:13:31 2010	(r205698)
@@ -954,12 +954,13 @@ void isp_async(ispsoftc_t *, ispasync_t,
 /*
  * Platform Dependent Error and Debug Printout
  *
- * Generally this is:
+ * Two required functions for each platform must be provided:
  *
  *    void isp_prt(ispsoftc_t *, int level, const char *, ...)
+ *    void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...)
  *
  * but due to compiler differences on different platforms this won't be
- * formally done here. Instead, it goes in each platform definition file.
+ * formally defined here. Instead, they go in each platform definition file.
  */
 
 #define	ISP_LOGALL	0x0	/* log always */
@@ -972,6 +973,7 @@ void isp_async(ispsoftc_t *, ispasync_t,
 #define	ISP_LOGDEBUG2	0x40	/* log most debug messages */
 #define	ISP_LOGDEBUG3	0x80	/* log high frequency debug messages */
 #define	ISP_LOGSANCFG	0x100	/* log SAN configuration */
+#define	ISP_LOG_CWARN	0x200	/* log SCSI command "warnings" (e.g., check conditions) */
 #define	ISP_LOGTINFO	0x1000	/* log informational messages (target mode) */
 #define	ISP_LOGTDEBUG0	0x2000	/* log simple debug messages (target mode) */
 #define	ISP_LOGTDEBUG1	0x4000	/* log intermediate debug messages (target) */
@@ -1045,6 +1047,8 @@ void isp_async(ispsoftc_t *, ispasync_t,
  *	XS_SNSP(xs)		gets a pointer to the associate sense data
  *	XS_SNSLEN(xs)		gets the length of sense data storage
  *	XS_SNSKEY(xs)		dereferences XS_SNSP to get the current stored Sense Key
+ *	XS_SNSASC(xs)		dereferences XS_SNSP to get the current stored Additional Sense Code
+ *	XS_SNSASCQ(xs)		dereferences XS_SNSP to get the current stored Additional Sense Code Qualifier
  *	XS_TAG_P(xs)		predicate of whether this command should be tagged
  *	XS_TAG_TYPE(xs)		which type of tag to use
  *	XS_SETERR(xs)		set error state
@@ -1065,6 +1069,8 @@ void isp_async(ispsoftc_t *, ispasync_t,
  *
  *	XS_SAVE_SENSE(xs, sp, len)	save sense data
  *
+ *	XS_SENSE_VALID(xs)		indicates whether sense is valid
+ *
  *	DEFAULT_FRAMESIZE(ispsoftc_t *)		Default Frame Size
  *	DEFAULT_EXEC_THROTTLE(ispsoftc_t *)	Default Execution Throttle
  *

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 17:02:32 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7CABE106564A;
	Fri, 26 Mar 2010 17:02:32 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 698FE8FC15;
	Fri, 26 Mar 2010 17:02:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QH2WEX006337;
	Fri, 26 Mar 2010 17:02:32 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QH2WEU006330;
	Fri, 26 Mar 2010 17:02:32 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003261702.o2QH2WEU006330@svn.freebsd.org>
From: Xin LI 
Date: Fri, 26 Mar 2010 17:02:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205702 - in head: . contrib/cpio gnu/usr.bin
	gnu/usr.bin/cpio share/man/man5 share/mk tools/build/mk
	tools/build/options usr.bin/cpio
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 17:02:32 -0000

Author: delphij
Date: Fri Mar 26 17:02:32 2010
New Revision: 205702
URL: http://svn.freebsd.org/changeset/base/205702

Log:
  Remove GNU cpio after fix of CVE-2010-0624.
  
  Note that this is actually a no-op for most users, as this GNU
  cpio was broken on -HEAD and 8-STABLE since last March until
  the recent fix.
  
  FreeBSD 8.0+ uses BSD cpio by default and the code is being
  actively maintained.
  
  Blessed by:	kientzle
  With hat:	secteam
  MFC after:	3 days

Deleted:
  head/contrib/cpio/
  head/gnu/usr.bin/cpio/
  head/tools/build/options/WITH_GNU_CPIO
Modified:
  head/ObsoleteFiles.inc
  head/gnu/usr.bin/Makefile
  head/share/man/man5/src.conf.5
  head/share/mk/bsd.own.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/cpio/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/ObsoleteFiles.inc	Fri Mar 26 17:02:32 2010	(r205702)
@@ -14,6 +14,11 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100326: gcpio removal
+OLD_FILES+=usr/bin/gcpio
+OLD_FILES+=usr/share/info/cpio.info.gz
+OLD_FILES+=usr/share/man/man1/gcpio.1.gz
+
 # 20100322: libz update
 OLD_LIBS+=lib/libz.so.5
 .if ${TARGET_ARCH} == "amd64"

Modified: head/gnu/usr.bin/Makefile
==============================================================================
--- head/gnu/usr.bin/Makefile	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/gnu/usr.bin/Makefile	Fri Mar 26 17:02:32 2010	(r205702)
@@ -4,7 +4,6 @@
 
 SUBDIR= ${_binutils} \
 	${_cc} \
-	${_cpio} \
 	${_cvs} \
 	dialog \
 	diff \
@@ -28,10 +27,6 @@ _groff=		groff
 .endif
 .endif
 
-.if ${MK_GNU_CPIO} == "yes"
-_cpio=		cpio
-.endif
-
 .if ${MK_CVS} != "no"
 _cvs=		cvs
 .endif

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/share/man/man5/src.conf.5	Fri Mar 26 17:02:32 2010	(r205702)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm
 .\" $FreeBSD$
-.Dd January 16, 2010
+.Dd March 26, 2010
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -339,13 +339,6 @@ When set, it also enforces the following
 .It
 .Va WITHOUT_GNU_SUPPORT
 .El
-.It Va WITH_GNU_CPIO
-.\" from FreeBSD: head/tools/build/options/WITH_GNU_CPIO 179813 2008-06-16 05:48:15Z dougb
-Set to build GNU cpio as a part of the base system,
-and symlink
-.Pa /usr/bin/cpio
-to this version.
-(This will override the symlink to the BSD version.)
 .It Va WITHOUT_GNU_GREP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP 179813 2008-06-16 05:48:15Z dougb
 Set to not build GNU grep as a part of the base system.

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/share/mk/bsd.own.mk	Fri Mar 26 17:02:32 2010	(r205702)
@@ -407,7 +407,6 @@ MK_${var}:=	yes
     BIND_LIBS \
     BIND_SIGCHASE \
     BIND_XML \
-    GNU_CPIO \
     HESIOD \
     IDEA
 .if defined(WITH_${var}) && defined(WITHOUT_${var})

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Fri Mar 26 17:02:32 2010	(r205702)
@@ -776,12 +776,6 @@ OLD_FILES+=usr/share/man/man1/gdbserver.
 OLD_FILES+=usr/share/man/man1/kgdb.1.gz
 .endif
 
-.if ${MK_GNU_CPIO} == no
-OLD_FILES+=usr/bin/gcpio
-OLD_FILES+=usr/share/info/cpio.info.gz
-OLD_FILES+=usr/share/man/man1/gcpio.1.gz
-.endif
-
 .if ${MK_GPIB} == no
 OLD_FILES+=usr/include/dev/ieee488/ibfoo_int.h
 OLD_FILES+=usr/include/dev/ieee488/ugpib.h

Modified: head/usr.bin/cpio/Makefile
==============================================================================
--- head/usr.bin/cpio/Makefile	Fri Mar 26 16:45:21 2010	(r205701)
+++ head/usr.bin/cpio/Makefile	Fri Mar 26 17:02:32 2010	(r205702)
@@ -19,10 +19,8 @@ DPADD+=	${LIBCRYPTO}
 LDADD+= -lcrypto
 .endif
 
-.if ${MK_GNU_CPIO} != "yes"
 SYMLINKS=bsdcpio ${BINDIR}/cpio
 MLINKS= bsdcpio.1 cpio.1
-.endif
 
 .PHONY: check test
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 18:49:44 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13976106564A;
	Fri, 26 Mar 2010 18:49:44 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 029778FC08;
	Fri, 26 Mar 2010 18:49:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QInhKZ030151;
	Fri, 26 Mar 2010 18:49:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QInh7n030149;
	Fri, 26 Mar 2010 18:49:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201003261849.o2QInh7n030149@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 26 Mar 2010 18:49:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205705 - head/sys/arm/xscale/ixp425
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 18:49:44 -0000

Author: rpaulo
Date: Fri Mar 26 18:49:43 2010
New Revision: 205705
URL: http://svn.freebsd.org/changeset/base/205705

Log:
  Pass the correct pointer to fled_cb().

Modified:
  head/sys/arm/xscale/ixp425/cambria_fled.c

Modified: head/sys/arm/xscale/ixp425/cambria_fled.c
==============================================================================
--- head/sys/arm/xscale/ixp425/cambria_fled.c	Fri Mar 26 18:34:25 2010	(r205704)
+++ head/sys/arm/xscale/ixp425/cambria_fled.c	Fri Mar 26 18:49:43 2010	(r205705)
@@ -74,7 +74,7 @@ fled_attach(device_t dev)
 
 	sc->sc_led = led_create(fled_cb, dev, "front");
 
-	fled_cb(sc, 1);		/* Turn on LED */
+	fled_cb(dev, 1);		/* Turn on LED */
 
 	return 0;
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 19:40:53 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E9C7106564A;
	Fri, 26 Mar 2010 19:40:53 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D8518FC1A;
	Fri, 26 Mar 2010 19:40:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QJerfl041670;
	Fri, 26 Mar 2010 19:40:53 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QJerY1041668;
	Fri, 26 Mar 2010 19:40:53 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003261940.o2QJerY1041668@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 26 Mar 2010 19:40:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205710 - head/gnu/usr.bin/gdb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 19:40:53 -0000

Author: marcel
Date: Fri Mar 26 19:40:53 2010
New Revision: 205710
URL: http://svn.freebsd.org/changeset/base/205710

Log:
  Handle cross-builds for gdbserver.

Modified:
  head/gnu/usr.bin/gdb/Makefile

Modified: head/gnu/usr.bin/gdb/Makefile
==============================================================================
--- head/gnu/usr.bin/gdb/Makefile	Fri Mar 26 19:00:17 2010	(r205709)
+++ head/gnu/usr.bin/gdb/Makefile	Fri Mar 26 19:40:53 2010	(r205710)
@@ -2,7 +2,9 @@
 
 SUBDIR=	doc libgdb gdb gdbtui kgdb
 
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc"
+TARGET_ARCH?= ${MACHINE_ARCH}
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "arm" || \
+    ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc"
 SUBDIR+=gdbserver
 .endif
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 19:41:41 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 433911065675;
	Fri, 26 Mar 2010 19:41:41 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 31EAB8FC1E;
	Fri, 26 Mar 2010 19:41:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QJffCS041901;
	Fri, 26 Mar 2010 19:41:41 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QJffRD041898;
	Fri, 26 Mar 2010 19:41:41 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003261941.o2QJffRD041898@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 26 Mar 2010 19:41:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205711 - in head/gnu/usr.bin/gdb: . kgdb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 19:41:41 -0000

Author: marcel
Date: Fri Mar 26 19:41:40 2010
New Revision: 205711
URL: http://svn.freebsd.org/changeset/base/205711

Log:
  Allow building a cross-kgdb for ia64.

Modified:
  head/gnu/usr.bin/gdb/Makefile.inc
  head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c

Modified: head/gnu/usr.bin/gdb/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/gdb/Makefile.inc	Fri Mar 26 19:40:53 2010	(r205710)
+++ head/gnu/usr.bin/gdb/Makefile.inc	Fri Mar 26 19:41:40 2010	(r205711)
@@ -41,7 +41,7 @@ CFLAGS+= -I${CNTRB_BU}/bfd
 GENSRCS+= nm.h tm.h
 
 .if defined(GDB_CROSS_DEBUGGER)
-CFLAGS+= -DCROSS_DEBUGGER
+CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT}/../..
 GDB_SUFFIX= -${TARGET_ARCH}
 NO_MAN=
 .endif

Modified: head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c	Fri Mar 26 19:40:53 2010	(r205710)
+++ head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c	Fri Mar 26 19:41:40 2010	(r205711)
@@ -28,9 +28,16 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#ifdef CROSS_DEBUGGER
+#include 
+#include 
+#include 
+#include 
+#else
 #include 
 #include 
 #include 
+#endif
 #include 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 20:22:18 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CAF281065670;
	Fri, 26 Mar 2010 20:22:18 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9A118FC0C;
	Fri, 26 Mar 2010 20:22:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QKMIx3050930;
	Fri, 26 Mar 2010 20:22:18 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QKMIJZ050928;
	Fri, 26 Mar 2010 20:22:18 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201003262022.o2QKMIJZ050928@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 26 Mar 2010 20:22:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205712 - head/sys/dev/isp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 20:22:18 -0000

Author: mjacob
Date: Fri Mar 26 20:22:18 2010
New Revision: 205712
URL: http://svn.freebsd.org/changeset/base/205712

Log:
  D'oh- isp_handle_index' logic was reversed (not used in FreeBSD).
  
  MFC after:	1 week

Modified:
  head/sys/dev/isp/isp_library.c

Modified: head/sys/dev/isp/isp_library.c
==============================================================================
--- head/sys/dev/isp/isp_library.c	Fri Mar 26 19:41:40 2010	(r205711)
+++ head/sys/dev/isp/isp_library.c	Fri Mar 26 20:22:18 2010	(r205712)
@@ -294,10 +294,10 @@ uint32_t
 isp_handle_index(ispsoftc_t *isp, uint32_t handle)
 {
 	if (!ISP_VALID_HANDLE(isp, handle)) {
-		return (handle & ISP_HANDLE_CMD_MASK);
-	} else {
 		isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle);
 		return (ISP_BAD_HANDLE_INDEX);
+	} else {
+		return (handle & ISP_HANDLE_CMD_MASK);
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar 26 21:22:03 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56CCA1065680;
	Fri, 26 Mar 2010 21:22:03 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 45A4F8FC1B;
	Fri, 26 Mar 2010 21:22:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2QLM3MX064039;
	Fri, 26 Mar 2010 21:22:03 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QLM3V5064031;
	Fri, 26 Mar 2010 21:22:03 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003262122.o2QLM3V5064031@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 26 Mar 2010 21:22:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205713 - in head/sys/ia64: ia64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 26 Mar 2010 21:22:03 -0000

Author: marcel
Date: Fri Mar 26 21:22:02 2010
New Revision: 205713
URL: http://svn.freebsd.org/changeset/base/205713

Log:
  Rename disable_intr() to ia64_disable_intr() and rename enable_intr()
  to ia64_enable_intr(). This reduces confusion with intr_disable() and
  intr_restore().
  
  Have configure_final() call ia64_finalize_intr() instead of enable_intr()
  in preparation of adding support for binding interrupts to all CPUs.

Modified:
  head/sys/ia64/ia64/autoconf.c
  head/sys/ia64/ia64/interrupt.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/ia64/trap.c
  head/sys/ia64/include/acpica_machdep.h
  head/sys/ia64/include/cpufunc.h
  head/sys/ia64/include/intr.h

Modified: head/sys/ia64/ia64/autoconf.c
==============================================================================
--- head/sys/ia64/ia64/autoconf.c	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/ia64/autoconf.c	Fri Mar 26 21:22:02 2010	(r205713)
@@ -39,15 +39,9 @@
 #include 
 #include 
 
-#include 
 #include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 
 static void	configure_first(void *);
 static void	configure(void *);
@@ -97,12 +91,9 @@ static void
 configure_final(void *dummy)
 {
 
-	/*
-	 * Now we're ready to handle (pending) interrupts.
-	 * XXX this is slightly misplaced.
-	 */
-	enable_intr();
-
 	cninit_finish();
+
+	ia64_finalize_intr();
+
 	cold = 0;
 }

Modified: head/sys/ia64/ia64/interrupt.c
==============================================================================
--- head/sys/ia64/ia64/interrupt.c	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/ia64/interrupt.c	Fri Mar 26 21:22:02 2010	(r205713)
@@ -280,6 +280,13 @@ ia64_teardown_intr(void *cookie)
 	return (intr_event_remove_handler(cookie));
 }
 
+void
+ia64_finalize_intr(void)
+{
+
+	ia64_enable_intr();
+}
+
 /*
  * Interrupt handlers.
  */
@@ -318,9 +325,9 @@ ia64_handle_intr(struct trapframe *tf)
  out:
 	if (TRAPF_USERMODE(tf)) {
 		while (td->td_flags & (TDF_ASTPENDING|TDF_NEEDRESCHED)) {
-			enable_intr();
+			ia64_enable_intr();
 			ast(tf);
-			disable_intr();
+			ia64_disable_intr();
 		}
 	}
 }

Modified: head/sys/ia64/ia64/mp_machdep.c
==============================================================================
--- head/sys/ia64/ia64/mp_machdep.c	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/ia64/mp_machdep.c	Fri Mar 26 21:22:02 2010	(r205713)
@@ -210,7 +210,7 @@ ia64_ap_startup(void)
 	ia64_set_itv(0x10000);
 	ia64_set_tpr(0);
 	ia64_srlz_d();
-	enable_intr();
+	ia64_enable_intr();
 
 	sched_throw(NULL);
 	/* NOTREACHED */

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/ia64/trap.c	Fri Mar 26 21:22:02 2010	(r205713)
@@ -334,11 +334,11 @@ int
 do_ast(struct trapframe *tf)
 {
 
-	disable_intr();
+	ia64_disable_intr();
 	while (curthread->td_flags & (TDF_ASTPENDING|TDF_NEEDRESCHED)) {
-		enable_intr();
+		ia64_enable_intr();
 		ast(tf);
-		disable_intr();
+		ia64_disable_intr();
 	}
 	/*
 	 * Keep interrupts disabled. We return r10 as a favor to the EPC

Modified: head/sys/ia64/include/acpica_machdep.h
==============================================================================
--- head/sys/ia64/include/acpica_machdep.h	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/include/acpica_machdep.h	Fri Mar 26 21:22:02 2010	(r205713)
@@ -56,8 +56,8 @@
 
 #define	ACPI_ASM_MACROS
 #define	BREAKPOINT3
-#define	ACPI_DISABLE_IRQS() disable_intr()
-#define	ACPI_ENABLE_IRQS()  enable_intr()
+#define	ACPI_DISABLE_IRQS()	ia64_disable_intr()
+#define	ACPI_ENABLE_IRQS()	ia64_enable_intr()
 
 #define	ACPI_FLUSH_CPU_CACHE()	/* XXX ia64_fc()? */
 

Modified: head/sys/ia64/include/cpufunc.h
==============================================================================
--- head/sys/ia64/include/cpufunc.h	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/include/cpufunc.h	Fri Mar 26 21:22:02 2010	(r205713)
@@ -56,13 +56,13 @@ breakpoint(void)
 
 
 static __inline void
-disable_intr(void)
+ia64_disable_intr(void)
 {
 	__asm __volatile ("rsm psr.i");
 }
 
 static __inline void
-enable_intr(void)
+ia64_enable_intr(void)
 {
 	__asm __volatile ("ssm psr.i;; srlz.d");
 }
@@ -71,8 +71,9 @@ static __inline register_t
 intr_disable(void)
 {
 	register_t psr;
+
 	__asm __volatile ("mov %0=psr;;" : "=r"(psr));
-	disable_intr();
+	ia64_disable_intr();
 	return ((psr & IA64_PSR_I) ? 1 : 0);
 }
 
@@ -80,7 +81,7 @@ static __inline void
 intr_restore(register_t ie)
 {
 	if (ie)
-		enable_intr();
+		ia64_enable_intr();
 }
 
 #endif /* __GNUCLIKE_ASM */

Modified: head/sys/ia64/include/intr.h
==============================================================================
--- head/sys/ia64/include/intr.h	Fri Mar 26 20:22:18 2010	(r205712)
+++ head/sys/ia64/include/intr.h	Fri Mar 26 21:22:02 2010	(r205713)
@@ -65,6 +65,7 @@ typedef u_int (ia64_ihtype)(struct threa
 
 extern struct ia64_pib *ia64_pib;
 
+void	ia64_finalize_intr(void);
 void	ia64_handle_intr(struct trapframe *);
 int	ia64_setup_intr(const char *, int, driver_filter_t, driver_intr_t,
 	    void *, enum intr_type, void **);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 00:21:40 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7716B106564A;
	Sat, 27 Mar 2010 00:21:40 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 652428FC12;
	Sat, 27 Mar 2010 00:21:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R0LeAL003973;
	Sat, 27 Mar 2010 00:21:40 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R0LebO003969;
	Sat, 27 Mar 2010 00:21:40 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201003270021.o2R0LebO003969@svn.freebsd.org>
From: Jack F Vogel 
Date: Sat, 27 Mar 2010 00:21:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205720 - in head/sys: dev/ixgbe modules/ixgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 00:21:40 -0000

Author: jfv
Date: Sat Mar 27 00:21:40 2010
New Revision: 205720
URL: http://svn.freebsd.org/changeset/base/205720

Log:
  Update the driver to Intel version 2.1.6
  	- add some new hardware support for 82599
  	- Big change to interrupt architecture, it now
  	  uses a queue which contains an RX/TX pair as
  	  the recipient of the interrupt. This will reduce
  	  overall system interrupts/msix usage.
  	- Improved RX mbuf handling: the old get_buf routine
  	  is no longer synchronized with rxeof, this allows
  	  the elimination of packet discards due to mbuf
  	  allocation failure.
  	- Much simplified and improved AIM code, it now
  	  happens in the queue interrupt context and takes
  	  into account both the traffic on the RX AND TX
  	  side.
  	- variety of small tweaks, like ring size, that have
  	  been seen as performance improvements.
  	- Thanks to those that provided feedback or suggested
  	  changes, I hope I've caught all of them.

Modified:
  head/sys/dev/ixgbe/LICENSE
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/ixgbe/ixgbe.h
  head/sys/dev/ixgbe/ixgbe_82598.c
  head/sys/dev/ixgbe/ixgbe_82599.c
  head/sys/dev/ixgbe/ixgbe_api.c
  head/sys/dev/ixgbe/ixgbe_api.h
  head/sys/dev/ixgbe/ixgbe_common.c
  head/sys/dev/ixgbe/ixgbe_phy.c
  head/sys/dev/ixgbe/ixgbe_phy.h
  head/sys/dev/ixgbe/ixgbe_type.h
  head/sys/modules/ixgbe/Makefile

Modified: head/sys/dev/ixgbe/LICENSE
==============================================================================
--- head/sys/dev/ixgbe/LICENSE	Fri Mar 26 23:44:51 2010	(r205719)
+++ head/sys/dev/ixgbe/LICENSE	Sat Mar 27 00:21:40 2010	(r205720)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2009, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Fri Mar 26 23:44:51 2010	(r205719)
+++ head/sys/dev/ixgbe/ixgbe.c	Sat Mar 27 00:21:40 2010	(r205720)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2009, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -46,7 +46,7 @@ int             ixgbe_display_debug_stat
 /*********************************************************************
  *  Driver version
  *********************************************************************/
-char ixgbe_driver_version[] = "2.0.7";
+char ixgbe_driver_version[] = "2.1.6";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -76,6 +76,7 @@ static ixgbe_vendor_info_t ixgbe_vendor_
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0},
+	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0},
 	/* required last entry */
 	{0, 0, 0, 0, 0}
@@ -136,12 +137,11 @@ static void     ixgbe_free_receive_struc
 static void     ixgbe_free_receive_buffers(struct rx_ring *);
 static void	ixgbe_setup_hw_rsc(struct rx_ring *);
 
-static void	ixgbe_init_moderation(struct adapter *);
 static void     ixgbe_enable_intr(struct adapter *);
 static void     ixgbe_disable_intr(struct adapter *);
 static void     ixgbe_update_stats_counters(struct adapter *);
 static bool	ixgbe_txeof(struct tx_ring *);
-static bool	ixgbe_rxeof(struct rx_ring *, int);
+static bool	ixgbe_rxeof(struct ix_queue *, int);
 static void	ixgbe_rx_checksum(u32, struct mbuf *);
 static void     ixgbe_set_promisc(struct adapter *);
 static void     ixgbe_disable_promisc(struct adapter *);
@@ -149,7 +149,7 @@ static void     ixgbe_set_multi(struct a
 static void     ixgbe_print_hw_stats(struct adapter *);
 static void	ixgbe_print_debug_info(struct adapter *);
 static void     ixgbe_update_link_status(struct adapter *);
-static int	ixgbe_get_buf(struct rx_ring *, int, int);
+static void	ixgbe_refresh_mbufs(struct rx_ring *, int);
 static int      ixgbe_xmit(struct tx_ring *, struct mbuf **);
 static int      ixgbe_sysctl_stats(SYSCTL_HANDLER_ARGS);
 static int	ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS);
@@ -169,7 +169,9 @@ static void	ixgbe_setup_vlan_hw_support(
 static void	ixgbe_register_vlan(void *, struct ifnet *, u16);
 static void	ixgbe_unregister_vlan(void *, struct ifnet *, u16);
 
-static void	ixgbe_update_aim(struct rx_ring *);
+static __inline void ixgbe_rx_discard(struct rx_ring *, int);
+static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *,
+		    struct mbuf *, u32);
 
 /* Support for pluggable optic modules */
 static bool	ixgbe_sfp_probe(struct adapter *);
@@ -178,13 +180,11 @@ static bool	ixgbe_sfp_probe(struct adapt
 static void	ixgbe_legacy_irq(void *);
 
 /* The MSI/X Interrupt handlers */
-static void	ixgbe_msix_tx(void *);
-static void	ixgbe_msix_rx(void *);
+static void	ixgbe_msix_que(void *);
 static void	ixgbe_msix_link(void *);
 
 /* Deferred interrupt tasklets */
-static void	ixgbe_handle_tx(void *, int);
-static void	ixgbe_handle_rx(void *, int);
+static void	ixgbe_handle_que(void *, int);
 static void	ixgbe_handle_link(void *, int);
 static void	ixgbe_handle_msf(void *, int);
 static void	ixgbe_handle_mod(void *, int);
@@ -222,23 +222,16 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1);
 */
 
 /*
-** These  parameters are used in Adaptive 
-** Interrupt Moderation. The value is set
-** into EITR and controls the interrupt
-** frequency. They can be modified but 
-** be careful in tuning them.
+** AIM: Adaptive Interrupt Moderation
+** which means that the interrupt rate
+** is varied over time based on the
+** traffic for that interrupt vector
 */
 static int ixgbe_enable_aim = TRUE;
 TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim);
-static int ixgbe_low_latency = IXGBE_LOW_LATENCY;
-TUNABLE_INT("hw.ixgbe.low_latency", &ixgbe_low_latency);
-static int ixgbe_ave_latency = IXGBE_AVE_LATENCY;
-TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_ave_latency);
-static int ixgbe_bulk_latency = IXGBE_BULK_LATENCY;
-TUNABLE_INT("hw.ixgbe.bulk_latency", &ixgbe_bulk_latency);
 
 /* How many packets rxeof tries to clean at a time */
-static int ixgbe_rx_process_limit = 100;
+static int ixgbe_rx_process_limit = 128;
 TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);
 
 /* Flow control setting, default to full */
@@ -271,20 +264,24 @@ static bool ixgbe_header_split = TRUE;
 TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split);
 
 /*
- * Number of Queues, should normally
- * be left at 0, it then autoconfigures to
- * the number of cpus. Each queue is a pair
- * of RX and TX rings with a dedicated interrupt
+ * Number of Queues, can be set to 0,
+ * it then autoconfigures based on the
+ * number of cpus. Each queue is a pair
+ * of RX and TX rings with a msix vector
  */
 static int ixgbe_num_queues = 0;
 TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues);
 
-/* Number of TX descriptors per ring */
-static int ixgbe_txd = DEFAULT_TXD;
+/*
+** Number of TX descriptors per ring,
+** setting higher than RX as this seems
+** the better performing choice.
+*/
+static int ixgbe_txd = PERFORM_TXD;
 TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd);
 
 /* Number of RX descriptors per ring */
-static int ixgbe_rxd = DEFAULT_RXD;
+static int ixgbe_rxd = PERFORM_RXD;
 TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd);
 
 /* Keep running tab on them for sanity check */
@@ -420,9 +417,11 @@ ixgbe_attach(device_t dev)
 		case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM :
 		case IXGBE_DEV_ID_82598EB_SFP_LOM :
 		case IXGBE_DEV_ID_82598AT :
-		case IXGBE_DEV_ID_82598AT2 :
 			adapter->optics = IFM_10G_SR;
 			break;
+		case IXGBE_DEV_ID_82598AT2 :
+			adapter->optics = IFM_10G_T;
+			break;
 		case IXGBE_DEV_ID_82598EB_XF_LR :
 			adapter->optics = IFM_10G_LR;
 			break;
@@ -439,6 +438,10 @@ ixgbe_attach(device_t dev)
 		case IXGBE_DEV_ID_82599_XAUI_LOM :
 		case IXGBE_DEV_ID_82599_COMBO_BACKPLANE :
 			ixgbe_num_segs = IXGBE_82599_SCATTER;
+			break;
+		case IXGBE_DEV_ID_82599_T3_LOM:
+			ixgbe_num_segs = IXGBE_82599_SCATTER;
+			adapter->optics = IFM_10G_T;
 		default:
 			break;
 	}
@@ -464,21 +467,6 @@ ixgbe_attach(device_t dev)
 			OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
 			&ixgbe_enable_aim, 1, "Interrupt Moderation");
 
-        SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
-			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-			OID_AUTO, "low_latency", CTLTYPE_INT|CTLFLAG_RW,
-			&ixgbe_low_latency, 1, "Low Latency");
-
-        SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
-			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-			OID_AUTO, "ave_latency", CTLTYPE_INT|CTLFLAG_RW,
-			&ixgbe_ave_latency, 1, "Average Latency");
-
-        SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
-			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-			OID_AUTO, "bulk_latency", CTLTYPE_INT|CTLFLAG_RW,
-			&ixgbe_bulk_latency, 1, "Bulk Latency");
-
 	/* Set up the timer callout */
 	callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0);
 
@@ -592,22 +580,6 @@ ixgbe_attach(device_t dev)
 	/* Setup OS specific network interface */
 	ixgbe_setup_interface(dev, adapter);
 
-#ifdef IXGBE_IEEE1588
-	/*
-	** Setup the timer: IEEE 1588 support
-	*/
-	adapter->cycles.read = ixgbe_read_clock;
-	adapter->cycles.mask = (u64)-1;
-	adapter->cycles.mult = 1;
-	adapter->cycles.shift = IXGBE_TSYNC_SHIFT;
-	IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, (1<<24) |
-	    IXGBE_TSYNC_CYCLE_TIME * IXGBE_TSYNC_SHIFT);
-	IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0x00000000);
-	IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0xFF800000);
-
-        // JFV - this is not complete yet
-#endif
-
 	/* Sysctl for limiting the amount of work done in the taskqueue */
 	ixgbe_add_rx_process_limit(adapter, "rx_processing_limit",
 	    "max number of rx packets to process", &adapter->rx_process_limit,
@@ -632,12 +604,13 @@ ixgbe_attach(device_t dev)
 	    (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" :
 	    ("Unknown"));
 
-	if (hw->bus.width <= ixgbe_bus_width_pcie_x4) {
+	if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) &&
+	    (hw->bus.speed == ixgbe_bus_speed_2500)) {
 		device_printf(dev, "PCI-Express bandwidth available"
 		    " for this card\n     is not sufficient for"
 		    " optimal performance.\n");
 		device_printf(dev, "For optimal performance a x8 "
-		    "PCI-Express slot is required.\n");
+		    "PCIE, or x4 PCIE 2 slot is required.\n");
         }
 
 	/* let hardware know driver is loaded */
@@ -670,8 +643,7 @@ static int
 ixgbe_detach(device_t dev)
 {
 	struct adapter *adapter = device_get_softc(dev);
-	struct tx_ring *txr = adapter->tx_rings;
-	struct rx_ring *rxr = adapter->rx_rings;
+	struct ix_queue *que = adapter->queues;
 	u32	ctrl_ext;
 
 	INIT_DEBUGOUT("ixgbe_detach: begin");
@@ -686,17 +658,10 @@ ixgbe_detach(device_t dev)
 	ixgbe_stop(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 
-	for (int i = 0; i < adapter->num_queues; i++, txr++) {
-		if (txr->tq) {
-			taskqueue_drain(txr->tq, &txr->tx_task);
-			taskqueue_free(txr->tq);
-		}
-	}
-
-	for (int i = 0; i < adapter->num_queues; i++, rxr++) {
-		if (rxr->tq) {
-			taskqueue_drain(rxr->tq, &rxr->rx_task);
-			taskqueue_free(rxr->tq);
+	for (int i = 0; i < adapter->num_queues; i++, que++) {
+		if (que->tq) {
+			taskqueue_drain(que->tq, &que->que_task);
+			taskqueue_free(que->tq);
 		}
 	}
 
@@ -833,6 +798,9 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 	/* Which queue to use */
 	if ((m->m_flags & M_FLOWID) != 0)
 		i = m->m_pkthdr.flowid % adapter->num_queues;
+	else	/* use the cpu we're on */
+		i = curcpu % adapter->num_queues;
+
 	txr = &adapter->tx_rings[i];
 
 	if (IXGBE_TX_TRYLOCK(txr)) {
@@ -849,59 +817,43 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 {
 	struct adapter  *adapter = txr->adapter;
         struct mbuf     *next;
-        int             err = 0;
+        int             enqueued, err = 0;
 
-	if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ||
-	    (!adapter->link_active)) {
-		err = drbr_enqueue(ifp, txr->br, m);
+	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING || adapter->link_active == 0) {
+		if (m != NULL)
+			err = drbr_enqueue(ifp, txr->br, m);
 		return (err);
 	}
 
-	if (m == NULL) /* Called by tasklet */
-		goto process;
-
-	/* If nothing queued go right to xmit */
-	if (!drbr_needs_enqueue(ifp, txr->br)) {
-		if ((err = ixgbe_xmit(txr, &m)) != 0) {
-			if (m != NULL)
-				err = drbr_enqueue(ifp, txr->br, m);
-			return (err);
-		} else {
-			/* Success, update stats */
-			drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags);
-			/* Send a copy of the frame to the BPF listener */
-			ETHER_BPF_MTAP(ifp, m);
-			/* Set the watchdog */
-			txr->watchdog_check = TRUE;
-                }
-
-        } else if ((err = drbr_enqueue(ifp, txr->br, m)) != 0)
-		return (err);
-
-process:
-	if (drbr_empty(ifp, txr->br))
-		return (err);
+	enqueued = 0;
+	if (m == NULL)
+		next = drbr_dequeue(ifp, txr->br);
+	else
+		next = m;
 
 	/* Process the queue */
-	while (TRUE) {
-		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
-			break;
-		next = drbr_dequeue(ifp, txr->br);
-		if (next == NULL)
-			break;
+	while (next != NULL) {
 		if ((err = ixgbe_xmit(txr, &next)) != 0) {
 			if (next != NULL)
 				err = drbr_enqueue(ifp, txr->br, next);
 			break;
 		}
+		enqueued++;
 		drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags);
+		/* Send a copy of the frame to the BPF listener */
 		ETHER_BPF_MTAP(ifp, next);
-		/* Set the watchdog */
-		txr->watchdog_check = TRUE;
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+			break;
+		if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) {
+			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+			break;
+		}
+		next = drbr_dequeue(ifp, txr->br);
 	}
-		
-	if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD)
-		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+
+	if (enqueued > 0) 
+		txr->watchdog_check = TRUE;
 
 	return (err);
 }
@@ -938,8 +890,8 @@ ixgbe_qflush(struct ifnet *ifp)
 static int
 ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
 {
-	struct adapter *adapter = ifp->if_softc;
-	struct ifreq   *ifr = (struct ifreq *) data;
+	struct adapter	*adapter = ifp->if_softc;
+	struct ifreq	*ifr = (struct ifreq *) data;
 	int             error = 0;
 
 	switch (command) {
@@ -999,8 +951,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
 			ifp->if_capenable ^= IFCAP_HWCSUM;
 		if (mask & IFCAP_TSO4)
 			ifp->if_capenable ^= IFCAP_TSO4;
-		/* Only allow changing when using header split */
-		if ((mask & IFCAP_LRO) && (ixgbe_header_split))
+		if (mask & IFCAP_LRO)
 			ifp->if_capenable ^= IFCAP_LRO;
 		if (mask & IFCAP_VLAN_HWTAGGING)
 			ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
@@ -1010,15 +961,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
 		break;
 	}
 
-#ifdef IXGBE_IEEE1588
-	/*
-	** IOCTL support for Precision Time (IEEE 1588) Support
-	*/
-	case SIOCSHWTSTAMP:
-		error = ixgbe_hwtstamp_ioctl(adapter, ifp);
-		break;
-#endif
-
 	default:
 		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
 		error = ether_ioctl(ifp, command, data);
@@ -1045,15 +987,20 @@ ixgbe_init_locked(struct adapter *adapte
 {
 	struct ifnet   *ifp = adapter->ifp;
 	device_t 	dev = adapter->dev;
-	struct ixgbe_hw *hw;
+	struct ixgbe_hw *hw = &adapter->hw;
 	u32		k, txdctl, mhadd, gpie;
 	u32		rxdctl, rxctrl;
 	int		err;
 
+	mtx_assert(&adapter->core_mtx, MA_OWNED);
 	INIT_DEBUGOUT("ixgbe_init: begin");
+	ixgbe_reset_hw(hw);
+	hw->adapter_stopped = FALSE;
+	ixgbe_stop_adapter(hw);
+        callout_stop(&adapter->timer);
 
-	hw = &adapter->hw;
-	mtx_assert(&adapter->core_mtx, MA_OWNED);
+        /* reprogram the RAR[0] in case user changed it. */
+        ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV);
 
 	/* Get the latest mac address, User can use a LAA */
 	bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr,
@@ -1061,9 +1008,6 @@ ixgbe_init_locked(struct adapter *adapte
 	ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1);
 	hw->addr_ctrl.rar_used_count = 1;
 
-	/* Do a warm reset */
-	ixgbe_reset_hw(hw);
-
 	/* Prepare transmit descriptors and buffers */
 	if (ixgbe_setup_transmit_structures(adapter)) {
 		device_printf(dev,"Could not setup transmit structures\n");
@@ -1071,6 +1015,7 @@ ixgbe_init_locked(struct adapter *adapte
 		return;
 	}
 
+	ixgbe_init_hw(hw);
 	ixgbe_initialize_transmit_units(adapter);
 
 	/* Setup Multicast table */
@@ -1095,9 +1040,6 @@ ixgbe_init_locked(struct adapter *adapte
 	/* Configure RX settings */
 	ixgbe_initialize_receive_units(adapter);
 
-	/* Configure Interrupt Moderation */
-	ixgbe_init_moderation(adapter);
-
 	gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE);
 
 	if (hw->mac.type == ixgbe_mac_82599EB) {
@@ -1174,7 +1116,7 @@ ixgbe_init_locked(struct adapter *adapte
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		rxctrl |= IXGBE_RXCTRL_DMBYPS;
 	rxctrl |= IXGBE_RXCTRL_RXEN;
-	IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl);
+	ixgbe_enable_rx_dma(hw, rxctrl);
 
 	callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter);
 
@@ -1291,34 +1233,22 @@ ixgbe_rearm_queues(struct adapter *adapt
 	}
 }
 
-static void
-ixgbe_handle_rx(void *context, int pending)
-{
-	struct rx_ring  *rxr = context;
-	struct adapter  *adapter = rxr->adapter;
-	u32		loop = MAX_LOOP;
-	bool		more;
-
-	do {
-		more = ixgbe_rxeof(rxr, -1);
-	} while (loop-- && more);
-        /* Reenable this interrupt */
-	ixgbe_enable_queue(adapter, rxr->msix);
-}
 
 static void
-ixgbe_handle_tx(void *context, int pending)
+ixgbe_handle_que(void *context, int pending)
 {
-	struct tx_ring  *txr = context;
-	struct adapter  *adapter = txr->adapter;
+	struct ix_queue *que = context;
+	struct adapter  *adapter = que->adapter;
+	struct tx_ring  *txr = que->txr;
 	struct ifnet    *ifp = adapter->ifp;
 	u32		loop = MAX_LOOP;
-	bool		more;
+	bool		more_rx, more_tx;
 
 	IXGBE_TX_LOCK(txr);
 	do {
-		more = ixgbe_txeof(txr);
-	} while (loop-- && more);
+		more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
+		more_tx = ixgbe_txeof(txr);
+	} while (loop-- && (more_rx || more_tx));
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
 #if __FreeBSD_version >= 800000
@@ -1332,7 +1262,7 @@ ixgbe_handle_tx(void *context, int pendi
 
 	IXGBE_TX_UNLOCK(txr);
 	/* Reenable this interrupt */
-	ixgbe_enable_queue(adapter, txr->msix);
+	ixgbe_enable_queue(adapter, que->msix);
 }
 
 
@@ -1345,33 +1275,32 @@ ixgbe_handle_tx(void *context, int pendi
 static void
 ixgbe_legacy_irq(void *arg)
 {
-	struct adapter	*adapter = arg;
+	struct ix_queue *que = arg;
+	struct adapter	*adapter = que->adapter;
 	struct ixgbe_hw	*hw = &adapter->hw;
 	struct 		tx_ring *txr = adapter->tx_rings;
-	struct		rx_ring *rxr = adapter->rx_rings;
-	bool		more;
+	bool		more_tx, more_rx;
 	u32       	reg_eicr, loop = MAX_LOOP;
 
 
 	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
+	++que->irqs;
 	if (reg_eicr == 0) {
 		ixgbe_enable_intr(adapter);
 		return;
 	}
 
-	if (ixgbe_rxeof(rxr, adapter->rx_process_limit))
-		taskqueue_enqueue(rxr->tq, &rxr->rx_task);
+	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
 
 	IXGBE_TX_LOCK(txr);
-	++txr->tx_irq;
 	do {
-		more = ixgbe_txeof(txr);
-	} while (loop-- && more);
+		more_tx = ixgbe_txeof(txr);
+	} while (loop-- && more_tx);
 	IXGBE_TX_UNLOCK(txr);
 
-	if (more)
-		taskqueue_enqueue(txr->tq, &txr->tx_task);
+	if (more_rx || more_tx)
+		taskqueue_enqueue(que->tq, &que->que_task);
 
 	/* Check for fan failure */
 	if ((hw->phy.media_type == ixgbe_media_type_copper) &&
@@ -1382,15 +1311,8 @@ ixgbe_legacy_irq(void *arg)
 	}
 
 	/* Link status change */
-	if (reg_eicr & IXGBE_EICR_LSC) {
-		ixgbe_check_link(&adapter->hw,
-		    &adapter->link_speed, &adapter->link_up, 0);
-        	ixgbe_update_link_status(adapter);
-	}
-
-	/* Update interrupt rate */
-	if (ixgbe_enable_aim == TRUE)
-		ixgbe_update_aim(rxr);
+	if (reg_eicr & IXGBE_EICR_LSC)
+		taskqueue_enqueue(adapter->tq, &adapter->link_task);
 
 	ixgbe_enable_intr(adapter);
 	return;
@@ -1399,55 +1321,85 @@ ixgbe_legacy_irq(void *arg)
 
 /*********************************************************************
  *
- *  MSI TX Interrupt Service routine
+ *  MSI Queue Interrupt Service routine
  *
  **********************************************************************/
 void
-ixgbe_msix_tx(void *arg)
+ixgbe_msix_que(void *arg)
 {
-	struct tx_ring	*txr = arg;
-	struct adapter  *adapter = txr->adapter;
-	bool		more;
+	struct ix_queue	*que = arg;
+	struct adapter  *adapter = que->adapter;
+	struct tx_ring	*txr = que->txr;
+	struct rx_ring	*rxr = que->rxr;
+	bool		more_tx, more_rx;
+	u32		newitr = 0;
 
-	ixgbe_disable_queue(adapter, txr->msix);
+	ixgbe_disable_queue(adapter, que->msix);
+	++que->irqs;
+
+	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
 
 	IXGBE_TX_LOCK(txr);
-	++txr->tx_irq;
-	more = ixgbe_txeof(txr);
+	more_tx = ixgbe_txeof(txr);
 	IXGBE_TX_UNLOCK(txr);
-	if (more)
-		taskqueue_enqueue(txr->tq, &txr->tx_task);
-	else /* Reenable this interrupt */
-		ixgbe_enable_queue(adapter, txr->msix);
-	return;
-}
 
+	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
 
-/*********************************************************************
- *
- *  MSIX RX Interrupt Service routine
- *
- **********************************************************************/
-static void
-ixgbe_msix_rx(void *arg)
-{
-	struct rx_ring	*rxr = arg;
-	struct adapter  *adapter = rxr->adapter;
-	bool		more;
-
-	ixgbe_disable_queue(adapter, rxr->msix);
+	/* Do AIM now? */
 
-	++rxr->rx_irq;
-	more = ixgbe_rxeof(rxr, adapter->rx_process_limit);
-
-	/* Update interrupt rate */
-	if (ixgbe_enable_aim == TRUE)
-		ixgbe_update_aim(rxr);
+	if (ixgbe_enable_aim == FALSE)
+		goto no_calc;
+	/*
+	** Do Adaptive Interrupt Moderation:
+        **  - Write out last calculated setting
+	**  - Calculate based on average size over
+	**    the last interval.
+	*/
+        if (que->eitr_setting)
+                IXGBE_WRITE_REG(&adapter->hw,
+                    IXGBE_EITR(que->msix), que->eitr_setting);
+ 
+        que->eitr_setting = 0;
 
-	if (more)
-		taskqueue_enqueue(rxr->tq, &rxr->rx_task);
+        /* Idle, do nothing */
+        if ((txr->bytes == 0) && (rxr->bytes == 0))
+                goto no_calc;
+                                
+	if ((txr->bytes) && (txr->packets))
+               	newitr = txr->bytes/txr->packets;
+	if ((rxr->bytes) && (rxr->packets))
+		newitr = max(newitr,
+		    (rxr->bytes / rxr->packets));
+	newitr += 24; /* account for hardware frame, crc */
+
+	/* set an upper boundary */
+	newitr = min(newitr, 3000);
+
+	/* Be nice to the mid range */
+	if ((newitr > 300) && (newitr < 1200))
+		newitr = (newitr / 3);
 	else
-		ixgbe_enable_queue(adapter, rxr->msix);
+		newitr = (newitr / 2);
+
+        if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+                newitr |= newitr << 16;
+        else
+                newitr |= IXGBE_EITR_CNT_WDIS;
+                 
+        /* save for next interrupt */
+        que->eitr_setting = newitr;
+
+        /* Reset state */
+        txr->bytes = 0;
+        txr->packets = 0;
+        rxr->bytes = 0;
+        rxr->packets = 0;
+
+no_calc:
+	if (more_tx || more_rx)
+		taskqueue_enqueue(que->tq, &que->que_task);
+	else /* Reenable this interrupt */
+		ixgbe_enable_queue(adapter, que->msix);
 	return;
 }
 
@@ -1512,84 +1464,6 @@ ixgbe_msix_link(void *arg)
 	return;
 }
 
-/*
-** Routine to do adjust the RX EITR value based on traffic,
-** its a simple three state model, but seems to help.
-**
-** Note that the three EITR values are tuneable using
-** sysctl in real time. The feature can be effectively
-** nullified by setting them equal.
-*/
-#define BULK_THRESHOLD	10000
-#define AVE_THRESHOLD	1600
-
-static void
-ixgbe_update_aim(struct rx_ring *rxr)
-{
-	struct adapter  *adapter = rxr->adapter;
-	u32             olditr, newitr;
-
-	/* Update interrupt moderation based on traffic */
-	olditr = rxr->eitr_setting;
-	newitr = olditr;
-
-	/* Idle, don't change setting */
-	if (rxr->bytes == 0)   
-		return;
-                
-	if (olditr == ixgbe_low_latency) {
-		if (rxr->bytes > AVE_THRESHOLD)
-			newitr = ixgbe_ave_latency;
-	} else if (olditr == ixgbe_ave_latency) {
-		if (rxr->bytes < AVE_THRESHOLD)
-			newitr = ixgbe_low_latency;
-		else if (rxr->bytes > BULK_THRESHOLD)
-			newitr = ixgbe_bulk_latency;
-	} else if (olditr == ixgbe_bulk_latency) {
-		if (rxr->bytes < BULK_THRESHOLD)
-			newitr = ixgbe_ave_latency;
-	}
-
-	if (olditr != newitr) {
-		/* Change interrupt rate */
-		rxr->eitr_setting = newitr;
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(rxr->me),
-		    newitr | (newitr << 16));
-	}
-
-	rxr->bytes = 0;
-	return;
-}
-
-static void
-ixgbe_init_moderation(struct adapter *adapter)
-{
-	struct rx_ring *rxr = adapter->rx_rings;
-	struct tx_ring *txr = adapter->tx_rings;
-
-	/* Single interrupt - MSI or Legacy? */
-	if (adapter->msix < 2) {
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(0), 100);
-		return;
-	}
-
-	/* TX irq moderation rate is fixed */
-	for (int i = 0; i < adapter->num_queues; i++, txr++)
-		IXGBE_WRITE_REG(&adapter->hw,
-		    IXGBE_EITR(txr->msix), ixgbe_ave_latency);
-
-	/* RX moderation will be adapted over time, set default */
-	for (int i = 0; i < adapter->num_queues; i++, rxr++) {
-		IXGBE_WRITE_REG(&adapter->hw,
-		    IXGBE_EITR(rxr->msix), ixgbe_low_latency);
-	}
-
-	/* Set Link moderation */
-	IXGBE_WRITE_REG(&adapter->hw,
-	    IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR);
-
-}
-
 /*********************************************************************
  *
  *  Media Ioctl callback
@@ -1665,11 +1539,10 @@ ixgbe_media_change(struct ifnet * ifp)
 
 /*********************************************************************
  *
- *  This routine maps the mbufs to tx descriptors.
- *    WARNING: while this code is using an MQ style infrastructure,
- *    it would NOT work as is with more than 1 queue.
+ *  This routine maps the mbufs to tx descriptors, allowing the
+ *  TX engine to transmit the packets. 
+ *  	- return 0 on success, positive on failure
  *
- *  return 0 on success, positive on failure
  **********************************************************************/
 
 static int
@@ -1695,14 +1568,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	if (m_head->m_flags & M_VLANTAG)
         	cmd_type_len |= IXGBE_ADVTXD_DCMD_VLE;
 
-	/* Do a clean if descriptors are low */
-	if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) {
-		ixgbe_txeof(txr);
-		/* Now do we at least have a minimal? */
-		if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD)
-			return (ENOBUFS);
-        }
-
         /*
          * Important to capture the first descriptor
          * used because it will contain the index of
@@ -1756,7 +1621,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 
 	/* Make certain there are enough descriptors */
 	if (nsegs > txr->tx_avail - 2) {
-		txr->no_tx_desc_avail++;
+		txr->no_desc_avail++;
 		error = ENOBUFS;
 		goto xmit_fail;
 	}
@@ -1814,7 +1679,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 		txd->read.cmd_type_len = htole32(txr->txd_cmd |
 		    cmd_type_len |seglen);
 		txd->read.olinfo_status = htole32(olinfo_status);
-		last = i; /* Next descriptor that will get completed */
+		last = i; /* descriptor that will get completion IRQ */
 
 		if (++i == adapter->num_tx_desc)
 			i = 0;
@@ -1843,7 +1708,13 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	 * hardware that this frame is available to transmit.
 	 */
 	++txr->total_packets;
+	txr->watchdog_time = ticks;
 	IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(txr->me), i);
+
+	/* Do a clean if descriptors are low */
+	if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD)
+		ixgbe_txeof(txr);
+
 	return (0);
 
 xmit_fail:
@@ -1978,7 +1849,6 @@ ixgbe_local_timer(void *arg)
 	struct ifnet   *ifp = adapter->ifp;
 	device_t	dev = adapter->dev;
 	struct tx_ring *txr = adapter->tx_rings;
-	bool   tx_hung = FALSE;
 
 	mtx_assert(&adapter->core_mtx, MA_OWNED);
 
@@ -1989,21 +1859,32 @@ ixgbe_local_timer(void *arg)
 
 	ixgbe_update_link_status(adapter);
 	ixgbe_update_stats_counters(adapter);
-	if (ixgbe_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) {
+
+	/* Debug display */
+	if (ixgbe_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING)
 		ixgbe_print_hw_stats(adapter);
-	}
+
+	/*
+	 * If the interface has been paused
+	 * then don't do the watchdog check
+	 */
+	if (IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF)
+		goto out;
 	/*
 	** Check for time since any descriptor was cleaned
 	*/
         for (int i = 0; i < adapter->num_queues; i++, txr++) {
-		if (txr->watchdog_check == FALSE)
+		IXGBE_TX_LOCK(txr);
+		if (txr->watchdog_check == FALSE) {
+			IXGBE_TX_UNLOCK(txr);
 			continue;
-		if ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG) {
-			tx_hung = TRUE;
-			goto hung;
 		}
+		if ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)
+			goto hung;
+		IXGBE_TX_UNLOCK(txr);
 	}
 out:
+       	ixgbe_rearm_queues(adapter, adapter->que_mask);
 	callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter);
 	return;
 
@@ -2017,6 +1898,7 @@ hung:
 	    txr->me, txr->tx_avail, txr->next_to_clean);
 	adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	adapter->watchdog_events++;
+	IXGBE_TX_UNLOCK(txr);
 	ixgbe_init_locked(adapter);
 }
 
@@ -2123,8 +2005,7 @@ static int
 ixgbe_allocate_legacy(struct adapter *adapter)
 {
 	device_t dev = adapter->dev;
-	struct 		tx_ring *txr = adapter->tx_rings;
-	struct		rx_ring *rxr = adapter->rx_rings;
+	struct		ix_queue *que = adapter->queues;
 	int error, rid = 0;
 
 	/* MSI RID at 1 */
@@ -2144,15 +2025,10 @@ ixgbe_allocate_legacy(struct adapter *ad
 	 * Try allocating a fast interrupt and the associated deferred
 	 * processing contexts.
 	 */
-	TASK_INIT(&txr->tx_task, 0, ixgbe_handle_tx, txr);
-	TASK_INIT(&rxr->rx_task, 0, ixgbe_handle_rx, rxr);
-	txr->tq = taskqueue_create_fast("ixgbe_txq", M_NOWAIT,
-            taskqueue_thread_enqueue, &txr->tq);
-	rxr->tq = taskqueue_create_fast("ixgbe_rxq", M_NOWAIT,
-            taskqueue_thread_enqueue, &rxr->tq);
-	taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq",
-            device_get_nameunit(adapter->dev));
-	taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq",
+	TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
+	que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
+            taskqueue_thread_enqueue, &que->tq);
+	taskqueue_start_threads(&que->tq, 1, PI_NET, "%s ixq",
             device_get_nameunit(adapter->dev));
 
 	/* Tasklets for Link, SFP and Multispeed Fiber */
@@ -2169,15 +2045,17 @@ ixgbe_allocate_legacy(struct adapter *ad
 
 	if ((error = bus_setup_intr(dev, adapter->res,
             INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_legacy_irq,
-            adapter, &adapter->tag)) != 0) {
+            que, &adapter->tag)) != 0) {
 		device_printf(dev, "Failed to register fast interrupt "
 		    "handler: %d\n", error);
-		taskqueue_free(txr->tq);
-		taskqueue_free(rxr->tq);
-		txr->tq = NULL;
-		rxr->tq = NULL;
+		taskqueue_free(que->tq);
+		taskqueue_free(adapter->tq);
+		que->tq = NULL;
+		adapter->tq = NULL;
 		return (error);
 	}
+	/* For simplicity in the handlers */
+	adapter->que_mask = IXGBE_EIMS_ENABLE_MASK;
 
 	return (0);
 }
@@ -2192,83 +2070,44 @@ static int
 ixgbe_allocate_msix(struct adapter *adapter)
 {
 	device_t        dev = adapter->dev;
-	struct 		tx_ring *txr = adapter->tx_rings;
-	struct		rx_ring *rxr = adapter->rx_rings;
+	struct 		ix_queue *que = adapter->queues;
 	int 		error, rid, vector = 0;
 
-	/* TX setup: the code is here for multi tx,
-	   there are other parts of the driver not ready for it */
-	for (int i = 0; i < adapter->num_queues; i++, vector++, txr++) {
+	for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
 		rid = vector + 1;
-		txr->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+		que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 		    RF_SHAREABLE | RF_ACTIVE);
-		if (!txr->res) {
+		if (que->res == NULL) {
 			device_printf(dev,"Unable to allocate"
-		    	    " bus resource: tx interrupt [%d]\n", vector);
+		    	    " bus resource: que interrupt [%d]\n", vector);
 			return (ENXIO);
 		}
 		/* Set the handler function */
-		error = bus_setup_intr(dev, txr->res,
+		error = bus_setup_intr(dev, que->res,
 		    INTR_TYPE_NET | INTR_MPSAFE, NULL,
-		    ixgbe_msix_tx, txr, &txr->tag);
+		    ixgbe_msix_que, que, &que->tag);
 		if (error) {
-			txr->res = NULL;
-			device_printf(dev, "Failed to register TX handler");
+			que->res = NULL;
+			device_printf(dev, "Failed to register QUE handler");
 			return (error);
 		}
-		txr->msix = vector;
+		que->msix = vector;
+        	adapter->que_mask |= (u64)(1 << que->msix);
 		/*
 		** Bind the msix vector, and thus the
 		** ring to the corresponding cpu.
 		*/
 		if (adapter->num_queues > 1)
-			bus_bind_intr(dev, txr->res, i);
+			bus_bind_intr(dev, que->res, i);
 
-		TASK_INIT(&txr->tx_task, 0, ixgbe_handle_tx, txr);
-		txr->tq = taskqueue_create_fast("ixgbe_txq", M_NOWAIT,
-		    taskqueue_thread_enqueue, &txr->tq);
-		taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq",
+		TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
+		que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,

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

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 02:21:17 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10BD4106564A;
	Sat, 27 Mar 2010 02:21:17 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id C479D8FC19;
	Sat, 27 Mar 2010 02:21:16 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o2R2H4eq020650;
	Fri, 26 Mar 2010 20:17:04 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Fri, 26 Mar 2010 20:16:41 -0600 (MDT)
Message-Id: <20100326.201641.200754750166606483.imp@bsdimp.com>
To: marcel@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <201003261940.o2QJerY1041668@svn.freebsd.org>
References: <201003261940.o2QJerY1041668@svn.freebsd.org>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205710 - head/gnu/usr.bin/gdb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 02:21:17 -0000

In message: <201003261940.o2QJerY1041668@svn.freebsd.org>
            Marcel Moolenaar  writes:
: Author: marcel
: Date: Fri Mar 26 19:40:53 2010
: New Revision: 205710
: URL: http://svn.freebsd.org/changeset/base/205710
: 
: Log:
:   Handle cross-builds for gdbserver.

Cross-builds outside the normal build system?  Otherwise, MACHINE_ARCH
is the right thing to check since TARGET* is only set in the
bootstrapping stages, not the actual build stages.

Warner


: Modified:
:   head/gnu/usr.bin/gdb/Makefile
: 
: Modified: head/gnu/usr.bin/gdb/Makefile
: ==============================================================================
: --- head/gnu/usr.bin/gdb/Makefile	Fri Mar 26 19:00:17 2010	(r205709)
: +++ head/gnu/usr.bin/gdb/Makefile	Fri Mar 26 19:40:53 2010	(r205710)
: @@ -2,7 +2,9 @@
:  
:  SUBDIR=	doc libgdb gdb gdbtui kgdb
:  
: -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc"
: +TARGET_ARCH?= ${MACHINE_ARCH}
: +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "arm" || \
: +    ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc"
:  SUBDIR+=gdbserver
:  .endif
:  
: 

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 02:23:56 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7EDB61065672;
	Sat, 27 Mar 2010 02:23:56 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101])
	by mx1.freebsd.org (Postfix) with ESMTP id 62F628FC15;
	Sat, 27 Mar 2010 02:23:56 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii
Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67])
	by asmtp026.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KZX009M15BM2Z50@asmtp026.mac.com>; Fri,
	26 Mar 2010 19:23:49 -0700 (PDT)
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
	ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam
	adjust=0
	reason=mlx engine=5.0.0-0908210000 definitions=main-1003260239
From: Marcel Moolenaar 
In-reply-to: <20100326.201641.200754750166606483.imp@bsdimp.com>
Date: Fri, 26 Mar 2010 19:23:45 -0700
Message-id: 
References: <201003261940.o2QJerY1041668@svn.freebsd.org>
	<20100326.201641.200754750166606483.imp@bsdimp.com>
To: "M. Warner Losh" 
X-Mailer: Apple Mail (2.1077)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r205710 - head/gnu/usr.bin/gdb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 02:23:56 -0000


On Mar 26, 2010, at 7:16 PM, M. Warner Losh wrote:

> In message: <201003261940.o2QJerY1041668@svn.freebsd.org>
>            Marcel Moolenaar  writes:
> : Author: marcel
> : Date: Fri Mar 26 19:40:53 2010
> : New Revision: 205710
> : URL: http://svn.freebsd.org/changeset/base/205710
> : 
> : Log:
> :   Handle cross-builds for gdbserver.
> 
> Cross-builds outside the normal build system?

Yes. A better description is building a cross-debugger.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 03:15:34 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E1EC106566C;
	Sat, 27 Mar 2010 03:15:34 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C5208FC0A;
	Sat, 27 Mar 2010 03:15:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R3FY1A042452;
	Sat, 27 Mar 2010 03:15:34 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R3FYn4042450;
	Sat, 27 Mar 2010 03:15:34 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003270315.o2R3FYn4042450@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 27 Mar 2010 03:15:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205723 - in head/sys/ia64: ia64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 03:15:34 -0000

Author: marcel
Date: Sat Mar 27 03:15:34 2010
New Revision: 205723
URL: http://svn.freebsd.org/changeset/base/205723

Log:
  Remove nx_pcibus from the nexus resource. Nexus is not involved
  with PCI busses. Remove nexus_read_ivar() and nexus_write_ivar()
  to give default behaviour. Remove  as well,
  because there's nothing in it that's being used.

Deleted:
  head/sys/ia64/include/nexusvar.h
Modified:
  head/sys/ia64/ia64/nexus.c

Modified: head/sys/ia64/ia64/nexus.c
==============================================================================
--- head/sys/ia64/ia64/nexus.c	Sat Mar 27 02:42:35 2010	(r205722)
+++ head/sys/ia64/ia64/nexus.c	Sat Mar 27 03:15:34 2010	(r205723)
@@ -56,7 +56,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -73,7 +72,6 @@
 static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
 struct nexus_device {
 	struct resource_list	nx_resources;
-	int			nx_pcibus;
 };
 
 #define DEVTONX(dev)	((struct nexus_device *)device_get_ivars(dev))
@@ -87,8 +85,6 @@ static device_t nexus_add_child(device_t
 				int unit);
 static	struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
 					      u_long, u_long, u_long, u_int);
-static	int nexus_read_ivar(device_t, device_t, int, uintptr_t *);
-static	int nexus_write_ivar(device_t, device_t, int, uintptr_t);
 static	int nexus_activate_resource(device_t, device_t, int, int,
 				    struct resource *);
 static	int nexus_deactivate_resource(device_t, device_t, int, int,
@@ -123,8 +119,6 @@ static device_method_t nexus_methods[] =
 	/* Bus interface */
 	DEVMETHOD(bus_print_child,	nexus_print_child),
 	DEVMETHOD(bus_add_child,	nexus_add_child),
-	DEVMETHOD(bus_read_ivar,	nexus_read_ivar),
-	DEVMETHOD(bus_write_ivar,	nexus_write_ivar),
 	DEVMETHOD(bus_alloc_resource,	nexus_alloc_resource),
 	DEVMETHOD(bus_release_resource,	nexus_release_resource),
 	DEVMETHOD(bus_activate_resource, nexus_activate_resource),
@@ -215,8 +209,6 @@ nexus_print_child(device_t bus, device_t
 	retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
 	retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
 	retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
-	if (ndev->nx_pcibus != -1)
-		retval += printf(" pcibus %d", ndev->nx_pcibus);
 	if (device_get_flags(child))
 		retval += printf(" flags %#x", device_get_flags(child));
 	retval += printf(" on motherboard\n");	/* XXX "motherboard", ick */
@@ -234,7 +226,6 @@ nexus_add_child(device_t bus, int order,
 	if (!ndev)
 		return(0);
 	resource_list_init(&ndev->nx_resources);
-	ndev->nx_pcibus = -1;
 
 	child = device_add_child_ordered(bus, order, name, unit); 
 
@@ -244,37 +235,6 @@ nexus_add_child(device_t bus, int order,
 	return(child);
 }
 
-static int
-nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
-{
-	struct	nexus_device *ndev = DEVTONX(child);
-
-	switch (which) {
-	case NEXUS_IVAR_PCIBUS:
-		*result = ndev->nx_pcibus;
-		break;
-	default:
-		return ENOENT;
-	}
-	return 0;
-}
-	
-
-static int
-nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
-{
-	struct	nexus_device *ndev = DEVTONX(child);
-
-	switch (which) {
-	case NEXUS_IVAR_PCIBUS:
-		ndev->nx_pcibus = value;
-		break;
-	default:
-		return ENOENT;
-	}
-	return 0;
-}
-
 
 /*
  * Allocate a resource on behalf of child.  NB: child is usually going to be a

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 03:17:39 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EABF01065672;
	Sat, 27 Mar 2010 03:17:39 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D9A218FC19;
	Sat, 27 Mar 2010 03:17:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R3HdvA042933;
	Sat, 27 Mar 2010 03:17:39 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R3Hda7042931;
	Sat, 27 Mar 2010 03:17:39 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003270317.o2R3Hda7042931@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 27 Mar 2010 03:17:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205724 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 03:17:40 -0000

Author: marcel
Date: Sat Mar 27 03:17:39 2010
New Revision: 205724
URL: http://svn.freebsd.org/changeset/base/205724

Log:
   removed on ia64.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sat Mar 27 03:15:34 2010	(r205723)
+++ head/ObsoleteFiles.inc	Sat Mar 27 03:17:39 2010	(r205724)
@@ -14,11 +14,14 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100326: [ia64] removed 
+.if ${TARGET_ARCH} == "ia64"
+OLD_FILES+=usr/include/machine/nexusvar.h
+.endif
 # 20100326: gcpio removal
 OLD_FILES+=usr/bin/gcpio
 OLD_FILES+=usr/share/info/cpio.info.gz
 OLD_FILES+=usr/share/man/man1/gcpio.1.gz
-
 # 20100322: libz update
 OLD_LIBS+=lib/libz.so.5
 .if ${TARGET_ARCH} == "amd64"

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 05:40:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22B85106564A;
	Sat, 27 Mar 2010 05:40:51 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0582F8FC18;
	Sat, 27 Mar 2010 05:40:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R5eo8f074405;
	Sat, 27 Mar 2010 05:40:50 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R5eojr074398;
	Sat, 27 Mar 2010 05:40:50 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003270540.o2R5eojr074398@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 27 Mar 2010 05:40:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205726 - in head/sys/ia64: ia64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 05:40:51 -0000

Author: marcel
Date: Sat Mar 27 05:40:50 2010
New Revision: 205726
URL: http://svn.freebsd.org/changeset/base/205726

Log:
  Implement interrupt to CPU binding. Assign interrupts to CPUs in a
  round-robin fashion, starting with the highest priority interrupt
  on the highest-numbered CPU and cycling downwards.

Modified:
  head/sys/ia64/ia64/autoconf.c
  head/sys/ia64/ia64/interrupt.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/ia64/nexus.c
  head/sys/ia64/ia64/sapic.c
  head/sys/ia64/include/intr.h

Modified: head/sys/ia64/ia64/autoconf.c
==============================================================================
--- head/sys/ia64/ia64/autoconf.c	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/ia64/autoconf.c	Sat Mar 27 05:40:50 2010	(r205726)
@@ -93,7 +93,7 @@ configure_final(void *dummy)
 
 	cninit_finish();
 
-	ia64_finalize_intr();
+	ia64_enable_intr();
 
 	cold = 0;
 }

Modified: head/sys/ia64/ia64/interrupt.c
==============================================================================
--- head/sys/ia64/ia64/interrupt.c	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/ia64/interrupt.c	Sat Mar 27 05:40:50 2010	(r205726)
@@ -122,7 +122,7 @@ ia64_xiv_reserve(u_int xiv, enum ia64_xi
 		return (EBUSY);
 	ia64_xiv[xiv] = what;
 	ia64_handler[xiv] = (ih == NULL) ? ia64_ih_invalid: ih;
-	if (1 || bootverbose)
+	if (bootverbose)
 		printf("XIV %u: use=%u, IH=%p\n", xiv, what, ih);
 	return (0);
 }
@@ -139,7 +139,7 @@ ia64_xiv_alloc(u_int prio, enum ia64_xiv
 
 	xiv0 = IA64_NXIVS - (hwprio + 1) * 16;
 
-	KASSERT(xiv0 > IA64_MIN_XIV, ("%s: min XIV", __func__));
+	KASSERT(xiv0 >= IA64_MIN_XIV, ("%s: min XIV", __func__));
 	KASSERT(xiv0 < IA64_NXIVS, ("%s: max XIV", __func__));
 
 	xiv = xiv0;
@@ -281,10 +281,24 @@ ia64_teardown_intr(void *cookie)
 }
 
 void
-ia64_finalize_intr(void)
+ia64_bind_intr(void)
 {
+	struct ia64_intr *i;
+	struct pcpu *pc;
+	u_int xiv;
+	int cpu;
 
-	ia64_enable_intr();
+	cpu = MAXCPU;
+	for (xiv = IA64_NXIVS - 1; xiv >= IA64_MIN_XIV; xiv--) {
+		if (ia64_xiv[xiv] != IA64_XIV_IRQ)
+			continue;
+		i = ia64_intrs[xiv];
+		do {
+			cpu = (cpu == 0) ? MAXCPU - 1 : cpu - 1;
+			pc = cpuid_to_pcpu[cpu];
+		} while (pc == NULL || !pc->pc_md.awake);
+		sapic_bind_intr(i->irq, pc);
+	}
 }
 
 /*

Modified: head/sys/ia64/ia64/mp_machdep.c
==============================================================================
--- head/sys/ia64/ia64/mp_machdep.c	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/ia64/mp_machdep.c	Sat Mar 27 05:40:50 2010	(r205726)
@@ -382,6 +382,12 @@ cpu_mp_unleash(void *dummy)
 
 	smp_active = 1;
 	smp_started = 1;
+
+	/*
+	 * Now that all CPUs are up and running, bind interrupts to each of
+	 * them.
+	 */
+	ia64_bind_intr();
 }
 
 /*

Modified: head/sys/ia64/ia64/nexus.c
==============================================================================
--- head/sys/ia64/ia64/nexus.c	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/ia64/nexus.c	Sat Mar 27 05:40:50 2010	(r205726)
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -101,6 +102,7 @@ static	int nexus_set_resource(device_t, 
 static	int nexus_get_resource(device_t, device_t, int, int, u_long *,
 			       u_long *);
 static void nexus_delete_resource(device_t, device_t, int, int);
+static int nexus_bind_intr(device_t, device_t, struct resource *, int);
 static	int nexus_config_intr(device_t, int, enum intr_trigger,
 			      enum intr_polarity);
 
@@ -129,6 +131,7 @@ static device_method_t nexus_methods[] =
 	DEVMETHOD(bus_set_resource,	nexus_set_resource),
 	DEVMETHOD(bus_get_resource,	nexus_get_resource),
 	DEVMETHOD(bus_delete_resource,	nexus_delete_resource),
+	DEVMETHOD(bus_bind_intr,	nexus_bind_intr),
 	DEVMETHOD(bus_config_intr,	nexus_config_intr),
 
 	/* Clock interface */
@@ -462,6 +465,17 @@ nexus_config_intr(device_t dev, int irq,
 }
 
 static int
+nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu)
+{
+	struct pcpu *pc;
+
+	pc = cpuid_to_pcpu[cpu];
+	if (pc == NULL)
+		return (EINVAL);
+	return (sapic_bind_intr(rman_get_start(irq), pc));
+}
+
+static int
 nexus_gettime(device_t dev, struct timespec *ts)
 {
 	struct clocktime ct;

Modified: head/sys/ia64/ia64/sapic.c
==============================================================================
--- head/sys/ia64/ia64/sapic.c	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/ia64/sapic.c	Sat Mar 27 05:40:50 2010	(r205726)
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -172,6 +173,26 @@ sapic_lookup(u_int irq, u_int *vecp)
 
 
 int
+sapic_bind_intr(u_int irq, struct pcpu *pc)
+{
+	struct sapic_rte rte;
+	struct sapic *sa;
+
+	sa = sapic_lookup(irq, NULL);
+	if (sa == NULL)
+		return (EINVAL);
+
+	mtx_lock_spin(&sa->sa_mtx);
+	sapic_read_rte(sa, irq - sa->sa_base, &rte);
+	rte.rte_destination_id = (pc->pc_md.lid >> 24) & 255;
+	rte.rte_destination_eid = (pc->pc_md.lid >> 16) & 255;
+	rte.rte_delivery_mode = SAPIC_DELMODE_FIXED;
+	sapic_write_rte(sa, irq - sa->sa_base, &rte);
+	mtx_unlock_spin(&sa->sa_mtx);
+	return (0);
+}
+
+int
 sapic_config_intr(u_int irq, enum intr_trigger trig, enum intr_polarity pol)
 {
 	struct sapic_rte rte;

Modified: head/sys/ia64/include/intr.h
==============================================================================
--- head/sys/ia64/include/intr.h	Sat Mar 27 04:39:59 2010	(r205725)
+++ head/sys/ia64/include/intr.h	Sat Mar 27 05:40:50 2010	(r205726)
@@ -35,6 +35,7 @@
 
 #define	IA64_MAX_HWPRIO		14
 
+struct pcpu;
 struct sapic;
 struct thread;
 struct trapframe;
@@ -65,7 +66,7 @@ typedef u_int (ia64_ihtype)(struct threa
 
 extern struct ia64_pib *ia64_pib;
 
-void	ia64_finalize_intr(void);
+void	ia64_bind_intr(void);
 void	ia64_handle_intr(struct trapframe *);
 int	ia64_setup_intr(const char *, int, driver_filter_t, driver_intr_t,
 	    void *, enum intr_type, void **);
@@ -76,6 +77,7 @@ u_int	ia64_xiv_alloc(u_int, enum ia64_xi
 int	ia64_xiv_free(u_int, enum ia64_xiv_use);
 int	ia64_xiv_reserve(u_int, enum ia64_xiv_use, ia64_ihtype);
 
+int	sapic_bind_intr(u_int, struct pcpu *);
 int	sapic_config_intr(u_int, enum intr_trigger, enum intr_polarity);
 struct sapic *sapic_create(u_int, u_int, uint64_t);
 int	sapic_enable(struct sapic *, u_int, u_int);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 06:53:12 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A3591065672;
	Sat, 27 Mar 2010 06:53:12 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 080D78FC08;
	Sat, 27 Mar 2010 06:53:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R6rBcQ090371;
	Sat, 27 Mar 2010 06:53:11 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R6rBMJ090357;
	Sat, 27 Mar 2010 06:53:11 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201003270653.o2R6rBMJ090357@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 27 Mar 2010 06:53:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205727 - in head/sys: ia64/conf modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 06:53:12 -0000

Author: marcel
Date: Sat Mar 27 06:53:11 2010
New Revision: 205727
URL: http://svn.freebsd.org/changeset/base/205727

Log:
  Bring up-to-date:
  o   Switch to ITANIUM2 has the cpu. This has absolutely no effect
      on the code, but makes for a better example.
  o   Drop COMPAT_FREEBSD6. We're tier 2, so you're supposed to run
      8-stable or newer.
  o   Add PREEMPTION. It works now.
  o   Remove HWPMC_HOOKS. We don't have support for hwpmc yet.
  
  o   Add a bunch of new devices: atapist, hptiop, amr, ips, twa, igb,
      ixgbe, ae, age, alc, ale, bce, bfe, et, jme, msk, nge, sk, ste,
      stge, tx, vge, axe, rue, udav, fwip, and all USB serial.
  o   Remove "legacy" devices: le, vx, dc, pcn, rl, sis.
  
  Make sure to the module list is a superset of what goes into GENERIC.

Modified:
  head/sys/ia64/conf/GENERIC
  head/sys/modules/Makefile

Modified: head/sys/ia64/conf/GENERIC
==============================================================================
--- head/sys/ia64/conf/GENERIC	Sat Mar 27 05:40:50 2010	(r205726)
+++ head/sys/ia64/conf/GENERIC	Sat Mar 27 06:53:11 2010	(r205727)
@@ -20,20 +20,21 @@
 #
 # $FreeBSD$
 
-cpu		ITANIUM
+cpu		ITANIUM2
 ident		GENERIC
 
 makeoptions	DEBUG=-g	# Build kernel with debug information.
 
 options 	AUDIT		# Security event auditing
 options 	CD9660		# ISO 9660 Filesystem
-options 	COMPAT_FREEBSD6	# Compatible with FreeBSD6
 options 	COMPAT_FREEBSD7	# Compatible with FreeBSD7
 options 	DDB		# Support DDB
 options 	DEADLKRES	# Enable the deadlock resolver
 options 	FFS		# Berkeley Fast Filesystem
+options 	FLOWTABLE	# per-cpu routing cache
 options 	GDB		# Support remote GDB
 options 	GEOM_LABEL	# Provides labelization
+options 	INCLUDE_CONFIG_FILE     # Include this file in kernel
 options 	INET		# InterNETworking
 options 	INET6		# IPv6 communications protocols
 options 	INVARIANTS	# Enable calls of extra sanity checking
@@ -44,9 +45,11 @@ options 	MAC		# TrustedBSD MAC Framework
 options 	MD_ROOT		# MD usable as root device
 options 	MSDOSFS		# MSDOS Filesystem
 options 	NFSCLIENT	# Network Filesystem Client
-options 	NFSSERVER	# Network Filesystem Server
 options 	NFSLOCKD	# Network Lock Manager
+options 	NFSSERVER	# Network Filesystem Server
 options 	NFS_ROOT	# NFS usable as root device
+options 	P1003_1B_SEMAPHORES	# POSIX-style semaphores
+options 	PREEMPTION	# Enable kernel thread preemption
 options 	PRINTF_BUFR_SIZE=128  # Printf buffering to limit interspersion
 options 	PROCFS		# Process filesystem (/proc)
 options 	PSEUDOFS	# Pseudo-filesystem framework
@@ -59,15 +62,12 @@ options 	STACK		# stack(9) support
 options 	SYSVMSG		# SYSV-style message queues
 options 	SYSVSEM		# SYSV-style semaphores
 options 	SYSVSHM		# SYSV-style shared memory
-options 	P1003_1B_SEMAPHORES	# POSIX-style semaphores
 options 	UFS_ACL		# Support for access control lists
 options 	UFS_DIRHASH	# Hash-based directory lookup scheme
 options 	UFS_GJOURNAL	# Enable gjournal-based UFS journaling
 options 	WITNESS		# Enable checks to detect deadlocks and cycles
 options 	WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
 options 	_KPOSIX_PRIORITY_SCHEDULING	# Posix P1003_1B RT extensions
-options 	HWPMC_HOOKS	# Necessary kernel hooks for hwpmc(4)
-options 	INCLUDE_CONFIG_FILE     # Include this file in kernel
 
 # Various "busses"
 device		firewire	# FireWire bus code
@@ -81,20 +81,25 @@ device		ata		# ATA controller
 device		atadisk		# ATA disk drives
 device		atapicd		# ATAPI CDROM drives
 device		atapifd		# ATAPI floppy drives
+device		atapist		# ATAPI tape drives
 device		ataraid		# ATA RAID drives
 
 # SCSI Controllers
 device		ahc		# AHA2940 and AIC7xxx devices
 device		ahd		# AHA39320/29320 and AIC79xx devices
+device		hptiop		# Highpoint RocketRaid 3xxx series
 device		isp		# Qlogic family
 device		mpt		# LSI-Logic MPT-Fusion
 device		sym		# NCR/Symbios Logic
 
 # RAID controllers interfaced to the SCSI subsystem
+device		amr		# AMI MegaRAID
 device		ciss		# Compaq Smart RAID 5*
 device		dpt		# DPT Smartcache III, IV
 device		iir		# Intel Integrated RAID
+device		ips		# IBM (Adaptec) ServeRAID
 device		mly		# Mylex AcceleRAID/eXtremeRAID
+device		twa		# 3ware 9000 series PATA/SATA RAID
 
 # SCSI peripherals
 device		cd		# CD-ROM, DVD-ROM etc.
@@ -107,7 +112,6 @@ device		ses		# Environmental Services (a
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
-device		amr		# AMI MegaRAID
 device		ida		# Compaq Smart RAID
 device		mlx		# Mylex DAC960 family
 
@@ -123,34 +127,58 @@ device		ums		# Mouse
 
 # PCI Ethernet NICs.
 device		de		# DEC/Intel DC21x4x (``Tulip'')
-device		em		# Intel PRO/1000 adapter Gigabit Ethernet Card
-device		le		# AMD Am7900 LANCE and Am79C9xx PCnet
+device		em		# Intel PRO/1000 Gigabit Ethernet Family
+device		igb		# Intel PRO/1000 PCIE Server Gigabit Family
+device		ixgbe		# Intel PRO/10GbE PCIE Ethernet Family
 device		txp		# 3Com 3cR990 (``Typhoon'')
-device		vx		# 3Com 3c590, 3c595 (``Vortex'')
 
 # PCI Ethernet NICs that use the common MII bus controller code.
+device		ae		# Attansic/Atheros L2 FastEthernet
+device		age		# Attansic/Atheros L1 Gigabit Ethernet
+device		alc		# Atheros AR8131/AR8132 Ethernet
+device		ale		# Atheros AR8121/AR8113/AR8114 Ethernet
+device		bce		# Broadcom BCM5706/BCM5708 Gigabit Ethernet
+device		bfe		# Broadcom BCM440x 10/100 Ethernet
 device		bge		# Broadcom BCM570xx Gigabit Ethernet
-device		dc		# DEC/Intel 21143 and various workalikes
+device		et		# Agere ET1310 10/100/Gigabit Ethernet
+device		jme		# JMicron JMC250 Gigabit/JMC260 Fast Ethernet
+device		msk		# Marvell/SysKonnect Yukon II Gigabit Ethernet
+device		nge		# NatSemi DP83820 gigabit Ethernet
 device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
-device		pcn		# AMD Am79C97x PCI 10/100 (precedence over 'le')
 device		re		# RealTek 8139C+/8169/8169S/8110S
-device		rl		# RealTek 8129/8139
 device		sf		# Adaptec AIC-6915 (``Starfire'')
-device		sis		# Silicon Integrated Systems SiS 900/SiS 7016
+device		sk		# SysKonnect SK-984x & SK-982x gigabit Ethernet
+device		ste		# Sundance ST201 (D-Link DFE-550TX)
+device		stge		# Sundance/Tamarack TC9021 gigabit Ethernet
+device		tx		# SMC EtherPower II (83c170 ``EPIC'')
+device		vge		# VIA VT612x gigabit Ethernet
 device		xl		# 3Com 3c90x ("Boomerang", "Cyclone")
 
 # USB Ethernet
 device		aue		# ADMtek USB Ethernet
+device		axe		# ASIX Electronics USB Ethernet
 device		cdce		# Generic USB over Ethernet
 device		cue		# CATC USB Ethernet
 device		kue		# Kawasaki LSI USB Ethernet
+device		rue		# RealTek RTL8150 USB Ethernet
+device		udav		# Davicom DM9601E USB
+
+# USB Serial
+device		uark		# Technologies ARK3116 based serial adapters
+device		ubsa		# Belkin F5U103 and compatible serial adapters
+device		uftdi		# For FTDI usb serial adapters
+device		uipaq		# Some WinCE based devices
+device		uplcom		# Prolific PL-2303 serial adapters
+device		uslcom		# SI Labs CP2101/CP2102 serial adapters
+device		uvisor		# Visor and Palm devices
+device		uvscom		# USB serial support for DDI pocket's PHS
 
 # FireWire support
+device		fwip		# IP over FireWire (RFC 2734,3146)
 device		sbp		# SCSI over FireWire (need scbus & da)
 
 # Various (pseudo) devices
 device		ether		# Ethernet support
-device		vlan		# 802.1Q VLAN support
 device		faith		# IPv6-to-IPv4 relaying (translation)
 device		gif		# IPv6 and IPv4 tunneling
 device		loop		# Network loopback
@@ -160,6 +188,7 @@ device		puc		# Multi I/O cards and multi
 device		random		# Entropy device
 device		tun		# Packet tunnel.
 device		uart		# Serial port (UART)
+device		vlan		# 802.1Q VLAN support
 device		firmware	# firmware assist module
 
 # The `bpf' device enables the Berkeley Packet Filter.

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Sat Mar 27 05:40:50 2010	(r205726)
+++ head/sys/modules/Makefile	Sat Mar 27 06:53:11 2010	(r205727)
@@ -565,10 +565,7 @@ _zfs=		zfs
 .endif
 
 .if ${MACHINE_ARCH} == "ia64"
-# Modules not enabled on ia64 (as compared to i386) include:
-#	aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv
-#	nsp s3 sbni stg vesa
-# acpi is not enabled because it is broken as a module on ia64
+_aac=		aac
 _aic=		aic
 _an=		an
 _arcnet=	arcnet
@@ -581,12 +578,17 @@ _cm=		cm
 _cmx=		cmx
 _coff=		coff
 _cpufreq=	cpufreq
+_dpt=		dpt
 _em=		em
 _ep=		ep
+_et=		et
 _exca=		exca
 _fe=		fe
+_hptiop=	hptiop
+_ida=		ida
 _igb=		igb
 _iir=		iir
+_ips=		ips
 _mly=		mly
 _pccard=	pccard
 _scsi_low=	scsi_low
@@ -595,6 +597,7 @@ _sound=		sound
 _splash=	splash
 _sppp=		sppp
 _streams=	streams
+_twa=		twa
 _wi=		wi
 _xe=		xe
 .endif

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 08:00:17 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D525106566C;
	Sat, 27 Mar 2010 08:00:17 +0000 (UTC)
	(envelope-from kaiw@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3BA728FC1D;
	Sat, 27 Mar 2010 08:00:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2R80G6d005178;
	Sat, 27 Mar 2010 08:00:17 GMT (envelope-from kaiw@svn.freebsd.org)
Received: (from kaiw@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2R80Glb005174;
	Sat, 27 Mar 2010 08:00:16 GMT (envelope-from kaiw@svn.freebsd.org)
Message-Id: <201003270800.o2R80Glb005174@svn.freebsd.org>
From: Kai Wang 
Date: Sat, 27 Mar 2010 08:00:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205728 - head/lib/libusbhid
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 08:00:17 -0000

Author: kaiw
Date: Sat Mar 27 08:00:16 2010
New Revision: 205728
URL: http://svn.freebsd.org/changeset/base/205728

Log:
  Merge improvements from kernel HID parser to the userland usbhid(3)
  parser.  This merge does not change any API and should not break any
  native or thirdparty applications.
  
  Changes include:
  
  * Merge multiple report ID support and other improvements from kernel
    HID parser.
  * Ignore rid argument in hid_start_parser, parse all the report items since
    we now support multiple report ID.
  * Skip report ID byte in hid_get_data() and set report ID byte in
    hid_set_data(), if report ID is non-zero.
  * Reimplement hid_get_report_id: instead get report id from uhid device
    (which is always 0), try parsing the report descriptor and return the
    first report ID encountered.
  
  Reviewed by:	hps
  Silent on:	-usb mailing list

Modified:
  head/lib/libusbhid/data.c
  head/lib/libusbhid/descr.c
  head/lib/libusbhid/parse.c
  head/lib/libusbhid/usage.c
  head/lib/libusbhid/usbhid.h
  head/lib/libusbhid/usbvar.h

Modified: head/lib/libusbhid/data.c
==============================================================================
--- head/lib/libusbhid/data.c	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/data.c	Sat Mar 27 08:00:16 2010	(r205728)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include "usbhid.h"
@@ -36,18 +37,27 @@ __FBSDID("$FreeBSD$");
 int
 hid_get_data(const void *p, const hid_item_t *h)
 {
-	const unsigned char *buf;
-	unsigned int hpos;
-	unsigned int hsize;
-	int data;
+	const uint8_t *buf;
+	uint32_t hpos;
+	uint32_t hsize;
+	uint32_t data;
 	int i, end, offs;
 
 	buf = p;
+
+	/* Skip report ID byte. */
+	if (h->report_ID > 0)
+		buf++;
+
 	hpos = h->pos;			/* bit position of data */
 	hsize = h->report_size;		/* bit length of data */
 
+	/* Range check and limit */
 	if (hsize == 0)
 		return (0);
+	if (hsize > 32)
+		hsize = 32;
+
 	offs = hpos / 8;
 	end = (hpos + hsize) / 8 - offs;
 	data = 0;
@@ -66,12 +76,17 @@ hid_get_data(const void *p, const hid_it
 void
 hid_set_data(void *p, const hid_item_t *h, int data)
 {
-	unsigned char *buf;
-	unsigned int hpos;
-	unsigned int hsize;
+	uint8_t *buf;
+	uint32_t hpos;
+	uint32_t hsize;
 	int i, end, offs, mask;
 
 	buf = p;
+
+	/* Set report ID byte. */
+	if (h->report_ID > 0)
+		*buf++ = h->report_ID & 0xff;
+
 	hpos = h->pos;			/* bit position of data */
 	hsize = h->report_size;		/* bit length of data */
 
@@ -90,5 +105,5 @@ hid_set_data(void *p, const hid_item_t *
 
 	for (i = 0; i <= end; i++)
 		buf[offs + i] = (buf[offs + i] & (mask >> (i*8))) |
-			((data >> (i*8)) & 0xff);
+		    ((data >> (i*8)) & 0xff);
 }

Modified: head/lib/libusbhid/descr.c
==============================================================================
--- head/lib/libusbhid/descr.c	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/descr.c	Sat Mar 27 08:00:16 2010	(r205728)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
 #include 
 
 #include "usbhid.h"
@@ -59,9 +58,30 @@ hid_set_immed(int fd, int enable)
 int
 hid_get_report_id(int fd)
 {
+	report_desc_t rep;
+	hid_data_t d;
+	hid_item_t h;
+	int kindset;
 	int temp = -1;
 	int ret;
 
+	if ((rep = hid_get_report_desc(fd)) == NULL)
+		goto use_ioctl;
+	kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature;
+	for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) {
+		/* Return the first report ID we met. */
+		if (h.report_ID != 0) {
+			temp = h.report_ID;
+			break;
+		}
+	}
+	hid_end_parse(d);
+	hid_dispose_report_desc(rep);
+
+	if (temp > 0)
+		return (temp);
+
+use_ioctl:
 	ret = ioctl(fd, USB_GET_REPORT_ID, &temp);
 #ifdef HID_COMPAT7
 	if (ret < 0)

Modified: head/lib/libusbhid/parse.c
==============================================================================
--- head/lib/libusbhid/parse.c	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/parse.c	Sat Mar 27 08:00:16 2010	(r205728)
@@ -40,42 +40,43 @@ __FBSDID("$FreeBSD$");
 #include "usbhid.h"
 #include "usbvar.h"
 
-#define MAXUSAGE 100
-struct hid_data {
-	u_char *start;
-	u_char *end;
-	u_char *p;
-	hid_item_t cur;
-	unsigned int usages[MAXUSAGE];
-	int nusage;
-	int minset;
-	int logminsize;
-	int multi;
-	int multimax;
-	int kindset;
-	int reportid;
-
-	/*
-	 * The start of collection item has no report ID set, so save
-	 * it until we know the ID.
-	 */
-	hid_item_t savedcoll;
-	u_char hassavedcoll;
-	/*
-	 * Absolute data position (bits) for input/output/feature.
-	 *  Assumes that hid_input, hid_output and hid_feature have
-	 *  values 0, 1 and 2.
-	 */
-	unsigned int kindpos[3];
+#define	MAXUSAGE 100
+#define	MAXPUSH 4
+#define	MAXID 64
+
+struct hid_pos_data {
+	int32_t rid;
+	uint32_t pos;
 };
 
-static int min(int x, int y) { return x < y ? x : y; }
-
-static int hid_get_item_raw(hid_data_t s, hid_item_t *h);
+struct hid_data {
+	const uint8_t *start;
+	const uint8_t *end;
+	const uint8_t *p;
+	struct hid_item cur[MAXPUSH];
+	struct hid_pos_data last_pos[MAXID];
+	int32_t usages_min[MAXUSAGE];
+	int32_t usages_max[MAXUSAGE];
+	int32_t usage_last;	/* last seen usage */
+	uint32_t loc_size;	/* last seen size */
+	uint32_t loc_count;	/* last seen count */
+	uint8_t	kindset;	/* we have 5 kinds so 8 bits are enough */
+	uint8_t	pushlevel;	/* current pushlevel */
+	uint8_t	ncount;		/* end usage item count */
+	uint8_t icount;		/* current usage item count */
+	uint8_t	nusage;		/* end "usages_min/max" index */
+	uint8_t	iusage;		/* current "usages_min/max" index */
+	uint8_t ousage;		/* current "usages_min/max" offset */
+	uint8_t	susage;		/* usage set flags */
+};
 
+/*------------------------------------------------------------------------*
+ *	hid_clear_local
+ *------------------------------------------------------------------------*/
 static void
 hid_clear_local(hid_item_t *c)
 {
+
 	c->usage = 0;
 	c->usage_minimum = 0;
 	c->usage_maximum = 0;
@@ -88,8 +89,61 @@ hid_clear_local(hid_item_t *c)
 	c->set_delimiter = 0;
 }
 
+static void
+hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID)
+{
+	uint8_t i;
+
+	/* check for same report ID - optimise */
+
+	if (c->report_ID == next_rID)
+		return;
+
+	/* save current position for current rID */
+
+	if (c->report_ID == 0) {
+		i = 0;
+	} else {
+		for (i = 1; i != MAXID; i++) {
+			if (s->last_pos[i].rid == c->report_ID)
+				break;
+			if (s->last_pos[i].rid == 0)
+				break;
+		}
+	}
+	if (i != MAXID) {
+		s->last_pos[i].rid = c->report_ID;
+		s->last_pos[i].pos = c->pos;
+	}
+
+	/* store next report ID */
+
+	c->report_ID = next_rID;
+
+	/* lookup last position for next rID */
+
+	if (next_rID == 0) {
+		i = 0;
+	} else {
+		for (i = 1; i != MAXID; i++) {
+			if (s->last_pos[i].rid == next_rID)
+				break;
+			if (s->last_pos[i].rid == 0)
+				break;
+		}
+	}
+	if (i != MAXID) {
+		s->last_pos[i].rid = next_rID;
+		c->pos = s->last_pos[i].pos;
+	} else
+		c->pos = 0;	/* Out of RID entries. */
+}
+
+/*------------------------------------------------------------------------*
+ *	hid_start_parse
+ *------------------------------------------------------------------------*/
 hid_data_t
-hid_start_parse(report_desc_t d, int kindset, int id)
+hid_start_parse(report_desc_t d, int kindset, int id __unused)
 {
 	struct hid_data *s;
 
@@ -98,213 +152,207 @@ hid_start_parse(report_desc_t d, int kin
 	s->start = s->p = d->data;
 	s->end = d->data + d->size;
 	s->kindset = kindset;
-	s->reportid = id;
-	s->hassavedcoll = 0;
 	return (s);
 }
 
+/*------------------------------------------------------------------------*
+ *	hid_end_parse
+ *------------------------------------------------------------------------*/
 void
 hid_end_parse(hid_data_t s)
 {
-	while (s->cur.next) {
-		hid_item_t *hi = s->cur.next->next;
-		free(s->cur.next);
-		s->cur.next = hi;
-	}
+
+	if (s == NULL)
+		return;
+
 	free(s);
 }
 
-int
-hid_get_item(hid_data_t s, hid_item_t *h)
+/*------------------------------------------------------------------------*
+ *	get byte from HID descriptor
+ *------------------------------------------------------------------------*/
+static uint8_t
+hid_get_byte(struct hid_data *s, const uint16_t wSize)
 {
-	int r;
+	const uint8_t *ptr;
+	uint8_t retval;
 
-	for (;;) {
-		r = hid_get_item_raw(s, h);
-		if (r <= 0)
-			break;
-		if (h->report_ID == s->reportid || s->reportid == -1)
-			break;
-	}
-	return (r);
-}
+	ptr = s->p;
+
+	/* check if end is reached */
+	if (ptr == s->end)
+		return (0);
 
-#define REPORT_SAVED_COLL \
-	do { \
-		if (s->hassavedcoll) { \
-			*h = s->savedcoll; \
-			h->report_ID = c->report_ID; \
-			s->hassavedcoll = 0; \
-			return (1); \
-		} \
-	} while(/*LINTED*/ 0)
+	/* read out a byte */
+	retval = *ptr;
 
-static int
-hid_get_item_raw(hid_data_t s, hid_item_t *h)
+	/* check if data pointer can be advanced by "wSize" bytes */
+	if ((s->end - ptr) < wSize)
+		ptr = s->end;
+	else
+		ptr += wSize;
+
+	/* update pointer */
+	s->p = ptr;
+
+	return (retval);
+}
+
+/*------------------------------------------------------------------------*
+ *	hid_get_item
+ *------------------------------------------------------------------------*/
+int
+hid_get_item(hid_data_t s, hid_item_t *h)
 {
 	hid_item_t *c;
-	unsigned int bTag = 0, bType = 0, bSize;
-	unsigned char *data;
-	int dval;
-	unsigned char *p;
-	hid_item_t *hi;
-	hid_item_t nc;
-	int i;
-	hid_kind_t retkind;
+	unsigned int bTag, bType, bSize;
+	uint32_t oldpos;
+	int32_t mask;
+	int32_t dval;
 
-	c = &s->cur;
+	if (s == NULL)
+		return (0);
+
+	c = &s->cur[s->pushlevel];
 
  top:
-	if (s->multimax) {
-		REPORT_SAVED_COLL;
-		if (c->logical_minimum >= c->logical_maximum) {
-			if (s->logminsize == 1)
-				c->logical_minimum =(int8_t)c->logical_minimum;
-			else if (s->logminsize == 2)
-				c->logical_minimum =(int16_t)c->logical_minimum;
+	/* check if there is an array of items */
+	if (s->icount < s->ncount) {
+		/* get current usage */
+		if (s->iusage < s->nusage) {
+			dval = s->usages_min[s->iusage] + s->ousage;
+			c->usage = dval;
+			s->usage_last = dval;
+			if (dval == s->usages_max[s->iusage]) {
+				s->iusage ++;
+				s->ousage = 0;
+			} else {
+				s->ousage ++;
+			}
+		} else {
+			/* Using last usage */
+			dval = s->usage_last;
 		}
-		if (s->multi < s->multimax) {
-			c->usage = s->usages[min(s->multi, s->nusage-1)];
-			s->multi++;
+		s->icount ++;
+		/* 
+		 * Only copy HID item, increment position and return
+		 * if correct kindset!
+		 */
+		if (s->kindset & (1 << c->kind)) {
 			*h = *c;
-			/*
-			 * 'multimax' is only non-zero if the current
-                         *  item kind is input/output/feature
-			 */
-			h->pos = s->kindpos[c->kind];
-			s->kindpos[c->kind] += c->report_size;
-			h->next = 0;
+			c->pos += c->report_size * c->report_count;
 			return (1);
-		} else {
-			c->report_count = s->multimax;
-			s->multimax = 0;
-			s->nusage = 0;
-			hid_clear_local(c);
 		}
 	}
-	for (;;) {
-		p = s->p;
-		if (p >= s->end)
-			return (0);
 
-		bSize = *p++;
+	/* reset state variables */
+	s->icount = 0;
+	s->ncount = 0;
+	s->iusage = 0;
+	s->nusage = 0;
+	s->susage = 0;
+	s->ousage = 0;
+	hid_clear_local(c);
+
+	/* get next item */
+	while (s->p != s->end) {
+
+		bSize = hid_get_byte(s, 1);
 		if (bSize == 0xfe) {
 			/* long item */
-			bSize = *p++;
-			bSize |= *p++ << 8;
-			bTag = *p++;
-			data = p;
-			p += bSize;
+			bSize = hid_get_byte(s, 1);
+			bSize |= hid_get_byte(s, 1) << 8;
+			bTag = hid_get_byte(s, 1);
+			bType = 0xff;	/* XXX what should it be */
 		} else {
 			/* short item */
 			bTag = bSize >> 4;
 			bType = (bSize >> 2) & 3;
 			bSize &= 3;
-			if (bSize == 3) bSize = 4;
-			data = p;
-			p += bSize;
+			if (bSize == 3)
+				bSize = 4;
 		}
-		s->p = p;
-		/*
-		 * The spec is unclear if the data is signed or unsigned.
-		 */
+
 		switch(bSize) {
 		case 0:
 			dval = 0;
+			mask = 0;
 			break;
 		case 1:
-			dval = *data++;
+			dval = (int8_t)hid_get_byte(s, 1);
+			mask = 0xFF;
 			break;
 		case 2:
-			dval = *data++;
-			dval |= *data++ << 8;
+			dval = hid_get_byte(s, 1);
+			dval |= hid_get_byte(s, 1) << 8;
+			dval = (int16_t)dval;
+			mask = 0xFFFF;
 			break;
 		case 4:
-			dval = *data++;
-			dval |= *data++ << 8;
-			dval |= *data++ << 16;
-			dval |= *data++ << 24;
+			dval = hid_get_byte(s, 1);
+			dval |= hid_get_byte(s, 1) << 8;
+			dval |= hid_get_byte(s, 1) << 16;
+			dval |= hid_get_byte(s, 1) << 24;
+			mask = 0xFFFFFFFF;
 			break;
 		default:
-			return (-1);
+			dval = hid_get_byte(s, bSize);
+			continue;
 		}
 
 		switch (bType) {
-		case 0:			/* Main */
+		case 0:		/* Main */
 			switch (bTag) {
-			case 8:		/* Input */
-				retkind = hid_input;
-			ret:
-				if (!(s->kindset & (1 << retkind))) {
-					/* Drop the items of this kind */
-					s->nusage = 0;
-					continue;
-				}
-				c->kind = retkind;
+			case 8:	/* Input */
+				c->kind = hid_input;
 				c->flags = dval;
+		ret:
+				c->report_count = s->loc_count;
+				c->report_size = s->loc_size;
+
 				if (c->flags & HIO_VARIABLE) {
-					s->multimax = c->report_count;
-					s->multi = 0;
+					/* range check usage count */
+					if (c->report_count > 255) {
+						s->ncount = 255;
+					} else
+						s->ncount = c->report_count;
+
+					/* 
+					 * The "top" loop will return
+					 * one and one item:
+					 */
 					c->report_count = 1;
-					if (s->minset) {
-						for (i = c->usage_minimum;
-						     i <= c->usage_maximum;
-						     i++) {
-							s->usages[s->nusage] = i;
-							if (s->nusage < MAXUSAGE-1)
-								s->nusage++;
-						}
-						c->usage_minimum = 0;
-						c->usage_maximum = 0;
-						s->minset = 0;
-					}
-					goto top;
 				} else {
-					if (s->minset)
-						c->usage = c->usage_minimum;
-					*h = *c;
-					h->next = 0;
-					h->pos = s->kindpos[c->kind];
-					s->kindpos[c->kind] +=
-					    c->report_size * c->report_count;
-					hid_clear_local(c);
-					s->minset = 0;
-					return (1);
+					s->ncount = 1;
 				}
-			case 9:		/* Output */
-				retkind = hid_output;
+				goto top;
+
+			case 9:	/* Output */
+				c->kind = hid_output;
+				c->flags = dval;
 				goto ret;
 			case 10:	/* Collection */
 				c->kind = hid_collection;
 				c->collection = dval;
 				c->collevel++;
-				nc = *c;
-				hid_clear_local(c);
-				/*c->report_ID = NO_REPORT_ID;*/
-				s->nusage = 0;
-				if (s->hassavedcoll) {
-					*h = s->savedcoll;
-					h->report_ID = nc.report_ID;
-					s->savedcoll = nc;
-					return (1);
-				} else {
-					s->hassavedcoll = 1;
-					s->savedcoll = nc;
-				}
-				break;
+				c->usage = s->usage_last;
+				*h = *c;
+				return (1);
 			case 11:	/* Feature */
-				retkind = hid_feature;
+				c->kind = hid_feature;
+				c->flags = dval;
 				goto ret;
 			case 12:	/* End collection */
-				REPORT_SAVED_COLL;
 				c->kind = hid_endcollection;
+				if (c->collevel == 0) {
+					/* Invalid end collection. */
+					return (0);
+				}
 				c->collevel--;
 				*h = *c;
-				/*hid_clear_local(c);*/
-				s->nusage = 0;
 				return (1);
 			default:
-				return (-2);
+				break;
 			}
 			break;
 
@@ -315,13 +363,12 @@ hid_get_item_raw(hid_data_t s, hid_item_
 				break;
 			case 1:
 				c->logical_minimum = dval;
-				s->logminsize = bSize;
 				break;
 			case 2:
 				c->logical_maximum = dval;
 				break;
 			case 3:
-				c->physical_maximum = dval;
+				c->physical_minimum = dval;
 				break;
 			case 4:
 				c->physical_maximum = dval;
@@ -333,45 +380,97 @@ hid_get_item_raw(hid_data_t s, hid_item_
 				c->unit = dval;
 				break;
 			case 7:
-				c->report_size = dval;
+				/* mask because value is unsigned */
+				s->loc_size = dval & mask;
 				break;
 			case 8:
-				c->report_ID = dval;
-				s->kindpos[hid_input] =
-				    s->kindpos[hid_output] =
-				    s->kindpos[hid_feature] = 0;
+				hid_switch_rid(s, c, dval);
 				break;
 			case 9:
-				c->report_count = dval;
+				/* mask because value is unsigned */
+				s->loc_count = dval & mask;
 				break;
-			case 10: /* Push */
-				hi = malloc(sizeof *hi);
-				*hi = s->cur;
-				c->next = hi;
-				break;
-			case 11: /* Pop */
-				hi = c->next;
-				s->cur = *hi;
-				free(hi);
+			case 10:	/* Push */
+				s->pushlevel ++;
+				if (s->pushlevel < MAXPUSH) {
+					s->cur[s->pushlevel] = *c;
+					/* store size and count */
+					c->report_size = s->loc_size;
+					c->report_count = s->loc_count;
+					/* update current item pointer */
+					c = &s->cur[s->pushlevel];
+				}
+				break;
+			case 11:	/* Pop */
+				s->pushlevel --;
+				if (s->pushlevel < MAXPUSH) {
+					/* preserve position */
+					oldpos = c->pos;
+					c = &s->cur[s->pushlevel];
+					/* restore size and count */
+					s->loc_size = c->report_size;
+					s->loc_count = c->report_count;
+					/* set default item location */
+					c->pos = oldpos;
+					c->report_size = 0;
+					c->report_count = 0;
+				}
 				break;
 			default:
-				return (-3);
+				break;
 			}
 			break;
 		case 2:		/* Local */
 			switch (bTag) {
 			case 0:
-				c->usage = c->_usage_page | dval;
-				if (s->nusage < MAXUSAGE)
-					s->usages[s->nusage++] = c->usage;
+				if (bSize != 4)
+					dval = (dval & mask) | c->_usage_page;
+
+				/* set last usage, in case of a collection */
+				s->usage_last = dval;
+
+				if (s->nusage < MAXUSAGE) {
+					s->usages_min[s->nusage] = dval;
+					s->usages_max[s->nusage] = dval;
+					s->nusage ++;
+				}
 				/* else XXX */
+
+				/* clear any pending usage sets */
+				s->susage = 0;
 				break;
 			case 1:
-				s->minset = 1;
-				c->usage_minimum = c->_usage_page | dval;
-				break;
+				s->susage |= 1;
+
+				if (bSize != 4)
+					dval = (dval & mask) | c->_usage_page;
+				c->usage_minimum = dval;
+
+				goto check_set;
 			case 2:
-				c->usage_maximum = c->_usage_page | dval;
+				s->susage |= 2;
+
+				if (bSize != 4)
+					dval = (dval & mask) | c->_usage_page;
+				c->usage_maximum = dval;
+
+			check_set:
+				if (s->susage != 3)
+					break;
+
+				/* sanity check */
+				if ((s->nusage < MAXUSAGE) &&
+				    (c->usage_minimum <= c->usage_maximum)) {
+					/* add usage range */
+					s->usages_min[s->nusage] = 
+					    c->usage_minimum;
+					s->usages_max[s->nusage] = 
+					    c->usage_maximum;
+					s->nusage ++;
+				}
+				/* else XXX */
+
+				s->susage = 0;
 				break;
 			case 3:
 				c->designator_index = dval;
@@ -395,40 +494,63 @@ hid_get_item_raw(hid_data_t s, hid_item_
 				c->set_delimiter = dval;
 				break;
 			default:
-				return (-4);
+				break;
 			}
 			break;
 		default:
-			return (-5);
+			break;
 		}
 	}
+	return (0);
 }
 
 int
 hid_report_size(report_desc_t r, enum hid_kind k, int id)
 {
 	struct hid_data *d;
-	hid_item_t h;
-	int size;
+	struct hid_item h;
+	uint32_t temp;
+	uint32_t hpos;
+	uint32_t lpos;
+
+	hpos = 0;
+	lpos = 0xFFFFFFFF;
 
 	memset(&h, 0, sizeof h);
-	size = 0;
-	for (d = hid_start_parse(r, 1<kindpos[k];
+			/* compute minimum */
+			if (lpos > h.pos)
+				lpos = h.pos;
+			/* compute end position */
+			temp = h.pos + (h.report_size * h.report_count);
+			/* compute maximum */
+			if (hpos < temp)
+				hpos = temp;
 		}
 	}
 	hid_end_parse(d);
-	return ((size + 7) / 8);
+
+	/* safety check - can happen in case of currupt descriptors */
+	if (lpos > hpos)
+		temp = 0;
+	else
+		temp = hpos - lpos;
+
+	if (id)
+		temp += 8;
+
+	/* return length in bytes rounded up */
+	return ((temp + 7) / 8);
 }
 
 int
 hid_locate(report_desc_t desc, unsigned int u, enum hid_kind k,
 	   hid_item_t *h, int id)
 {
-	hid_data_t d;
+	struct hid_data *d;
 
-	for (d = hid_start_parse(desc, 1<kind == k && !(h->flags & HIO_CONST) && h->usage == u) {
 			hid_end_parse(d);
 			return (1);

Modified: head/lib/libusbhid/usage.c
==============================================================================
--- head/lib/libusbhid/usage.c	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/usage.c	Sat Mar 27 08:00:16 2010	(r205728)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 #include 

Modified: head/lib/libusbhid/usbhid.h
==============================================================================
--- head/lib/libusbhid/usbhid.h	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/usbhid.h	Sat Mar 27 08:00:16 2010	(r205728)
@@ -29,52 +29,48 @@
  *
  */
 
-#include 
+#include 
 
 typedef struct report_desc *report_desc_t;
 
 typedef struct hid_data *hid_data_t;
 
 typedef enum hid_kind {
-	hid_input = 0,
-	hid_output = 1,
-	hid_feature = 2,
-	hid_collection,
-	hid_endcollection
+	hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
 } hid_kind_t;
 
 typedef struct hid_item {
 	/* Global */
-	unsigned int _usage_page;
-	int logical_minimum;
-	int logical_maximum;
-	int physical_minimum;
-	int physical_maximum;
-	int unit_exponent;
-	int unit;
-	int report_size;
-	int report_ID;
+	uint32_t _usage_page;
+	int32_t logical_minimum;
+	int32_t logical_maximum;
+	int32_t physical_minimum;
+	int32_t physical_maximum;
+	int32_t unit_exponent;
+	int32_t unit;
+	int32_t report_size;
+	int32_t report_ID;
 #define NO_REPORT_ID 0
-	int report_count;
+	int32_t report_count;
 	/* Local */
-	unsigned int usage;
-	int usage_minimum;
-	int usage_maximum;
-	int designator_index;
-	int designator_minimum;
-	int designator_maximum;
-	int string_index;
-	int string_minimum;
-	int string_maximum;
-	int set_delimiter;
+	uint32_t usage;
+	int32_t usage_minimum;
+	int32_t usage_maximum;
+	int32_t designator_index;
+	int32_t designator_minimum;
+	int32_t designator_maximum;
+	int32_t string_index;
+	int32_t string_minimum;
+	int32_t string_maximum;
+	int32_t set_delimiter;
 	/* Misc */
-	int collection;
-	int collevel;
+	int32_t collection;
+	int	collevel;
 	enum hid_kind kind;
-	unsigned int flags;
-	/* Absolute data position (bits) */
-	unsigned int pos;
-	/* */
+	uint32_t flags;
+	/* Location */
+	uint32_t pos;
+	/* unused */
 	struct hid_item *next;
 } hid_item_t;
 
@@ -95,7 +91,8 @@ hid_data_t hid_start_parse(report_desc_t
 void hid_end_parse(hid_data_t s);
 int hid_get_item(hid_data_t s, hid_item_t *h);
 int hid_report_size(report_desc_t d, enum hid_kind k, int id);
-int hid_locate(report_desc_t d, unsigned int usage, enum hid_kind k, hid_item_t *h, int id);
+int hid_locate(report_desc_t d, unsigned int usage, enum hid_kind k,
+    hid_item_t *h, int id);
 
 /* Conversion to/from usage names, usage.c: */
 const char *hid_usage_page(int i);

Modified: head/lib/libusbhid/usbvar.h
==============================================================================
--- head/lib/libusbhid/usbvar.h	Sat Mar 27 06:53:11 2010	(r205727)
+++ head/lib/libusbhid/usbvar.h	Sat Mar 27 08:00:16 2010	(r205728)
@@ -30,8 +30,8 @@
  */
 
 struct report_desc {
-	unsigned int size;
-	unsigned char data[1];
+	uint32_t size;
+	uint8_t data[1];
 };
 
 /* internal backwards compatibility functions */

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 11:08:45 2010
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB5F5106566B;
	Sat, 27 Mar 2010 11:08:45 +0000 (UTC)
	(envelope-from ticso@cicely7.cicely.de)
Received: from raven.bwct.de (raven.bwct.de [85.159.14.73])
	by mx1.freebsd.org (Postfix) with ESMTP id 6ADB78FC12;
	Sat, 27 Mar 2010 11:08:44 +0000 (UTC)
Received: from mail.cicely.de ([10.1.1.37])
	by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o2RB8gvx055456
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 27 Mar 2010 12:08:42 +0100 (CET)
	(envelope-from ticso@cicely7.cicely.de)
Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9])
	by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o2RB8ajE093408
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 27 Mar 2010 12:08:36 +0100 (CET)
	(envelope-from ticso@cicely7.cicely.de)
Received: from cicely7.cicely.de (localhost [127.0.0.1])
	by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o2RB8ZmX043753;
	Sat, 27 Mar 2010 12:08:35 +0100 (CET)
	(envelope-from ticso@cicely7.cicely.de)
Received: (from ticso@localhost)
	by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o2RB8Z5e043752;
	Sat, 27 Mar 2010 12:08:35 +0100 (CET) (envelope-from ticso)
Date: Sat, 27 Mar 2010 12:08:35 +0100
From: Bernd Walter 
To: Ivan Voras 
Message-ID: <20100327110835.GB7176@cicely7.cicely.de>
References: <7d6fde3d1003182333m336d52fbh987035a21568250d@mail.gmail.com>
	<9bbcef731003190913k4f3afbd8mb4e767c40433be8e@mail.gmail.com>
	<20100319162249.GD67820@netch.kiev.ua>
	<9bbcef731003190928l165c6279p6244f0c97a92600a@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <9bbcef731003190928l165c6279p6244f0c97a92600a@mail.gmail.com>
X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386
User-Agent: Mutt/1.5.11
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9,
	T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de
Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Xin LI , svn-src-head@FreeBSD.org,
	Garrett Cooper , netch@netch.kiev.ua
Subject: Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn
	commit: r205307 - head/sys/i386/conf]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: ticso@cicely.de
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 11:08:46 -0000

On Fri, Mar 19, 2010 at 05:28:06PM +0100, Ivan Voras wrote:
> On 19 March 2010 17:22, Valentin Nechayev  wrote:
> >  Fri, Mar 19, 2010 at 17:13:00, ivoras wrote about "Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]":
> >
> >> SSE in the userland you mean? Regardless, I don't think there is now
> >> reason for compiling everything as for i386. E.g. why not add at least
> >> -mtune=generic or even also -march=i686 to default gcc options?
> >>
> >> http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
> >
> > Having userland compiled with i686 will give the same effect as i686-only
> > kernel: it won't boot on machines which doesn't conform to. If it is
> > supposed to boot on i486 and higher, no more than -march=i486 can be used.
> 
> Yes, this is how I read the change - the move from "i386" to "i686". I
> apologize if I got it wrong :)
> 
> As it was pointed out earlier - small systems users and designers
> probably have special install procedures because of the nature of the
> business.

The assumption is wrong to my knowledge.
I think it is a fact that an old 586 usually can't boot our CDs.
It is also true that many embedded boards don't have CD boot support,
like Soekris systems.
But there are also some miniATX systems build on 586 class CPUs, which
have recent BIOS code and can boot from CD.
It is also quite common for unexeperienced users to binary install the
HDD in a modern system.
This is not business, because many home users run such small systems as
storage servers, gateways, dhcp, ... - there are many unexperienced
users with such systems.

-- 
B.Walter  http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 13:43:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CB101065670;
	Sat, 27 Mar 2010 13:43:19 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B71A8FC17;
	Sat, 27 Mar 2010 13:43:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2RDhJqx000792;
	Sat, 27 Mar 2010 13:43:19 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2RDhJ5p000791;
	Sat, 27 Mar 2010 13:43:19 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <201003271343.o2RDhJ5p000791@svn.freebsd.org>
From: Antoine Brodin 
Date: Sat, 27 Mar 2010 13:43:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205729 - in head/contrib/bsnmp: gensnmpdef snmpd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 13:43:19 -0000

Author: antoine
Date: Sat Mar 27 13:43:18 2010
New Revision: 205729
URL: http://svn.freebsd.org/changeset/base/205729

Log:
  (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.
  
  Approved by:	harti@

Modified:
  head/contrib/bsnmp/gensnmpdef/gensnmpdef.c
  head/contrib/bsnmp/snmpd/config.c

Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c
==============================================================================
--- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c	Sat Mar 27 08:00:16 2010	(r205728)
+++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c	Sat Mar 27 13:43:18 2010	(r205729)
@@ -59,7 +59,7 @@ struct tdef {
 	SLIST_ENTRY(tdef) link;
 };
 
-static SLIST_HEAD(, tdef) tdefs = SLIST_HEAD_INITIALIZER(tdef);
+static SLIST_HEAD(, tdef) tdefs = SLIST_HEAD_INITIALIZER(tdefs);
 static int do_typedef = 0;
 
 static void print_node(SmiNode *n, u_int level);

Modified: head/contrib/bsnmp/snmpd/config.c
==============================================================================
--- head/contrib/bsnmp/snmpd/config.c	Sat Mar 27 08:00:16 2010	(r205728)
+++ head/contrib/bsnmp/snmpd/config.c	Sat Mar 27 13:43:18 2010	(r205729)
@@ -134,7 +134,7 @@ struct macro {
 	LIST_ENTRY(macro) link;
 	int	perm;
 };
-static LIST_HEAD(, macro) macros = LIST_HEAD_INITIALIZER(¯os);
+static LIST_HEAD(, macro) macros = LIST_HEAD_INITIALIZER(macros);
 
 enum {
 	TOK_EOF	= 0200,

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 15:39:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E04451065672;
	Sat, 27 Mar 2010 15:39:19 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CF4CC8FC14;
	Sat, 27 Mar 2010 15:39:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2RFdJ4b026588;
	Sat, 27 Mar 2010 15:39:19 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2RFdJoL026586;
	Sat, 27 Mar 2010 15:39:19 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201003271539.o2RFdJoL026586@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 27 Mar 2010 15:39:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205734 - head/sys/dev/sound/pcm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 15:39:20 -0000

Author: mav
Date: Sat Mar 27 15:39:19 2010
New Revision: 205734
URL: http://svn.freebsd.org/changeset/base/205734

Log:
  Fix lock leakage.
  
  PR:		kern/145081

Modified:
  head/sys/dev/sound/pcm/dsp.c

Modified: head/sys/dev/sound/pcm/dsp.c
==============================================================================
--- head/sys/dev/sound/pcm/dsp.c	Sat Mar 27 15:05:06 2010	(r205733)
+++ head/sys/dev/sound/pcm/dsp.c	Sat Mar 27 15:39:19 2010	(r205734)
@@ -1071,6 +1071,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd
 	if (IOCGROUP(cmd) == 'M') {
 		if (cmd == OSS_GETVERSION) {
 			*arg_i = SOUND_VERSION;
+			PCM_GIANT_EXIT(d);
 			return (0);
 		}
 		ret = dsp_ioctl_channel(i_dev, PCM_VOLCH(i_dev), cmd, arg);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 16:35:08 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAA5D1065678;
	Sat, 27 Mar 2010 16:35:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 994CE8FC21;
	Sat, 27 Mar 2010 16:35:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2RGZ8Ai039047;
	Sat, 27 Mar 2010 16:35:08 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2RGZ8QM039046;
	Sat, 27 Mar 2010 16:35:08 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201003271635.o2RGZ8QM039046@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 27 Mar 2010 16:35:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205738 - head/sbin/hastd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 16:35:08 -0000

Author: pjd
Date: Sat Mar 27 16:35:07 2010
New Revision: 205738
URL: http://svn.freebsd.org/changeset/base/205738

Log:
  Don't hold connection lock when doing reconnects as it makes I/Os wait for
  connection timeouts.
  
  Reported by:	Kevin Day 

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Sat Mar 27 16:31:49 2010	(r205737)
+++ head/sbin/hastd/primary.c	Sat Mar 27 16:35:07 2010	(r205738)
@@ -460,9 +460,11 @@ init_local(struct hast_resource *res)
 		exit(EX_NOINPUT);
 }
 
-static void
-init_remote(struct hast_resource *res)
+static bool
+init_remote(struct hast_resource *res, struct proto_conn **inp,
+    struct proto_conn **outp)
 {
+	struct proto_conn *in, *out;
 	struct nv *nvout, *nvin;
 	const unsigned char *token;
 	unsigned char *map;
@@ -472,13 +474,17 @@ init_remote(struct hast_resource *res)
 	uint32_t mapsize;
 	size_t size;
 
+	assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL));
+
+	in = out = NULL;
+
 	/* Prepare outgoing connection with remote node. */
-	if (proto_client(res->hr_remoteaddr, &res->hr_remoteout) < 0) {
+	if (proto_client(res->hr_remoteaddr, &out) < 0) {
 		primary_exit(EX_OSERR, "Unable to create connection to %s",
 		    res->hr_remoteaddr);
 	}
 	/* Try to connect, but accept failure. */
-	if (proto_connect(res->hr_remoteout) < 0) {
+	if (proto_connect(out) < 0) {
 		pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
 		    res->hr_remoteaddr);
 		goto close;
@@ -496,7 +502,7 @@ init_remote(struct hast_resource *res)
 		nv_free(nvout);
 		goto close;
 	}
-	if (hast_proto_send(res, res->hr_remoteout, nvout, NULL, 0) < 0) {
+	if (hast_proto_send(res, out, nvout, NULL, 0) < 0) {
 		pjdlog_errno(LOG_WARNING,
 		    "Unable to send handshake header to %s",
 		    res->hr_remoteaddr);
@@ -504,7 +510,7 @@ init_remote(struct hast_resource *res)
 		goto close;
 	}
 	nv_free(nvout);
-	if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) {
+	if (hast_proto_recv_hdr(out, &nvin) < 0) {
 		pjdlog_errno(LOG_WARNING,
 		    "Unable to receive handshake header from %s",
 		    res->hr_remoteaddr);
@@ -536,12 +542,12 @@ init_remote(struct hast_resource *res)
 	 * Second handshake step.
 	 * Setup incoming connection with remote node.
 	 */
-	if (proto_client(res->hr_remoteaddr, &res->hr_remotein) < 0) {
+	if (proto_client(res->hr_remoteaddr, &in) < 0) {
 		pjdlog_errno(LOG_WARNING, "Unable to create connection to %s",
 		    res->hr_remoteaddr);
 	}
 	/* Try to connect, but accept failure. */
-	if (proto_connect(res->hr_remotein) < 0) {
+	if (proto_connect(in) < 0) {
 		pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
 		    res->hr_remoteaddr);
 		goto close;
@@ -560,7 +566,7 @@ init_remote(struct hast_resource *res)
 		nv_free(nvout);
 		goto close;
 	}
-	if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) < 0) {
+	if (hast_proto_send(res, in, nvout, NULL, 0) < 0) {
 		pjdlog_errno(LOG_WARNING,
 		    "Unable to send handshake header to %s",
 		    res->hr_remoteaddr);
@@ -568,7 +574,7 @@ init_remote(struct hast_resource *res)
 		goto close;
 	}
 	nv_free(nvout);
-	if (hast_proto_recv_hdr(res->hr_remoteout, &nvin) < 0) {
+	if (hast_proto_recv_hdr(out, &nvin) < 0) {
 		pjdlog_errno(LOG_WARNING,
 		    "Unable to receive handshake header from %s",
 		    res->hr_remoteaddr);
@@ -611,7 +617,7 @@ init_remote(struct hast_resource *res)
 		 * Remote node have some dirty extents on its own, lets
 		 * download its activemap.
 		 */
-		if (hast_proto_recv_data(res, res->hr_remoteout, nvin, map,
+		if (hast_proto_recv_data(res, out, nvin, map,
 		    mapsize) < 0) {
 			pjdlog_errno(LOG_ERR,
 			    "Unable to receive remote activemap");
@@ -631,18 +637,29 @@ init_remote(struct hast_resource *res)
 		(void)hast_activemap_flush(res);
 	}
 	pjdlog_info("Connected to %s.", res->hr_remoteaddr);
+	if (inp != NULL && outp != NULL) {
+		*inp = in;
+		*outp = out;
+	} else {
+		res->hr_remotein = in;
+		res->hr_remoteout = out;
+	}
+	return (true);
+close:
+	proto_close(out);
+	if (in != NULL)
+		proto_close(in);
+	return (false);
+}
+
+static void
+sync_start(void)
+{
+
 	mtx_lock(&sync_lock);
 	sync_inprogress = true;
 	mtx_unlock(&sync_lock);
 	cv_signal(&sync_cond);
-	return;
-close:
-	proto_close(res->hr_remoteout);
-	res->hr_remoteout = NULL;
-	if (res->hr_remotein != NULL) {
-		proto_close(res->hr_remotein);
-		res->hr_remotein = NULL;
-	}
 }
 
 static void
@@ -735,7 +752,8 @@ hastd_primary(struct hast_resource *res)
 	setproctitle("%s (primary)", res->hr_name);
 
 	init_local(res);
-	init_remote(res);
+	if (init_remote(res, NULL, NULL))
+		sync_start();
 	init_ggate(res);
 	init_environment(res);
 	error = pthread_create(&td, NULL, ggate_recv_thread, res);
@@ -1695,6 +1713,7 @@ static void *
 guard_thread(void *arg)
 {
 	struct hast_resource *res = arg;
+	struct proto_conn *in, *out;
 	unsigned int ii, ncomps;
 	int timeout;
 
@@ -1738,26 +1757,31 @@ guard_thread(void *arg)
 				 * connected.
 				 */
 				rw_unlock(&hio_remote_lock[ii]);
-				rw_wlock(&hio_remote_lock[ii]);
-				assert(res->hr_remotein == NULL);
-				assert(res->hr_remoteout == NULL);
 				pjdlog_debug(2,
 				    "remote_guard: Reconnecting to %s.",
 				    res->hr_remoteaddr);
-				init_remote(res);
-				if (ISCONNECTED(res, ii)) {
+				in = out = NULL;
+				if (init_remote(res, &in, &out)) {
+					rw_wlock(&hio_remote_lock[ii]);
+					assert(res->hr_remotein == NULL);
+					assert(res->hr_remoteout == NULL);
+					assert(in != NULL && out != NULL);
+					res->hr_remotein = in;
+					res->hr_remoteout = out;
+					rw_unlock(&hio_remote_lock[ii]);
 					pjdlog_info("Successfully reconnected to %s.",
 					    res->hr_remoteaddr);
+					sync_start();
 				} else {
 					/* Both connections should be NULL. */
 					assert(res->hr_remotein == NULL);
 					assert(res->hr_remoteout == NULL);
+					assert(in == NULL && out == NULL);
 					pjdlog_debug(2,
 					    "remote_guard: Reconnect to %s failed.",
 					    res->hr_remoteaddr);
 					timeout = RECONNECT_SLEEP;
 				}
-				rw_unlock(&hio_remote_lock[ii]);
 			}
 		}
 		(void)cv_timedwait(&hio_guard_cond, &hio_guard_lock, timeout);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 18:24:28 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DA30106566C;
	Sat, 27 Mar 2010 18:24:28 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0228D8FC14;
	Sat, 27 Mar 2010 18:24:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2RIORkR065205;
	Sat, 27 Mar 2010 18:24:27 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2RIORTF065203;
	Sat, 27 Mar 2010 18:24:27 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201003271824.o2RIORTF065203@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 27 Mar 2010 18:24:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205773 - head/sys/i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 18:24:28 -0000

Author: alc
Date: Sat Mar 27 18:24:27 2010
New Revision: 205773
URL: http://svn.freebsd.org/changeset/base/205773

Log:
  Simplify pmap_growkernel(), making the i386 version more like the amd64
  version.
  
  MFC after:	3 weeks

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Mar 27 18:15:18 2010	(r205772)
+++ head/sys/i386/i386/pmap.c	Sat Mar 27 18:24:27 2010	(r205773)
@@ -207,8 +207,8 @@ vm_offset_t virtual_end;	/* VA of last a
 int pgeflag = 0;		/* PG_G or-in */
 int pseflag = 0;		/* PG_PS or-in */
 
-static int nkpt;
-vm_offset_t kernel_vm_end;
+static int nkpt = NKPT;
+vm_offset_t kernel_vm_end = KERNBASE + NKPT * NBPDR;
 extern u_int32_t KERNend;
 extern u_int32_t KPTphys;
 
@@ -395,7 +395,6 @@ pmap_bootstrap(vm_paddr_t firstaddr)
 	mtx_lock_spin(&allpmaps_lock);
 	LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list);
 	mtx_unlock_spin(&allpmaps_lock);
-	nkpt = NKPT;
 
 	/*
 	 * Reserve some special page table entries/VA space for temporary
@@ -2032,24 +2031,12 @@ pmap_growkernel(vm_offset_t addr)
 	pd_entry_t newpdir;
 
 	mtx_assert(&kernel_map->system_mtx, MA_OWNED);
-	if (kernel_vm_end == 0) {
-		kernel_vm_end = KERNBASE;
-		nkpt = 0;
-		while (pdir_pde(PTD, kernel_vm_end)) {
-			kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
-			nkpt++;
-			if (kernel_vm_end - 1 >= kernel_map->max_offset) {
-				kernel_vm_end = kernel_map->max_offset;
-				break;
-			}
-		}
-	}
-	addr = roundup2(addr, PAGE_SIZE * NPTEPG);
+	addr = roundup2(addr, NBPDR);
 	if (addr - 1 >= kernel_map->max_offset)
 		addr = kernel_map->max_offset;
 	while (kernel_vm_end < addr) {
 		if (pdir_pde(PTD, kernel_vm_end)) {
-			kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+			kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
 			if (kernel_vm_end - 1 >= kernel_map->max_offset) {
 				kernel_vm_end = kernel_map->max_offset;
 				break;
@@ -2072,7 +2059,7 @@ pmap_growkernel(vm_offset_t addr)
 		pdir_pde(KPTD, kernel_vm_end) = pgeflag | newpdir;
 
 		pmap_kenter_pde(kernel_vm_end, newpdir);
-		kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+		kernel_vm_end = (kernel_vm_end + NBPDR) & ~PDRMASK;
 		if (kernel_vm_end - 1 >= kernel_map->max_offset) {
 			kernel_vm_end = kernel_map->max_offset;
 			break;

From owner-svn-src-head@FreeBSD.ORG  Sat Mar 27 23:53:48 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3DA21065675;
	Sat, 27 Mar 2010 23:53:47 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E29938FC16;
	Sat, 27 Mar 2010 23:53:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2RNrlrs037835;
	Sat, 27 Mar 2010 23:53:47 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2RNrlTp037832;
	Sat, 27 Mar 2010 23:53:47 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201003272353.o2RNrlTp037832@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 27 Mar 2010 23:53:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205778 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 27 Mar 2010 23:53:48 -0000

Author: alc
Date: Sat Mar 27 23:53:47 2010
New Revision: 205778
URL: http://svn.freebsd.org/changeset/base/205778

Log:
  Correctly handle preemption of pmap_update_pde_invalidate().
  
  X-MFC after:	r205573

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Mar 27 20:25:50 2010	(r205777)
+++ head/sys/amd64/amd64/pmap.c	Sat Mar 27 23:53:47 2010	(r205778)
@@ -880,9 +880,12 @@ pmap_update_pde_invalidate(vm_offset_t v
 		load_cr4(cr4 & ~CR4_PGE);
 		/*
 		 * Although preemption at this point could be detrimental to
-		 * performance, it would not lead to an error.
+		 * performance, it would not lead to an error.  PG_G is simply
+		 * ignored if CR4.PGE is clear.  Moreover, in case this block
+		 * is re-entered, the load_cr4() either above or below will
+		 * modify CR4.PGE flushing the TLB.
 		 */
-		load_cr4(cr4);
+		load_cr4(cr4 | CR4_PGE);
 	}
 }
 #ifdef SMP

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sat Mar 27 20:25:50 2010	(r205777)
+++ head/sys/i386/i386/pmap.c	Sat Mar 27 23:53:47 2010	(r205778)
@@ -917,9 +917,12 @@ pmap_update_pde_invalidate(vm_offset_t v
 		load_cr4(cr4 & ~CR4_PGE);
 		/*
 		 * Although preemption at this point could be detrimental to
-		 * performance, it would not lead to an error.
+		 * performance, it would not lead to an error.  PG_G is simply
+		 * ignored if CR4.PGE is clear.  Moreover, in case this block
+		 * is re-entered, the load_cr4() either above or below will
+		 * modify CR4.PGE flushing the TLB.
 		 */
-		load_cr4(cr4);
+		load_cr4(cr4 | CR4_PGE);
 	}
 }
 #ifdef SMP