From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 00:23:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5127C85; Sun, 17 Feb 2013 00:23:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 766BD1A8; Sun, 17 Feb 2013 00:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H0NhEe098282; Sun, 17 Feb 2013 00:23:43 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H0NhoX098281; Sun, 17 Feb 2013 00:23:43 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302170023.r1H0NhoX098281@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 17 Feb 2013 00:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246888 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 00:23:43 -0000 Author: gonzo Date: Sun Feb 17 00:23:42 2013 New Revision: 246888 URL: http://svnweb.freebsd.org/changeset/base/246888 Log: - Add hw.bcm2835.sdhci.hs tunable to enable/disable highspeed mode in SDHCI driver Suggested by: Daisuke Aoyama - Set initilization sequence frequency to 8MHz. It should fix Data CRC errors. Standard requires initialization sequence to be executed at 400KHz but on this hardware low frequncies seems to cause Data CRC errors. Value was derived from analyzing hardware signals after Raspberry Pi is powered up. Before any data is read though DATA line adapter's clock frequency is changed to 8MHz. Modern cards should function fine at 8MHz but for older MMC cards it can be overriden by setting hw.bcm2835.sdhci.min_freq tunable. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sat Feb 16 23:52:14 2013 (r246887) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Feb 17 00:23:42 2013 (r246888) @@ -78,6 +78,12 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif +static int bcm2835_sdhci_min_freq = 8000000; +static int bcm2835_sdhci_hs = 1; + +TUNABLE_INT("hw.bcm2835.sdhci.min_freq", &bcm2835_sdhci_min_freq); +TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); + struct bcm_sdhci_dmamap_arg { bus_addr_t sc_dma_busaddr; }; @@ -180,7 +186,9 @@ bcm_sdhci_attach(device_t dev) goto fail; } - sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180 | SDHCI_CAN_DO_HISPD; + sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180; + if (bcm2835_sdhci_hs) + sc->sc_slot.caps |= SDHCI_CAN_DO_HISPD; sc->sc_slot.caps |= (default_freq << SDHCI_CLOCK_BASE_SHIFT); sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL @@ -334,6 +342,19 @@ bcm_sdhci_write_multi_4(device_t dev, st bus_space_write_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count); } +static uint32_t +bcm_sdhci_min_freq(device_t dev, struct sdhci_slot *slot) +{ + + /* + * Arasan HC seems to have problem with + * Data CRC on lower frequencies. Cap minimum + * frequncy at 8MHz (or whatever set via tunable) + * to work around this issue + */ + return bcm2835_sdhci_min_freq; +} + static device_method_t bcm_sdhci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcm_sdhci_probe), @@ -353,6 +374,7 @@ static device_method_t bcm_sdhci_methods DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), /* SDHCI registers accessors */ + DEVMETHOD(sdhci_min_freq, bcm_sdhci_min_freq), DEVMETHOD(sdhci_read_1, bcm_sdhci_read_1), DEVMETHOD(sdhci_read_2, bcm_sdhci_read_2), DEVMETHOD(sdhci_read_4, bcm_sdhci_read_4), From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 00:51:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D06713D; Sun, 17 Feb 2013 00:51:35 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E708222D; Sun, 17 Feb 2013 00:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H0pYmq006946; Sun, 17 Feb 2013 00:51:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H0pYwp006945; Sun, 17 Feb 2013 00:51:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201302170051.r1H0pYwp006945@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 17 Feb 2013 00:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246890 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 00:51:35 -0000 Author: marcel Date: Sun Feb 17 00:51:34 2013 New Revision: 246890 URL: http://svnweb.freebsd.org/changeset/base/246890 Log: Close a race relating to setting the PCPU pointer (r13). Register r13 points to the TLS in user space and points to the PCPU structure in the kernel. The race is the result of having the exception handler on the one hand and the RPC system call entry on the other. The EPC syscall path is non-atomic in that interrupts are enabled while the two stacks are switched. The register stack is switched last as that is the stack used to determine whether we're going back to user space by the exception handler. If we go back to user space, we restore r13, otherwise we leave r13 alone. The EPC syscall path however set r13 to the PCPU structure *before* switching the register stack, which means that there was a window in which the exception handler would restore r13 when it was already pointing to the PCPU structure. This is fatal when the exception happened on CPU x, but left from the exception on anotehr CPU. In that case r13 would point to the PCPU of the CPU the thread was running on. This immediately results in getting the wrong value for curthread. The fix is to make sure we assign r13 *after* we set ar.bspstore to point to the kernel register stack for the thread. Modified: head/sys/ia64/ia64/syscall.S Modified: head/sys/ia64/ia64/syscall.S ============================================================================== --- head/sys/ia64/ia64/syscall.S Sun Feb 17 00:41:15 2013 (r246889) +++ head/sys/ia64/ia64/syscall.S Sun Feb 17 00:51:34 2013 (r246890) @@ -228,7 +228,7 @@ ENTRY_NOPROFILE(epc_syscall, 8) { .mmi mov r16=ar.rsc mov ar.rsc=0 - mov r17=r13 + nop 0 ;; } { .mmi @@ -239,13 +239,13 @@ ENTRY_NOPROFILE(epc_syscall, 8) ;; } { .mmi - mov r13=ar.k4 + mov r21=ar.unat add r30=-SIZEOF_TRAPFRAME,r14 mov r20=sp ;; } { .mii - mov r21=ar.unat + mov r17=r13 dep r30=0,r30,0,10 ;; add sp=-16,r30 @@ -258,10 +258,10 @@ ENTRY_NOPROFILE(epc_syscall, 8) add r31=8,r30 ;; } -{ .mii +{ .mmi + mov r13=ar.k4 mov r22=ar.fpsr sub r29=r14,r30 - nop 0 } { .mmi mov r23=ar.bsp From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 01:34:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DD4B64B; Sun, 17 Feb 2013 01:34:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBCD32DF; Sun, 17 Feb 2013 01:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H1YPkA019654; Sun, 17 Feb 2013 01:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H1YPZJ019653; Sun, 17 Feb 2013 01:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302170134.r1H1YPZJ019653@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 17 Feb 2013 01:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246891 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 01:34:26 -0000 Author: gonzo Date: Sun Feb 17 01:34:25 2013 New Revision: 246891 URL: http://svnweb.freebsd.org/changeset/base/246891 Log: Remove accidentally committed debug panic(9) call Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Feb 17 00:51:34 2013 (r246890) +++ head/sys/dev/sdhci/sdhci.c Sun Feb 17 01:34:25 2013 (r246891) @@ -1090,12 +1090,8 @@ sdhci_data_irq(struct sdhci_slot *slot, } if (intmask & SDHCI_INT_DATA_TIMEOUT) slot->curcmd->error = MMC_ERR_TIMEOUT; - else if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_END_BIT)) { - if (intmask & SDHCI_INT_DATA_CRC) { - panic("DATA CRC error\n"); - } + else if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_END_BIT)) slot->curcmd->error = MMC_ERR_BADCRC; - } if (slot->curcmd->data == NULL && (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END))) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 02:15:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B735AC4D; Sun, 17 Feb 2013 02:15:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8ECA73A5; Sun, 17 Feb 2013 02:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H2FMku032112; Sun, 17 Feb 2013 02:15:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H2FK2f032095; Sun, 17 Feb 2013 02:15:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201302170215.r1H2FK2f032095@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 17 Feb 2013 02:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246893 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 02:15:22 -0000 Author: marcel Date: Sun Feb 17 02:15:19 2013 New Revision: 246893 URL: http://svnweb.freebsd.org/changeset/base/246893 Log: In kthr.c, obtain the address of the PCB for threads that were running on a core, when the core was stopped, by calling kgdb_trgt_core_pcb(). This has 2 advantages: 1. We don't need to include a machine-specific header anymore and as such kthr.c is truly machine independent. This allows the code to be used in a cross-debugger. 2. We don't need to lookup stoppcbs in generic code when it's an inherently target-spicific symbol. It does not exist for ia64. Implement kgdb_trgt_core_pcb() for all architectures, except ia64, by calling a common function called kgdb_trgt_stop_pcb(). This function differs from kgdb_trgt_core_pcb() in that it gets the size of the PCB structure as an argument and as such remains machine independent. On ia64 the PCB for stopped cores is in the PCPU structure itself. This for better scaling. The implementation of kgdb_trgt_core_pcb() for ia64 uses the cpuid_to_pcpu[] array to to obtain the address of the PCB structure. Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.h head/gnu/usr.bin/gdb/kgdb/kthr.c head/gnu/usr.bin/gdb/kgdb/trgt.c head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c head/gnu/usr.bin/gdb/kgdb/trgt_arm.c head/gnu/usr.bin/gdb/kgdb/trgt_i386.c head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c head/gnu/usr.bin/gdb/kgdb/trgt_mips.c head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.h ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kgdb.h Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/kgdb.h Sun Feb 17 02:15:19 2013 (r246893) @@ -49,6 +49,8 @@ extern struct kthr *curkthr; void initialize_kld_target(void); void initialize_kgdb_target(void); void kgdb_dmesg(void); +CORE_ADDR kgdb_trgt_core_pcb(u_int); +CORE_ADDR kgdb_trgt_stop_pcb(u_int, u_int); void kgdb_trgt_new_objfile(struct objfile *); void kgdb_trgt_fetch_registers(int); void kgdb_trgt_store_registers(int); Modified: head/gnu/usr.bin/gdb/kgdb/kthr.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kthr.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/kthr.c Sun Feb 17 02:15:19 2013 (r246893) @@ -44,12 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include "kgdb.h" -#include static CORE_ADDR dumppcb; static int dumptid; -static CORE_ADDR stoppcbs; static cpuset_t stopped_cpus; static struct kthr *first; @@ -98,10 +96,9 @@ kgdb_thr_add_procs(uintptr_t paddr) kt->kaddr = addr; if (td.td_tid == dumptid) kt->pcb = dumppcb; - else if (td.td_state == TDS_RUNNING && stoppcbs != 0 && + else if (td.td_state == TDS_RUNNING && CPU_ISSET(td.td_oncpu, &stopped_cpus)) - kt->pcb = (uintptr_t)stoppcbs + - sizeof(struct pcb) * td.td_oncpu; + kt->pcb = kgdb_trgt_core_pcb(td.td_oncpu); else kt->pcb = (uintptr_t)td.td_pcb; kt->kstack = td.td_kstack; @@ -152,8 +149,6 @@ kgdb_thr_init(void) addr != 0) kvm_read(kvm, addr, &stopped_cpus, cpusetsize); - stoppcbs = kgdb_lookup("stoppcbs"); - kgdb_thr_add_procs(paddr); addr = kgdb_lookup("zombproc"); if (addr != 0) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt.c Sun Feb 17 02:15:19 2013 (r246893) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +static CORE_ADDR stoppcbs; + static void kgdb_core_cleanup(void *); static char *vmcore; @@ -352,3 +354,18 @@ initialize_kgdb_target(void) add_com ("tid", class_obscure, kgdb_set_tid_cmd, "Set current thread context"); } + +CORE_ADDR +kgdb_trgt_stop_pcb(u_int cpuid, u_int pcbsz) +{ + static int once = 0; + + if (stoppcbs == 0 && !once) { + once = 1; + stoppcbs = kgdb_lookup("stoppcbs"); + } + if (stoppcbs == 0) + return 0; + + return (stoppcbs + pcbsz * cpuid); +} Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Sun Feb 17 02:15:19 2013 (r246893) @@ -44,6 +44,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Sun Feb 17 02:15:19 2013 (r246893) @@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Sun Feb 17 02:15:19 2013 (r246893) @@ -49,6 +49,12 @@ __FBSDID("$FreeBSD$"); static int ofs_fix; +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c Sun Feb 17 02:15:19 2013 (r246893) @@ -52,6 +52,18 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + CORE_ADDR addr; + char *expr; + + asprintf(&expr, "&cpuid_to_pcpu[%d]->pc_md.pcb", cpuid); + addr = kgdb_parse(expr); + free(expr); + return (addr); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Feb 17 02:15:19 2013 (r246893) @@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Sun Feb 17 02:15:19 2013 (r246893) @@ -49,6 +49,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c Sun Feb 17 02:15:19 2013 (r246893) @@ -44,6 +44,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { Modified: head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Sun Feb 17 01:34:41 2013 (r246892) +++ head/gnu/usr.bin/gdb/kgdb/trgt_sparc64.c Sun Feb 17 02:15:19 2013 (r246893) @@ -46,6 +46,12 @@ __FBSDID("$FreeBSD$"); #include "kgdb.h" +CORE_ADDR +kgdb_trgt_core_pcb(u_int cpuid) +{ + return (kgdb_trgt_stop_pcb(cpuid, sizeof(struct pcb))); +} + void kgdb_trgt_fetch_registers(int regno __unused) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 02:52:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 066F6560; Sun, 17 Feb 2013 02:52:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E7A336A3; Sun, 17 Feb 2013 02:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H2qgQt043730; Sun, 17 Feb 2013 02:52:42 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H2qgau043728; Sun, 17 Feb 2013 02:52:42 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201302170252.r1H2qgau043728@svn.freebsd.org> From: David Xu Date: Sun, 17 Feb 2013 02:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246894 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 02:52:43 -0000 Author: davidxu Date: Sun Feb 17 02:52:42 2013 New Revision: 246894 URL: http://svnweb.freebsd.org/changeset/base/246894 Log: Make more code be protected by internal mutex, and now it is fork-safe, in error case, the file exclusive lock is now released as soon as possible, in previous code, child process can still hold the exclusive lock. Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sun Feb 17 02:15:19 2013 (r246893) +++ head/lib/libc/gen/sem_new.c Sun Feb 17 02:52:42 2013 (r246894) @@ -229,18 +229,18 @@ _sem_open(const char *name, int flags, . ni->open_count = 1; ni->sem = sem; LIST_INSERT_HEAD(&sem_list, ni, next); - _pthread_mutex_unlock(&sem_llock); _close(fd); + _pthread_mutex_unlock(&sem_llock); return (sem); error: errsave = errno; - _pthread_mutex_unlock(&sem_llock); if (fd != -1) _close(fd); if (sem != NULL) munmap(sem, sizeof(sem_t)); free(ni); + _pthread_mutex_unlock(&sem_llock); errno = errsave; return (SEM_FAILED); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 04:43:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4DF6A45E; Sun, 17 Feb 2013 04:43:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 209BC985; Sun, 17 Feb 2013 04:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1H4hNnY077849; Sun, 17 Feb 2013 04:43:23 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1H4hMAK077840; Sun, 17 Feb 2013 04:43:22 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201302170443.r1H4hMAK077840@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 17 Feb 2013 04:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246896 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 04:43:24 -0000 Author: luigi Date: Sun Feb 17 04:43:22 2013 New Revision: 246896 URL: http://svnweb.freebsd.org/changeset/base/246896 Log: update the netmap example programs merging some common code in nm_util.c pkt-gen now implements several functions (unlimited transmit, receive, ping-pong) and can operate on a 'tap' device. Added: head/tools/tools/netmap/nm_util.c (contents, props changed) head/tools/tools/netmap/nm_util.h (contents, props changed) Modified: head/tools/tools/netmap/Makefile head/tools/tools/netmap/bridge.c head/tools/tools/netmap/pcap.c head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Sun Feb 17 03:33:13 2013 (r246895) +++ head/tools/tools/netmap/Makefile Sun Feb 17 04:43:22 2013 (r246896) @@ -5,7 +5,7 @@ # we can just define 'progs' and create custom targets. PROGS = pkt-gen bridge testpcap libnetmap.so -CLEANFILES = $(PROGS) pcap.o +CLEANFILES = $(PROGS) pcap.o nm_util.o NO_MAN= CFLAGS += -Werror -Wall -nostdinc -I/usr/include -I../../../sys CFLAGS += -Wextra @@ -17,9 +17,12 @@ LDFLAGS += -lpthread -lpcap all: $(PROGS) +pkt-gen bridge: nm_util.o + $(CC) $(CFLAGS) -o ${.TARGET} ${.TARGET:=.c} nm_util.o $(LDFLAGS) + testpcap: pcap.c libnetmap.so - $(CC) $(CFLAGS) -L. -lnetmap -o ${.TARGET} pcap.c + $(CC) $(CFLAGS) -DTEST -L. -lnetmap -o ${.TARGET} pcap.c -libnetmap.so: pcap.c +libnetmap.so: pcap.c nm_util.c $(CC) $(CFLAGS) -fpic -c ${.ALLSRC} $(CC) -shared -o ${.TARGET} ${.ALLSRC:.c=.o} Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Sun Feb 17 03:33:13 2013 (r246895) +++ head/tools/tools/netmap/bridge.c Sun Feb 17 04:43:22 2013 (r246896) @@ -9,195 +9,24 @@ * $FreeBSD$ */ -#include -#include /* signal */ -#include -#include -#include /* strcmp */ -#include /* open */ -#include /* close */ - -#include /* le64toh */ -#include /* PROT_* */ -#include /* ioctl */ -#include -#include -#include /* sockaddr.. */ -#include /* ntohs */ - -#include /* ifreq */ -#include -#include -#include +#include "nm_util.h" -#include /* sockaddr_in */ - -#define MIN(a, b) ((a) < (b) ? (a) : (b)) int verbose = 0; -/* debug support */ -#define ND(format, ...) {} -#define D(format, ...) do { \ - if (!verbose) break; \ - struct timeval _xxts; \ - gettimeofday(&_xxts, NULL); \ - fprintf(stderr, "%03d.%06d %s [%d] " format "\n", \ - (int)_xxts.tv_sec %1000, (int)_xxts.tv_usec, \ - __FUNCTION__, __LINE__, ##__VA_ARGS__); \ - } while (0) - - -char *version = "$Id: bridge.c 10857 2012-04-06 12:18:22Z luigi $"; +char *version = "$Id: bridge.c 12016 2013-01-23 17:24:22Z luigi $"; static int do_abort = 0; -/* - * info on a ring we handle - */ -struct my_ring { - const char *ifname; - int fd; - char *mem; /* userspace mmap address */ - u_int memsize; - u_int queueid; - u_int begin, end; /* first..last+1 rings to check */ - struct netmap_if *nifp; - struct netmap_ring *tx, *rx; /* shortcuts */ - - uint32_t if_flags; - uint32_t if_reqcap; - uint32_t if_curcap; -}; - static void -sigint_h(__unused int sig) +sigint_h(int sig) { + (void)sig; /* UNUSED */ do_abort = 1; signal(SIGINT, SIG_DFL); } -static int -do_ioctl(struct my_ring *me, unsigned long what) -{ - struct ifreq ifr; - int error; - - bzero(&ifr, sizeof(ifr)); - strncpy(ifr.ifr_name, me->ifname, sizeof(ifr.ifr_name)); - switch (what) { - case SIOCSIFFLAGS: - ifr.ifr_flagshigh = me->if_flags >> 16; - ifr.ifr_flags = me->if_flags & 0xffff; - break; - case SIOCSIFCAP: - ifr.ifr_reqcap = me->if_reqcap; - ifr.ifr_curcap = me->if_curcap; - break; - } - error = ioctl(me->fd, what, &ifr); - if (error) { - D("ioctl error 0x%lx", what); - return error; - } - switch (what) { - case SIOCGIFFLAGS: - me->if_flags = (ifr.ifr_flagshigh << 16) | - (0xffff & ifr.ifr_flags); - if (verbose) - D("flags are 0x%x", me->if_flags); - break; - - case SIOCGIFCAP: - me->if_reqcap = ifr.ifr_reqcap; - me->if_curcap = ifr.ifr_curcap; - if (verbose) - D("curcap are 0x%x", me->if_curcap); - break; - } - return 0; -} - -/* - * open a device. if me->mem is null then do an mmap. - */ -static int -netmap_open(struct my_ring *me, int ringid) -{ - int fd, err, l; - struct nmreq req; - - me->fd = fd = open("/dev/netmap", O_RDWR); - if (fd < 0) { - D("Unable to open /dev/netmap"); - return (-1); - } - bzero(&req, sizeof(req)); - strncpy(req.nr_name, me->ifname, sizeof(req.nr_name)); - req.nr_ringid = ringid; - req.nr_version = NETMAP_API; - err = ioctl(fd, NIOCGINFO, &req); - if (err) { - D("cannot get info on %s", me->ifname); - goto error; - } - me->memsize = l = req.nr_memsize; - if (verbose) - D("memsize is %d MB", l>>20); - err = ioctl(fd, NIOCREGIF, &req); - if (err) { - D("Unable to register %s", me->ifname); - goto error; - } - - if (me->mem == NULL) { - me->mem = mmap(0, l, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); - if (me->mem == MAP_FAILED) { - D("Unable to mmap"); - me->mem = NULL; - goto error; - } - } - - me->nifp = NETMAP_IF(me->mem, req.nr_offset); - me->queueid = ringid; - if (ringid & NETMAP_SW_RING) { - me->begin = req.nr_rx_rings; - me->end = me->begin + 1; - me->tx = NETMAP_TXRING(me->nifp, req.nr_tx_rings); - me->rx = NETMAP_RXRING(me->nifp, req.nr_rx_rings); - } else if (ringid & NETMAP_HW_RING) { - D("XXX check multiple threads"); - me->begin = ringid & NETMAP_RING_MASK; - me->end = me->begin + 1; - me->tx = NETMAP_TXRING(me->nifp, me->begin); - me->rx = NETMAP_RXRING(me->nifp, me->begin); - } else { - me->begin = 0; - me->end = req.nr_rx_rings; // XXX max of the two - me->tx = NETMAP_TXRING(me->nifp, 0); - me->rx = NETMAP_RXRING(me->nifp, 0); - } - return (0); -error: - close(me->fd); - return -1; -} - - -static int -netmap_close(struct my_ring *me) -{ - D(""); - if (me->mem) - munmap(me->mem, me->memsize); - ioctl(me->fd, NIOCUNREGIF, NULL); - close(me->fd); - return (0); -} - - /* * move up to 'limit' pkts from rxring to txring swapping buffers. */ @@ -237,7 +66,7 @@ process_rings(struct netmap_ring *rxring if (rs->len < 14 || rs->len > 2048) D("wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); else if (verbose > 1) - D("send len %d rx[%d] -> tx[%d]", rs->len, j, k); + D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); ts->len = rs->len; /* report the buffer change. */ @@ -251,7 +80,7 @@ process_rings(struct netmap_ring *rxring rxring->cur = j; txring->cur = k; if (verbose && m > 0) - D("sent %d packets to %p", m, txring); + D("%s sent %d packets to %p", msg, m, txring); return (m); } @@ -287,7 +116,7 @@ move(struct my_ring *src, struct my_ring * how many packets on this set of queues ? */ static int -howmany(struct my_ring *me, int tx) +pkt_queued(struct my_ring *me, int tx) { u_int i, tot = 0; @@ -337,6 +166,7 @@ main(int argc, char **argv) while ( (ch = getopt(argc, argv, "b:i:vw:")) != -1) { switch (ch) { + default: D("bad option %c %s", ch, optarg); usage(); break; @@ -361,6 +191,7 @@ main(int argc, char **argv) } } + argc -= optind; argv += optind; @@ -394,44 +225,12 @@ main(int argc, char **argv) /* two different interfaces. Take all rings on if1 */ i = 0; // all hw rings } - if (netmap_open(me, i)) + if (netmap_open(me, i, 1)) return (1); me[1].mem = me[0].mem; /* copy the pointer, so only one mmap */ - if (netmap_open(me+1, 0)) + if (netmap_open(me+1, 0, 1)) return (1); - /* if bridging two interfaces, set promisc mode */ - if (i != NETMAP_SW_RING) { - do_ioctl(me, SIOCGIFFLAGS); - if ((me[0].if_flags & IFF_UP) == 0) { - D("%s is down, bringing up...", me[0].ifname); - me[0].if_flags |= IFF_UP; - } - me[0].if_flags |= IFF_PPROMISC; - do_ioctl(me, SIOCSIFFLAGS); - - do_ioctl(me+1, SIOCGIFFLAGS); - me[1].if_flags |= IFF_PPROMISC; - do_ioctl(me+1, SIOCSIFFLAGS); - - /* also disable checksums etc. */ - do_ioctl(me, SIOCGIFCAP); - me[0].if_reqcap = me[0].if_curcap; - me[0].if_reqcap &= ~(IFCAP_HWCSUM | IFCAP_TSO | IFCAP_TOE); - do_ioctl(me+0, SIOCSIFCAP); - } - do_ioctl(me+1, SIOCGIFFLAGS); - if ((me[1].if_flags & IFF_UP) == 0) { - D("%s is down, bringing up...", me[1].ifname); - me[1].if_flags |= IFF_UP; - } - do_ioctl(me+1, SIOCSIFFLAGS); - - do_ioctl(me+1, SIOCGIFCAP); - me[1].if_reqcap = me[1].if_curcap; - me[1].if_reqcap &= ~(IFCAP_HWCSUM | IFCAP_TSO | IFCAP_TOE); - do_ioctl(me+1, SIOCSIFCAP); - /* setup poll(2) variables. */ memset(pollfd, 0, sizeof(pollfd)); for (i = 0; i < 2; i++) { @@ -451,8 +250,8 @@ main(int argc, char **argv) int n0, n1, ret; pollfd[0].events = pollfd[1].events = 0; pollfd[0].revents = pollfd[1].revents = 0; - n0 = howmany(me, 0); - n1 = howmany(me + 1, 0); + n0 = pkt_queued(me, 0); + n1 = pkt_queued(me + 1, 0); if (n0) pollfd[1].events |= POLLOUT; else @@ -468,14 +267,14 @@ main(int argc, char **argv) ret <= 0 ? "timeout" : "ok", pollfd[0].events, pollfd[0].revents, - howmany(me, 0), + pkt_queued(me, 0), me[0].rx->cur, - howmany(me, 1), + pkt_queued(me, 1), pollfd[1].events, pollfd[1].revents, - howmany(me+1, 0), + pkt_queued(me+1, 0), me[1].rx->cur, - howmany(me+1, 1) + pkt_queued(me+1, 1) ); if (ret < 0) continue; Added: head/tools/tools/netmap/nm_util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netmap/nm_util.c Sun Feb 17 04:43:22 2013 (r246896) @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2012 Luigi Rizzo. 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$ + * $Id$ + * + * utilities to use netmap devices. + * This does the basic functions of opening a device and issuing + * ioctls() + */ + +#include "nm_util.h" + +extern int verbose; + +int +nm_do_ioctl(struct my_ring *me, u_long what, int subcmd) +{ + struct ifreq ifr; + int error; +#if defined( __FreeBSD__ ) || defined (__APPLE__) + int fd = me->fd; +#endif +#ifdef linux + struct ethtool_value eval; + int fd; + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + printf("Error: cannot get device control socket.\n"); + return -1; + } +#endif /* linux */ + + (void)subcmd; // unused + bzero(&ifr, sizeof(ifr)); + strncpy(ifr.ifr_name, me->ifname, sizeof(ifr.ifr_name)); + switch (what) { + case SIOCSIFFLAGS: +#ifndef __APPLE__ + ifr.ifr_flagshigh = me->if_flags >> 16; +#endif + ifr.ifr_flags = me->if_flags & 0xffff; + break; + +#if defined( __FreeBSD__ ) + case SIOCSIFCAP: + ifr.ifr_reqcap = me->if_reqcap; + ifr.ifr_curcap = me->if_curcap; + break; +#endif +#ifdef linux + case SIOCETHTOOL: + eval.cmd = subcmd; + eval.data = 0; + ifr.ifr_data = (caddr_t)&eval; + break; +#endif /* linux */ + } + error = ioctl(fd, what, &ifr); + if (error) + goto done; + switch (what) { + case SIOCGIFFLAGS: +#ifndef __APPLE__ + me->if_flags = (ifr.ifr_flagshigh << 16) | + (0xffff & ifr.ifr_flags); +#endif + if (verbose) + D("flags are 0x%x", me->if_flags); + break; + +#if defined( __FreeBSD__ ) + case SIOCGIFCAP: + me->if_reqcap = ifr.ifr_reqcap; + me->if_curcap = ifr.ifr_curcap; + if (verbose) + D("curcap are 0x%x", me->if_curcap); + break; +#endif /* __FreeBSD__ */ + } +done: +#ifdef linux + close(fd); +#endif + if (error) + D("ioctl error %d %lu", error, what); + return error; +} + +/* + * open a device. if me->mem is null then do an mmap. + * Returns the file descriptor. + * The extra flag checks configures promisc mode. + */ +int +netmap_open(struct my_ring *me, int ringid, int promisc) +{ + int fd, err, l; + struct nmreq req; + + me->fd = fd = open("/dev/netmap", O_RDWR); + if (fd < 0) { + D("Unable to open /dev/netmap"); + return (-1); + } + bzero(&req, sizeof(req)); + req.nr_version = NETMAP_API; + strncpy(req.nr_name, me->ifname, sizeof(req.nr_name)); + req.nr_ringid = ringid; + err = ioctl(fd, NIOCGINFO, &req); + if (err) { + D("cannot get info on %s, errno %d ver %d", + me->ifname, errno, req.nr_version); + goto error; + } + me->memsize = l = req.nr_memsize; + if (verbose) + D("memsize is %d MB", l>>20); + err = ioctl(fd, NIOCREGIF, &req); + if (err) { + D("Unable to register %s", me->ifname); + goto error; + } + + if (me->mem == NULL) { + me->mem = mmap(0, l, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); + if (me->mem == MAP_FAILED) { + D("Unable to mmap"); + me->mem = NULL; + goto error; + } + } + + + /* Set the operating mode. */ + if (ringid != NETMAP_SW_RING) { + nm_do_ioctl(me, SIOCGIFFLAGS, 0); + if ((me[0].if_flags & IFF_UP) == 0) { + D("%s is down, bringing up...", me[0].ifname); + me[0].if_flags |= IFF_UP; + } + if (promisc) { + me[0].if_flags |= IFF_PPROMISC; + nm_do_ioctl(me, SIOCSIFFLAGS, 0); + } + +#ifdef __FreeBSD__ + /* also disable checksums etc. */ + nm_do_ioctl(me, SIOCGIFCAP, 0); + me[0].if_reqcap = me[0].if_curcap; + me[0].if_reqcap &= ~(IFCAP_HWCSUM | IFCAP_TSO | IFCAP_TOE); + nm_do_ioctl(me+0, SIOCSIFCAP, 0); +#endif +#ifdef linux + /* disable: + * - generic-segmentation-offload + * - tcp-segmentation-offload + * - rx-checksumming + * - tx-checksumming + * XXX check how to set back the caps. + */ + nm_do_ioctl(me, SIOCETHTOOL, ETHTOOL_SGSO); + nm_do_ioctl(me, SIOCETHTOOL, ETHTOOL_STSO); + nm_do_ioctl(me, SIOCETHTOOL, ETHTOOL_SRXCSUM); + nm_do_ioctl(me, SIOCETHTOOL, ETHTOOL_STXCSUM); +#endif /* linux */ + } + + me->nifp = NETMAP_IF(me->mem, req.nr_offset); + me->queueid = ringid; + if (ringid & NETMAP_SW_RING) { + me->begin = req.nr_rx_rings; + me->end = me->begin + 1; + me->tx = NETMAP_TXRING(me->nifp, req.nr_tx_rings); + me->rx = NETMAP_RXRING(me->nifp, req.nr_rx_rings); + } else if (ringid & NETMAP_HW_RING) { + D("XXX check multiple threads"); + me->begin = ringid & NETMAP_RING_MASK; + me->end = me->begin + 1; + me->tx = NETMAP_TXRING(me->nifp, me->begin); + me->rx = NETMAP_RXRING(me->nifp, me->begin); + } else { + me->begin = 0; + me->end = req.nr_rx_rings; // XXX max of the two + me->tx = NETMAP_TXRING(me->nifp, 0); + me->rx = NETMAP_RXRING(me->nifp, 0); + } + return (0); +error: + close(me->fd); + return -1; +} + + +int +netmap_close(struct my_ring *me) +{ + D(""); + if (me->mem) + munmap(me->mem, me->memsize); + ioctl(me->fd, NIOCUNREGIF, NULL); + close(me->fd); + return (0); +} + + +/* + * how many packets on this set of queues ? + */ +int +pkt_queued(struct my_ring *me, int tx) +{ + u_int i, tot = 0; + + ND("me %p begin %d end %d", me, me->begin, me->end); + for (i = me->begin; i < me->end; i++) { + struct netmap_ring *ring = tx ? + NETMAP_TXRING(me->nifp, i) : NETMAP_RXRING(me->nifp, i); + tot += ring->avail; + } + if (0 && verbose && tot && !tx) + D("ring %s %s %s has %d avail at %d", + me->ifname, tx ? "tx": "rx", + me->end >= me->nifp->ni_tx_rings ? // XXX who comes first ? + "host":"net", + tot, NETMAP_TXRING(me->nifp, me->begin)->cur); + return tot; +} Added: head/tools/tools/netmap/nm_util.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netmap/nm_util.h Sun Feb 17 04:43:22 2013 (r246896) @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2012 Luigi Rizzo. 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$ + * $Id$ + * + * Some utilities to build netmap-based programs. + */ + +#ifndef _NM_UTIL_H +#define _NM_UTIL_H +#include +#include /* signal */ +#include +#include +#include /* PRI* macros */ +#include /* strcmp */ +#include /* open */ +#include /* close */ +#include /* getifaddrs */ + +#include /* PROT_* */ +#include /* ioctl */ +#include +#include /* sockaddr.. */ +#include /* ntohs */ +#include +#include /* sysctl */ +#include /* timersub */ + +#include +#include /* ifreq */ + +#include +#include +#include + +#include +#include + +#ifndef MY_PCAP /* use the system's pcap if available */ + +#ifdef NO_PCAP +#define PCAP_ERRBUF_SIZE 512 +typedef void pcap_t; +struct pcap_pkthdr; +#define pcap_inject(a,b,c) ((void)a, (void)b, (void)c, -1) +#define pcap_dispatch(a, b, c, d) (void)c +#define pcap_open_live(a, b, c, d, e) ((void)e, NULL) +#else /* !NO_PCAP */ +#include // XXX do we need it ? +#endif /* !NO_PCAP */ + +#endif // XXX hack + +#include /* pthread_* */ + +#ifdef linux +#define ifr_flagshigh ifr_flags +#define ifr_curcap ifr_flags +#define ifr_reqcap ifr_flags +#define IFF_PPROMISC IFF_PROMISC +#include +#include + +#define CLOCK_REALTIME_PRECISE CLOCK_REALTIME +#include /* ether_aton */ +#include /* sockaddr_ll */ +#endif /* linux */ + +#ifdef __FreeBSD__ +#include /* le64toh */ +#include + +#include /* pthread w/ affinity */ +#include /* cpu_set */ +#include /* LLADDR */ +#endif /* __FreeBSD__ */ + +#ifdef __APPLE__ +#define ifr_flagshigh ifr_flags // XXX +#define IFF_PPROMISC IFF_PROMISC +#include /* LLADDR */ +#define clock_gettime(a,b) \ + do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) +#endif /* __APPLE__ */ + +static inline int min(int a, int b) { return a < b ? a : b; } +extern int time_second; + +/* debug support */ +#define ND(format, ...) do {} while(0) +#define D(format, ...) \ + fprintf(stderr, "%s [%d] " format "\n", \ + __FUNCTION__, __LINE__, ##__VA_ARGS__) + +#define RD(lps, format, ...) \ + do { \ + static int t0, cnt; \ + if (t0 != time_second) { \ + t0 = time_second; \ + cnt = 0; \ + } \ + if (cnt++ < lps) \ + D(format, ##__VA_ARGS__); \ + } while (0) + + + +// XXX does it work on 32-bit machines ? +static inline void prefetch (const void *x) +{ + __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); +} + +// XXX only for multiples of 64 bytes, non overlapped. +static inline void +pkt_copy(const void *_src, void *_dst, int l) +{ + const uint64_t *src = _src; + uint64_t *dst = _dst; +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + if (unlikely(l >= 1024)) { + bcopy(src, dst, l); + return; + } + for (; l > 0; l-=64) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } +} + +/* + * info on a ring we handle + */ +struct my_ring { + const char *ifname; + int fd; + char *mem; /* userspace mmap address */ + u_int memsize; + u_int queueid; + u_int begin, end; /* first..last+1 rings to check */ + struct netmap_if *nifp; + struct netmap_ring *tx, *rx; /* shortcuts */ + + uint32_t if_flags; + uint32_t if_reqcap; + uint32_t if_curcap; +}; +int netmap_open(struct my_ring *me, int ringid, int promisc); +int netmap_close(struct my_ring *me); +int nm_do_ioctl(struct my_ring *me, u_long what, int subcmd); +#endif /* _NM_UTIL_H */ Modified: head/tools/tools/netmap/pcap.c ============================================================================== --- head/tools/tools/netmap/pcap.c Sun Feb 17 03:33:13 2013 (r246895) +++ head/tools/tools/netmap/pcap.c Sun Feb 17 04:43:22 2013 (r246896) @@ -1,5 +1,5 @@ /* - * (C) 2011 Luigi Rizzo + * (C) 2011-2012 Luigi Rizzo * * BSD license * @@ -10,81 +10,18 @@ * $FreeBSD$ */ -#include -#include /* signal */ -#include -#include -#include /* strcmp */ -#include /* open */ -#include /* close */ - -#include /* le64toh */ -#include /* PROT_* */ -#include /* ioctl */ -#include -#include -#include /* sockaddr.. */ -#include /* ntohs */ - -#include /* ifreq */ -#include -#include -#include +#define MY_PCAP +#include "nm_util.h" -#include /* sockaddr_in */ - -#include -#include - -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - -const char *version = "$Id$"; +char *version = "$Id: pcap.c 11463 2012-07-30 15:26:02Z luigi $"; int verbose = 0; -/* debug support */ -#define ND(format, ...) do {} while (0) -#define D(format, ...) do { \ - if (verbose) \ - fprintf(stderr, "--- %s [%d] " format "\n", \ - __FUNCTION__, __LINE__, ##__VA_ARGS__); \ - } while (0) - -static inline void prefetch (const void *x) -{ - __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); -} - -// XXX only for multiples of 64 bytes, non overlapped. -static inline void -pkt_copy(const void *_src, void *_dst, int l) -{ - const uint64_t *src = _src; - uint64_t *dst = _dst; -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - if (unlikely(l >= 1024)) { - bcopy(src, dst, l); - return; - } - for (; l > 0; l-=64) { - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - } -} - /* * We redefine here a number of structures that are in pcap.h * so we can compile this file without the system header. */ #ifndef PCAP_ERRBUF_SIZE #define PCAP_ERRBUF_SIZE 128 - /* * Each packet is accompanied by a header including the timestamp, * captured size and actual size. @@ -135,12 +72,13 @@ typedef enum { PCAP_D_OUT } pcap_direction_t; -struct bpf_program; typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes); +char errbuf[PCAP_ERRBUF_SIZE]; + pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf); @@ -154,24 +92,6 @@ char *pcap_lookupdev(char *errbuf); int pcap_inject(pcap_t *p, const void *buf, size_t size); int pcap_fileno(pcap_t *p); const char *pcap_lib_version(void); -void pcap_freealldevs(pcap_if_t *); -pcap_t *pcap_create(const char *, char *); -int pcap_activate(pcap_t *); -int pcap_can_set_rfmon(pcap_t *); -int pcap_set_snaplen(pcap_t *, int); -int pcap_snapshot(pcap_t *); -int pcap_lookupnet(const char *, uint32_t *, uint32_t *, char *); -int pcap_set_promisc(pcap_t *, int); -int pcap_set_timeout(pcap_t *, int); -int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, - uint32_t); -int pcap_setfilter(pcap_t *, struct bpf_program *); -int pcap_datalink(pcap_t *); -const char *pcap_datalink_val_to_name(int); -const char *pcap_datalink_val_to_description(int); -int pcap_stats(pcap_t *, struct pcap_stat *); -int pcap_loop(pcap_t *, int, pcap_handler, u_char *); -char *pcap_geterr(pcap_t *); struct eproto { @@ -180,7 +100,7 @@ struct eproto { }; #endif /* !PCAP_ERRBUF_SIZE */ -#ifdef __PIC__ +#ifndef TEST /* * build as a shared library */ @@ -190,8 +110,12 @@ char pcap_version[] = "libnetmap version /* * Our equivalent of pcap_t */ -struct my_ring { - struct nmreq nmr; +struct pcap_ring { + struct my_ring me; +#if 0 + const char *ifname; + + //struct nmreq nmr; int fd; char *mem; /* userspace mmap address */ @@ -200,6 +124,10 @@ struct my_ring { u_int begin, end; /* first..last+1 rings to check */ struct netmap_if *nifp; + uint32_t if_flags; + uint32_t if_reqcap; + uint32_t if_curcap; +#endif int snaplen; char *errbuf; int promisc; @@ -207,9 +135,6 @@ struct my_ring { struct pcap_pkthdr hdr; - uint32_t if_flags; - uint32_t if_reqcap; - uint32_t if_curcap; struct pcap_stat st; @@ -217,114 +142,6 @@ struct my_ring { }; -static int -do_ioctl(struct my_ring *me, unsigned long what) -{ - struct ifreq ifr; - int error; - - bzero(&ifr, sizeof(ifr)); - strncpy(ifr.ifr_name, me->nmr.nr_name, sizeof(ifr.ifr_name)); - switch (what) { - case SIOCSIFFLAGS: - D("call SIOCSIFFLAGS 0x%x", me->if_flags); - ifr.ifr_flagshigh = (me->if_flags >> 16) & 0xffff; - ifr.ifr_flags = me->if_flags & 0xffff; - break; - case SIOCSIFCAP: - ifr.ifr_reqcap = me->if_reqcap; - ifr.ifr_curcap = me->if_curcap; - break; - } - error = ioctl(me->fd, what, &ifr); - if (error) { - D("ioctl 0x%lx error %d", what, error); - return error; - } - switch (what) { - case SIOCSIFFLAGS: - case SIOCGIFFLAGS: - me->if_flags = (ifr.ifr_flagshigh << 16) | - (0xffff & ifr.ifr_flags); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:36:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B03E2496; Sun, 17 Feb 2013 11:36:14 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B633253; Sun, 17 Feb 2013 11:36:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBaEr2000987; Sun, 17 Feb 2013 11:36:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBaEVV000986; Sun, 17 Feb 2013 11:36:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171136.r1HBaEVV000986@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246902 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:36:14 -0000 Author: pjd Date: Sun Feb 17 11:36:13 2013 New Revision: 246902 URL: http://svnweb.freebsd.org/changeset/base/246902 Log: Remove trailing spaces. Modified: head/sys/sys/protosw.h Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Sun Feb 17 09:04:42 2013 (r246901) +++ head/sys/sys/protosw.h Sun Feb 17 11:36:13 2013 (r246902) @@ -203,7 +203,7 @@ struct pr_usrreqs { int (*pru_peeraddr)(struct socket *so, struct sockaddr **nam); int (*pru_rcvd)(struct socket *so, int flags); int (*pru_rcvoob)(struct socket *so, struct mbuf *m, int flags); - int (*pru_send)(struct socket *so, int flags, struct mbuf *m, + int (*pru_send)(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td); #define PRUS_OOB 0x1 @@ -211,7 +211,7 @@ struct pr_usrreqs { #define PRUS_MORETOCOME 0x4 int (*pru_sense)(struct socket *so, struct stat *sb); int (*pru_shutdown)(struct socket *so); - int (*pru_flush)(struct socket *so, int direction); + int (*pru_flush)(struct socket *so, int direction); int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); int (*pru_sosend)(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:36:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8E55604; Sun, 17 Feb 2013 11:36:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA87925A; Sun, 17 Feb 2013 11:36:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBafuZ001175; Sun, 17 Feb 2013 11:36:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBafV9001173; Sun, 17 Feb 2013 11:36:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171136.r1HBafV9001173@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246903 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:36:41 -0000 Author: pjd Date: Sun Feb 17 11:36:41 2013 New Revision: 246903 URL: http://svnweb.freebsd.org/changeset/base/246903 Log: Remove redundant space. Modified: head/sys/sys/namei.h Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sun Feb 17 11:36:13 2013 (r246902) +++ head/sys/sys/namei.h Sun Feb 17 11:36:41 2013 (r246903) @@ -145,7 +145,7 @@ struct nameidata { #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ #define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ -#define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ +#define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ #define NOCAPCHECK 0x20000000 /* do not perform capability checks */ #define PARAMASK 0x3ffffe00 /* mask of parameter descriptors */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:47:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9833AA01; Sun, 17 Feb 2013 11:47:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 867FA2A3; Sun, 17 Feb 2013 11:47:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBl2OS004150; Sun, 17 Feb 2013 11:47:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBl2HQ004149; Sun, 17 Feb 2013 11:47:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171147.r1HBl2HQ004149@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246904 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:47:02 -0000 Author: pjd Date: Sun Feb 17 11:47:01 2013 New Revision: 246904 URL: http://svnweb.freebsd.org/changeset/base/246904 Log: Remove redundant parenthesis. Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Feb 17 11:36:41 2013 (r246903) +++ head/sys/kern/kern_fork.c Sun Feb 17 11:47:01 2013 (r246904) @@ -942,7 +942,7 @@ fail1: vmspace_free(vm2); uma_zfree(proc_zone, newproc); #ifdef PROCDESC - if (((flags & RFPROCDESC) != 0) && (fp_procdesc != NULL)) { + if ((flags & RFPROCDESC) != 0 && fp_procdesc != NULL) { fdclose(td->td_proc->p_fd, fp_procdesc, *procdescp, td); fdrop(fp_procdesc, td); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:47:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85577B7F; Sun, 17 Feb 2013 11:47:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 598632B1; Sun, 17 Feb 2013 11:47:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBlVTN004250; Sun, 17 Feb 2013 11:47:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBlVJb004249; Sun, 17 Feb 2013 11:47:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171147.r1HBlVJb004249@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246905 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:47:31 -0000 Author: pjd Date: Sun Feb 17 11:47:30 2013 New Revision: 246905 URL: http://svnweb.freebsd.org/changeset/base/246905 Log: Don't treat pointers as booleans. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Feb 17 11:47:01 2013 (r246904) +++ head/sys/kern/kern_descrip.c Sun Feb 17 11:47:30 2013 (r246905) @@ -1949,11 +1949,11 @@ fdfree(struct thread *td) fdp->fd_jdir = NULL; FILEDESC_XUNLOCK(fdp); - if (cdir) + if (cdir != NULL) vrele(cdir); - if (rdir) + if (rdir != NULL) vrele(rdir); - if (jdir) + if (jdir != NULL) vrele(jdir); fddrop(fdp); From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:47:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8F621CEE; Sun, 17 Feb 2013 11:47:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EB252B9; Sun, 17 Feb 2013 11:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBlx70004342; Sun, 17 Feb 2013 11:47:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBlxQH004341; Sun, 17 Feb 2013 11:47:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171147.r1HBlxQH004341@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246906 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:47:59 -0000 Author: pjd Date: Sun Feb 17 11:47:58 2013 New Revision: 246906 URL: http://svnweb.freebsd.org/changeset/base/246906 Log: Add break to the default case. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Feb 17 11:47:30 2013 (r246905) +++ head/sys/kern/kern_sig.c Sun Feb 17 11:47:58 2013 (r246906) @@ -3130,6 +3130,7 @@ corefile_open(const char *comm, uid_t ui break; default: sbuf_putc(&sb, format[i]); + break; } } free(hostname, M_TEMP); From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:48:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7911BE5C; Sun, 17 Feb 2013 11:48:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 515E12BF; Sun, 17 Feb 2013 11:48:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBmHYj004439; Sun, 17 Feb 2013 11:48:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBmHkR004438; Sun, 17 Feb 2013 11:48:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171148.r1HBmHkR004438@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246907 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:48:17 -0000 Author: pjd Date: Sun Feb 17 11:48:16 2013 New Revision: 246907 URL: http://svnweb.freebsd.org/changeset/base/246907 Log: Remove redundant space. Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sun Feb 17 11:47:58 2013 (r246906) +++ head/sys/kern/sys_pipe.c Sun Feb 17 11:48:16 2013 (r246907) @@ -473,7 +473,7 @@ sys_pipe(struct thread *td, struct pipe_ error = kern_pipe(td, fildes); if (error) return (error); - + td->td_retval[0] = fildes[0]; td->td_retval[1] = fildes[1]; From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:49:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2507FFD; Sun, 17 Feb 2013 11:49:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A07422D9; Sun, 17 Feb 2013 11:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBnLuJ004624; Sun, 17 Feb 2013 11:49:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBnLFD004623; Sun, 17 Feb 2013 11:49:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171149.r1HBnLFD004623@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246908 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:49:21 -0000 Author: pjd Date: Sun Feb 17 11:49:21 2013 New Revision: 246908 URL: http://svnweb.freebsd.org/changeset/base/246908 Log: Remove redundant parenthesis. Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sun Feb 17 11:48:16 2013 (r246907) +++ head/sys/kern/sys_capability.c Sun Feb 17 11:49:21 2013 (r246908) @@ -113,7 +113,7 @@ sys_cap_getmode(struct thread *td, struc { u_int i; - i = (IN_CAPABILITY_MODE(td)) ? 1 : 0; + i = IN_CAPABILITY_MODE(td) ? 1 : 0; return (copyout(&i, uap->modep, sizeof(i))); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:53:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 251DC347; Sun, 17 Feb 2013 11:53:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0DCC5309; Sun, 17 Feb 2013 11:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBrpD3006880; Sun, 17 Feb 2013 11:53:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBrplt006879; Sun, 17 Feb 2013 11:53:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171153.r1HBrplt006879@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246909 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:53:52 -0000 Author: pjd Date: Sun Feb 17 11:53:51 2013 New Revision: 246909 URL: http://svnweb.freebsd.org/changeset/base/246909 Log: - Require CAP_FSYNC capability right when opening a file with O_SYNC or O_FSYNC flags. - While here simplify check for locking flags. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Feb 17 11:49:21 2013 (r246908) +++ head/sys/kern/vfs_syscalls.c Sun Feb 17 11:53:51 2013 (r246909) @@ -980,7 +980,10 @@ flags_to_rights(int flags) if (flags & O_TRUNC) rights |= CAP_FTRUNCATE; - if ((flags & O_EXLOCK) || (flags & O_SHLOCK)) + if (flags & (O_SYNC | O_FSYNC)) + rights |= CAP_FSYNC; + + if (flags & (O_EXLOCK | O_SHLOCK)) rights |= CAP_FLOCK; return (rights); From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:56:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 94C3B4CD; Sun, 17 Feb 2013 11:56:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F15D320; Sun, 17 Feb 2013 11:56:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBubWE007327; Sun, 17 Feb 2013 11:56:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBubIH007326; Sun, 17 Feb 2013 11:56:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171156.r1HBubIH007326@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246910 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:56:37 -0000 Author: pjd Date: Sun Feb 17 11:56:36 2013 New Revision: 246910 URL: http://svnweb.freebsd.org/changeset/base/246910 Log: Style. Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Feb 17 11:53:51 2013 (r246909) +++ head/sys/kern/vfs_syscalls.c Sun Feb 17 11:56:36 2013 (r246910) @@ -3268,8 +3268,7 @@ kern_futimes(struct thread *td, int fd, AUDIT_ARG_FD(fd); if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - if ((error = getvnode(td->td_proc->p_fd, fd, CAP_FUTIMES, &fp)) - != 0) + if ((error = getvnode(td->td_proc->p_fd, fd, CAP_FUTIMES, &fp)) != 0) return (error); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); @@ -3419,8 +3418,7 @@ sys_fsync(td, uap) int error, lock_flags; AUDIT_ARG_FD(uap->fd); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_FSYNC, - &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_FSYNC, &fp)) != 0) return (error); vp = fp->f_vnode; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) @@ -3529,8 +3527,7 @@ kern_renameat(struct thread *td, int old goto out1; } NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | - SAVESTART | AUDITVNODE2, pathseg, new, newfd, CAP_CREATE, - td); + SAVESTART | AUDITVNODE2, pathseg, new, newfd, CAP_CREATE, td); if (fromnd.ni_vp->v_type == VDIR) tond.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&tond)) != 0) { @@ -3829,8 +3826,7 @@ kern_ogetdirentries(struct thread *td, s /* XXX arbitrary sanity limit on `count'. */ if (uap->count > 64 * 1024) return (EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_READ, - &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_READ, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -4621,7 +4617,7 @@ kern_posix_fadvise(struct thread *td, in error = fget(td, fd, 0, &fp); if (error != 0) goto out; - + switch (fp->f_type) { case DTYPE_VNODE: break; From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:57:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C500E641; Sun, 17 Feb 2013 11:57:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2EAB329; Sun, 17 Feb 2013 11:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBvlKu007508; Sun, 17 Feb 2013 11:57:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBvlbu007507; Sun, 17 Feb 2013 11:57:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171157.r1HBvlbu007507@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246911 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:57:47 -0000 Author: pjd Date: Sun Feb 17 11:57:47 2013 New Revision: 246911 URL: http://svnweb.freebsd.org/changeset/base/246911 Log: Remove redundant check. Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sun Feb 17 11:56:36 2013 (r246910) +++ head/sys/security/audit/audit_bsm.c Sun Feb 17 11:57:47 2013 (r246911) @@ -223,9 +223,7 @@ kau_free(struct au_record *rec) } while (0) #define UPATH1_VNODE1_TOKENS do { \ - if (ARG_IS_VALID(kar, ARG_UPATH1)) { \ - UPATH1_TOKENS; \ - } \ + UPATH1_TOKENS; \ if (ARG_IS_VALID(kar, ARG_VNODE1)) { \ tok = au_to_attr32(&ar->ar_arg_vnode1); \ kau_write(rec, tok); \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 11:58:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D51267C5; Sun, 17 Feb 2013 11:58:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98420339; Sun, 17 Feb 2013 11:58:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HBwU82007647; Sun, 17 Feb 2013 11:58:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HBwUNb007646; Sun, 17 Feb 2013 11:58:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302171158.r1HBwUNb007646@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 11:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246912 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 11:58:30 -0000 Author: pjd Date: Sun Feb 17 11:58:30 2013 New Revision: 246912 URL: http://svnweb.freebsd.org/changeset/base/246912 Log: Remove space before tab. Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sun Feb 17 11:57:47 2013 (r246911) +++ head/sys/sys/filedesc.h Sun Feb 17 11:58:30 2013 (r246912) @@ -88,7 +88,7 @@ struct filedesc_to_leader { /* * Per-process open flags. */ -#define UF_EXCLOSE 0x01 /* auto-close on exec */ +#define UF_EXCLOSE 0x01 /* auto-close on exec */ #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 13:07:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F27B2240; Sun, 17 Feb 2013 13:06:59 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF4307E3; Sun, 17 Feb 2013 13:06:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HD6xqU028563; Sun, 17 Feb 2013 13:06:59 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HD6xGM028562; Sun, 17 Feb 2013 13:06:59 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201302171306.r1HD6xGM028562@svn.freebsd.org> From: "Andrey A. Chernov" Date: Sun, 17 Feb 2013 13:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246913 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 13:07:00 -0000 Author: ache Date: Sun Feb 17 13:06:59 2013 New Revision: 246913 URL: http://svnweb.freebsd.org/changeset/base/246913 Log: In 'make hierarchy' don't install /sys/sys pointing to usr/src/sys but just /sys pointing there Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Feb 17 11:58:30 2013 (r246912) +++ head/etc/Makefile Sun Feb 17 13:06:59 2013 (r246913) @@ -354,7 +354,7 @@ distrib-dirs: ${METALOG.add} ; \ done; true .endif - ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys + ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/ cd ${DESTDIR}/usr/share/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 18:42:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4EC7332D; Sun, 17 Feb 2013 18:42:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2756D29D; Sun, 17 Feb 2013 18:42:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HIgVYV032273; Sun, 17 Feb 2013 18:42:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HIgVs3032272; Sun, 17 Feb 2013 18:42:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302171842.r1HIgVs3032272@svn.freebsd.org> From: Alexander Motin Date: Sun, 17 Feb 2013 18:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246916 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 18:42:31 -0000 Author: mav Date: Sun Feb 17 18:42:30 2013 New Revision: 246916 URL: http://svnweb.freebsd.org/changeset/base/246916 Log: MFcalloutng: Microoptimize i8254 one-shot operation mode (disabled by default to allow timecounter functionality) by not writing to mode and MSB registers when it is not required. This saves several microseconds of CPU time per call, reducing minimal measured interrupts interval to 19.5us. Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Sun Feb 17 14:27:04 2013 (r246915) +++ head/sys/x86/isa/clock.c Sun Feb 17 18:42:30 2013 (r246916) @@ -125,6 +125,8 @@ struct attimer_softc { static struct attimer_softc *attimer_sc = NULL; static int timer0_period = -2; +static int timer0_mode = 0xffff; +static int timer0_last = 0xffff; /* Values for timerX_state: */ #define RELEASED 0 @@ -404,7 +406,7 @@ DELAY(int n) static void set_i8254_freq(int mode, uint32_t period) { - int new_count; + int new_count, new_mode; mtx_lock_spin(&clock_lock); if (mode == MODE_STOP) { @@ -423,21 +425,34 @@ set_i8254_freq(int mode, uint32_t period timer0_period = (mode == MODE_PERIODIC) ? new_count : -1; switch (mode) { case MODE_STOP: - outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); + new_mode = TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT; + outb(TIMER_MODE, new_mode); outb(TIMER_CNTR0, 0); outb(TIMER_CNTR0, 0); break; case MODE_PERIODIC: - outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); + new_mode = TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT; + outb(TIMER_MODE, new_mode); outb(TIMER_CNTR0, new_count & 0xff); outb(TIMER_CNTR0, new_count >> 8); break; case MODE_ONESHOT: - outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); + if (new_count < 256 && timer0_last < 256) { + new_mode = TIMER_SEL0 | TIMER_INTTC | TIMER_LSB; + if (new_mode != timer0_mode) + outb(TIMER_MODE, new_mode); + outb(TIMER_CNTR0, new_count & 0xff); + break; + } + new_mode = TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT; + if (new_mode != timer0_mode) + outb(TIMER_MODE, new_mode); outb(TIMER_CNTR0, new_count & 0xff); outb(TIMER_CNTR0, new_count >> 8); break; } + timer0_mode = new_mode; + timer0_last = new_count; out: mtx_unlock_spin(&clock_lock); } @@ -447,6 +462,8 @@ i8254_restore(void) { timer0_period = -2; + timer0_mode = 0xffff; + timer0_last = 0xffff; if (attimer_sc != NULL) set_i8254_freq(attimer_sc->mode, attimer_sc->period); else From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 19:48:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83554F19; Sun, 17 Feb 2013 19:48:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7581765E; Sun, 17 Feb 2013 19:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HJmOnm051644; Sun, 17 Feb 2013 19:48:24 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HJmOJ5051643; Sun, 17 Feb 2013 19:48:24 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302171948.r1HJmOJ5051643@svn.freebsd.org> From: Mark Johnston Date: Sun, 17 Feb 2013 19:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246917 - head/usr.bin/grep/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 19:48:24 -0000 Author: markj Date: Sun Feb 17 19:48:23 2013 New Revision: 246917 URL: http://svnweb.freebsd.org/changeset/base/246917 Log: Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a valid index into the input buffer. PR: bin/175213 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week Modified: head/usr.bin/grep/regex/tre-fastmatch.c Modified: head/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- head/usr.bin/grep/regex/tre-fastmatch.c Sun Feb 17 18:42:30 2013 (r246916) +++ head/usr.bin/grep/regex/tre-fastmatch.c Sun Feb 17 19:48:23 2013 (r246917) @@ -103,7 +103,7 @@ static int fastcmp(const fastmatch_t *fg ((!fg->reversed \ ? ((type == STR_WIDE) ? ((j + fg->wlen) > len) \ : ((j + fg->len) > len)) \ - : (j < 0))) + : (j <= 0))) /* * Checks whether the new position after shifting in the input string From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 20:35:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 647F5EA0; Sun, 17 Feb 2013 20:35:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 460927C5; Sun, 17 Feb 2013 20:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HKZtCs067351; Sun, 17 Feb 2013 20:35:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HKZsS1067345; Sun, 17 Feb 2013 20:35:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302172035.r1HKZsS1067345@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 17 Feb 2013 20:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246921 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 20:35:55 -0000 Author: kib Date: Sun Feb 17 20:35:54 2013 New Revision: 246921 URL: http://svnweb.freebsd.org/changeset/base/246921 Log: Do not update the fsinfo block on each update of any fat block, this is excessive. Postpone the flush of the fsinfo to VFS_SYNC(), remembering the need for update with the flag MSDOSFS_FSIMOD, stored in pm_flags. FAT32 specification describes both FSI_Free_Count and FSI_Nxt_Free as the advisory hints, not requiring them to be correct. Based on the patch from bde, modified by me. Reviewed by: bde MFC after: 2 weeks Modified: head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/msdosfs/msdosfsmount.h Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Sun Feb 17 19:49:59 2013 (r246920) +++ head/sys/fs/msdosfs/msdosfs_fat.c Sun Feb 17 20:35:54 2013 (r246921) @@ -328,29 +328,6 @@ updatefats(pmp, bp, fatbn) printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); #endif - /* - * If we have an FSInfo block, update it. - */ - if (pmp->pm_fsinfo) { - if (bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, - NOCRED, &bpn) != 0) { - /* - * Ignore the error, but turn off FSInfo update for the future. - */ - pmp->pm_fsinfo = 0; - brelse(bpn); - } else { - struct fsinfo *fp = (struct fsinfo *)bpn->b_data; - - putulong(fp->fsinfree, pmp->pm_freeclustercount); - putulong(fp->fsinxtfree, pmp->pm_nxtfree); - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) - bwrite(bpn); - else - bdwrite(bpn); - } - } - if (pmp->pm_flags & MSDOSFS_FATMIRROR) { /* * Now copy the block(s) of the modified fat to the other copies of @@ -393,9 +370,6 @@ updatefats(pmp, bp, fatbn) bwrite(bp); else bdwrite(bp); - /* - * Maybe update fsinfo sector here? - */ } /* @@ -431,6 +405,7 @@ usemap_alloc(pmp, cn) pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; + pmp->pm_flags |= MSDOSFS_FSIMOD; } static __inline void @@ -441,6 +416,7 @@ usemap_free(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_freeclustercount++; + pmp->pm_flags |= MSDOSFS_FSIMOD; KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); @@ -742,7 +718,10 @@ chainalloc(pmp, start, count, fillwith, for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++); - + pmp->pm_nxtfree = start + count; + if (pmp->pm_nxtfree > pmp->pm_maxcluster) + pmp->pm_nxtfree = CLUST_FIRST; + pmp->pm_flags |= MSDOSFS_FSIMOD; error = fatchain(pmp, start, count, fillwith); if (error != 0) return (error); @@ -754,9 +733,6 @@ chainalloc(pmp, start, count, fillwith, *retcluster = start; if (got) *got = count; - pmp->pm_nxtfree = start + count; - if (pmp->pm_nxtfree > pmp->pm_maxcluster) - pmp->pm_nxtfree = CLUST_FIRST; return (0); } Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Feb 17 19:49:59 2013 (r246920) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Feb 17 20:35:54 2013 (r246921) @@ -896,6 +896,40 @@ msdosfs_statfs(struct mount *mp, struct return (0); } +/* + * If we have an FSInfo block, update it. + */ +static int +msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor) +{ + struct fsinfo *fp; + struct buf *bp; + int error; + + MSDOSFS_LOCK_MP(pmp); + if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) { + error = 0; + goto unlock; + } + error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, + NOCRED, &bp); + if (error != 0) { + brelse(bp); + goto unlock; + } + fp = (struct fsinfo *)bp->b_data; + putulong(fp->fsinfree, pmp->pm_freeclustercount); + putulong(fp->fsinxtfree, pmp->pm_nxtfree); + pmp->pm_flags &= ~MSDOSFS_FSIMOD; + if (waitfor == MNT_WAIT) + error = bwrite(bp); + else + bawrite(bp); +unlock: + MSDOSFS_UNLOCK_MP(pmp); + return (error); +} + static int msdosfs_sync(struct mount *mp, int waitfor) { @@ -958,6 +992,10 @@ loop: allerror = error; VOP_UNLOCK(pmp->pm_devvp, 0); } + + error = msdosfs_fsiflush(pmp, waitfor); + if (error != 0) + allerror = error; return (allerror); } Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Sun Feb 17 19:49:59 2013 (r246920) +++ head/sys/fs/msdosfs/msdosfsmount.h Sun Feb 17 20:35:54 2013 (r246921) @@ -262,6 +262,7 @@ struct msdosfs_args { #define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */ #define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */ #define MSDOSFS_LARGEFS 0x10000000 /* perform fileno mapping */ +#define MSDOSFS_FSIMOD 0x01000000 #define MSDOSFS_ARGSMAGIC 0xe4eff300 From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 21:12:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CF29712; Sun, 17 Feb 2013 21:12:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F22C98C9; Sun, 17 Feb 2013 21:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HLCZl2079231; Sun, 17 Feb 2013 21:12:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HLCYfm079218; Sun, 17 Feb 2013 21:12:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302172112.r1HLCYfm079218@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 21:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246922 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 21:12:36 -0000 Author: pjd Date: Sun Feb 17 21:12:34 2013 New Revision: 246922 URL: http://svnweb.freebsd.org/changeset/base/246922 Log: - Add support for 'memsync' mode. This is the fastest replication mode that's why it will now be the default. - Bump protocol version to 2 and add backward compatibility for version 1. - Allow to specify hosts by kern.hostid as well (in addition to hostname and kern.hostuuid) in configuration file. Sponsored by: Panzura Tested by: trociny Added: head/sbin/hastd/refcnt.h (contents, props changed) Modified: head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hast_proto.c head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/hast.conf.5 Sun Feb 17 21:12:34 2013 (r246922) @@ -129,9 +129,13 @@ The .Aq node argument can be replaced either by a full hostname as obtained by .Xr gethostname 3 , -only first part of the hostname, or by node's UUID as found in the +only first part of the hostname, by node's UUID as found in the .Va kern.hostuuid .Xr sysctl 8 +variable +or by node's hostid as found in the +.Va kern.hostid +.Xr sysctl 8 variable. .Pp The following statements are available: @@ -208,15 +212,12 @@ to the application was lost. The risk of such a situation is very small. The .Ic memsync -replication mode is currently not implemented. +replication mode is the default. .It Ic fullsync .Pp Mark the write operation as completed when local as well as remote write completes. This is the safest and the slowest replication mode. -The -.Ic fullsync -replication mode is the default. .It Ic async .Pp The write operation is reported as complete right after the local write Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/hast.h Sun Feb 17 21:12:34 2013 (r246922) @@ -53,8 +53,9 @@ * Version history: * 0 - initial version * 1 - HIO_KEEPALIVE added + * 2 - "memsync" and "received" attributes added for memsync mode */ -#define HAST_PROTO_VERSION 1 +#define HAST_PROTO_VERSION 2 #define EHAST_OK 0 #define EHAST_NOENTRY 1 @@ -142,8 +143,10 @@ struct hastd_config { struct hast_resource { /* Resource name. */ char hr_name[NAME_MAX]; - /* Replication mode (HAST_REPLICATION_*). */ + /* Negotiated replication mode (HAST_REPLICATION_*). */ int hr_replication; + /* Configured replication mode (HAST_REPLICATION_*). */ + int hr_original_replication; /* Provider name that will appear in /dev/hast/. */ char hr_provname[NAME_MAX]; /* Synchronization extent size. */ @@ -156,6 +159,8 @@ struct hast_resource { int hr_compression; /* Checksum algorithm. */ int hr_checksum; + /* Protocol version. */ + int hr_version; /* Path to local component. */ char hr_localpath[PATH_MAX]; Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/hast_proto.c Sun Feb 17 21:12:34 2013 (r246922) @@ -112,7 +112,7 @@ hast_proto_send(const struct hast_resour if (eb == NULL) goto end; - hdr.version = HAST_PROTO_VERSION; + hdr.version = res != NULL ? res->hr_version : HAST_PROTO_VERSION; hdr.size = htole32((uint32_t)ebuf_size(eb)); if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1) goto end; @@ -144,7 +144,7 @@ hast_proto_recv_hdr(const struct proto_c if (proto_recv(conn, &hdr, sizeof(hdr)) == -1) goto fail; - if (hdr.version != HAST_PROTO_VERSION) { + if (hdr.version > HAST_PROTO_VERSION) { errno = ERPCMISMATCH; goto fail; } Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/hastd.c Sun Feb 17 21:12:34 2013 (r246922) @@ -68,7 +68,7 @@ static struct hastd_config *cfg; bool sigexit_received = false; /* Path to pidfile. */ static const char *pidfile; -/* PID file handle. */ +/* Pidfile handle. */ struct pidfh *pfh; /* Do we run in foreground? */ static bool foreground; @@ -748,6 +748,7 @@ listen_accept(struct hastd_listen *lst) const char *resname; const unsigned char *token; char laddr[256], raddr[256]; + uint8_t version; size_t size; pid_t pid; int status; @@ -797,6 +798,20 @@ listen_accept(struct hastd_listen *lst) goto close; } pjdlog_debug(2, "%s: resource=%s", raddr, resname); + version = nv_get_uint8(nvin, "version"); + pjdlog_debug(2, "%s: version=%hhu", raddr, version); + if (version == 0) { + /* + * If no version is sent, it means this is protocol version 1. + */ + version = 1; + } + if (version > HAST_PROTO_VERSION) { + pjdlog_info("Remote protocol version %hhu is not supported, falling back to version %hhu.", + version, (unsigned char)HAST_PROTO_VERSION); + version = HAST_PROTO_VERSION; + } + pjdlog_debug(1, "Negotiated protocol version %hhu.", version); token = nv_get_uint8_array(nvin, &size, "token"); /* * NULL token means that this is first connection. @@ -910,8 +925,10 @@ listen_accept(struct hastd_listen *lst) */ if (token == NULL) { + res->hr_version = version; arc4random_buf(res->hr_token, sizeof(res->hr_token)); nvout = nv_alloc(); + nv_add_uint8(nvout, version, "version"); nv_add_uint8_array(nvout, res->hr_token, sizeof(res->hr_token), "token"); if (nv_error(nvout) != 0) { @@ -922,7 +939,7 @@ listen_accept(struct hastd_listen *lst) strerror(nv_error(nvout))); goto fail; } - if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) { + if (hast_proto_send(res, conn, nvout, NULL, 0) == -1) { int error = errno; pjdlog_errno(LOG_ERR, "Unable to send response to %s", Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/parse.y Sun Feb 17 21:12:34 2013 (r246922) @@ -236,6 +236,7 @@ replication_statement: REPLICATION repli case 1: PJDLOG_ASSERT(curres != NULL); curres->hr_replication = $2; + curres->hr_original_replication = $2; break; default: PJDLOG_ABORT("replication at wrong depth level"); @@ -533,8 +534,10 @@ resource_start: STR curres->hr_role = HAST_ROLE_INIT; curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; + curres->hr_original_replication = -1; curres->hr_checksum = -1; curres->hr_compression = -1; + curres->hr_version = 1; curres->hr_timeout = -1; curres->hr_exec[0] = '\0'; curres->hr_provname[0] = '\0'; @@ -724,6 +727,7 @@ static int isitme(const char *name) { char buf[MAXHOSTNAMELEN]; + unsigned long hostid; char *pos; size_t bufsize; @@ -738,7 +742,7 @@ isitme(const char *name) return (1); /* - * Now check if it matches first part of the host name. + * Check if it matches first part of the host name. */ pos = strchr(buf, '.'); if (pos != NULL && (size_t)(pos - buf) == strlen(name) && @@ -747,7 +751,7 @@ isitme(const char *name) } /* - * At the end check if name is equal to our host's UUID. + * Check if it matches host UUID. */ bufsize = sizeof(buf); if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { @@ -758,6 +762,18 @@ isitme(const char *name) return (1); /* + * Check if it matches hostid. + */ + bufsize = sizeof(hostid); + if (sysctlbyname("kern.hostid", &hostid, &bufsize, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostid) failed"); + return (-1); + } + (void)snprintf(buf, sizeof(buf), "hostid%lu", hostid); + if (strcmp(buf, name) == 0) + return (1); + + /* * Looks like this isn't about us. */ return (0); @@ -769,7 +785,7 @@ family_supported(int family) int sock; sock = socket(family, SOCK_STREAM, 0); - if (sock == -1 && errno == EAFNOSUPPORT) + if (sock == -1 && errno == EPROTONOSUPPORT) return (false); if (sock >= 0) (void)close(sock); @@ -781,6 +797,7 @@ node_names(char **namesp) { static char names[MAXHOSTNAMELEN * 3]; char buf[MAXHOSTNAMELEN]; + unsigned long hostid; char *pos; size_t bufsize; @@ -808,6 +825,16 @@ node_names(char **namesp) return (-1); } (void)strlcat(names, buf, sizeof(names)); + (void)strlcat(names, ", ", sizeof(names)); + + /* Host ID. */ + bufsize = sizeof(hostid); + if (sysctlbyname("kern.hostid", &hostid, &bufsize, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostid) failed"); + return (-1); + } + (void)snprintf(buf, sizeof(buf), "hostid%lu", hostid); + (void)strlcat(names, buf, sizeof(names)); *namesp = names; @@ -833,7 +860,7 @@ yy_config_parse(const char *config, bool lineno = 0; depth0_timeout = HAST_TIMEOUT; - depth0_replication = HAST_REPLICATION_FULLSYNC; + depth0_replication = HAST_REPLICATION_MEMSYNC; depth0_checksum = HAST_CHECKSUM_NONE; depth0_compression = HAST_COMPRESSION_HOLE; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); @@ -943,11 +970,7 @@ yy_config_parse(const char *config, bool * Use global or default setting. */ curres->hr_replication = depth0_replication; - } - if (curres->hr_replication == HAST_REPLICATION_MEMSYNC) { - pjdlog_warning("Replication mode \"%s\" is not implemented, falling back to \"%s\".", - "memsync", "fullsync"); - curres->hr_replication = HAST_REPLICATION_FULLSYNC; + curres->hr_original_replication = depth0_replication; } if (curres->hr_checksum == -1) { /* Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/primary.c Sun Feb 17 21:12:34 2013 (r246922) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -65,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include "metadata.h" #include "proto.h" #include "pjdlog.h" +#include "refcnt.h" #include "subr.h" #include "synch.h" @@ -543,7 +543,7 @@ primary_connect(struct hast_resource *re return (0); } - + /* * Function instructs GEOM_GATE to handle reads directly from within the kernel. */ @@ -577,6 +577,7 @@ init_remote(struct hast_resource *res, s int32_t extentsize; int64_t datasize; uint32_t mapsize; + uint8_t version; size_t size; int error; @@ -597,6 +598,7 @@ init_remote(struct hast_resource *res, s */ nvout = nv_alloc(); nv_add_string(nvout, res->hr_name, "resource"); + nv_add_uint8(nvout, HAST_PROTO_VERSION, "version"); if (nv_error(nvout) != 0) { pjdlog_common(LOG_WARNING, 0, nv_error(nvout), "Unable to allocate header for connection with %s", @@ -626,6 +628,20 @@ init_remote(struct hast_resource *res, s nv_free(nvin); goto close; } + version = nv_get_uint8(nvin, "version"); + if (version == 0) { + /* + * If no version is sent, it means this is protocol version 1. + */ + version = 1; + } + if (version > HAST_PROTO_VERSION) { + pjdlog_warning("Invalid version received (%hhu).", version); + nv_free(nvin); + goto close; + } + res->hr_version = version; + pjdlog_debug(1, "Negotiated protocol version %d.", res->hr_version); token = nv_get_uint8_array(nvin, &size, "token"); if (token == NULL) { pjdlog_warning("Handshake header from %s has no 'token' field.", @@ -776,6 +792,16 @@ init_remote(struct hast_resource *res, s pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); #endif pjdlog_info("Connected to %s.", res->hr_remoteaddr); + if (res->hr_original_replication == HAST_REPLICATION_MEMSYNC && + res->hr_version < 2) { + pjdlog_warning("The 'memsync' replication mode is not supported by the remote node, falling back to 'fullsync' mode."); + res->hr_replication = HAST_REPLICATION_FULLSYNC; + } else if (res->hr_replication != res->hr_original_replication) { + /* + * This is in case hastd disconnected and was upgraded. + */ + res->hr_replication = res->hr_original_replication; + } if (inp != NULL && outp != NULL) { *inp = in; *outp = out; @@ -1009,7 +1035,8 @@ hastd_primary(struct hast_resource *res) } static void -reqlog(int loglevel, int debuglevel, struct g_gate_ctl_io *ggio, const char *fmt, ...) +reqlog(int loglevel, int debuglevel, struct g_gate_ctl_io *ggio, + const char *fmt, ...) { char msg[1024]; va_list ap; @@ -1020,21 +1047,18 @@ reqlog(int loglevel, int debuglevel, str switch (ggio->gctl_cmd) { case BIO_READ: (void)snprlcat(msg, sizeof(msg), "READ(%ju, %ju).", - (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); + (uintmax_t)ggio->gctl_offset, (uintmax_t)ggio->gctl_length); break; case BIO_DELETE: (void)snprlcat(msg, sizeof(msg), "DELETE(%ju, %ju).", - (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); + (uintmax_t)ggio->gctl_offset, (uintmax_t)ggio->gctl_length); break; case BIO_FLUSH: (void)snprlcat(msg, sizeof(msg), "FLUSH."); break; case BIO_WRITE: (void)snprlcat(msg, sizeof(msg), "WRITE(%ju, %ju).", - (uintmax_t)ggio->gctl_offset, - (uintmax_t)ggio->gctl_length); + (uintmax_t)ggio->gctl_offset, (uintmax_t)ggio->gctl_length); break; default: (void)snprlcat(msg, sizeof(msg), "UNKNOWN(%u).", @@ -1274,8 +1298,13 @@ ggate_recv_thread(void *arg) } pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); - refcount_init(&hio->hio_countdown, ncomps); - for (ii = ncomp; ii < ncomp + ncomps; ii++) + hio->hio_countdown = ncomps; + if (hio->hio_replication == HAST_REPLICATION_MEMSYNC && + ggio->gctl_cmd == BIO_WRITE) { + /* Each remote request needs two responses in memsync. */ + hio->hio_countdown++; + } + for (ii = ncomp; ii < ncomps; ii++) QUEUE_INSERT1(hio, send, ii); } /* NOTREACHED */ @@ -1346,8 +1375,7 @@ local_send_thread(void *arg) } else { hio->hio_errors[ncomp] = 0; if (hio->hio_replication == - HAST_REPLICATION_ASYNC && - !ISSYNCREQ(hio)) { + HAST_REPLICATION_ASYNC) { ggio->gctl_error = 0; write_complete(res, hio); } @@ -1385,8 +1413,42 @@ local_send_thread(void *arg) } break; } - if (!refcount_release(&hio->hio_countdown)) - continue; + + if (hio->hio_replication != HAST_REPLICATION_MEMSYNC || + ggio->gctl_cmd != BIO_WRITE || ISSYNCREQ(hio)) { + if (refcnt_release(&hio->hio_countdown) > 0) + continue; + } else { + /* + * Depending on hio_countdown value, requests finished + * in the following order: + * 0: remote memsync, remote final, local write + * 1: remote memsync, local write, (remote final) + * 2: local write, (remote memsync), (remote final) + */ + switch (refcnt_release(&hio->hio_countdown)) { + case 0: + /* + * Local write finished as last. + */ + break; + case 1: + /* + * Local write finished after remote memsync + * reply arrvied. We can complete the write now. + */ + if (hio->hio_errors[0] == 0) + write_complete(res, hio); + continue; + case 2: + /* + * Local write finished as first. + */ + continue; + default: + PJDLOG_ABORT("Invalid hio_countdown."); + } + } if (ISSYNCREQ(hio)) { mtx_lock(&sync_lock); SYNCREQDONE(hio); @@ -1508,6 +1570,10 @@ remote_send_thread(void *arg) nv_add_uint64(nv, (uint64_t)ggio->gctl_seq, "seq"); nv_add_uint64(nv, offset, "offset"); nv_add_uint64(nv, length, "length"); + if (hio->hio_replication == HAST_REPLICATION_MEMSYNC && + ggio->gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio)) { + nv_add_uint8(nv, 1, "memsync"); + } if (nv_error(nv) != 0) { hio->hio_errors[ncomp] = nv_error(nv); pjdlog_debug(2, @@ -1568,7 +1634,7 @@ remote_send_thread(void *arg) done_queue: nv_free(nv); if (ISSYNCREQ(hio)) { - if (!refcount_release(&hio->hio_countdown)) + if (refcnt_release(&hio->hio_countdown) > 0) continue; mtx_lock(&sync_lock); SYNCREQDONE(hio); @@ -1583,8 +1649,10 @@ done_queue: (void)hast_activemap_flush(res); } mtx_unlock(&res->hr_amp_lock); + if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) + (void)refcnt_release(&hio->hio_countdown); } - if (!refcount_release(&hio->hio_countdown)) + if (refcnt_release(&hio->hio_countdown) > 0) continue; pjdlog_debug(2, "remote_send: (%p) Moving request to the done queue.", @@ -1608,6 +1676,7 @@ remote_recv_thread(void *arg) struct nv *nv; unsigned int ncomp; uint64_t seq; + bool memsyncack; int error; /* Remote component is 1 for now. */ @@ -1623,6 +1692,8 @@ remote_recv_thread(void *arg) } mtx_unlock(&hio_recv_list_lock[ncomp]); + memsyncack = false; + rw_rlock(&hio_remote_lock[ncomp]); if (!ISCONNECTED(res, ncomp)) { rw_unlock(&hio_remote_lock[ncomp]); @@ -1652,6 +1723,7 @@ remote_recv_thread(void *arg) nv_free(nv); continue; } + memsyncack = nv_exists(nv, "received"); mtx_lock(&hio_recv_list_lock[ncomp]); TAILQ_FOREACH(hio, &hio_recv_list[ncomp], hio_next[ncomp]) { if (hio->hio_ggio.gctl_seq == seq) { @@ -1707,8 +1779,80 @@ remote_recv_thread(void *arg) hio->hio_errors[ncomp] = 0; nv_free(nv); done_queue: - if (!refcount_release(&hio->hio_countdown)) - continue; + if (hio->hio_replication != HAST_REPLICATION_MEMSYNC || + hio->hio_ggio.gctl_cmd != BIO_WRITE || ISSYNCREQ(hio)) { + if (refcnt_release(&hio->hio_countdown) > 0) + continue; + } else { + /* + * Depending on hio_countdown value, requests finished + * in the following order: + * + * 0: local write, remote memsync, remote final + * or + * 0: remote memsync, local write, remote final + * + * 1: local write, remote memsync, (remote final) + * or + * 1: remote memsync, remote final, (local write) + * + * 2: remote memsync, (local write), (remote final) + * or + * 2: remote memsync, (remote final), (local write) + */ + switch (refcnt_release(&hio->hio_countdown)) { + case 0: + /* + * Remote final reply arrived. + */ + PJDLOG_ASSERT(!memsyncack); + break; + case 1: + if (memsyncack) { + /* + * Local request already finished, so we + * can complete the write. + */ + if (hio->hio_errors[0] == 0) + write_complete(res, hio); + /* + * We still need to wait for final + * remote reply. + */ + pjdlog_debug(2, + "remote_recv: (%p) Moving request back to the recv queue.", + hio); + mtx_lock(&hio_recv_list_lock[ncomp]); + TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], + hio, hio_next[ncomp]); + mtx_unlock(&hio_recv_list_lock[ncomp]); + } else { + /* + * Remote final reply arrived before + * local write finished. + * Nothing to do in such case. + */ + } + continue; + case 2: + /* + * We received remote memsync reply even before + * local write finished. + */ + PJDLOG_ASSERT(memsyncack); + + pjdlog_debug(2, + "remote_recv: (%p) Moving request back to the recv queue.", + hio); + mtx_lock(&hio_recv_list_lock[ncomp]); + TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, + hio_next[ncomp]); + mtx_unlock(&hio_recv_list_lock[ncomp]); + continue; + default: + PJDLOG_ABORT("Invalid hio_countdown."); + } + } if (ISSYNCREQ(hio)) { mtx_lock(&sync_lock); SYNCREQDONE(hio); @@ -1977,7 +2121,7 @@ sync_thread(void *arg __unused) ncomp = 1; } mtx_unlock(&metadata_lock); - refcount_init(&hio->hio_countdown, 1); + hio->hio_countdown = 1; QUEUE_INSERT1(hio, send, ncomp); /* @@ -2027,7 +2171,7 @@ sync_thread(void *arg __unused) pjdlog_debug(2, "sync: (%p) Moving request to the send queue.", hio); - refcount_init(&hio->hio_countdown, 1); + hio->hio_countdown = 1; QUEUE_INSERT1(hio, send, ncomp); /* Added: head/sbin/hastd/refcnt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/refcnt.h Sun Feb 17 21:12:34 2013 (r246922) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2005 John Baldwin + * 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. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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$ + */ + +#ifndef __REFCNT_H__ +#define __REFCNT_H__ + +#include + +#include "pjdlog.h" + +static __inline void +refcnt_acquire(volatile unsigned int *count) +{ + + atomic_add_acq_int(count, 1); +} + +static __inline unsigned int +refcnt_release(volatile unsigned int *count) +{ + unsigned int old; + + /* XXX: Should this have a rel membar? */ + old = atomic_fetchadd_int(count, -1); + PJDLOG_ASSERT(old > 0); + return (old - 1); +} + +#endif /* ! __REFCNT_H__ */ Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sun Feb 17 20:35:54 2013 (r246921) +++ head/sbin/hastd/secondary.c Sun Feb 17 21:12:34 2013 (r246922) @@ -71,6 +71,7 @@ struct hio { uint8_t hio_cmd; uint64_t hio_offset; uint64_t hio_length; + bool hio_memsync; TAILQ_ENTRY(hio) hio_next; }; @@ -135,6 +136,22 @@ hio_clear(struct hio *hio) hio->hio_cmd = HIO_UNDEF; hio->hio_offset = 0; hio->hio_length = 0; + hio->hio_memsync = false; +} + +static void +hio_copy(const struct hio *srchio, struct hio *dsthio) +{ + + /* + * We don't copy hio_error, hio_data and hio_next fields. + */ + + dsthio->hio_seq = srchio->hio_seq; + dsthio->hio_cmd = srchio->hio_cmd; + dsthio->hio_offset = srchio->hio_offset; + dsthio->hio_length = srchio->hio_length; + dsthio->hio_memsync = srchio->hio_memsync; } static void @@ -543,8 +560,10 @@ requnpack(struct hast_resource *res, str case HIO_FLUSH: case HIO_KEEPALIVE: break; - case HIO_READ: case HIO_WRITE: + hio->hio_memsync = nv_exists(nv, "memsync"); + /* FALLTHROUGH */ + case HIO_READ: case HIO_DELETE: hio->hio_offset = nv_get_uint64(nv, "offset"); if (nv_error(nv) != 0) { @@ -621,7 +640,7 @@ static void * recv_thread(void *arg) { struct hast_resource *res = arg; - struct hio *hio; + struct hio *hio, *mshio; struct nv *nv; for (;;) { @@ -675,6 +694,27 @@ recv_thread(void *arg) secondary_exit(EX_TEMPFAIL, "Unable to receive request data"); } + if (hio->hio_memsync) { + /* + * For memsync requests we expect two replies. + * Clone the hio so we can handle both of them. + */ + pjdlog_debug(2, "recv: Taking free request."); + QUEUE_TAKE(free, mshio); + pjdlog_debug(2, "recv: (%p) Got request.", + mshio); + hio_copy(hio, mshio); + mshio->hio_error = 0; + /* + * We want to keep 'memsync' tag only on the + * request going onto send queue (mshio). + */ + hio->hio_memsync = false; + pjdlog_debug(2, + "recv: (%p) Moving memsync request to the send queue.", + mshio); + QUEUE_INSERT(send, mshio); + } } nv_free(nv); pjdlog_debug(2, "recv: (%p) Moving request to the disk queue.", @@ -818,6 +858,10 @@ send_thread(void *arg) nvout = nv_alloc(); /* Copy sequence number. */ nv_add_uint64(nvout, hio->hio_seq, "seq"); + if (hio->hio_memsync) { + PJDLOG_ASSERT(hio->hio_cmd == HIO_WRITE); + nv_add_int8(nvout, 1, "received"); + } switch (hio->hio_cmd) { case HIO_READ: if (hio->hio_error == 0) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 17 21:37:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0847AC48; Sun, 17 Feb 2013 21:37:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D62DA983; Sun, 17 Feb 2013 21:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HLbXLv085760; Sun, 17 Feb 2013 21:37:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HLbWSF085759; Sun, 17 Feb 2013 21:37:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302172137.r1HLbWSF085759@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Feb 2013 21:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246923 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 17 Feb 2013 21:37:34 -0000 Author: pjd Date: Sun Feb 17 21:37:32 2013 New Revision: 246923 URL: http://svnweb.freebsd.org/changeset/base/246923 Log: Update the comment: we do show the backtrace of misbehaving thread. Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sun Feb 17 21:12:34 2013 (r246922) +++ head/sys/kern/subr_turnstile.c Sun Feb 17 21:37:32 2013 (r246923) @@ -215,10 +215,9 @@ propagate_priority(struct thread *td) /* * If the thread is asleep, then we are probably about - * to deadlock. To make debugging this easier, just - * panic and tell the user which thread misbehaved so - * they can hopefully get a stack trace from the truly - * misbehaving thread. + * to deadlock. To make debugging this easier, show + * backtrace of misbehaving thread and panic to not + * leave the kernel deadlocked. */ if (TD_IS_SLEEPING(td)) { printf( From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 00:38:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DE172EE2; Mon, 18 Feb 2013 00:38:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B99CF1000; Mon, 18 Feb 2013 00:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I0ce0H040573; Mon, 18 Feb 2013 00:38:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I0ceQh040572; Mon, 18 Feb 2013 00:38:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302180038.r1I0ceQh040572@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 18 Feb 2013 00:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246925 - head/contrib/openbsm/bin/auditdistd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 00:38:40 -0000 Author: pjd Date: Mon Feb 18 00:38:40 2013 New Revision: 246925 URL: http://svnweb.freebsd.org/changeset/base/246925 Log: Allow [] in remote address, which fixes IPv6 support. Reported by: simon Modified: head/contrib/openbsm/bin/auditdistd/token.l Modified: head/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- head/contrib/openbsm/bin/auditdistd/token.l Sun Feb 17 23:46:17 2013 (r246924) +++ head/contrib/openbsm/bin/auditdistd/token.l Mon Feb 18 00:38:40 2013 (r246925) @@ -74,7 +74,7 @@ sender { DP; return SENDER; } source { DP; return SOURCE; } timeout { DP; return TIMEOUT; } [0-9]+ { DP; yylval.num = atoi(yytext); return NUM; } -\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } +\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\[\]\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } \{ { DP; depth++; return OB; } \} { DP; depth--; return CB; } #.*$ /* ignore comments */; From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 01:02:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 68F60985; Mon, 18 Feb 2013 01:02:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B573186; Mon, 18 Feb 2013 01:02:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I12oRk049215; Mon, 18 Feb 2013 01:02:50 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I12nMX049209; Mon, 18 Feb 2013 01:02:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201302180102.r1I12nMX049209@svn.freebsd.org> From: Alan Cox Date: Mon, 18 Feb 2013 01:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246926 - in head/sys: arm/arm arm/include vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 01:02:50 -0000 Author: alc Date: Mon Feb 18 01:02:48 2013 New Revision: 246926 URL: http://svnweb.freebsd.org/changeset/base/246926 Log: On arm, like sparc64, the end of the kernel map varies from one type of machine to another. Therefore, VM_MAX_KERNEL_ADDRESS can't be a constant. Instead, #define it to be a variable, vm_max_kernel_address, just like we do on sparc64. Reviewed by: kib Tested by: ian Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/include/vmparam.h head/sys/vm/vm_kern.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Feb 18 00:38:40 2013 (r246925) +++ head/sys/arm/arm/machdep.c Mon Feb 18 01:02:48 2013 (r246926) @@ -1178,7 +1178,6 @@ initarm(struct arm_boot_params *abp) struct pv_addr kernel_l1pt; struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; - vm_offset_t pmap_bootstrap_lastaddr; uint32_t memsize, l2size; char *env; void *kmdp; @@ -1288,7 +1287,7 @@ initarm(struct arm_boot_params *abp) availmem_regions_sz = curr; /* Platform-specific initialisation */ - pmap_bootstrap_lastaddr = initarm_lastaddr(); + vm_max_kernel_address = initarm_lastaddr(); pcpu0_init(); @@ -1477,7 +1476,7 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); + pmap_bootstrap(freemempos, vm_max_kernel_address, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Feb 18 00:38:40 2013 (r246925) +++ head/sys/arm/arm/pmap-v6.c Mon Feb 18 01:02:48 2013 (r246926) @@ -231,6 +231,8 @@ vm_paddr_t kernel_l1pa; vm_offset_t kernel_vm_end = 0; +vm_offset_t vm_max_kernel_address; + struct pmap kernel_pmap_store; static pt_entry_t *csrc_pte, *cdst_pte; Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon Feb 18 00:38:40 2013 (r246925) +++ head/sys/arm/arm/pmap.c Mon Feb 18 01:02:48 2013 (r246926) @@ -220,6 +220,8 @@ vm_paddr_t kernel_l1pa; vm_offset_t kernel_vm_end = 0; +vm_offset_t vm_max_kernel_address; + struct pmap kernel_pmap_store; static pt_entry_t *csrc_pte, *cdst_pte; Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Mon Feb 18 00:38:40 2013 (r246925) +++ head/sys/arm/include/vmparam.h Mon Feb 18 01:02:48 2013 (r246926) @@ -133,7 +133,7 @@ #define VM_MIN_KERNEL_ADDRESS KERNBASE #endif -#define VM_MAX_KERNEL_ADDRESS 0xffffffff +#define VM_MAX_KERNEL_ADDRESS (vm_max_kernel_address) /* * Virtual size (bytes) for various kernel submaps. @@ -166,6 +166,8 @@ #define UMA_MD_SMALL_ALLOC #endif /* ARM_USE_SMALL_ALLOC */ +extern vm_offset_t vm_max_kernel_address; + #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Feb 18 00:38:40 2013 (r246925) +++ head/sys/vm/vm_kern.c Mon Feb 18 01:02:48 2013 (r246926) @@ -98,7 +98,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_a NULL, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, -#ifdef __sparc64__ +#if defined(__arm__) || defined(__sparc64__) &vm_max_kernel_address, 0, #else NULL, VM_MAX_KERNEL_ADDRESS, From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 01:09:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A760D38; Mon, 18 Feb 2013 01:09:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5831C9; Mon, 18 Feb 2013 01:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I190TW050544; Mon, 18 Feb 2013 01:09:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I190ET050543; Mon, 18 Feb 2013 01:09:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302180109.r1I190ET050543@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 01:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246927 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 01:09:00 -0000 Author: adrian Date: Mon Feb 18 01:08:59 2013 New Revision: 246927 URL: http://svnweb.freebsd.org/changeset/base/246927 Log: Disable this code and add a note as to why. It wasn't currently being called anyway - but being explicit about it can't hurt. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Feb 18 01:02:48 2013 (r246926) +++ head/sys/net80211/ieee80211_adhoc.c Mon Feb 18 01:08:59 2013 (r246927) @@ -768,8 +768,23 @@ adhoc_recv_mgmt(struct ieee80211_node *n IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; } + /* + * Same here - the channel width change should + * be applied to the specific peer node, not + * to the ic. Ie, the interface configuration + * should stay in its current channel width; + * but it should change the rate control and + * any queued frames for the given node only. + * + * Since there's no (current) way to inform + * the driver that a channel width change has + * occured for a single node, just stub this + * out. + */ +#if 0 if (ht_state_change) ieee80211_update_chw(ic); +#endif } break; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 01:22:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 311BA1C4; Mon, 18 Feb 2013 01:22:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 237B6254; Mon, 18 Feb 2013 01:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I1MKq3055756; Mon, 18 Feb 2013 01:22:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I1MKMD055755; Mon, 18 Feb 2013 01:22:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201302180122.r1I1MKMD055755@svn.freebsd.org> From: Alan Cox Date: Mon, 18 Feb 2013 01:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246929 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 01:22:21 -0000 Author: alc Date: Mon Feb 18 01:22:20 2013 New Revision: 246929 URL: http://svnweb.freebsd.org/changeset/base/246929 Log: Place a cap on the size of the kernel's heap, also known as the kmem submap. Otherwise, after r246204, the auto-scaling logic in kern_malloc.c tries to create a kmem submap that consumes the entire kernel map on a Pandaboard with 1 GB of RAM. Tested by: gonzo Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Mon Feb 18 01:14:21 2013 (r246928) +++ head/sys/arm/include/vmparam.h Mon Feb 18 01:22:20 2013 (r246929) @@ -145,6 +145,14 @@ #define VM_KMEM_SIZE_SCALE (2) #endif +/* + * Ceiling on the size of the kmem submap: 60% of the kernel map. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((vm_max_kernel_address - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + #define MAXTSIZ (16*1024*1024) #ifndef DFLDSIZ #define DFLDSIZ (128*1024*1024) From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 01:37:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67A503E1; Mon, 18 Feb 2013 01:37:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 559702AE; Mon, 18 Feb 2013 01:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I1budD059397; Mon, 18 Feb 2013 01:37:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I1buvL059396; Mon, 18 Feb 2013 01:37:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302180137.r1I1buvL059396@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 01:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246930 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 01:37:56 -0000 Author: adrian Date: Mon Feb 18 01:37:55 2013 New Revision: 246930 URL: http://svnweb.freebsd.org/changeset/base/246930 Log: Disable this variable; the code using it is also disabled. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Feb 18 01:22:20 2013 (r246929) +++ head/sys/net80211/ieee80211_adhoc.c Mon Feb 18 01:37:55 2013 (r246930) @@ -688,7 +688,9 @@ adhoc_recv_mgmt(struct ieee80211_node *n struct ieee80211_frame *wh; uint8_t *frm, *efrm, *sfrm; uint8_t *ssid, *rates, *xrates; +#if 0 int ht_state_change = 0; +#endif wh = mtod(m0, struct ieee80211_frame *); frm = (uint8_t *)&wh[1]; From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 01:55:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56538710; Mon, 18 Feb 2013 01:55:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39F25327; Mon, 18 Feb 2013 01:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I1tsj6064952; Mon, 18 Feb 2013 01:55:54 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I1trQn064949; Mon, 18 Feb 2013 01:55:53 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302180155.r1I1trQn064949@svn.freebsd.org> From: Tim Kientzle Date: Mon, 18 Feb 2013 01:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246931 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 01:55:54 -0000 Author: kientzle Date: Mon Feb 18 01:55:53 2013 New Revision: 246931 URL: http://svnweb.freebsd.org/changeset/base/246931 Log: Add strtoul() to libstand by copying from libc and clipping out locale code. Added: head/lib/libstand/strtoul.c - copied, changed from r246713, head/lib/libc/stdlib/strtoul.c Modified: head/lib/libstand/Makefile head/lib/libstand/stand.h Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon Feb 18 01:37:55 2013 (r246930) +++ head/lib/libstand/Makefile Mon Feb 18 01:55:53 2013 (r246931) @@ -39,7 +39,7 @@ CFLAGS+= -msoft-float -D_STANDALONE # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ sbrk.c twiddle.c zalloc.c zalloc_malloc.c # private (pruned) versions of libc string functions Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Mon Feb 18 01:37:55 2013 (r246930) +++ head/lib/libstand/stand.h Mon Feb 18 01:55:53 2013 (r246931) @@ -261,6 +261,7 @@ extern u_long random(void); /* imports from stdlib, locally modified */ extern long strtol(const char *, char **, int); +extern unsigned long strtoul(const char *, char **, int); extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt, optreset; extern int getopt(int, char * const [], const char *); Copied and modified: head/lib/libstand/strtoul.c (from r246713, head/lib/libc/stdlib/strtoul.c) ============================================================================== --- head/lib/libc/stdlib/strtoul.c Tue Feb 12 16:57:20 2013 (r246713, copy source) +++ head/lib/libstand/strtoul.c Mon Feb 18 01:55:53 2013 (r246931) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "xlocale_private.h" /* * Convert a string to an unsigned long integer. @@ -51,14 +50,13 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ unsigned long -strtoul_l(const char * __restrict nptr, char ** __restrict endptr, int base, locale_t locale) +strtoul(const char * __restrict nptr, char ** __restrict endptr, int base) { const char *s; unsigned long acc; char c; unsigned long cutoff; int neg, any, cutlim; - FIX_LOCALE(locale); /* * See strtol for comments as to the logic used. @@ -66,7 +64,7 @@ strtoul_l(const char * __restrict nptr, s = nptr; do { c = *s++; - } while (isspace_l((unsigned char)c, locale)); + } while (isspace((unsigned char)c)); if (c == '-') { neg = 1; c = *s++; @@ -123,8 +121,3 @@ noconv: *endptr = (char *)(any ? s - 1 : nptr); return (acc); } -unsigned long -strtoul(const char * __restrict nptr, char ** __restrict endptr, int base) -{ - return strtoul_l(nptr, endptr, base, __get_locale()); -} From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 02:08:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9187493C; Mon, 18 Feb 2013 02:08:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9A3370; Mon, 18 Feb 2013 02:08:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I28gOv068658; Mon, 18 Feb 2013 02:08:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I28gfk068656; Mon, 18 Feb 2013 02:08:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201302180208.r1I28gfk068656@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 18 Feb 2013 02:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246932 - in head/release/picobsd: bridge qemu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 02:08:42 -0000 Author: luigi Date: Mon Feb 18 02:08:41 2013 New Revision: 246932 URL: http://svnweb.freebsd.org/changeset/base/246932 Log: the NO_PAM option has been finally removed in favor of WITHOUT_PAM. Modified: head/release/picobsd/bridge/crunch.conf head/release/picobsd/qemu/crunch.conf Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Mon Feb 18 01:55:53 2013 (r246931) +++ head/release/picobsd/bridge/crunch.conf Mon Feb 18 02:08:41 2013 (r246932) @@ -29,7 +29,7 @@ # Default build options. Basically tell the Makefiles # that to use the most compact possible version of the code. -buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 buildopts -DWITHOUT_IPX Modified: head/release/picobsd/qemu/crunch.conf ============================================================================== --- head/release/picobsd/qemu/crunch.conf Mon Feb 18 01:55:53 2013 (r246931) +++ head/release/picobsd/qemu/crunch.conf Mon Feb 18 02:08:41 2013 (r246932) @@ -29,7 +29,7 @@ # Default build options. Basically tell the Makefiles # that to use the most compact possible version of the code. -buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 buildopts -DWITHOUT_IPX From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 04:10:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A1C071C; Mon, 18 Feb 2013 04:10:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 75B7D99E; Mon, 18 Feb 2013 04:10:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I4Acc8006756; Mon, 18 Feb 2013 04:10:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I4Ac99006746; Mon, 18 Feb 2013 04:10:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302180410.r1I4Ac99006746@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 04:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246933 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 04:10:39 -0000 Author: adrian Date: Mon Feb 18 04:10:38 2013 New Revision: 246933 URL: http://svnweb.freebsd.org/changeset/base/246933 Log: Add a new ATH KTR debug method to log the interrupt status. Modified: head/sys/dev/ath/if_ath_alq.h Modified: head/sys/dev/ath/if_ath_alq.h ============================================================================== --- head/sys/dev/ath/if_ath_alq.h Mon Feb 18 02:08:41 2013 (r246932) +++ head/sys/dev/ath/if_ath_alq.h Mon Feb 18 04:10:38 2013 (r246933) @@ -92,6 +92,13 @@ struct if_ath_alq_tdma_timer_set { uint32_t sc_tdmaswbaprep; }; +#define ATH_ALQ_INTR_STATUS 10 +struct if_ath_alq_interrupt { + uint32_t intr_status; + uint32_t intr_state[8]; + uint32_t intr_syncstate; +}; + /* * These will always be logged, regardless. */ @@ -144,6 +151,27 @@ extern int if_ath_alq_start(struct if_at extern int if_ath_alq_stop(struct if_ath_alq *alq); extern void if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len, const char *buf); + +/* XXX maybe doesn't belong here? */ +static inline void +if_ath_alq_post_intr(struct if_ath_alq *alq, uint32_t status, + uint32_t *state, uint32_t sync_state) +{ + int i; + struct if_ath_alq_interrupt intr; + + if (! if_ath_alq_checkdebug(alq, ATH_ALQ_INTR_STATUS)) + return; + + intr.intr_status = htobe32(status); + for (i = 0; i < 8; i++) + intr.intr_state[i] = htobe32(state[i]); + intr.intr_syncstate = htobe32(sync_state); + + if_ath_alq_post(alq, ATH_ALQ_INTR_STATUS, sizeof(&intr), + (const char *) &intr); +} + #endif /* _KERNEL */ #endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 04:19:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF59E9DC; Mon, 18 Feb 2013 04:19:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9563C9DC; Mon, 18 Feb 2013 04:19:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I4JL3D009296; Mon, 18 Feb 2013 04:19:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I4JLCw009295; Mon, 18 Feb 2013 04:19:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302180419.r1I4JLCw009295@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 04:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246934 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 04:19:21 -0000 Author: adrian Date: Mon Feb 18 04:19:21 2013 New Revision: 246934 URL: http://svnweb.freebsd.org/changeset/base/246934 Log: Make this output more terse. Modified: head/tools/tools/ath/athalq/ar5416_ds.c Modified: head/tools/tools/ath/athalq/ar5416_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar5416_ds.c Mon Feb 18 04:10:38 2013 (r246933) +++ head/tools/tools/ath/athalq/ar5416_ds.c Mon Feb 18 04:19:21 2013 (r246934) @@ -45,23 +45,34 @@ ar5416_decode_txstatus(struct if_ath_alq /* XXX assumes txs is smaller than PAYLOAD_LEN! */ memcpy(&txs, &a->payload, sizeof(struct ar5416_desc)); - printf("[%u.%06u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n", + printf("[%u.%06u] [%llu] TXSTATUS: TxDone=%d, FrmOk=%d, filt=%d, TS=0x%08x\n", (unsigned int) be32toh(a->hdr.tstamp_sec), (unsigned int) be32toh(a->hdr.tstamp_usec), (unsigned long long) be64toh(a->hdr.threadid), MF(txs.u.tx.status[9], AR_TxDone), + MF(txs.u.tx.status[1], AR_FrmXmitOK), + MF(txs.u.tx.status[1], AR_Filtered), txs.u.tx.status[2]); /* ds_txstatus0 */ - printf(" RX RSSI 0 [%d %d %d]\n", + printf(" RX RSSI 0 [%d %d %d]", MS(txs.u.tx.status[0], AR_TxRSSIAnt00), MS(txs.u.tx.status[0], AR_TxRSSIAnt01), MS(txs.u.tx.status[0], AR_TxRSSIAnt02)); - printf(" BA Valid=%d\n", + + /* ds_txstatus5 */ + printf(" RX RSSI 1 [%d %d %d] Comb=%d\n", + MS(txs.u.tx.status[5], AR_TxRSSIAnt10), + MS(txs.u.tx.status[5], AR_TxRSSIAnt11), + MS(txs.u.tx.status[5], AR_TxRSSIAnt12), + MS(txs.u.tx.status[5], AR_TxRSSICombined)); + + /* ds_txstatus0 */ + printf(" BA Valid=%d", MF(txs.u.tx.status[0], AR_TxBaStatus)); /* ds_txstatus1 */ - printf(" Frmok=%d, xretries=%d, fifounderrun=%d, filt=%d\n", + printf(", Frmok=%d, xretries=%d, fifounderrun=%d, filt=%d\n", MF(txs.u.tx.status[1], AR_FrmXmitOK), MF(txs.u.tx.status[1], AR_ExcessiveRetries), MF(txs.u.tx.status[1], AR_FIFOUnderrun), @@ -79,19 +90,13 @@ ar5416_decode_txstatus(struct if_ath_alq MS(txs.u.tx.status[1], AR_VirtRetryCnt)); /* ds_txstatus2 */ - printf(" TxTimestamp=0x%08x\n", txs.u.tx.status[2]); + printf(" TxTimestamp=0x%08x", txs.u.tx.status[2]); /* ds_txstatus3 */ /* ds_txstatus4 */ - printf(" BALow=0x%08x\n", txs.u.tx.status[3]); - printf(" BAHigh=0x%08x\n", txs.u.tx.status[4]); + printf(", BALow=0x%08x", txs.u.tx.status[3]); + printf(", BAHigh=0x%08x\n", txs.u.tx.status[4]); - /* ds_txstatus5 */ - printf(" RX RSSI 1 [%d %d %d] Comb=%d\n", - MS(txs.u.tx.status[5], AR_TxRSSIAnt10), - MS(txs.u.tx.status[5], AR_TxRSSIAnt11), - MS(txs.u.tx.status[5], AR_TxRSSIAnt12), - MS(txs.u.tx.status[5], AR_TxRSSICombined)); /* ds_txstatus6 */ /* ds_txstatus7 */ @@ -174,26 +179,23 @@ ar5416_decode_txdesc(struct if_ath_alq_p MS(txc.ds_ctl2, AR_XmitDataTries2), MS(txc.ds_ctl2, AR_XmitDataTries3)); - /* ds_ctl3 */ - printf(" rate0=0x%02x, rate1=0x%02x, rate2=0x%02x, rate3=0x%02x\n", + /* ds_ctl3, 4 */ + printf(" try 0: Rate=0x%02x, PktDur=%d, RTS/CTS ena=%d\n", MS(txc.ds_ctl3, AR_XmitRate0), - MS(txc.ds_ctl3, AR_XmitRate1), - MS(txc.ds_ctl3, AR_XmitRate2), - MS(txc.ds_ctl3, AR_XmitRate3)); - - /* ds_ctl4 */ - printf(" try 0: PktDur=%d, RTS/CTS ena=%d\n", MS(txc.ds_ctl4, AR_PacketDur0), MF(txc.ds_ctl4, AR_RTSCTSQual0)); - printf(" try 1: PktDur=%d, RTS/CTS ena=%d\n", + printf(" try 1: Rate=0x%02x, PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl3, AR_XmitRate1), MS(txc.ds_ctl4, AR_PacketDur1), MF(txc.ds_ctl4, AR_RTSCTSQual1)); - /* ds_ctl5 */ - printf(" try 2: PktDur=%d, RTS/CTS ena=%d\n", + /* ds_ctl3, 5 */ + printf(" try 2: Rate=0x%02x, PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl3, AR_XmitRate2), MS(txc.ds_ctl5, AR_PacketDur2), MF(txc.ds_ctl5, AR_RTSCTSQual2)); - printf(" try 3: PktDur=%d, RTS/CTS ena=%d\n", + printf(" try 3: Rate=0x%02x, PktDur=%d, RTS/CTS ena=%d\n", + MS(txc.ds_ctl3, AR_XmitRate3), MS(txc.ds_ctl5, AR_PacketDur3), MF(txc.ds_ctl5, AR_RTSCTSQual3)); @@ -254,11 +256,12 @@ ar5416_decode_rxstatus(struct if_ath_alq /* XXX assumes rxs is smaller than PAYLOAD_LEN! */ memcpy(&rxs, &a->payload, sizeof(struct ar5416_desc)); - printf("[%u.%06u] [%llu] RXSTATUS: RxDone=%d, TS=0x%08x\n", + printf("[%u.%06u] [%llu] RXSTATUS: RxDone=%d, RxRate=0x%02x, TS=0x%08x\n", (unsigned int) be32toh(a->hdr.tstamp_sec), (unsigned int) be32toh(a->hdr.tstamp_usec), (unsigned long long) be64toh(a->hdr.threadid), MF(rxs.ds_rxstatus8, AR_RxDone), + MS(rxs.ds_rxstatus0, AR_RxRate), rxs.ds_rxstatus2); printf(" link=0x%08x, data=0x%08x, ctl0=0x%08x, ctl2=0x%08x\n", @@ -277,15 +280,22 @@ ar5416_decode_rxstatus(struct if_ath_alq MS(rxs.ds_rxstatus0, AR_RxRSSIAnt01), MS(rxs.ds_rxstatus0, AR_RxRSSIAnt02)); + /* status4 */ + printf(" RSSIExt[0]=%d, RSSIExt[1]=%d, RSSIExt[2]=%d, RSSIComb=%d\n", + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt10), + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt11), + MS(rxs.ds_rxstatus4, AR_RxRSSIAnt12), + MS(rxs.ds_rxstatus4, AR_RxRSSICombined)); + + /* status2 */ + printf(" RxTimestamp=0x%08x,", rxs.ds_rxstatus2); + /* status1 */ - printf(" DataLen=%d, RxMore=%d, NumDelim=%d\n", + printf(" DataLen=%d, RxMore=%d, NumDelim=%d\n", rxs.ds_rxstatus1 & AR_DataLen, MF(rxs.ds_rxstatus1, AR_RxMore), MS(rxs.ds_rxstatus1, AR_NumDelim)); - /* status2 */ - printf(" RxTimestamp=0x%08x\n", rxs.ds_rxstatus2); - /* status3 - RxRate however is for Owl 2.0 */ printf(" GI=%d, 2040=%d, RxRate=0x%02x, DupFrame=%d, RxAnt=0x%08x\n", MF(rxs.ds_rxstatus3, AR_GI), @@ -294,13 +304,6 @@ ar5416_decode_rxstatus(struct if_ath_alq MF(rxs.ds_rxstatus3, AR_DupFrame), MS(rxs.ds_rxstatus3, AR_RxAntenna)); - /* status4 */ - printf(" RSSIExt[0]=%d, RSSIExt[1]=%d, RSSIExt[2]=%d, RSSIComb=%d\n", - MS(rxs.ds_rxstatus4, AR_RxRSSIAnt10), - MS(rxs.ds_rxstatus4, AR_RxRSSIAnt11), - MS(rxs.ds_rxstatus4, AR_RxRSSIAnt12), - MS(rxs.ds_rxstatus4, AR_RxRSSICombined)); - /* status5 */ /* status6 */ /* status7 */ @@ -321,20 +324,20 @@ ar5416_decode_rxstatus(struct if_ath_alq MF(rxs.ds_rxstatus8, AR_PreDelimCRCErr), MF(rxs.ds_rxstatus8, AR_RxKeyIdxValid)); - /* If PHY error, print that out. Otherwise, the key index */ - if (MF(rxs.ds_rxstatus8, AR_PHYErr)) - printf(" PhyErrCode=0x%02x\n", - MS(rxs.ds_rxstatus8, AR_PHYErrCode)); - else - printf(" KeyIdx=0x%02x\n", - MS(rxs.ds_rxstatus8, AR_KeyIdx)); - printf(" RxMoreAggr=%d, RxAggr=%d, PostDelimCRCErr=%d, HiRxChain=%d\n", MF(rxs.ds_rxstatus8, AR_RxMoreAggr), MF(rxs.ds_rxstatus8, AR_RxAggr), MF(rxs.ds_rxstatus8, AR_PostDelimCRCErr), MF(rxs.ds_rxstatus8, AR_HiRxChain)); - printf(" KeyMiss=%d\n", + + /* If PHY error, print that out. Otherwise, the key index */ + if (MF(rxs.ds_rxstatus8, AR_PHYErr)) + printf(" PhyErrCode=0x%02x", + MS(rxs.ds_rxstatus8, AR_PHYErrCode)); + else + printf(" KeyIdx=0x%02x", + MS(rxs.ds_rxstatus8, AR_KeyIdx)); + printf(", KeyMiss=%d\n", MF(rxs.ds_rxstatus8, AR_KeyMiss)); printf("\n ------\n"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 04:20:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B23C5B51; Mon, 18 Feb 2013 04:20:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 959699E7; Mon, 18 Feb 2013 04:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1I4KiU3011100; Mon, 18 Feb 2013 04:20:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1I4KhxJ011096; Mon, 18 Feb 2013 04:20:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302180420.r1I4KhxJ011096@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 04:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246935 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 04:20:44 -0000 Author: adrian Date: Mon Feb 18 04:20:43 2013 New Revision: 246935 URL: http://svnweb.freebsd.org/changeset/base/246935 Log: * Add initial debugging of the interrupt status entry * Add in the TDMA debugging entries that I added a while ago Added: head/tools/tools/ath/athalq/tdma.c (contents, props changed) head/tools/tools/ath/athalq/tdma.h (contents, props changed) Modified: head/tools/tools/ath/athalq/Makefile head/tools/tools/ath/athalq/main.c Modified: head/tools/tools/ath/athalq/Makefile ============================================================================== --- head/tools/tools/ath/athalq/Makefile Mon Feb 18 04:19:21 2013 (r246934) +++ head/tools/tools/ath/athalq/Makefile Mon Feb 18 04:20:43 2013 (r246935) @@ -3,7 +3,7 @@ PROG= athalq NOMAN= yes -SRCS= main.c ar5210_ds.c ar5211_ds.c ar5212_ds.c ar5416_ds.c +SRCS= main.c ar5210_ds.c ar5211_ds.c ar5212_ds.c ar5416_ds.c tdma.c # SRCS+= ar9300_ds.c .include <../Makefile.inc> Modified: head/tools/tools/ath/athalq/main.c ============================================================================== --- head/tools/tools/ath/athalq/main.c Mon Feb 18 04:19:21 2013 (r246934) +++ head/tools/tools/ath/athalq/main.c Mon Feb 18 04:20:43 2013 (r246935) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include "ar5212_ds.h" #include "ar5416_ds.h" +#include "tdma.h" + #define AR5210_MAGIC 0x19980124 #define AR5211_MAGIC 0x19570405 #define AR5212_MAGIC 0x19541014 @@ -58,6 +60,21 @@ ath_alq_print_hdr(struct if_ath_alq_init be32toh(hdr->sc_hal_magic)); } +static void +ath_alq_print_intr_status(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_interrupt is; + + /* XXX len check! */ + memcpy(&is, &a->payload, sizeof(is)); + + printf("[%u.%06u] [%llu] INTR: status=0x%08x\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid), + be32toh(is.intr_status)); +} + int main(int argc, const char *argv[]) { @@ -112,6 +129,24 @@ main(int argc, const char *argv[]) memcpy(&hdr, a->payload, sizeof(hdr)); ath_alq_print_hdr(&hdr); break; + case ATH_ALQ_TDMA_BEACON_STATE: + ath_tdma_beacon_state(a); + break; + case ATH_ALQ_TDMA_TIMER_CONFIG: + ath_tdma_timer_config(a); + break; + case ATH_ALQ_TDMA_SLOT_CALC: + ath_tdma_slot_calc(a); + break; + case ATH_ALQ_TDMA_TSF_ADJUST: + ath_tdma_tsf_adjust(a); + break; + case ATH_ALQ_TDMA_TIMER_SET: + ath_tdma_timer_set(a); + break; + case ATH_ALQ_INTR_STATUS: + ath_alq_print_intr_status(a); + break; default: if (be32toh(hdr.sc_hal_magic) == AR5210_MAGIC) ar5210_alq_payload(a); Added: head/tools/tools/ath/athalq/tdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athalq/tdma.c Mon Feb 18 04:20:43 2013 (r246935) @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2013 Adrian Chadd + * All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "tdma.h" + +void +ath_tdma_beacon_state(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_beacon_state t; + static uint64_t last_beacon_tx = 0; + + memcpy(&t, &a->payload, sizeof(t)); + + printf("[%u.%06u] [%llu] BEACON: RX TSF=%llu Beacon TSF=%llu (%d)\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.rx_tsf), + (unsigned long long) be64toh(t.beacon_tsf), + be64toh(t.beacon_tsf) - last_beacon_tx); + + last_beacon_tx = be64toh(t.beacon_tsf); +} + +void +ath_tdma_timer_config(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_timer_config t; + + memcpy(&t, &a->payload, sizeof(t)); +} + +void +ath_tdma_slot_calc(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_slot_calc t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u.%06u] [%llu] SLOTCALC: NEXTTBTT=%llu nextslot=%llu " + "tsfdelta=%d avg (%d/%d)\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.nexttbtt), + (unsigned long long) be64toh(t.next_slot), + (int) be32toh(t.tsfdelta), + (int) be32toh(t.avg_plus), + (int) be32toh(t.avg_minus)); +} + +void +ath_tdma_tsf_adjust(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_tsf_adjust t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u.%06u] [%llu] TSFADJUST: TSF64 was %llu, adj=%d, " + "now %llu\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid), + (unsigned long long) be64toh(t.tsf64_old), + (int) be32toh(t.tsfdelta), + (unsigned long long) be64toh(t.tsf64_new)); +} + +void +ath_tdma_timer_set(struct if_ath_alq_payload *a) +{ + struct if_ath_alq_tdma_timer_set t; + + memcpy(&t, &a->payload, sizeof(t)); + printf("[%u.%06u] [%llu] TIMERSET: bt_intval=%d nexttbtt=%d " + "nextdba=%d nextswba=%d nextatim=%d flags=0x%x tdmadbaprep=%d " + "tdmaswbaprep=%d\n", + (unsigned int) be32toh(a->hdr.tstamp_sec), + (unsigned int) be32toh(a->hdr.tstamp_usec), + (unsigned long long) be64toh(a->hdr.threadid), + be32toh(t.bt_intval), + be32toh(t.bt_nexttbtt), + be32toh(t.bt_nextdba), + be32toh(t.bt_nextswba), + be32toh(t.bt_nextatim), + be32toh(t.bt_flags), + be32toh(t.sc_tdmadbaprep), + be32toh(t.sc_tdmaswbaprep)); +} Added: head/tools/tools/ath/athalq/tdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athalq/tdma.h Mon Feb 18 04:20:43 2013 (r246935) @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013 Adrian Chadd + * All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef __TDMA_H__ +#define __TDMA_H__ + +extern void ath_tdma_beacon_state(struct if_ath_alq_payload *a); +extern void ath_tdma_timer_config(struct if_ath_alq_payload *a); +extern void ath_tdma_slot_calc(struct if_ath_alq_payload *a); +extern void ath_tdma_tsf_adjust(struct if_ath_alq_payload *a); +extern void ath_tdma_timer_set(struct if_ath_alq_payload *a); + +#endif /* __TDMA_H__ */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 09:57:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF4D1EB4; Mon, 18 Feb 2013 09:57:02 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from fallback3.mail.ru (fallback3.mail.ru [94.100.176.58]) by mx1.freebsd.org (Postfix) with ESMTP id 70876893; Mon, 18 Feb 2013 09:57:02 +0000 (UTC) Received: from smtp13.mail.ru (smtp13.mail.ru [94.100.176.90]) by fallback3.mail.ru (mPOP.Fallback_MX) with ESMTP id 7C72FD53C0E7; Mon, 18 Feb 2013 13:57:00 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=agU3spldSH8CRXEFyofy98PV5PJM55mTNHvq40yEbVY=; b=eNMYwYLrvjCE6tt0wno6yhBreEidrD0AejXBeQNrAoqHcY9O5LKOKpBIHZRyyuBrb+N9VOqtQN9Ro7KlpUf/SGY0GEhDGvcu0gu1l7uITbosfu1KUTGpZcbqxxjWk3ho; Received: from [93.185.182.46] (port=33845 helo=gpr.nnz-home.ru) by smtp13.mail.ru with esmtpa (envelope-from ) id 1U7NSu-0003gb-F5; Mon, 18 Feb 2013 13:56:52 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1U7NSi-0009E0-Gd; Mon, 18 Feb 2013 13:56:40 +0400 Date: Mon, 18 Feb 2013 13:56:40 +0400 From: Gennady Proskurin To: Kirk McKusick Subject: Re: svn commit: r246877 - head/sys/ufs/ffs Message-ID: <20130218095640.GA35293@gpr.nnz-home.ru> References: <201302161511.r1GFBesh029301@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302161511.r1GFBesh029301@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam: Not detected X-Mras: Ok Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 09:57:03 -0000 May be a dumb question, but I want to be explicit here. Can system before this commit crash here or filesystem corruption happen during ordinary work? (I mean no power loss and no crashes in other kernel code) Or filesystem can be corrupted only if system crashes by other means (power loss or something) during inode block allocation? On Sat, Feb 16, 2013 at 03:11:40PM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Sat Feb 16 15:11:40 2013 > New Revision: 246877 > URL: http://svnweb.freebsd.org/changeset/base/246877 > > Log: > The UFS2 filesystem allocates new blocks of inodes as they are needed. > When a cylinder group runs short of inodes, a new block for inodes is > allocated, zero'ed, and written to the disk. The zero'ed inodes must > be on the disk before the cylinder group can be updated to claim them. > If the cylinder group claiming the new inodes were written before the > zero'ed block of inodes, the system could crash with the filesystem in > an unrecoverable state. > > Rather than adding a soft updates dependency to ensure that the new > inode block is written before it is claimed by the cylinder group > map, we just do a barrier write of the zero'ed inode block to ensure > that it will get written before the updated cylinder group map can > be written. This change should only slow down bulk loading of newly > created filesystems since that is the primary time that new inode > blocks need to be created. > > Reported by: Robert Watson > Reviewed by: kib > Tested by: Peter Holm > > Modified: > head/sys/ufs/ffs/ffs_alloc.c > > Modified: head/sys/ufs/ffs/ffs_alloc.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_alloc.c Sat Feb 16 14:51:30 2013 (r246876) > +++ head/sys/ufs/ffs/ffs_alloc.c Sat Feb 16 15:11:40 2013 (r246877) > @@ -1861,7 +1861,6 @@ gotit: > /* > * Check to see if we need to initialize more inodes. > */ > - ibp = NULL; > if (fs->fs_magic == FS_UFS2_MAGIC && > ipref + INOPB(fs) > cgp->cg_initediblk && > cgp->cg_initediblk < cgp->cg_niblk) { > @@ -1874,6 +1873,16 @@ gotit: > dp2->di_gen = arc4random() / 2 + 1; > dp2++; > } > + /* > + * Rather than adding a soft updates dependency to ensure > + * that the new inode block is written before it is claimed > + * by the cylinder group map, we just do a barrier write > + * here. The barrier write will ensure that the inode block > + * gets written before the updated cylinder group map can be > + * written. The barrier write should only slow down bulk > + * loading of newly created filesystems. > + */ > + babarrierwrite(ibp); > cgp->cg_initediblk += INOPB(fs); > } > UFS_LOCK(ump); > @@ -1892,8 +1901,6 @@ gotit: > if (DOINGSOFTDEP(ITOV(ip))) > softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref, mode); > bdwrite(bp); > - if (ibp != NULL) > - bawrite(ibp); > return ((ino_t)(cg * fs->fs_ipg + ipref)); > } > > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 17:55:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 703D8D88; Mon, 18 Feb 2013 17:55:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57C37C33; Mon, 18 Feb 2013 17:55:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IHtSa7058160; Mon, 18 Feb 2013 17:55:28 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IHtSOo058158; Mon, 18 Feb 2013 17:55:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302181755.r1IHtSOo058158@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 18 Feb 2013 17:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246944 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 17:55:28 -0000 Author: hselasky Date: Mon Feb 18 17:55:27 2013 New Revision: 246944 URL: http://svnweb.freebsd.org/changeset/base/246944 Log: Fix bad EEPROM parsing code. MFC after: 2 weeks Modified: head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_upgtvar.h Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Mon Feb 18 16:19:26 2013 (r246943) +++ head/sys/dev/usb/wlan/if_upgt.c Mon Feb 18 17:55:27 2013 (r246944) @@ -1132,12 +1132,23 @@ upgt_eeprom_parse(struct upgt_softc *sc) (sizeof(struct upgt_eeprom_header) + preamble_len)); while (!option_end) { + + /* sanity check */ + if (eeprom_option >= (struct upgt_eeprom_option *) + (sc->sc_eeprom + UPGT_EEPROM_SIZE)) { + return (EINVAL); + } + /* the eeprom option length is stored in words */ option_len = (le16toh(eeprom_option->len) - 1) * sizeof(uint16_t); option_type = le16toh(eeprom_option->type); + /* sanity check */ + if (option_len == 0 || option_len >= UPGT_EEPROM_SIZE) + return (EINVAL); + switch (option_type) { case UPGT_EEPROM_TYPE_NAME: DPRINTF(sc, UPGT_DEBUG_FW, @@ -1208,7 +1219,6 @@ upgt_eeprom_parse(struct upgt_softc *sc) eeprom_option = (struct upgt_eeprom_option *) (eeprom_option->data + option_len); } - return (0); } @@ -1217,7 +1227,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft { struct upgt_eeprom_freq3_header *freq3_header; struct upgt_lmac_freq3 *freq3; - int i, elements, flags; + int i; + int elements; + int flags; unsigned channel; freq3_header = (struct upgt_eeprom_freq3_header *)data; @@ -1229,6 +1241,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d\n", flags, elements); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq3[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq3[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) @@ -1247,7 +1262,11 @@ upgt_eeprom_parse_freq4(struct upgt_soft struct upgt_eeprom_freq4_header *freq4_header; struct upgt_eeprom_freq4_1 *freq4_1; struct upgt_eeprom_freq4_2 *freq4_2; - int i, j, elements, settings, flags; + int i; + int j; + int elements; + int settings; + int flags; unsigned channel; freq4_header = (struct upgt_eeprom_freq4_header *)data; @@ -1262,6 +1281,9 @@ upgt_eeprom_parse_freq4(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d settings=%d\n", flags, elements, settings); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq4_1[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq4_1[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) @@ -1282,7 +1304,8 @@ void upgt_eeprom_parse_freq6(struct upgt_softc *sc, uint8_t *data, int len) { struct upgt_lmac_freq6 *freq6; - int i, elements; + int i; + int elements; unsigned channel; freq6 = (struct upgt_lmac_freq6 *)data; @@ -1290,6 +1313,9 @@ upgt_eeprom_parse_freq6(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "elements=%d\n", elements); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq6[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq6[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) Modified: head/sys/dev/usb/wlan/if_upgtvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_upgtvar.h Mon Feb 18 16:19:26 2013 (r246943) +++ head/sys/dev/usb/wlan/if_upgtvar.h Mon Feb 18 17:55:27 2013 (r246944) @@ -453,7 +453,7 @@ struct upgt_softc { struct upgt_memory sc_memory; /* data which we found in the EEPROM */ - uint8_t sc_eeprom[UPGT_EEPROM_SIZE]; + uint8_t sc_eeprom[2 * UPGT_EEPROM_SIZE] __aligned(4); uint16_t sc_eeprom_hwrx; struct upgt_lmac_freq3 sc_eeprom_freq3[IEEE80211_CHAN_MAX]; struct upgt_lmac_freq4 sc_eeprom_freq4[IEEE80211_CHAN_MAX][8]; From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 18:02:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40F1EF9A; Mon, 18 Feb 2013 18:02:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id DEDEDCD1; Mon, 18 Feb 2013 18:02:50 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.6/8.14.6) with ESMTP id r1II2m5F017430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 18 Feb 2013 19:02:48 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Mon, 18 Feb 2013 19:02:47 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Joel Dahl Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130218180247.GC38645@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Joel Dahl , Gleb Smirnoff , John Baldwin , Benjamin Kaduk , Dag-Erling SmXXrgrav , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> <201302051617.25454.jhb@freebsd.org> <20130206071807.GN26896@FreeBSD.org> <20130206074201.GG21730@jd.benders.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130206074201.GG21730@jd.benders.se> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Benjamin Kaduk , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-head@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 18:02:51 -0000 On Wed, 2013-02-06 at 08:42:01 +0100, Joel Dahl wrote: > On 06-02-2013 11:18, Gleb Smirnoff wrote: > > On Tue, Feb 05, 2013 at 04:17:25PM -0500, John Baldwin wrote: > > J> On Tuesday, February 05, 2013 3:55:47 pm Gleb Smirnoff wrote: > > J> > On Tue, Feb 05, 2013 at 11:58:54AM -0500, John Baldwin wrote: > > J> > J> > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > > J> > J> > > > Author: des > > J> > J> > > > Date: Tue Feb 5 14:39:37 2013 > > J> > J> > > > New Revision: 246362 > > J> > J> > > > URL: http://svnweb.freebsd.org/changeset/base/246362 > > J> > J> > > > > > J> > J> > > > Log: > > J> > J> > > > Remove political propaganda > > J> > J> > > > > > J> > J> > > > Modified: > > J> > J> > > > head/games/fortune/datfiles/fortunes-o.real > > J> > J> > > > > J> > J> > > *sigh* > > J> > J> > > > > J> > J> > > I'm sure there are other quotes that people who do not share your political > > J> > J> > > persuasion might find propaganda or offensive, etc. Censorship and freedom > > J> > J> > > of speech is quite a sticky widget, and I think the only truly sane policy > > J> > J> > > is that fortune files are append-only (unless we outright remove them and > > J> > J> > > that seems excessive). And new things should have a very high bar to be > > J> > J> > > added to fortune. Perhaps we should move fortunes-o to ports entirely? > > J> > J> > > > > J> > J> > > > J> > J> > I am more concerned about the insta-MFC than the removal per se. > > J> > J> > Only security or legal issues are cause to go under 3 days, was my > > J> > J> > impression. > > J> > J> > > J> > J> Yes, the insta-MFC is also not appropriate, esp. for something that you know > > J> > J> is going to raise eyebrows when it is committed. Having to debate this sort > > J> > J> of thing in public on mailing lists is also distinctly unhelpful and very > > J> > J> distracting from productive work. Also, I'd like to preemptively ask > > J> > J> developers to refrain from any further commits to the fortunes datfiles for > > J> > J> the time being as the last thing we need is a commit war over this sort of > > J> > J> thing. > > J> > > > J> > What about just moving the entire games subdirectory to ports repo? > > J> > > J> We've already moved most of it many years ago. > > > > The yesterday bikeshed proves that "most" isn't enough. :( The entire games subdir > > needs to be moved. > > +1 > > This is a worthless discussion that seems to pop up from time to time. Move it > to ports. No. There are people that use morse(6) in production code and stuff like random(6) can also be very useful. This is *BSD legacy and if it was for me, the whole games stuff would be brought *back* into the tree from ports. So can we move on to something else now and let this one die? kthxbai Uli From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 18:39:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3F397E2; Mon, 18 Feb 2013 18:39:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6767E6B; Mon, 18 Feb 2013 18:39:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IIdFnU071111; Mon, 18 Feb 2013 18:39:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IIdF7i071110; Mon, 18 Feb 2013 18:39:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302181839.r1IIdF7i071110@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Feb 2013 18:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246945 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 18:39:15 -0000 Author: adrian Date: Mon Feb 18 18:39:15 2013 New Revision: 246945 URL: http://svnweb.freebsd.org/changeset/base/246945 Log: Fix an incorrect sizeof() PR: kern/176238 Submitted by: Christoph Mallon Modified: head/sys/dev/ath/if_ath_alq.h Modified: head/sys/dev/ath/if_ath_alq.h ============================================================================== --- head/sys/dev/ath/if_ath_alq.h Mon Feb 18 17:55:27 2013 (r246944) +++ head/sys/dev/ath/if_ath_alq.h Mon Feb 18 18:39:15 2013 (r246945) @@ -168,7 +168,7 @@ if_ath_alq_post_intr(struct if_ath_alq * intr.intr_state[i] = htobe32(state[i]); intr.intr_syncstate = htobe32(sync_state); - if_ath_alq_post(alq, ATH_ALQ_INTR_STATUS, sizeof(&intr), + if_ath_alq_post(alq, ATH_ALQ_INTR_STATUS, sizeof(intr), (const char *) &intr); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 19:33:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 770C5C2C; Mon, 18 Feb 2013 19:33:08 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6803F18A; Mon, 18 Feb 2013 19:33:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IJX8Hs088976; Mon, 18 Feb 2013 19:33:08 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IJX8AC088975; Mon, 18 Feb 2013 19:33:08 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201302181933.r1IJX8AC088975@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 18 Feb 2013 19:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246947 - head/contrib/sendmail/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 19:33:08 -0000 Author: gshapiro Date: Mon Feb 18 19:33:07 2013 New Revision: 246947 URL: http://svnweb.freebsd.org/changeset/base/246947 Log: Merge sendmail 8.14.6 errata issue MFC after: 3 days Modified: head/contrib/sendmail/src/milter.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/src/milter.c ============================================================================== --- head/contrib/sendmail/src/milter.c Mon Feb 18 19:23:41 2013 (r246946) +++ head/contrib/sendmail/src/milter.c Mon Feb 18 19:33:07 2013 (r246947) @@ -4048,7 +4048,7 @@ milter_helo(helo, e, state) } response = milter_command(SMFIC_HELO, helo, strlen(helo) + 1, - SMFIM_EOH, e, state, "helo", false); + SMFIM_HELO, e, state, "helo", false); milter_per_connection_check(e); return response; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 19:50:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA6C175; Mon, 18 Feb 2013 19:50:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 904E822E; Mon, 18 Feb 2013 19:50:31 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MIF00FWZL2NMN20@smtp4.clear.net.nz>; Tue, 19 Feb 2013 08:35:22 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Tue, 19 Feb 2013 08:35:14 +1300 Date: Tue, 19 Feb 2013 08:34:55 +1300 From: Andrew Turner Subject: Re: svn commit: r246926 - in head/sys: arm/arm arm/include vm In-reply-to: <201302180102.r1I12nMX049209@svn.freebsd.org> To: Alan Cox Message-id: <20130219083455.176129d3@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <201302180102.r1I12nMX049209@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 19:50:31 -0000 On Mon, 18 Feb 2013 01:02:49 +0000 (UTC) Alan Cox wrote: > Author: alc > Date: Mon Feb 18 01:02:48 2013 > New Revision: 246926 > URL: http://svnweb.freebsd.org/changeset/base/246926 > > Log: > On arm, like sparc64, the end of the kernel map varies from one > type of machine to another. Therefore, VM_MAX_KERNEL_ADDRESS can't > be a constant. Instead, #define it to be a variable, > vm_max_kernel_address, just like we do on sparc64. This looks to be broken on non-FDT ARM. There are still a number of copies of initarm for older ports without FDT that will need vm_max_kernel_address to be set. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 20:11:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E5A77E6; Mon, 18 Feb 2013 20:11:21 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21AD6336; Mon, 18 Feb 2013 20:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IKBLlI001172; Mon, 18 Feb 2013 20:11:21 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IKBLrR001171; Mon, 18 Feb 2013 20:11:21 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302182011.r1IKBLrR001171@svn.freebsd.org> From: Tim Kientzle Date: Mon, 18 Feb 2013 20:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246948 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 20:11:21 -0000 Author: kientzle Date: Mon Feb 18 20:11:20 2013 New Revision: 246948 URL: http://svnweb.freebsd.org/changeset/base/246948 Log: Clarify an error message. The addresses here are really offsets within the primary mapped memory block (which may not start at address zero). Modified: head/sys/boot/uboot/lib/copy.c Modified: head/sys/boot/uboot/lib/copy.c ============================================================================== --- head/sys/boot/uboot/lib/copy.c Mon Feb 18 19:33:07 2013 (r246947) +++ head/sys/boot/uboot/lib/copy.c Mon Feb 18 20:11:20 2013 (r246948) @@ -66,7 +66,7 @@ uboot_vm_translate(vm_offset_t o) { */ } if (o > size) - panic("Address 0x%08jX bigger than size 0x%08X\n", + panic("Address offset 0x%08jX bigger than size 0x%08X\n", (intmax_t)o, size); return (void *)(start + o); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 20:21:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BEC88BC6; Mon, 18 Feb 2013 20:21:26 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD2DC3CC; Mon, 18 Feb 2013 20:21:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IKLQqw004239; Mon, 18 Feb 2013 20:21:26 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IKLQch004238; Mon, 18 Feb 2013 20:21:26 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201302182021.r1IKLQch004238@svn.freebsd.org> From: Joel Dahl Date: Mon, 18 Feb 2013 20:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246949 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 20:21:26 -0000 Author: joel (doc committer) Date: Mon Feb 18 20:21:26 2013 New Revision: 246949 URL: http://svnweb.freebsd.org/changeset/base/246949 Log: mdoc: sort sections. Modified: head/share/man/man5/group.5 Modified: head/share/man/man5/group.5 ============================================================================== --- head/share/man/man5/group.5 Mon Feb 18 20:11:20 2013 (r246948) +++ head/share/man/man5/group.5 Mon Feb 18 20:21:26 2013 (r246949) @@ -116,6 +116,17 @@ file. .\" char **gr_mem; /* group members */ .\" }; .\" .Ed +.Sh IMPLEMENTATION NOTES +The +.Xr passwd 1 +command does not change the +.Nm +passwords. +The +.Xr pw 8 +utility's +.Cm groupmod +command should be used instead. .Sh LIMITS There are various limitations which are explained in the function where they occur; see section @@ -157,14 +168,3 @@ file format appeared in .At v6 . Support for comments first appeared in .Fx 3.0 . -.Sh IMPLEMENTATION NOTES -The -.Xr passwd 1 -command does not change the -.Nm -passwords. -The -.Xr pw 8 -utility's -.Cm groupmod -command should be used instead. From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 22:47:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 08E4736B; Mon, 18 Feb 2013 22:47:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D286EB58; Mon, 18 Feb 2013 22:47:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IMlGXW049156; Mon, 18 Feb 2013 22:47:16 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IMlGrm049155; Mon, 18 Feb 2013 22:47:16 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302182247.r1IMlGrm049155@svn.freebsd.org> From: Mark Johnston Date: Mon, 18 Feb 2013 22:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246951 - head/sys/dev/coretemp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 22:47:17 -0000 Author: markj Date: Mon Feb 18 22:47:16 2013 New Revision: 246951 URL: http://svnweb.freebsd.org/changeset/base/246951 Log: Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be held unnecessarily by a user thread waiting to run on a specific CPU after calling sched_bind(). Reviewed by: rstone Approved by: emaste (co-mentor) Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/sys/dev/coretemp/coretemp.c Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Mon Feb 18 22:03:04 2013 (r246950) +++ head/sys/dev/coretemp/coretemp.c Mon Feb 18 22:47:16 2013 (r246951) @@ -274,23 +274,23 @@ coretemp_attach(device_t dev) * Add the MIBs to dev.cpu.N and dev.cpu.N.coretemp. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, dev, - CORETEMP_TEMP, coretemp_get_val_sysctl, "IK", + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, CORETEMP_TEMP, coretemp_get_val_sysctl, "IK", "Current temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "delta", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_DELTA, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_DELTA, coretemp_get_val_sysctl, "I", "Delta between TCC activation and current temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "resolution", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_RESOLUTION, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_RESOLUTION, coretemp_get_val_sysctl, "I", "Resolution of CPU thermal sensor"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "tjmax", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_TJMAX, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_TJMAX, coretemp_get_val_sysctl, "IK", "TCC activation temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "throttle_log", CTLTYPE_INT | CTLFLAG_RW, dev, 0, + "throttle_log", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, 0, coretemp_throttle_log_sysctl, "I", "Set to 1 if the thermal sensor has tripped"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 22:48:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E65B4E9; Mon, 18 Feb 2013 22:48:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 614C4B65; Mon, 18 Feb 2013 22:48:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1IMm0hV049296; Mon, 18 Feb 2013 22:48:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1IMm0cG049295; Mon, 18 Feb 2013 22:48:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302182248.r1IMm0cG049295@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 18 Feb 2013 22:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246952 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 22:48:00 -0000 Author: jilles Date: Mon Feb 18 22:47:59 2013 New Revision: 246952 URL: http://svnweb.freebsd.org/changeset/base/246952 Log: setbuf(3): Restore a BUGS section about setbuf(). The brokenness of setbuf() is not specific to 4.2BSD and 4.3BSD but inherent in the API definition. Reported by: bde Modified: head/lib/libc/stdio/setbuf.3 Modified: head/lib/libc/stdio/setbuf.3 ============================================================================== --- head/lib/libc/stdio/setbuf.3 Mon Feb 18 22:47:16 2013 (r246951) +++ head/lib/libc/stdio/setbuf.3 Mon Feb 18 22:47:59 2013 (r246952) @@ -32,7 +32,7 @@ .\" @(#)setbuf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 15, 2013 +.Dd February 18, 2013 .Dt SETBUF 3 .Os .Sh NAME @@ -195,3 +195,6 @@ and functions conform to .St -isoC . +.Sh BUGS +.Fn setbuf +usually uses a suboptimal buffer size and should be avoided. From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 22:55:16 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 410FE6E5; Mon, 18 Feb 2013 22:55:16 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 81E72BF9; Mon, 18 Feb 2013 22:55:15 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r1IMtBlY022750; Mon, 18 Feb 2013 16:55:11 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r1IMtBJB022749; Mon, 18 Feb 2013 16:55:11 -0600 (CST) (envelope-from brooks) Date: Mon, 18 Feb 2013 16:55:11 -0600 From: Brooks Davis To: "Andrey A. Chernov" Subject: Re: svn commit: r246913 - head/etc Message-ID: <20130218225511.GC91067@lor.one-eyed-alien.net> References: <201302171306.r1HD6xGM028562@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <201302171306.r1HD6xGM028562@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 22:55:16 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 17, 2013 at 01:06:59PM +0000, Andrey A. Chernov wrote: > Author: ache > Date: Sun Feb 17 13:06:59 2013 > New Revision: 246913 > URL: http://svnweb.freebsd.org/changeset/base/246913 >=20 > Log: > In 'make hierarchy' don't install /sys/sys pointing to usr/src/sys > but just /sys pointing there Did you have the latest install sources when you hit this? It should be emulating "ln -sfh" which would do the right thing. -- Brooks --gKMricLos+KVdGMg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRIrFPXY6L6fI4GtQRAulGAKCqzcmrFur3qe/O9Xc2AjzS5a1Y6gCaA4U8 M0qvwvp4zHB6QTDzth3VCDY= =Wcu4 -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 23:13:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92F0AAAF; Mon, 18 Feb 2013 23:13:14 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 689DCCFC; Mon, 18 Feb 2013 23:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1INDE8s058048; Mon, 18 Feb 2013 23:13:14 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1INDEne058046; Mon, 18 Feb 2013 23:13:14 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302182313.r1INDEne058046@svn.freebsd.org> From: Tim Kientzle Date: Mon, 18 Feb 2013 23:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246953 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 23:13:14 -0000 Author: kientzle Date: Mon Feb 18 23:13:13 2013 New Revision: 246953 URL: http://svnweb.freebsd.org/changeset/base/246953 Log: Add mem_load_raw() for loading data from another location in memory. This will be used by some upcoming changes to loader(8) FDT handling to allow it to use an FDT provided by an earlier boot stage the same as an FDT loaded from disk. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Mon Feb 18 22:47:59 2013 (r246952) +++ head/sys/boot/common/bootstrap.h Mon Feb 18 23:13:13 2013 (r246953) @@ -237,6 +237,8 @@ void file_discard(struct preloaded_file void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, struct kernel_module **newmp); +/* Load from a buffer in memory. */ +struct preloaded_file *mem_load_raw(char *type, char *name, const void *p, size_t len); /* MI module loaders */ #ifdef __elfN Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Mon Feb 18 22:47:59 2013 (r246952) +++ head/sys/boot/common/module.c Mon Feb 18 23:13:13 2013 (r246953) @@ -351,6 +351,7 @@ file_load_dependencies(struct preloaded_ } return (error); } + /* * We've been asked to load (name) as (type), so just suck it in, * no arguments or anything. @@ -421,6 +422,42 @@ file_loadraw(char *type, char *name) } /* + * Load a chunk of data as if it had been read from a file. + */ +struct preloaded_file * +mem_load_raw(char *type, char *name, const void *p, size_t len) +{ + struct preloaded_file *fp; + + /* We can't load first */ + if ((file_findfile(NULL, NULL)) == NULL) { + command_errmsg = "can't load file before kernel"; + return(NULL); + } + + if (archsw.arch_loadaddr != NULL) + loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); + archsw.arch_copyin(p, loadaddr, len); + + /* Looks OK so far; create & populate control structure */ + fp = file_alloc(); + fp->f_name = strdup(name); + fp->f_type = strdup(type); + fp->f_args = NULL; + fp->f_metadata = NULL; + fp->f_loader = -1; + fp->f_addr = loadaddr; + fp->f_size = len; + + /* recognise space consumption */ + loadaddr += len; + + /* Add to the list of loaded files */ + file_insert_tail(fp); + return fp; +} + +/* * Load the module (name), pass it (argc),(argv), add container file * to the list of loaded files. * If module is already loaded just assign new argc/argv. From owner-svn-src-head@FreeBSD.ORG Mon Feb 18 23:58:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3547E300; Mon, 18 Feb 2013 23:58:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3F2E76; Mon, 18 Feb 2013 23:58:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1INw6Oj070240; Mon, 18 Feb 2013 23:58:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1INw5Pb070239; Mon, 18 Feb 2013 23:58:05 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302182358.r1INw5Pb070239@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 18 Feb 2013 23:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246954 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Feb 2013 23:58:06 -0000 Author: pjd Date: Mon Feb 18 23:58:05 2013 New Revision: 246954 URL: http://svnweb.freebsd.org/changeset/base/246954 Log: More white-space cleanups. Reported by: zont (the first one) Modified: head/sys/sys/protosw.h Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Mon Feb 18 23:13:13 2013 (r246953) +++ head/sys/sys/protosw.h Mon Feb 18 23:58:05 2013 (r246954) @@ -210,7 +210,7 @@ struct pr_usrreqs { #define PRUS_EOF 0x2 #define PRUS_MORETOCOME 0x4 int (*pru_sense)(struct socket *so, struct stat *sb); - int (*pru_shutdown)(struct socket *so); + int (*pru_shutdown)(struct socket *so); int (*pru_flush)(struct socket *so, int direction); int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); int (*pru_sosend)(struct socket *so, struct sockaddr *addr, @@ -266,7 +266,7 @@ int pru_sopoll_notsupp(struct socket *so */ #define PRC_IFDOWN 0 /* interface transition */ #define PRC_ROUTEDEAD 1 /* select new route if possible ??? */ -#define PRC_IFUP 2 /* interface has come back up */ +#define PRC_IFUP 2 /* interface has come back up */ #define PRC_QUENCH2 3 /* DEC congestion bit says slow down */ #define PRC_QUENCH 4 /* some one said to slow down */ #define PRC_MSGSIZE 5 /* message size forced drop */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 02:01:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7CE194E8; Tue, 19 Feb 2013 02:01:36 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CFE32F9; Tue, 19 Feb 2013 02:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J21ZXO008307; Tue, 19 Feb 2013 02:01:35 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J21ZYm008306; Tue, 19 Feb 2013 02:01:35 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201302190201.r1J21ZYm008306@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 19 Feb 2013 02:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246955 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 02:01:36 -0000 Author: ganbold (doc committer) Date: Tue Feb 19 02:01:35 2013 New Revision: 246955 URL: http://svnweb.freebsd.org/changeset/base/246955 Log: Define gpio constants rather than using enum. Fix pull-up and pull-down values of gpio. According to A10 user manual possible pull register values are 00 Pull-up/down disable, 01 Pull-up, 10 Pull-down. Approved by: gonzo@ Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Mon Feb 18 23:58:05 2013 (r246954) +++ head/sys/arm/allwinner/a10_gpio.c Tue Feb 19 02:01:35 2013 (r246955) @@ -66,6 +66,13 @@ __FBSDID("$FreeBSD$"); #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) +#define A10_GPIO_NONE 0 +#define A10_GPIO_PULLUP 1 +#define A10_GPIO_PULLDOWN 2 + +#define A10_GPIO_INPUT 0 +#define A10_GPIO_OUTPUT 1 + struct a10_gpio_softc { device_t sc_dev; struct mtx sc_mtx; @@ -78,17 +85,6 @@ struct a10_gpio_softc { struct gpio_pin sc_gpio_pins[A10_GPIO_PINS]; }; -enum a10_gpio_fsel { - A10_GPIO_INPUT, - A10_GPIO_OUTPUT, -}; - -enum a10_gpio_pud { - A10_GPIO_NONE, - A10_GPIO_PULLDOWN, - A10_GPIO_PULLUP, -}; - #define A10_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) #define A10_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) #define A10_GPIO_LOCK_ASSERT(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 02:09:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E68BE910; Tue, 19 Feb 2013 02:09:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A89D3346; Tue, 19 Feb 2013 02:09:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J29JZO009858; Tue, 19 Feb 2013 02:09:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J29Ja8009856; Tue, 19 Feb 2013 02:09:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302190209.r1J29Ja8009856@svn.freebsd.org> From: Adrian Chadd Date: Tue, 19 Feb 2013 02:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246958 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 02:09:20 -0000 Author: adrian Date: Tue Feb 19 02:09:18 2013 New Revision: 246958 URL: http://svnweb.freebsd.org/changeset/base/246958 Log: kgdb enhancements! * document the kgdb -b flag * better verify what's valid with -b * add more comprehensive command line help PR: kern/175743 Submitted by: Christoph Mallon Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.1 head/gnu/usr.bin/gdb/kgdb/main.c Modified: head/gnu/usr.bin/gdb/kgdb/kgdb.1 ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/kgdb.1 Tue Feb 19 02:07:36 2013 (r246957) +++ head/gnu/usr.bin/gdb/kgdb/kgdb.1 Tue Feb 19 02:09:18 2013 (r246958) @@ -33,6 +33,7 @@ .Sh SYNOPSIS .Nm .Op Fl a | Fl f | Fl fullname +.Op Fl b Ar rate .Op Fl q | Fl quiet .Op Fl v .Op Fl w @@ -62,6 +63,9 @@ The or .Fl fullname options are supported for backward compatibility as well. +.It Fl b Ar rate +Set the baudrate to +.Ar rate . .It Fl q Suppress printing of the banner when the debugger starts. The Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Tue Feb 19 02:07:36 2013 (r246957) +++ head/gnu/usr.bin/gdb/kgdb/main.c Tue Feb 19 02:09:18 2013 (r246958) @@ -83,7 +83,7 @@ usage(void) { fprintf(stderr, - "usage: %s [-afqvw] [-d crashdir] [-c core | -n dumpnr | -r device]\n" + "usage: %s [-afqvw] [-b rate] [-d crashdir] [-c core | -n dumpnr | -r device]\n" "\t[kernel [core]]\n", getprogname()); exit(1); } @@ -338,19 +338,18 @@ main(int argc, char *argv[]) case 'a': annotation_level++; break; - case 'b': - { - int i; - char *p; + case 'b': { + int i; + char *p; - i = strtol (optarg, &p, 0); - if (i == 0 && p == optarg) + i = strtol(optarg, &p, 0); + if (*p != '\0' || p == optarg) warnx("warning: could not set baud rate to `%s'.\n", optarg); - else - baud_rate = i; - } + else + baud_rate = i; break; + } case 'c': /* use given core file. */ if (vmcore != NULL) { warnx("option %c: can only be specified once", From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 03:23:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B044AAF; Tue, 19 Feb 2013 03:23:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC218F1; Tue, 19 Feb 2013 03:23:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J3NDup035003; Tue, 19 Feb 2013 03:23:13 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J3NDBi035001; Tue, 19 Feb 2013 03:23:13 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302190323.r1J3NDBi035001@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Feb 2013 03:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246978 - head/lib/libelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 03:23:14 -0000 Author: markj Date: Tue Feb 19 03:23:13 2013 New Revision: 246978 URL: http://svnweb.freebsd.org/changeset/base/246978 Log: - Make sure to set an error code when trying to obtain a data descriptor for a section of type SHT_NULL. - Update the man page to reflect the fact that elf_getdata() and elf_rawdata() may return with an error of ELF_E_SECTION. PR: bin/175491 Approved by: emaste (co-mentor) MFC after: 1 week Modified: head/lib/libelf/elf_data.c head/lib/libelf/elf_getdata.3 Modified: head/lib/libelf/elf_data.c ============================================================================== --- head/lib/libelf/elf_data.c Tue Feb 19 02:51:31 2013 (r246977) +++ head/lib/libelf/elf_data.c Tue Feb 19 03:23:13 2013 (r246978) @@ -78,8 +78,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && @@ -219,8 +221,10 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); Modified: head/lib/libelf/elf_getdata.3 ============================================================================== --- head/lib/libelf/elf_getdata.3 Tue Feb 19 02:51:31 2013 (r246977) +++ head/lib/libelf/elf_getdata.3 Tue Feb 19 03:23:13 2013 (r246978) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2011 +.Dd February 18, 2013 .Dt ELF_GETDATA 3 .Os .Sh NAME @@ -186,6 +186,23 @@ was not associated with section descript .Ar scn . .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. +.It Bq Er ELF_E_SECTION +Section +.Ar scn +had type +.Dv SHT_NULL . +.It Bq Er ELF_E_SECTION +The type of the section +.Ar scn +was not recognized by the library. +.It Bq Er ELF_E_SECTION +The size of the section +.Ar scn +is not a multiple of the file size for its section type. +.It Bq Er ELF_E_SECTION +The file offset for section +.Ar scn +is incorrect. .El .Sh SEE ALSO .Xr elf 3 , From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 06:42:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F114233F; Tue, 19 Feb 2013 06:42:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9C46F4B; Tue, 19 Feb 2013 06:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1J6gCml093398; Tue, 19 Feb 2013 06:42:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1J6gC1m093397; Tue, 19 Feb 2013 06:42:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302190642.r1J6gC1m093397@svn.freebsd.org> From: Adrian Chadd Date: Tue, 19 Feb 2013 06:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246979 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 06:42:13 -0000 Author: adrian Date: Tue Feb 19 06:42:12 2013 New Revision: 246979 URL: http://svnweb.freebsd.org/changeset/base/246979 Log: Print out the RTS/CTS rate in the TX descriptor. Modified: head/tools/tools/ath/athalq/ar5416_ds.c Modified: head/tools/tools/ath/athalq/ar5416_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar5416_ds.c Tue Feb 19 03:23:13 2013 (r246978) +++ head/tools/tools/ath/athalq/ar5416_ds.c Tue Feb 19 06:42:12 2013 (r246979) @@ -227,6 +227,8 @@ ar5416_decode_txdesc(struct if_ath_alq_p MF(txc.ds_ctl7, AR_2040_3), MF(txc.ds_ctl7, AR_STBC3)); + printf(" RTSCtsRate=0x%02x\n", MS(txc.ds_ctl7, AR_RTSCTSRate)); + /* ds_ctl8 */ printf(" try 0: ant=0x%08x\n", txc.ds_ctl8 & AR_AntCtl0); From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 10:25:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 07088F2; Tue, 19 Feb 2013 10:25:52 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EDFCD23B; Tue, 19 Feb 2013 10:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JAPpkb061078; Tue, 19 Feb 2013 10:25:51 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JAPpX0061077; Tue, 19 Feb 2013 10:25:51 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201302191025.r1JAPpX0061077@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 19 Feb 2013 10:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246983 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 10:25:52 -0000 Author: uqs Date: Tue Feb 19 10:25:51 2013 New Revision: 246983 URL: http://svnweb.freebsd.org/changeset/base/246983 Log: Fix typo Submitted by: Matt Burke Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Feb 19 08:07:11 2013 (r246982) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Feb 19 10:25:51 2013 (r246983) @@ -557,7 +557,7 @@ hdaa_presence_handler(struct hdaa_widget HDA_BOOTVERBOSE( if (connected || old != 2) { device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + "Pin sense: nid=%d sense=0x%08x (%sconnected)\n", w->nid, res, !connected ? "dis" : ""); } ); @@ -706,7 +706,7 @@ hdaa_eld_handler(struct hdaa_widget *w) } HDA_BOOTVERBOSE( device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x " + "Pin sense: nid=%d sense=0x%08x " "(%sconnected, ELD %svalid)\n", w->nid, res, (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) ? "" : "dis", From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 10:49:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E61A9D1 for ; Tue, 19 Feb 2013 10:49:28 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1.freebsd.org (Postfix) with ESMTP id F2CAB376 for ; Tue, 19 Feb 2013 10:49:27 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id gg13so5028930lbb.16 for ; Tue, 19 Feb 2013 02:49:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:disposition-notification-to:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :openpgp:content-type:x-gm-message-state; bh=DUFjEwWSsi6HHbGPpAGnhwOWudKDphRWJWw9sPbmoYA=; b=Ap22EfwRrrm+yT+KNz2yX5WrdzsqA7yrv3W/a/lxWwtsriwJVJWozZFJ3srpYYHSVx gY2ZyGU5JpMGCJUGR3SVJRA/xCa3KZroDD2Go/DVLG6sQFmZHH+OFBSs1u0DPjRmSEdc 9xIdsIasxb2D784kbDuxGes6dqlDpVdUPdNNuFD1nkDY3p2vHtrpyhjqzEqv0h92coub w1kbfw8H0jpz63i6HH1Kr9aNAPdDpaWWwO2SWnXB9TMSTeGxcx0z4lPYjPmx4xP+u5TV JCtonms9JiEcC3NowjeF92D1/9SgaT97WHGFpWm7VAP6uRN6JiaxCy5m9uvy2SUQGHyY qG5A== X-Received: by 10.152.105.244 with SMTP id gp20mr13053644lab.34.1361270961011; Tue, 19 Feb 2013 02:49:21 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id mq7sm19293833lab.1.2013.02.19.02.49.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 02:49:20 -0800 (PST) Message-ID: <512358A5.7050800@freebsd.org> Date: Tue, 19 Feb 2013 14:49:09 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r246913 - head/etc References: <201302171306.r1HD6xGM028562@svn.freebsd.org> <20130218225511.GC91067@lor.one-eyed-alien.net> In-Reply-To: <20130218225511.GC91067@lor.one-eyed-alien.net> OpenPGP: id=964474DD Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2UJMCSFHNETAGTFTSWOBE" X-Gm-Message-State: ALoCoQnInPVef/JV9GbpWSA3KknGpOxz1Pn9SxZfTBuM50MKBfk0HU6v19cy4Lb8iEWuMK9OyLfD Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 10:49:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2UJMCSFHNETAGTFTSWOBE Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 19.02.2013 2:55, Brooks Davis wrote: > On Sun, Feb 17, 2013 at 01:06:59PM +0000, Andrey A. Chernov wrote: >> Author: ache >> Date: Sun Feb 17 13:06:59 2013 >> New Revision: 246913 >> URL: http://svnweb.freebsd.org/changeset/base/246913 >> >> Log: >> In 'make hierarchy' don't install /sys/sys pointing to usr/src/sys >> but just /sys pointing there >=20 > Did you have the latest install sources when you hit this? It should > be emulating "ln -sfh" which would do the right thing. >=20 > -- Brooks >=20 Yes, very latest current, just standing in /usr/src and typing 'make hierarchy' and fail. I suspect the difference which plays role is make.conf:INSTALL=3Dinstall -C which is common practice since old days. I.e. it may don't delete old symlink with -C, but use it as directory instead. I can't check this right now, maybe later. ------enig2UJMCSFHNETAGTFTSWOBE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (MingW32) iEYEARECAAYFAlEjWLAACgkQVg5YK5ZEdN0+cgCgtwTfpODMe76OTa6H00KLHMWW gPUAn22jIlWcDwQNr443eBMLNGvyowlZ =gHkr -----END PGP SIGNATURE----- ------enig2UJMCSFHNETAGTFTSWOBE-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 12:57:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 034B5996; Tue, 19 Feb 2013 12:57:08 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA0E5AF0; Tue, 19 Feb 2013 12:57:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JCv77P006321; Tue, 19 Feb 2013 12:57:07 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JCv7p6006320; Tue, 19 Feb 2013 12:57:07 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201302191257.r1JCv7p6006320@svn.freebsd.org> From: Philippe Charnier Date: Tue, 19 Feb 2013 12:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246987 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 12:57:08 -0000 Author: charnier Date: Tue Feb 19 12:57:07 2013 New Revision: 246987 URL: http://svnweb.freebsd.org/changeset/base/246987 Log: Remove old-style function definition Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Tue Feb 19 12:09:23 2013 (r246986) +++ head/usr.bin/systat/main.c Tue Feb 19 12:57:07 2013 (r246987) @@ -192,7 +192,7 @@ labels(void) } void -display() +display(void) { int i, j; From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 13:17:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F4D4F3F; Tue, 19 Feb 2013 13:17:17 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91801C22; Tue, 19 Feb 2013 13:17:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JDHHQB012871; Tue, 19 Feb 2013 13:17:17 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JDHGHa012865; Tue, 19 Feb 2013 13:17:16 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201302191317.r1JDHGHa012865@svn.freebsd.org> From: Philippe Charnier Date: Tue, 19 Feb 2013 13:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246988 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 13:17:17 -0000 Author: charnier Date: Tue Feb 19 13:17:16 2013 New Revision: 246988 URL: http://svnweb.freebsd.org/changeset/base/246988 Log: WARNS=6 compliance Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netisr.c head/usr.bin/netstat/sctp.c head/usr.bin/netstat/unix.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/inet.c Tue Feb 19 13:17:16 2013 (r246988) @@ -89,7 +89,7 @@ static int udp_done, tcp_done, sdp_done; #endif /* INET6 */ static int -pcblist_sysctl(int proto, const char *name, char **bufp, int istcp) +pcblist_sysctl(int proto, const char *name, char **bufp, int istcp __unused) { const char *mibvar; char *buf; Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/inet6.c Tue Feb 19 13:17:16 2013 (r246988) @@ -335,7 +335,7 @@ static const char *ip6nh[] = { "#255", }; -static char *srcrule_str[] = { +static const char *srcrule_str[] = { "first candidate", "same address", "appropriate scope", Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/main.c Tue Feb 19 13:17:16 2013 (r246988) @@ -640,9 +640,7 @@ main(int argc, char *argv[]) * is not in the namelist, ignore this one. */ static void -printproto(tp, name) - struct protox *tp; - const char *name; +printproto(struct protox *tp, const char *name) { void (*pr)(u_long, const char *, int, int); u_long off; Modified: head/usr.bin/netstat/netisr.c ============================================================================== --- head/usr.bin/netstat/netisr.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/netisr.c Tue Feb 19 13:17:16 2013 (r246988) @@ -76,12 +76,12 @@ static u_int *nws_array; static u_int maxprot; static void -netisr_dispatch_policy_to_string(u_int dispatch_policy, char *buf, +netisr_dispatch_policy_to_string(u_int policy, char *buf, size_t buflen) { const char *str; - switch (dispatch_policy) { + switch (policy) { case NETISR_DISPATCH_DEFAULT: str = "default"; break; @@ -102,7 +102,7 @@ netisr_dispatch_policy_to_string(u_int d } static void -netisr_load_kvm_uint(kvm_t *kd, char *name, u_int *p) +netisr_load_kvm_uint(kvm_t *kd, const char *name, u_int *p) { struct nlist nl[] = { { .n_name = name }, Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/sctp.c Tue Feb 19 13:17:16 2013 (r246988) @@ -77,7 +77,7 @@ static void sctp_statesprint(uint32_t st #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8 #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9 -char *sctpstates[] = { +const char *sctpstates[] = { "CLOSED", "BOUND", "LISTEN", @@ -393,7 +393,7 @@ sctp_process_inpcb(struct xsctp_inpcb *x { int indent = 0, xladdr_total = 0, is_listening = 0; static int first = 1; - char *tname, *pname; + const char *tname, *pname; struct xsctp_tcb *xstcb; struct xsctp_laddr *xladdr; size_t offset_laddr; @@ -527,7 +527,7 @@ retry: */ void sctp_protopr(u_long off __unused, - const char *name, int af1, int proto) + const char *name __unused, int af1 __unused, int proto) { char *buf; const char *mibvar = "net.inet.sctp.assoclist"; Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Tue Feb 19 12:57:07 2013 (r246987) +++ head/usr.bin/netstat/unix.c Tue Feb 19 13:17:16 2013 (r246988) @@ -199,6 +199,7 @@ unixpr(u_long count_off, u_long gencnt_o struct xunpcb *xunp; u_long head_off; + buf = NULL; for (type = SOCK_STREAM; type <= SOCK_SEQPACKET; type++) { if (live) ret = pcblist_sysctl(type, &buf); From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 13:28:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0EA372F for ; Tue, 19 Feb 2013 13:28:07 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22f.google.com (la-in-x022f.1e100.net [IPv6:2a00:1450:4010:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1A4D5E for ; Tue, 19 Feb 2013 13:28:07 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fj20so6385035lab.6 for ; Tue, 19 Feb 2013 05:28:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:disposition-notification-to:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :openpgp:content-type:x-gm-message-state; bh=nxT1BgXClwbDx3Y8tkKzRPT/JkvC49vQqzE0rhiLsZ0=; b=dDALa8adPG7YZcSFSWWWlCgPBaGXr98OAXCTBDRl58J6scJ4tjopY+BJGB7sjtmcqZ mkVQ/hQjqzym19cKkMfAQX1OOEvK660l6gO1P4vebIpft+c4OpWvFzcccyF2Pm0l12Nx 0Wn/EzWKVYpIgpewmbMs/ObobNxDFiyNFDL26S8ts9ZjKJqo2M6s3EGkseTc2ErfLEkx kSgYnyZuVNVa1/f8t1Ca7rk6fAVOp1BaTOwc0l8tGBX0uJJQ74sgnvHbaKG/TYLgKzlp ETiCEGrRtjKGfxjGvrwPTbLBvY98AgBUSIXlYlLlZwCqoZ1iG85hFvYAFCV/wpZbLH+e XUKQ== X-Received: by 10.152.130.131 with SMTP id oe3mr14134924lab.1.1361280485405; Tue, 19 Feb 2013 05:28:05 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id gm20sm21337073lab.7.2013.02.19.05.28.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 05:28:04 -0800 (PST) Message-ID: <51237DDD.90301@freebsd.org> Date: Tue, 19 Feb 2013 17:27:57 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn commit: r246913 - head/etc References: <201302171306.r1HD6xGM028562@svn.freebsd.org> <20130218225511.GC91067@lor.one-eyed-alien.net> <512358A5.7050800@freebsd.org> <5123621F.1050000@freebsd.org> In-Reply-To: <5123621F.1050000@freebsd.org> OpenPGP: id=964474DD Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2PXBHTTSFIGDJFVBFOECC" X-Gm-Message-State: ALoCoQm7ruck5OwTvgKUAHMMs18Y4rXG8Eyc6InyARF6liIZli538PYeKC4X/y9K6/BY53T4M9ex Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 13:28:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2PXBHTTSFIGDJFVBFOECC Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Forget about -C and the patch, this bug shows itself with pure install without -C too. install does not acts like 'ln -f'. Here is minimal test:= #!/bin/sh mkdir b install -l s b a echo Pass 1 ls -al a b install -l s b a echo echo Pass 2 ls -al a b # bug And its output (notice b -> b): Pass 1 lrwxr-xr-x 1 ache wheel 1 19 Feb 17:15 a -> b b: total 6 drwxr-xr-x 2 ache wheel 512 19 Feb 17:15 . drwxr-xr-x 32 ache wheel 2560 19 Feb 17:15 .. Pass 2 lrwxr-xr-x 1 ache wheel 1 19 Feb 17:15 a -> b b: total 6 drwxr-xr-x 2 ache wheel 512 19 Feb 17:15 . drwxr-xr-x 32 ache wheel 2560 19 Feb 17:15 .. lrwxr-xr-x 1 ache wheel 1 19 Feb 17:15 b -> b On 19.02.2013 15:29, Andrey Chernov wrote: > This patch makes install -C, -S and default (-c) to do the same for lin= ks,=20 > as 'ln -f'. Not well tested yes due to lack of time. >=20 > --- xinstall.c.bak 2013-02-19 15:20:16.000000000 +0400 > +++ xinstall.c 2013-02-19 15:24:30.000000000 +0400 > @@ -754,7 +754,7 @@ > target =3D (lstat(to_name, &to_sb) =3D=3D 0); > =20 > if (dolink) { > - if (target && !safecopy) { > + if (target) { > if (to_sb.st_mode & S_IFDIR && rmdir(to_name) =3D=3D -1) > err(EX_OSERR, "%s", to_name); > if (to_sb.st_flags & NOCHANGEBITS)=20 >=20 > On 19.02.2013 14:49, Andrey Chernov wrote: >> On 19.02.2013 2:55, Brooks Davis wrote: >>> On Sun, Feb 17, 2013 at 01:06:59PM +0000, Andrey A. Chernov wrote: >>>> Author: ache Date: Sun Feb 17 13:06:59 2013 New Revision: 246913 >>>> URL: http://svnweb.freebsd.org/changeset/base/246913 >>>> >>>> Log: In 'make hierarchy' don't install /sys/sys pointing to=20 >>>> usr/src/sys but just /sys pointing there >>> >>> Did you have the latest install sources when you hit this? It=20 >>> should be emulating "ln -sfh" which would do the right thing. >>> >>> -- Brooks >>> >> >> Yes, very latest current, just standing in /usr/src and typing 'make >> hierarchy' and fail. I suspect the difference which plays role is=20 >> make.conf:INSTALL=3Dinstall -C which is common practice since old >> days. I.e. it may don't delete old symlink with -C, but use it as >> directory instead. I can't check this right now, maybe later. >> >=20 >=20 ------enig2PXBHTTSFIGDJFVBFOECC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (MingW32) iEYEARECAAYFAlEjfeMACgkQVg5YK5ZEdN3BKACcC8hhm6C4K/s718IZMPGQCyBD dlwAn35vqY3yZ82AYXjcyQLMVELbZgZx =lyS4 -----END PGP SIGNATURE----- ------enig2PXBHTTSFIGDJFVBFOECC-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 13:32:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C92EE8F1; Tue, 19 Feb 2013 13:32:26 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7B62D86; Tue, 19 Feb 2013 13:32:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JDWQrW018233; Tue, 19 Feb 2013 13:32:26 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JDWQKP018232; Tue, 19 Feb 2013 13:32:26 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201302191332.r1JDWQKP018232@svn.freebsd.org> From: Philippe Charnier Date: Tue, 19 Feb 2013 13:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246990 - head/usr.bin/keylogin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 13:32:26 -0000 Author: charnier Date: Tue Feb 19 13:32:26 2013 New Revision: 246990 URL: http://svnweb.freebsd.org/changeset/base/246990 Log: WARNS=6 compliance Modified: head/usr.bin/keylogin/keylogin.c Modified: head/usr.bin/keylogin/keylogin.c ============================================================================== --- head/usr.bin/keylogin/keylogin.c Tue Feb 19 13:27:20 2013 (r246989) +++ head/usr.bin/keylogin/keylogin.c Tue Feb 19 13:32:26 2013 (r246990) @@ -48,8 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +extern int key_setnet(struct key_netstarg *); + int -main() +main(void) { char fullname[MAXNETNAMELEN + 1]; struct key_netstarg netst; From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 16:35:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A408D9E; Tue, 19 Feb 2013 16:35:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9579279; Tue, 19 Feb 2013 16:35:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JGZRs2075827; Tue, 19 Feb 2013 16:35:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JGZRLV075826; Tue, 19 Feb 2013 16:35:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302191635.r1JGZRLV075826@svn.freebsd.org> From: John Baldwin Date: Tue, 19 Feb 2013 16:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246996 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 16:35:28 -0000 Author: jhb Date: Tue Feb 19 16:35:27 2013 New Revision: 246996 URL: http://svnweb.freebsd.org/changeset/base/246996 Log: Fix a few typos. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Feb 19 15:42:52 2013 (r246995) +++ head/sys/kern/kern_thread.c Tue Feb 19 16:35:27 2013 (r246996) @@ -748,10 +748,10 @@ stopme: * P_SINGLE_EXIT | return_instead == 0| return_instead != 0 *---------------+--------------------+--------------------- * 0 | returns 0 | returns 0 or 1 - * | when ST ends | immediatly + * | when ST ends | immediately *---------------+--------------------+--------------------- * 1 | thread exits | returns 1 - * | | immediatly + * | | immediately * 0 = thread_exit() or suspension ok, * other = return error instead of stopping the thread. * From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 16:43:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8498F6FB; Tue, 19 Feb 2013 16:43:49 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7763F304; Tue, 19 Feb 2013 16:43:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JGhnEK078841; Tue, 19 Feb 2013 16:43:49 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JGhnBv078839; Tue, 19 Feb 2013 16:43:49 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201302191643.r1JGhnBv078839@svn.freebsd.org> From: Davide Italiano Date: Tue, 19 Feb 2013 16:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247000 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 16:43:49 -0000 Author: davide Date: Tue Feb 19 16:43:48 2013 New Revision: 247000 URL: http://svnweb.freebsd.org/changeset/base/247000 Log: Fixup r246916 in case gcc is used to build. Reported by: attilio, simon Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Feb 19 16:40:38 2013 (r246999) +++ head/sys/x86/isa/clock.c Tue Feb 19 16:43:48 2013 (r247000) @@ -450,6 +450,8 @@ set_i8254_freq(int mode, uint32_t period outb(TIMER_CNTR0, new_count & 0xff); outb(TIMER_CNTR0, new_count >> 8); break; + default: + panic("set_i8254_freq: unknown operational mode"); } timer0_mode = new_mode; timer0_last = new_count; From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 17:09:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47ADA2A2; Tue, 19 Feb 2013 17:09:24 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF726CA; Tue, 19 Feb 2013 17:09:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JH9O3i093097; Tue, 19 Feb 2013 17:09:24 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JH9Oeb093095; Tue, 19 Feb 2013 17:09:24 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302191709.r1JH9Oeb093095@svn.freebsd.org> From: Tim Kientzle Date: Tue, 19 Feb 2013 17:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247001 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 17:09:24 -0000 Author: kientzle Date: Tue Feb 19 17:09:23 2013 New Revision: 247001 URL: http://svnweb.freebsd.org/changeset/base/247001 Log: Fix includes for use in libstand. Modified: head/lib/libstand/strtoul.c Modified: head/lib/libstand/strtoul.c ============================================================================== --- head/lib/libstand/strtoul.c Tue Feb 19 16:43:48 2013 (r247000) +++ head/lib/libstand/strtoul.c Tue Feb 19 17:09:23 2013 (r247001) @@ -38,10 +38,8 @@ static char sccsid[] = "@(#)strtoul.c 8. #include __FBSDID("$FreeBSD$"); +#include "stand.h" #include -#include -#include -#include /* * Convert a string to an unsigned long integer. From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 17:38:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 610EC1F7; Tue, 19 Feb 2013 17:38:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53EDF8B1; Tue, 19 Feb 2013 17:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JHcJGE023557; Tue, 19 Feb 2013 17:38:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JHcJ3Y023556; Tue, 19 Feb 2013 17:38:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302191738.r1JHcJ3Y023556@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 17:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247002 - head/crypto/heimdal/kcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 17:38:19 -0000 Author: dim Date: Tue Feb 19 17:38:18 2013 New Revision: 247002 URL: http://svnweb.freebsd.org/changeset/base/247002 Log: Import change 6d783560e4aad1e680097d11e89755647a5aba87 from upstream heimdal: fix sizeof(uuid) Found by: clang ToT Reviewed by: stas Modified: head/crypto/heimdal/kcm/cache.c Modified: head/crypto/heimdal/kcm/cache.c ============================================================================== --- head/crypto/heimdal/kcm/cache.c Tue Feb 19 17:09:23 2013 (r247001) +++ head/crypto/heimdal/kcm/cache.c Tue Feb 19 17:38:18 2013 (r247002) @@ -102,7 +102,7 @@ kcm_ccache_resolve_by_uuid(krb5_context for (p = ccache_head; p != NULL; p = p->next) { if ((p->flags & KCM_FLAGS_VALID) == 0) continue; - if (memcmp(p->uuid, uuid, sizeof(uuid)) == 0) { + if (memcmp(p->uuid, uuid, sizeof(kcmuuid_t)) == 0) { ret = 0; break; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 17:53:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31E1487B; Tue, 19 Feb 2013 17:53:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1AB997; Tue, 19 Feb 2013 17:53:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JHrWbh028790; Tue, 19 Feb 2013 17:53:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JHrWnm028789; Tue, 19 Feb 2013 17:53:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302191753.r1JHrWnm028789@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Feb 2013 17:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247003 - head/contrib/llvm/lib/MC/MCParser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 17:53:33 -0000 Author: dim Date: Tue Feb 19 17:53:32 2013 New Revision: 247003 URL: http://svnweb.freebsd.org/changeset/base/247003 Log: Pull in r175360 from upstream llvm trunk: MCParser: Reject .balign with non-pow2 alignments. GNU as rejects them and there are configure scripts in the wild that check if the assembler rejects ".align 3" to determine whether the alignment is in bytes or powers of two. MFC after: 3 days Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Feb 19 17:38:18 2013 (r247002) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Feb 19 17:53:32 2013 (r247003) @@ -2372,6 +2372,10 @@ bool AsmParser::ParseDirectiveAlign(bool } Alignment = 1ULL << Alignment; + } else { + // Reject alignments that aren't a power of two, for gas compatibility. + if (!isPowerOf2_64(Alignment)) + Error(AlignmentLoc, "alignment must be a power of 2"); } // Diagnose non-sensical max bytes to align. From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 18:22:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 467EF75D; Tue, 19 Feb 2013 18:22:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3498EB6F; Tue, 19 Feb 2013 18:22:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JIMP33038144; Tue, 19 Feb 2013 18:22:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JIMPUR038143; Tue, 19 Feb 2013 18:22:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302191822.r1JIMPUR038143@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Feb 2013 18:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247005 - head/sys/dev/dcons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 18:22:26 -0000 Author: mav Date: Tue Feb 19 18:22:25 2013 New Revision: 247005 URL: http://svnweb.freebsd.org/changeset/base/247005 Log: MFcalloutng: Make dcons input polling adaptive, reducing poll rate to 1Hz after several minutes of inactivty to reduce global interrupt rate. Most of users never used FireWire debugging, so it is not very useful to consume power by it. Modified: head/sys/dev/dcons/dcons_os.c Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Tue Feb 19 17:57:17 2013 (r247004) +++ head/sys/dev/dcons/dcons_os.c Tue Feb 19 18:22:25 2013 (r247005) @@ -74,6 +74,10 @@ #define DCONS_POLL_HZ 25 #endif +#ifndef DCONS_POLL_IDLE +#define DCONS_POLL_IDLE 256 +#endif + #ifndef DCONS_BUF_SIZE #define DCONS_BUF_SIZE (16*1024) #endif @@ -90,6 +94,7 @@ static char bssbuf[DCONS_BUF_SIZE]; /* b static struct dcons_global dg; struct dcons_global *dcons_conf; static int poll_hz = DCONS_POLL_HZ; +static u_int poll_idle = DCONS_POLL_HZ * DCONS_POLL_IDLE; static struct dcons_softc sc[DCONS_NPORT]; @@ -214,14 +219,17 @@ dcons_timeout(void *v) tp = dc->tty; tty_lock(tp); - while ((c = dcons_os_checkc_nopoll(dc)) != -1) + while ((c = dcons_os_checkc_nopoll(dc)) != -1) { ttydisc_rint(tp, c, 0); + poll_idle = 0; + } ttydisc_rint_done(tp); tty_unlock(tp); } - polltime = hz / poll_hz; - if (polltime < 1) - polltime = 1; + poll_idle++; + polltime = hz; + if (poll_idle <= (poll_hz * DCONS_POLL_IDLE)) + polltime /= poll_hz; callout_reset(&dcons_callout, polltime, dcons_timeout, tp); } @@ -368,8 +376,6 @@ dcons_attach(void) dcons_attach_port(DCONS_GDB, "dgdb", DC_GDB); callout_init(&dcons_callout, CALLOUT_MPSAFE); polltime = hz / poll_hz; - if (polltime < 1) - polltime = 1; callout_reset(&dcons_callout, polltime, dcons_timeout, NULL); return(0); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 18:28:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5696BAEA; Tue, 19 Feb 2013 18:28:26 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49550CB0; Tue, 19 Feb 2013 18:28:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JISQVn038969; Tue, 19 Feb 2013 18:28:26 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JISQX4038968; Tue, 19 Feb 2013 18:28:26 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201302191828.r1JISQX4038968@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 19 Feb 2013 18:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247006 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 18:28:26 -0000 Author: uqs Date: Tue Feb 19 18:28:25 2013 New Revision: 247006 URL: http://svnweb.freebsd.org/changeset/base/247006 Log: dtc: fix bootstrapping from 8.2-STABLE MFC after: 1 week Approved by: theraven Modified: head/usr.bin/dtc/input_buffer.cc Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Tue Feb 19 18:22:25 2013 (r247005) +++ head/usr.bin/dtc/input_buffer.cc Tue Feb 19 18:28:25 2013 (r247006) @@ -43,6 +43,10 @@ #include #include +#ifndef MAP_PREFAULT_READ +#define MAP_PREFAULT_READ 0 +#endif + namespace dtc { From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 19:25:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0137079A; Tue, 19 Feb 2013 19:25:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CE63913C; Tue, 19 Feb 2013 19:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JJPoMg057092; Tue, 19 Feb 2013 19:25:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JJPoiW057091; Tue, 19 Feb 2013 19:25:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302191925.r1JJPoiW057091@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Feb 2013 19:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247008 - head/sys/dev/led X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 19:25:51 -0000 Author: mav Date: Tue Feb 19 19:25:50 2013 New Revision: 247008 URL: http://svnweb.freebsd.org/changeset/base/247008 Log: MFcalloutng: Make led(4) fire callouts at 10Hz only when there is at least one LED that is requested to blink. Do not fire if all LEDs are static (usual case). Modified: head/sys/dev/led/led.c Modified: head/sys/dev/led/led.c ============================================================================== --- head/sys/dev/led/led.c Tue Feb 19 19:14:22 2013 (r247007) +++ head/sys/dev/led/led.c Tue Feb 19 19:25:50 2013 (r247008) @@ -43,6 +43,7 @@ static struct mtx led_mtx; static struct sx led_sx; static LIST_HEAD(, ledsc) led_list = LIST_HEAD_INITIALIZER(led_list); static struct callout led_ch; +static int blinkers = 0; static MALLOC_DEFINE(M_LED, "LED", "LED driver"); @@ -51,7 +52,6 @@ led_timeout(void *p) { struct ledsc *sc; - mtx_lock(&led_mtx); LIST_FOREACH(sc, &led_list, list) { if (sc->ptr == NULL) continue; @@ -61,6 +61,7 @@ led_timeout(void *p) } if (*sc->ptr == '.') { sc->ptr = NULL; + blinkers--; continue; } else if (*sc->ptr == 'U' || *sc->ptr == 'u') { if (sc->last_second == time_second) @@ -78,9 +79,8 @@ led_timeout(void *p) if (*sc->ptr == '\0') sc->ptr = sc->str; } - mtx_unlock(&led_mtx); - callout_reset(&led_ch, hz / 10, led_timeout, p); - return; + if (blinkers > 0) + callout_reset(&led_ch, hz / 10, led_timeout, p); } static int @@ -92,9 +92,15 @@ led_state(struct ledsc *sc, struct sbuf sc->spec = *sb; if (*sb != NULL) { sc->str = sbuf_data(*sb); + if (sc->ptr == NULL) { + blinkers++; + callout_reset(&led_ch, hz / 10, led_timeout, NULL); + } sc->ptr = sc->str; } else { sc->str = NULL; + if (sc->ptr != NULL) + blinkers--; sc->ptr = NULL; sc->func(sc->private, state); } @@ -286,8 +292,6 @@ led_create_state(led_t *func, void *priv mtx_lock(&led_mtx); sc->dev->si_drv1 = sc; - if (LIST_EMPTY(&led_list)) - callout_reset(&led_ch, hz / 10, led_timeout, NULL); LIST_INSERT_HEAD(&led_list, sc, list); sc->func(sc->private, state != 0); mtx_unlock(&led_mtx); @@ -303,7 +307,8 @@ led_destroy(struct cdev *dev) mtx_lock(&led_mtx); sc = dev->si_drv1; dev->si_drv1 = NULL; - + if (sc->ptr != NULL) + blinkers--; LIST_REMOVE(sc, list); if (LIST_EMPTY(&led_list)) callout_stop(&led_ch); @@ -326,7 +331,7 @@ led_drvinit(void *unused) led_unit = new_unrhdr(0, INT_MAX, NULL); mtx_init(&led_mtx, "LED mtx", NULL, MTX_DEF); sx_init(&led_sx, "LED sx"); - callout_init(&led_ch, CALLOUT_MPSAFE); + callout_init_mtx(&led_ch, &led_mtx, 0); } SYSINIT(leddev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, led_drvinit, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 20:33:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3507ECC; Tue, 19 Feb 2013 20:33:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 964DC6A5; Tue, 19 Feb 2013 20:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JKXtHj078207; Tue, 19 Feb 2013 20:33:55 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JKXt6R078206; Tue, 19 Feb 2013 20:33:55 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302192033.r1JKXt6R078206@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 19 Feb 2013 20:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247009 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 20:33:55 -0000 Author: gonzo Date: Tue Feb 19 20:33:55 2013 New Revision: 247009 URL: http://svnweb.freebsd.org/changeset/base/247009 Log: Roll back change of frequency for initialization sequence since it seems to cause more problems then previous behavior: it either breaks initilization sequence in other places or uncovers problems with high-speed mode timing for SDHCI 3.0 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 19 19:25:50 2013 (r247008) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 19 20:33:55 2013 (r247009) @@ -78,7 +78,12 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -static int bcm2835_sdhci_min_freq = 8000000; +/* + * Arasan HC seems to have problem with Data CRC on lower frequencies. + * Use this tunable to cap intilization sequence frequency at higher + * value. Default is standard 400KHz + */ +static int bcm2835_sdhci_min_freq = 400000; static int bcm2835_sdhci_hs = 1; TUNABLE_INT("hw.bcm2835.sdhci.min_freq", &bcm2835_sdhci_min_freq); @@ -346,12 +351,6 @@ static uint32_t bcm_sdhci_min_freq(device_t dev, struct sdhci_slot *slot) { - /* - * Arasan HC seems to have problem with - * Data CRC on lower frequencies. Cap minimum - * frequncy at 8MHz (or whatever set via tunable) - * to work around this issue - */ return bcm2835_sdhci_min_freq; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 21:24:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24E0BEB4; Tue, 19 Feb 2013 21:24:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17BFB887; Tue, 19 Feb 2013 21:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JLOq1b093907; Tue, 19 Feb 2013 21:24:52 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JLOqVT093906; Tue, 19 Feb 2013 21:24:52 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302192124.r1JLOqVT093906@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 19 Feb 2013 21:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247010 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 21:24:53 -0000 Author: gonzo Date: Tue Feb 19 21:24:52 2013 New Revision: 247010 URL: http://svnweb.freebsd.org/changeset/base/247010 Log: Spelling fixes Spotted by: N. J. Mann Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 19 20:33:55 2013 (r247009) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 19 21:24:52 2013 (r247010) @@ -80,8 +80,8 @@ __FBSDID("$FreeBSD$"); /* * Arasan HC seems to have problem with Data CRC on lower frequencies. - * Use this tunable to cap intilization sequence frequency at higher - * value. Default is standard 400KHz + * Use this tunable to cap initialization sequence frequency at higher + * value. Default is standard 400kHz */ static int bcm2835_sdhci_min_freq = 400000; static int bcm2835_sdhci_hs = 1; From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 21:33:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F441184; Tue, 19 Feb 2013 21:33:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 388AB8E2; Tue, 19 Feb 2013 21:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JLXM9t096675; Tue, 19 Feb 2013 21:33:22 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JLXLER096670; Tue, 19 Feb 2013 21:33:21 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302192133.r1JLXLER096670@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 19 Feb 2013 21:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247011 - in head/sys: dev/mxge modules/mxge/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 21:33:22 -0000 Author: gallatin Date: Tue Feb 19 21:33:21 2013 New Revision: 247011 URL: http://svnweb.freebsd.org/changeset/base/247011 Log: Add support to mxge for IPv6 TX csum offload & IPv6 TSO. Sponsored by: Myricom, Inc. MFC after: 7 days Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h head/sys/modules/mxge/mxge/Makefile Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Tue Feb 19 21:24:52 2013 (r247010) +++ head/sys/dev/mxge/if_mxge.c Tue Feb 19 21:33:21 2013 (r247011) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -91,6 +93,7 @@ __FBSDID("$FreeBSD$"); #endif #include "opt_inet.h" +#include "opt_inet6.h" /* tunable params */ static int mxge_nvidia_ecrc_enable = 1; @@ -1810,21 +1813,99 @@ mxge_submit_req(mxge_tx_ring_t *tx, mcp_ wmb(); } +static int +mxge_parse_tx(struct mxge_slice_state *ss, struct mbuf *m, + struct mxge_pkt_info *pi) +{ + struct ether_vlan_header *eh; + uint16_t etype; + int tso = m->m_pkthdr.csum_flags & (CSUM_TSO); +#if IFCAP_TSO6 && defined(INET6) + int nxt; +#endif + + eh = mtod(m, struct ether_vlan_header *); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + etype = ntohs(eh->evl_proto); + pi->ip_off = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + } else { + etype = ntohs(eh->evl_encap_proto); + pi->ip_off = ETHER_HDR_LEN; + } + + switch (etype) { + case ETHERTYPE_IP: + /* + * ensure ip header is in first mbuf, copy it to a + * scratch buffer if not + */ + pi->ip = (struct ip *)(m->m_data + pi->ip_off); + pi->ip6 = NULL; + if (__predict_false(m->m_len < pi->ip_off + sizeof(*pi->ip))) { + m_copydata(m, 0, pi->ip_off + sizeof(*pi->ip), + ss->scratch); + pi->ip = (struct ip *)(ss->scratch + pi->ip_off); + } + pi->ip_hlen = pi->ip->ip_hl << 2; + if (!tso) + return 0; + + if (__predict_false(m->m_len < pi->ip_off + pi->ip_hlen + + sizeof(struct tcphdr))) { + m_copydata(m, 0, pi->ip_off + pi->ip_hlen + + sizeof(struct tcphdr), ss->scratch); + pi->ip = (struct ip *)(ss->scratch + pi->ip_off); + } + pi->tcp = (struct tcphdr *)((char *)pi->ip + pi->ip_hlen); + break; +#if IFCAP_TSO6 && defined(INET6) + case ETHERTYPE_IPV6: + pi->ip6 = (struct ip6_hdr *)(m->m_data + pi->ip_off); + if (__predict_false(m->m_len < pi->ip_off + sizeof(*pi->ip6))) { + m_copydata(m, 0, pi->ip_off + sizeof(*pi->ip6), + ss->scratch); + pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off); + } + nxt = 0; + pi->ip_hlen = ip6_lasthdr(m, pi->ip_off, IPPROTO_IPV6, &nxt); + pi->ip_hlen -= pi->ip_off; + if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP) + return EINVAL; + + if (!tso) + return 0; + + if (pi->ip_off + pi->ip_hlen > ss->sc->max_tso6_hlen) + return EINVAL; + + if (__predict_false(m->m_len < pi->ip_off + pi->ip_hlen + + sizeof(struct tcphdr))) { + m_copydata(m, 0, pi->ip_off + pi->ip_hlen + + sizeof(struct tcphdr), ss->scratch); + pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off); + } + pi->tcp = (struct tcphdr *)((char *)pi->ip6 + pi->ip_hlen); + break; +#endif + default: + return EINVAL; + } + return 0; +} + #if IFCAP_TSO4 static void mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m, - int busdma_seg_cnt, int ip_off) + int busdma_seg_cnt, struct mxge_pkt_info *pi) { mxge_tx_ring_t *tx; mcp_kreq_ether_send_t *req; bus_dma_segment_t *seg; - struct ip *ip; - struct tcphdr *tcp; uint32_t low, high_swapped; int len, seglen, cum_len, cum_len_next; int next_is_first, chop, cnt, rdma_count, small; - uint16_t pseudo_hdr_offset, cksum_offset, mss; + uint16_t pseudo_hdr_offset, cksum_offset, mss, sum; uint8_t flags, flags_next; static int once; @@ -1835,38 +1916,33 @@ mxge_encap_tso(struct mxge_slice_state * * header portion of the TSO packet. */ - /* ensure we have the ethernet, IP and TCP - header together in the first mbuf, copy - it to a scratch buffer if not */ - if (__predict_false(m->m_len < ip_off + sizeof (*ip))) { - m_copydata(m, 0, ip_off + sizeof (*ip), - ss->scratch); - ip = (struct ip *)(ss->scratch + ip_off); - } else { - ip = (struct ip *)(mtod(m, char *) + ip_off); - } - if (__predict_false(m->m_len < ip_off + (ip->ip_hl << 2) - + sizeof (*tcp))) { - m_copydata(m, 0, ip_off + (ip->ip_hl << 2) - + sizeof (*tcp), ss->scratch); - ip = (struct ip *)(mtod(m, char *) + ip_off); - } - - tcp = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2)); - cum_len = -(ip_off + ((ip->ip_hl + tcp->th_off) << 2)); - cksum_offset = ip_off + (ip->ip_hl << 2); + cksum_offset = pi->ip_off + pi->ip_hlen; + cum_len = -(cksum_offset + (pi->tcp->th_off << 2)); /* TSO implies checksum offload on this hardware */ - if (__predict_false((m->m_pkthdr.csum_flags & (CSUM_TCP)) == 0)) { + if (__predict_false((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_TCP_IPV6)) == 0)) { /* * If packet has full TCP csum, replace it with pseudo hdr * sum that the NIC expects, otherwise the NIC will emit * packets with bad TCP checksums. */ - m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(IPPROTO_TCP + (m->m_pkthdr.len - cksum_offset))); + if (pi->ip6) { +#if (CSUM_TCP_IPV6 != 0) && defined(INET6) + m->m_pkthdr.csum_flags |= CSUM_TCP_IPV6; + sum = in6_cksum_pseudo(pi->ip6, + m->m_pkthdr.len - cksum_offset, + IPPROTO_TCP, 0); +#endif + } else { + m->m_pkthdr.csum_flags |= CSUM_TCP; + sum = in_pseudo(pi->ip->ip_src.s_addr, + pi->ip->ip_dst.s_addr, + htons(IPPROTO_TCP + (m->m_pkthdr.len - + cksum_offset))); + } + m_copyback(m, offsetof(struct tcphdr, th_sum) + + cksum_offset, sizeof(sum), (caddr_t)&sum); } flags = MXGEFW_FLAGS_TSO_HDR | MXGEFW_FLAGS_FIRST; @@ -1876,6 +1952,14 @@ mxge_encap_tso(struct mxge_slice_state * * the checksum by parsing the header. */ pseudo_hdr_offset = htobe16(mss); + if (pi->ip6) { + /* + * for IPv6 TSO, the "checksum offset" is re-purposed + * to store the TCP header len + */ + cksum_offset = (pi->tcp->th_off << 2); + } + tx = &ss->tx; req = tx->req_list; seg = tx->seg_list; @@ -1947,10 +2031,12 @@ mxge_encap_tso(struct mxge_slice_state * req++; cnt++; rdma_count++; - if (__predict_false(cksum_offset > seglen)) - cksum_offset -= seglen; - else - cksum_offset = 0; + if (cksum_offset != 0 && !pi->ip6) { + if (__predict_false(cksum_offset > seglen)) + cksum_offset -= seglen; + else + cksum_offset = 0; + } if (__predict_false(cnt > tx->max_desc)) goto drop; } @@ -2030,14 +2116,14 @@ mxge_vlan_tag_insert(struct mbuf *m) static void mxge_encap(struct mxge_slice_state *ss, struct mbuf *m) { + struct mxge_pkt_info pi = {0,0,0,0}; mxge_softc_t *sc; mcp_kreq_ether_send_t *req; bus_dma_segment_t *seg; struct mbuf *m_tmp; struct ifnet *ifp; mxge_tx_ring_t *tx; - struct ip *ip; - int cnt, cum_len, err, i, idx, odd_flag, ip_off; + int cnt, cum_len, err, i, idx, odd_flag; uint16_t pseudo_hdr_offset; uint8_t flags, cksum_offset; @@ -2046,15 +2132,19 @@ mxge_encap(struct mxge_slice_state *ss, ifp = sc->ifp; tx = &ss->tx; - ip_off = sizeof (struct ether_header); #ifdef MXGE_NEW_VLAN_API if (m->m_flags & M_VLANTAG) { m = mxge_vlan_tag_insert(m); if (__predict_false(m == NULL)) - goto drop; - ip_off += ETHER_VLAN_ENCAP_LEN; + goto drop_without_m; } #endif + if (m->m_pkthdr.csum_flags & + (CSUM_TSO | CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) { + if (mxge_parse_tx(ss, m, &pi)) + goto drop; + } + /* (try to) map the frame for DMA */ idx = tx->req & tx->mask; err = bus_dmamap_load_mbuf_sg(tx->dmat, tx->info[idx].map, @@ -2086,7 +2176,7 @@ mxge_encap(struct mxge_slice_state *ss, #if IFCAP_TSO4 /* TSO is different enough, we handle it in another routine */ if (m->m_pkthdr.csum_flags & (CSUM_TSO)) { - mxge_encap_tso(ss, m, cnt, ip_off); + mxge_encap_tso(ss, m, cnt, &pi); return; } #endif @@ -2097,17 +2187,11 @@ mxge_encap(struct mxge_slice_state *ss, flags = MXGEFW_FLAGS_NO_TSO; /* checksum offloading? */ - if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { + if (m->m_pkthdr.csum_flags & + (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) { /* ensure ip header is in first mbuf, copy it to a scratch buffer if not */ - if (__predict_false(m->m_len < ip_off + sizeof (*ip))) { - m_copydata(m, 0, ip_off + sizeof (*ip), - ss->scratch); - ip = (struct ip *)(ss->scratch + ip_off); - } else { - ip = (struct ip *)(mtod(m, char *) + ip_off); - } - cksum_offset = ip_off + (ip->ip_hl << 2); + cksum_offset = pi.ip_off + pi.ip_hlen; pseudo_hdr_offset = cksum_offset + m->m_pkthdr.csum_data; pseudo_hdr_offset = htobe16(pseudo_hdr_offset); req->cksum_offset = cksum_offset; @@ -2190,6 +2274,7 @@ mxge_encap(struct mxge_slice_state *ss, drop: m_freem(m); +drop_without_m: ss->oerrors++; return; } @@ -4126,8 +4211,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com if (mask & IFCAP_TXCSUM) { if (IFCAP_TXCSUM & ifp->if_capenable) { ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4); - ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP - | CSUM_TSO); + ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP); } else { ifp->if_capenable |= IFCAP_TXCSUM; ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); @@ -4144,7 +4228,6 @@ mxge_ioctl(struct ifnet *ifp, u_long com if (mask & IFCAP_TSO4) { if (IFCAP_TSO4 & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_TSO4; - ifp->if_hwassist &= ~CSUM_TSO; } else if (IFCAP_TXCSUM & ifp->if_capenable) { ifp->if_capenable |= IFCAP_TSO4; ifp->if_hwassist |= CSUM_TSO; @@ -4154,6 +4237,43 @@ mxge_ioctl(struct ifnet *ifp, u_long com err = EINVAL; } } +#if IFCAP_TSO6 + if (mask & IFCAP_TXCSUM_IPV6) { + if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) { + ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6 + | IFCAP_TSO6); + ifp->if_hwassist &= ~(CSUM_TCP_IPV6 + | CSUM_UDP); + } else { + ifp->if_capenable |= IFCAP_TXCSUM_IPV6; + ifp->if_hwassist |= (CSUM_TCP_IPV6 + | CSUM_UDP_IPV6); + } +#ifdef NOTYET + } else if (mask & IFCAP_RXCSUM6) { + if (IFCAP_RXCSUM6 & ifp->if_capenable) { + ifp->if_capenable &= ~IFCAP_RXCSUM6; + sc->csum_flag = 0; + } else { + ifp->if_capenable |= IFCAP_RXCSUM6; + sc->csum_flag = 1; + } +#endif + } + if (mask & IFCAP_TSO6) { + if (IFCAP_TSO6 & ifp->if_capenable) { + ifp->if_capenable &= ~IFCAP_TSO6; + } else if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) { + ifp->if_capenable |= IFCAP_TSO6; + ifp->if_hwassist |= CSUM_TSO; + } else { + printf("mxge requires tx checksum offload" + " be enabled to use TSO\n"); + err = EINVAL; + } + } +#endif /*IFCAP_TSO6 */ + if (mask & IFCAP_LRO) { if (IFCAP_LRO & ifp->if_capenable) err = mxge_change_lro_locked(sc, 0); @@ -4646,6 +4766,7 @@ mxge_add_irq(mxge_softc_t *sc) static int mxge_attach(device_t dev) { + mxge_cmd_t cmd; mxge_softc_t *sc = device_get_softc(dev); struct ifnet *ifp; int err, rid; @@ -4776,7 +4897,7 @@ mxge_attach(device_t dev) if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 | - IFCAP_VLAN_MTU | IFCAP_LINKSTATE; + IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6; #ifdef INET ifp->if_capabilities |= IFCAP_LRO; #endif @@ -4789,7 +4910,6 @@ mxge_attach(device_t dev) sc->fw_ver_tiny >= 32) ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif - sc->max_mtu = mxge_max_mtu(sc); if (sc->max_mtu >= 9000) ifp->if_capabilities |= IFCAP_JUMBO_MTU; @@ -4798,6 +4918,14 @@ mxge_attach(device_t dev) "latest firmware for 9000 byte jumbo support\n", sc->max_mtu - ETHER_HDR_LEN); ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + ifp->if_hwassist |= CSUM_TCP_IPV6 | CSUM_UDP_IPV6; + /* check to see if f/w supports TSO for IPv6 */ + if (!mxge_send_cmd(sc, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE, &cmd)) { + if (CSUM_TCP_IPV6) + ifp->if_capabilities |= IFCAP_TSO6; + sc->max_tso6_hlen = min(cmd.data0, + sizeof (sc->ss[0].scratch)); + } ifp->if_capenable = ifp->if_capabilities; if (sc->lro_cnt == 0) ifp->if_capenable &= ~IFCAP_LRO; Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Tue Feb 19 21:24:52 2013 (r247010) +++ head/sys/dev/mxge/if_mxge_var.h Tue Feb 19 21:33:21 2013 (r247011) @@ -50,6 +50,19 @@ $FreeBSD$ #define IFNET_BUF_RING 1 #endif +#if (__FreeBSD_version < 1000020) +#undef IF_Kbps +#undef IF_Mbps +#undef IF_Gbps +#define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ +#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ +#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ +static __inline void +if_initbaudrate(struct ifnet *ifp, uintmax_t baud) +{ + ifp->if_baudrate = baud; +} +#endif #ifndef VLAN_CAPABILITIES #define VLAN_CAPABILITIES(ifp) #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans @@ -73,10 +86,33 @@ $FreeBSD$ #define IFCAP_TSO4 0 #endif +#ifndef IFCAP_TSO6 +#define IFCAP_TSO6 0 +#endif + +#ifndef IFCAP_TXCSUM_IPV6 +#define IFCAP_TXCSUM_IPV6 0 +#endif + +#ifndef IFCAP_RXCSUM_IPV6 +#define IFCAP_RXCSUM_IPV6 0 +#endif + #ifndef CSUM_TSO #define CSUM_TSO 0 #endif +#ifndef CSUM_TCP_IPV6 +#define CSUM_TCP_IPV6 0 +#endif + +#ifndef CSUM_UDP_IPV6 +#define CSUM_UDP_IPV6 0 +#endif + +#ifndef CSUM_DELAY_DATA_IPV6 +#define CSUM_DELAY_DATA_IPV6 0 +#endif typedef struct { void *addr; @@ -270,6 +306,7 @@ struct mxge_softc { int dying; int connector; int current_media; + int max_tso6_hlen; mxge_dma_t dmabench_dma; struct callout co_hdl; struct taskqueue *tq; @@ -312,6 +349,15 @@ struct mxge_media_type char *name; }; +struct mxge_pkt_info { + int ip_off; + int ip_hlen; + struct ip *ip; + struct ip6_hdr *ip6; + struct tcphdr *tcp; +}; + + /* implement our own memory barriers, since bus_space_barrier cannot handle write-combining regions */ Modified: head/sys/modules/mxge/mxge/Makefile ============================================================================== --- head/sys/modules/mxge/mxge/Makefile Tue Feb 19 21:24:52 2013 (r247010) +++ head/sys/modules/mxge/mxge/Makefile Tue Feb 19 21:33:21 2013 (r247011) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../dev/mxge KMOD= if_mxge -SRCS= if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h +SRCS= if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h .include From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 21:35:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8F7D132F; Tue, 19 Feb 2013 21:35:18 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 670118FB; Tue, 19 Feb 2013 21:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JLZIbv096989; Tue, 19 Feb 2013 21:35:18 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JLZH27096984; Tue, 19 Feb 2013 21:35:17 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201302192135.r1JLZH27096984@svn.freebsd.org> From: John-Mark Gurney Date: Tue, 19 Feb 2013 21:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247012 - in head/contrib/binutils: gas/config opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 21:35:18 -0000 Author: jmg Date: Tue Feb 19 21:35:17 2013 New Revision: 247012 URL: http://svnweb.freebsd.org/changeset/base/247012 Log: add support for AES and PCLMULQDQ instructions to binutils... Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though OpenBSD's gcc is very different that it only helped w/ where to modify, not how... Thanks to jhb for some early reviews... Reviewed by: imp, kib MFC after: 1 month Modified: head/contrib/binutils/gas/config/tc-i386.c head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.h head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- head/contrib/binutils/gas/config/tc-i386.c Tue Feb 19 21:33:21 2013 (r247011) +++ head/contrib/binutils/gas/config/tc-i386.c Tue Feb 19 21:35:17 2013 (r247012) @@ -3981,7 +3981,7 @@ output_insn (void) SSE4 instructions have 3 bytes. We may use one more higher byte to specify a prefix the instruction requires. Exclude instructions which are in both SSE4 and ABM. */ - if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4 | CpuAES | CpuPCLMUL)) != 0 && (i.tm.cpu_flags & CpuABM) == 0) { if (i.tm.base_opcode & 0xff000000) @@ -4033,7 +4033,7 @@ output_insn (void) } else { - if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4 | CpuAES | CpuPCLMUL)) != 0 && (i.tm.cpu_flags & CpuABM) == 0) { p = frag_more (3); Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Tue Feb 19 21:33:21 2013 (r247011) +++ head/contrib/binutils/opcodes/i386-dis.c Tue Feb 19 21:35:17 2013 (r247012) @@ -543,6 +543,13 @@ fetch_data (struct disassemble_info *inf #define PREGRP97 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } } #define PREGRP98 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 98 } } #define PREGRP99 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 99 } } +#define PREGRP100 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 100 } } +#define PREGRP101 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 101 } } +#define PREGRP102 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 102 } } +#define PREGRP103 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 103 } } +#define PREGRP104 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 104 } } +#define PREGRP105 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 105 } } +#define PREGRP106 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 106 } } #define X86_64_0 NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } } @@ -1319,7 +1326,7 @@ static const unsigned char threebyte_0x3 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */ /* c0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */ - /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */ + /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1, /* df */ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */ /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */ /* ------------------------------- */ @@ -1382,7 +1389,7 @@ static const unsigned char threebyte_0x3 /* 10 */ 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* 1f */ /* 20 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2f */ /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */ - /* 40 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */ + /* 40 */ 1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0, /* 4f */ /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */ /* 60 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */ /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */ @@ -1391,7 +1398,7 @@ static const unsigned char threebyte_0x3 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */ /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */ /* c0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */ - /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */ + /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, /* df */ /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */ /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */ /* ------------------------------- */ @@ -2605,6 +2612,62 @@ static const struct dis386 prefix_user_t { "invvpid",{ Gm, Mo } }, { "(bad)", { XX } }, }, + + /* PREGRP100 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesimc", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP101 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesenc",{ XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP102 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesenclast", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP103 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesdec", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP104 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aesdeclast", { XM, EXx } }, + { "(bad)", { XX } }, + }, + + /* PREGRP105 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "aeskeygenassist", { XM, EXx, Ib } }, + { "(bad)", { XX } }, + }, + + /* PREGRP106 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "pclmulqdq", { XM, EXx, Ib } }, + { "(bad)", { XX } }, + }, }; static const struct dis386 x86_64_table[][2] = { @@ -2876,11 +2939,11 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP100 }, + { PREGRP101 }, + { PREGRP102 }, + { PREGRP103 }, + { PREGRP104 }, /* e0 */ { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -2997,7 +3060,7 @@ static const struct dis386 three_byte_ta { PREGRP84 }, { PREGRP85 }, { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP106 }, { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -3171,7 +3234,7 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP105 }, /* e0 */ { "(bad)", { XX } }, { "(bad)", { XX } }, Modified: head/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.h Tue Feb 19 21:33:21 2013 (r247011) +++ head/contrib/binutils/opcodes/i386-opc.h Tue Feb 19 21:35:17 2013 (r247012) @@ -72,6 +72,8 @@ typedef struct template #define CpuSSE4_1 0x400000 /* SSE4.1 Instructions required */ #define CpuSSE4_2 0x800000 /* SSE4.2 Instructions required */ #define CpuXSAVE 0x1000000 /* XSAVE Instructions required */ +#define CpuAES 0x2000000 /* AES Instructions required */ +#define CpuPCLMUL 0x4000000 /* Carry-less Multiplication extensions */ /* SSE4.1/4.2 Instructions required */ #define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) @@ -84,7 +86,7 @@ typedef struct template #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of @@ -126,6 +128,8 @@ typedef struct template #define Rex64 0x10000000 /* instruction require Rex64 prefix. */ #define Ugh 0x20000000 /* deprecated fp insn, gets a warning */ +#define NoSuf (No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf) + /* operand_types[i] describes the type of operand i. This is made by OR'ing together all of the possible type masks. (e.g. 'operand_types[i] = Reg|Imm' specifies that operand i can be Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Tue Feb 19 21:33:21 2013 (r247011) +++ head/contrib/binutils/opcodes/i386-tbl.h Tue Feb 19 21:35:17 2013 (r247012) @@ -4319,6 +4319,54 @@ const template i386_optab[] = { "xrstor", 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + /* Intel AES extensions */ + {"aesdec", 2, 0x660f38de, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesdeclast", 2, 0x660f38df, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesenc", 2, 0x660f38dc, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesenclast", 2, 0x660f38dd, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aesimc", 2, 0x660f38db, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { RegXMM|LLongMem, + RegXMM } }, + {"aeskeygenassist", 3, 0x660f3adf, None, CpuAES, + Modrm|IgnoreSize|NoSuf, + { Imm8, RegXMM|LLongMem, + RegXMM } }, + + /* Intel Carry-less Multiplication extensions */ + {"pclmulqdq", 3, 0x660f3a44, None, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf, + { Imm8, RegXMM|LLongMem, + RegXMM } }, + {"pclmullqlqdq", 2, 0x660f3a44, 0x0, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmulhqlqdq", 2, 0x660f3a44, 0x1, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmullqhqdq", 2, 0x660f3a44, 0x10, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + {"pclmulhqhqdq", 2, 0x660f3a44, 0x11, CpuPCLMUL, + Modrm|IgnoreSize|NoSuf|ImmExt, + { RegXMM|LLongMem, + RegXMM } }, + { NULL, 0, 0, 0, 0, 0, { 0 } } }; From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 22:37:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00C4983B; Tue, 19 Feb 2013 22:37:02 +0000 (UTC) (envelope-from Daan@vitsch.nl) Received: from Prakkezator.VEHosting.nl (Prakkezator6.VEHosting.nl [IPv6:2001:1af8:2100:b020::142]) by mx1.freebsd.org (Postfix) with ESMTP id 842D8CB3; Tue, 19 Feb 2013 22:37:02 +0000 (UTC) Received: from [192.168.72.13] (124-54.bbned.dsl.internl.net [92.254.54.124]) (authenticated bits=0) by Prakkezator.VEHosting.nl (8.14.2/8.14.2) with ESMTP id r1JMawxg061660; Tue, 19 Feb 2013 23:36:58 +0100 (CET) (envelope-from Daan@vitsch.nl) From: Daan Vreeken Organization: Daan - Vitsch Electronics To: Ian Lepore Subject: Re: svn commit: r246881 - head/sys/arm/arm Date: Tue, 19 Feb 2013 23:36:58 +0100 User-Agent: KMail/1.9.10 References: <1361047411-3211857922.60053a5ec5@bliksem.vehosting.nl> <201302162043.r1GKhG1e030867@svn.freebsd.org> In-Reply-To: <201302162043.r1GKhG1e030867@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201302192336.59024.Daan@vitsch.nl> x-ve-auth-version: mi-1.1.7 2011-02-21 - Copyright (c) 2008, 2011 - Daan Vreeken - VEHosting x-ve-auth: authenticated as 'pa4dan' on Prakkezator.VEHosting.nl Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 22:37:03 -0000 Hi Ian, On Saturday 16 February 2013 21:43:16 Ian Lepore wrote: > Author: ian > Date: Sat Feb 16 20:43:16 2013 > New Revision: 246881 > URL: http://svnweb.freebsd.org/changeset/base/246881 > > Log: > In _bus_dmamap_addseg(), the return value must be zero for error, or the > size actually added to the segment (possibly smaller than the requested > size if boundary crossings had to be avoided). Your fix just beat me by minutes to reporting this bug. I'm rebasing a local source tree and ran into a situation where DMA wasn't working without any obvious reason. It turned out to be _bus_dmamap_load_buffer() returning EFBIG to bus_dmamap_load() because of the above. Thanks! -- Ing. Daan Vreeken Vitsch Electronics http://Vitsch.nl/ http://VitschVPN.nl/ tel: +31-(0)40-7113051 KvK nr: 17174380 -- Machines en netwerken op afstand beheren? Vitsch VPN oplossing! Kijk voor meer informatie op: http://www.VitschVPN.nl/ From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 23:46:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A45C66C; Tue, 19 Feb 2013 23:46:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0DD176; Tue, 19 Feb 2013 23:46:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JNkp5X036040; Tue, 19 Feb 2013 23:46:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JNkpnP036039; Tue, 19 Feb 2013 23:46:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302192346.r1JNkpnP036039@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 19 Feb 2013 23:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247013 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 23:46:52 -0000 Author: jilles Date: Tue Feb 19 23:46:51 2013 New Revision: 247013 URL: http://svnweb.freebsd.org/changeset/base/247013 Log: sh: Fix a crash with the stackmark code. If a stack mark is set while the current stack block is empty, the stack block may move later on (because of realloc()) and the stack mark needs to be updated. This updating does not happen after popstackmark() has been called; therefore, call setstackmark() again if the stack mark is still being used. For some reason, this only affects a few users. I cannot reproduce it. The situation seems quite rare as well because an empty stack block would usually be freed (by popstackmark()) before execution reaches a setstackmark() call. PR: 175922 Tested by: KT Sin Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Tue Feb 19 21:35:17 2013 (r247012) +++ head/bin/sh/eval.c Tue Feb 19 23:46:51 2013 (r247013) @@ -174,6 +174,7 @@ evalstring(char *s, int flags) any = 1; } popstackmark(&smark); + setstackmark(&smark); } popfile(); popstackmark(&smark); @@ -296,6 +297,7 @@ evaltree(union node *n, int flags) } n = next; popstackmark(&smark); + setstackmark(&smark); } while (n != NULL); out: popstackmark(&smark); From owner-svn-src-head@FreeBSD.ORG Tue Feb 19 23:57:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 988B3ADC; Tue, 19 Feb 2013 23:57:40 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2021E0; Tue, 19 Feb 2013 23:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1JNve7o039941; Tue, 19 Feb 2013 23:57:40 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1JNveLq039940; Tue, 19 Feb 2013 23:57:40 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302192357.r1JNveLq039940@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 19 Feb 2013 23:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247014 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 23:57:40 -0000 Author: keramida (doc committer) Date: Tue Feb 19 23:57:39 2013 New Revision: 247014 URL: http://svnweb.freebsd.org/changeset/base/247014 Log: Add a sample program that shows how a custom comparison function and qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Approved by: gjb (mentor) MFC after: 1 week Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Tue Feb 19 23:46:51 2013 (r247013) +++ head/lib/libc/stdlib/qsort.3 Tue Feb 19 23:57:39 2013 (r247014) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 30, 2003 +.Dd February 20, 2013 .Dt QSORT 3 .Os .Sh NAME @@ -211,6 +211,52 @@ Previous versions of did not permit the comparison routine itself to call .Fn qsort 3 . This is no longer true. +.Sh EXAMPLES +A sample program that sorts an array of +.Vt int +values in place using +.Fn qsort , +and then prints the sorted array to standard output is: +.Bd -literal +#include +#include +#include + +/* + * Custom comparison function that can compare 'int' values through pointers + * passed by qsort(3). + */ +static int +int_compare(const void *p1, const void *p2) +{ + int *left = (int *)p1; + int *right = (int *)p2; + + if (*left < *right) + return (-1); + else if (*left > *right) + return (1); + else + return (0); +} + +/* + * Sort an array of 'int' values and print it to standard output. + */ +int +main(void) +{ + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + const int array_size = sizeof(int_array) / sizeof(int_array[0]); + int k; + + qsort(&int_array, array_size, sizeof(int), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + printf("\\n"); + exit(EXIT_SUCCESS); +} +.Ed .Sh ERRORS The .Fn heapsort From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 08:25:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A2B161A9; Wed, 20 Feb 2013 08:25:25 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by mx1.freebsd.org (Postfix) with ESMTP id 32B2CAA6; Wed, 20 Feb 2013 08:25:24 +0000 (UTC) Received: by mail-qe0-f47.google.com with SMTP id 2so3500228qea.6 for ; Wed, 20 Feb 2013 00:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=KQyA/8euGMN/UKUntT1tue9TAy9XEyUsR4AVbuXqsAc=; b=LXooGYVnPhdVtzOUQu/MixFz/Ye3ch53cxYka2rKGpPnkldKW2JxZILarS3hYKYe9v dhd1sGinOJUUwb1dx98Vk1ex59kWMOEqc3P5iyzKRHLdeR2AZyqXgV+qkfInjwICA1kH 8rbXlN+ZypNTRC++1i00B8HW5zoO8Nlo5995oBMJF/csdQyxxi1pgoGvgWIW/TT31Oia bhUiJXNHQ1jHmpKd1Hi8CbMaMStcw5115xXURP3IS/8aJaIb797fhl5RUw55IC987slw Ia3QjbylfP5jPI8FFMVTtdWw5nN4vckcAHarkx0tCnQczJ4oEMJRnMt67cmdyu3qDq3c S4rQ== MIME-Version: 1.0 X-Received: by 10.224.52.68 with SMTP id h4mr8607541qag.17.1361348724241; Wed, 20 Feb 2013 00:25:24 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.229.179.42 with HTTP; Wed, 20 Feb 2013 00:25:24 -0800 (PST) In-Reply-To: <201302192357.r1JNveLq039940@svn.freebsd.org> References: <201302192357.r1JNveLq039940@svn.freebsd.org> Date: Wed, 20 Feb 2013 00:25:24 -0800 X-Google-Sender-Auth: dJRNRIjSaCjbRMBSdm30tp96qRM Message-ID: Subject: Re: svn commit: r247014 - head/lib/libc/stdlib From: mdf@FreeBSD.org To: Giorgos Keramidas Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 08:25:25 -0000 On Tue, Feb 19, 2013 at 3:57 PM, Giorgos Keramidas wrote: > Author: keramida (doc committer) > Date: Tue Feb 19 23:57:39 2013 > New Revision: 247014 > URL: http://svnweb.freebsd.org/changeset/base/247014 > > Log: > Add a sample program that shows how a custom comparison function and > qsort(3) can work together to sort an array of integers. > > PR: docs/176197 > Submitted by: Fernando, fapesteguia at opensistemas.com > Approved by: gjb (mentor) > MFC after: 1 week > > Modified: > head/lib/libc/stdlib/qsort.3 > > Modified: head/lib/libc/stdlib/qsort.3 > ============================================================================== > --- head/lib/libc/stdlib/qsort.3 Tue Feb 19 23:46:51 2013 (r247013) > +++ head/lib/libc/stdlib/qsort.3 Tue Feb 19 23:57:39 2013 (r247014) > @@ -32,7 +32,7 @@ > .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd September 30, 2003 > +.Dd February 20, 2013 > .Dt QSORT 3 > .Os > .Sh NAME > @@ -211,6 +211,52 @@ Previous versions of > did not permit the comparison routine itself to call > .Fn qsort 3 . > This is no longer true. > +.Sh EXAMPLES > +A sample program that sorts an array of > +.Vt int > +values in place using > +.Fn qsort , > +and then prints the sorted array to standard output is: > +.Bd -literal > +#include > +#include > +#include > + > +/* > + * Custom comparison function that can compare 'int' values through pointers > + * passed by qsort(3). > + */ > +static int > +int_compare(const void *p1, const void *p2) > +{ > + int *left = (int *)p1; > + int *right = (int *)p2; These should be declared const int *. And the cast shouldn't be needed in C, since void * can be assigned to any other pointer type. Cheers, matthew > + > + if (*left < *right) > + return (-1); > + else if (*left > *right) > + return (1); > + else > + return (0); > +} > + > +/* > + * Sort an array of 'int' values and print it to standard output. > + */ > +int > +main(void) > +{ > + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; > + const int array_size = sizeof(int_array) / sizeof(int_array[0]); > + int k; > + > + qsort(&int_array, array_size, sizeof(int), int_compare); > + for (k = 0; k < array_size; k++) > + printf(" %d", int_array[k]); > + printf("\\n"); > + exit(EXIT_SUCCESS); > +} > +.Ed > .Sh ERRORS > The > .Fn heapsort From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 09:32:49 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0588A365; Wed, 20 Feb 2013 09:32:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id CC3F1EEF; Wed, 20 Feb 2013 09:32:48 +0000 (UTC) Received: from [192.168.0.2] (cpc10-cmbg15-2-0-cust123.5-4.cable.virginmedia.com [86.30.246.124]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r1K9WgUr051359 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 20 Feb 2013 09:32:46 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r247014 - head/lib/libc/stdlib From: David Chisnall In-Reply-To: Date: Wed, 20 Feb 2013 09:32:43 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> References: <201302192357.r1JNveLq039940@svn.freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Giorgos Keramidas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 09:32:49 -0000 On 20 Feb 2013, at 08:25, mdf@FreeBSD.org wrote: > These should be declared const int *. And the cast shouldn't be > needed in C, since void * can be assigned to any other pointer type. In fact, the entire function body can be replaced with: return (*(int*)p1 - *(int*)p2); qsort doesn't require that you return -1, 0, or 1, it requires you = return <0, 0, or >0. David From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 09:49:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0700843; Wed, 20 Feb 2013 09:49:44 +0000 (UTC) (envelope-from gkeramidas@gmail.com) Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by mx1.freebsd.org (Postfix) with ESMTP id 97CC0FC4; Wed, 20 Feb 2013 09:49:43 +0000 (UTC) Received: by mail-ee0-f49.google.com with SMTP id d4so3915344eek.36 for ; Wed, 20 Feb 2013 01:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to; bh=PcrPtzWoUG5efqOafPhM9x0s0aU8qrLNj/QzRxT72Ts=; b=yrE4qw2u52igFFChkKmcTNPpm1XYZ99QTUjNjLrketBVU5pB3kopm/eVpMdiOUrZZg WuS+1D0H2Ns7LQp184H2YIvKZ/tI5vwdKvUmNZ6Pai993zF9Pp1hlNYC28eqL80eE129 0QyKb9B551JI1t2+xqlPr/4xDpxAlq53zlaLxzqxBEJ4VY/JbrbHDyKcLltnp++f9hIW YlzDtKpwp/fjeCC9uL+mOuwG05LKh5tozHYrg1F93q/hZjbzZjNEegx642oPKG9Y53uE ey8QeYJeuP3IW+1V+5w4n/IE/aSMS2Zo1VR4WkC7bYe2Tw+2mZ/OAvEbBnjl2YWRDNt2 MMlw== X-Received: by 10.14.182.137 with SMTP id o9mr67021251eem.13.1361353777128; Wed, 20 Feb 2013 01:49:37 -0800 (PST) Received: from saturn (217-162-217-29.dynamic.hispeed.ch. [217.162.217.29]) by mx.google.com with ESMTPS id u44sm48400183eel.7.2013.02.20.01.49.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Feb 2013 01:49:36 -0800 (PST) Sender: Giorgos Keramidas Date: Wed, 20 Feb 2013 10:49:32 +0100 From: Giorgos Keramidas To: David Chisnall Subject: Re: svn commit: r247014 - head/lib/libc/stdlib Message-ID: <20130220094930.GB26651@saturn> References: <201302192357.r1JNveLq039940@svn.freebsd.org> <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, mdf@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 09:49:44 -0000 On 2013-02-20 09:32, David Chisnall wrote: > On 20 Feb 2013, at 08:25, mdf@FreeBSD.org wrote: > > These should be declared const int *. And the cast shouldn't be > > needed in C, since void * can be assigned to any other pointer type. > > In fact, the entire function body can be replaced with: > > return (*(int*)p1 - *(int*)p2); > > qsort doesn't require that you return -1, 0, or 1, it requires you return <0, 0, or >0. That's true. Since we are trying to document the interface, I'd prefer if we don't compress the comparison too much. Would something like this be ok too? int int_compare(const void *p1, const void *p2) { const int *left = p1; const int *right = p2; return (*left - *right); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 09:49:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC1E7999; Wed, 20 Feb 2013 09:49:51 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id 6582DFC5; Wed, 20 Feb 2013 09:49:50 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep15-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130220094943.UUP15686.viefep15-int.chello.at@edge03.upcmail.net>; Wed, 20 Feb 2013 10:49:43 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge03.upcmail.net with edge id 2Zpi1l0152xdvHc03ZpiRj; Wed, 20 Feb 2013 10:49:43 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 3EFC56D47C; Wed, 20 Feb 2013 10:49:42 +0100 (CET) Date: Wed, 20 Feb 2013 10:49:42 +0100 From: Stefan Farfeleder To: David Chisnall Subject: Re: svn commit: r247014 - head/lib/libc/stdlib Message-ID: <20130220094941.GA1438@mole.fafoe.narf.at> References: <201302192357.r1JNveLq039940@svn.freebsd.org> <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, mdf@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Giorgos Keramidas X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 09:49:52 -0000 On Wed, Feb 20, 2013 at 09:32:43AM +0000, David Chisnall wrote: > On 20 Feb 2013, at 08:25, mdf@FreeBSD.org wrote: > > > These should be declared const int *. And the cast shouldn't be > > needed in C, since void * can be assigned to any other pointer type. > > In fact, the entire function body can be replaced with: > > return (*(int*)p1 - *(int*)p2); > > qsort doesn't require that you return -1, 0, or 1, it requires you return <0, 0, or >0. The subtraction might overflow and give wrong results. It won't for these specific elements, but it would be a bad example, IMHO. Stefan From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 09:58:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4A5F1B0; Wed, 20 Feb 2013 09:58:42 +0000 (UTC) (envelope-from gkeramidas@gmail.com) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by mx1.freebsd.org (Postfix) with ESMTP id 9C09F11C; Wed, 20 Feb 2013 09:58:41 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi8so5953528wib.7 for ; Wed, 20 Feb 2013 01:58:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to; bh=e+VGxdvFOJ2tcs3QZ7Sg4JTbZULhwcPYpAU8gtogf4w=; b=j+o/65hLkAQh8WxYt3pOnNR3K3hDx9t/aIPEG/bgWQ307swl6CwAfrsvhvk2PkoyQM 2s9B4UPPyOh+6xsZzgEGebeeRNtlOvgW9CFat25dn0Z+JoErkNWQ4WlR6Vp9nrHwZY46 N0IB65/BMLIAVTTOXssuGfHc7kaSjCn+cSmJrn5ZN6nATD+Q0uLjU8dixAPa8tdCltoi jVa9fIWAs9f/o4HkTOdelaf2L27zMOoplAJjBD0+6Uzlxobu3tzvRWSpm6u5A5aupvML HJOVcdMCfoktDg6UmSTZoOBLml5Egkn2opefCNxS/93139l/D37yxBwON5c7korNoFhP syxg== X-Received: by 10.180.87.170 with SMTP id az10mr31561074wib.3.1361354320606; Wed, 20 Feb 2013 01:58:40 -0800 (PST) Received: from saturn (217-162-217-29.dynamic.hispeed.ch. [217.162.217.29]) by mx.google.com with ESMTPS id m6sm32800876wic.2.2013.02.20.01.58.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Feb 2013 01:58:39 -0800 (PST) Sender: Giorgos Keramidas Date: Wed, 20 Feb 2013 10:58:35 +0100 From: Giorgos Keramidas To: Stefan Farfeleder Subject: Re: svn commit: r247014 - head/lib/libc/stdlib Message-ID: <20130220095834.GD26651@saturn> References: <201302192357.r1JNveLq039940@svn.freebsd.org> <79B2F826-6CB5-4CD5-8C7D-8220833403EF@FreeBSD.org> <20130220094941.GA1438@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130220094941.GA1438@mole.fafoe.narf.at> Cc: svn-src-head@FreeBSD.org, mdf@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David Chisnall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 09:58:42 -0000 On 2013-02-20 10:49, Stefan Farfeleder wrote: >On Wed, Feb 20, 2013 at 09:32:43AM +0000, David Chisnall wrote: >>On 20 Feb 2013, at 08:25, mdf@FreeBSD.org wrote: >>> These should be declared const int *. And the cast shouldn't be >>> needed in C, since void * can be assigned to any other pointer type. >> >> In fact, the entire function body can be replaced with: >> >> return (*(int*)p1 - *(int*)p2); >> >> qsort doesn't require that you return -1, 0, or 1, it requires you return <0, 0, or >0. > > The subtraction might overflow and give wrong results. It won't for > these specific elements, but it would be a bad example, IMHO. That's a good point. The Linux version of the manpage uses a string comparison function as an example, *and* a subtraction, which then requires a lengthy comment to explain what's happening and why all the casts: static int cmpstringp(const void *p1, const void *p2) { /* The actual arguments to this function are "pointers to pointers to char", but strcmp(3) arguments are "pointers to char", hence the following cast plus dereference */ return strcmp(* (char * const *) p1, * (char * const *) p2); } Now I prefer sticking with the rather explicit and rather simple to understand version: /* * Custom comparison function that can compare 'int' values through pointers * passed by qsort(3). */ static int int_compare(const void *p1, const void *p2) { const int *left = p1; const int *right = p2; if (*left < *right) return (-1); else if (*left > *right) return (1); else return (0); } Even the comment is not stricly needed. The code is simpler than the version with the casts, especially if the casts have to be repeated to avoid subtraction induced underflows. From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:14:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2FC553E7; Wed, 20 Feb 2013 11:14:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17F79820; Wed, 20 Feb 2013 11:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBEtCw046218; Wed, 20 Feb 2013 11:14:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBEtg2046217; Wed, 20 Feb 2013 11:14:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201114.r1KBEtg2046217@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247025 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:14:56 -0000 Author: adrian Date: Wed Feb 20 11:14:55 2013 New Revision: 247025 URL: http://svnweb.freebsd.org/changeset/base/247025 Log: CFG_ERR, DATA_UNDERRUN and DELIM_UNDERRUN are all flags, rather than part of ts_status. Thus: * make sure we decode them from ts_flags, rather than ts_status; * make sure we decode them regardless of whether there's an error or not. This correctly exposes descriptor configuration errors, TX delimiter underruns and TX data underruns. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 20 10:58:42 2013 (r247024) +++ head/sys/dev/ath/if_ath.c Wed Feb 20 11:14:55 2013 (r247025) @@ -3581,17 +3581,24 @@ ath_tx_update_stats(struct ath_softc *sc if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED) sc->sc_stats.ast_tx_timerexpired++; - if (ts->ts_status & HAL_TX_DATA_UNDERRUN) - sc->sc_stats.ast_tx_data_underrun++; - if (ts->ts_status & HAL_TX_DELIM_UNDERRUN) - sc->sc_stats.ast_tx_delim_underrun++; - if (bf->bf_m->m_flags & M_FF) sc->sc_stats.ast_ff_txerr++; } /* XXX when is this valid? */ - if (ts->ts_status & HAL_TX_DESC_CFG_ERR) + if (ts->ts_flags & HAL_TX_DESC_CFG_ERR) sc->sc_stats.ast_tx_desccfgerr++; + /* + * This can be valid for successful frame transmission! + * If there's a TX FIFO underrun during aggregate transmission, + * the MAC will pad the rest of the aggregate with delimiters. + * If a BA is returned, the frame is marked as "OK" and it's up + * to the TX completion code to notice which frames weren't + * successfully transmitted. + */ + if (ts->ts_flags & HAL_TX_DATA_UNDERRUN) + sc->sc_stats.ast_tx_data_underrun++; + if (ts->ts_flags & HAL_TX_DELIM_UNDERRUN) + sc->sc_stats.ast_tx_delim_underrun++; sr = ts->ts_shortretry; lr = ts->ts_longretry; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:17:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4353959A; Wed, 20 Feb 2013 11:17:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 35C19846; Wed, 20 Feb 2013 11:17:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBH46k046585; Wed, 20 Feb 2013 11:17:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBH4Dc046584; Wed, 20 Feb 2013 11:17:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201117.r1KBH4Dc046584@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247026 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:17:04 -0000 Author: adrian Date: Wed Feb 20 11:17:03 2013 New Revision: 247026 URL: http://svnweb.freebsd.org/changeset/base/247026 Log: Post interrupts in the ath alq trace. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 20 11:14:55 2013 (r247025) +++ head/sys/dev/ath/if_ath.c Wed Feb 20 11:17:03 2013 (r247026) @@ -1588,6 +1588,10 @@ ath_intr(void *arg) ath_hal_getisr(ah, &status); /* NB: clears ISR too */ DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status); ATH_KTR(sc, ATH_KTR_INTERRUPTS, 1, "ath_intr: mask=0x%.8x", status); +#ifdef ATH_DEBUG_ALQ + if_ath_alq_post_intr(&sc->sc_alq, status, ah->ah_intrstate, + ah->ah_syncstate); +#endif /* ATH_DEBUG_ALQ */ #ifdef ATH_KTR_INTR_DEBUG ATH_KTR(sc, ATH_KTR_INTERRUPTS, 5, "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x", From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:17:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B95A877D; Wed, 20 Feb 2013 11:17:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC23D854; Wed, 20 Feb 2013 11:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBHT3V046675; Wed, 20 Feb 2013 11:17:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBHThr046674; Wed, 20 Feb 2013 11:17:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201117.r1KBHThr046674@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247027 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:17:29 -0000 Author: adrian Date: Wed Feb 20 11:17:29 2013 New Revision: 247027 URL: http://svnweb.freebsd.org/changeset/base/247027 Log: oops, tab! Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 20 11:17:03 2013 (r247026) +++ head/sys/dev/ath/if_ath.c Wed Feb 20 11:17:29 2013 (r247027) @@ -1591,7 +1591,7 @@ ath_intr(void *arg) #ifdef ATH_DEBUG_ALQ if_ath_alq_post_intr(&sc->sc_alq, status, ah->ah_intrstate, ah->ah_syncstate); -#endif /* ATH_DEBUG_ALQ */ +#endif /* ATH_DEBUG_ALQ */ #ifdef ATH_KTR_INTR_DEBUG ATH_KTR(sc, ATH_KTR_INTERRUPTS, 5, "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x", From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:20:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0F33CB7; Wed, 20 Feb 2013 11:20:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2DFE8DC; Wed, 20 Feb 2013 11:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBKpMm048724; Wed, 20 Feb 2013 11:20:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBKpSv048723; Wed, 20 Feb 2013 11:20:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201120.r1KBKpSv048723@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247028 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:20:52 -0000 Author: adrian Date: Wed Feb 20 11:20:51 2013 New Revision: 247028 URL: http://svnweb.freebsd.org/changeset/base/247028 Log: Enable TX FIFO underrun interrupts. This allows the TX FIFO threshold adjustment code to now run. Tested: * AR5416, STA TODO: * Much more thorough testing on the other chips, AR5210 -> AR9287 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 20 11:17:29 2013 (r247027) +++ head/sys/dev/ath/if_ath.c Wed Feb 20 11:20:51 2013 (r247028) @@ -1983,6 +1983,7 @@ ath_init(void *arg) */ sc->sc_imask = HAL_INT_RX | HAL_INT_TX | HAL_INT_RXEOL | HAL_INT_RXORN + | HAL_INT_TXURN | HAL_INT_FATAL | HAL_INT_GLOBAL; /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:22:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30261ECF; Wed, 20 Feb 2013 11:22:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA6A8FE; Wed, 20 Feb 2013 11:22:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBMjVo049044; Wed, 20 Feb 2013 11:22:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBMiLv049043; Wed, 20 Feb 2013 11:22:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201122.r1KBMiLv049043@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247029 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:22:45 -0000 Author: adrian Date: Wed Feb 20 11:22:44 2013 New Revision: 247029 URL: http://svnweb.freebsd.org/changeset/base/247029 Log: A couple of quick tidyups: * Delete this debugging print - I used it when debugging the initial TX descriptor chaining code. It now works, so let's toss it. It just confuses people if they enable TX descriptor debugging as they get two slightly different versions of the same descriptor. * Indenting. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Feb 20 11:20:51 2013 (r247028) +++ head/sys/dev/ath/if_ath_tx.c Wed Feb 20 11:22:44 2013 (r247029) @@ -473,11 +473,6 @@ ath_tx_chaindesclist(struct ath_softc *s bf->bf_state.bfs_ndelim); } isFirstDesc = 0; -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_XMIT) - ath_printtxbuf(sc, bf, bf->bf_state.bfs_tx_queue, - 0, 0); -#endif bf->bf_lastds = (struct ath_desc *) ds; /* @@ -3154,7 +3149,7 @@ ath_tx_tid_filt_comp_aggr(struct ath_sof * Don't allow a filtered frame to live forever. */ if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { - sc->sc_stats.ast_tx_swretrymax++; + sc->sc_stats.ast_tx_swretrymax++; DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: bf=%p, seqno=%d, exceeded retries\n", __func__, From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:24:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BDB2FE; Wed, 20 Feb 2013 11:24:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4E3B9921; Wed, 20 Feb 2013 11:24:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KBOCHO049275; Wed, 20 Feb 2013 11:24:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KBOCkR049274; Wed, 20 Feb 2013 11:24:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201124.r1KBOCkR049274@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 11:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247030 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:24:12 -0000 Author: adrian Date: Wed Feb 20 11:24:11 2013 New Revision: 247030 URL: http://svnweb.freebsd.org/changeset/base/247030 Log: If any of the TX queues have underrun reporting enabled, enable HAL_INT_TXURN in the interrupt mask register. This should now allow for TXURN interrupts to be posted. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Wed Feb 20 11:22:44 2013 (r247029) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Wed Feb 20 11:24:11 2013 (r247030) @@ -307,6 +307,8 @@ ar5416SetInterrupts(struct ath_hal *ah, mask |= AR_IMR_TXDESC; if (ahp->ah_txEolInterruptMask) mask |= AR_IMR_TXEOL; + if (ahp->ah_txUrnInterruptMask) + mask |= AR_IMR_TXURN; } if (ints & (HAL_INT_BMISC)) { mask |= AR_IMR_BCNMISC; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 11:27:07 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 651F32DD; Wed, 20 Feb 2013 11:27:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id D038F950; Wed, 20 Feb 2013 11:27:06 +0000 (UTC) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1KBQxLi027311; Wed, 20 Feb 2013 22:26:59 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1KBQl5T003031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Feb 2013 22:26:48 +1100 Date: Wed, 20 Feb 2013 22:26:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov Subject: Re: svn commit: r246033 - head/usr.bin/systat In-Reply-To: <5107BC87.4080403@FreeBSD.org> Message-ID: <20130220220256.X856@besplex.bde.org> References: <201301281257.r0SCvhhv071414@svn.freebsd.org> <20130129003913.G2698@besplex.bde.org> <5107BC87.4080403@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=KZ6KKnkD c=1 sm=1 a=VYs4l19NTHwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=hP3lJxi6wgAA:10 a=NEAV23lmAAAA:8 a=ZS0bOJEMWNEgiowcFE4A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 11:27:07 -0000 On Tue, 29 Jan 2013, Andrey Zonov wrote: > On 1/28/13 6:51 PM, Bruce Evans wrote: >> On Mon, 28 Jan 2013, Andrey Zonov wrote: >> >>> Log: >>> - Show page faults requiring I/O on vmstat display. >> >> No space is available there for showing it. > > Yep, you're right. >>> + mvprintw(VMSTATROW, VMSTATCOL + 9, "ioflt"); >> >> Putting it first unsorts the fields a bit and makes the diff large. >> >> It is not documented in the man page. > > Fixed in attached systat1.patch.txt. OK. >> ... >> "buf" is even more useless with zfs. So are some of the other fields >> ... > > I totally agree with you, 'buf' should go away from systat and top. I > removed 'buf' from systat. Please review systat2.patch.txt. I'd just like it to be replaced by a useful buf field someday. Since the field in row 23 (starting at row 0) is now useful, omitting it is not so good so I I agree with your patch removing the special code to avoid printing it on 24-row terminals. > To count 'disk cache' we have to add new counter which should track all > pages with OBJT_VNODE type. It doesn't look hard to implement this. I > wrote utility [1] which allows me to inspect memory and find what is in > disk cache. I think I would like at least 2 fields: - total disk space mapped in VMIO buffers - total disk space mapped in the buffer cache. > I also found that %ozfod is not useful for me and I removed it to not > mangle 'free' on 24-line terminals (systat3.patch.txt). Certainly no space is available for the luxury of both ozfod and %ozfod. That would also allow leaving buf and its 24-column support alone. Only 3 fields would move relative to the old version (not just 1 field changing for swapping %ozfod with the new field, since you want to put the new field first). Are the other fields in the best order? I think they are. If not, it would be good to move some when adjusting all the row numbers. > Thanks for comments! > > [1] https://github.com/z0nt/meminfo/ Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 12:14:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C32C5FD5; Wed, 20 Feb 2013 12:14:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5C64CEC; Wed, 20 Feb 2013 12:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KCEopI064407; Wed, 20 Feb 2013 12:14:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KCEowf064406; Wed, 20 Feb 2013 12:14:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302201214.r1KCEowf064406@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Feb 2013 12:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247033 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 12:14:50 -0000 Author: adrian Date: Wed Feb 20 12:14:49 2013 New Revision: 247033 URL: http://svnweb.freebsd.org/changeset/base/247033 Log: Configure larger TX FIFO default and maximum level values. This has reduced the number of TX delimiter and data underruns when doing large UDP transfers (>100mbit). This stops any HAL_INT_TXURN interrupts from occuring, which is a good sign! Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Feb 20 12:06:33 2013 (r247032) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Feb 20 12:14:49 2013 (r247033) @@ -241,8 +241,24 @@ ar5416InitState(struct ath_hal_5416 *ahp /* Enable all ANI functions to begin with */ AH5416(ah)->ah_ani_function = 0xffffffff; - /* Set overridable ANI methods */ - AH5212(ah)->ah_aniControl = ar5416AniControl; + /* Set overridable ANI methods */ + AH5212(ah)->ah_aniControl = ar5416AniControl; + + /* Default FIFO Trigger levels */ +#define AR_FTRIG_512B 0x00000080 // 5 bits total + /* AR9285/AR9271 need to use half the TX FIFOs */ + if (AR_SREV_KITE(ah) || AR_SREV_9271(ah)) { + AH5212(ah)->ah_txTrigLev = (AR_FTRIG_256B >> AR_FTRIG_S); + AH5212(ah)->ah_maxTxTrigLev = ((2048 / 64) - 1); + } else { + AH5212(ah)->ah_txTrigLev = (AR_FTRIG_512B >> AR_FTRIG_S); + AH5212(ah)->ah_maxTxTrigLev = ((4096 / 64) - 1); + } + ath_hal_printf(ah, "%s: trigLev=%d, maxTxTrigLev=%d\n", + __func__, + AH5212(ah)->ah_txTrigLev, + AH5212(ah)->ah_maxTxTrigLev); +#undef AR_FTRIG_512B } uint32_t From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 12:40:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5DEE4D5F; Wed, 20 Feb 2013 12:40:27 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5046BF04; Wed, 20 Feb 2013 12:40:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KCeRnL072533; Wed, 20 Feb 2013 12:40:27 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KCeRRx072532; Wed, 20 Feb 2013 12:40:27 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302201240.r1KCeRRx072532@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 20 Feb 2013 12:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247034 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 12:40:27 -0000 Author: pluknet Date: Wed Feb 20 12:40:26 2013 New Revision: 247034 URL: http://svnweb.freebsd.org/changeset/base/247034 Log: Check if the -sec option is given without an argument. PR: bin/170413 Submitted by: Andrey Simonenko MFC after: 1 week Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Feb 20 12:14:49 2013 (r247033) +++ head/usr.sbin/mountd/mountd.c Wed Feb 20 12:40:26 2013 (r247034) @@ -2235,7 +2235,7 @@ do_opt(char **cpp, char **endcpp, struct ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { opt_flags |= OP_QUIET; - } else if (!strcmp(cpopt, "sec")) { + } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) return (1); opt_flags |= OP_SEC; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 12:59:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB0972DA; Wed, 20 Feb 2013 12:59:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B00AD8; Wed, 20 Feb 2013 12:59:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KCxMRo076598; Wed, 20 Feb 2013 12:59:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KCxMUZ076597; Wed, 20 Feb 2013 12:59:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302201259.r1KCxMUZ076597@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 20 Feb 2013 12:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247035 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 12:59:22 -0000 Author: des Date: Wed Feb 20 12:59:21 2013 New Revision: 247035 URL: http://svnweb.freebsd.org/changeset/base/247035 Log: Reduce excessive nesting. Modified: head/sys/dev/ixgbe/ixgbe_phy.c Modified: head/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_phy.c Wed Feb 20 12:40:26 2013 (r247034) +++ head/sys/dev/ixgbe/ixgbe_phy.c Wed Feb 20 12:59:21 2013 (r247035) @@ -1194,25 +1194,23 @@ s32 ixgbe_identify_sfp_module_generic(st /* Make sure we're a supported PHY type */ if (hw->phy.type == ixgbe_phy_sfp_intel) { status = IXGBE_SUCCESS; + } else if (hw->allow_unsupported_sfp == TRUE) { + EWARN(hw, "WARNING: Intel (R) Network " + "Connections are quality tested " + "using Intel (R) Ethernet Optics." + " Using untested modules is not " + "supported and may cause unstable" + " operation or damage to the " + "module or the adapter. Intel " + "Corporation is not responsible " + "for any harm caused by using " + "untested modules.\n", status); + status = IXGBE_SUCCESS; } else { - if (hw->allow_unsupported_sfp == TRUE) { - EWARN(hw, "WARNING: Intel (R) Network " - "Connections are quality tested " - "using Intel (R) Ethernet Optics." - " Using untested modules is not " - "supported and may cause unstable" - " operation or damage to the " - "module or the adapter. Intel " - "Corporation is not responsible " - "for any harm caused by using " - "untested modules.\n", status); - status = IXGBE_SUCCESS; - } else { - DEBUGOUT("SFP+ module not supported\n"); - hw->phy.type = - ixgbe_phy_sfp_unsupported; - status = IXGBE_ERR_SFP_NOT_SUPPORTED; - } + DEBUGOUT("SFP+ module not supported\n"); + hw->phy.type = + ixgbe_phy_sfp_unsupported; + status = IXGBE_ERR_SFP_NOT_SUPPORTED; } } else { status = IXGBE_SUCCESS; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 13:47:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E51169DE; Wed, 20 Feb 2013 13:47:06 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C852D2E3; Wed, 20 Feb 2013 13:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KDl6Xj091376; Wed, 20 Feb 2013 13:47:06 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KDl5Rb091373; Wed, 20 Feb 2013 13:47:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201302201347.r1KDl5Rb091373@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 20 Feb 2013 13:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247036 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 13:47:07 -0000 Author: melifaro Date: Wed Feb 20 13:47:05 2013 New Revision: 247036 URL: http://svnweb.freebsd.org/changeset/base/247036 Log: Add interface name filtering via 'match' cmd. Add 'pps' cmd for switching beetween interface packets/bytes statistics. Submitted by: vsevolod MFC after: 2 weeks Modified: head/usr.bin/systat/ifcmds.c head/usr.bin/systat/ifstat.c head/usr.bin/systat/systat.1 Modified: head/usr.bin/systat/ifcmds.c ============================================================================== --- head/usr.bin/systat/ifcmds.c Wed Feb 20 12:59:21 2013 (r247035) +++ head/usr.bin/systat/ifcmds.c Wed Feb 20 13:47:05 2013 (r247036) @@ -28,11 +28,19 @@ * $FreeBSD$ */ +#include + #include "systat.h" #include "extern.h" #include "convtbl.h" +#include +#include + int curscale = SC_AUTO; +char *matchline = NULL; +int showpps = 0; +int needsort = 0; int ifcmd(const char *cmd, const char *args) @@ -48,6 +56,24 @@ ifcmd(const char *cmd, const char *args) addstr("what scale? "); addstr(get_helplist()); } - } + } else if (prefix(cmd, "match")) { + if (args != NULL && *args != '\0' && memcmp(args, "*", 2) != 0) { + /* We got a valid match line */ + if (matchline != NULL) { + free(matchline); + } + needsort = 1; + matchline = strdup(args); + } else { + /* Empty or * pattern, turn filtering off */ + if (matchline != NULL) { + free(matchline); + } + needsort = 1; + matchline = NULL; + } + } else if (prefix(cmd, "pps")) + showpps = !showpps; + return (1); } Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Wed Feb 20 12:59:21 2013 (r247035) +++ head/usr.bin/systat/ifstat.c Wed Feb 20 13:47:05 2013 (r247036) @@ -38,6 +38,7 @@ #include #include #include +#include #include "systat.h" #include "extern.h" @@ -71,12 +72,22 @@ struct if_stat { u_long if_out_curtraffic; u_long if_in_traffic_peak; u_long if_out_traffic_peak; + u_long if_in_curpps; + u_long if_out_curpps; + u_long if_in_pps_peak; + u_long if_out_pps_peak; u_int if_row; /* Index into ifmib sysctl */ u_int if_ypos; /* 0 if not being displayed */ u_int display; + u_int match; }; -extern u_int curscale; +extern int curscale; +extern char *matchline; +extern int showpps; +extern int needsort; + +static int needclear = 0; static void right_align_string(struct if_stat *); static void getifmibdata(const int, struct ifmibdata *); @@ -96,34 +107,48 @@ static u_int getifnum(void); #define STARTING_ROW (TOPLINE + 1) #define ROW_SPACING (3) -#define CLEAR_LINE(y, x) do { \ - wmove(wnd, y, x); \ - wclrtoeol(wnd); \ -} while (0) - -#define IN_col2 (ifp->if_in_curtraffic) -#define OUT_col2 (ifp->if_out_curtraffic) -#define IN_col3 (ifp->if_in_traffic_peak) -#define OUT_col3 (ifp->if_out_traffic_peak) -#define IN_col4 (ifp->if_mib.ifmd_data.ifi_ibytes) -#define OUT_col4 (ifp->if_mib.ifmd_data.ifi_obytes) +#define IN_col2 (showpps ? ifp->if_in_curpps : ifp->if_in_curtraffic) +#define OUT_col2 (showpps ? ifp->if_out_curpps : ifp->if_out_curtraffic) +#define IN_col3 (showpps ? \ + ifp->if_in_pps_peak : ifp->if_in_traffic_peak) +#define OUT_col3 (showpps ? \ + ifp->if_out_pps_peak : ifp->if_out_traffic_peak) +#define IN_col4 (showpps ? \ + ifp->if_mib.ifmd_data.ifi_ipackets : ifp->if_mib.ifmd_data.ifi_ibytes) +#define OUT_col4 (showpps ? \ + ifp->if_mib.ifmd_data.ifi_opackets : ifp->if_mib.ifmd_data.ifi_obytes) #define EMPTY_COLUMN " " #define CLEAR_COLUMN(y, x) mvprintw((y), (x), "%20s", EMPTY_COLUMN); #define DOPUTRATE(c, r, d) do { \ CLEAR_COLUMN(r, c); \ - mvprintw(r, (c), "%10.3f %s%s ", \ - convert(d##_##c, curscale), \ - get_string(d##_##c, curscale), \ - "/s"); \ + if (showpps) { \ + mvprintw(r, (c), "%10.3f %cp%s ", \ + convert(d##_##c, curscale), \ + *get_string(d##_##c, curscale), \ + "/s"); \ + } \ + else { \ + mvprintw(r, (c), "%10.3f %s%s ", \ + convert(d##_##c, curscale), \ + get_string(d##_##c, curscale), \ + "/s"); \ + } \ } while (0) #define DOPUTTOTAL(c, r, d) do { \ CLEAR_COLUMN((r), (c)); \ - mvprintw((r), (c), "%12.3f %s ", \ - convert(d##_##c, SC_AUTO), \ - get_string(d##_##c, SC_AUTO)); \ + if (showpps) { \ + mvprintw((r), (c), "%12.3f %cp ", \ + convert(d##_##c, SC_AUTO), \ + *get_string(d##_##c, SC_AUTO)); \ + } \ + else { \ + mvprintw((r), (c), "%12.3f %s ", \ + convert(d##_##c, SC_AUTO), \ + get_string(d##_##c, SC_AUTO)); \ + } \ } while (0) #define PUTRATE(c, r) do { \ @@ -183,8 +208,10 @@ void showifstat(void) { struct if_stat *ifp = NULL; + SLIST_FOREACH(ifp, &curlist, link) { - if (ifp->display == 0) + if (ifp->display == 0 || (ifp->match == 0) || + ifp->if_ypos > LINES - 3 - 1) continue; PUTNAME(ifp); PUTRATE(col2, ifp->if_ypos); @@ -215,6 +242,7 @@ initifstat(void) p->if_row = i+1; getifmibdata(p->if_row, &p->if_mib); right_align_string(p); + p->match = 1; /* * Initially, we only display interfaces that have @@ -236,7 +264,7 @@ fetchifstat(void) struct timeval tv, new_tv, old_tv; double elapsed = 0.0; u_int new_inb, new_outb, old_inb, old_outb = 0; - u_int we_need_to_sort_interface_list = 0; + u_int new_inp, new_outp, old_inp, old_outp = 0; SLIST_FOREACH(ifp, &curlist, link) { /* @@ -245,6 +273,8 @@ fetchifstat(void) */ old_inb = ifp->if_mib.ifmd_data.ifi_ibytes; old_outb = ifp->if_mib.ifmd_data.ifi_obytes; + old_inp = ifp->if_mib.ifmd_data.ifi_ipackets; + old_outp = ifp->if_mib.ifmd_data.ifi_opackets; ifp->tv_lastchanged = ifp->if_mib.ifmd_data.ifi_lastchange; (void)gettimeofday(&new_tv, NULL); @@ -252,11 +282,13 @@ fetchifstat(void) new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; new_outb = ifp->if_mib.ifmd_data.ifi_obytes; + new_inp = ifp->if_mib.ifmd_data.ifi_ipackets; + new_outp = ifp->if_mib.ifmd_data.ifi_opackets; /* Display interface if it's received some traffic. */ if (new_inb > 0 && old_inb == 0) { ifp->display = 1; - we_need_to_sort_interface_list++; + needsort = 1; } /* @@ -271,6 +303,9 @@ fetchifstat(void) ifp->if_in_curtraffic = new_inb - old_inb; ifp->if_out_curtraffic = new_outb - old_outb; + ifp->if_in_curpps = new_inp - old_inp; + ifp->if_out_curpps = new_outp - old_outp; + /* * Rather than divide by the time specified on the comm- * and line, we divide by ``elapsed'' as this is likely @@ -278,6 +313,8 @@ fetchifstat(void) */ ifp->if_in_curtraffic /= elapsed; ifp->if_out_curtraffic /= elapsed; + ifp->if_in_curpps /= elapsed; + ifp->if_out_curpps /= elapsed; if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak) ifp->if_in_traffic_peak = ifp->if_in_curtraffic; @@ -285,12 +322,18 @@ fetchifstat(void) if (ifp->if_out_curtraffic > ifp->if_out_traffic_peak) ifp->if_out_traffic_peak = ifp->if_out_curtraffic; + if (ifp->if_in_curpps > ifp->if_in_pps_peak) + ifp->if_in_pps_peak = ifp->if_in_curpps; + + if (ifp->if_out_curpps > ifp->if_out_pps_peak) + ifp->if_out_pps_peak = ifp->if_out_curpps; + ifp->tv.tv_sec = new_tv.tv_sec; ifp->tv.tv_usec = new_tv.tv_usec; } - if (we_need_to_sort_interface_list) + if (needsort) sort_interface_list(); return; @@ -323,6 +366,40 @@ right_align_string(struct if_stat *ifp) return; } +static int +check_match(const char *ifname) +{ + char *p = matchline, *c, t; + int match = 0, mlen; + + if (matchline == NULL) { + return 0; + } + /* Strip leading whitespaces */ + while (*p == ' ') + p ++; + + c = p; + while ((mlen = strcspn(c, " ;,")) != 0) { + p = c + mlen; + t = *p; + if (p - c > 0) { + *p = '\0'; + if (fnmatch(c, ifname, FNM_CASEFOLD) == 0) { + *p = t; + return 1; + } + *p = t; + c = p + strspn(p, " ;,"); + } + else { + c = p + strspn(p, " ;,"); + } + } + + return match; +} + /* * This function iterates through our list of interfaces, identifying * those that are to be displayed (ifp->display = 1). For each interf- @@ -340,11 +417,18 @@ sort_interface_list(void) y = STARTING_ROW; SLIST_FOREACH(ifp, &curlist, link) { - if (ifp->display) { + if (matchline && !check_match(ifp->if_mib.ifmd_name)) + ifp->match = 0; + else + ifp->match = 1; + if (ifp->display && ifp->match) { ifp->if_ypos = y; y += ROW_SPACING; } } + + needsort = 0; + needclear = 1; } static @@ -394,6 +478,11 @@ cmdifstat(const char *cmd, const char *a if (retval == 1) { showifstat(); refresh(); + if (needclear) { + werase(wnd); + labelifstat(); + needclear = 0; + } } return retval; Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Wed Feb 20 12:59:21 2013 (r247035) +++ head/usr.bin/systat/systat.1 Wed Feb 20 13:47:05 2013 (r247036) @@ -511,6 +511,28 @@ Modify the scale used to display the cur interfaces. The following units are recognised: kbit, kbyte, mbit, mbyte, gbit, gbyte and auto. +.It Cm pps +Show statistics in packets per second instead of bytes/bits per second. +A subsequent call of +.Ic pps +switches this mode off. +.It Cm match Op Ar patterns +Display only interfaces that match pattern provided as an argument. +Patterns should be in shell syntax separated by whitespaces or commas. +If this command is called without arguments then all interfaces are displayed. +For example: +.Pp +.Dl match em0, bge1 +.Pp +This will display em0 and bge1 interfaces. +.Pp +.Dl match em*, bge*, lo0 +.Pp +This will display all +.Ic em +interfaces, all +.Ic bge +interfaces and the loopback interface. .El .El .Pp From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 14:19:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE257799; Wed, 20 Feb 2013 14:19:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 88B36738; Wed, 20 Feb 2013 14:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KEJAKY001163; Wed, 20 Feb 2013 14:19:10 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KEJ9jO001159; Wed, 20 Feb 2013 14:19:09 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201302201419.r1KEJ9jO001159@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 20 Feb 2013 14:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247037 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 14:19:10 -0000 Author: melifaro Date: Wed Feb 20 14:19:09 2013 New Revision: 247037 URL: http://svnweb.freebsd.org/changeset/base/247037 Log: Fix several new & old style issues. Pointed by: ae, pluknet, zont MFC with: r247036 Modified: head/usr.bin/systat/ifcmds.c head/usr.bin/systat/ifstat.c head/usr.bin/systat/systat.1 Modified: head/usr.bin/systat/ifcmds.c ============================================================================== --- head/usr.bin/systat/ifcmds.c Wed Feb 20 13:47:05 2013 (r247036) +++ head/usr.bin/systat/ifcmds.c Wed Feb 20 14:19:09 2013 (r247037) @@ -59,16 +59,14 @@ ifcmd(const char *cmd, const char *args) } else if (prefix(cmd, "match")) { if (args != NULL && *args != '\0' && memcmp(args, "*", 2) != 0) { /* We got a valid match line */ - if (matchline != NULL) { + if (matchline != NULL) free(matchline); - } needsort = 1; matchline = strdup(args); } else { /* Empty or * pattern, turn filtering off */ - if (matchline != NULL) { + if (matchline != NULL) free(matchline); - } needsort = 1; matchline = NULL; } Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Wed Feb 20 13:47:05 2013 (r247036) +++ head/usr.bin/systat/ifstat.c Wed Feb 20 14:19:09 2013 (r247037) @@ -230,7 +230,7 @@ initifstat(void) n = getifnum(); if (n <= 0) - return -1; + return (-1); SLIST_INIT(&curlist); @@ -254,7 +254,7 @@ initifstat(void) sort_interface_list(); - return 1; + return (1); } void @@ -372,9 +372,9 @@ check_match(const char *ifname) char *p = matchline, *c, t; int match = 0, mlen; - if (matchline == NULL) { - return 0; - } + if (matchline == NULL) + return (0); + /* Strip leading whitespaces */ while (*p == ' ') p ++; @@ -387,7 +387,7 @@ check_match(const char *ifname) *p = '\0'; if (fnmatch(c, ifname, FNM_CASEFOLD) == 0) { *p = t; - return 1; + return (1); } *p = t; c = p + strspn(p, " ;,"); @@ -397,7 +397,7 @@ check_match(const char *ifname) } } - return match; + return (match); } /* @@ -447,7 +447,7 @@ getifnum(void) if (sysctl(name, 5, (void *)&data, (size_t *)&datalen, (void *)NULL, (size_t)0) != 0) IFSTAT_ERR(1, "sysctl error"); - return data; + return (data); } static void @@ -485,5 +485,5 @@ cmdifstat(const char *cmd, const char *a } } - return retval; + return (retval); } Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Wed Feb 20 13:47:05 2013 (r247036) +++ head/usr.bin/systat/systat.1 Wed Feb 20 14:19:09 2013 (r247037) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd September 17, 2012 +.Dd February 20, 2013 .Dt SYSTAT 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:18:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6FA1AEB3; Wed, 20 Feb 2013 15:18:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53875A7A; Wed, 20 Feb 2013 15:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KFIh0j019272; Wed, 20 Feb 2013 15:18:43 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KFIhNa019268; Wed, 20 Feb 2013 15:18:43 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302201518.r1KFIhNa019268@svn.freebsd.org> From: Brooks Davis Date: Wed, 20 Feb 2013 15:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247041 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 15:18:44 -0000 Author: brooks Date: Wed Feb 20 15:18:42 2013 New Revision: 247041 URL: http://svnweb.freebsd.org/changeset/base/247041 Log: Add a -D flag that causes duplicate entries in an mtree manifest to be treated as warnings rather than errors. Reviewed by: marcel Sponsored by: DARPA, AFRL Modified: head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Wed Feb 20 14:26:51 2013 (r247040) +++ head/usr.sbin/makefs/makefs.8 Wed Feb 20 15:18:42 2013 (r247041) @@ -43,7 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm -.Op Fl px +.Op Fl Dpx .Op Fl B Ar byte-order .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask @@ -106,6 +106,8 @@ An optional suffix may be provided to indicate that .Ar free-blocks indicates a percentage of the calculated image size. +.It Fl D +Treat duplicate paths in an mtree manifest as warnings not error. .It Fl d Ar debug-mask Enable various levels of debugging, depending upon which bits are set in Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Feb 20 14:26:51 2013 (r247040) +++ head/usr.sbin/makefs/makefs.c Wed Feb 20 15:18:42 2013 (r247041) @@ -73,6 +73,7 @@ static fstype_t fstypes[] = { }; u_int debug; +int dupsok; struct timespec start_time; static fstype_t *get_fstype(const char *); @@ -112,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:ps:S:t:x")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:x")) != -1) { switch (ch) { case 'B': @@ -148,6 +149,10 @@ main(int argc, char *argv[]) } break; + case 'D': + dupsok = 1; + break; + case 'd': debug = strtoll(optarg, NULL, 0); break; Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Wed Feb 20 14:26:51 2013 (r247040) +++ head/usr.sbin/makefs/makefs.h Wed Feb 20 15:18:42 2013 (r247041) @@ -169,6 +169,7 @@ void cd9660_makefs(const char *, const extern u_int debug; +extern int dupsok; extern struct timespec start_time; /* Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Feb 20 14:26:51 2013 (r247040) +++ head/usr.sbin/makefs/mtree.c Wed Feb 20 15:18:42 2013 (r247041) @@ -881,8 +881,14 @@ read_mtree_spec1(FILE *fp, bool def, con if (strcmp(name, node->name) == 0) { if (def == true) { - mtree_error("duplicate definition of %s", - name); + if (!dupsok) + mtree_error( + "duplicate definition of %s", + name); + else + mtree_warning( + "duplicate definition of %s", + name); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:25:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4BAB1A3; Wed, 20 Feb 2013 15:25:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDBE8AD6; Wed, 20 Feb 2013 15:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KFPf20021837; Wed, 20 Feb 2013 15:25:41 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KFPfR2021835; Wed, 20 Feb 2013 15:25:41 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302201525.r1KFPfR2021835@svn.freebsd.org> From: Brooks Davis Date: Wed, 20 Feb 2013 15:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247042 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 15:25:42 -0000 Author: brooks Date: Wed Feb 20 15:25:40 2013 New Revision: 247042 URL: http://svnweb.freebsd.org/changeset/base/247042 Log: Fix the -N option in manifest mode by using pwcache(3). This also speeds up image creation appreciably. Reviewed by: marcel Sponsored by: DARPA, AFRL Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Feb 20 15:18:42 2013 (r247041) +++ head/usr.sbin/makefs/mtree.c Wed Feb 20 15:25:40 2013 (r247042) @@ -508,8 +508,8 @@ read_mtree_keywords(FILE *fp, fsnode *no { char keyword[PATH_MAX]; char *name, *p, *value; - struct group *grent; - struct passwd *pwent; + gid_t gid; + uid_t uid; struct stat *st, sb; intmax_t num; u_long flset, flclr; @@ -585,11 +585,10 @@ read_mtree_keywords(FILE *fp, fsnode *no error = ENOATTR; break; } - grent = getgrnam(value); - if (grent != NULL) - st->st_gid = grent->gr_gid; + if (gid_from_group(value, &gid) == 0) + st->st_gid = gid; else - error = errno; + error = EINVAL; } else error = ENOSYS; break; @@ -698,11 +697,10 @@ read_mtree_keywords(FILE *fp, fsnode *no error = ENOATTR; break; } - pwent = getpwnam(value); - if (pwent != NULL) - st->st_uid = pwent->pw_uid; + if (uid_from_user(value, &uid) == 0) + st->st_uid = uid; else - error = errno; + error = EINVAL; } else error = ENOSYS; break; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:28:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4D85537B; Wed, 20 Feb 2013 15:28:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F30BAFF; Wed, 20 Feb 2013 15:28:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KFSfiF022277; Wed, 20 Feb 2013 15:28:41 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KFSfLd022276; Wed, 20 Feb 2013 15:28:41 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302201528.r1KFSfLd022276@svn.freebsd.org> From: Brooks Davis Date: Wed, 20 Feb 2013 15:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247043 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 15:28:41 -0000 Author: brooks Date: Wed Feb 20 15:28:40 2013 New Revision: 247043 URL: http://svnweb.freebsd.org/changeset/base/247043 Log: Allow '.' components in manifest paths. They are always the first component of mtree -C and install -M output and are easily skipped. Reviewed by: marcel Sponsored by: DARPA, AFRL Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Feb 20 15:25:40 2013 (r247042) +++ head/usr.sbin/makefs/mtree.c Wed Feb 20 15:28:40 2013 (r247043) @@ -974,15 +974,15 @@ read_mtree_spec(FILE *fp) do { *cp++ = '\0'; - /* Disallow '.' and '..' as components. */ - if (IS_DOT(pathspec) || IS_DOTDOT(pathspec)) { - mtree_error("absolute path cannot contain . " - "or .. components"); + /* Disallow '..' as a component. */ + if (IS_DOTDOT(pathspec)) { + mtree_error("absolute path cannot contain " + ".. component"); goto out; } - /* Ignore multiple adjacent slashes. */ - if (pathspec[0] != '\0') + /* Ignore multiple adjacent slashes and '.'. */ + if (pathspec[0] != '\0' && !IS_DOT(pathspec)) error = read_mtree_spec1(fp, false, pathspec); memmove(pathspec, cp, strlen(cp) + 1); cp = strchr(pathspec, '/'); From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:44:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9241ADF0; Wed, 20 Feb 2013 15:44:41 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85731D19; Wed, 20 Feb 2013 15:44:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KFifnk027604; Wed, 20 Feb 2013 15:44:41 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KFifaZ027603; Wed, 20 Feb 2013 15:44:41 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302201544.r1KFifaZ027603@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 20 Feb 2013 15:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247044 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 15:44:41 -0000 Author: pluknet Date: Wed Feb 20 15:44:40 2013 New Revision: 247044 URL: http://svnweb.freebsd.org/changeset/base/247044 Log: ip_savecontrol() style fixes. No functional changes. - fix indentation - put the operator at the end of the line for long statements - remove spaces between the type and the variable in a cast - remove excessive parentheses Tested by: md5 Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Feb 20 15:28:40 2013 (r247043) +++ head/sys/netinet/ip_input.c Wed Feb 20 15:44:40 2013 (r247044) @@ -1592,8 +1592,8 @@ ip_savecontrol(struct inpcb *inp, struct bintime(&bt); if (inp->inp_socket->so_options & SO_BINTIME) { - *mp = sbcreatecontrol((caddr_t) &bt, sizeof(bt), - SCM_BINTIME, SOL_SOCKET); + *mp = sbcreatecontrol((caddr_t)&bt, sizeof(bt), + SCM_BINTIME, SOL_SOCKET); if (*mp) mp = &(*mp)->m_next; } @@ -1601,20 +1601,20 @@ ip_savecontrol(struct inpcb *inp, struct struct timeval tv; bintime2timeval(&bt, &tv); - *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv), - SCM_TIMESTAMP, SOL_SOCKET); + *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv), + SCM_TIMESTAMP, SOL_SOCKET); if (*mp) mp = &(*mp)->m_next; } } if (inp->inp_flags & INP_RECVDSTADDR) { - *mp = sbcreatecontrol((caddr_t) &ip->ip_dst, + *mp = sbcreatecontrol((caddr_t)&ip->ip_dst, sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; } if (inp->inp_flags & INP_RECVTTL) { - *mp = sbcreatecontrol((caddr_t) &ip->ip_ttl, + *mp = sbcreatecontrol((caddr_t)&ip->ip_ttl, sizeof(u_char), IP_RECVTTL, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; @@ -1626,14 +1626,14 @@ ip_savecontrol(struct inpcb *inp, struct */ /* options were tossed already */ if (inp->inp_flags & INP_RECVOPTS) { - *mp = sbcreatecontrol((caddr_t) opts_deleted_above, + *mp = sbcreatecontrol((caddr_t)opts_deleted_above, sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; } /* ip_srcroute doesn't do what we want here, need to fix */ if (inp->inp_flags & INP_RECVRETOPTS) { - *mp = sbcreatecontrol((caddr_t) ip_srcroute(m), + *mp = sbcreatecontrol((caddr_t)ip_srcroute(m), sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; @@ -1648,32 +1648,32 @@ ip_savecontrol(struct inpcb *inp, struct struct sockaddr_dl *sdp; struct sockaddr_dl *sdl2 = &sdlbuf.sdl; - if (((ifp = m->m_pkthdr.rcvif)) - && ( ifp->if_index && (ifp->if_index <= V_if_index))) { + if ((ifp = m->m_pkthdr.rcvif) && + ifp->if_index && ifp->if_index <= V_if_index) { sdp = (struct sockaddr_dl *)ifp->if_addr->ifa_addr; /* * Change our mind and don't try copy. */ - if ((sdp->sdl_family != AF_LINK) - || (sdp->sdl_len > sizeof(sdlbuf))) { + if (sdp->sdl_family != AF_LINK || + sdp->sdl_len > sizeof(sdlbuf)) { goto makedummy; } bcopy(sdp, sdl2, sdp->sdl_len); } else { makedummy: - sdl2->sdl_len - = offsetof(struct sockaddr_dl, sdl_data[0]); + sdl2->sdl_len = + offsetof(struct sockaddr_dl, sdl_data[0]); sdl2->sdl_family = AF_LINK; sdl2->sdl_index = 0; sdl2->sdl_nlen = sdl2->sdl_alen = sdl2->sdl_slen = 0; } - *mp = sbcreatecontrol((caddr_t) sdl2, sdl2->sdl_len, - IP_RECVIF, IPPROTO_IP); + *mp = sbcreatecontrol((caddr_t)sdl2, sdl2->sdl_len, + IP_RECVIF, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; } if (inp->inp_flags & INP_RECVTOS) { - *mp = sbcreatecontrol((caddr_t) &ip->ip_tos, + *mp = sbcreatecontrol((caddr_t)&ip->ip_tos, sizeof(u_char), IP_RECVTOS, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 15:49:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5364DB5; Wed, 20 Feb 2013 15:49:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 32CF7D76; Wed, 20 Feb 2013 15:49:08 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 501A6B95B; Wed, 20 Feb 2013 10:49:07 -0500 (EST) From: John Baldwin To: "John-Mark Gurney" Subject: Re: svn commit: r247012 - in head/contrib/binutils: gas/config opcodes Date: Wed, 20 Feb 2013 08:09:23 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201302192135.r1JLZH27096984@svn.freebsd.org> In-Reply-To: <201302192135.r1JLZH27096984@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302200809.23854.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Feb 2013 10:49:07 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 15:49:08 -0000 On Tuesday, February 19, 2013 4:35:17 pm John-Mark Gurney wrote: > Author: jmg > Date: Tue Feb 19 21:35:17 2013 > New Revision: 247012 > URL: http://svnweb.freebsd.org/changeset/base/247012 > > Log: > add support for AES and PCLMULQDQ instructions to binutils... > > Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though > OpenBSD's gcc is very different that it only helped w/ where to modify, > not how... Thanks to jhb for some early reviews... > > Reviewed by: imp, kib > MFC after: 1 month Nice! Sorry I wasn't able to review this in more detail. :( Can you also add support for these instructions to ddb's disassembler? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 16:32:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E74E5390; Wed, 20 Feb 2013 16:32:38 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7FA6FD5; Wed, 20 Feb 2013 16:32:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KGWcQs043525; Wed, 20 Feb 2013 16:32:38 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KGWcqe043524; Wed, 20 Feb 2013 16:32:38 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302201632.r1KGWcqe043524@svn.freebsd.org> From: Tim Kientzle Date: Wed, 20 Feb 2013 16:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247045 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 16:32:39 -0000 Author: kientzle Date: Wed Feb 20 16:32:38 2013 New Revision: 247045 URL: http://svnweb.freebsd.org/changeset/base/247045 Log: Fix "fdt addr" to accept literal addresses rather than va offsets. When initializing the fdt, query U-Boot as well. With this change, it is now feasible to have U-Boot load the FDT, ubldr will pull it from U-Boot and hand it to the kernel. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Wed Feb 20 15:44:40 2013 (r247044) +++ head/sys/boot/fdt/fdt_loader_cmd.c Wed Feb 20 16:32:38 2013 (r247045) @@ -235,26 +235,47 @@ fdt_load_dtb(vm_offset_t va) } static int -fdt_setup_fdtp() +fdt_load_dtb_addr(struct fdt_header *header) { struct preloaded_file *bfp; - vm_offset_t va; - bfp = file_findfile(NULL, "dtb"); + bfp = mem_load_raw("dtb", "memory.dtb", header, fdt_totalsize(header)); if (bfp == NULL) { - if ((va = fdt_find_static_dtb()) == 0) { - command_errmsg = "no device tree blob found!"; - return (1); - } - } else { - /* Dynamic blob has precedence over static. */ - va = bfp->f_addr; + command_errmsg = "unable to copy DTB into module directory"; + return (1); } + return fdt_load_dtb(bfp->f_addr); +} - if (fdt_load_dtb(va) != 0) - return (1); - - return (0); +static int +fdt_setup_fdtp() +{ + struct preloaded_file *bfp; + struct fdt_header *hdr; + const char *s, *p; + vm_offset_t va; + + if ((bfp = file_findfile(NULL, "dtb")) != NULL) { + printf("Using DTB from loaded file.\n"); + return fdt_load_dtb(bfp->f_addr); + } + + s = ub_env_get("fdtaddr"); + if (s != NULL && *s != '\0') { + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p == '\0') { + printf("Using DTB provided by U-Boot.\n"); + return fdt_load_dtb_addr(hdr); + } + } + + if ((va = fdt_find_static_dtb()) != 0) { + printf("Using DTB compiled into kernel.\n"); + return (fdt_load_dtb(va)); + } + + command_errmsg = "no device tree blob found!"; + return (1); } #define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ @@ -789,8 +810,8 @@ command_fdt_internal(int argc, char *arg static int fdt_cmd_addr(int argc, char *argv[]) { - vm_offset_t va; - char *addr, *cp; + struct fdt_header *hdr; + const char *addr, *cp; if (argc > 2) addr = argv[2]; @@ -799,13 +820,13 @@ fdt_cmd_addr(int argc, char *argv[]) return (CMD_ERROR); } - va = strtol(addr, &cp, 0); + hdr = (struct fdt_header *)strtoul(addr, &cp, 0); if (cp == addr) { sprintf(command_errbuf, "Invalid address: %s", addr); return (CMD_ERROR); } - if (fdt_load_dtb(va) != 0) + if (fdt_load_dtb_addr(hdr) != 0) return (CMD_ERROR); return (CMD_OK); @@ -1484,6 +1505,7 @@ fdt_cmd_mkprop(int argc, char *argv[]) if (fdt_modprop(o, propname, value, 1)) return (CMD_ERROR); + COPYIN(fdtp, fdtp_va, fdtp_size); return (CMD_OK); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 16:48:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7EE7C94F; Wed, 20 Feb 2013 16:48:55 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 704C2154; Wed, 20 Feb 2013 16:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KGmtfj047317; Wed, 20 Feb 2013 16:48:55 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KGmqZr047301; Wed, 20 Feb 2013 16:48:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201302201648.r1KGmqZr047301@svn.freebsd.org> From: Alan Cox Date: Wed, 20 Feb 2013 16:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247046 - in head/sys/arm: arm at91 econa include s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 16:48:55 -0000 Author: alc Date: Wed Feb 20 16:48:52 2013 New Revision: 247046 URL: http://svnweb.freebsd.org/changeset/base/247046 Log: Initialize vm_max_kernel_address on non-FDT platforms. (This should have been included in r246926.) The second parameter to pmap_bootstrap() is redundant. Eliminate it. Reviewed by: andrew Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/pmap.h head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/arm/machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -1476,7 +1476,7 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, vm_max_kernel_address, &kernel_l1pt); + pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/arm/pmap-v6.c Wed Feb 20 16:48:52 2013 (r247046) @@ -1538,7 +1538,7 @@ pmap_alloc_specials(vm_offset_t *availp, #define PMAP_STATIC_L2_SIZE 16 void -pmap_bootstrap(vm_offset_t firstaddr, vm_offset_t lastaddr, struct pv_addr *l1pt) +pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt) { static struct l1_ttable static_l1; static struct l2_dtable static_l2[PMAP_STATIC_L2_SIZE]; @@ -1554,7 +1554,7 @@ pmap_bootstrap(vm_offset_t firstaddr, vm int l1idx, l2idx, l2next = 0; PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n", - firstaddr, lastaddr)); + firstaddr, vm_max_kernel_address)); virtual_avail = firstaddr; kernel_pmap->pm_l1 = l1; @@ -1670,7 +1670,8 @@ pmap_bootstrap(vm_offset_t firstaddr, vm pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)csrc_pte); pmap_alloc_specials(&virtual_avail, 1, &cdstp, &cdst_pte); pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)cdst_pte); - size = ((lastaddr - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE; + size = ((vm_max_kernel_address - pmap_curmaxkvaddr) + L1_S_OFFSET) / + L1_S_SIZE; pmap_alloc_specials(&virtual_avail, round_page(size * L2_TABLE_SIZE_REAL) / PAGE_SIZE, &pmap_kernel_l2ptp_kva, NULL); @@ -1692,9 +1693,9 @@ pmap_bootstrap(vm_offset_t firstaddr, vm cpu_l2cache_wbinv_all(); virtual_avail = round_page(virtual_avail); - virtual_end = lastaddr; + virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = lastaddr; + arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/arm/pmap.c Wed Feb 20 16:48:52 2013 (r247046) @@ -2254,7 +2254,7 @@ extern struct mtx smallalloc_mtx; #endif void -pmap_bootstrap(vm_offset_t firstaddr, vm_offset_t lastaddr, struct pv_addr *l1pt) +pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt) { static struct l1_ttable static_l1; static struct l2_dtable static_l2[PMAP_STATIC_L2_SIZE]; @@ -2270,7 +2270,7 @@ pmap_bootstrap(vm_offset_t firstaddr, vm int l1idx, l2idx, l2next = 0; PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n", - firstaddr, lastaddr)); + firstaddr, vm_max_kernel_address)); virtual_avail = firstaddr; kernel_pmap->pm_l1 = l1; @@ -2388,7 +2388,8 @@ pmap_bootstrap(vm_offset_t firstaddr, vm pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)csrc_pte); pmap_alloc_specials(&virtual_avail, 1, &cdstp, &cdst_pte); pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)cdst_pte); - size = ((lastaddr - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE; + size = ((vm_max_kernel_address - pmap_curmaxkvaddr) + L1_S_OFFSET) / + L1_S_SIZE; pmap_alloc_specials(&virtual_avail, round_page(size * L2_TABLE_SIZE_REAL) / PAGE_SIZE, &pmap_kernel_l2ptp_kva, NULL); @@ -2410,9 +2411,9 @@ pmap_bootstrap(vm_offset_t firstaddr, vm cpu_l2cache_wbinv_all(); virtual_avail = round_page(virtual_avail); - virtual_end = lastaddr; + virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = lastaddr; + arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); #ifdef ARM_USE_SMALL_ALLOC Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/at91/at91_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -624,7 +624,8 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); arm_dump_avail_init(memsize, sizeof(dump_avail)/sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, KERNVIRTADDR + 3 * memsize, &kernel_l1pt); + vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; + pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/econa/econa_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -324,7 +324,8 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, KERNVIRTADDR + 3 * memsize, &kernel_l1pt); + vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; + pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/include/pmap.h Wed Feb 20 16:48:52 2013 (r247046) @@ -222,7 +222,7 @@ extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -void pmap_bootstrap(vm_offset_t, vm_offset_t, struct pv_addr *); +void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt); int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa); Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -386,7 +386,8 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, KERNVIRTADDR + 3 * memsize, &kernel_l1pt); + vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; + pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/sa11x0/assabet_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -381,7 +381,8 @@ initarm(struct arm_boot_params *abp) dump_avail[3] = phys_avail[3] = 0; mutex_init(); - pmap_bootstrap(freemempos, 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(freemempos, &kernel_l1pt); init_param2(physmem); kdb_init(); Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -368,8 +368,8 @@ initarm(struct arm_boot_params *abp) dump_avail[2] = 0; dump_avail[3] = 0; - pmap_bootstrap(pmap_curmaxkvaddr, - 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -369,8 +369,8 @@ initarm(struct arm_boot_params *abp) dump_avail[2] = 0; dump_avail[3] = 0; - pmap_bootstrap(pmap_curmaxkvaddr, - 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -347,8 +347,8 @@ initarm(struct arm_boot_params *abp) dump_avail[2] = 0; dump_avail[3] = 0; - pmap_bootstrap(pmap_curmaxkvaddr, - 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -432,7 +432,8 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = afterkern + PAGE_SIZE; arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Wed Feb 20 16:32:38 2013 (r247045) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Wed Feb 20 16:48:52 2013 (r247046) @@ -365,7 +365,8 @@ initarm(struct arm_boot_params *abp) } dump_avail[i] = 0; dump_avail[i] = 0; - pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); + vm_max_kernel_address = 0xd0000000; + pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 17:39:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18C56115; Wed, 20 Feb 2013 17:39:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1E4B6CA; Wed, 20 Feb 2013 17:39:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KHdsjn062975; Wed, 20 Feb 2013 17:39:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KHdqVM062956; Wed, 20 Feb 2013 17:39:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302201739.r1KHdqVM062956@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 20 Feb 2013 17:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247047 - in head/sys: amd64/include boot/userboot/userboot i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 17:39:55 -0000 Author: kib Date: Wed Feb 20 17:39:52 2013 New Revision: 247047 URL: http://svnweb.freebsd.org/changeset/base/247047 Log: Convert machine/elf.h, machine/frame.h, machine/sigframe.h, machine/signal.h and machine/ucontext.h into common x86 includes, copying from amd64 and merging with i386. Kernel-only compat definitions are kept in the i386/include/sigframe.h and i386/include/signal.h, to reduce amd64 kernel namespace pollution. The amd64 compat uses its own definitions so far. The _MACHINE_ELF_WANT_32BIT definition is to allow the sys/boot/userboot/userboot/elf32_freebsd.c to use i386 ELF definitions on the amd64 compile host. The same hack could be usefully abused by other code too. Added: head/sys/x86/include/elf.h - copied, changed from r247045, head/sys/amd64/include/elf.h head/sys/x86/include/frame.h - copied, changed from r247045, head/sys/amd64/include/frame.h head/sys/x86/include/sigframe.h - copied, changed from r247045, head/sys/amd64/include/sigframe.h head/sys/x86/include/signal.h - copied, changed from r247045, head/sys/amd64/include/signal.h head/sys/x86/include/ucontext.h - copied, changed from r247045, head/sys/amd64/include/ucontext.h Modified: head/sys/amd64/include/elf.h head/sys/amd64/include/frame.h head/sys/amd64/include/sigframe.h head/sys/amd64/include/signal.h head/sys/amd64/include/ucontext.h head/sys/boot/userboot/userboot/elf32_freebsd.c head/sys/i386/include/elf.h head/sys/i386/include/frame.h head/sys/i386/include/sigframe.h head/sys/i386/include/signal.h head/sys/i386/include/ucontext.h Modified: head/sys/amd64/include/elf.h ============================================================================== --- head/sys/amd64/include/elf.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/amd64/include/elf.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,124 +1,6 @@ /*- - * Copyright (c) 1996-1997 John D. Polstra. - * 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_ELF_H_ -#define _MACHINE_ELF_H_ 1 - -/* - * ELF definitions for the AMD64 architecture. - */ - - -#ifndef __ELF_WORD_SIZE -#define __ELF_WORD_SIZE 64 /* Used by */ -#endif -#include /* Definitions common to all 32 bit architectures. */ -#include /* Definitions common to all 64 bit architectures. */ -#include - -#define ELF_ARCH EM_X86_64 -#define ELF_ARCH32 EM_386 - -#define ELF_MACHINE_OK(x) ((x) == EM_X86_64) - -/* - * Auxiliary vector entries for passing information to the interpreter. - * - * The i386 supplement to the SVR4 ABI specification names this "auxv_t", - * but POSIX lays claim to all symbols ending with "_t". - */ -typedef struct { /* Auxiliary vector entry on initial stack */ - int a_type; /* Entry type. */ - union { - int a_val; /* Integer value. */ - } a_un; -} Elf32_Auxinfo; - - -typedef struct { /* Auxiliary vector entry on initial stack */ - long a_type; /* Entry type. */ - union { - long a_val; /* Integer value. */ - void *a_ptr; /* Address. */ - void (*a_fcn)(void); /* Function pointer (not used). */ - } a_un; -} Elf64_Auxinfo; - -__ElfType(Auxinfo); - -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ - -#define AT_COUNT 24 /* Count of defined aux entry types. */ - -/* - * Relocation types. - */ - -#define R_X86_64_COUNT 24 /* Count of defined relocation types. */ - -/* Define "machine" characteristics */ -#if __ELF_WORD_SIZE == 32 -#define ELF_TARG_CLASS ELFCLASS32 -#else -#define ELF_TARG_CLASS ELFCLASS64 -#endif -#define ELF_TARG_DATA ELFDATA2LSB -#define ELF_TARG_MACH EM_X86_64 -#define ELF_TARG_VER 1 - -#if __ELF_WORD_SIZE == 32 -#define ET_DYN_LOAD_ADDR 0x01001000 -#else -#define ET_DYN_LOAD_ADDR 0x01021000 -#endif - -#endif /* !_MACHINE_ELF_H_ */ +#include Modified: head/sys/amd64/include/frame.h ============================================================================== --- head/sys/amd64/include/frame.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/amd64/include/frame.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,87 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm. - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_FRAME_H_ -#define _MACHINE_FRAME_H_ 1 - -/* - * System stack frames. - */ - -/* - * Exception/Trap Stack Frame - * - * The ordering of this is specifically so that we can take first 6 - * the syscall arguments directly from the beginning of the frame. - */ - -struct trapframe { - register_t tf_rdi; - register_t tf_rsi; - register_t tf_rdx; - register_t tf_rcx; - register_t tf_r8; - register_t tf_r9; - register_t tf_rax; - register_t tf_rbx; - register_t tf_rbp; - register_t tf_r10; - register_t tf_r11; - register_t tf_r12; - register_t tf_r13; - register_t tf_r14; - register_t tf_r15; - uint32_t tf_trapno; - uint16_t tf_fs; - uint16_t tf_gs; - register_t tf_addr; - uint32_t tf_flags; - uint16_t tf_es; - uint16_t tf_ds; - /* below portion defined in hardware */ - register_t tf_err; - register_t tf_rip; - register_t tf_cs; - register_t tf_rflags; - register_t tf_rsp; - register_t tf_ss; -}; - -#define TF_HASSEGS 0x1 -#define TF_HASBASES 0x2 -#define TF_HASFPXSTATE 0x4 - -#endif /* _MACHINE_FRAME_H_ */ +#include Modified: head/sys/amd64/include/sigframe.h ============================================================================== --- head/sys/amd64/include/sigframe.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/amd64/include/sigframe.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,46 +1,6 @@ /*- - * Copyright (c) 1999 Marcel Moolenaar - * 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 - * in this position and unchanged. - * 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. 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. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SIGFRAME_H_ -#define _MACHINE_SIGFRAME_H_ - -/* - * Signal frames, arguments passed to application signal handlers. - */ -struct sigframe { - union { - __siginfohandler_t *sf_action; - __sighandler_t *sf_handler; - } sf_ahu; - ucontext_t sf_uc; /* = *sf_ucontext */ - siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ -}; - -#endif /* !_MACHINE_SIGFRAME_H_ */ +#include Modified: head/sys/amd64/include/signal.h ============================================================================== --- head/sys/amd64/include/signal.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/amd64/include/signal.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,109 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm. - * Copyright (c) 1986, 1989, 1991, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * @(#)signal.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SIGNAL_H_ -#define _MACHINE_SIGNAL_H_ - -#include -#include - -/* - * Machine-dependent signal definitions - */ - -typedef long sig_atomic_t; - -#if __BSD_VISIBLE -#include /* codes for SIGILL, SIGFPE */ - -/* - * Information pushed on stack when a signal is delivered. - * This is used by the kernel to restore state following - * execution of the signal handler. It is also made available - * to the handler to allow it to restore state properly if - * a non-standard exit is performed. - * - * The sequence of the fields/registers after sc_mask in struct - * sigcontext must match those in mcontext_t and struct trapframe. - */ -struct sigcontext { - struct __sigset sc_mask; /* signal mask to restore */ - long sc_onstack; /* sigstack state to restore */ - long sc_rdi; /* machine state (struct trapframe) */ - long sc_rsi; - long sc_rdx; - long sc_rcx; - long sc_r8; - long sc_r9; - long sc_rax; - long sc_rbx; - long sc_rbp; - long sc_r10; - long sc_r11; - long sc_r12; - long sc_r13; - long sc_r14; - long sc_r15; - int sc_trapno; - short sc_fs; - short sc_gs; - long sc_addr; - int sc_flags; - short sc_es; - short sc_ds; - long sc_err; - long sc_rip; - long sc_cs; - long sc_rflags; - long sc_rsp; - long sc_ss; - long sc_len; /* sizeof(mcontext_t) */ - /* - * See and for the following - * fields. - */ - long sc_fpformat; - long sc_ownedfp; - long sc_fpstate[64] __aligned(16); - - long sc_fsbase; - long sc_gsbase; - - long sc_xfpustate; - long sc_xfpustate_len; - - long sc_spare[4]; -}; -#endif /* __BSD_VISIBLE */ - -#endif /* !_MACHINE_SIGNAL_H_ */ +#include Modified: head/sys/amd64/include/ucontext.h ============================================================================== --- head/sys/amd64/include/ucontext.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/amd64/include/ucontext.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,103 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm - * Copyright (c) 1999 Marcel Moolenaar - * 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 - * in this position and unchanged. - * 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. 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. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_UCONTEXT_H_ -#define _MACHINE_UCONTEXT_H_ - -/* - * mc_trapno bits. Shall be in sync with TF_XXX. - */ -#define _MC_HASSEGS 0x1 -#define _MC_HASBASES 0x2 -#define _MC_HASFPXSTATE 0x4 -#define _MC_FLAG_MASK (_MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE) - -typedef struct __mcontext { - /* - * The definition of mcontext_t must match the layout of - * struct sigcontext after the sc_mask member. This is so - * that we can support sigcontext and ucontext_t at the same - * time. - */ - __register_t mc_onstack; /* XXX - sigcontext compat. */ - __register_t mc_rdi; /* machine state (struct trapframe) */ - __register_t mc_rsi; - __register_t mc_rdx; - __register_t mc_rcx; - __register_t mc_r8; - __register_t mc_r9; - __register_t mc_rax; - __register_t mc_rbx; - __register_t mc_rbp; - __register_t mc_r10; - __register_t mc_r11; - __register_t mc_r12; - __register_t mc_r13; - __register_t mc_r14; - __register_t mc_r15; - __uint32_t mc_trapno; - __uint16_t mc_fs; - __uint16_t mc_gs; - __register_t mc_addr; - __uint32_t mc_flags; - __uint16_t mc_es; - __uint16_t mc_ds; - __register_t mc_err; - __register_t mc_rip; - __register_t mc_cs; - __register_t mc_rflags; - __register_t mc_rsp; - __register_t mc_ss; - - long mc_len; /* sizeof(mcontext_t) */ - -#define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ -#define _MC_FPFMT_XMM 0x10002 - long mc_fpformat; -#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ -#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ -#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ - long mc_ownedfp; - /* - * See for the internals of mc_fpstate[]. - */ - long mc_fpstate[64] __aligned(16); - - __register_t mc_fsbase; - __register_t mc_gsbase; - - __register_t mc_xfpustate; - __register_t mc_xfpustate_len; - - long mc_spare[4]; -} mcontext_t; - -#endif /* !_MACHINE_UCONTEXT_H_ */ +#include Modified: head/sys/boot/userboot/userboot/elf32_freebsd.c ============================================================================== --- head/sys/boot/userboot/userboot/elf32_freebsd.c Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/boot/userboot/userboot/elf32_freebsd.c Wed Feb 20 17:39:52 2013 (r247047) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _MACHINE_ELF_WANT_32BIT #include #include #include Modified: head/sys/i386/include/elf.h ============================================================================== --- head/sys/i386/include/elf.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/i386/include/elf.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,118 +1,6 @@ /*- - * Copyright (c) 1996-1997 John D. Polstra. - * 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_ELF_H_ -#define _MACHINE_ELF_H_ 1 - -/* - * ELF definitions for the i386 architecture. - */ - -#include /* Definitions common to all 32 bit architectures. */ -#if defined(__ELF_WORD_SIZE) && __ELF_WORD_SIZE == 64 -#include /* Definitions common to all 64 bit architectures. */ -#endif - -#ifndef __ELF_WORD_SIZE -#define __ELF_WORD_SIZE 32 /* Used by */ -#endif - -#include - -#define ELF_ARCH EM_386 - -#define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486) - -/* - * Auxiliary vector entries for passing information to the interpreter. - * - * The i386 supplement to the SVR4 ABI specification names this "auxv_t", - * but POSIX lays claim to all symbols ending with "_t". - */ - -typedef struct { /* Auxiliary vector entry on initial stack */ - int a_type; /* Entry type. */ - union { - long a_val; /* Integer value. */ - void *a_ptr; /* Address. */ - void (*a_fcn)(void); /* Function pointer (not used). */ - } a_un; -} Elf32_Auxinfo; - -#if __ELF_WORD_SIZE == 64 -/* Fake for amd64 loader support */ -typedef struct { - int fake; -} Elf64_Auxinfo; -#endif - -__ElfType(Auxinfo); - -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP. */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ - -#define AT_COUNT 24 /* Count of defined aux entry types. */ - -/* - * Relocation types. - */ - -#define R_386_COUNT 38 /* Count of defined relocation types. */ - -/* Define "machine" characteristics */ -#define ELF_TARG_CLASS ELFCLASS32 -#define ELF_TARG_DATA ELFDATA2LSB -#define ELF_TARG_MACH EM_386 -#define ELF_TARG_VER 1 - -#define ET_DYN_LOAD_ADDR 0x01001000 - -#endif /* !_MACHINE_ELF_H_ */ +#include Modified: head/sys/i386/include/frame.h ============================================================================== --- head/sys/i386/include/frame.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/i386/include/frame.h Wed Feb 20 17:39:52 2013 (r247047) @@ -1,100 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_FRAME_H_ -#define _MACHINE_FRAME_H_ 1 - -/* - * System stack frames. - */ - -/* - * Exception/Trap Stack Frame - */ - -struct trapframe { - int tf_fs; - int tf_es; - int tf_ds; - int tf_edi; - int tf_esi; - int tf_ebp; - int tf_isp; - int tf_ebx; - int tf_edx; - int tf_ecx; - int tf_eax; - int tf_trapno; - /* below portion defined in 386 hardware */ - int tf_err; - int tf_eip; - int tf_cs; - int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ - int tf_esp; - int tf_ss; -}; - -/* Superset of trap frame, for traps from virtual-8086 mode */ - -struct trapframe_vm86 { - int tf_fs; - int tf_es; - int tf_ds; - int tf_edi; - int tf_esi; - int tf_ebp; - int tf_isp; - int tf_ebx; - int tf_edx; - int tf_ecx; - int tf_eax; - int tf_trapno; - /* below portion defined in 386 hardware */ - int tf_err; - int tf_eip; - int tf_cs; - int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ - int tf_esp; - int tf_ss; - /* below only when switching out of VM86 mode */ - int tf_vm86_es; - int tf_vm86_ds; - int tf_vm86_fs; - int tf_vm86_gs; -}; - -#endif /* _MACHINE_FRAME_H_ */ +#include Modified: head/sys/i386/include/sigframe.h ============================================================================== --- head/sys/i386/include/sigframe.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/i386/include/sigframe.h Wed Feb 20 17:39:52 2013 (r247047) @@ -89,25 +89,6 @@ struct sigframe4 { #endif #endif -struct sigframe { - /* - * The first four members may be used by applications. - * - * NOTE: The 4th argument is undocumented, ill commented - * on and seems to be somewhat BSD "standard". Handlers - * installed with sigvec may be using it. - */ - register_t sf_signum; - register_t sf_siginfo; /* code or pointer to sf_si */ - register_t sf_ucontext; /* points to sf_uc */ - register_t sf_addr; /* undocumented 4th arg */ - - union { - __siginfohandler_t *sf_action; - __sighandler_t *sf_handler; - } sf_ahu; - ucontext_t sf_uc; /* = *sf_ucontext */ - siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ -}; +#include #endif /* !_MACHINE_SIGFRAME_H_ */ Modified: head/sys/i386/include/signal.h ============================================================================== --- head/sys/i386/include/signal.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/i386/include/signal.h Wed Feb 20 17:39:52 2013 (r247047) @@ -33,25 +33,7 @@ #ifndef _MACHINE_SIGNAL_H_ #define _MACHINE_SIGNAL_H_ -#include -#include - -/* - * Machine-dependent signal definitions - */ - -typedef int sig_atomic_t; - -#if __BSD_VISIBLE -#include /* codes for SIGILL, SIGFPE */ - -/* - * Information pushed on stack when a signal is delivered. - * This is used by the kernel to restore state following - * execution of the signal handler. It is also made available - * to the handler to allow it to restore state properly if - * a non-standard exit is performed. - */ +#include #if defined(_KERNEL) && defined(COMPAT_43) /* @@ -82,57 +64,4 @@ struct osigcontext { }; #endif -/* - * The sequence of the fields/registers in struct sigcontext should match - * those in mcontext_t and struct trapframe. - */ -struct sigcontext { - struct __sigset sc_mask; /* signal mask to restore */ - int sc_onstack; /* sigstack state to restore */ - int sc_gs; /* machine state (struct trapframe) */ - int sc_fs; - int sc_es; - int sc_ds; - int sc_edi; - int sc_esi; - int sc_ebp; - int sc_isp; - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; - int sc_trapno; - int sc_err; - int sc_eip; - int sc_cs; - int sc_efl; - int sc_esp; - int sc_ss; - int sc_len; /* sizeof(mcontext_t) */ - /* - * See and for - * the following fields. - */ - int sc_fpformat; - int sc_ownedfp; - int sc_flags; - int sc_fpstate[128] __aligned(16); - - int sc_fsbase; - int sc_gsbase; - - int sc_xfpustate; - int sc_xfpustate_len; - - int sc_spare2[4]; -}; - -#define sc_sp sc_esp -#define sc_fp sc_ebp -#define sc_pc sc_eip -#define sc_ps sc_efl -#define sc_eflags sc_efl - -#endif /* __BSD_VISIBLE */ - #endif /* !_MACHINE_SIGNAL_H_ */ Modified: head/sys/i386/include/ucontext.h ============================================================================== --- head/sys/i386/include/ucontext.h Wed Feb 20 16:48:52 2013 (r247046) +++ head/sys/i386/include/ucontext.h Wed Feb 20 17:39:52 2013 (r247047) @@ -31,64 +31,6 @@ #ifndef _MACHINE_UCONTEXT_H_ #define _MACHINE_UCONTEXT_H_ -/* Keep _MC_* values similar to amd64 */ -#define _MC_HASSEGS 0x1 -#define _MC_HASBASES 0x2 -#define _MC_HASFPXSTATE 0x4 -#define _MC_FLAG_MASK (_MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE) - -typedef struct __mcontext { - /* - * The definition of mcontext_t must match the layout of - * struct sigcontext after the sc_mask member. This is so - * that we can support sigcontext and ucontext_t at the same - * time. - */ - __register_t mc_onstack; /* XXX - sigcontext compat. */ - __register_t mc_gs; /* machine state (struct trapframe) */ - __register_t mc_fs; - __register_t mc_es; - __register_t mc_ds; - __register_t mc_edi; - __register_t mc_esi; - __register_t mc_ebp; - __register_t mc_isp; - __register_t mc_ebx; - __register_t mc_edx; - __register_t mc_ecx; - __register_t mc_eax; - __register_t mc_trapno; - __register_t mc_err; - __register_t mc_eip; - __register_t mc_cs; - __register_t mc_eflags; - __register_t mc_esp; - __register_t mc_ss; - - int mc_len; /* sizeof(mcontext_t) */ -#define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ -#define _MC_FPFMT_387 0x10001 -#define _MC_FPFMT_XMM 0x10002 - int mc_fpformat; -#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ -#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ -#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ - int mc_ownedfp; - __register_t mc_flags; - /* - * See for the internals of mc_fpstate[]. - */ - int mc_fpstate[128] __aligned(16); - - __register_t mc_fsbase; - __register_t mc_gsbase; - - __register_t mc_xfpustate; - __register_t mc_xfpustate_len; - - int mc_spare2[4]; -} mcontext_t; - #if defined(_KERNEL) && defined(COMPAT_FREEBSD4) struct mcontext4 { __register_t mc_onstack; /* XXX - sigcontext compat. */ @@ -116,4 +58,6 @@ struct mcontext4 { }; #endif +#include + #endif /* !_MACHINE_UCONTEXT_H_ */ Copied and modified: head/sys/x86/include/elf.h (from r247045, head/sys/amd64/include/elf.h) ============================================================================== --- head/sys/amd64/include/elf.h Wed Feb 20 16:32:38 2013 (r247045, copy source) +++ head/sys/x86/include/elf.h Wed Feb 20 17:39:52 2013 (r247047) @@ -29,10 +29,99 @@ #ifndef _MACHINE_ELF_H_ #define _MACHINE_ELF_H_ 1 +#if defined(__i386__) || defined(_MACHINE_ELF_WANT_32BIT) + /* - * ELF definitions for the AMD64 architecture. + * ELF definitions for the i386 architecture. */ +#include /* Definitions common to all 32 bit architectures. */ +#if defined(__ELF_WORD_SIZE) && __ELF_WORD_SIZE == 64 +#include /* Definitions common to all 64 bit architectures. */ +#endif + +#ifndef __ELF_WORD_SIZE +#define __ELF_WORD_SIZE 32 /* Used by */ +#endif + +#include + +#define ELF_ARCH EM_386 + +#define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486) + +/* + * Auxiliary vector entries for passing information to the interpreter. + * + * The i386 supplement to the SVR4 ABI specification names this "auxv_t", + * but POSIX lays claim to all symbols ending with "_t". + */ + +typedef struct { /* Auxiliary vector entry on initial stack */ + int a_type; /* Entry type. */ + union { + long a_val; /* Integer value. */ + void *a_ptr; /* Address. */ + void (*a_fcn)(void); /* Function pointer (not used). */ + } a_un; +} Elf32_Auxinfo; + +#if __ELF_WORD_SIZE == 64 +/* Fake for amd64 loader support */ +typedef struct { + int fake; +} Elf64_Auxinfo; +#endif + +__ElfType(Auxinfo); + +/* Values for a_type. */ +#define AT_NULL 0 /* Terminates the vector. */ +#define AT_IGNORE 1 /* Ignored entry. */ +#define AT_EXECFD 2 /* File descriptor of program to load. */ +#define AT_PHDR 3 /* Program header of program already loaded. */ +#define AT_PHENT 4 /* Size of each program header entry. */ +#define AT_PHNUM 5 /* Number of program header entries. */ +#define AT_PAGESZ 6 /* Page size in bytes. */ +#define AT_BASE 7 /* Interpreter's base address. */ +#define AT_FLAGS 8 /* Flags (unused for i386). */ +#define AT_ENTRY 9 /* Where interpreter should transfer control. */ +#define AT_NOTELF 10 /* Program is not ELF ?? */ +#define AT_UID 11 /* Real uid. */ +#define AT_EUID 12 /* Effective uid. */ +#define AT_GID 13 /* Real gid. */ +#define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 17:46:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A6163AA; Wed, 20 Feb 2013 17:46:39 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 35062726; Wed, 20 Feb 2013 17:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KHkdi9065514; Wed, 20 Feb 2013 17:46:39 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KHkdZA065513; Wed, 20 Feb 2013 17:46:39 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201302201746.r1KHkdZA065513@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 20 Feb 2013 17:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247048 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 17:46:39 -0000 Author: gibbs Date: Wed Feb 20 17:46:38 2013 New Revision: 247048 URL: http://svnweb.freebsd.org/changeset/base/247048 Log: Orphaned processes that are being traced are killed by the kernel. Properly restore, continue, and detach from processes being DTraced when DTrace exits with an error so the program being inspected is not terminated. cddl/contrib/opensolaris/cmd/dtrace/dtrace.c: In fatal(), the generic error handler, close the DTrace handle as is done in the "probe/script" error handler dfatal(). fatal() can be invoked after DTrace attaches to processes (e.g. a script specified by command line argument can't be found) and closing the handle will release them. Submitted by: Spectra Logic Corporation Reviewed by: rpaulo, gnn Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Feb 20 17:39:52 2013 (r247047) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Feb 20 17:46:38 2013 (r247048) @@ -195,6 +195,13 @@ fatal(const char *fmt, ...) verror(fmt, ap); va_end(ap); + /* + * Close the DTrace handle to ensure that any controlled processes are + * correctly restored and continued. + */ + if (g_dtp) + dtrace_close(g_dtp); + exit(E_ERROR); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 17:49:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EC907B8; Wed, 20 Feb 2013 17:49:22 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx1.freebsd.org (Postfix) with ESMTP id 7BE61767; Wed, 20 Feb 2013 17:49:21 +0000 (UTC) Received: by mail-vb0-f47.google.com with SMTP id e21so5173301vbm.34 for ; Wed, 20 Feb 2013 09:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=gPmRART8IOsS9G8QE8+epkgcPWrNi6DBQh/97PLvelY=; b=gt1dIjPBtU7SPHvZ+vascV3dsBxvTlFiBpbNObrnSIuC6dOBpIWz5B9nkev0ZC3XLl gfoo3+K4bArs6N6zmChxkLDLJ9usQoqfHYB1XpfihLV2RzsWETJfKLAkorNJpoNqq4S1 aKbD5EBTDIcJVg2b3uJP2MyPQSVhf/aehAPoCaesLN+hWDmIA4/5pcycmwGOELmbXJ6w Lpgx0DaK1kD5PooCIVZ+LKHswV/t3YUUXwMVS7vD9KzKNidMmZQ0DRaTIFxXad2XhHFR CEdWrjQbaXJKeqTAQBYkyFrwXPkQMknS3cK4vP+82kxH/+F+g6+IUTDJD6HnmNgBP2TW yCjA== MIME-Version: 1.0 X-Received: by 10.52.30.48 with SMTP id p16mr24260827vdh.118.1361382554786; Wed, 20 Feb 2013 09:49:14 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 20 Feb 2013 09:49:14 -0800 (PST) In-Reply-To: <201302201259.r1KCxMUZ076597@svn.freebsd.org> References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> Date: Wed, 20 Feb 2013 09:49:14 -0800 Message-ID: Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe From: Jack Vogel To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 17:49:22 -0000 OK, this change must be backed out. This was not run past me, and this is a shared code file, that means its code that we license in both GPL, BSD, and closed source licensing, and thus we CANNOT accept changes without special handling. Further, I do not author this code, its done by another team internally, and I simply accept it as a component. If someone feels a change needs to happen the way to handle it is to send email to me to discuss it, I need to have it reviewed internally by the full development team, and a special waiver from the author will be needed to handle the licensing. So, please uncommit this. Jack On Wed, Feb 20, 2013 at 4:59 AM, Dag-Erling Sm=F8rgrav wro= te: > Author: des > Date: Wed Feb 20 12:59:21 2013 > New Revision: 247035 > URL: http://svnweb.freebsd.org/changeset/base/247035 > > Log: > Reduce excessive nesting. > > Modified: > head/sys/dev/ixgbe/ixgbe_phy.c > > Modified: head/sys/dev/ixgbe/ixgbe_phy.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/dev/ixgbe/ixgbe_phy.c Wed Feb 20 12:40:26 2013 > (r247034) > +++ head/sys/dev/ixgbe/ixgbe_phy.c Wed Feb 20 12:59:21 2013 > (r247035) > @@ -1194,25 +1194,23 @@ s32 ixgbe_identify_sfp_module_generic(st > /* Make sure we're a supported PHY type */ > if (hw->phy.type =3D=3D ixgbe_phy_sfp_intel) { > status =3D IXGBE_SUCCESS; > + } else if (hw->allow_unsupported_sfp =3D=3D TRUE)= { > + EWARN(hw, "WARNING: Intel (R) Network " > + "Connections are quality tested " > + "using Intel (R) Ethernet Optics." > + " Using untested modules is not " > + "supported and may cause unstable" > + " operation or damage to the " > + "module or the adapter. Intel " > + "Corporation is not responsible " > + "for any harm caused by using " > + "untested modules.\n", status); > + status =3D IXGBE_SUCCESS; > } else { > - if (hw->allow_unsupported_sfp =3D=3D TRUE= ) { > - EWARN(hw, "WARNING: Intel (R) > Network " > - "Connections are quality > tested " > - "using Intel (R) Ethernet > Optics." > - " Using untested modules is > not " > - "supported and may cause > unstable" > - " operation or damage to th= e > " > - "module or the adapter. > Intel " > - "Corporation is not > responsible " > - "for any harm caused by > using " > - "untested modules.\n", > status); > - status =3D IXGBE_SUCCESS; > - } else { > - DEBUGOUT("SFP+ module not > supported\n"); > - hw->phy.type =3D > - ixgbe_phy_sfp_unsupported= ; > - status =3D > IXGBE_ERR_SFP_NOT_SUPPORTED; > - } > + DEBUGOUT("SFP+ module not supported\n"); > + hw->phy.type =3D > + ixgbe_phy_sfp_unsupported; > + status =3D IXGBE_ERR_SFP_NOT_SUPPORTED; > } > } else { > status =3D IXGBE_SUCCESS; > From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 17:55:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D71CCD03; Wed, 20 Feb 2013 17:55:17 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0F337CE; Wed, 20 Feb 2013 17:55:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KHtHGF068795; Wed, 20 Feb 2013 17:55:17 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KHtHA6068794; Wed, 20 Feb 2013 17:55:17 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201302201755.r1KHtHA6068794@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 20 Feb 2013 17:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247049 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 17:55:17 -0000 Author: gibbs Date: Wed Feb 20 17:55:17 2013 New Revision: 247049 URL: http://svnweb.freebsd.org/changeset/base/247049 Log: Avoid panic when tearing down the DTrace pid provider for a process that has crashed. sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c: In fasttrap_pid_disable(), we cannot PHOLD the proc structure for a process that no longer exists, but we still have other, fasttrap specific, state that must be cleaned up for probes that existed in the dead process. Instead of returning early if the process related to our probes isn't found, conditionalize the locking and carry on with a NULL proc pointer. The rest of the fasttrap code already understands that a NULL proc is possible and does the right things in this case. Sponsored by: Spectra Logic Corporation Reviewed by: rpaulo, gnn MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 20 17:46:38 2013 (r247048) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 20 17:55:17 2013 (r247049) @@ -1124,14 +1124,12 @@ fasttrap_pid_disable(void *arg, dtrace_i * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = pfind(probe->ftp_pid)) == NULL) { - mutex_exit(&provider->ftp_mtx); - return; - } + if ((p = pfind(probe->ftp_pid)) != NULL) { #ifdef __FreeBSD__ - _PHOLD(p); - PROC_UNLOCK(p); + _PHOLD(p); + PROC_UNLOCK(p); #endif + } /* * Disable all the associated tracepoints (for fully enabled probes). @@ -1168,7 +1166,8 @@ fasttrap_pid_disable(void *arg, dtrace_i fasttrap_pid_cleanup(); #ifdef __FreeBSD__ - PRELE(p); + if (p != NULL) + PRELE(p); #endif if (!probe->ftp_enabled) return; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 18:31:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 924EB509; Wed, 20 Feb 2013 18:31:56 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54DA0A5A; Wed, 20 Feb 2013 18:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KIVt54081645; Wed, 20 Feb 2013 18:31:55 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KIVtiB081644; Wed, 20 Feb 2013 18:31:55 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302201831.r1KIVtiB081644@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 20 Feb 2013 18:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247050 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 18:31:56 -0000 Author: keramida (doc committer) Date: Wed Feb 20 18:31:55 2013 New Revision: 247050 URL: http://svnweb.freebsd.org/changeset/base/247050 Log: Various improvements to the qsort(3) usage example: - Remove unused #include. - Do not cast away const. - Use the canonical idiom to compare two numbers. - Use proper type for sizes, i.e. size_t instead of int. - Correct indentation. - Simplify printf("\n") to puts(""). - Use return instead of exit() in main(). Submitted by: Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor) Reviewed by: stefanf MFC after: 1 week Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Wed Feb 20 17:55:17 2013 (r247049) +++ head/lib/libc/stdlib/qsort.3 Wed Feb 20 18:31:55 2013 (r247050) @@ -220,7 +220,6 @@ and then prints the sorted array to stan .Bd -literal #include #include -#include /* * Custom comparison function that can compare 'int' values through pointers @@ -229,15 +228,10 @@ and then prints the sorted array to stan static int int_compare(const void *p1, const void *p2) { - int *left = (int *)p1; - int *right = (int *)p2; + int left = *(const int *)p1; + int right = *(const int *)p2; - if (*left < *right) - return (-1); - else if (*left > *right) - return (1); - else - return (0); + return ((left > right) - (left < right)); } /* @@ -247,14 +241,14 @@ int main(void) { int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; - const int array_size = sizeof(int_array) / sizeof(int_array[0]); - int k; + const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; - qsort(&int_array, array_size, sizeof(int), int_compare); + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); for (k = 0; k < array_size; k++) printf(" %d", int_array[k]); - printf("\\n"); - exit(EXIT_SUCCESS); + puts(""); + return (EXIT_SUCCESS); } .Ed .Sh ERRORS From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 18:42:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 859439AC; Wed, 20 Feb 2013 18:42:01 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 2C0A2ADB; Wed, 20 Feb 2013 18:42:00 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r1KIg0K0062364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Feb 2013 10:42:00 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r1KIg0T9062363; Wed, 20 Feb 2013 10:42:00 -0800 (PST) (envelope-from jmg) Date: Wed, 20 Feb 2013 10:42:00 -0800 From: John-Mark Gurney To: John Baldwin Subject: Re: svn commit: r247012 - in head/contrib/binutils: gas/config opcodes Message-ID: <20130220184200.GN55866@funkthat.com> References: <201302192135.r1JLZH27096984@svn.freebsd.org> <201302200809.23854.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302200809.23854.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 20 Feb 2013 10:42:00 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 18:42:01 -0000 John Baldwin wrote this message on Wed, Feb 20, 2013 at 08:09 -0500: > On Tuesday, February 19, 2013 4:35:17 pm John-Mark Gurney wrote: > > Author: jmg > > Date: Tue Feb 19 21:35:17 2013 > > New Revision: 247012 > > URL: http://svnweb.freebsd.org/changeset/base/247012 > > > > Log: > > add support for AES and PCLMULQDQ instructions to binutils... > > > > Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though > > OpenBSD's gcc is very different that it only helped w/ where to modify, > > not how... Thanks to jhb for some early reviews... > > > > Reviewed by: imp, kib > > MFC after: 1 month > > Nice! Sorry I wasn't able to review this in more detail. :( Can you also add > support for these instructions to ddb's disassembler? Considering that ddb doesn't appear to support xmm registers, that'll be a bit of work... even simple instructions such as pxor aren't there yet... So, it'd be more like adding all of the SSE instructions to db than just adding the AES instructions... If I had time, I'd do it, but I don't right now.. Also, I just happen to be looking at the declaration in amd64/amd64/db_disasm.c of: static const char * const db_reg[2][4][16] = { shouldn't we change that to: static const char const db_reg[2][4][16][6] = { That would save a level of indirection, and also all those pointers associated... I estimate that it would save about 1k of space on amd64... it might be a bit less, but at least 512 bytes... Just a thought... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 18:57:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06343F2B; Wed, 20 Feb 2013 18:57:51 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id BD49BC25; Wed, 20 Feb 2013 18:57:50 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id C97F166BD; Wed, 20 Feb 2013 18:57:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 87EE29528; Wed, 20 Feb 2013 19:57:49 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jack Vogel Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> Date: Wed, 20 Feb 2013 19:57:48 +0100 In-Reply-To: (Jack Vogel's message of "Wed, 20 Feb 2013 09:49:14 -0800") Message-ID: <86ip5mbyoj.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 18:57:51 -0000 Jack Vogel writes: > OK, this change must be backed out. This was not run past me, and this > is a shared code file, that means its code that we license in both > GPL, BSD, and closed source licensing, and thus we CANNOT accept > changes without special handling. Further, I do not author this code, > its done by another team internally, and I simply accept it as a > component. I think you're confused. I did not commit this to Intel's code repository. I committed it to FreeBSD's code repository as a precursor to a slightly more extensive patch which I intend to commit once I've tested it more thoroughly. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:01:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D242D387; Wed, 20 Feb 2013 19:01:52 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6F350CCE; Wed, 20 Feb 2013 19:01:52 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id cz11so7154908veb.31 for ; Wed, 20 Feb 2013 11:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=1FB3A/3l343ErCjtkAoXhxR1zvf/liMLcqUib9SbFmw=; b=VSOkTKR8cLn+urQPpfLV4yzRlz8rFJfECmNEEqHGlUmGQAdf0h2KjBlJZuqzPhwK9G q9WcQIOfaIvY0nqN0ePsDglH1uaPDv1KcizgXVSXMbQoYz6z8BOG6djTmRcDMSvLV7YD QEJPJE4ft0zdz4oacSBqICcxToQia8jcOeUWumkIXAyCevKovD/H/Mt+8v7ltW3M93T5 Yy9Gf4vYErM2CuCHcdG5fqfr1uPu1+YhTF06m7kaOIjDxIaWyEPEZjpeGOtO7Opt8DUG Zsbb/FJsRkBf3JD+3K/WXhDvtUrF5NdwQAtKOp7MRD8n3gxRF/qCRw3mi0XVCXiF5SQO ukvg== MIME-Version: 1.0 X-Received: by 10.52.30.48 with SMTP id p16mr24561475vdh.118.1361386906440; Wed, 20 Feb 2013 11:01:46 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 20 Feb 2013 11:01:46 -0800 (PST) In-Reply-To: <86ip5mbyoj.fsf@ds4.des.no> References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> Date: Wed, 20 Feb 2013 11:01:46 -0800 Message-ID: Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe From: Jack Vogel To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:01:52 -0000 No, I'm not confused, I am the owner of the driver, and keep the FreeBSD code and the Intel code in sync, any changes to the code should be run by me first. Jack On Wed, Feb 20, 2013 at 10:57 AM, Dag-Erling Sm=F8rgrav wrote: > Jack Vogel writes: > > OK, this change must be backed out. This was not run past me, and this > > is a shared code file, that means its code that we license in both > > GPL, BSD, and closed source licensing, and thus we CANNOT accept > > changes without special handling. Further, I do not author this code, > > its done by another team internally, and I simply accept it as a > > component. > > I think you're confused. I did not commit this to Intel's code > repository. I committed it to FreeBSD's code repository as a precursor > to a slightly more extensive patch which I intend to commit once I've > tested it more thoroughly. > > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:05:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E169A644; Wed, 20 Feb 2013 19:05:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D40C4CF6; Wed, 20 Feb 2013 19:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KJ5D87091345; Wed, 20 Feb 2013 19:05:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KJ5DDN091344; Wed, 20 Feb 2013 19:05:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201302201905.r1KJ5DDN091344@svn.freebsd.org> From: Joel Dahl Date: Wed, 20 Feb 2013 19:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247051 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:05:14 -0000 Author: joel (doc committer) Date: Wed Feb 20 19:05:13 2013 New Revision: 247051 URL: http://svnweb.freebsd.org/changeset/base/247051 Log: Sort sections. Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Wed Feb 20 18:31:55 2013 (r247050) +++ head/lib/libc/stdlib/qsort.3 Wed Feb 20 19:05:13 2013 (r247051) @@ -205,12 +205,6 @@ functions return no value. .Pp .Rv -std heapsort mergesort -.Sh COMPATIBILITY -Previous versions of -.Fn qsort -did not permit the comparison routine itself to call -.Fn qsort 3 . -This is no longer true. .Sh EXAMPLES A sample program that sorts an array of .Vt int @@ -251,6 +245,12 @@ main(void) return (EXIT_SUCCESS); } .Ed +.Sh COMPATIBILITY +Previous versions of +.Fn qsort +did not permit the comparison routine itself to call +.Fn qsort 3 . +This is no longer true. .Sh ERRORS The .Fn heapsort From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:05:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9655E7BA for ; Wed, 20 Feb 2013 19:05:32 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) by mx1.freebsd.org (Postfix) with ESMTP id 24243D01 for ; Wed, 20 Feb 2013 19:05:31 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id fo12so8073320lab.0 for ; Wed, 20 Feb 2013 11:05:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=caZ8lbzXS67ogxijCDwrDd8reM1TOI6bgyCXy9A/upk=; b=Zlj/oGF/p/QdVrZ2TkIODI7RMUoVll5fDMbgt5M3cZ586FHvMdXrzyU0FQGr5+acEA 5NzthJUfZuG3t45iRb/mekZB+SutdopAkb9LXWWWquK6k3xZpfAR4x/gMwt731ylH8AV bpDNRDvubR+JR88x2fnQ8SDiM3+ZEp9Adqjue7IHDE+0TtiDb2yB88KS89wWqL5h1Iao L3PFxt7BluRxhgkWs0ep8rp2vUufGKrvR86Sh75vQ4wzL7UiFYTKQG6XRxZWVJBjrF6M y/dEJiP5j4TIBanMJJtMLr036IN3dfLmW2cBNeMCNL4ZXd0dVNG6qwvAvv46Hxwf/R/3 UGQw== X-Received: by 10.112.17.108 with SMTP id n12mr8774420lbd.21.1361387130794; Wed, 20 Feb 2013 11:05:30 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.133.196 with HTTP; Wed, 20 Feb 2013 11:05:10 -0800 (PST) In-Reply-To: <86ip5mbyoj.fsf@ds4.des.no> References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> From: Juli Mallett Date: Wed, 20 Feb 2013 11:05:10 -0800 X-Google-Sender-Auth: Kk-HXhIDOGRZP9C1NHFQa3HWsFs Message-ID: Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQnoRW8JMHCXaO7n4dv1jvq3khV7o2QjSpt+VQt6euqXpbm0mVFt9ph8pxbY32IUGjnziV08 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jack Vogel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:05:32 -0000 On Wed, Feb 20, 2013 at 10:57 AM, Dag-Erling Sm=C3=B8rgrav wro= te: > Jack Vogel writes: >> OK, this change must be backed out. This was not run past me, and this >> is a shared code file, that means its code that we license in both >> GPL, BSD, and closed source licensing, and thus we CANNOT accept >> changes without special handling. Further, I do not author this code, >> its done by another team internally, and I simply accept it as a >> component. > > I think you're confused. I did not commit this to Intel's code > repository. I committed it to FreeBSD's code repository as a precursor > to a slightly more extensive patch which I intend to commit once I've > tested it more thoroughly. Please don't. Many others have accepted/respected Jack's maintainership by letting him keep control of the in-tree driver as much as is possible, particularly outside of ixgbe.c. I would love to have committed my code to handle 1G SFPs quite some time ago, but it makes at least a little sense to me that Jack handles the merges and testing and whatnot and doesn't need the additional work of maintaining FreeBSD additions he can't test. In general, the benefit of having the Intel drivers updated regularly by someone who has done extensive testing and who has the backing of Intel has outweighed the cost of deferring to Intel and Jack about what can go into the drivers. If your changes are so compelling, I would have expected them to have appeared at least on a major public mailing list, rather than committed at a whim to a driver which has a clear and obvious maintainer. If we really do have a lot of wonderful changes that are stalled by Jack's maintainership, provide a second driver in-tree and maintain it, which has all the go-faster/better/stronger stripes. It's not just Jack that unexpected changes to these critical drivers make things harder for. There's Luigi, Ryan Stone, John Baldwin, myself and others, who maintain extensions to the Intel drivers in-tree and/or privately. Thanks, Juli. From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:05:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAE6A7BB; Wed, 20 Feb 2013 19:05:32 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5F3D02; Wed, 20 Feb 2013 19:05:32 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 84C636702; Wed, 20 Feb 2013 19:05:31 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 55442952B; Wed, 20 Feb 2013 20:05:31 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jack Vogel Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> Date: Wed, 20 Feb 2013 20:05:31 +0100 In-Reply-To: (Jack Vogel's message of "Wed, 20 Feb 2013 11:01:46 -0800") Message-ID: <86ehgabybo.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:05:32 -0000 Jack Vogel writes: > No, I'm not confused, I am the owner of the driver, and keep the > FreeBSD code and the Intel code in sync, any changes to the code > should be run by me first. Where is this documented? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:07:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B53EAD3; Wed, 20 Feb 2013 19:07:56 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0EED32; Wed, 20 Feb 2013 19:07:56 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 6F8806714; Wed, 20 Feb 2013 19:07:55 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 27D72952D; Wed, 20 Feb 2013 20:07:55 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Juli Mallett Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> Date: Wed, 20 Feb 2013 20:07:54 +0100 In-Reply-To: (Juli Mallett's message of "Wed, 20 Feb 2013 11:05:10 -0800") Message-ID: <86a9qyby7p.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 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, Jack Vogel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:07:56 -0000 Juli Mallett writes: > Please don't. Many others have accepted/respected Jack's > maintainership by letting him keep control of the in-tree driver as > much as is possible, particularly outside of ixgbe.c. Jack claims to have a hard lock on the driver. While not unheard of, it is somewhat unusual, and there is no documentation of it anywhere - neither in MAINTAINERS nor in the README or LICENSE files which accompany the driver. He also needs to work on his attitude. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:32:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 706F84B6; Wed, 20 Feb 2013 19:32:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA65E93; Wed, 20 Feb 2013 19:32:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KJWV5X000271; Wed, 20 Feb 2013 19:32:31 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KJWVTB000268; Wed, 20 Feb 2013 19:32:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302201932.r1KJWVTB000268@svn.freebsd.org> From: Brooks Davis Date: Wed, 20 Feb 2013 19:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247052 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:32:32 -0000 Author: brooks Date: Wed Feb 20 19:32:31 2013 New Revision: 247052 URL: http://svnweb.freebsd.org/changeset/base/247052 Log: Support hardlinks in manifest files by the same logic as the treewalk code. Reviewed by: marcel Sponsored by: DARPA, AFRL Modified: head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/mtree.c head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Wed Feb 20 19:05:13 2013 (r247051) +++ head/usr.sbin/makefs/makefs.h Wed Feb 20 19:32:31 2013 (r247052) @@ -280,6 +280,8 @@ extern struct timespec start_time; struct fs; void ffs_fragacct_swap(struct fs *, int, int32_t [], int, int); +fsinode *link_check(fsinode *); + /* * Declarations for compat routines. */ Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Feb 20 19:05:13 2013 (r247051) +++ head/usr.sbin/makefs/mtree.c Wed Feb 20 19:32:31 2013 (r247052) @@ -779,6 +779,24 @@ read_mtree_keywords(FILE *fp, fsnode *no return (0); } + /* + * Check for hardlinks. If the contents key is used, then the check + * will only trigger if the contents file is a link even if it is used + * by more than one file + */ + if (sb.st_nlink > 1) { + fsinode *curino; + + st->st_ino = sb.st_ino; + st->st_dev = sb.st_dev; + curino = link_check(node->inode); + if (curino != NULL) { + free(node->inode); + node->inode = curino; + node->inode->nlink++; + } + } + free(node->contents); node->contents = name; st->st_size = sb.st_size; Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Wed Feb 20 19:05:13 2013 (r247051) +++ head/usr.sbin/makefs/walk.c Wed Feb 20 19:32:31 2013 (r247052) @@ -59,7 +59,6 @@ static void apply_specdir(const char *, static void apply_specentry(const char *, NODE *, fsnode *); static fsnode *create_fsnode(const char *, const char *, const char *, struct stat *); -static fsinode *link_check(fsinode *); /* @@ -644,7 +643,7 @@ inode_type(mode_t mode) /* This was borrowed from du.c and tweaked to keep an fsnode * pointer instead. -- dbj@netbsd.org */ -static fsinode * +fsinode * link_check(fsinode *entry) { static struct entry { From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 19:49:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 88D13D14; Wed, 20 Feb 2013 19:49:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6363FF96; Wed, 20 Feb 2013 19:49:54 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CDA75B926; Wed, 20 Feb 2013 14:49:53 -0500 (EST) From: John Baldwin To: "John-Mark Gurney" Subject: Re: svn commit: r247012 - in head/contrib/binutils: gas/config opcodes Date: Wed, 20 Feb 2013 14:30:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201302192135.r1JLZH27096984@svn.freebsd.org> <201302200809.23854.jhb@freebsd.org> <20130220184200.GN55866@funkthat.com> In-Reply-To: <20130220184200.GN55866@funkthat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201302201430.53615.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 20 Feb 2013 14:49:53 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 19:49:54 -0000 On Wednesday, February 20, 2013 1:42:00 pm John-Mark Gurney wrote: > John Baldwin wrote this message on Wed, Feb 20, 2013 at 08:09 -0500: > > On Tuesday, February 19, 2013 4:35:17 pm John-Mark Gurney wrote: > > > Author: jmg > > > Date: Tue Feb 19 21:35:17 2013 > > > New Revision: 247012 > > > URL: http://svnweb.freebsd.org/changeset/base/247012 > > > > > > Log: > > > add support for AES and PCLMULQDQ instructions to binutils... > > > > > > Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though > > > OpenBSD's gcc is very different that it only helped w/ where to modify, > > > not how... Thanks to jhb for some early reviews... > > > > > > Reviewed by: imp, kib > > > MFC after: 1 month > > > > Nice! Sorry I wasn't able to review this in more detail. :( Can you also add > > support for these instructions to ddb's disassembler? > > Considering that ddb doesn't appear to support xmm registers, that'll > be a bit of work... even simple instructions such as pxor aren't there > yet... So, it'd be more like adding all of the SSE instructions to db > than just adding the AES instructions... If I had time, I'd do it, but > I don't right now.. Ahh, that's fair. The ones I added recently did not use XMM registers so they weren't as tricky. > Also, I just happen to be looking at the declaration in > amd64/amd64/db_disasm.c of: > static const char * const db_reg[2][4][16] = { > > shouldn't we change that to: > static const char const db_reg[2][4][16][6] = { > > That would save a level of indirection, and also all those pointers > associated... I estimate that it would save about 1k of space on > amd64... it might be a bit less, but at least 512 bytes... > > Just a thought... On arm or mips I'd say yes. On amd64 I doubt it would be noticable, and the first version is arguably slightly more readable. I don't really care one way or another though. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 20:42:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF2A3B1A; Wed, 20 Feb 2013 20:42:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1312353; Wed, 20 Feb 2013 20:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KKgulX022618; Wed, 20 Feb 2013 20:42:56 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KKgug4022617; Wed, 20 Feb 2013 20:42:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201302202042.r1KKgug4022617@svn.freebsd.org> From: Ed Maste Date: Wed, 20 Feb 2013 20:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247054 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 20:42:56 -0000 Author: emaste Date: Wed Feb 20 20:42:56 2013 New Revision: 247054 URL: http://svnweb.freebsd.org/changeset/base/247054 Log: Fix parallel build race with DEBUG_FLAGS Reported by: Jan Beich on freebsd-current Tested by: markj Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Feb 20 20:12:17 2013 (r247053) +++ head/share/mk/bsd.lib.mk Wed Feb 20 20:42:56 2013 (r247054) @@ -113,12 +113,20 @@ PO_FLAG=-pg all: objwarn +.if defined(SHLIB_NAME) +.if defined(DEBUG_FLAGS) +SHLIB_NAME_FULL=${SHLIB_NAME}.debug +.else +SHLIB_NAME_FULL=${SHLIB_NAME} +.endif +.endif + .include # Allow libraries to specify their own version map or have it # automatically generated (see bsd.symver.mk above). .if ${MK_SYMVER} == "yes" && !empty(VERSION_MAP) -${SHLIB_NAME}: ${VERSION_MAP} +${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif @@ -165,12 +173,6 @@ SOBJS+= ${OBJS:.o=.So} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} -.if defined(DEBUG_FLAGS) -SHLIB_NAME_FULL=${SHLIB_NAME}.debug -.else -SHLIB_NAME_FULL=${SHLIB_NAME} -.endif - SOLINKOPTS= -shared -Wl,-x .if !defined(ALLOW_SHARED_TEXTREL) SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 20:57:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0544A3C0; Wed, 20 Feb 2013 20:57:47 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx1.freebsd.org (Postfix) with ESMTP id 425F1695; Wed, 20 Feb 2013 20:57:46 +0000 (UTC) Received: by mail-vb0-f42.google.com with SMTP id ff1so2183416vbb.15 for ; Wed, 20 Feb 2013 12:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=BC/fOU+CwsBsTN1YS/QlVw0F3+KNZ9hWFjYteWlg4p8=; b=huez2WsxZkmZSn5XEAyQ3TZWrFpRjQg3hUin54oIvtS5QfONy5Oh+Qm/5HVQQKgEpQ CSVkCNuRNa26b7hXCQxnlgbWsd+TrasITWkMttFTQg2DGOFF7HjVfNBz1hHklpC5ChPj 9NkIWOSIb3VJKbA7E6jUy/w8bljZ39AynUbeDYqVyPcdMLYeUlkvTnNzQt0zJfjMcKnX IhBWsubuxzsq8U/FQ92bhxOYO8iiaibuxs0orShzFwpS+T+4Dc8Z3GMyX1O1HX86jF5u 70MslhStlYpgnoGhQahqyYBfq/sVEdK8zEdncIda8zBmB9jXIxp5PHy+T3zmrfrTcgV7 iALQ== MIME-Version: 1.0 X-Received: by 10.220.218.195 with SMTP id hr3mr27368829vcb.70.1361393859872; Wed, 20 Feb 2013 12:57:39 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 20 Feb 2013 12:57:39 -0800 (PST) In-Reply-To: <86a9qyby7p.fsf@ds4.des.no> References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> <86a9qyby7p.fsf@ds4.des.no> Date: Wed, 20 Feb 2013 12:57:39 -0800 Message-ID: Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe From: Jack Vogel To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 20:57:47 -0000 My attitude? And what part of courtesy were you missing, did I make comment= s about you or your behavior. At this point I'd say you owe me an apology as well as the uncommit. Jack On Wed, Feb 20, 2013 at 11:07 AM, Dag-Erling Sm=F8rgrav wrote: > Juli Mallett writes: > > Please don't. Many others have accepted/respected Jack's > > maintainership by letting him keep control of the in-tree driver as > > much as is possible, particularly outside of ixgbe.c. > > Jack claims to have a hard lock on the driver. While not unheard of, it > is somewhat unusual, and there is no documentation of it anywhere - > neither in MAINTAINERS nor in the README or LICENSE files which > accompany the driver. > > He also needs to work on his attitude. > > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 21:15:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B1968AF1; Wed, 20 Feb 2013 21:15:22 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 165A3774; Wed, 20 Feb 2013 21:15:22 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 3746D742B; Wed, 20 Feb 2013 21:15:21 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 010739551; Wed, 20 Feb 2013 22:15:20 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jack Vogel Subject: Re: svn commit: r247035 - head/sys/dev/ixgbe References: <201302201259.r1KCxMUZ076597@svn.freebsd.org> <86ip5mbyoj.fsf@ds4.des.no> <86a9qyby7p.fsf@ds4.des.no> Date: Wed, 20 Feb 2013 22:15:20 +0100 In-Reply-To: (Jack Vogel's message of "Wed, 20 Feb 2013 12:57:39 -0800") Message-ID: <86mwuyadqv.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 21:15:22 -0000 Jack Vogel writes: > My attitude? And what part of courtesy were you missing, did I make > comments about you or your behavior. At this point I'd say you owe me > an apology as well as the uncommit. I'll revert the commit, but you won't get an apology. You and / or Intel clearly don't understand how open source works. That's your problem, though, not mine. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 21:16:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4D80CDA2; Wed, 20 Feb 2013 21:16:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4015C78D; Wed, 20 Feb 2013 21:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KLGpFa032887; Wed, 20 Feb 2013 21:16:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KLGpq3032886; Wed, 20 Feb 2013 21:16:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302202116.r1KLGpq3032886@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 20 Feb 2013 21:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247056 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 21:16:51 -0000 Author: des Date: Wed Feb 20 21:16:50 2013 New Revision: 247056 URL: http://svnweb.freebsd.org/changeset/base/247056 Log: revert 247035 Modified: head/sys/dev/ixgbe/ixgbe_phy.c Modified: head/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_phy.c Wed Feb 20 20:56:07 2013 (r247055) +++ head/sys/dev/ixgbe/ixgbe_phy.c Wed Feb 20 21:16:50 2013 (r247056) @@ -1194,23 +1194,25 @@ s32 ixgbe_identify_sfp_module_generic(st /* Make sure we're a supported PHY type */ if (hw->phy.type == ixgbe_phy_sfp_intel) { status = IXGBE_SUCCESS; - } else if (hw->allow_unsupported_sfp == TRUE) { - EWARN(hw, "WARNING: Intel (R) Network " - "Connections are quality tested " - "using Intel (R) Ethernet Optics." - " Using untested modules is not " - "supported and may cause unstable" - " operation or damage to the " - "module or the adapter. Intel " - "Corporation is not responsible " - "for any harm caused by using " - "untested modules.\n", status); - status = IXGBE_SUCCESS; } else { - DEBUGOUT("SFP+ module not supported\n"); - hw->phy.type = - ixgbe_phy_sfp_unsupported; - status = IXGBE_ERR_SFP_NOT_SUPPORTED; + if (hw->allow_unsupported_sfp == TRUE) { + EWARN(hw, "WARNING: Intel (R) Network " + "Connections are quality tested " + "using Intel (R) Ethernet Optics." + " Using untested modules is not " + "supported and may cause unstable" + " operation or damage to the " + "module or the adapter. Intel " + "Corporation is not responsible " + "for any harm caused by using " + "untested modules.\n", status); + status = IXGBE_SUCCESS; + } else { + DEBUGOUT("SFP+ module not supported\n"); + hw->phy.type = + ixgbe_phy_sfp_unsupported; + status = IXGBE_ERR_SFP_NOT_SUPPORTED; + } } } else { status = IXGBE_SUCCESS; From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 22:20:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 58ECE6A5; Wed, 20 Feb 2013 22:20:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B842C1F; Wed, 20 Feb 2013 22:20:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KMKoHK053366; Wed, 20 Feb 2013 22:20:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KMKoJh053365; Wed, 20 Feb 2013 22:20:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302202220.r1KMKoJh053365@svn.freebsd.org> From: Warner Losh Date: Wed, 20 Feb 2013 22:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247059 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 22:20:50 -0000 Author: imp Date: Wed Feb 20 22:20:49 2013 New Revision: 247059 URL: http://svnweb.freebsd.org/changeset/base/247059 Log: Remove the unused spl functions: spl0, splsoftcam, splsofttty, splsofttq and splstatclock. Other used spl functions to follow. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Feb 20 21:57:01 2013 (r247058) +++ head/sys/sys/systm.h Wed Feb 20 22:20:49 2013 (r247059) @@ -324,19 +324,14 @@ caddr_t kern_timeout_callwheel_alloc(cad void kern_timeout_callwheel_init(void); /* Stubs for obsolete functions that used to be for interrupt management */ -static __inline void spl0(void) { return; } static __inline intrmask_t splbio(void) { return 0; } static __inline intrmask_t splcam(void) { return 0; } static __inline intrmask_t splclock(void) { return 0; } static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } static __inline intrmask_t splnet(void) { return 0; } -static __inline intrmask_t splsoftcam(void) { return 0; } static __inline intrmask_t splsoftclock(void) { return 0; } -static __inline intrmask_t splsofttty(void) { return 0; } static __inline intrmask_t splsoftvm(void) { return 0; } -static __inline intrmask_t splsofttq(void) { return 0; } -static __inline intrmask_t splstatclock(void) { return 0; } static __inline intrmask_t spltty(void) { return 0; } static __inline intrmask_t splvm(void) { return 0; } static __inline void splx(intrmask_t ipl __unused) { return; } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 22:51:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCBC7B97; Wed, 20 Feb 2013 22:51:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9BBAF88; Wed, 20 Feb 2013 22:51:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KMphRN062820; Wed, 20 Feb 2013 22:51:43 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KMphiE062819; Wed, 20 Feb 2013 22:51:43 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201302202251.r1KMphiE062819@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 20 Feb 2013 22:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247060 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 22:51:43 -0000 Author: bapt Date: Wed Feb 20 22:51:42 2013 New Revision: 247060 URL: http://svnweb.freebsd.org/changeset/base/247060 Log: Do not use deprecated functions from libarchive Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Feb 20 22:20:49 2013 (r247059) +++ head/usr.sbin/pkg/pkg.c Wed Feb 20 22:51:42 2013 (r247060) @@ -212,7 +212,7 @@ extract_pkg_static(int fd, char *p, int warn("archive_read_new"); return (ret); } - archive_read_support_compression_all(a); + archive_read_support_filter_all(a); archive_read_support_format_tar(a); if (lseek(fd, 0, 0) == -1) { @@ -247,7 +247,7 @@ extract_pkg_static(int fd, char *p, int warnx("fail to extract pkg-static"); cleanup: - archive_read_finish(a); + archive_read_free(a); return (ret); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 22:59:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 27A634EE; Wed, 20 Feb 2013 22:59:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0137BD2; Wed, 20 Feb 2013 22:59:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KMxrIN063998; Wed, 20 Feb 2013 22:59:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KMxrNH063993; Wed, 20 Feb 2013 22:59:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302202259.r1KMxrNH063993@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 20 Feb 2013 22:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247061 - in head/sys: crypto/aesni opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 22:59:54 -0000 Author: pjd Date: Wed Feb 20 22:59:53 2013 New Revision: 247061 URL: http://svnweb.freebsd.org/changeset/base/247061 Log: When porting XTS-related code from OpenBSD I forgot to update copyright (only OpenBSD was credited in one of two commits). Fix it. Reported by: Theo de Raadt Reviewed by: Damien Miller Modified: head/sys/crypto/aesni/aesni_wrap.c head/sys/opencrypto/xform.c Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Wed Feb 20 22:51:42 2013 (r247060) +++ head/sys/crypto/aesni/aesni_wrap.c Wed Feb 20 22:59:53 2013 (r247061) @@ -1,4 +1,5 @@ /*- + * Copyright (C) 2008 Damien Miller * Copyright (c) 2010 Konstantin Belousov * Copyright (c) 2010-2011 Pawel Jakub Dawidek * All rights reserved. Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Wed Feb 20 22:51:42 2013 (r247060) +++ head/sys/opencrypto/xform.c Wed Feb 20 22:59:53 2013 (r247061) @@ -1,8 +1,9 @@ /* $OpenBSD: xform.c,v 1.16 2001/08/28 12:20:43 ben Exp $ */ /*- * The authors of this code are John Ioannidis (ji@tla.org), - * Angelos D. Keromytis (kermit@csd.uch.gr) and - * Niels Provos (provos@physnet.uni-hamburg.de). + * Angelos D. Keromytis (kermit@csd.uch.gr), + * Niels Provos (provos@physnet.uni-hamburg.de) and + * Damien Miller (djm@mindrot.org). * * This code was written by John Ioannidis for BSD/OS in Athens, Greece, * in November 1995. @@ -15,11 +16,15 @@ * * Additional features in 1999 by Angelos D. Keromytis. * + * AES XTS implementation in 2008 by Damien Miller + * * Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis, * Angelos D. Keromytis and Niels Provos. * * Copyright (C) 2001, Angelos D. Keromytis. * + * Copyright (C) 2008, Damien Miller + * * Permission to use, copy, and modify this software with or without fee * is hereby granted, provided that this entire notice is included in * all copies of any software which is or includes a copy or From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 23:15:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A93A7C52; Wed, 20 Feb 2013 23:15:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A006198; Wed, 20 Feb 2013 23:15:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1KNFfns070130; Wed, 20 Feb 2013 23:15:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1KNFfZS070129; Wed, 20 Feb 2013 23:15:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302202315.r1KNFfZS070129@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 20 Feb 2013 23:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247062 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 23:15:41 -0000 Author: np Date: Wed Feb 20 23:15:40 2013 New Revision: 247062 URL: http://svnweb.freebsd.org/changeset/base/247062 Log: cxgbe(4): Assume that CSUM_TSO in the transmit path implies CSUM_IP and CSUM_TCP too. They are all set explicitly by the kernel usually. While here, fix an unrelated bug where hardware L4 checksum calculation was accidentally disabled for some IPv6 packets. Reported by: alfred@ MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Feb 20 22:59:53 2013 (r247061) +++ head/sys/dev/cxgbe/t4_sge.c Wed Feb 20 23:15:40 2013 (r247062) @@ -2950,13 +2950,13 @@ write_txpkt_wr(struct port_info *pi, str /* Checksum offload */ ctrl1 = 0; - if (!(m->m_pkthdr.csum_flags & CSUM_IP)) + if (!(m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO))) ctrl1 |= F_TXPKT_IPCSUM_DIS; if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | - CSUM_TCP_IPV6))) + CSUM_TCP_IPV6 | CSUM_TSO))) ctrl1 |= F_TXPKT_L4CSUM_DIS; if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_UDP_IPV6 | CSUM_TCP_IPV6)) + CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ @@ -3152,11 +3152,13 @@ write_ulp_cpl_sgl(struct port_info *pi, /* Checksum offload */ ctrl = 0; - if (!(m->m_pkthdr.csum_flags & CSUM_IP)) + if (!(m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO))) ctrl |= F_TXPKT_IPCSUM_DIS; - if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP))) + if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | + CSUM_TCP_IPV6 | CSUM_TSO))) ctrl |= F_TXPKT_L4CSUM_DIS; - if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP)) + if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 20 23:23:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9364596; Wed, 20 Feb 2013 23:23:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1388C1F3; Wed, 20 Feb 2013 23:23:39 +0000 (UTC) Message-ID: <51255A8D.5070606@FreeBSD.org> Date: Wed, 20 Feb 2013 18:21:49 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130128 Thunderbird/17.0.2 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r247059 - head/sys/sys References: <201302202220.r1KMKoJh053365@svn.freebsd.org> In-Reply-To: <201302202220.r1KMKoJh053365@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 20 Feb 2013 23:23:39 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-02-20 17:20:50 -0500, Warner Losh wrote: > Author: imp Date: Wed Feb 20 22:20:49 2013 New Revision: 247059 > URL: http://svnweb.freebsd.org/changeset/base/247059 > > Log: Remove the unused spl functions: spl0, splsoftcam, > splsofttty, splsofttq and splstatclock. > > Other used spl functions to follow. ... Hallelujah! 12 years... Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJRJVqMAAoJECXpabHZMqHOgAYIALzL7aNILn4jH545V/fnmvK/ VWKuEdKI5t1Ewp4sU8Zf2HOzZRYLExQIrW1YKTRxij99Y/MnKByo//yCtMXMx7Cu PgbET0DnkH2Z2CMIFgRvJ1a5MN0lAB41ecPSfrVKS8yPbxDMdSUUbwOPKc67uqAp qMIkZ2W/LHAaBi8vcLyja+drTucBdJdG/ilJmkDLu1OiYFJQ0ig1ftwkyFh6BMno WnZaQp1cPBumwBuyYxnZpiDFlXmHLJpc2OYVndgFNTFbkIO3Hl1AlqFwEWcpxAI5 oJxzHBg4EHYMJSlSFu7yYSQqAQ5vZWjUbiu+INThpRwRqt9/22QDV7+z+2qU4/Y= =wpUg -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 00:25:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6CC6351; Thu, 21 Feb 2013 00:25:46 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B89AE7D3; Thu, 21 Feb 2013 00:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L0PkNi091354; Thu, 21 Feb 2013 00:25:46 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L0Pk6W091352; Thu, 21 Feb 2013 00:25:46 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201302210025.r1L0Pk6W091352@svn.freebsd.org> From: Jack F Vogel Date: Thu, 21 Feb 2013 00:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247064 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 00:25:46 -0000 Author: jfv Date: Thu Feb 21 00:25:45 2013 New Revision: 247064 URL: http://svnweb.freebsd.org/changeset/base/247064 Log: Refresh on the shared code for the E1000 drivers. - bear with me, there are lots of white space changes, I would not do them, but I am a mere consumer of this stuff and if these drivers are to stay in shape they need to be taken. em driver changes: support for the new i217/i218 interfaces igb driver changes: - TX mq start has a quick turnaround to the stack - Link/media handling improvement - When link status changes happen the current flow control state will now be displayed. - A few white space/style changes. lem driver changes: - the shared code uncovered a bogus write to the RLPML register (which does not exist in this hardware) in the vlan code,this is removed. Modified: head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Wed Feb 20 23:26:14 2013 (r247063) +++ head/sys/dev/e1000/e1000_82571.c Thu Feb 21 00:25:45 2013 (r247064) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,8 +32,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -/* - * 82571EB Gigabit Ethernet Controller +/* 82571EB Gigabit Ethernet Controller * 82571EB Gigabit Ethernet Controller (Copper) * 82571EB Gigabit Ethernet Controller (Fiber) * 82571EB Dual Port Gigabit Mezzanine Adapter @@ -51,9 +50,6 @@ #include "e1000_api.h" -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); static void e1000_release_nvm_82571(struct e1000_hw *hw); static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_init_phy_params_82571"); if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; - goto out; + return E1000_SUCCESS; } phy->addr = 1; @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574; break; default: - ret_val = -E1000_ERR_PHY; - goto out; + return -E1000_ERR_PHY; break; } @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s ret_val = e1000_get_phy_id_82571(hw); if (ret_val) { DEBUGOUT("Error getting PHY ID\n"); - goto out; + return ret_val; } /* Verify phy id */ @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s if (ret_val) DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); -out: return ret_val; } @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s if (((eecd >> 15) & 0x3) == 0x3) { nvm->type = e1000_nvm_flash_hw; nvm->word_size = 2048; - /* - * Autonomous Flash update bit must be cleared due + /* Autonomous Flash update bit must be cleared due * to Flash update issue. */ eecd &= ~E1000_EECD_AUPDEN; @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value + /* Added to a constant, "size" becomes the left-shift value * for setting word_size. */ size += NVM_WORD_SIZE_BASE_SHIFT; @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s /* FWSM register */ mac->has_fwsm = TRUE; - /* - * ARC supported; valid only if manageability features are + /* ARC supported; valid only if manageability features are * enabled. */ - mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & - E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & + E1000_FWSM_MODE_MASK); break; case e1000_82574: case e1000_82583: @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s break; } - /* - * Ensure that the inter-port SWSM.SMBI lock bit is clear before + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before * first NVM or PHY acess. This should be done for single-port * devices, and for one port only on dual-port devices so that * for those devices we can still use the SMBI lock to synchronize @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | E1000_SWSM2_LOCK); force_clear_smbi = TRUE; - } else + } else { force_clear_smbi = FALSE; + } break; default: force_clear_smbi = TRUE; @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); } - /* - * Initialze device specific counter of SMBI acquisition - * timeouts. - */ + /* Initialze device specific counter of SMBI acquisition timeouts. */ hw->dev_spec._82571.smb_counter = 0; return E1000_SUCCESS; @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_id = 0; DEBUGFUNC("e1000_get_phy_id_82571"); @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct switch (hw->mac.type) { case e1000_82571: case e1000_82572: - /* - * The 82571 firmware may still be configuring the PHY. + /* The 82571 firmware may still be configuring the PHY. * In this case, we cannot access the PHY until the * configuration is done. So we explicitly set the * PHY ID. @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct phy->id = IGP01E1000_I_PHY_ID; break; case e1000_82573: - ret_val = e1000_get_phy_id(hw); + return e1000_get_phy_id(hw); break; case e1000_82574: case e1000_82583: ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); if (ret_val) - goto out; + return ret_val; phy->id = (u32)(phy_id << 16); usec_delay(20); ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); if (ret_val) - goto out; + return ret_val; phy->id |= (u32)(phy_id); phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); break; default: - ret_val = -E1000_ERR_PHY; + return -E1000_ERR_PHY; break; } -out: - return ret_val; + + return E1000_SUCCESS; } /** @@ -528,15 +514,13 @@ out: static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; - s32 ret_val = E1000_SUCCESS; s32 sw_timeout = hw->nvm.word_size + 1; s32 fw_timeout = hw->nvm.word_size + 1; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore_82571"); - /* - * If we have timedout 3 times on trying to acquire + /* If we have timedout 3 times on trying to acquire * the inter-port SMBI semaphore, there is old code * operating on the other port, and it is not * releasing SMBI. Modify the number of times that @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( /* Release semaphores */ e1000_put_hw_semaphore_82571(hw); DEBUGOUT("Driver can't access the NVM\n"); - ret_val = -E1000_ERR_NVM; - goto out; + return -E1000_ERR_NVM; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) { u32 extcnf_ctrl; - s32 ret_val = E1000_SUCCESS; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore_82573"); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; do { + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) break; - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; - msec_delay(2); i++; } while (i < MDIO_OWNERSHIP_TIMEOUT); @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( /* Release semaphores */ e1000_put_hw_semaphore_82573(hw); DEBUGOUT("Driver can't access the PHY\n"); - ret_val = -E1000_ERR_PHY; - goto out; + return -E1000_ERR_PHY; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 **/ static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) { - u16 data = E1000_READ_REG(hw, E1000_POEMB); + u32 data = E1000_READ_REG(hw, E1000_POEMB); DEBUGFUNC("e1000_set_d0_lplu_state_82574"); @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 **/ static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active) { - u16 data = E1000_READ_REG(hw, E1000_POEMB); + u32 data = E1000_READ_REG(hw, E1000_POEMB); DEBUGFUNC("e1000_set_d3_lplu_state_82574"); @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc ret_val = e1000_get_hw_semaphore_82571(hw); if (ret_val) - goto out; + return ret_val; switch (hw->mac.type) { case e1000_82573: @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc if (ret_val) e1000_put_hw_semaphore_82571(hw); -out: return ret_val; } @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_write_nvm_82571"); @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 ret_val = e1000_update_nvm_checksum_generic(hw); if (ret_val) - goto out; + return ret_val; - /* - * If our nvm is an EEPROM, then we're done + /* If our nvm is an EEPROM, then we're done * otherwise, commit the checksum to the flash NVM. */ if (hw->nvm.type != e1000_nvm_flash_hw) - goto out; + return E1000_SUCCESS; /* Check for pending operations. */ for (i = 0; i < E1000_FLASH_UPDATES; i++) { msec_delay(1); - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) break; } - if (i == E1000_FLASH_UPDATES) { - ret_val = -E1000_ERR_NVM; - goto out; - } + if (i == E1000_FLASH_UPDATES) + return -E1000_ERR_NVM; /* Reset the firmware if using STM opcode. */ if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) { - /* - * The enabling of and the actual reset must be done + /* The enabling of and the actual reset must be done * in two write cycles. */ E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE); @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 for (i = 0; i < E1000_FLASH_UPDATES; i++) { msec_delay(1); - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) break; } - if (i == E1000_FLASH_UPDATES) { - ret_val = -E1000_ERR_NVM; - goto out; - } + if (i == E1000_FLASH_UPDATES) + return -E1000_ERR_NVM; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st { struct e1000_nvm_info *nvm = &hw->nvm; u32 i, eewr = 0; - s32 ret_val = 0; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_write_nvm_eewr_82571"); - /* - * A check for invalid values: offset too large, too many words, + /* A check for invalid values: offset too large, too many words, * and not enough words. */ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || (words == 0)) { DEBUGOUT("nvm parameter(s) out of bounds\n"); - ret_val = -E1000_ERR_NVM; - goto out; + return -E1000_ERR_NVM; } for (i = 0; i < words; i++) { @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st break; } -out: return ret_val; } @@ -988,7 +954,6 @@ out: static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) { s32 timeout = PHY_CFG_TIMEOUT; - s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_get_cfg_done_82571"); @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru } if (!timeout) { DEBUGOUT("MNG configuration cycle has not completed.\n"); - ret_val = -E1000_ERR_RESET; - goto out; + return -E1000_ERR_RESET; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1023,39 +986,40 @@ out: static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 data; DEBUGFUNC("e1000_set_d0_lplu_state_82571"); if (!(phy->ops.read_reg)) - goto out; + return E1000_SUCCESS; ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); if (ret_val) - goto out; + return ret_val; if (active) { data |= IGP02E1000_PM_D0_LPLU; ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, data); if (ret_val) - goto out; + return ret_val; /* When LPLU is enabled, we should disable SmartSpeed */ ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &data); + if (ret_val) + return ret_val; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } else { data &= ~IGP02E1000_PM_D0_LPLU; ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, data); - /* - * LPLU and SmartSpeed are mutually exclusive. LPLU is used + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used * during Dx states where the power conservation is most * important. During driver activity we should enable * SmartSpeed, so performance is maintained. @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 IGP01E1000_PHY_PORT_CONFIG, &data); if (ret_val) - goto out; + return ret_val; data |= IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } else if (phy->smart_speed == e1000_smart_speed_off) { ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &data); if (ret_val) - goto out; + return ret_val; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1101,13 +1064,12 @@ out: **/ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) { - u32 ctrl, ctrl_ext; + u32 ctrl, ctrl_ext, eecd, tctl; s32 ret_val; DEBUGFUNC("e1000_reset_hw_82571"); - /* - * Prevent the PCI-E bus from sticking if there is no TLP connection + /* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ ret_val = e1000_disable_pcie_master_generic(hw); @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); E1000_WRITE_REG(hw, E1000_RCTL, 0); - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); + tctl = E1000_READ_REG(hw, E1000_TCTL); + tctl &= ~E1000_TCTL_EN; + E1000_WRITE_REG(hw, E1000_TCTL, tctl); E1000_WRITE_FLUSH(hw); msec_delay(10); - /* - * Must acquire the MDIO ownership before MAC reset. + /* Must acquire the MDIO ownership before MAC reset. * Ownership defaults to firmware after a reset. */ switch (hw->mac.type) { @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) /* We don't want to continue accessing MAC registers. */ - goto out; + return ret_val; - /* - * Phy configuration from NVM just starts after EECD_AUTO_RD is set. + /* Phy configuration from NVM just starts after EECD_AUTO_RD is set. * Need to wait for Phy configuration completion before accessing * NVM and Phy. */ switch (hw->mac.type) { + case e1000_82571: + case e1000_82572: + /* REQ and GNT bits need to be cleared when using AUTO_RD + * to access the EEPROM. + */ + eecd = E1000_READ_REG(hw, E1000_EECD); + eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT); + E1000_WRITE_REG(hw, E1000_EECD, eecd); + break; case e1000_82573: case e1000_82574: case e1000_82583: @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e /* Install any alternate MAC address into RAR0 */ ret_val = e1000_check_alt_mac_addr_generic(hw); if (ret_val) - goto out; + return ret_val; e1000_set_laa_state_82571(hw, TRUE); } @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e if (hw->phy.media_type == e1000_media_type_internal_serdes) hw->mac.serdes_link_state = e1000_serdes_link_down; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); + /* An error is not fatal and we should not stop init due to this */ if (ret_val) DEBUGOUT("Error initializing identification LED\n"); - /* This is not fatal and we should not stop init due to this */ /* Disabling VLAN filtering */ DEBUGOUT("Initializing the IEEE VLAN\n"); mac->ops.clear_vfta(hw); - /* Setup the receive address. */ - /* + /* Setup the receive address. * If, however, a locally administered address was assigned to the * 82571, we must reserve a RAR for it to work around an issue where * resetting one port will reload the MAC on the other port. @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 break; } - /* - * Clear all of the statistics registers (clear on read). It is + /* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link. @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); } - /* - * Workaround for hardware errata. + /* Workaround for hardware errata. * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 */ if ((hw->mac.type == e1000_82571) || @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); } + /* Disable IPv6 extension header parsing because some malformed + * IPv6 headers can hang the Rx. + */ + if (hw->mac.type <= e1000_82573) { + reg = E1000_READ_REG(hw, E1000_RFCTL); + reg |= (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS); + E1000_WRITE_REG(hw, E1000_RFCTL, reg); + } + /* PCI-Ex Control Registers */ switch (hw->mac.type) { case e1000_82574: @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 reg |= (1 << 22); E1000_WRITE_REG(hw, E1000_GCR, reg); - /* - * Workaround for hardware errata. + /* Workaround for hardware errata. * apply workaround for hardware errata documented in errata * docs Fixes issue where some error prone or unreliable PCIe * completions are occurring, particularly with ASPM enabled. @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc case e1000_82574: case e1000_82583: if (hw->mng_cookie.vlan_id != 0) { - /* - * The VFTA is a 4096b bit-field, each identifying + /* The VFTA is a 4096b bit-field, each identifying * a single VLAN ID. The following operations * determine which 32b entry (i.e. offset) into the * array we want to set the VLAN ID (i.e. bit) of * the manageability unit. */ vfta_offset = (hw->mng_cookie.vlan_id >> - E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; - vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); + E1000_VFTA_ENTRY_SHIFT) & + E1000_VFTA_ENTRY_MASK; + vfta_bit_in_reg = + 1 << (hw->mng_cookie.vlan_id & + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); } break; default: break; } for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { - /* - * If the offset we want to clear is the same offset of the + /* If the offset we want to clear is the same offset of the * manageability VLAN ID, then clear all bits except that of * the manageability unit. */ @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 ctrl = hw->mac.ledctl_mode2; if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { - /* - * If no link, then turn LED on by setting the invert bit + /* If no link, then turn LED on by setting the invert bit * for each LED that's "on" (0x0E) in ledctl_mode2. */ for (i = 0; i < 4; i++) @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ { u16 status_1kbt = 0; u16 receive_errors = 0; - bool phy_hung = FALSE; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_check_phy_82574"); - /* - * Read PHY Receive Error counter first, if its is max - all F's then + /* Read PHY Receive Error counter first, if its is max - all F's then * read the Base1000T status register If both are max then PHY is hung. */ ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); if (ret_val) - goto out; + return FALSE; if (receive_errors == E1000_RECEIVE_ERROR_MAX) { ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, &status_1kbt); if (ret_val) - goto out; + return FALSE; if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == E1000_IDLE_ERROR_COUNT_MASK) - phy_hung = TRUE; + return TRUE; } -out: - return phy_hung; + + return FALSE; } @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct { DEBUGFUNC("e1000_setup_link_82571"); - /* - * 82573 does not have a word in the NVM to determine + /* 82573 does not have a word in the NVM to determine * the default flow control setting, so we explicitly * set it to full. */ @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 ret_val = e1000_copper_link_setup_igp(hw); break; default: - ret_val = -E1000_ERR_PHY; + return -E1000_ERR_PHY; break; } if (ret_val) - goto out; - - ret_val = e1000_setup_copper_link_generic(hw); + return ret_val; -out: - return ret_val; + return e1000_setup_copper_link_generic(hw); } /** @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link switch (hw->mac.type) { case e1000_82571: case e1000_82572: - /* - * If SerDes loopback mode is entered, there is no form + /* If SerDes loopback mode is entered, there is no form * of reset to take the adapter out of that mode. So we * have to explicitly take the adapter out of loopback * mode. This prevents drivers from twiddling their thumbs @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 ctrl = E1000_READ_REG(hw, E1000_CTRL); status = E1000_READ_REG(hw, E1000_STATUS); + E1000_READ_REG(hw, E1000_RXCW); + /* SYNCH bit and IV bit are sticky */ + usec_delay(10); rxcw = E1000_READ_REG(hw, E1000_RXCW); if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { - /* Receiver is synchronized with no invalid bits. */ switch (mac->serdes_link_state) { case e1000_serdes_link_autoneg_complete: if (!(status & E1000_STATUS_LU)) { - /* - * We have lost link, retry autoneg before + /* We have lost link, retry autoneg before * reporting link failure */ mac->serdes_link_state = @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 break; case e1000_serdes_link_forced_up: - /* - * If we are receiving /C/ ordered sets, re-enable + /* If we are receiving /C/ ordered sets, re-enable * auto-negotiation in the TXCW register and disable * forced link in the Device Control register in an * attempt to auto-negotiate with our link partner. - * If the partner code word is null, stop forcing - * and restart auto negotiation. */ - if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { + if (rxcw & E1000_RXCW_C) { /* Enable autoneg, and unforce link up */ E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); E1000_WRITE_REG(hw, E1000_CTRL, @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 case e1000_serdes_link_autoneg_progress: if (rxcw & E1000_RXCW_C) { - /* - * We received /C/ ordered sets, meaning the + /* We received /C/ ordered sets, meaning the * link partner has autonegotiated, and we can * trust the Link Up (LU) status bit. */ @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 DEBUGOUT("AN_PROG -> DOWN\n"); } } else { - /* - * The link partner did not autoneg. + /* The link partner did not autoneg. * Force link up and full duplex, and change * state to forced. */ @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 case e1000_serdes_link_down: default: - /* - * The link was down but the receiver has now gained + /* The link was down but the receiver has now gained * valid sync, so lets see if we can bring the link * up. */ @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 mac->serdes_link_state = e1000_serdes_link_down; DEBUGOUT("ANYSTATE -> DOWN\n"); } else { - /* - * Check several times, if Sync and Config - * both are consistently 1 then simply ignore - * the Invalid bit and restart Autoneg + /* Check several times, if SYNCH bit and CONFIG + * bit both are consistently 1 then simply ignore + * the IV bit and restart Autoneg */ for (i = 0; i < AN_RETRY_COUNT; i++) { usec_delay(10); rxcw = E1000_READ_REG(hw, E1000_RXCW); - if ((rxcw & E1000_RXCW_IV) && - !((rxcw & E1000_RXCW_SYNCH) && - (rxcw & E1000_RXCW_C))) { + if ((rxcw & E1000_RXCW_SYNCH) && + (rxcw & E1000_RXCW_C)) + continue; + + if (rxcw & E1000_RXCW_IV) { mac->serdes_has_link = FALSE; mac->serdes_link_state = e1000_serdes_link_down; @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); if (ret_val) { DEBUGOUT("NVM Read Error\n"); - goto out; + return ret_val; } switch (hw->mac.type) { @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 break; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 /* If workaround is activated... */ if (state) - /* - * Hold a copy of the LAA in RAR[14] This is done so that + /* Hold a copy of the LAA in RAR[14] This is done so that * between the time RAR[0] gets clobbered and the time it * gets fixed, the actual LAA is in one of the RARs and no * incoming packets directed to this port are dropped. * Eventually the LAA will be in RAR[0] and RAR[14]. */ hw->mac.ops.rar_set(hw, hw->mac.addr, - hw->mac.rar_entry_count - 1); + hw->mac.rar_entry_count - 1); return; } @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) { struct e1000_nvm_info *nvm = &hw->nvm; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 data; DEBUGFUNC("e1000_fix_nvm_checksum_82571"); if (nvm->type != e1000_nvm_flash_hw) - goto out; + return E1000_SUCCESS; - /* - * Check bit 4 of word 10h. If it is 0, firmware is done updating + /* Check bit 4 of word 10h. If it is 0, firmware is done updating * 10h-12h. Checksum may need to be fixed. */ ret_val = nvm->ops.read(hw, 0x10, 1, &data); if (ret_val) - goto out; + return ret_val; if (!(data & 0x10)) { - /* - * Read 0x23 and check bit 15. This bit is a 1 + /* Read 0x23 and check bit 15. This bit is a 1 * when the checksum has already been fixed. If * the checksum is still wrong and this bit is a * 1, we need to return bad checksum. Otherwise, @@ -1952,19 +1911,20 @@ static s32 e1000_fix_nvm_checksum_82571( */ ret_val = nvm->ops.read(hw, 0x23, 1, &data); if (ret_val) - goto out; + return ret_val; if (!(data & 0x8000)) { data |= 0x8000; ret_val = nvm->ops.write(hw, 0x23, 1, &data); if (ret_val) - goto out; + return ret_val; ret_val = nvm->ops.update(hw); + if (ret_val) + return ret_val; } } -out: - return ret_val; + return E1000_SUCCESS; } @@ -1974,25 +1934,21 @@ out: **/ static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; - DEBUGFUNC("e1000_read_mac_addr_82571"); if (hw->mac.type == e1000_82571) { - /* - * If there's an alternate MAC address place it in RAR0 + s32 ret_val; + + /* If there's an alternate MAC address place it in RAR0 * so that it will override the Si installed default perm * address. */ ret_val = e1000_check_alt_mac_addr_generic(hw); if (ret_val) - goto out; + return ret_val; } - ret_val = e1000_read_mac_addr_generic(hw); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 00:26:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B13FE4CB; Thu, 21 Feb 2013 00:26:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A37987DF; Thu, 21 Feb 2013 00:26:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L0QV9M091507; Thu, 21 Feb 2013 00:26:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L0QVic091506; Thu, 21 Feb 2013 00:26:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210026.r1L0QVic091506@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 00:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247065 - head/sys/dev/ppc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 00:26:31 -0000 Author: imp Date: Thu Feb 21 00:26:31 2013 New Revision: 247065 URL: http://svnweb.freebsd.org/changeset/base/247065 Log: No longer need splhigh() since locking was done, delete it and comments about it. Modified: head/sys/dev/ppc/ppc_isa.c Modified: head/sys/dev/ppc/ppc_isa.c ============================================================================== --- head/sys/dev/ppc/ppc_isa.c Thu Feb 21 00:25:45 2013 (r247064) +++ head/sys/dev/ppc/ppc_isa.c Thu Feb 21 00:26:31 2013 (r247065) @@ -141,7 +141,7 @@ ppc_isa_write(device_t dev, char *buf, i { struct ppc_data *ppc = device_get_softc(dev); char ecr, ecr_sav, ctr, ctr_sav; - int s, error = 0; + int error = 0; int spin; PPC_ASSERT_LOCKED(ppc); @@ -190,12 +190,6 @@ ppc_isa_write(device_t dev, char *buf, i w_ecr(ppc, ecr); ecr = r_ecr(ppc); - /* enter splhigh() not to be preempted - * by the dma interrupt, we may miss - * the wakeup otherwise - */ - s = splhigh(); - ppc->ppc_dmastat = PPC_DMA_INIT; /* enable interrupts */ @@ -221,8 +215,6 @@ ppc_isa_write(device_t dev, char *buf, i "ppcdma", 0); } while (error == EWOULDBLOCK); - splx(s); - if (error) { #ifdef PPC_DEBUG printf("i"); From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 00:27:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8916E6A9; Thu, 21 Feb 2013 00:27:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5BD7F8; Thu, 21 Feb 2013 00:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L0RqlF091749; Thu, 21 Feb 2013 00:27:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L0Rqv3091748; Thu, 21 Feb 2013 00:27:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210027.r1L0Rqv3091748@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 00:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247066 - head/sys/dev/ppc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 00:27:52 -0000 Author: imp Date: Thu Feb 21 00:27:51 2013 New Revision: 247066 URL: http://svnweb.freebsd.org/changeset/base/247066 Log: Replace splhigh() with critical_enter()/leave() to ensure we write the config mode unlock sequence quickly enough. This likely isn't too critical, since splhigh() has been a noop for a decade... Modified: head/sys/dev/ppc/ppc.c Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Thu Feb 21 00:26:31 2013 (r247065) +++ head/sys/dev/ppc/ppc.c Thu Feb 21 00:27:51 2013 (r247066) @@ -74,6 +74,22 @@ static void ppcintr(void *arg); #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev)) +/* + * We use critical enter/leave for the simple config locking needed to + * detect the devices. We just want to make sure that both of our writes + * happen without someone else also writing to those config registers. Since + * we just do this at startup, Giant keeps multiple threads from executing, + * and critical_enter() then is all that's needed to keep us from being preempted + * during the critical sequences with the hardware. + * + * Note: this doesn't prevent multiple threads from putting the chips into + * config mode, but since we only do that to detect the type at startup the + * extra overhead isn't needed since Giant protects us from multiple entry + * and no other code changes these registers. + */ +#define PPC_CONFIG_LOCK(ppc) critical_enter() +#define PPC_CONFIG_UNLOCK(ppc) critical_leave() + devclass_t ppc_devclass; const char ppc_driver_name[] = "ppc"; @@ -689,7 +705,7 @@ ppc_pc873xx_detect(struct ppc_data *ppc, static int ppc_smc37c66xgt_detect(struct ppc_data *ppc, int chipset_mode) { - int s, i; + int i; u_char r; int type = -1; int csr = SMC66x_CSR; /* initial value is 0x3F0 */ @@ -702,11 +718,10 @@ ppc_smc37c66xgt_detect(struct ppc_data * /* * Detection: enter configuration mode and read CRD register. */ - - s = splhigh(); + PPC_CONFIG_LOCK(ppc); outb(csr, SMC665_iCODE); outb(csr, SMC665_iCODE); - splx(s); + PPC_CONFIG_UNLOCK(ppc); outb(csr, 0xd); if (inb(cio) == 0x65) { @@ -715,10 +730,10 @@ ppc_smc37c66xgt_detect(struct ppc_data * } for (i = 0; i < 2; i++) { - s = splhigh(); + PPC_CONFIG_LOCK(ppc); outb(csr, SMC666_iCODE); outb(csr, SMC666_iCODE); - splx(s); + PPC_CONFIG_UNLOCK(ppc); outb(csr, 0xd); if (inb(cio) == 0x66) { @@ -734,16 +749,20 @@ config: /* * If chipset not found, do not continue. */ - if (type == -1) + if (type == -1) { + outb(csr, 0xaa); /* end config mode */ return (-1); + } /* select CR1 */ outb(csr, 0x1); /* read the port's address: bits 0 and 1 of CR1 */ r = inb(cio) & SMC_CR1_ADDR; - if (port_address[(int)r] != ppc->ppc_base) + if (port_address[(int)r] != ppc->ppc_base) { + outb(csr, 0xaa); /* end config mode */ return (-1); + } ppc->ppc_model = type; @@ -881,8 +900,7 @@ end_detect: outb(cio, (r | SMC_CR4_EPPTYPE)); } - /* end config mode */ - outb(csr, 0xaa); + outb(csr, 0xaa); /* end config mode */ ppc->ppc_type = PPC_TYPE_SMCLIKE; ppc_smclike_setmode(ppc, chipset_mode); @@ -897,13 +915,12 @@ end_detect: static int ppc_smc37c935_detect(struct ppc_data *ppc, int chipset_mode) { - int s; int type = -1; - s = splhigh(); + PPC_CONFIG_LOCK(ppc); outb(SMC935_CFG, 0x55); /* enter config mode */ outb(SMC935_CFG, 0x55); - splx(s); + PPC_CONFIG_UNLOCK(ppc); outb(SMC935_IND, SMC935_ID); /* check device id */ if (inb(SMC935_DAT) == 0x2) From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 00:36:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F4988B4; Thu, 21 Feb 2013 00:36:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A16D847; Thu, 21 Feb 2013 00:36:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L0aCRh094566; Thu, 21 Feb 2013 00:36:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L0aCVs094565; Thu, 21 Feb 2013 00:36:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210036.r1L0aCVs094565@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 00:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247067 - head/sys/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 00:36:13 -0000 Author: imp Date: Thu Feb 21 00:36:12 2013 New Revision: 247067 URL: http://svnweb.freebsd.org/changeset/base/247067 Log: Kill now-bogus splhigh() -- it is a nop Modified: head/sys/pci/ncr.c Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Thu Feb 21 00:27:51 2013 (r247066) +++ head/sys/pci/ncr.c Thu Feb 21 00:36:12 2013 (r247067) @@ -5544,7 +5544,6 @@ static void ncr_exception (ncb_p np) ** Freeze system to be able to read the messages. */ printf ("ncr: fatal error: system halted - press reset to reboot ..."); - (void) splhigh(); for (;;); #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 00:40:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9D49A8F; Thu, 21 Feb 2013 00:40:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD52D871; Thu, 21 Feb 2013 00:40:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L0e8rf095141; Thu, 21 Feb 2013 00:40:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L0e80m095140; Thu, 21 Feb 2013 00:40:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210040.r1L0e80m095140@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 00:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247068 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 00:40:08 -0000 Author: imp Date: Thu Feb 21 00:40:08 2013 New Revision: 247068 URL: http://svnweb.freebsd.org/changeset/base/247068 Log: Fix broken usage of splhigh() by removing it. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Thu Feb 21 00:36:12 2013 (r247067) +++ head/sys/x86/isa/atrtc.c Thu Feb 21 00:40:08 2013 (r247068) @@ -328,7 +328,6 @@ static int atrtc_gettime(device_t dev, struct timespec *ts) { struct clocktime ct; - int s; /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { @@ -338,11 +337,8 @@ atrtc_gettime(device_t dev, struct times /* wait for time update to complete */ /* If RTCSA_TUP is zero, we have at least 244us before next update */ - s = splhigh(); - while (rtcin(RTC_STATUSA) & RTCSA_TUP) { - splx(s); - s = splhigh(); - } + while (rtcin(RTC_STATUSA) & RTCSA_TUP) + continue; ct.nsec = 0; ct.sec = readrtc(RTC_SEC); ct.min = readrtc(RTC_MIN); From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 02:34:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2185AFC2; Thu, 21 Feb 2013 02:34:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 141B0C3F; Thu, 21 Feb 2013 02:34:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2Y4Lv031842; Thu, 21 Feb 2013 02:34:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2Y4a4031841; Thu, 21 Feb 2013 02:34:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210234.r1L2Y4a4031841@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 02:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247069 - head/sys/dev/mcd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 02:34:05 -0000 Author: imp Date: Thu Feb 21 02:34:04 2013 New Revision: 247069 URL: http://svnweb.freebsd.org/changeset/base/247069 Log: The other giant locked storage drivers have removed splbio(), for the most part, so remove it here too. Anybody locking this driver will need far more than locks where splbio() were, so remove these nops. Modified: head/sys/dev/mcd/mcd.c Modified: head/sys/dev/mcd/mcd.c ============================================================================== --- head/sys/dev/mcd/mcd.c Thu Feb 21 00:40:08 2013 (r247068) +++ head/sys/dev/mcd/mcd.c Thu Feb 21 02:34:04 2013 (r247069) @@ -289,7 +289,6 @@ static void mcdstrategy(struct bio *bp) { struct mcd_softc *sc; - int s; sc = (struct mcd_softc *)bp->bio_dev->si_drv1; @@ -318,9 +317,7 @@ mcdstrategy(struct bio *bp) bp->bio_resid = 0; /* queue it */ - s = splbio(); bioq_disksort(&sc->data.head, bp); - splx(s); /* now check whether we can perform processing */ mcd_start(sc); @@ -338,10 +335,8 @@ static void mcd_start(struct mcd_softc *sc) { struct bio *bp; - int s = splbio(); if (sc->data.flags & MCDMBXBSY) { - splx(s); return; } @@ -350,10 +345,8 @@ mcd_start(struct mcd_softc *sc) /* block found to process, dequeue */ /*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/ sc->data.flags |= MCDMBXBSY; - splx(s); } else { /* nothing to do */ - splx(s); return; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 02:40:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B67D53B8; Thu, 21 Feb 2013 02:40:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8C8CCE9; Thu, 21 Feb 2013 02:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2eKu8034153; Thu, 21 Feb 2013 02:40:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2eKOq034145; Thu, 21 Feb 2013 02:40:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210240.r1L2eKOq034145@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 02:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247070 - head/sys/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 02:40:20 -0000 Author: imp Date: Thu Feb 21 02:40:20 2013 New Revision: 247070 URL: http://svnweb.freebsd.org/changeset/base/247070 Log: Most other giant locked storage drivers in the tree don't use splsoftclock to note the need for future locking, so remove it from here. Modified: head/sys/pci/ncr.c Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Thu Feb 21 02:34:04 2013 (r247069) +++ head/sys/pci/ncr.c Thu Feb 21 02:40:20 2013 (r247070) @@ -6396,12 +6396,8 @@ static nccb_p ncr_get_nccb (ncb_p np, u_long target, u_long lun) { lcb_p lp; - int s; nccb_p cp = NULL; - /* Keep our timeout handler out */ - s = splsoftclock(); - /* ** Lun structure available ? */ @@ -6434,7 +6430,6 @@ static nccb_p ncr_get_nccb } cp->magic = 1; } - splx(s); return (cp); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 02:41:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82EE4617; Thu, 21 Feb 2013 02:41:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 762D2CFF; Thu, 21 Feb 2013 02:41:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2fcPS034727; Thu, 21 Feb 2013 02:41:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2fcAe034726; Thu, 21 Feb 2013 02:41:38 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201302210241.r1L2fcAe034726@svn.freebsd.org> From: Jamie Gritton Date: Thu, 21 Feb 2013 02:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247071 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 02:41:38 -0000 Author: jamie Date: Thu Feb 21 02:41:37 2013 New Revision: 247071 URL: http://svnweb.freebsd.org/changeset/base/247071 Log: Don't worry if a module is already loaded when looking for a fstype to mount (possible in a race condition). Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/vfs_init.c Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Thu Feb 21 02:40:20 2013 (r247070) +++ head/sys/kern/vfs_init.c Thu Feb 21 02:41:37 2013 (r247071) @@ -122,7 +122,7 @@ struct vfsconf * vfs_byname_kld(const char *fstype, struct thread *td, int *error) { struct vfsconf *vfsp; - int fileid; + int fileid, loaded; vfsp = vfs_byname(fstype); if (vfsp != NULL) @@ -130,13 +130,17 @@ vfs_byname_kld(const char *fstype, struc /* Try to load the respective module. */ *error = kern_kldload(td, fstype, &fileid); + loaded = (*error == 0); + if (*error == EEXIST) + *error = 0; if (*error) return (NULL); /* Look up again to see if the VFS was loaded. */ vfsp = vfs_byname(fstype); if (vfsp == NULL) { - (void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE); + if (loaded) + (void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE); *error = ENODEV; return (NULL); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 02:43:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55C567AE; Thu, 21 Feb 2013 02:43:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48D0DD1B; Thu, 21 Feb 2013 02:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2hjZp035055; Thu, 21 Feb 2013 02:43:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2hjnT035054; Thu, 21 Feb 2013 02:43:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210243.r1L2hjnT035054@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 02:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247072 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 02:43:45 -0000 Author: imp Date: Thu Feb 21 02:43:44 2013 New Revision: 247072 URL: http://svnweb.freebsd.org/changeset/base/247072 Log: The request queue is already locked, so we don't need the splsofclock/splx here to note future work. Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Thu Feb 21 02:41:37 2013 (r247071) +++ head/sys/fs/nfsclient/nfs_clstate.c Thu Feb 21 02:43:44 2013 (r247072) @@ -1888,7 +1888,7 @@ nfscl_recover(struct nfsclclient *clp, s struct nfsreq *rep; u_int64_t len; u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode; - int i, igotlock = 0, error, trycnt, firstlock, s; + int i, igotlock = 0, error, trycnt, firstlock; struct nfscllayout *lyp, *nlyp; /* @@ -1945,14 +1945,12 @@ nfscl_recover(struct nfsclclient *clp, s * This will be translated to NFSERR_STALEDONTRECOVER when * R_DONTRECOVER is set. */ - s = splsoftclock(); NFSLOCKREQ(); TAILQ_FOREACH(rep, &nfsd_reqq, r_chain) { if (rep->r_nmp == nmp) rep->r_flags |= R_DONTRECOVER; } NFSUNLOCKREQ(); - splx(s); /* * Now, mark all delegations "need reclaim". From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 02:52:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCC87B03; Thu, 21 Feb 2013 02:52:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AED36D69; Thu, 21 Feb 2013 02:52:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2qDch037956; Thu, 21 Feb 2013 02:52:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2qDdk037955; Thu, 21 Feb 2013 02:52:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302210252.r1L2qDdk037955@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Feb 2013 02:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247073 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 02:52:13 -0000 Author: adrian Date: Thu Feb 21 02:52:13 2013 New Revision: 247073 URL: http://svnweb.freebsd.org/changeset/base/247073 Log: Remove this unneeded printf(), sorry! Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 21 02:43:44 2013 (r247072) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 21 02:52:13 2013 (r247073) @@ -254,10 +254,6 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5212(ah)->ah_txTrigLev = (AR_FTRIG_512B >> AR_FTRIG_S); AH5212(ah)->ah_maxTxTrigLev = ((4096 / 64) - 1); } - ath_hal_printf(ah, "%s: trigLev=%d, maxTxTrigLev=%d\n", - __func__, - AH5212(ah)->ah_txTrigLev, - AH5212(ah)->ah_maxTxTrigLev); #undef AR_FTRIG_512B } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 06:18:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6693EC3D; Thu, 21 Feb 2013 06:18:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49B1B11C8; Thu, 21 Feb 2013 06:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L6IgwS000793; Thu, 21 Feb 2013 06:18:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L6IfTL000788; Thu, 21 Feb 2013 06:18:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302210618.r1L6IfTL000788@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Feb 2013 06:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247085 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 06:18:42 -0000 Author: adrian Date: Thu Feb 21 06:18:40 2013 New Revision: 247085 URL: http://svnweb.freebsd.org/changeset/base/247085 Log: Add a new option to limit the maximum size of aggregates. The default is to limit them to what the hardware is capable of. Add sysctl twiddles for both the non-RTS and RTS protected aggregate generation. Whilst here, add some comments about stuff that I've discovered during my exploration of the TX aggregate / delimiter setup path from the reference driver. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 21 06:12:26 2013 (r247084) +++ head/sys/dev/ath/if_ath.c Thu Feb 21 06:18:40 2013 (r247085) @@ -799,6 +799,7 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hwq_limit = ATH_AGGR_MIN_QDEPTH; sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; + sc->sc_aggr_limit = ATH_AGGR_MAXSIZE; /* * Check if the hardware requires PCI register serialisation. Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Feb 21 06:12:26 2013 (r247084) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Feb 21 06:18:40 2013 (r247085) @@ -704,7 +704,7 @@ ath_sysctlattach(struct ath_softc *sc) SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "hwq_limit", CTLFLAG_RW, &sc->sc_hwq_limit, 0, - ""); + "Hardware queue depth before software-queuing TX frames"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tid_hwq_lo", CTLFLAG_RW, &sc->sc_tid_hwq_lo, 0, ""); @@ -712,6 +712,12 @@ ath_sysctlattach(struct ath_softc *sc) "tid_hwq_hi", CTLFLAG_RW, &sc->sc_tid_hwq_hi, 0, ""); + /* Aggregate length twiddles */ + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "aggr_limit", CTLFLAG_RW, &sc->sc_aggr_limit, 0, ""); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "rts_aggr_limit", CTLFLAG_RW, &sc->sc_rts_aggr_limit, 0, ""); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "txq_data_minfree", CTLFLAG_RW, &sc->sc_txq_data_minfree, 0, "Minimum free buffers before adding a data frame" Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Thu Feb 21 06:12:26 2013 (r247084) +++ head/sys/dev/ath/if_ath_tx.h Thu Feb 21 06:18:40 2013 (r247085) @@ -79,6 +79,11 @@ #define BAW_WITHIN(_start, _bawsz, _seqno) \ ((((_seqno) - (_start)) & 4095) < (_bawsz)) +/* + * Maximum aggregate size + */ +#define ATH_AGGR_MAXSIZE 65530 + extern void ath_freetx(struct mbuf *m); extern void ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an); extern void ath_tx_txq_drain(struct ath_softc *sc, struct ath_txq *txq); Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 21 06:12:26 2013 (r247084) +++ head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 21 06:18:40 2013 (r247085) @@ -346,12 +346,19 @@ ath_compute_num_delims(struct ath_softc * crypto hardware catch up. This could be tuned per-MAC and * per-rate, but for now we'll simply assume encryption is * always enabled. + * + * Also note that the Atheros reference driver inserts two + * delimiters by default for pre-AR9380 peers. This will + * include "that" required delimiter. */ ndelim += ATH_AGGR_ENCRYPTDELIM; /* * For AR9380, there's a minimum number of delimeters * required when doing RTS. + * + * XXX TODO: this is only needed if (a) RTS/CTS is enabled, and + * XXX (b) this is the first sub-frame in the aggregate. */ if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR) && ndelim < AH_FIRST_DESC_NDELIMS) @@ -420,9 +427,12 @@ ath_compute_num_delims(struct ath_softc static int ath_get_aggr_limit(struct ath_softc *sc, struct ath_buf *bf) { - int amin = 65530; + int amin = ATH_AGGR_MAXSIZE; int i; + if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) + amin = sc->sc_aggr_limit; + for (i = 0; i < ATH_RC_NUM; i++) { if (bf->bf_state.bfs_rc[i].tries == 0) continue; @@ -488,6 +498,13 @@ ath_rateseries_setup(struct ath_softc *s * XXX It's overridden in the HAL rate scenario function * XXX for now. */ + /* + * XXX TODO: When the NIC is capable of three stream TX, + * transmit 1/2 stream rates on two streams. + * + * This reduces the power consumption of the NIC and + * keeps it within the PCIe slot power limits. + */ series[i].ChSel = sc->sc_txchainmask; if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Feb 21 06:12:26 2013 (r247084) +++ head/sys/dev/ath/if_athvar.h Thu Feb 21 06:18:40 2013 (r247085) @@ -718,6 +718,7 @@ struct ath_softc { int sc_txchainmask; /* currently configured TX chainmask */ int sc_rxchainmask; /* currently configured RX chainmask */ int sc_rts_aggr_limit; /* TX limit on RTS aggregates */ + int sc_aggr_limit; /* TX limit on all aggregates */ /* Queue limits */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 06:38:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD30CF7F; Thu, 21 Feb 2013 06:38:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0299125F; Thu, 21 Feb 2013 06:38:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L6cOim006679; Thu, 21 Feb 2013 06:38:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L6cOVx006678; Thu, 21 Feb 2013 06:38:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210638.r1L6cOVx006678@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 06:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247086 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 06:38:24 -0000 Author: imp Date: Thu Feb 21 06:38:24 2013 New Revision: 247086 URL: http://svnweb.freebsd.org/changeset/base/247086 Log: Correct comment about use of pmtimer, and the real reason it isn't used or desirable for amd64. Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Thu Feb 21 06:18:40 2013 (r247085) +++ head/sys/x86/isa/clock.c Thu Feb 21 06:38:24 2013 (r247086) @@ -478,9 +478,10 @@ i8254_restore(void) * * This function is called from pmtimer_resume() to restore all the timers. * This should not be necessary, but there are broken laptops that do not - * restore all the timers on resume. - * As long as pmtimer is not part of amd64 suport, skip this for the amd64 - * case. + * restore all the timers on resume. The APM spec was at best vague on the + * subject. + * pmtimer is used only with the old APM power management, and not with + * acpi, which is required for amd64, so skip it in that case. */ void timer_restore(void) From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 06:38:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FE4718E; Thu, 21 Feb 2013 06:38:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4413912A1; Thu, 21 Feb 2013 06:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L6coJC006776; Thu, 21 Feb 2013 06:38:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L6cnsn006769; Thu, 21 Feb 2013 06:38:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302210638.r1L6cnsn006769@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Feb 2013 06:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247087 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 06:38:50 -0000 Author: adrian Date: Thu Feb 21 06:38:49 2013 New Revision: 247087 URL: http://svnweb.freebsd.org/changeset/base/247087 Log: Add an option to allow the minimum number of delimiters to be tweaked. This is primarily for debugging purposes. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 21 06:38:24 2013 (r247086) +++ head/sys/dev/ath/if_ath.c Thu Feb 21 06:38:49 2013 (r247087) @@ -800,6 +800,7 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; sc->sc_aggr_limit = ATH_AGGR_MAXSIZE; + sc->sc_delim_min_pad = 0; /* * Check if the hardware requires PCI register serialisation. Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Feb 21 06:38:24 2013 (r247086) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Feb 21 06:38:49 2013 (r247087) @@ -714,9 +714,16 @@ ath_sysctlattach(struct ath_softc *sc) /* Aggregate length twiddles */ SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "aggr_limit", CTLFLAG_RW, &sc->sc_aggr_limit, 0, ""); + "aggr_limit", CTLFLAG_RW, &sc->sc_aggr_limit, 0, + "Maximum A-MPDU size, or 0 for 'default'"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "rts_aggr_limit", CTLFLAG_RW, &sc->sc_rts_aggr_limit, 0, ""); + "rts_aggr_limit", CTLFLAG_RW, &sc->sc_rts_aggr_limit, 0, + "Maximum A-MPDU size for RTS-protected frames, or '0' " + "for default"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "delim_min_pad", CTLFLAG_RW, &sc->sc_delim_min_pad, 0, + "Enforce a minimum number of delimiters per A-MPDU " + " sub-frame"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "txq_data_minfree", CTLFLAG_RW, &sc->sc_txq_data_minfree, Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 21 06:38:24 2013 (r247086) +++ head/sys/dev/ath/if_ath_tx_ht.c Thu Feb 21 06:38:49 2013 (r247087) @@ -364,6 +364,13 @@ ath_compute_num_delims(struct ath_softc && ndelim < AH_FIRST_DESC_NDELIMS) ndelim = AH_FIRST_DESC_NDELIMS; + /* + * If sc_delim_min_pad is non-zero, enforce it as the minimum + * pad delimiter count. + */ + if (sc->sc_delim_min_pad != 0) + ndelim = MAX(ndelim, sc->sc_delim_min_pad); + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: pktlen=%d, ndelim=%d, mpdudensity=%d\n", __func__, pktlen, ndelim, mpdudensity); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Feb 21 06:38:24 2013 (r247086) +++ head/sys/dev/ath/if_athvar.h Thu Feb 21 06:38:49 2013 (r247087) @@ -719,6 +719,7 @@ struct ath_softc { int sc_rxchainmask; /* currently configured RX chainmask */ int sc_rts_aggr_limit; /* TX limit on RTS aggregates */ int sc_aggr_limit; /* TX limit on all aggregates */ + int sc_delim_min_pad; /* Minimum delimiter count */ /* Queue limits */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 06:49:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 6C0425E4; Thu, 21 Feb 2013 06:49:12 +0000 (UTC) Date: Thu, 21 Feb 2013 06:49:12 +0000 From: Alexey Dokuchaev To: Warner Losh Subject: Re: svn commit: r247086 - head/sys/x86/isa Message-ID: <20130221064912.GA20360@FreeBSD.org> References: <201302210638.r1L6cOVx006678@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302210638.r1L6cOVx006678@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 06:49:12 -0000 On Thu, Feb 21, 2013 at 06:38:24AM +0000, Warner Losh wrote: > New Revision: 247086 > URL: http://svnweb.freebsd.org/changeset/base/247086 > > Log: > Correct comment about use of pmtimer, and the real reason it isn't > used or desirable for amd64. Thanks! > + * pmtimer is used only with the old APM power management, and not with > + * acpi, which is required for amd64, so skip it in that case. Does it also mean it should be removed from ACPI-driven i386 machines kernel configs? ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 06:57:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83BB290A for ; Thu, 21 Feb 2013 06:57:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 568A514E4 for ; Thu, 21 Feb 2013 06:57:37 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id c12so10791568ieb.6 for ; Wed, 20 Feb 2013 22:57:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=+7T5mBMRZOy7GLre9GJI/LQQA/4cE2CN4302dtIx9k8=; b=LuG0KAIDVbxQtFM5C7zwRghtOVNB6STUNV6NjSnfOdI676ORZZm2rqw3OXc56JZRfK Tay5jg232Rxw6a2HyAqH/ZdBfOgyqVL8V8fK1e5o/NDlMshanYi8mkPcoF8+b5saOmHU VaSKhnN65S1x6nM7cSmv/LkmjlfoEsSDruOo0W2yQwL8yKWY205XIgLjoc31dcdH1Qgn 04dCXzTOzQymN8zMVV36GSU2mtrTk3Cwt0QFLtuqBsnRwqqUrYpj3d92M1i1fpQJurMz yuAiRC119kdjEGtU0Nt+6Y8RXOFCUNBnI8L1hPyjgqccSrW58LDdOEPjR12CQF4pm67Y i32Q== X-Received: by 10.50.152.230 with SMTP id vb6mr12557408igb.23.1361429856987; Wed, 20 Feb 2013 22:57:36 -0800 (PST) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id ip8sm7792814igc.4.2013.02.20.22.57.36 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 22:57:36 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r247086 - head/sys/x86/isa Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130221064912.GA20360@FreeBSD.org> Date: Wed, 20 Feb 2013 23:57:35 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201302210638.r1L6cOVx006678@svn.freebsd.org> <20130221064912.GA20360@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQktWM0TNR3kT/PeST+qwasON6JmqI6ng303e7KdTAO+vdZORKdw2qkRyA46q0B/u30OHcWj Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 06:57:37 -0000 On Feb 20, 2013, at 11:49 PM, Alexey Dokuchaev wrote: > On Thu, Feb 21, 2013 at 06:38:24AM +0000, Warner Losh wrote: >> New Revision: 247086 >> URL: http://svnweb.freebsd.org/changeset/base/247086 >>=20 >> Log: >> Correct comment about use of pmtimer, and the real reason it isn't >> used or desirable for amd64. >=20 > Thanks! >=20 >> + * pmtimer is used only with the old APM power management, and not = with >> + * acpi, which is required for amd64, so skip it in that case. >=20 > Does it also mean it should be removed from ACPI-driven i386 machines = kernel > configs? Likely, but let me confirm with one of the laptops that I have that I = know is affected and supports acpi. Warner From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 07:16:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56A7AE63; Thu, 21 Feb 2013 07:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4946115CB; Thu, 21 Feb 2013 07:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L7GfvH018847; Thu, 21 Feb 2013 07:16:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L7Gf7J018846; Thu, 21 Feb 2013 07:16:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210716.r1L7Gf7J018846@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 07:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247088 - head/sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 07:16:41 -0000 Author: imp Date: Thu Feb 21 07:16:40 2013 New Revision: 247088 URL: http://svnweb.freebsd.org/changeset/base/247088 Log: Locking for todr got pushed down into inittodr and the client libraries it calls (although some might not be doing it right). We are serialized right now by giant as well. This means the splsoftclock are now an anachronism that has no benefit, even marking where locking needs to happen. Remove them. Modified: head/sys/i386/isa/pmtimer.c Modified: head/sys/i386/isa/pmtimer.c ============================================================================== --- head/sys/i386/isa/pmtimer.c Thu Feb 21 06:38:49 2013 (r247087) +++ head/sys/i386/isa/pmtimer.c Thu Feb 21 07:16:40 2013 (r247088) @@ -82,26 +82,21 @@ static struct timeval diff_time; static int pmtimer_suspend(device_t dev) { - int pl; - pl = splsoftclock(); microtime(&diff_time); inittodr(0); microtime(&suspend_time); timevalsub(&diff_time, &suspend_time); - splx(pl); return (0); } static int pmtimer_resume(device_t dev) { - int pl; u_int second, minute, hour; struct timeval resume_time, tmp_time; /* modified for adjkerntz */ - pl = splsoftclock(); timer_restore(); /* restore the all timers */ inittodr(0); /* adjust time to RTC */ microtime(&resume_time); @@ -118,16 +113,13 @@ pmtimer_resume(device_t dev) timevalsub(&resume_time, &suspend_time); /* Fixup the calltodo list with the delta time. */ adjust_timeout_calltodo(&resume_time); -#endif /* PMTIMER_FIXUP_CALLTODOK */ - splx(pl); -#ifndef PMTIMER_FIXUP_CALLTODO - second = resume_time.tv_sec - suspend_time.tv_sec; -#else /* PMTIMER_FIXUP_CALLTODO */ /* * We've already calculated resume_time to be the delta between * the suspend and the resume. */ second = resume_time.tv_sec; +#else /* !PMTIMER_FIXUP_CALLTODO */ + second = resume_time.tv_sec - suspend_time.tv_sec; #endif /* PMTIMER_FIXUP_CALLTODO */ hour = second / 3600; second %= 3600; From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 07:19:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3DB52FD; Thu, 21 Feb 2013 07:19:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B666D1746; Thu, 21 Feb 2013 07:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L7Jopj019284; Thu, 21 Feb 2013 07:19:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L7JoZW019283; Thu, 21 Feb 2013 07:19:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302210719.r1L7JoZW019283@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 07:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247089 - head/sys/dev/si X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 07:19:50 -0000 Author: imp Date: Thu Feb 21 07:19:50 2013 New Revision: 247089 URL: http://svnweb.freebsd.org/changeset/base/247089 Log: Remove incorrect comment about splsoftclock. Modified: head/sys/dev/si/si.c Modified: head/sys/dev/si/si.c ============================================================================== --- head/sys/dev/si/si.c Thu Feb 21 07:16:40 2013 (r247088) +++ head/sys/dev/si/si.c Thu Feb 21 07:19:50 2013 (r247089) @@ -1446,7 +1446,6 @@ si_start(struct tty *tp) #if 0 /* - * Note: called at splsoftclock from the timeout code * This has to deal with two things... cause wakeups while waiting for * tty drains on last process exit, and call l_start at about the right * time for protocols like ppp. From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 08:42:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D76CAD3; Thu, 21 Feb 2013 08:42:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E99F71A82; Thu, 21 Feb 2013 08:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L8getS044991; Thu, 21 Feb 2013 08:42:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L8gePQ044989; Thu, 21 Feb 2013 08:42:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302210842.r1L8gePQ044989@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Feb 2013 08:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247092 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 08:42:41 -0000 Author: adrian Date: Thu Feb 21 08:42:40 2013 New Revision: 247092 URL: http://svnweb.freebsd.org/changeset/base/247092 Log: Be slightly more paranoid with the TX DMA buffer maximum threshold. Specifically - never jack the TX FIFO threshold up to the absolute maximum; always leave enough space for two DMA transactions to appear. This is a paranoia from the Linux ath9k driver. It can't hurt. Obtained from: Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 21 08:21:14 2013 (r247091) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Feb 21 08:42:40 2013 (r247092) @@ -244,9 +244,23 @@ ar5416InitState(struct ath_hal_5416 *ahp /* Set overridable ANI methods */ AH5212(ah)->ah_aniControl = ar5416AniControl; - /* Default FIFO Trigger levels */ + /* + * Default FIFO Trigger levels + * + * These define how filled the TX FIFO needs to be before + * the baseband begins to be given some data. + * + * To be paranoid, we ensure that the TX trigger level always + * has at least enough space for two TX DMA to occur. + * The TX DMA size is currently hard-coded to AR_TXCFG_DMASZ_128B. + * That means we need to leave at least 256 bytes available in + * the TX DMA FIFO. + */ #define AR_FTRIG_512B 0x00000080 // 5 bits total - /* AR9285/AR9271 need to use half the TX FIFOs */ + /* + * AR9285/AR9271 have half the size TX FIFO compared to + * other devices + */ if (AR_SREV_KITE(ah) || AR_SREV_9271(ah)) { AH5212(ah)->ah_txTrigLev = (AR_FTRIG_256B >> AR_FTRIG_S); AH5212(ah)->ah_maxTxTrigLev = ((2048 / 64) - 1); @@ -255,6 +269,9 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5212(ah)->ah_maxTxTrigLev = ((4096 / 64) - 1); } #undef AR_FTRIG_512B + + /* And now leave some headspace - 256 bytes */ + AH5212(ah)->ah_maxTxTrigLev -= 4; } uint32_t Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Feb 21 08:21:14 2013 (r247091) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Feb 21 08:42:40 2013 (r247092) @@ -570,6 +570,10 @@ ar5416InitDMA(struct ath_hal *ah) /* * let mac dma writes be in 128 byte chunks */ + /* + * XXX If you change this, you must change the headroom + * assigned in ah_maxTxTrigLev - see ar5416InitState(). + */ OS_REG_WRITE(ah, AR_RXCFG, (OS_REG_READ(ah, AR_RXCFG) & ~AR_RXCFG_DMASZ_MASK) | AR_RXCFG_DMASZ_128B); From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:10:33 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id DFE2910E7; Thu, 21 Feb 2013 12:10:33 +0000 (UTC) Date: Thu, 21 Feb 2013 12:10:33 +0000 From: Alexey Dokuchaev To: Andriy Gapon Subject: Re: svn commit: r246251 - head/sys/dev/acpica Message-ID: <20130221121033.GA83734@FreeBSD.org> References: <201302021244.r12CiKgj046079@svn.freebsd.org> <20130202125122.GA4975@FreeBSD.org> <20130202151137.GA28366@FreeBSD.org> <510E3A9D.7040005@FreeBSD.org> <20130205072124.GA97885@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130205072124.GA97885@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:10:33 -0000 On Tue, Feb 05, 2013 at 07:21:24AM +0000, Alexey Dokuchaev wrote: > On Sun, Feb 03, 2013 at 12:23:25PM +0200, Andriy Gapon wrote: > > on 02/02/2013 17:11 Alexey Dokuchaev said the following: > > > On Sat, Feb 02, 2013 at 12:51:22PM +0000, Alexey Dokuchaev wrote: > > >> On Sat, Feb 02, 2013 at 12:44:20PM +0000, Andriy Gapon wrote: > > >>> New Revision: 246251 > > >>> URL: http://svnweb.freebsd.org/changeset/base/246251 > > >>> > > >>> Log: > > >>> acpi: clear power button status bit after waking up... > > >>> so that it is not confused for a new power off request. > > > > > > Andriy, it appears to me that ACPI code is substantially different between > > > 8-stable and head, so the patch cannot be applied as is. [...] > > > > P.S. logically the new block of code seems to belong to acpi_sleep_machdep() > > before intr_restore() call. > > OK, thanks, I will try to cook something up and report how would it go. I've hand-crafted the patch to 8-stable [1], it seems to act as intended, that is, I do see the "acpi0: cleared fixed power button status (was 1)" in dmesg(8), but somehow power button still does nothing after resume. Any advice how to debug this further? Thanks, ./danfe [1] http://193.124.210.26/acpi.diff (long comment trimmed, debug %u added) From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:30:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60150CF3; Thu, 21 Feb 2013 12:30:03 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 200D0A21; Thu, 21 Feb 2013 12:30:02 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 8A85686ED; Thu, 21 Feb 2013 12:29:56 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 63C8395EF; Thu, 21 Feb 2013 13:29:56 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrew Thompson Subject: Re: svn commit: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh References: <201209031651.q83GpfHi014195@svn.freebsd.org> Date: Thu, 21 Feb 2013 13:29:56 +0100 In-Reply-To: (Andrew Thompson's message of "Thu, 21 Feb 2013 23:51:43 +1300") Message-ID: <86wqu1yhmj.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:30:03 -0000 Andrew Thompson writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Log: > > Upgrade OpenSSH to 6.1p1. > MFC? Not sure, it's a fairly large change. I assume you're asking because of the upcoming 8.4? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:31:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D421FEA; Thu, 21 Feb 2013 12:31:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 0DAE0A66; Thu, 21 Feb 2013 12:31:24 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1LCVFfA009577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Feb 2013 23:31:17 +1100 Date: Thu, 21 Feb 2013 23:31:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r247068 - head/sys/x86/isa In-Reply-To: <201302210040.r1L0e80m095140@svn.freebsd.org> Message-ID: <20130221225538.J1447@besplex.bde.org> References: <201302210040.r1L0e80m095140@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zty1sKHG c=1 sm=1 a=l9K4Gy_p75cA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=P-gUh28lWcoA:10 a=i8LIHgZwk8PlJfKH8WMA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:31:25 -0000 On Thu, 21 Feb 2013, Warner Losh wrote: > Log: > Fix broken usage of splhigh() by removing it. This is more broken than before. The splhigh() served to indicate missing locking. > Modified: head/sys/x86/isa/atrtc.c > ============================================================================== > --- head/sys/x86/isa/atrtc.c Thu Feb 21 00:36:12 2013 (r247067) > +++ head/sys/x86/isa/atrtc.c Thu Feb 21 00:40:08 2013 (r247068) > @@ -328,7 +328,6 @@ static int > atrtc_gettime(device_t dev, struct timespec *ts) > { > struct clocktime ct; > - int s; > > /* Look if we have a RTC present and the time is valid */ > if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { > @@ -338,11 +337,8 @@ atrtc_gettime(device_t dev, struct times > > /* wait for time update to complete */ > /* If RTCSA_TUP is zero, we have at least 244us before next update */ As the comment says, this is time-critical code. It needs to do something to prevent it being preempted for more than 244 usec > - s = splhigh(); It used to do something... > - while (rtcin(RTC_STATUSA) & RTCSA_TUP) { > - splx(s); > - s = splhigh(); > - } > + while (rtcin(RTC_STATUSA) & RTCSA_TUP) > + continue; You should probably have changed this to a critical section like you did in ppc. Disabling hardware interrupts would be even better. There is a problem with the "show rtc" command in ddb. It was born broken (racy), and the races were turned into deadlocks by adding locking in rtcin(). So if you trace through this code, then "show rtc" while holding the lock in rtcin() will deadlock. It is a bug for ddb to call any code that might try to acquire a mutex, but "show rtc" always calls rtcin() and rtcin() always tries to aquire a mutex. Similar deadlocks on the i8254 lock in DELAY() are worked around by not trying to acquire the lock in kdb mode. > ct.nsec = 0; > ct.sec = readrtc(RTC_SEC); > ct.min = readrtc(RTC_MIN); > There are 8 or 9 readrtc()'s altogether. These must be atomic, and all within the 244 usec limit. There is considerable danger of exceeding the limit without even being preempted. Each readrtc() does 1 or 4 isa bus accesses. I've seen a single isa bus access taking 139 usec (delayed by PCI DMA). Another way of doing this without any locking against preemption or timing magic is to read the time before and after. If it took more than 244 usec from before seeing RTCSA_TUP deasserted to after the last readrtc(), then retry. My version still depends on splhigh() working, but it does more sophisticated waiting that gives a full second to read the registers without getting more than a stale time. The above reads an RTC value that may be stale by almost 1 second. My version busy-waits until just after after the counter rolls over. This is only suitable for boot=time initialization. Debugging printfs show that this never got preempted over the last few years -- the whole operation always completed within about 40 usec of seeing the rollover. Linux does even more sophisticated waiting for writing the registers, so as not to be off by another second in the write operation. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:40:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8B613BA3; Thu, 21 Feb 2013 12:40:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 667C1CD3; Thu, 21 Feb 2013 12:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LCerLE016825; Thu, 21 Feb 2013 12:40:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LCerqQ016824; Thu, 21 Feb 2013 12:40:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201302211240.r1LCerqQ016824@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Feb 2013 12:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247094 - head/sys/dev/ppc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:40:53 -0000 Author: glebius Date: Thu Feb 21 12:40:52 2013 New Revision: 247094 URL: http://svnweb.freebsd.org/changeset/base/247094 Log: Fix build. Modified: head/sys/dev/ppc/ppc.c Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Thu Feb 21 12:13:06 2013 (r247093) +++ head/sys/dev/ppc/ppc.c Thu Feb 21 12:40:52 2013 (r247094) @@ -75,7 +75,7 @@ static void ppcintr(void *arg); #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev)) /* - * We use critical enter/leave for the simple config locking needed to + * We use critical enter/exit for the simple config locking needed to * detect the devices. We just want to make sure that both of our writes * happen without someone else also writing to those config registers. Since * we just do this at startup, Giant keeps multiple threads from executing, @@ -88,7 +88,7 @@ static void ppcintr(void *arg); * and no other code changes these registers. */ #define PPC_CONFIG_LOCK(ppc) critical_enter() -#define PPC_CONFIG_UNLOCK(ppc) critical_leave() +#define PPC_CONFIG_UNLOCK(ppc) critical_exit() devclass_t ppc_devclass; const char ppc_driver_name[] = "ppc"; From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:49:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3A0E378 for ; Thu, 21 Feb 2013 12:49:03 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx1.freebsd.org (Postfix) with ESMTP id 97985E51 for ; Thu, 21 Feb 2013 12:49:03 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id p16so5764602vcq.1 for ; Thu, 21 Feb 2013 04:48:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=ySyVPgXmzm9PWydQqok5sOtzml2GaUdB6CbOThvP0UU=; b=SWXq+qSRq0vST491UqEWP2lZV2/HzkxGmDiEmfZM5lmrgL+D8bKTRB57W6BMZAUxZh So1S/42/DwO4caN6ejxDkZM6WFQtY6C51+ml73CTnnaV6PYnpWTPfEjEJJUaQ1D/SwxE sPHxS2sbShAbJkK6e//JnxlFH5gpKO/z6ah1aCLg+FWIJoa+T/yH1oOmlQz2WexeSmwZ usQPgml+PuJ9GlJmcnu/IUJ2bWtJ//olPQ9Oisw05uTJuTUgIbQ2pWGr4eTvvvxGbtAZ XKjW2uiSXW4Vhjb1vXIi33ldb8FLmgUUKgG4ON8KN4JOuf52PWXQMooxsmcHsOwLaX6p xpPg== MIME-Version: 1.0 X-Received: by 10.52.94.17 with SMTP id cy17mr26668720vdb.68.1361443904217; Thu, 21 Feb 2013 02:51:44 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.58.30.4 with HTTP; Thu, 21 Feb 2013 02:51:43 -0800 (PST) In-Reply-To: <201209031651.q83GpfHi014195@svn.freebsd.org> References: <201209031651.q83GpfHi014195@svn.freebsd.org> Date: Thu, 21 Feb 2013 23:51:43 +1300 X-Google-Sender-Auth: cdfUt9q8ZJammrr89BrpdIonZpc Message-ID: Subject: Re: svn commit: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh From: Andrew Thompson To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlLDzTfyJJxkRPcEUBcwROqXvGEqWtTjkroKovhitmCttt/6lh9HcK46Xu1YZlG+uRRIXPn Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:49:03 -0000 On 4 September 2012 04:51, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Mon Sep 3 16:51:41 2012 > New Revision: 240075 > URL: http://svn.freebsd.org/changeset/base/240075 > > Log: > Upgrade OpenSSH to 6.1p1. MFC? From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 12:52:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8ABE54CA; Thu, 21 Feb 2013 12:52:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 656D9EB9; Thu, 21 Feb 2013 12:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LCqJx2019938; Thu, 21 Feb 2013 12:52:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LCqJbZ019937; Thu, 21 Feb 2013 12:52:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201302211252.r1LCqJbZ019937@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Feb 2013 12:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247095 - head/sys/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 12:52:19 -0000 Author: glebius Date: Thu Feb 21 12:52:18 2013 New Revision: 247095 URL: http://svnweb.freebsd.org/changeset/base/247095 Log: Fix build. Modified: head/sys/pci/ncr.c Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Thu Feb 21 12:40:52 2013 (r247094) +++ head/sys/pci/ncr.c Thu Feb 21 12:52:18 2013 (r247095) @@ -6425,7 +6425,6 @@ static nccb_p ncr_get_nccb if (cp != NULL) { if (cp->magic) { printf("%s: Bogus free cp found\n", ncr_name(np)); - splx(s); return (NULL); } cp->magic = 1; From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 13:08:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64D6FE0A; Thu, 21 Feb 2013 13:08:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by mx1.freebsd.org (Postfix) with ESMTP id 0557010B; Thu, 21 Feb 2013 13:08:01 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1LD7p5a024826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 Feb 2013 00:07:52 +1100 Date: Fri, 22 Feb 2013 00:07:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r247088 - head/sys/i386/isa In-Reply-To: <201302210716.r1L7Gf7J018846@svn.freebsd.org> Message-ID: <20130221233134.Y1447@besplex.bde.org> References: <201302210716.r1L7Gf7J018846@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=MscKcBme c=1 sm=1 a=jC5Ga5vlsagA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=5nP1CsCkY-8A:10 a=9hQEr5tbHPrHrfW25csA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 13:08:02 -0000 On Thu, 21 Feb 2013, Warner Losh wrote: > Log: > Locking for todr got pushed down into inittodr and the client > libraries it calls (although some might not be doing it right). We are > serialized right now by giant as well. This means the splsoftclock are > now an anachronism that has no benefit, even marking where locking > needs to happen. Remove them. No, it (a working version of it) was needed to prevent delays from being preempted. > Modified: > head/sys/i386/isa/pmtimer.c > > Modified: head/sys/i386/isa/pmtimer.c > ============================================================================== > --- head/sys/i386/isa/pmtimer.c Thu Feb 21 06:38:49 2013 (r247087) > +++ head/sys/i386/isa/pmtimer.c Thu Feb 21 07:16:40 2013 (r247088) > @@ -82,26 +82,21 @@ static struct timeval diff_time; > static int > pmtimer_suspend(device_t dev) > { > - int pl; > > - pl = splsoftclock(); > microtime(&diff_time); > inittodr(0); > microtime(&suspend_time); > timevalsub(&diff_time, &suspend_time); > - splx(pl); > return (0); > } For this to work, it is also necessary for inittodr() to be accurate. With inittodr() in -current being off by up to 1 second (even if the RTC hardare time is perfectly accurate), it doesn't matter if there is a small additional error from being preempted here. settime(2) has similar races (even worse, since it asks for an absolute time). If either the user or kernel parts of settime() are preempted, then the final time will be in the past by the amount of the preemption plus the syscall time (if the time was perfectly accurate at the start of settime()). > > static int > pmtimer_resume(device_t dev) > { > - int pl; > u_int second, minute, hour; > struct timeval resume_time, tmp_time; > > /* modified for adjkerntz */ > - pl = splsoftclock(); > timer_restore(); /* restore the all timers */ > inittodr(0); /* adjust time to RTC */ > microtime(&resume_time); I remember a bit better how this is supposed to work. It doesn't need a very accurate RTC hardware time. Suspend records the difference between the hardware time and the software time. Resume reads the hardware time and adds the difference to get the new software time. So the only unavoidable error is the RTC hardware time drift during the suspsension period. This should be small if the suspension period is only a few hours. I use similar methods to fix up the software time after sitting in ddb for a few seconds or minutes. The RTC drifts a few usec/sec and the fixup adds a few more usec. Here the fix isn't as simple as putting everything in a critical section. inittodr() would be in the section, but a working version of it can't be locked like that since it needs to wait. In my version, inittodr() is not used for this. The RTC is programmed to interrupt on every seconds boundary, and a difference corresponding to the above is calculated on avery 64th of these interrupts. Since the RTC just rolled over, it can be read without waiting for it to be non-busy. Or we could just count the interrupts and add 64 to the previous RTC time in seconds. > @@ -118,16 +113,13 @@ pmtimer_resume(device_t dev) > timevalsub(&resume_time, &suspend_time); > /* Fixup the calltodo list with the delta time. */ > adjust_timeout_calltodo(&resume_time); > -#endif /* PMTIMER_FIXUP_CALLTODOK */ > - splx(pl); > -#ifndef PMTIMER_FIXUP_CALLTODO > - second = resume_time.tv_sec - suspend_time.tv_sec; > -#else /* PMTIMER_FIXUP_CALLTODO */ The PMTIMER_FIXUP_CALLTODO is bogus. It never even compiled in any committed version. However, I think something like it is still needed timeouts in monotonic time are very wrong for long timeouts. After a resume after a suspension period of hours or days, lots of timeouts should have expired and the problem is to avoid creating a thundering herd of them by timing them out all at once. > /* > * We've already calculated resume_time to be the delta between > * the suspend and the resume. > */ > second = resume_time.tv_sec; > +#else /* !PMTIMER_FIXUP_CALLTODO */ > + second = resume_time.tv_sec - suspend_time.tv_sec; > #endif /* PMTIMER_FIXUP_CALLTODO */ > hour = second / 3600; > second %= 3600; Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 13:14:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 109422A7 for ; Thu, 21 Feb 2013 13:14:26 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7E7190 for ; Thu, 21 Feb 2013 13:14:25 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id s4so6734725lbc.21 for ; Thu, 21 Feb 2013 05:14:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=FMJ1vB+frPpl12CTbpW/YkoL73+oo8CyJx7RhTyURCs=; b=Gwz1v1IWsQZ6eYzJrz73GYQEsvqTF0qnA4vewNuPqnmwWNem1XyWhklm6tzgYsViw3 43yAh/BUYV7sL9WUUrfzKD6xF8IJ/ng3b/RjpS8AOQADUu59gJBlLNCFzrnAZWxQTcfI p+781dODnW2mqUV2yGcYdPvLcDqTJRMH71vz4y6hqg+Bvv/ZlOCaigK/T5Tkqw71Sof9 kfqPk19gimEM3/LZJqeK2MQQDY9lzWbxHrhrVgxuiMkcQ759cuFwJtLWArpqbE5cKvbr 8Vqi86JX6zBKXkDB99dMqXu5DZvk0TNuuP/SrhWM0jDHRDNnB4jqNDUoAzqdic0tTQlN Z93A== X-Received: by 10.152.46.131 with SMTP id v3mr20363877lam.57.1361437804317; Thu, 21 Feb 2013 01:10:04 -0800 (PST) Received: from dhcp170-82-red.yandex.net ([2a02:6b8:0:401:b5cf:be6b:fd46:fbdb]) by mx.google.com with ESMTPS id oy10sm40534963lab.8.2013.02.21.01.10.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 01:10:02 -0800 (PST) Sender: Andrey Zonov Message-ID: <5125E465.20700@FreeBSD.org> Date: Thu, 21 Feb 2013 13:09:57 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r247066 - head/sys/dev/ppc References: <201302210027.r1L0Rqv3091748@svn.freebsd.org> In-Reply-To: <201302210027.r1L0Rqv3091748@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2NJGJKOPHNWNMLRTIMJXK" X-Gm-Message-State: ALoCoQmIpc75Udfa1wCLq2XPMICJ2NmFZMGOhC9q3Ubd2pPWJ3hDWMkmXS3nBpq0r63tTFirQF76 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 13:14:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NJGJKOPHNWNMLRTIMJXK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2/21/13 4:27 AM, Warner Losh wrote: > Author: imp > Date: Thu Feb 21 00:27:51 2013 > New Revision: 247066 > URL: http://svnweb.freebsd.org/changeset/base/247066 >=20 > Log: > Replace splhigh() with critical_enter()/leave() to ensure we write th= e > config mode unlock sequence quickly enough. This likely isn't too cri= tical, > since splhigh() has been a noop for a decade... >=20 > Modified: > head/sys/dev/ppc/ppc.c >=20 > Modified: head/sys/dev/ppc/ppc.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/dev/ppc/ppc.c Thu Feb 21 00:26:31 2013 (r247065) > +++ head/sys/dev/ppc/ppc.c Thu Feb 21 00:27:51 2013 (r247066) > @@ -74,6 +74,22 @@ static void ppcintr(void *arg); > =20 > #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev)) > =20 > +/* > + * We use critical enter/leave for the simple config locking needed to= > + * detect the devices. We just want to make sure that both of our writ= es > + * happen without someone else also writing to those config registers.= Since > + * we just do this at startup, Giant keeps multiple threads from execu= ting, > + * and critical_enter() then is all that's needed to keep us from bein= g preempted > + * during the critical sequences with the hardware. > + * > + * Note: this doesn't prevent multiple threads from putting the chips = into > + * config mode, but since we only do that to detect the type at startu= p the > + * extra overhead isn't needed since Giant protects us from multiple e= ntry > + * and no other code changes these registers. > + */ > +#define PPC_CONFIG_LOCK(ppc) critical_enter() > +#define PPC_CONFIG_UNLOCK(ppc) critical_leave() > + s/critical_leave/critical_exit/? --=20 Andrey Zonov ------enig2NJGJKOPHNWNMLRTIMJXK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJRJeRoAAoJEBWLemxX/CvTo7EIAI0Bb6+R6ilQNSpqpDFZzcof 09nTBgZ+CehLpsijnmghoRRg04dZHlkJN8EqNNXSOpOM+uMtMahr178VV6lgNg+J flB+fAm5ior9sm+muTz2BCJPNeyzRgZnbS2eiIZXP6gDKeYGZW2cxo+DLNpIOHHt bs50QNUvFNiBzqAY//KC2a/iw3T7rG6+C5F9M2Y+mhFmawfKJQz21pU5u4srpQqr 7EJAcKHPdD0Fw/nOnzOzeREQvaRH2PB/0sJ//s2k1CRecDBnNykVfA2CIOj879Kx T/6N3odkVIqnXC8fck8gDOoMKMuvTzPjRhtwQVbFvWN0MYwEMQaNBXKW/hWsdT4= =JJwj -----END PGP SIGNATURE----- ------enig2NJGJKOPHNWNMLRTIMJXK-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 13:27:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43CCE635; Thu, 21 Feb 2013 13:27:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 2ED73273; Thu, 21 Feb 2013 13:27:00 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r1LDQxP5086027; Thu, 21 Feb 2013 17:26:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r1LDQxOS086026; Thu, 21 Feb 2013 17:26:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 21 Feb 2013 17:26:59 +0400 From: Gleb Smirnoff To: Andrey Zonov Subject: Re: svn commit: r247066 - head/sys/dev/ppc Message-ID: <20130221132659.GS72813@FreeBSD.org> References: <201302210027.r1L0Rqv3091748@svn.freebsd.org> <5125E465.20700@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <5125E465.20700@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 13:27:02 -0000 On Thu, Feb 21, 2013 at 01:09:57PM +0400, Andrey Zonov wrote: A> > Log: A> > Replace splhigh() with critical_enter()/leave() to ensure we write the A> > config mode unlock sequence quickly enough. This likely isn't too critical, A> > since splhigh() has been a noop for a decade... A> > A> > Modified: A> > head/sys/dev/ppc/ppc.c A> > A> > Modified: head/sys/dev/ppc/ppc.c A> > ============================================================================== A> > --- head/sys/dev/ppc/ppc.c Thu Feb 21 00:26:31 2013 (r247065) A> > +++ head/sys/dev/ppc/ppc.c Thu Feb 21 00:27:51 2013 (r247066) A> > @@ -74,6 +74,22 @@ static void ppcintr(void *arg); A> > A> > #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev)) A> > A> > +/* A> > + * We use critical enter/leave for the simple config locking needed to A> > + * detect the devices. We just want to make sure that both of our writes A> > + * happen without someone else also writing to those config registers. Since A> > + * we just do this at startup, Giant keeps multiple threads from executing, A> > + * and critical_enter() then is all that's needed to keep us from being preempted A> > + * during the critical sequences with the hardware. A> > + * A> > + * Note: this doesn't prevent multiple threads from putting the chips into A> > + * config mode, but since we only do that to detect the type at startup the A> > + * extra overhead isn't needed since Giant protects us from multiple entry A> > + * and no other code changes these registers. A> > + */ A> > +#define PPC_CONFIG_LOCK(ppc) critical_enter() A> > +#define PPC_CONFIG_UNLOCK(ppc) critical_leave() A> > + A> A> s/critical_leave/critical_exit/? Already fixed. However, question to Warner. Since code already executes under Giant, what is the reason for critical_section? What's the problem if couple of outb instructions are split (assuming they are properly serialized) across two CPUs? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 14:08:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2F56E27C for ; Thu, 21 Feb 2013 14:08:28 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ia0-x236.google.com (ia-in-x0236.1e100.net [IPv6:2607:f8b0:4001:c02::236]) by mx1.freebsd.org (Postfix) with ESMTP id F3F4D711 for ; Thu, 21 Feb 2013 14:08:27 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id k38so1558967iah.27 for ; Thu, 21 Feb 2013 06:08:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=TDMT7EEa64ZRrxY32cx6MpP40Pw+ySwUNWe1sKSxkXA=; b=kbUxlDWhLEolW8S+ljwYshT1zmQKzwIWxb3rC1WiqgTGofRUAVO675uKE6f6ZQ11eF m8hB+m78N4vHpsm/dAypui8tLLEBTddkm8ODshGpDeNzAmXG3EArzNQ8c4nUyVTYYURn WVfJT4lg97ZkM5k8NQ6vR7JMKnlPsRDWT46VoLVekNqA8Y6jyiZWFA+HanFY1cgRfTY1 vdzskHzXCb1lp4iR36oCtDBfxjDyas+9+abF6K4IQCMbw5XWIKdcehag7h9OFNkg1eK6 R8HKwK3mjRxwbpzeL4vcikcFh8axbzftc5YEn/rA1NxySMsniQcfdTL/rJL3bxb3fokr Z2Jg== X-Received: by 10.50.88.233 with SMTP id bj9mr13230772igb.55.1361455707680; Thu, 21 Feb 2013 06:08:27 -0800 (PST) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id xd4sm18683351igb.3.2013.02.21.06.08.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 06:08:26 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r247066 - head/sys/dev/ppc Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130221132659.GS72813@FreeBSD.org> Date: Thu, 21 Feb 2013 07:08:24 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <63ACAB54-24F4-4EB7-B7F6-54683E016848@bsdimp.com> References: <201302210027.r1L0Rqv3091748@svn.freebsd.org> <5125E465.20700@FreeBSD.org> <20130221132659.GS72813@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmMiNl5OTZN0hSkiMfP8QHy5qwXAXHCHkzCOUiEwxVpgrbfDEbpeS0LGmz6laMUptts1AIu Cc: svn-src-head@freebsd.org, Andrey Zonov , src-committers@freebsd.org, Warner Losh , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 14:08:28 -0000 On Feb 21, 2013, at 6:26 AM, Gleb Smirnoff wrote: > On Thu, Feb 21, 2013 at 01:09:57PM +0400, Andrey Zonov wrote: > A> > Log: > A> > Replace splhigh() with critical_enter()/leave() to ensure we = write the > A> > config mode unlock sequence quickly enough. This likely isn't = too critical, > A> > since splhigh() has been a noop for a decade... > A> >=20 > A> > Modified: > A> > head/sys/dev/ppc/ppc.c > A> >=20 > A> > Modified: head/sys/dev/ppc/ppc.c > A> > = =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 > A> > --- head/sys/dev/ppc/ppc.c Thu Feb 21 00:26:31 2013 = (r247065) > A> > +++ head/sys/dev/ppc/ppc.c Thu Feb 21 00:27:51 2013 = (r247066) > A> > @@ -74,6 +74,22 @@ static void ppcintr(void *arg); > A> > =20 > A> > #define DEVTOSOFTC(dev) ((struct ppc_data = *)device_get_softc(dev)) > A> > =20 > A> > +/* > A> > + * We use critical enter/leave for the simple config locking = needed to > A> > + * detect the devices. We just want to make sure that both of = our writes > A> > + * happen without someone else also writing to those config = registers. Since > A> > + * we just do this at startup, Giant keeps multiple threads from = executing, > A> > + * and critical_enter() then is all that's needed to keep us = from being preempted > A> > + * during the critical sequences with the hardware. > A> > + * > A> > + * Note: this doesn't prevent multiple threads from putting the = chips into > A> > + * config mode, but since we only do that to detect the type at = startup the > A> > + * extra overhead isn't needed since Giant protects us from = multiple entry > A> > + * and no other code changes these registers. > A> > + */ > A> > +#define PPC_CONFIG_LOCK(ppc) critical_enter() > A> > +#define PPC_CONFIG_UNLOCK(ppc) critical_leave() > A> > + > A>=20 > A> s/critical_leave/critical_exit/? >=20 > Already fixed. >=20 > However, question to Warner. >=20 > Since code already executes under Giant, what is the reason for = critical_section? > What's the problem if couple of outb instructions are split (assuming = they are > properly serialized) across two CPUs? There's a timing window that needs to be hit with these chips. Warner= From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 14:52:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4940E560 for ; Thu, 21 Feb 2013 14:52:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ia0-x22a.google.com (mail-ia0-x22a.google.com [IPv6:2607:f8b0:4001:c02::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 19985A1D for ; Thu, 21 Feb 2013 14:52:41 +0000 (UTC) Received: by mail-ia0-f170.google.com with SMTP id k20so8391693iak.29 for ; Thu, 21 Feb 2013 06:52:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=g8Pvyj8imXOdnI6TJ4w7cqJQotWVQGxPg5h9kv/opUU=; b=iL9evf7twfXs2e2VHQaYFAERotKl7H3iOnge6aVbL2lzqdvXRqPPkzUghDhUgyg5iO Wc7dP2nXXk1gqTGn3bnHt0uJHXIByk0V3NjZPptYitu8XrenwUSTe+z6T9bgVh8eWJ3C sC1BvU+mXkf+udRy2XRMKKAtaJ4Dfn2CcMgDeB13LkV+e0bzLekmNX+u9vanXZzSJFmq 34pyqnP/jIVAHXQvRsNv29LYmCA5zUXnQA5kSSd2M6nqOBDCeQJ8kr1TveJma5SEGw70 nE8smOfRqULmVlPwERxrMm1FzdfP5smUeQOWOU7t+rNp6JuWS9JSABSyMu2kjhBlEfIM Ap7g== X-Received: by 10.50.76.168 with SMTP id l8mr12997368igw.97.1361458360660; Thu, 21 Feb 2013 06:52:40 -0800 (PST) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id vb15sm18777441igb.9.2013.02.21.06.52.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 06:52:39 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r247068 - head/sys/x86/isa Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130221225538.J1447@besplex.bde.org> Date: Thu, 21 Feb 2013 07:52:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9BB56E45-A272-46D7-AF3F-833424017F2D@bsdimp.com> References: <201302210040.r1L0e80m095140@svn.freebsd.org> <20130221225538.J1447@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmP5GSwj3muFWqEDB2bkvoB5WAaKsT1c6qVPY42iLplZy2jqNpFfPZTHVTzvIr44a/nUc+4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 14:52:41 -0000 On Feb 21, 2013, at 5:31 AM, Bruce Evans wrote: > On Thu, 21 Feb 2013, Warner Losh wrote: >=20 >> Log: >> Fix broken usage of splhigh() by removing it. >=20 > This is more broken than before. The splhigh() served to indicate > missing locking. Depends on what you mean by more :) It is less depessimized after the = nopification of splhigh(). >> Modified: head/sys/x86/isa/atrtc.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/x86/isa/atrtc.c Thu Feb 21 00:36:12 2013 = (r247067) >> +++ head/sys/x86/isa/atrtc.c Thu Feb 21 00:40:08 2013 = (r247068) >> @@ -328,7 +328,6 @@ static int >> atrtc_gettime(device_t dev, struct timespec *ts) >> { >> struct clocktime ct; >> - int s; >>=20 >> /* Look if we have a RTC present and the time is valid */ >> if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { >> @@ -338,11 +337,8 @@ atrtc_gettime(device_t dev, struct times >>=20 >> /* wait for time update to complete */ >> /* If RTCSA_TUP is zero, we have at least 244us before next = update */ >=20 > As the comment says, this is time-critical code. It needs to do = something > to prevent it being preempted for more than 244 usec That's a long time... >> - s =3D splhigh(); >=20 > It used to do something... >=20 >> - while (rtcin(RTC_STATUSA) & RTCSA_TUP) { >> - splx(s); >> - s =3D splhigh(); >> - } >> + while (rtcin(RTC_STATUSA) & RTCSA_TUP) >> + continue; >=20 > You should probably have changed this to a critical section like you = did > in ppc. Disabling hardware interrupts would be even better. I'll replace with a critical section. > There is a problem with the "show rtc" command in ddb. It was born > broken (racy), and the races were turned into deadlocks by adding > locking in rtcin(). So if you trace through this code, then > "show rtc" while holding the lock in rtcin() will deadlock. It is a > bug for ddb to call any code that might try to acquire a mutex, but > "show rtc" always calls rtcin() and rtcin() always tries to aquire a > mutex. Similar deadlocks on the i8254 lock in DELAY() are worked > around by not trying to acquire the lock in kdb mode. kbd_active is what I need to check, right? I'll fix that while here. >> ct.nsec =3D 0; >> ct.sec =3D readrtc(RTC_SEC); >> ct.min =3D readrtc(RTC_MIN); >>=20 >=20 > There are 8 or 9 readrtc()'s altogether. These must be atomic, and = all > within the 244 usec limit. There is considerable danger of exceeding = the > limit without even being preempted. Each readrtc() does 1 or 4 isa = bus > accesses. I've seen a single isa bus access taking 139 usec (delayed = by > PCI DMA). >=20 > Another way of doing this without any locking against preemption or > timing magic is to read the time before and after. If it took more = than > 244 usec from before seeing RTCSA_TUP deasserted to after the last > readrtc(), then retry. By computing a time difference, or by checking RTCSA_TUP? > My version still depends on splhigh() working, but it does more > sophisticated waiting that gives a full second to read the registers > without getting more than a stale time. The above reads an RTC value > that may be stale by almost 1 second. My version busy-waits until > just after after the counter rolls over. This is only suitable for > boot=3Dtime initialization. Debugging printfs show that this never = got > preempted over the last few years -- the whole operation always > completed within about 40 usec of seeing the rollover. So this isn't a problem on fast machines? > Linux does even more sophisticated waiting for writing the registers, > so as not to be off by another second in the write operation. Yea, that would be nice, I may have to look into that, once I'm done = fetching these stones. Warner From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 15:35:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EF801B8; Thu, 21 Feb 2013 15:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD7A2E07; Thu, 21 Feb 2013 15:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LFZm2p069188; Thu, 21 Feb 2013 15:35:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LFZmG0069187; Thu, 21 Feb 2013 15:35:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302211535.r1LFZmG0069187@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 15:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247101 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 15:35:49 -0000 Author: imp Date: Thu Feb 21 15:35:48 2013 New Revision: 247101 URL: http://svnweb.freebsd.org/changeset/base/247101 Log: Use critical_enter/critical_exit around the time sensitive part of this code to depessimize the worst case we've lived with silently and uneventfully for the past 12 years. Add a comment about a refinement for those needing more assurance of accuracy. Fix ddb's show rtc command deadlock potential when debugging rtc code by not taking the lock if we're in the debugger. If you need a thumb to count the number of people that have encountered this, I'd be surprised. Submitted by: bde Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Thu Feb 21 15:26:26 2013 (r247100) +++ head/sys/x86/isa/atrtc.c Thu Feb 21 15:35:48 2013 (r247101) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include "clock_if.h" -#define RTC_LOCK mtx_lock_spin(&clock_lock) -#define RTC_UNLOCK mtx_unlock_spin(&clock_lock) +#define RTC_LOCK do { if (!kdb_active) mtx_lock_spin(&clock_lock); } while (0) +#define RTC_UNLOCK do { if (!kdb_active) mtx_unlock_spin(&clock_lock); } while (0) int atrtcclock_disable = 0; @@ -335,10 +336,16 @@ atrtc_gettime(device_t dev, struct times return (EINVAL); } - /* wait for time update to complete */ - /* If RTCSA_TUP is zero, we have at least 244us before next update */ + /* + * wait for time update to complete + * If RTCSA_TUP is zero, we have at least 244us before next update. + * This is fast enough on most hardware, but a refinement would be + * to make sure that no more than 240us pass after we start reading, + * and try again if so. + */ while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; + critical_enter(); ct.nsec = 0; ct.sec = readrtc(RTC_SEC); ct.min = readrtc(RTC_MIN); @@ -352,6 +359,7 @@ atrtc_gettime(device_t dev, struct times #else ct.year += 2000; #endif + critical_exit(); /* Set dow = -1 because some clocks don't set it correctly. */ ct.dow = -1; return (clock_ct_to_ts(&ct, ts)); From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 15:41:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E26155B7; Thu, 21 Feb 2013 15:41:10 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D48F4E69; Thu, 21 Feb 2013 15:41:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LFfAgM071501; Thu, 21 Feb 2013 15:41:10 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LFfAKK071497; Thu, 21 Feb 2013 15:41:10 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302211541.r1LFfAKK071497@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Feb 2013 15:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247102 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 15:41:11 -0000 Author: pluknet Date: Thu Feb 21 15:41:09 2013 New Revision: 247102 URL: http://svnweb.freebsd.org/changeset/base/247102 Log: In the EXAMPLES section: append the subsystem regular expression with a typical interface name pattern as devd(8) uses full string match. Discussed with: avg, glebius Modified: head/share/man/man4/carp.4 Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Thu Feb 21 15:35:48 2013 (r247101) +++ head/share/man/man4/carp.4 Thu Feb 21 15:41:09 2013 (r247102) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2012 +.Dd February 21, 2013 .Dt CARP 4 .Os .Sh NAME @@ -281,7 +281,7 @@ status change events can be set up by us .Bd -literal -offset indent notify 0 { match "system" "CARP"; - match "subsystem" "[0-9]+@"; + match "subsystem" "[0-9]+@[0-9a-z]+"; match "type" "(MASTER|BACKUP)"; action "/root/carpcontrol.sh $subsystem $type"; }; From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 15:48:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 628F4CEE; Thu, 21 Feb 2013 15:48:08 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by mx1.freebsd.org (Postfix) with ESMTP id A9085F0E; Thu, 21 Feb 2013 15:48:07 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id 15so7306631wgd.28 for ; Thu, 21 Feb 2013 07:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=50IgYdpyQlc2ZXDXDfmb/IplOUOaIQsYrvUdsVZGoiM=; b=lM38U5++6+O48FphD4t0ZrUTsjkurkc78krEcU2UVBahKBv4vF7HGSkRZ74DrSB91S 8eendeTjO/cKQ+doDF6t0A/a7Tl+Z9NGrIqx81abGPQkc3GHE1K0O2ZalxgD5p237WX/ bOwEWy3r4ymz0ABtcsRe60daFHeobbmprOp98sCeCDRVhHG4xhmKet4McD86DIk7aPTw xLZmc6zV7vCvVjXVbDpItHmhdeoLLC8pH0BYegOAcBsiQenlS/Ngo72hbdX+w4kfF0X0 Hd5X3/IRw02OwQwnm9prDNdDr85cvU3oXuS4BuDQMEqMsEJnrWbnUjwJiOZ84VJ++YjI BuYg== MIME-Version: 1.0 X-Received: by 10.180.107.70 with SMTP id ha6mr28043514wib.10.1361461681501; Thu, 21 Feb 2013 07:48:01 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.194.86.167 with HTTP; Thu, 21 Feb 2013 07:48:01 -0800 (PST) In-Reply-To: <201302211541.r1LFfAKK071497@svn.freebsd.org> References: <201302211541.r1LFfAKK071497@svn.freebsd.org> Date: Thu, 21 Feb 2013 18:48:01 +0300 X-Google-Sender-Auth: 1CI_B1k7sQmnX6kfJFZrKdJ9lAs Message-ID: Subject: Re: svn commit: r247102 - head/share/man/man4 From: Sergey Kandaurov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 15:48:08 -0000 On 21 February 2013 19:41, Sergey Kandaurov wrote: > Author: pluknet > Date: Thu Feb 21 15:41:09 2013 > New Revision: 247102 > URL: http://svnweb.freebsd.org/changeset/base/247102 > > Log: > In the EXAMPLES section: append the subsystem regular expression with a > typical interface name pattern as devd(8) uses full string match. > > Discussed with: avg, glebius > > Modified: > head/share/man/man4/carp.4 > > Modified: head/share/man/man4/carp.4 > ============================================================================== > --- head/share/man/man4/carp.4 Thu Feb 21 15:35:48 2013 (r247101) > +++ head/share/man/man4/carp.4 Thu Feb 21 15:41:09 2013 (r247102) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 25, 2012 > +.Dd February 21, 2013 > .Dt CARP 4 > .Os > .Sh NAME > @@ -281,7 +281,7 @@ status change events can be set up by us > .Bd -literal -offset indent > notify 0 { > match "system" "CARP"; > - match "subsystem" "[0-9]+@"; > + match "subsystem" "[0-9]+@[0-9a-z]+"; > match "type" "(MASTER|BACKUP)"; > action "/root/carpcontrol.sh $subsystem $type"; > }; "Typical" means that it could be renamed to something else with ifconfig name. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 17:00:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D9CF99; Thu, 21 Feb 2013 17:00:36 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF586ED; Thu, 21 Feb 2013 17:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LH0aZ5094578; Thu, 21 Feb 2013 17:00:36 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LH0agN094577; Thu, 21 Feb 2013 17:00:36 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302211700.r1LH0agN094577@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 21 Feb 2013 17:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247104 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 17:00:36 -0000 Author: gallatin Date: Thu Feb 21 17:00:35 2013 New Revision: 247104 URL: http://svnweb.freebsd.org/changeset/base/247104 Log: Fix tcp_lro_rx_ipv4() for drivers that do not set CSUM_IP_CHECKED. Specifcially, in_cksum_hdr() returns 0 (not 0xffff) when the IPv4 checksum is correct. Without this fix, the tcp_lro code will reject good IPv4 traffic from drivers that do not implement IPv4 header harder csum offload. Sponsored by: Myricom Inc. MFC after: 7 days Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Feb 21 16:59:28 2013 (r247103) +++ head/sys/netinet/tcp_lro.c Thu Feb 21 17:00:35 2013 (r247104) @@ -333,7 +333,7 @@ tcp_lro_rx_ipv4(struct lro_ctrl *lc, str } } else { csum = in_cksum_hdr(ip4); - if (__predict_false((csum ^ 0xffff) != 0)) { + if (__predict_false((csum) != 0)) { lc->lro_bad_csum++; return (TCP_LRO_CANNOT); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 17:41:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5227652; Thu, 21 Feb 2013 17:41:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC8499E7; Thu, 21 Feb 2013 17:41:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LHf0YM008784; Thu, 21 Feb 2013 17:41:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LHf0gd008783; Thu, 21 Feb 2013 17:41:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302211741.r1LHf0gd008783@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 17:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247108 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 17:41:01 -0000 Author: imp Date: Thu Feb 21 17:40:59 2013 New Revision: 247108 URL: http://svnweb.freebsd.org/changeset/base/247108 Log: Remove splsoftclock() since it is now gone. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Feb 21 17:17:13 2013 (r247107) +++ head/sys/sys/systm.h Thu Feb 21 17:40:59 2013 (r247108) @@ -330,7 +330,6 @@ static __inline intrmask_t splclock(void static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } static __inline intrmask_t splnet(void) { return 0; } -static __inline intrmask_t splsoftclock(void) { return 0; } static __inline intrmask_t splsoftvm(void) { return 0; } static __inline intrmask_t spltty(void) { return 0; } static __inline intrmask_t splvm(void) { return 0; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 17:50:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64B57C1A; Thu, 21 Feb 2013 17:50:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57AD6ABF; Thu, 21 Feb 2013 17:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LHoM46011623; Thu, 21 Feb 2013 17:50:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LHoMrT011622; Thu, 21 Feb 2013 17:50:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302211750.r1LHoMrT011622@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 17:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247109 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 17:50:22 -0000 Author: imp Date: Thu Feb 21 17:50:21 2013 New Revision: 247109 URL: http://svnweb.freebsd.org/changeset/base/247109 Log: bus_dmamap_load_ccb doesn't exist on earlier versions of FreeBSD or DragonFlyBSD, so it certainly doesn't need splsoftvm(). Remove it. # I doubt this driver will now compile on older FreeBSD versions or DFBSD # We should consider unifdefing it since that code seems unmaintained. Modified: head/sys/dev/firewire/sbp.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Thu Feb 21 17:40:59 2013 (r247108) +++ head/sys/dev/firewire/sbp.c Thu Feb 21 17:50:21 2013 (r247109) @@ -2488,16 +2488,14 @@ printf("ORB %08x %08x %08x %08x\n", ntoh printf("ORB %08x %08x %08x %08x\n", ntohl(ocb->orb[4]), ntohl(ocb->orb[5]), ntohl(ocb->orb[6]), ntohl(ocb->orb[7])); */ if (ccb->csio.dxfer_len > 0) { - int s, error; + int error; - s = splsoftvm(); error = bus_dmamap_load_ccb(/*dma tag*/sbp->dmat, /*dma map*/ocb->dmamap, ccb, sbp_execute_ocb, ocb, /*flags*/0); - splx(s); if (error) printf("sbp: bus_dmamap_load error %d\n", error); } else From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 17:54:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60623FD1; Thu, 21 Feb 2013 17:54:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5365AB38; Thu, 21 Feb 2013 17:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LHsFOB012321; Thu, 21 Feb 2013 17:54:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LHsFup012320; Thu, 21 Feb 2013 17:54:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201302211754.r1LHsFup012320@svn.freebsd.org> From: Warner Losh Date: Thu, 21 Feb 2013 17:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247110 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 17:54:15 -0000 Author: imp Date: Thu Feb 21 17:54:14 2013 New Revision: 247110 URL: http://svnweb.freebsd.org/changeset/base/247110 Log: splsoftvm() is no longer in the tree. gc. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Feb 21 17:50:21 2013 (r247109) +++ head/sys/sys/systm.h Thu Feb 21 17:54:14 2013 (r247110) @@ -330,7 +330,6 @@ static __inline intrmask_t splclock(void static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } static __inline intrmask_t splnet(void) { return 0; } -static __inline intrmask_t splsoftvm(void) { return 0; } static __inline intrmask_t spltty(void) { return 0; } static __inline intrmask_t splvm(void) { return 0; } static __inline void splx(intrmask_t ipl __unused) { return; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 19:02:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 33AC9FC0; Thu, 21 Feb 2013 19:02:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 227B31DC; Thu, 21 Feb 2013 19:02:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJ2rpk033722; Thu, 21 Feb 2013 19:02:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LJ2o5T033708; Thu, 21 Feb 2013 19:02:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302211902.r1LJ2o5T033708@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Feb 2013 19:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 19:02:53 -0000 Author: jhb Date: Thu Feb 21 19:02:50 2013 New Revision: 247116 URL: http://svnweb.freebsd.org/changeset/base/247116 Log: Further refine the handling of stop signals in the NFS client. The changes in r246417 were incomplete as they did not add explicit calls to sigdeferstop() around all the places that previously passed SBDRY to _sleep(). In addition, nfs_getcacheblk() could trigger a write RPC from getblk() resulting in sigdeferstop() recursing. Rather than manually deferring stop signals in specific places, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients are set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. PR: kern/176179 Reported by: Russell Cattelan (sigdeferstop() recursion) Reviewed by: kib MFC after: 1 month Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/kern/kern_sig.c head/sys/kern/subr_trap.c head/sys/kern/vfs_export.c head/sys/kern/vfs_lookup.c head/sys/nfsclient/nfs_krpc.c head/sys/nfsclient/nfs_vfsops.c head/sys/sys/mount.h head/sys/sys/signalvar.h head/sys/tools/vnode_if.awk Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 21 19:02:50 2013 (r247116) @@ -1080,7 +1080,6 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); - sigdeferstop(td); kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); @@ -1092,7 +1091,6 @@ newnfs_restore_sigmask(struct thread *td if (td == NULL) td = curthread; /* XXX */ kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0); - sigallowstop(td); } /* Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 21 19:02:50 2013 (r247116) @@ -132,7 +132,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/kern/kern_sig.c Thu Feb 21 19:02:50 2013 (r247116) @@ -2537,16 +2537,22 @@ tdsigcleanup(struct thread *td) } -/* Defer the delivery of SIGSTOP for the current thread. */ -void -sigdeferstop(struct thread *td) +/* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) { + struct thread *td; - KASSERT(!(td->td_flags & TDF_SBDRY), - ("attempt to set TDF_SBDRY recursively")); + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); thread_lock(td); td->td_flags |= TDF_SBDRY; thread_unlock(td); + return (1); } /* @@ -2555,11 +2561,11 @@ sigdeferstop(struct thread *td) * will suspend either via ast() or a subsequent interruptible sleep. */ void -sigallowstop(struct thread *td) +sigallowstop() { + struct thread *td; - KASSERT(td->td_flags & TDF_SBDRY, - ("attempt to clear already-cleared TDF_SBDRY")); + td = curthread; thread_lock(td); td->td_flags &= ~TDF_SBDRY; thread_unlock(td); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/kern/subr_trap.c Thu Feb 21 19:02:50 2013 (r247116) @@ -164,6 +164,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with with pinned thread")); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/kern/vfs_export.c Thu Feb 21 19:02:50 2013 (r247116) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/kern/vfs_lookup.c Thu Feb 21 19:02:50 2013 (r247116) @@ -339,7 +339,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/nfsclient/nfs_krpc.c Thu Feb 21 19:02:50 2013 (r247116) @@ -748,7 +748,6 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); - sigdeferstop(td); kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); @@ -760,7 +759,6 @@ nfs_restore_sigmask(struct thread *td, s if (td == NULL) td = curthread; /* XXX */ kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0); - sigallowstop(td); } /* Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/nfsclient/nfs_vfsops.c Thu Feb 21 19:02:50 2013 (r247116) @@ -146,7 +146,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(oldnfs, 1); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/sys/mount.h Thu Feb 21 19:02:50 2013 (r247116) @@ -493,6 +493,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -629,30 +630,121 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) -#define VFS_RECLAIM_LOWERVP(MP, VP) \ - ({if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) \ - (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); }) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/sys/signalvar.h Thu Feb 21 19:02:50 2013 (r247116) @@ -328,8 +328,8 @@ extern struct mtx sigio_lock; #define SIGPROCMASK_PS_LOCKED 0x0004 int cursig(struct thread *td, int stop_allowed); -void sigdeferstop(struct thread *td); -void sigallowstop(struct thread *td); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Thu Feb 21 19:02:29 2013 (r247115) +++ head/sys/tools/vnode_if.awk Thu Feb 21 19:02:50 2013 (r247116) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -365,10 +366,12 @@ while ((getline < srcfile) > 0) { add_debug_code(name, args[i], "Entry", "\t"); printc("\tKTR_START" ctrstr); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); for (i = 0; i < numargs; ++i) From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 19:13:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 854A94D5; Thu, 21 Feb 2013 19:13:20 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77FF4293; Thu, 21 Feb 2013 19:13:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJDKhG037220; Thu, 21 Feb 2013 19:13:20 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LJDK3w037219; Thu, 21 Feb 2013 19:13:20 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201302211913.r1LJDK3w037219@svn.freebsd.org> From: John-Mark Gurney Date: Thu, 21 Feb 2013 19:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247117 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 19:13:20 -0000 Author: jmg Date: Thu Feb 21 19:13:19 2013 New Revision: 247117 URL: http://svnweb.freebsd.org/changeset/base/247117 Log: reorder so all the flags are together and make the PCLMUL flag unique.. This fixes the problem on amd64 miscompiling mpboot.s causing boot issues... We are still using gas for a few files in the kernel... Submitted by: kib MFC after: 1 month Modified: head/contrib/binutils/opcodes/i386-opc.h Modified: head/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.h Thu Feb 21 19:02:50 2013 (r247116) +++ head/contrib/binutils/opcodes/i386-opc.h Thu Feb 21 19:13:19 2013 (r247117) @@ -73,15 +73,16 @@ typedef struct template #define CpuSSE4_2 0x800000 /* SSE4.2 Instructions required */ #define CpuXSAVE 0x1000000 /* XSAVE Instructions required */ #define CpuAES 0x2000000 /* AES Instructions required */ -#define CpuPCLMUL 0x4000000 /* Carry-less Multiplication extensions */ - -/* SSE4.1/4.2 Instructions required */ -#define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ #define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ +#define CpuPCLMUL 0x10000000 /* Carry-less Multiplication extensions */ + +/* SSE4.1/4.2 Instructions required */ +#define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) + /* The default value for unknown CPUs - enable all features to avoid problems. */ #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 20:13:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C97FBDA2; Thu, 21 Feb 2013 20:13:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBA68846; Thu, 21 Feb 2013 20:13:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LKDG9k055903; Thu, 21 Feb 2013 20:13:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LKDGRQ055901; Thu, 21 Feb 2013 20:13:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302212013.r1LKDGRQ055901@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 21 Feb 2013 20:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247122 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 20:13:16 -0000 Author: np Date: Thu Feb 21 20:13:15 2013 New Revision: 247122 URL: http://svnweb.freebsd.org/changeset/base/247122 Log: cxgbe(4): Add sysctls to extract debug information from the chip: dev.t4nex.X.misc.cim_la logic analyzer dump dev.t4nex.X.misc.cim_qcfg queue configuration dev.t4nex.X.misc.cim_ibq_xxx inbound queues dev.t4nex.X.misc.cim_obq_xxx outbound queues Obtained from: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Thu Feb 21 19:44:05 2013 (r247121) +++ head/sys/dev/cxgbe/common/t4_hw.h Thu Feb 21 20:13:15 2013 (r247122) @@ -58,6 +58,7 @@ enum { CIM_PIFLA_SIZE = 64, /* # of 192-bit words in CIM PIF LA */ CIM_MALA_SIZE = 64, /* # of 160-bit words in CIM MA LA */ CIM_IBQ_SIZE = 128, /* # of 128-bit words in a CIM IBQ */ + CIM_OBQ_SIZE = 128, /* # of 128-bit words in a CIM OBQ */ TPLA_SIZE = 128, /* # of 64-bit words in TP LA */ ULPRX_LA_SIZE = 512, /* # of 256-bit words in ULP_RX LA */ }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 21 19:44:05 2013 (r247121) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 21 20:13:15 2013 (r247122) @@ -317,6 +317,9 @@ static int sysctl_qsize_txq(SYSCTL_HANDL static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); #ifdef SBUF_DRAIN static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_la(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); static int sysctl_devlog(SYSCTL_HANDLER_ARGS); @@ -3171,6 +3174,62 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cctrl, "A", "congestion control"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp0", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_ibq_obq, "A", "CIM IBQ 0 (TP0)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp1", + CTLTYPE_STRING | CTLFLAG_RD, sc, 1, + sysctl_cim_ibq_obq, "A", "CIM IBQ 1 (TP1)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ulp", + CTLTYPE_STRING | CTLFLAG_RD, sc, 2, + sysctl_cim_ibq_obq, "A", "CIM IBQ 2 (ULP)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge0", + CTLTYPE_STRING | CTLFLAG_RD, sc, 3, + sysctl_cim_ibq_obq, "A", "CIM IBQ 3 (SGE0)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge1", + CTLTYPE_STRING | CTLFLAG_RD, sc, 4, + sysctl_cim_ibq_obq, "A", "CIM IBQ 4 (SGE1)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ncsi", + CTLTYPE_STRING | CTLFLAG_RD, sc, 5, + sysctl_cim_ibq_obq, "A", "CIM IBQ 5 (NCSI)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_la", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_la, "A", "CIM logic analyzer"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp1", + CTLTYPE_STRING | CTLFLAG_RD, sc, 1 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 1 (ULP1)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp2", + CTLTYPE_STRING | CTLFLAG_RD, sc, 2 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 2 (ULP2)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp3", + CTLTYPE_STRING | CTLFLAG_RD, sc, 3 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 3 (ULP3)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge", + CTLTYPE_STRING | CTLFLAG_RD, sc, 4 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 4 (SGE)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ncsi", + CTLTYPE_STRING | CTLFLAG_RD, sc, 5 + CIM_NUM_IBQ, + sysctl_cim_ibq_obq, "A", "CIM OBQ 5 (NCSI)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_cim_qcfg, "A", "CIM queue configuration"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cpl_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cpl_stats, "A", "CPL statistics"); @@ -3694,6 +3753,176 @@ sysctl_cctrl(SYSCTL_HANDLER_ARGS) return (rc); } +static const char *qname[CIM_NUM_IBQ + CIM_NUM_OBQ] = { + "TP0", "TP1", "ULP", "SGE0", "SGE1", "NC-SI", /* ibq's */ + "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "NC-SI" /* obq's */ +}; + +static int +sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i, n, qid = arg2; + uint32_t *buf, *p; + char *qtype; + + KASSERT(qid >= 0 && qid < nitems(qname), + ("%s: bad qid %d\n", __func__, qid)); + + if (qid < CIM_NUM_IBQ) { + /* inbound queue */ + qtype = "IBQ"; + n = 4 * CIM_IBQ_SIZE; + buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + rc = t4_read_cim_ibq(sc, qid, buf, n); + } else { + /* outbound queue */ + qtype = "OBQ"; + qid -= CIM_NUM_IBQ; + n = 4 * 6 * CIM_OBQ_SIZE; + buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + rc = t4_read_cim_obq(sc, qid, buf, n); + } + + if (rc < 0) { + rc = -rc; + goto done; + } + n = rc * sizeof(uint32_t); /* rc has # of words actually read */ + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + goto done; + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) { + rc = ENOMEM; + goto done; + } + + sbuf_printf(sb, "%s%d %s", qtype , qid, qname[arg2]); + for (i = 0, p = buf; i < n; i += 16, p += 4) + sbuf_printf(sb, "\n%#06x: %08x %08x %08x %08x", i, p[0], p[1], + p[2], p[3]); + + rc = sbuf_finish(sb); + sbuf_delete(sb); +done: + free(buf, M_CXGBE); + return (rc); +} + +static int +sysctl_cim_la(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int cfg; + struct sbuf *sb; + uint32_t *buf, *p; + int rc; + + rc = -t4_cim_read(sc, A_UP_UP_DBG_LA_CFG, 1, &cfg); + if (rc != 0) + return (rc); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + buf = malloc(sc->params.cim_la_size * sizeof(uint32_t), M_CXGBE, + M_ZERO | M_WAITOK); + + rc = -t4_cim_read_la(sc, buf, NULL); + if (rc != 0) + goto done; + + sbuf_printf(sb, "Status Data PC%s", + cfg & F_UPDBGLACAPTPCONLY ? "" : + " LS0Stat LS0Addr LS0Data"); + + KASSERT((sc->params.cim_la_size & 7) == 0, + ("%s: p will walk off the end of buf", __func__)); + + for (p = buf; p < &buf[sc->params.cim_la_size]; p += 8) { + if (cfg & F_UPDBGLACAPTPCONLY) { + sbuf_printf(sb, "\n %02x %08x %08x", p[5] & 0xff, + p[6], p[7]); + sbuf_printf(sb, "\n %02x %02x%06x %02x%06x", + (p[3] >> 8) & 0xff, p[3] & 0xff, p[4] >> 8, + p[4] & 0xff, p[5] >> 8); + sbuf_printf(sb, "\n %02x %x%07x %x%07x", + (p[0] >> 4) & 0xff, p[0] & 0xf, p[1] >> 4, + p[1] & 0xf, p[2] >> 4); + } else { + sbuf_printf(sb, + "\n %02x %x%07x %x%07x %08x %08x " + "%08x%08x%08x%08x", + (p[0] >> 4) & 0xff, p[0] & 0xf, p[1] >> 4, + p[1] & 0xf, p[2] >> 4, p[2] & 0xf, p[3], p[4], p[5], + p[6], p[7]); + } + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); +done: + free(buf, M_CXGBE); + return (rc); +} + +static int +sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i; + uint16_t base[CIM_NUM_IBQ + CIM_NUM_OBQ]; + uint16_t size[CIM_NUM_IBQ + CIM_NUM_OBQ]; + uint16_t thres[CIM_NUM_IBQ]; + uint32_t obq_wr[2 * CIM_NUM_OBQ], *wr = obq_wr; + uint32_t stat[4 * (CIM_NUM_IBQ + CIM_NUM_OBQ)], *p = stat; + + rc = -t4_cim_read(sc, A_UP_IBQ_0_RDADDR, nitems(stat), stat); + if (rc == 0) + rc = -t4_cim_read(sc, A_UP_OBQ_0_REALADDR, nitems(obq_wr), + obq_wr); + if (rc != 0) + return (rc); + + t4_read_cimq_cfg(sc, base, size, thres); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); + + for (i = 0; i < CIM_NUM_IBQ; i++, p += 4) + sbuf_printf(sb, "\n%5s %5x %5u %4u %6x %4x %4u %4u %5u", + qname[i], base[i], size[i], thres[i], G_IBQRDADDR(p[0]), + G_IBQWRADDR(p[1]), G_QUESOPCNT(p[3]), G_QUEEOPCNT(p[3]), + G_QUEREMFLITS(p[2]) * 16); + for ( ; i < CIM_NUM_IBQ + CIM_NUM_OBQ; i++, p += 4, wr += 2) + sbuf_printf(sb, "\n%5s %5x %5u %11x %4x %4u %4u %5u", qname[i], + base[i], size[i], G_QUERDADDR(p[0]) & 0x3fff, + wr[0] - base[i], G_QUESOPCNT(p[3]), G_QUEEOPCNT(p[3]), + G_QUEREMFLITS(p[2]) * 16); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 20:45:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F839E18; Thu, 21 Feb 2013 20:45:20 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 522B89EC; Thu, 21 Feb 2013 20:45:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LKjK1J065413; Thu, 21 Feb 2013 20:45:20 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LKjKd6065412; Thu, 21 Feb 2013 20:45:20 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302212045.r1LKjKd6065412@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Feb 2013 20:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247129 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 20:45:20 -0000 Author: pluknet Date: Thu Feb 21 20:45:19 2013 New Revision: 247129 URL: http://svnweb.freebsd.org/changeset/base/247129 Log: Separate items in the list of System values with .Pp to ease readability. Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Thu Feb 21 20:44:53 2013 (r247128) +++ head/sbin/devd/devd.conf.5 Thu Feb 21 20:45:19 2013 (r247129) @@ -350,6 +350,7 @@ The network interface is attached to the The network interface is detached from the system. .El .El +.Pp .It Li DEVFS Events related to the .Xr devfs 5 @@ -369,6 +370,7 @@ The node is destroyed. .El .El +.Pp .It Li USB Events related to the USB subsystem. .Bl -tag -width ".Sy Subsystem" -compact @@ -390,6 +392,7 @@ USB interface is attached to a device. USB interface is detached from a device. .El .El +.Pp .It Li coretemp Events related to the .Xr coretemp 4 @@ -404,6 +407,7 @@ Notification that the CPU core has reach String containing the temperature of the core that has become too hot. .El .El +.Pp .It Li kern Events related to the kernel. .Bl -tag -width ".Sy Subsystem" -compact From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 21:28:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35C14205; Thu, 21 Feb 2013 21:28:35 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1973DD29; Thu, 21 Feb 2013 21:28:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LLSZ4A078616; Thu, 21 Feb 2013 21:28:35 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LLSYsc078612; Thu, 21 Feb 2013 21:28:34 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302212128.r1LLSYsc078612@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 21 Feb 2013 21:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247133 - in head/sys: conf dev/mxge modules/mxge/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 21:28:35 -0000 Author: gallatin Date: Thu Feb 21 21:28:33 2013 New Revision: 247133 URL: http://svnweb.freebsd.org/changeset/base/247133 Log: Improve mxge's receive performance for IPv6: - Add support for IPv6 rx csum offload - Finally switch mxge from using its own driver lro, to using tcp_lro MFC after: 7 days Sponsored by: Myricom Inc. Deleted: head/sys/dev/mxge/mxge_lro.c Modified: head/sys/conf/files head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h head/sys/modules/mxge/mxge/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 21 21:16:42 2013 (r247132) +++ head/sys/conf/files Thu Feb 21 21:28:33 2013 (r247133) @@ -1742,7 +1742,6 @@ mwlboot.fw optional mwlfw \ no-obj no-implicit-rule \ clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci -dev/mxge/mxge_lro.c optional mxge pci dev/mxge/mxge_eth_z8e.c optional mxge pci dev/mxge/mxge_ethp_z8e.c optional mxge pci dev/mxge/mxge_rss_eth_z8e.c optional mxge pci Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Feb 21 21:16:42 2013 (r247132) +++ head/sys/dev/mxge/if_mxge.c Thu Feb 21 21:28:33 2013 (r247133) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -102,7 +103,6 @@ static int mxge_intr_coal_delay = 30; static int mxge_deassert_wait = 1; static int mxge_flow_control = 1; static int mxge_verbose = 0; -static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; @@ -1311,9 +1311,9 @@ mxge_reset(mxge_softc_t *sc, int interru ss->tx.stall = 0; ss->rx_big.cnt = 0; ss->rx_small.cnt = 0; - ss->lro_bad_csum = 0; - ss->lro_queued = 0; - ss->lro_flushed = 0; + ss->lc.lro_bad_csum = 0; + ss->lc.lro_queued = 0; + ss->lc.lro_flushed = 0; if (ss->fw_stats != NULL) { bzero(ss->fw_stats, sizeof *ss->fw_stats); } @@ -1414,50 +1414,6 @@ mxge_change_flow_control(SYSCTL_HANDLER_ } static int -mxge_change_lro_locked(mxge_softc_t *sc, int lro_cnt) -{ - struct ifnet *ifp; - int err = 0; - - ifp = sc->ifp; - if (lro_cnt == 0) - ifp->if_capenable &= ~IFCAP_LRO; - else - ifp->if_capenable |= IFCAP_LRO; - sc->lro_cnt = lro_cnt; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc, 0); - err = mxge_open(sc); - } - return err; -} - -static int -mxge_change_lro(SYSCTL_HANDLER_ARGS) -{ - mxge_softc_t *sc; - unsigned int lro_cnt; - int err; - - sc = arg1; - lro_cnt = sc->lro_cnt; - err = sysctl_handle_int(oidp, &lro_cnt, arg2, req); - if (err != 0) - return err; - - if (lro_cnt == sc->lro_cnt) - return 0; - - if (lro_cnt > 128) - return EINVAL; - - mtx_lock(&sc->driver_mtx); - err = mxge_change_lro_locked(sc, lro_cnt); - mtx_unlock(&sc->driver_mtx); - return err; -} - -static int mxge_handle_be32(SYSCTL_HANDLER_ARGS) { int err; @@ -1653,14 +1609,6 @@ mxge_add_sysctls(mxge_softc_t *sc) CTLFLAG_RW, &mxge_verbose, 0, "verbose printing"); - /* lro */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "lro_cnt", - CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_lro, - "I", "number of lro merge queues"); - - /* add counters exported for debugging from all slices */ sysctl_ctx_init(&sc->slice_sysctl_ctx); sc->slice_sysctl_tree = @@ -1686,11 +1634,15 @@ mxge_add_sysctls(mxge_softc_t *sc) CTLFLAG_RD, &ss->rx_big.cnt, 0, "rx_small_cnt"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "lro_flushed", CTLFLAG_RD, &ss->lro_flushed, + "lro_flushed", CTLFLAG_RD, &ss->lc.lro_flushed, 0, "number of lro merge queues flushed"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "lro_queued", CTLFLAG_RD, &ss->lro_queued, + "lro_bad_csum", CTLFLAG_RD, &ss->lc.lro_bad_csum, + 0, "number of bad csums preventing LRO"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "lro_queued", CTLFLAG_RD, &ss->lc.lro_queued, 0, "number of frames appended to lro merge" "queues"); @@ -2534,6 +2486,64 @@ done: return err; } +#ifdef INET6 + +static uint16_t +mxge_csum_generic(uint16_t *raw, int len) +{ + uint32_t csum; + + + csum = 0; + while (len > 0) { + csum += *raw; + raw++; + len -= 2; + } + csum = (csum >> 16) + (csum & 0xffff); + csum = (csum >> 16) + (csum & 0xffff); + return (uint16_t)csum; +} + +static inline uint16_t +mxge_rx_csum6(void *p, struct mbuf *m, uint32_t csum) +{ + uint32_t partial; + int nxt, cksum_offset; + struct ip6_hdr *ip6 = p; + uint16_t c; + + nxt = ip6->ip6_nxt; + cksum_offset = sizeof (*ip6) + ETHER_HDR_LEN; + if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP) { + cksum_offset = ip6_lasthdr(m, ETHER_HDR_LEN, + IPPROTO_IPV6, &nxt); + if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP) + return (1); + } + + /* + * IPv6 headers do not contain a checksum, and hence + * do not checksum to zero, so they don't "fall out" + * of the partial checksum calculation like IPv4 + * headers do. We need to fix the partial checksum by + * subtracting the checksum of the IPv6 header. + */ + + partial = mxge_csum_generic((uint16_t *)ip6, cksum_offset - + ETHER_HDR_LEN); + csum += ~partial; + csum += (csum < ~partial); + csum = (csum >> 16) + (csum & 0xFFFF); + csum = (csum >> 16) + (csum & 0xFFFF); + c = in6_cksum_pseudo(ip6, m->m_pkthdr.len - cksum_offset, nxt, + csum); + +// printf("%d %d %x %x %x %x %x\n", m->m_pkthdr.len, cksum_offset, c, csum, ocsum, partial, d); + c ^= 0xffff; + return (c); +} +#endif /* INET6 */ /* * Myri10GE hardware checksums are not valid if the sender * padded the frame with non-zero padding. This is because @@ -2547,26 +2557,39 @@ static inline uint16_t mxge_rx_csum(struct mbuf *m, int csum) { struct ether_header *eh; +#ifdef INET struct ip *ip; - uint16_t c; +#endif + int cap = m->m_pkthdr.rcvif->if_capenable; + uint16_t c, etype; - eh = mtod(m, struct ether_header *); - /* only deal with IPv4 TCP & UDP for now */ - if (__predict_false(eh->ether_type != htons(ETHERTYPE_IP))) - return 1; - ip = (struct ip *)(eh + 1); - if (__predict_false(ip->ip_p != IPPROTO_TCP && - ip->ip_p != IPPROTO_UDP)) - return 1; + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + switch (etype) { #ifdef INET - c = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htonl(ntohs(csum) + ntohs(ip->ip_len) + - - (ip->ip_hl << 2) + ip->ip_p)); -#else - c = 1; + case ETHERTYPE_IP: + if ((cap & IFCAP_RXCSUM) == 0) + return (1); + ip = (struct ip *)(eh + 1); + if (ip->ip_p != IPPROTO_TCP && ip->ip_p != IPPROTO_UDP) + return (1); + c = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htonl(ntohs(csum) + ntohs(ip->ip_len) - + (ip->ip_hl << 2) + ip->ip_p)); + c ^= 0xffff; + break; #endif - c ^= 0xffff; +#ifdef INET6 + case ETHERTYPE_IPV6: + if ((cap & IFCAP_RXCSUM_IPV6) == 0) + return (1); + c = mxge_rx_csum6((eh + 1), m, csum); + break; +#endif + default: + c = 1; + } return (c); } @@ -2628,7 +2651,8 @@ mxge_vlan_tag_remove(struct mbuf *m, uin static inline void -mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, uint32_t csum) +mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, + uint32_t csum, int lro) { mxge_softc_t *sc; struct ifnet *ifp; @@ -2637,7 +2661,6 @@ mxge_rx_done_big(struct mxge_slice_state mxge_rx_ring_t *rx; bus_dmamap_t old_map; int idx; - uint16_t tcpudp_csum; sc = ss->sc; ifp = sc->ifp; @@ -2674,14 +2697,18 @@ mxge_rx_done_big(struct mxge_slice_state mxge_vlan_tag_remove(m, &csum); } /* if the checksum is valid, mark it in the mbuf header */ - if (sc->csum_flag && (0 == (tcpudp_csum = mxge_rx_csum(m, csum)))) { - if (sc->lro_cnt && (0 == mxge_lro_rx(ss, m, csum))) - return; - /* otherwise, it was a UDP frame, or a TCP frame which - we could not do LRO on. Tell the stack that the - checksum is good */ + + if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) && + (0 == mxge_rx_csum(m, csum))) { + /* Tell the stack that the checksum is good */ m->m_pkthdr.csum_data = 0xffff; - m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | CSUM_DATA_VALID; + m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | + CSUM_DATA_VALID; + +#if defined(INET) || defined (INET6) + if (lro && (0 == tcp_lro_rx(&ss->lc, m, 0))) + return; +#endif } /* flowid only valid if RSS hashing is enabled */ if (sc->num_slices > 1) { @@ -2693,7 +2720,8 @@ mxge_rx_done_big(struct mxge_slice_state } static inline void -mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, uint32_t csum) +mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, + uint32_t csum, int lro) { mxge_softc_t *sc; struct ifnet *ifp; @@ -2702,7 +2730,6 @@ mxge_rx_done_small(struct mxge_slice_sta mxge_rx_ring_t *rx; bus_dmamap_t old_map; int idx; - uint16_t tcpudp_csum; sc = ss->sc; ifp = sc->ifp; @@ -2739,14 +2766,17 @@ mxge_rx_done_small(struct mxge_slice_sta mxge_vlan_tag_remove(m, &csum); } /* if the checksum is valid, mark it in the mbuf header */ - if (sc->csum_flag && (0 == (tcpudp_csum = mxge_rx_csum(m, csum)))) { - if (sc->lro_cnt && (0 == mxge_lro_rx(ss, m, csum))) - return; - /* otherwise, it was a UDP frame, or a TCP frame which - we could not do LRO on. Tell the stack that the - checksum is good */ + if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) && + (0 == mxge_rx_csum(m, csum))) { + /* Tell the stack that the checksum is good */ m->m_pkthdr.csum_data = 0xffff; - m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | CSUM_DATA_VALID; + m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | + CSUM_DATA_VALID; + +#if defined(INET) || defined (INET6) + if (lro && (0 == tcp_lro_rx(&ss->lc, m, csum))) + return; +#endif } /* flowid only valid if RSS hashing is enabled */ if (sc->num_slices > 1) { @@ -2764,16 +2794,17 @@ mxge_clean_rx_done(struct mxge_slice_sta int limit = 0; uint16_t length; uint16_t checksum; + int lro; - + lro = ss->sc->ifp->if_capenable & IFCAP_LRO; while (rx_done->entry[rx_done->idx].length != 0) { length = ntohs(rx_done->entry[rx_done->idx].length); rx_done->entry[rx_done->idx].length = 0; checksum = rx_done->entry[rx_done->idx].checksum; if (length <= (MHLEN - MXGEFW_PAD)) - mxge_rx_done_small(ss, length, checksum); + mxge_rx_done_small(ss, length, checksum, lro); else - mxge_rx_done_big(ss, length, checksum); + mxge_rx_done_big(ss, length, checksum, lro); rx_done->cnt++; rx_done->idx = rx_done->cnt & rx_done->mask; @@ -2781,11 +2812,11 @@ mxge_clean_rx_done(struct mxge_slice_sta if (__predict_false(++limit > rx_done->mask / 2)) break; } -#ifdef INET - while (!SLIST_EMPTY(&ss->lro_active)) { - struct lro_entry *lro = SLIST_FIRST(&ss->lro_active); - SLIST_REMOVE_HEAD(&ss->lro_active, next); - mxge_lro_flush(ss, lro); +#if defined(INET) || defined (INET6) + while (!SLIST_EMPTY(&ss->lc.lro_active)) { + struct lro_entry *lro = SLIST_FIRST(&ss->lc.lro_active); + SLIST_REMOVE_HEAD(&ss->lc.lro_active, next); + tcp_lro_flush(&ss->lc, lro); } #endif } @@ -3153,15 +3184,11 @@ mxge_init(void *arg) static void mxge_free_slice_mbufs(struct mxge_slice_state *ss) { - struct lro_entry *lro_entry; int i; - while (!SLIST_EMPTY(&ss->lro_free)) { - lro_entry = SLIST_FIRST(&ss->lro_free); - SLIST_REMOVE_HEAD(&ss->lro_free, next); - free(lro_entry, M_DEVBUF); - } - +#if defined(INET) || defined(INET6) + tcp_lro_free(&ss->lc); +#endif for (i = 0; i <= ss->rx_big.mask; i++) { if (ss->rx_big.info[i].m == NULL) continue; @@ -3545,26 +3572,17 @@ mxge_slice_open(struct mxge_slice_state mxge_softc_t *sc; mxge_cmd_t cmd; bus_dmamap_t map; - struct lro_entry *lro_entry; int err, i, slice; sc = ss->sc; slice = ss - sc->ss; - SLIST_INIT(&ss->lro_free); - SLIST_INIT(&ss->lro_active); - - for (i = 0; i < sc->lro_cnt; i++) { - lro_entry = (struct lro_entry *) - malloc(sizeof (*lro_entry), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (lro_entry == NULL) { - sc->lro_cnt = i; - break; - } - SLIST_INSERT_HEAD(&ss->lro_free, lro_entry, next); - } +#if defined(INET) || defined(INET6) + (void)tcp_lro_init(&ss->lc); +#endif + ss->lc.ifp = sc->ifp; + /* get the lanai pointers to the send and receive rings */ err = 0; @@ -4219,10 +4237,8 @@ mxge_ioctl(struct ifnet *ifp, u_long com } else if (mask & IFCAP_RXCSUM) { if (IFCAP_RXCSUM & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_RXCSUM; - sc->csum_flag = 0; } else { ifp->if_capenable |= IFCAP_RXCSUM; - sc->csum_flag = 1; } } if (mask & IFCAP_TSO4) { @@ -4249,16 +4265,12 @@ mxge_ioctl(struct ifnet *ifp, u_long com ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); } -#ifdef NOTYET - } else if (mask & IFCAP_RXCSUM6) { - if (IFCAP_RXCSUM6 & ifp->if_capenable) { - ifp->if_capenable &= ~IFCAP_RXCSUM6; - sc->csum_flag = 0; + } else if (mask & IFCAP_RXCSUM_IPV6) { + if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) { + ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6; } else { - ifp->if_capenable |= IFCAP_RXCSUM6; - sc->csum_flag = 1; + ifp->if_capenable |= IFCAP_RXCSUM_IPV6; } -#endif } if (mask & IFCAP_TSO6) { if (IFCAP_TSO6 & ifp->if_capenable) { @@ -4274,12 +4286,8 @@ mxge_ioctl(struct ifnet *ifp, u_long com } #endif /*IFCAP_TSO6 */ - if (mask & IFCAP_LRO) { - if (IFCAP_LRO & ifp->if_capenable) - err = mxge_change_lro_locked(sc, 0); - else - err = mxge_change_lro_locked(sc, mxge_lro_cnt); - } + if (mask & IFCAP_LRO) + ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if (mask & IFCAP_VLAN_HWTSO) @@ -4326,14 +4334,11 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.verbose", &mxge_verbose); TUNABLE_INT_FETCH("hw.mxge.ticks", &mxge_ticks); - TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); - if (sc->lro_cnt != 0) - mxge_lro_cnt = sc->lro_cnt; if (bootverbose) mxge_verbose = 1; @@ -4897,8 +4902,9 @@ mxge_attach(device_t dev) if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 | - IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6; -#ifdef INET + IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6 | + IFCAP_RXCSUM_IPV6; +#if defined(INET) || defined(INET6) ifp->if_capabilities |= IFCAP_LRO; #endif @@ -4929,7 +4935,6 @@ mxge_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; if (sc->lro_cnt == 0) ifp->if_capenable &= ~IFCAP_LRO; - sc->csum_flag = 1; ifp->if_init = mxge_init; ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Thu Feb 21 21:16:42 2013 (r247132) +++ head/sys/dev/mxge/if_mxge_var.h Thu Feb 21 21:28:33 2013 (r247133) @@ -194,31 +194,6 @@ typedef struct char mtx_name[16]; } mxge_tx_ring_t; -struct lro_entry; -struct lro_entry -{ - SLIST_ENTRY(lro_entry) next; - struct mbuf *m_head; - struct mbuf *m_tail; - int timestamp; - struct ip *ip; - uint32_t tsval; - uint32_t tsecr; - uint32_t source_ip; - uint32_t dest_ip; - uint32_t next_seq; - uint32_t ack_seq; - uint32_t len; - uint32_t data_csum; - uint16_t window; - uint16_t source_port; - uint16_t dest_port; - uint16_t append_cnt; - uint16_t mss; - -}; -SLIST_HEAD(lro_head, lro_entry); - struct mxge_softc; typedef struct mxge_softc mxge_softc_t; @@ -236,11 +211,7 @@ struct mxge_slice_state { u_long omcasts; u_long oerrors; int if_drv_flags; - struct lro_head lro_active; - struct lro_head lro_free; - int lro_queued; - int lro_flushed; - int lro_bad_csum; + struct lro_ctrl lc; mxge_dma_t fw_stats_dma; struct sysctl_oid *sysctl_tree; struct sysctl_ctx_list sysctl_ctx; @@ -250,7 +221,6 @@ struct mxge_slice_state { struct mxge_softc { struct ifnet* ifp; struct mxge_slice_state *ss; - int csum_flag; /* rx_csums? */ int tx_boundary; /* boundary transmits cannot cross*/ int lro_cnt; bus_dma_tag_t parent_dmat; Modified: head/sys/modules/mxge/mxge/Makefile ============================================================================== --- head/sys/modules/mxge/mxge/Makefile Thu Feb 21 21:16:42 2013 (r247132) +++ head/sys/modules/mxge/mxge/Makefile Thu Feb 21 21:28:33 2013 (r247133) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../dev/mxge KMOD= if_mxge -SRCS= if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h +SRCS= if_mxge.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 21:35:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD4014FD; Thu, 21 Feb 2013 21:35:09 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5DBDD8B; Thu, 21 Feb 2013 21:35:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LLZ9mx081240; Thu, 21 Feb 2013 21:35:09 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LLZ9cY081239; Thu, 21 Feb 2013 21:35:09 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302212135.r1LLZ9cY081239@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Feb 2013 21:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247134 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 21:35:09 -0000 Author: pluknet Date: Thu Feb 21 21:35:09 2013 New Revision: 247134 URL: http://svnweb.freebsd.org/changeset/base/247134 Log: Reflect CARP media-type departure. X-MFC after: never Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Thu Feb 21 21:28:33 2013 (r247133) +++ head/sbin/devd/devd.conf.5 Thu Feb 21 21:35:09 2013 (r247134) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd December 16, 2011 +.Dd February 22, 2013 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -181,9 +181,8 @@ Valid media types are: .Dq Li Tokenring , .Dq Li FDDI , .Dq Li 802.11 , -.Dq Li ATM , and -.Dq Li CARP . +.Dq Li ATM . .It Ic subdevice Qq Ar string ; This is shorthand for .Dq Ic match Qo Li subdevice Qc Qq Ar string . From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 21:47:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 23506CC4; Thu, 21 Feb 2013 21:47:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 101DFE46; Thu, 21 Feb 2013 21:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LLlaGf084722; Thu, 21 Feb 2013 21:47:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LLla0k084720; Thu, 21 Feb 2013 21:47:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302212147.r1LLla0k084720@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Feb 2013 21:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247135 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 21:47:37 -0000 Author: adrian Date: Thu Feb 21 21:47:35 2013 New Revision: 247135 URL: http://svnweb.freebsd.org/changeset/base/247135 Log: Disable debugging entries about BAW issues. I haven't seen any issues to do with BAW tracking in the last 9 months or so. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 21 21:35:09 2013 (r247134) +++ head/sys/dev/ath/if_ath.c Thu Feb 21 21:47:35 2013 (r247135) @@ -3631,12 +3631,14 @@ ath_tx_default_comp(struct ath_softc *sc st = ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) ? ts->ts_status : HAL_TXERR_XRETRY; +#if 0 if (bf->bf_state.bfs_dobaw) device_printf(sc->sc_dev, "%s: bf %p: seqno %d: dobaw should've been cleared!\n", __func__, bf, SEQNO(bf->bf_state.bfs_seqno)); +#endif if (bf->bf_next != NULL) device_printf(sc->sc_dev, "%s: bf %p: seqno %d: bf_next not NULL!\n", Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Feb 21 21:35:09 2013 (r247134) +++ head/sys/dev/ath/if_ath_tx.c Thu Feb 21 21:47:35 2013 (r247135) @@ -3373,6 +3373,7 @@ ath_tx_tid_drain_pkt(struct ath_softc *s ath_tx_update_baw(sc, an, tid, bf); bf->bf_state.bfs_dobaw = 0; } +#if 0 /* * This has become a non-fatal error now */ @@ -3380,6 +3381,7 @@ ath_tx_tid_drain_pkt(struct ath_softc *s device_printf(sc->sc_dev, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); +#endif } TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 21:54:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B6F91FF; Thu, 21 Feb 2013 21:54:26 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id 92D8AEAA; Thu, 21 Feb 2013 21:54:25 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hi8so200150wib.7 for ; Thu, 21 Feb 2013 13:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=YH+CmAwVUKpFI/Vbi8mRveMp6QfXQk9dIzJGiPVlHak=; b=IYJaFKqr4UNwPpO+kIiOAawb2R+8KjLSRvPriVxsmQKfKJg+0MmEbwcCz7v01VVvca Xst7LzA2NihUW8uB9P1+etoGiLogmp05i1Z2q4ac9rd78SUJrYM5MDs6gzaZGyUTJcbC JsR8tv3fRZ9SOs0M+KTQWP7SJZhPNPwGRS5xrfusXWed2Iazazs62KqUmH7sAo4DoQPK dnuZk/qiSaQAgBNA1ncaExCs0GIyP6J0sacE5+TNOwiN/Solni6kJfBICcIS7GE2rVt5 fwZ+E6gFc7RhJqJ69/IY0M/N8AQGIrL2Pb9RnNqcPWmLyKlHZXjmps2lJcMOVDHzSc1r kDkg== MIME-Version: 1.0 X-Received: by 10.181.12.103 with SMTP id ep7mr44934580wid.12.1361483664378; Thu, 21 Feb 2013 13:54:24 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.194.86.167 with HTTP; Thu, 21 Feb 2013 13:54:24 -0800 (PST) In-Reply-To: <201302212135.r1LLZ9cY081239@svn.freebsd.org> References: <201302212135.r1LLZ9cY081239@svn.freebsd.org> Date: Fri, 22 Feb 2013 00:54:24 +0300 X-Google-Sender-Auth: -gaLSnId_IcWIxZraWBTt6L601E Message-ID: Subject: Re: svn commit: r247134 - head/sbin/devd From: Sergey Kandaurov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 21:54:26 -0000 On 22 February 2013 01:35, Sergey Kandaurov wrote: > Author: pluknet > Date: Thu Feb 21 21:35:09 2013 > New Revision: 247134 > URL: http://svnweb.freebsd.org/changeset/base/247134 > > Log: > Reflect CARP media-type departure. > > X-MFC after: never > > Modified: > head/sbin/devd/devd.conf.5 > > Modified: head/sbin/devd/devd.conf.5 > ============================================================================== > --- head/sbin/devd/devd.conf.5 Thu Feb 21 21:28:33 2013 (r247133) > +++ head/sbin/devd/devd.conf.5 Thu Feb 21 21:35:09 2013 (r247134) > @@ -41,7 +41,7 @@ > .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS > .\" SOFTWARE. > .\" > -.Dd December 16, 2011 > +.Dd February 22, 2013 > .Dt DEVD.CONF 5 > .Os > .Sh NAME > @@ -181,9 +181,8 @@ Valid media types are: > .Dq Li Tokenring , > .Dq Li FDDI , > .Dq Li 802.11 , > -.Dq Li ATM , > and > -.Dq Li CARP . > +.Dq Li ATM . > .It Ic subdevice Qq Ar string ; > This is shorthand for > .Dq Ic match Qo Li subdevice Qc Qq Ar string . Probably CARP devd hooks documentation should rather be moved here from the carp(4) man page, where it resides currently. So, it will all be in one place. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 22:21:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 457AF291; Thu, 21 Feb 2013 22:21:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32B8CD9; Thu, 21 Feb 2013 22:21:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LMLk9Y096610; Thu, 21 Feb 2013 22:21:46 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1LMLksi096609; Thu, 21 Feb 2013 22:21:46 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302212221.r1LMLksi096609@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Feb 2013 22:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247140 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 21 Feb 2013 22:21:46 -0000 Author: pluknet Date: Thu Feb 21 22:21:45 2013 New Revision: 247140 URL: http://svnweb.freebsd.org/changeset/base/247140 Log: Document VFCF_SBDRY. Reviewed by: jhb X-MFC with: r247116 Modified: head/share/man/man9/VFS_SET.9 Modified: head/share/man/man9/VFS_SET.9 ============================================================================== --- head/share/man/man9/VFS_SET.9 Thu Feb 21 21:59:35 2013 (r247139) +++ head/share/man/man9/VFS_SET.9 Thu Feb 21 22:21:45 2013 (r247140) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2013 +.Dd February 21, 2013 .Dt VFS_SET 9 .Os .Sh NAME @@ -80,6 +80,9 @@ Supports delegated administration if .Va vfs.usermount sysctl is set to .Dv 1 . +.It Dv VFCF_SBDRY +When in VFS method, the thread suspension is deferred to the user +boundary upon arrival of stop action. .El .Sh PSEUDOCODE .Bd -literal From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 00:46:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFC7C399; Fri, 22 Feb 2013 00:46:33 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89F6E9A2; Fri, 22 Feb 2013 00:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1M0kXN7039941; Fri, 22 Feb 2013 00:46:33 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1M0kWvD039938; Fri, 22 Feb 2013 00:46:32 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201302220046.r1M0kWvD039938@svn.freebsd.org> From: Peter Grehan Date: Fri, 22 Feb 2013 00:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247144 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 00:46:33 -0000 Author: grehan Date: Fri Feb 22 00:46:32 2013 New Revision: 247144 URL: http://svnweb.freebsd.org/changeset/base/247144 Log: Add the ability to have a 'fallback' search for memory ranges. These set of ranges will be looked at if a standard memory range isn't found, and won't be installed in the cache. Use this to implement the memory behaviour of the PCI hole on x86 systems, where writes are ignored and reads always return -1. This allows breakpoints to be set when issuing a 'boot -d', which has the side effect of accessing the PCI hole when changing the PTE protection on kernel code, since the pmap layer hasn't been initialized (a bug, but present in existing FreeBSD releases so has to be handled). Reviewed by: neel Obtained from: NetApp Modified: head/usr.sbin/bhyve/mem.c head/usr.sbin/bhyve/mem.h head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Thu Feb 21 22:48:25 2013 (r247143) +++ head/usr.sbin/bhyve/mem.c Fri Feb 22 00:46:32 2013 (r247144) @@ -62,7 +62,7 @@ struct mmio_rb_range { struct mmio_rb_tree; RB_PROTOTYPE(mmio_rb_tree, mmio_rb_range, mr_link, mmio_rb_range_compare); -RB_HEAD(mmio_rb_tree, mmio_rb_range) mmio_rbroot; +RB_HEAD(mmio_rb_tree, mmio_rb_range) mmio_rb_root, mmio_rb_fallback; /* * Per-vCPU cache. Since most accesses from a vCPU will be to @@ -82,13 +82,14 @@ mmio_rb_range_compare(struct mmio_rb_ran } static int -mmio_rb_lookup(uint64_t addr, struct mmio_rb_range **entry) +mmio_rb_lookup(struct mmio_rb_tree *rbt, uint64_t addr, + struct mmio_rb_range **entry) { struct mmio_rb_range find, *res; find.mr_base = find.mr_end = addr; - res = RB_FIND(mmio_rb_tree, &mmio_rbroot, &find); + res = RB_FIND(mmio_rb_tree, rbt, &find); if (res != NULL) { *entry = res; @@ -99,11 +100,11 @@ mmio_rb_lookup(uint64_t addr, struct mmi } static int -mmio_rb_add(struct mmio_rb_range *new) +mmio_rb_add(struct mmio_rb_tree *rbt, struct mmio_rb_range *new) { struct mmio_rb_range *overlap; - overlap = RB_INSERT(mmio_rb_tree, &mmio_rbroot, new); + overlap = RB_INSERT(mmio_rb_tree, rbt, new); if (overlap != NULL) { #ifdef RB_DEBUG @@ -120,11 +121,11 @@ mmio_rb_add(struct mmio_rb_range *new) #if 0 static void -mmio_rb_dump(void) +mmio_rb_dump(struct mmio_rb_tree *rbt) { struct mmio_rb_range *np; - RB_FOREACH(np, mmio_rb_tree, &mmio_rbroot) { + RB_FOREACH(np, mmio_rb_tree, rbt) { printf(" %lx:%lx, %s\n", np->mr_base, np->mr_end, np->mr_param.name); } @@ -172,22 +173,22 @@ emulate_mem(struct vmctx *ctx, int vcpu, entry = NULL; if (entry == NULL) { - if (mmio_rb_lookup(paddr, &entry)) + if (!mmio_rb_lookup(&mmio_rb_root, paddr, &entry)) { + /* Update the per-vCPU cache */ + mmio_hint[vcpu] = entry; + } else if (mmio_rb_lookup(&mmio_rb_fallback, paddr, &entry)) { return (ESRCH); - - /* Update the per-vCPU cache */ - mmio_hint[vcpu] = entry; + } } - assert(entry != NULL && entry == mmio_hint[vcpu]); - + assert(entry != NULL); err = vmm_emulate_instruction(ctx, vcpu, paddr, vie, mem_read, mem_write, &entry->mr_param); return (err); } -int -register_mem(struct mem_range *memp) +static int +register_mem_int(struct mmio_rb_tree *rbt, struct mem_range *memp) { struct mmio_rb_range *mrp; int err; @@ -201,7 +202,7 @@ register_mem(struct mem_range *memp) mrp->mr_base = memp->base; mrp->mr_end = memp->base + memp->size - 1; - err = mmio_rb_add(mrp); + err = mmio_rb_add(rbt, mrp); if (err) free(mrp); } else @@ -210,9 +211,24 @@ register_mem(struct mem_range *memp) return (err); } +int +register_mem(struct mem_range *memp) +{ + + return (register_mem_int(&mmio_rb_root, memp)); +} + +int +register_mem_fallback(struct mem_range *memp) +{ + + return (register_mem_int(&mmio_rb_fallback, memp)); +} + void init_mem(void) { - RB_INIT(&mmio_rbroot); + RB_INIT(&mmio_rb_root); + RB_INIT(&mmio_rb_fallback); } Modified: head/usr.sbin/bhyve/mem.h ============================================================================== --- head/usr.sbin/bhyve/mem.h Thu Feb 21 22:48:25 2013 (r247143) +++ head/usr.sbin/bhyve/mem.h Fri Feb 22 00:46:32 2013 (r247144) @@ -53,5 +53,6 @@ void init_mem(void); int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie); int register_mem(struct mem_range *memp); +int register_mem_fallback(struct mem_range *memp); #endif /* _MEM_H_ */ Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Feb 21 22:48:25 2013 (r247143) +++ head/usr.sbin/bhyve/pci_emul.c Fri Feb 22 00:46:32 2013 (r247144) @@ -846,12 +846,29 @@ pci_emul_iscap(struct pci_devinst *pi, i return (found); } +static int +pci_emul_fallback_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, + int size, uint64_t *val, void *arg1, long arg2) +{ + /* + * Ignore writes; return 0xff's for reads. The mem read code + * will take care of truncating to the correct size. + */ + if (dir == MEM_F_READ) { + *val = 0xffffffffffffffff; + } + + return (0); +} + void init_pci(struct vmctx *ctx) { + struct mem_range memp; struct pci_devemu *pde; struct slotinfo *si; int slot, func; + int error; pci_emul_iobase = PCI_EMUL_IOBASE; pci_emul_membase32 = PCI_EMUL_MEMBASE32; @@ -879,6 +896,20 @@ init_pci(struct vmctx *ctx) lirq[11].li_generic = 1; lirq[12].li_generic = 1; lirq[15].li_generic = 1; + + /* + * Setup the PCI hole to return 0xff's when accessed in a region + * with no devices + */ + memset(&memp, 0, sizeof(struct mem_range)); + memp.name = "PCI hole"; + memp.flags = MEM_F_RW; + memp.base = lomem_sz; + memp.size = (4ULL * 1024 * 1024 * 1024) - lomem_sz; + memp.handler = pci_emul_fallback_handler; + + error = register_mem_fallback(&memp); + assert(error == 0); } int From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 06:26:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39A3B843; Fri, 22 Feb 2013 06:26:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id B22C195F; Fri, 22 Feb 2013 06:26:17 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1M6Pw7l021702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 Feb 2013 17:26:01 +1100 Date: Fri, 22 Feb 2013 17:25:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r247068 - head/sys/x86/isa In-Reply-To: <9BB56E45-A272-46D7-AF3F-833424017F2D@bsdimp.com> Message-ID: <20130222163203.V998@besplex.bde.org> References: <201302210040.r1L0e80m095140@svn.freebsd.org> <20130221225538.J1447@besplex.bde.org> <9BB56E45-A272-46D7-AF3F-833424017F2D@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Auu2R5BP c=1 sm=1 a=l9K4Gy_p75cA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=P-gUh28lWcoA:10 a=SCQmF_P1DJsj7OQf4WYA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 06:26:18 -0000 On Thu, 21 Feb 2013, Warner Losh wrote: > On Feb 21, 2013, at 5:31 AM, Bruce Evans wrote: > >> On Thu, 21 Feb 2013, Warner Losh wrote: >> >>> Log: >>> Fix broken usage of splhigh() by removing it. >> >> This is more broken than before. The splhigh() served to indicate >> missing locking. > > Depends on what you mean by more :) It is less depessimized after the nopification of splhigh(). The null spl didn't cost anything. >>> Modified: head/sys/x86/isa/atrtc.c >>> ============================================================================== >>> --- head/sys/x86/isa/atrtc.c Thu Feb 21 00:36:12 2013 (r247067) >>> +++ head/sys/x86/isa/atrtc.c Thu Feb 21 00:40:08 2013 (r247068) >>> @@ -328,7 +328,6 @@ static int >>> atrtc_gettime(device_t dev, struct timespec *ts) >>> { >>> struct clocktime ct; >>> - int s; >>> >>> /* Look if we have a RTC present and the time is valid */ >>> if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { >>> @@ -338,11 +337,8 @@ atrtc_gettime(device_t dev, struct times >>> >>> /* wait for time update to complete */ >>> /* If RTCSA_TUP is zero, we have at least 244us before next update */ >> >> As the comment says, this is time-critical code. It needs to do something >> to prevent it being preempted for more than 244 usec > > That's a long time... No, preemptions can easily be for as long as the quantum (default 100 milliseconds). > >>> - s = splhigh(); >> >> It used to do something... >> >>> - while (rtcin(RTC_STATUSA) & RTCSA_TUP) { >>> - splx(s); >>> - s = splhigh(); >>> - } >>> + while (rtcin(RTC_STATUSA) & RTCSA_TUP) >>> + continue; >> >> You should probably have changed this to a critical section like you did >> in ppc. Disabling hardware interrupts would be even better. > > I'll replace with a critical section. > >> There is a problem with the "show rtc" command in ddb. It was born >> broken (racy), and the races were turned into deadlocks by adding >> locking in rtcin(). So if you trace through this code, then >> "show rtc" while holding the lock in rtcin() will deadlock. It is a >> bug for ddb to call any code that might try to acquire a mutex, but >> "show rtc" always calls rtcin() and rtcin() always tries to aquire a >> mutex. Similar deadlocks on the i8254 lock in DELAY() are worked >> around by not trying to acquire the lock in kdb mode. > > kbd_active is what I need to check, right? I'll fix that while here. It is logically wrong, since only ddb has a command for accessing the RTC. >>> ct.nsec = 0; >>> ct.sec = readrtc(RTC_SEC); >>> ct.min = readrtc(RTC_MIN); >>> >> >> There are 8 or 9 readrtc()'s altogether. These must be atomic, and all >> within the 244 usec limit. There is considerable danger of exceeding the >> limit without even being preempted. Each readrtc() does 1 or 4 isa bus >> accesses. I've seen a single isa bus access taking 139 usec (delayed by >> PCI DMA). >> >> Another way of doing this without any locking against preemption or >> timing magic is to read the time before and after. If it took more than >> 244 usec from before seeing RTCSA_TUP deasserted to after the last >> readrtc(), then retry. > > By computing a time difference, or by checking RTCSA_TUP? The former. Needs a working timecounter or just some other timer with enough precision. RTCSA_TUP is volatile sand only gives the state at the time you read it, but you need to know if it became set while you were reading the registers. >> My version still depends on splhigh() working, but it does more >> sophisticated waiting that gives a full second to read the registers >> without getting more than a stale time. The above reads an RTC value >> that may be stale by almost 1 second. My version busy-waits until >> just after after the counter rolls over. This is only suitable for >> boot=time initialization. Debugging printfs show that this never got >> preempted over the last few years -- the whole operation always >> completed within about 40 usec of seeing the rollover. > > So this isn't a problem on fast machines? Fast machines shrink the race windows. I forgot that inittodr() is almost a non-problem for another reason: it is, or should, only be called at boot time and resume times. At these times, user threads shouldn't be running so we don't have to worry about preemption for a full quantum. resettodr() is more interesting. Privileged applications can try racing and/or mistiming it it using settime(2) in loops from multiple threads. Locking in the kernel settime() is quite broken too. It was broken even in FreeBSD-4 where the splclock() part of it worked, since it was: @ s = splclock(); @ ... @ set_timecounter(&ts); /* OK so far. */ @ (void) splsoftclock(); /* Wrong (1). */ @ lease_updatetime(delta.tv_sec); @ splx(s); /* Wronger (2). */ @ resettodr(); @ return (0); (1) We want to continue with lower priority for lease_updatetime(), but we haven't done resettodr() yet. OTOH, resettodr() might take too long to be done all at splclock(). (2) We even completely lower the priority before resettodr(). In -current, this has rotted to: @ s = splclock(); /* Wrong (3). */ @ ... @ mtx_lock(&Giant); /* Bogus (4). */ @ tc_setclock(&ts); @ // lease_updatetime() was removed, including its splsoftclock() @ // and also the splx(s) which doesn't belong to it. So now there @ // is an splclock() with no corresponding splx(). Compilers @ // should complain that s is unused. @ resettodr(); @ mtx_unlock(&Giant); @ return (0); After splclock() became null, anti-premption became broken. This isn't even Giant-locked. It accesses some globals without locking: - boottime, via microtime(). Locking for boottime is quite broken. Here we can cause boottime to be volatile by racing with another thread doing the same micro-adjustments as us. It is a bug for boottime to be volatile at all. It shouldn't be changed by micro-adjustments. - securelevel, via securelevel_gt(). Giant locking wouldn't help here. (4) Giant locking is fairly bogus for tc_setclock(), but better than nothing. It prevents contention from here. Similarly for resettodr(). tc_setclock() is called from elsewhere mainly from inittodr(). I think it has no Giant locking then. >> Linux does even more sophisticated waiting for writing the registers, >> so as not to be off by another second in the write operation. > > Yea, that would be nice, I may have to look into that, once I'm done fetching these stones. The above resettodr() call is the main thing that writes the registers. I think settime() should block for a second or 2 as necessary to sync with the hardware. It must release all locks while waiting for the hardware. Then when it writes, it updates the hardware with the current time, which is normally a fractional second after settime() starts. The splx(s) before the resettodr() was actually correct for this. Now resettodr() can be Giant locked, but if its callers acquire Giant as above, then it must release Giant while sleeping. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 06:46:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8E7B1D3C for ; Fri, 22 Feb 2013 06:46:43 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3D99ED for ; Fri, 22 Feb 2013 06:46:42 +0000 (UTC) Received: by mail-vb0-f42.google.com with SMTP id ff1so222698vbb.29 for ; Thu, 21 Feb 2013 22:46:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=gxkRrbngnD2J2kxF8dyjrN0doFtD/6We9AJaKRyY3GE=; b=OP+8Vydn9/1C4TBE6kBnQx6GqK529XMAi9cpj0aNPIyhHP8vIi4RHFhcu8pSLkTXlZ xaA7PMx2ncRJb8yDFZPk0w1tv+hoODwcrZDF7JrXk8lZm8pJMdrZxQ6QIAYP+HrXnqPg pu7rbKGRShpjBze8w6GLRCX+Y1ORj9kMwEQ+e0IztnotVgckrebw8nPqFjDP9fOxSzbn wyotfqUiONVsUG4sezkNaeuA8WtheQ+/NzSmQltgWGxYGTZu0Eh+MAAhNTAHt55kAJHb 9v7ECgrNRxteuwjudBn3zHdJ888NWbMxZ0VAlG98wnH2YqahNb7r67ePedbuD6BqLT+v q8PQ== MIME-Version: 1.0 X-Received: by 10.220.219.9 with SMTP id hs9mr1030564vcb.68.1361515602281; Thu, 21 Feb 2013 22:46:42 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.58.30.4 with HTTP; Thu, 21 Feb 2013 22:46:42 -0800 (PST) In-Reply-To: <86wqu1yhmj.fsf@ds4.des.no> References: <201209031651.q83GpfHi014195@svn.freebsd.org> <86wqu1yhmj.fsf@ds4.des.no> Date: Fri, 22 Feb 2013 19:46:42 +1300 X-Google-Sender-Auth: n6pgKva4GzAn5mcbGpK3xCKy3XE Message-ID: Subject: Re: svn commit: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh From: Andrew Thompson To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQny55bMPACQPbOh8+nNdSMTiMXe66uu/rZmWg/psY/JKzUnzVUJBvJeLDPhJ2SgQ5fM1yQx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 06:46:43 -0000 On 22 February 2013 01:29, Dag-Erling Sm=F8rgrav wrote: > Andrew Thompson writes: >> Dag-Erling Sm=F8rgrav writes: >> > Log: >> > Upgrade OpenSSH to 6.1p1. >> MFC? > > Not sure, it's a fairly large change. I assume you're asking because of > the upcoming 8.4? I found myself wanting the new Match LocalPort options and saw 6.1 was only in head, I had assumed openssh was always merged back but if its a disruptive change then thats ok. Andrew From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 07:07:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E2CF1A1; Fri, 22 Feb 2013 07:07:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38D70A98; Fri, 22 Feb 2013 07:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1M77CPf059447; Fri, 22 Feb 2013 07:07:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1M77C2s059446; Fri, 22 Feb 2013 07:07:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302220707.r1M77C2s059446@svn.freebsd.org> From: Adrian Chadd Date: Fri, 22 Feb 2013 07:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247145 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 07:07:12 -0000 Author: adrian Date: Fri Feb 22 07:07:11 2013 New Revision: 247145 URL: http://svnweb.freebsd.org/changeset/base/247145 Log: Add a workaround for AR5416, AR9130 and AR9160 chipsets - work around an incorrectly calculated RTS duration value when transmitting aggregates. These earlier 802.11n NICs incorrectly used the ACK duration time when calculating what to put in the RTS of an aggregate frame. Instead it should have used the block-ack time. The result is that other stations may not reserve enough time and start transmitting _over_ the top of the in-progress blockack field. Tsk. This workaround is to popuate the burst duration field with the delta between the ACK duration the hardware is using and the required duration for the block-ack. The result is that the RTS field should now contain the correct duration for the subsequent block-ack. This doesn't apply for AR9280 and later NICs. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Feb 22 00:46:32 2013 (r247144) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Feb 22 07:07:11 2013 (r247145) @@ -669,6 +669,26 @@ ar5416GetGlobalTxTimeout(struct ath_hal return MS(OS_REG_READ(ah, AR_GTXTO), AR_GTXTO_TIMEOUT_LIMIT); } +#define HT_RC_2_MCS(_rc) ((_rc) & 0x0f) +static const u_int8_t baDurationDelta[] = { + 24, // 0: BPSK + 12, // 1: QPSK 1/2 + 12, // 2: QPSK 3/4 + 4, // 3: 16-QAM 1/2 + 4, // 4: 16-QAM 3/4 + 4, // 5: 64-QAM 2/3 + 4, // 6: 64-QAM 3/4 + 4, // 7: 64-QAM 5/6 + 24, // 8: BPSK + 12, // 9: QPSK 1/2 + 12, // 10: QPSK 3/4 + 4, // 11: 16-QAM 1/2 + 4, // 12: 16-QAM 3/4 + 4, // 13: 64-QAM 2/3 + 4, // 14: 64-QAM 3/4 + 4, // 15: 64-QAM 5/6 +}; + void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds, u_int durUpdateEn, u_int rtsctsRate, @@ -740,17 +760,44 @@ ar5416Set11nRateScenario(struct ath_hal | SM(rtsctsRate, AR_RTSCTSRate); } +/* + * Note: this should be called before calling ar5416SetBurstDuration() + * (if it is indeed called) in order to ensure that the burst duration + * is correctly updated with the BA delta workaround. + */ void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, u_int aggrLen, u_int numDelims) { struct ar5416_desc *ads = AR5416DESC(ds); + uint32_t flags; + uint32_t burstDur; + uint8_t rate; ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr); ads->ds_ctl6 &= ~(AR_AggrLen | AR_PadDelim); ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen); ads->ds_ctl6 |= SM(numDelims, AR_PadDelim); + + if (! AR_SREV_MERLIN_10_OR_LATER(ah)) { + /* + * XXX It'd be nice if I were passed in the rate scenario + * at this point.. + */ + rate = MS(ads->ds_ctl3, AR_XmitRate0); + flags = ads->ds_ctl0 & (AR_CTSEnable | AR_RTSEnable); + /* + * WAR - MAC assumes normal ACK time instead of + * block ACK while computing packet duration. + * Add this delta to the burst duration in the descriptor. + */ + if (flags && (ads->ds_ctl1 & AR_IsAggr)) { + burstDur = baDurationDelta[HT_RC_2_MCS(rate)]; + ads->ds_ctl2 &= ~(AR_BurstDur); + ads->ds_ctl2 |= SM(burstDur, AR_BurstDur); + } + } } void @@ -792,14 +839,36 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +/* + * Program the burst duration, with the included BA delta if it's + * applicable. + */ void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration) { struct ar5416_desc *ads = AR5416DESC(ds); + uint32_t burstDur = 0; + uint8_t rate; + + if (! AR_SREV_MERLIN_10_OR_LATER(ah)) { + /* + * XXX It'd be nice if I were passed in the rate scenario + * at this point.. + */ + rate = MS(ads->ds_ctl3, AR_XmitDataTries0); + /* + * WAR - MAC assumes normal ACK time instead of + * block ACK while computing packet duration. + * Add this delta to the burst duration in the descriptor. + */ + if (ads->ds_ctl1 & AR_IsAggr) { + burstDur = baDurationDelta[HT_RC_2_MCS(rate)]; + } + } ads->ds_ctl2 &= ~AR_BurstDur; - ads->ds_ctl2 |= SM(burstDuration, AR_BurstDur); + ads->ds_ctl2 |= SM(burstDur + burstDuration, AR_BurstDur); } /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 09:23:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11E2DF72; Fri, 22 Feb 2013 09:23:07 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id C1C20130; Fri, 22 Feb 2013 09:23:06 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id BCCFA72D1; Fri, 22 Feb 2013 09:23:05 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 887C396A3; Fri, 22 Feb 2013 10:23:05 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrew Thompson Subject: Re: svn commit: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh References: <201209031651.q83GpfHi014195@svn.freebsd.org> <86wqu1yhmj.fsf@ds4.des.no> Date: Fri, 22 Feb 2013 10:23:05 +0100 In-Reply-To: (Andrew Thompson's message of "Fri, 22 Feb 2013 19:46:42 +1300") Message-ID: <86hal4ya6e.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 09:23:07 -0000 Andrew Thompson writes: > I found myself wanting the new Match LocalPort options and saw 6.1 was > only in head, I had assumed openssh was always merged back but if its > a disruptive change then thats ok. They generally do a good job with backward compatibility, but I'll have to tweak some configuration defaults to avoid surprising users. Not a huge deal. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 12:41:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 807B0EAC; Fri, 22 Feb 2013 12:41:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5942AC06; Fri, 22 Feb 2013 12:41:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MCfOVB061237; Fri, 22 Feb 2013 12:41:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MCfO7n061236; Fri, 22 Feb 2013 12:41:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201302221241.r1MCfO7n061236@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Feb 2013 12:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247151 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 12:41:25 -0000 Author: glebius Date: Fri Feb 22 12:41:24 2013 New Revision: 247151 URL: http://svnweb.freebsd.org/changeset/base/247151 Log: Fix build. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 22 09:47:21 2013 (r247150) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 22 12:41:24 2013 (r247151) @@ -2560,7 +2560,6 @@ mxge_rx_csum(struct mbuf *m, int csum) #ifdef INET struct ip *ip; #endif - int cap = m->m_pkthdr.rcvif->if_capenable; uint16_t c, etype; From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 16:46:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD366D5B; Fri, 22 Feb 2013 16:46:29 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFA8CAF8; Fri, 22 Feb 2013 16:46:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MGkTNP034875; Fri, 22 Feb 2013 16:46:29 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MGkTPZ034874; Fri, 22 Feb 2013 16:46:29 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302221646.r1MGkTPZ034874@svn.freebsd.org> From: Andrew Gallatin Date: Fri, 22 Feb 2013 16:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247152 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 16:46:29 -0000 Author: gallatin Date: Fri Feb 22 16:46:28 2013 New Revision: 247152 URL: http://svnweb.freebsd.org/changeset/base/247152 Log: Try harder to make mxge safe for all combinations of INET and INET6 - Re-fix build by restoring local removed in r247151, but protected by #if defined(INET) || defined(INET6) so that the compile succeeds in the !(INET||INET6) case. - Protect call to in_pseudo() with an #ifdef INET, to allow a kernel to link with mxge when INET is not compiled in. - Also remove an errant (improperly commented) obsolete debugging printf Thanks to Glebius for pointing out the !(INET||INET6) build issue. Sponsored by: Myricom MFC After: 7 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 22 12:41:24 2013 (r247151) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 22 16:46:28 2013 (r247152) @@ -1887,11 +1887,13 @@ mxge_encap_tso(struct mxge_slice_state * IPPROTO_TCP, 0); #endif } else { +#ifdef INET m->m_pkthdr.csum_flags |= CSUM_TCP; sum = in_pseudo(pi->ip->ip_src.s_addr, pi->ip->ip_dst.s_addr, htons(IPPROTO_TCP + (m->m_pkthdr.len - cksum_offset))); +#endif } m_copyback(m, offsetof(struct tcphdr, th_sum) + cksum_offset, sizeof(sum), (caddr_t)&sum); @@ -2538,8 +2540,6 @@ mxge_rx_csum6(void *p, struct mbuf *m, u csum = (csum >> 16) + (csum & 0xFFFF); c = in6_cksum_pseudo(ip6, m->m_pkthdr.len - cksum_offset, nxt, csum); - -// printf("%d %d %x %x %x %x %x\n", m->m_pkthdr.len, cksum_offset, c, csum, ocsum, partial, d); c ^= 0xffff; return (c); } @@ -2560,6 +2560,9 @@ mxge_rx_csum(struct mbuf *m, int csum) #ifdef INET struct ip *ip; #endif +#if defined(INET) || defined(INET6) + int cap = m->m_pkthdr.rcvif->if_capenable; +#endif uint16_t c, etype; From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 16:59:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26349336; Fri, 22 Feb 2013 16:59:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18F21BF2; Fri, 22 Feb 2013 16:59:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MGxq0Y038275; Fri, 22 Feb 2013 16:59:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MGxqYF038274; Fri, 22 Feb 2013 16:59:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201302221659.r1MGxqYF038274@svn.freebsd.org> From: Alan Cox Date: Fri, 22 Feb 2013 16:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247153 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 16:59:53 -0000 Author: alc Date: Fri Feb 22 16:59:52 2013 New Revision: 247153 URL: http://svnweb.freebsd.org/changeset/base/247153 Log: Eliminate an unused #define. Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Fri Feb 22 16:46:28 2013 (r247152) +++ head/sys/powerpc/include/vmparam.h Fri Feb 22 16:59:52 2013 (r247153) @@ -121,11 +121,6 @@ #endif /* AIM/E500 */ -/* XXX max. amount of KVM to be used by buffers. */ -#ifndef VM_MAX_KERNEL_BUF -#define VM_MAX_KERNEL_BUF (SEGMENT_LENGTH * 7 / 10) -#endif - #if !defined(LOCORE) struct pmap_physseg { struct pv_entry *pvent; From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 17:45:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56947C42; Fri, 22 Feb 2013 17:45:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48CC4E48; Fri, 22 Feb 2013 17:45:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MHjWj1053102; Fri, 22 Feb 2013 17:45:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MHjWoO053101; Fri, 22 Feb 2013 17:45:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302221745.r1MHjWoO053101@svn.freebsd.org> From: Alexander Motin Date: Fri, 22 Feb 2013 17:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247154 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 17:45:33 -0000 Author: mav Date: Fri Feb 22 17:45:32 2013 New Revision: 247154 URL: http://svnweb.freebsd.org/changeset/base/247154 Log: Add DA_Q_NO_PREVENT quirk for Kingston DataTraveler G3 1.00 USB flash. PREVENT ALLOW MEDIUM REMOVAL commands return errors on these devices without returning sense data. In some cases unrelated following commands start to return errors too, that makes device to be dropped by CAM. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Feb 22 16:59:52 2013 (r247153) +++ head/sys/cam/scsi/scsi_da.c Fri Feb 22 17:45:32 2013 (r247154) @@ -607,6 +607,10 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "Sony", "Sony DSC", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_PREVENT }, + { + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston", "DataTraveler G3", + "1.00"}, /*quirks*/ DA_Q_NO_PREVENT + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 19:21:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0ED0D795; Fri, 22 Feb 2013 19:21:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB6706AE; Fri, 22 Feb 2013 19:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MJLTnl083331; Fri, 22 Feb 2013 19:21:29 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MJLTiB083330; Fri, 22 Feb 2013 19:21:29 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302221921.r1MJLTiB083330@svn.freebsd.org> From: Andrew Gallatin Date: Fri, 22 Feb 2013 19:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247159 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 19:21:30 -0000 Author: gallatin Date: Fri Feb 22 19:21:29 2013 New Revision: 247159 URL: http://svnweb.freebsd.org/changeset/base/247159 Log: Improvements for newer mxge nics: - Some mxge nics may store the serial number in the SN2 field of the EEPROM. These will also have an SN=0 field, so parse the SN2 field, and give it precedence. - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it. This saves roughly 10ms per port at device attach time. Sponsored by: Myricom MFC After: 7 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 22 18:50:41 2013 (r247158) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 22 19:21:29 2013 (r247159) @@ -291,11 +291,12 @@ mxge_parse_strings(mxge_softc_t *sc) #define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) char *ptr, *limit; - int i, found_mac; + int i, found_mac, found_sn2; ptr = sc->eeprom_strings; limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; + found_sn2 = 0; while (ptr < limit && *ptr != '\0') { if (memcmp(ptr, "MAC=", 4) == 0) { ptr += 1; @@ -311,10 +312,16 @@ mxge_parse_strings(mxge_softc_t *sc) ptr += 3; strncpy(sc->product_code_string, ptr, sizeof (sc->product_code_string) - 1); - } else if (memcmp(ptr, "SN=", 3) == 0) { + } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { ptr += 3; strncpy(sc->serial_number_string, ptr, sizeof (sc->serial_number_string) - 1); + } else if (memcmp(ptr, "SN2=", 4) == 0) { + /* SN2 takes precedence over SN */ + ptr += 4; + found_sn2 = 1; + strncpy(sc->serial_number_string, ptr, + sizeof (sc->serial_number_string) - 1); } MXGE_NEXT_STRING(ptr); } @@ -581,9 +588,10 @@ mxge_firmware_probe(mxge_softc_t *sc) /* * Run a DMA test which watches for unaligned completions and - * aborts on the first one seen. + * aborts on the first one seen. Not required on Z8ES or newer. */ - + if (pci_get_revid(sc->dev) >= MXGE_PCI_REV_Z8ES) + return 0; status = mxge_dma_test(sc, MXGEFW_CMD_UNALIGNED_TEST); if (status == 0) return 0; /* keep the aligned firmware */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 19:23:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3175C945; Fri, 22 Feb 2013 19:23:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21A5C6D6; Fri, 22 Feb 2013 19:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MJNYx0083668; Fri, 22 Feb 2013 19:23:34 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MJNXQ7083665; Fri, 22 Feb 2013 19:23:33 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302221923.r1MJNXQ7083665@svn.freebsd.org> From: Andrew Gallatin Date: Fri, 22 Feb 2013 19:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247160 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 19:23:34 -0000 Author: gallatin Date: Fri Feb 22 19:23:33 2013 New Revision: 247160 URL: http://svnweb.freebsd.org/changeset/base/247160 Log: Bump mxge copyright. Sponsored by: Myricom MFC After: 7 days Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Feb 22 19:21:29 2013 (r247159) +++ head/sys/dev/mxge/if_mxge.c Fri Feb 22 19:23:33 2013 (r247160) @@ -1,6 +1,6 @@ /****************************************************************************** -Copyright (c) 2006-2009, Myricom Inc. +Copyright (c) 2006-2013, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Fri Feb 22 19:21:29 2013 (r247159) +++ head/sys/dev/mxge/if_mxge_var.h Fri Feb 22 19:23:33 2013 (r247160) @@ -1,6 +1,6 @@ /******************************************************************************* -Copyright (c) 2006-2009, Myricom Inc. +Copyright (c) 2006-2013, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 19:53:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A76AB475; Fri, 22 Feb 2013 19:53:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3E8855; Fri, 22 Feb 2013 19:53:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MJrCM1092352; Fri, 22 Feb 2013 19:53:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MJrCtg092351; Fri, 22 Feb 2013 19:53:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302221953.r1MJrCtg092351@svn.freebsd.org> From: Alexander Motin Date: Fri, 22 Feb 2013 19:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247161 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 19:53:12 -0000 Author: mav Date: Fri Feb 22 19:53:12 2013 New Revision: 247161 URL: http://svnweb.freebsd.org/changeset/base/247161 Log: Hide SEMB port of the SiI3826 Port Multiplier by default to avoid extra errors while it tries to talk via I2C to usually missing external SEP. There is tunable to enable it back when needed. Modified: head/sys/cam/ata/ata_pmp.c Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Fri Feb 22 19:23:33 2013 (r247160) +++ head/sys/cam/ata/ata_pmp.c Fri Feb 22 19:53:12 2013 (r247161) @@ -595,7 +595,9 @@ pmpdone(struct cam_periph *periph, union * causes timeouts if external SEP is not connected * to PMP over I2C. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + if ((softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) && + softc->pm_ports == 6) softc->pm_ports = 5; /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 19:57:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C676562F; Fri, 22 Feb 2013 19:57:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1F95885; Fri, 22 Feb 2013 19:57:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MJvIsM092980; Fri, 22 Feb 2013 19:57:18 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MJvION092979; Fri, 22 Feb 2013 19:57:18 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201302221957.r1MJvION092979@svn.freebsd.org> From: "Andrey A. Chernov" Date: Fri, 22 Feb 2013 19:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247162 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 19:57:18 -0000 Author: ache Date: Fri Feb 22 19:57:18 2013 New Revision: 247162 URL: http://svnweb.freebsd.org/changeset/base/247162 Log: Back out prev. change preventing /sys/sys symlink. It appears my install was not very recent and not acts like 'ln -h' Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Feb 22 19:53:12 2013 (r247161) +++ head/etc/Makefile Fri Feb 22 19:57:18 2013 (r247162) @@ -354,7 +354,7 @@ distrib-dirs: ${METALOG.add} ; \ done; true .endif - ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/ + ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys cd ${DESTDIR}/usr/share/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 20:49:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2E0E7AD; Fri, 22 Feb 2013 20:49:50 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5580AB1; Fri, 22 Feb 2013 20:49:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MKno6U008636; Fri, 22 Feb 2013 20:49:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MKnon3008635; Fri, 22 Feb 2013 20:49:50 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302222049.r1MKnon3008635@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 22 Feb 2013 20:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247164 - head/usr.sbin/extattr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 20:49:50 -0000 Author: pjd Date: Fri Feb 22 20:49:50 2013 New Revision: 247164 URL: http://svnweb.freebsd.org/changeset/base/247164 Log: Don't print an empty line for files with no attributes when -q is given for lsextattr(8). Modified: head/usr.sbin/extattr/rmextattr.c Modified: head/usr.sbin/extattr/rmextattr.c ============================================================================== --- head/usr.sbin/extattr/rmextattr.c Fri Feb 22 20:16:16 2013 (r247163) +++ head/usr.sbin/extattr/rmextattr.c Fri Feb 22 20:49:50 2013 (r247164) @@ -237,7 +237,8 @@ main(int argc, char *argv[]) printf("%s%*.*s", i ? "\t" : "", ch, ch, buf + i + 1); } - printf("\n"); + if (!flag_quiet || error > 0) + printf("\n"); continue; case EAGET: if (flag_nofollow) From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 21:43:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F01351A; Fri, 22 Feb 2013 21:43:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39465D99; Fri, 22 Feb 2013 21:43:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MLhMkr026061; Fri, 22 Feb 2013 21:43:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MLhLJD026058; Fri, 22 Feb 2013 21:43:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302222143.r1MLhLJD026058@svn.freebsd.org> From: Alexander Motin Date: Fri, 22 Feb 2013 21:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247165 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 21:43:22 -0000 Author: mav Date: Fri Feb 22 21:43:21 2013 New Revision: 247165 URL: http://svnweb.freebsd.org/changeset/base/247165 Log: Fix command timeout caused by data underrun during fetching ATAPI sense data, introduced by r246713. There are two places where ata_request is filled in ATA_CAM: ata_cam_begin_transaction() and ata_cam_request_sense(). In the first case DMA should be done for addresses from the CCB. In second case, DMA should be done to the different address, the address of the sense buffer inside the CCB structure itself. Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-dma.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Fri Feb 22 20:49:50 2013 (r247164) +++ head/sys/dev/ata/ata-all.c Fri Feb 22 21:43:21 2013 (r247165) @@ -1532,6 +1532,7 @@ ata_cam_begin_transaction(device_t dev, request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); request->ccb = ccb; + request->flags |= ATA_R_DATA_IN_CCB; ch->running = request; ch->state = ATA_ACTIVE; Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Fri Feb 22 20:49:50 2013 (r247164) +++ head/sys/dev/ata/ata-all.h Fri Feb 22 21:43:21 2013 (r247165) @@ -398,6 +398,7 @@ struct ata_request { #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 #define ATA_R_NEEDRESULT 0x00002000 +#define ATA_R_DATA_IN_CCB 0x00004000 #define ATA_R_ATAPI16 0x00010000 #define ATA_R_ATAPI_INTR 0x00020000 Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Fri Feb 22 20:49:50 2013 (r247164) +++ head/sys/dev/ata/ata-dma.c Fri Feb 22 21:43:21 2013 (r247165) @@ -305,7 +305,7 @@ ata_dmaload(struct ata_request *request, dspa.dmatab = request->dma->sg; #ifdef ATA_CAM - if (request->ccb) + if (request->flags & ATA_R_DATA_IN_CCB) error = bus_dmamap_load_ccb(request->dma->data_tag, request->dma->data_map, request->ccb, ch->dma.setprd, &dspa, BUS_DMA_NOWAIT); From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 22:40:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 21C222A7; Fri, 22 Feb 2013 22:40:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 074A8F99; Fri, 22 Feb 2013 22:40:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MMeAHj042090; Fri, 22 Feb 2013 22:40:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MMeAsu042087; Fri, 22 Feb 2013 22:40:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302222240.r1MMeAsu042087@svn.freebsd.org> From: Dimitry Andric Date: Fri, 22 Feb 2013 22:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 22:40:11 -0000 Author: dim Date: Fri Feb 22 22:40:10 2013 New Revision: 247166 URL: http://svnweb.freebsd.org/changeset/base/247166 Log: Pull in r172354 from upstream clang trunk: Refactor the x86 CPU name logic in the driver and pass -march and -mcpu flag information down from the Clang driver into the Gold linker plugin for LTO. This allows specifying -march on the linker commandline and should hopefully have it pass all the way through to the LTO optimizer. Fixes PR14697. Pull in r175919 from upstream clang trunk: Driver: Pass down the -march setting down to -cc1as on x86 too. The assembler historically didn't make use of any target features, but this has changed when support for old CPUs that don't support long nops was added. This should fix the long nops that still occurred in crt*.o, and possibly other object files, if the system was compiled for a CPU that does not support those, such as Geode. Note that gcc on i386 also does not pass through any -march, -mcpu or -mtune setting to gas, but this has not caused any trouble yet, because gas defaults to i386. Reported by: lev MFC after: 1 week Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Feb 22 21:43:21 2013 (r247165) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Feb 22 22:40:10 2013 (r247166) @@ -1114,10 +1114,59 @@ void Clang::AddSparcTargetArgs(const Arg } } +static const char *getX86TargetCPU(const ArgList &Args, + const llvm::Triple &Triple) { + if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { + if (StringRef(A->getValue()) != "native") + return A->getValue(); + + // FIXME: Reject attempts to use -march=native unless the target matches + // the host. + // + // FIXME: We should also incorporate the detected target features for use + // with -native. + std::string CPU = llvm::sys::getHostCPUName(); + if (!CPU.empty() && CPU != "generic") + return Args.MakeArgString(CPU); + } + + // Select the default CPU if none was given (or detection failed). + + if (Triple.getArch() != llvm::Triple::x86_64 && + Triple.getArch() != llvm::Triple::x86) + return 0; // This routine is only handling x86 targets. + + bool Is64Bit = Triple.getArch() == llvm::Triple::x86_64; + + // FIXME: Need target hooks. + if (Triple.isOSDarwin()) + return Is64Bit ? "core2" : "yonah"; + + // Everything else goes to x86-64 in 64-bit mode. + if (Is64Bit) + return "x86-64"; + + if (Triple.getOSName().startswith("haiku")) + return "i586"; + if (Triple.getOSName().startswith("openbsd")) + return "i486"; + if (Triple.getOSName().startswith("bitrig")) + return "i686"; + if (Triple.getOSName().startswith("freebsd")) + return "i486"; + if (Triple.getOSName().startswith("netbsd")) + return "i486"; + // All x86 devices running Android have core2 as their common + // denominator. This makes a better choice than pentium4. + if (Triple.getEnvironment() == llvm::Triple::Android) + return "core2"; + + // Fallback to p4. + return "pentium4"; +} + void Clang::AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { - const bool isAndroid = - getToolChain().getTriple().getEnvironment() == llvm::Triple::Android; if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) || @@ -1130,65 +1179,7 @@ void Clang::AddX86TargetArgs(const ArgLi false)) CmdArgs.push_back("-no-implicit-float"); - const char *CPUName = 0; - if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) { - if (StringRef(A->getValue()) == "native") { - // FIXME: Reject attempts to use -march=native unless the target matches - // the host. - // - // FIXME: We should also incorporate the detected target features for use - // with -native. - std::string CPU = llvm::sys::getHostCPUName(); - if (!CPU.empty() && CPU != "generic") - CPUName = Args.MakeArgString(CPU); - } else - CPUName = A->getValue(); - } - - // Select the default CPU if none was given (or detection failed). - if (!CPUName) { - // FIXME: Need target hooks. - if (getToolChain().getTriple().isOSDarwin()) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "core2"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "yonah"; - } else if (getToolChain().getOS().startswith("haiku")) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "i586"; - } else if (getToolChain().getOS().startswith("openbsd")) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "i486"; - } else if (getToolChain().getOS().startswith("bitrig")) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "i686"; - } else if (getToolChain().getOS().startswith("freebsd")) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "i486"; - } else if (getToolChain().getOS().startswith("netbsd")) { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - CPUName = "i486"; - } else { - if (getToolChain().getArch() == llvm::Triple::x86_64) - CPUName = "x86-64"; - else if (getToolChain().getArch() == llvm::Triple::x86) - // All x86 devices running Android have core2 as their common - // denominator. This makes a better choice than pentium4. - CPUName = isAndroid ? "core2" : "pentium4"; - } - } - - if (CPUName) { + if (const char *CPUName = getX86TargetCPU(Args, getToolChain().getTriple())) { CmdArgs.push_back("-target-cpu"); CmdArgs.push_back(CPUName); } @@ -3091,6 +3082,15 @@ void ClangAs::AddARMTargetArgs(const Arg addFPMathArgs(D, A, Args, CmdArgs, getARMTargetCPU(Args, Triple)); } +void ClangAs::AddX86TargetArgs(const ArgList &Args, + ArgStringList &CmdArgs) const { + // Set the CPU based on -march=. + if (const char *CPUName = getX86TargetCPU(Args, getToolChain().getTriple())) { + CmdArgs.push_back("-target-cpu"); + CmdArgs.push_back(CPUName); + } +} + /// Add options related to the Objective-C runtime/ABI. /// /// Returns true if the runtime is non-fragile. @@ -3261,6 +3261,11 @@ void ClangAs::ConstructJob(Compilation & case llvm::Triple::thumb: AddARMTargetArgs(Args, CmdArgs); break; + + case llvm::Triple::x86: + case llvm::Triple::x86_64: + AddX86TargetArgs(Args, CmdArgs); + break; } // Ignore explicit -force_cpusubtype_ALL option. @@ -6068,8 +6073,27 @@ void linuxtools::Link::ConstructJob(Comp CmdArgs.push_back("-plugin"); std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; CmdArgs.push_back(Args.MakeArgString(Plugin)); + + // Try to pass driver level flags relevant to LTO code generation down to + // the plugin. + + // Handle architecture-specific flags for selecting CPU variants. + if (ToolChain.getArch() == llvm::Triple::x86 || + ToolChain.getArch() == llvm::Triple::x86_64) + CmdArgs.push_back( + Args.MakeArgString(Twine("-plugin-opt=mcpu=") + + getX86TargetCPU(Args, ToolChain.getTriple()))); + else if (ToolChain.getArch() == llvm::Triple::arm || + ToolChain.getArch() == llvm::Triple::thumb) + CmdArgs.push_back( + Args.MakeArgString(Twine("-plugin-opt=mcpu=") + + getARMTargetCPU(Args, ToolChain.getTriple()))); + + // FIXME: Factor out logic for MIPS, PPC, and other targets to support this + // as well. } + if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) CmdArgs.push_back("--no-demangle"); Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.h Fri Feb 22 21:43:21 2013 (r247165) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.h Fri Feb 22 22:40:10 2013 (r247166) @@ -68,6 +68,7 @@ namespace tools { /// \brief Clang integrated assembler tool. class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; + void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; public: ClangAs(const ToolChain &TC) : Tool("clang::as", "clang integrated assembler", TC) {} From owner-svn-src-head@FreeBSD.ORG Fri Feb 22 23:53:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB2CEFA1; Fri, 22 Feb 2013 23:53:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9DE27A; Fri, 22 Feb 2013 23:53:40 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1MNrWvg011930; Sat, 23 Feb 2013 01:53:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1MNrWvg011930 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1MNrWje011929; Sat, 23 Feb 2013 01:53:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Feb 2013 01:53:32 +0200 From: Konstantin Belousov To: Dimitry Andric Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver Message-ID: <20130222235332.GB2454@kib.kiev.ua> References: <201302222240.r1MMeAsu042087@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i9LlY+UWpKt15+FH" Content-Disposition: inline In-Reply-To: <201302222240.r1MMeAsu042087@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Feb 2013 23:53:40 -0000 --i9LlY+UWpKt15+FH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 22, 2013 at 10:40:10PM +0000, Dimitry Andric wrote: > Author: dim > Date: Fri Feb 22 22:40:10 2013 > New Revision: 247166 > URL: http://svnweb.freebsd.org/changeset/base/247166 >=20 > Log: > Pull in r172354 from upstream clang trunk: > =20 > Refactor the x86 CPU name logic in the driver and pass -march and -mc= pu > flag information down from the Clang driver into the Gold linker plug= in > for LTO. This allows specifying -march on the linker commandline and > should hopefully have it pass all the way through to the LTO optimize= r. > =20 > Fixes PR14697. > =20 > Pull in r175919 from upstream clang trunk: > =20 > Driver: Pass down the -march setting down to -cc1as on x86 too. > =20 > The assembler historically didn't make use of any target features, bu= t this has > changed when support for old CPUs that don't support long nops was ad= ded. > =20 > This should fix the long nops that still occurred in crt*.o, and > possibly other object files, if the system was compiled for a CPU that > does not support those, such as Geode. > =20 > Note that gcc on i386 also does not pass through any -march, -mcpu or > -mtune setting to gas, but this has not caused any trouble yet, because > gas defaults to i386. Are you saying that assembler (in the 'cc' invocation) miscompiles the .s files on i386 ? Why does it use instructions by default which are not supported on the i486 architecture, implicitely ? --i9LlY+UWpKt15+FH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRKAT7AAoJEJDCuSvBvK1BIIMP+wUvTv0DjRxxvnlLx53LTUsg zMzirwHFJH3ICLT+TCpKCgdh4vFxcvnlclFn6WyFsThY19rcpNBjibqjG14TWfVJ cfY+TyyFM/8Y72gDuDAS/MDTYHXUH1keuykofjJTNdDN+/PjaID0fyDpgkcknAA/ rfb1vmtcl4h9zf3s6/Ld/vv4dWCAr3UAqVSV7SpXLcTmoTFu5FL3VBd1BIBuxzt3 pfVU+Aj5kI86KTdzbdiBf+LCrUNu149SGEMUquQPqmhS2tD1NX2riw+NXSZzKJnr eRwbgpZAEGwQw1bVs5bgIRwTiKVJqNEftqLkiIMZBR9KPheOApwyMo7HX32Dd6py KPByMrZuOEA1NwPWVHwOSvb2n1vn3/cwWq2XV0Km0G4a5fbfDshKe2I0NZctHIZL KZhmYD97LmayV55nFpFMQ/6vbn08Z0/1s3yWxEYLzHDmI2WutAZowOCnIFuAla0V p4xwQgABC43nBQPaeswsH0Z6VPMzciqjqCX8Gygx7Tn2BhR+AOMZ+rgq/A97fTkc E2c/ivzqqA9RBocdgXmwcxIeCx+cMCi9386H8N+MX58wxxnhWUaZ51WUnuqzUFbD 4dXdq9AfTjaw8XyHrxHTc0jiBtCUgvErD2TESJIg5BhCeczM4vgHwMSo4G7A57x0 KcdssMqY+AMGb1uQut8/ =80t0 -----END PGP SIGNATURE----- --i9LlY+UWpKt15+FH-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 11:21:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1470EE40; Sat, 23 Feb 2013 11:21:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC85291A; Sat, 23 Feb 2013 11:21:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NBL8Op074067; Sat, 23 Feb 2013 11:21:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NBL5rw074043; Sat, 23 Feb 2013 11:21:05 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302231121.r1NBL5rw074043@svn.freebsd.org> From: Martin Matuska Date: Sat, 23 Feb 2013 11:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247187 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 11:21:09 -0000 Author: mm Date: Sat Feb 23 11:21:05 2013 New Revision: 247187 URL: http://svnweb.freebsd.org/changeset/base/247187 Log: MFV r246653: Import vendor change to avoid "unitialized variable" warnings. Illumos ZFS issues: 3522 zfs module should not allow uninitialized variables References: https://www.illumos.org/issues/3522 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Feb 23 11:21:05 2013 (r247187) @@ -3045,7 +3045,7 @@ arc_read(zio_t *pio, spa_t *spa, const b const zbookmark_t *zb) { arc_buf_hdr_t *hdr; - arc_buf_t *buf; + arc_buf_t *buf = NULL; kmutex_t *hash_lock; zio_t *rzio; uint64_t guid = spa_load_guid(spa); @@ -3127,7 +3127,7 @@ top: uint64_t size = BP_GET_LSIZE(bp); arc_callback_t *acb; vdev_t *vd = NULL; - uint64_t addr; + uint64_t addr = 0; boolean_t devw = B_FALSE; if (hdr == NULL) { @@ -3245,6 +3245,10 @@ top: cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; + ASSERT(addr >= VDEV_LABEL_START_SIZE && + addr + size < vd->vdev_psize - + VDEV_LABEL_END_SIZE); + /* * l2arc read. The SCL_L2ARC lock will be * released by l2arc_read_done(). @@ -3440,8 +3444,8 @@ arc_release(arc_buf_t *buf, void *tag) if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); hdr->b_l2hdr = NULL; - buf_size = hdr->b_size; } + buf_size = hdr->b_size; /* * Do we have more than one buf? @@ -4544,7 +4548,7 @@ l2arc_read_done(zio_t *zio) static list_t * l2arc_list_locked(int list_num, kmutex_t **lock) { - list_t *list; + list_t *list = NULL; int idx; ASSERT(list_num >= 0 && list_num < 2 * ARC_BUFC_NUMLISTS); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Feb 23 11:21:05 2013 (r247187) @@ -408,8 +408,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, if (dn->dn_objset->os_dsl_dataset) dp = dn->dn_objset->os_dsl_dataset->ds_dir->dd_pool; - if (dp && dsl_pool_sync_context(dp)) - start = gethrtime(); + start = gethrtime(); zio = zio_root(dn->dn_objset->os_spa, NULL, NULL, ZIO_FLAG_CANFAIL); blkid = dbuf_whichblock(dn, offset); for (i = 0; i < nblks; i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Feb 23 11:21:05 2013 (r247187) @@ -1323,7 +1323,8 @@ dmu_objset_userquota_get_ids(dnode_t *dn objset_t *os = dn->dn_objset; void *data = NULL; dmu_buf_impl_t *db = NULL; - uint64_t *user, *group; + uint64_t *user = NULL; + uint64_t *group = NULL; int flags = dn->dn_id_flags; int error; boolean_t have_spill = B_FALSE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 23 11:21:05 2013 (r247187) @@ -382,7 +382,7 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint ds = dmu_buf_get_user(dbuf); if (ds == NULL) { - dsl_dataset_t *winner; + dsl_dataset_t *winner = NULL; ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP); ds->ds_dbuf = dbuf; @@ -467,11 +467,8 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint ds->ds_reserved = ds->ds_quota = 0; } - if (err == 0) { - winner = dmu_buf_set_user_ie(dbuf, ds, &ds->ds_phys, - dsl_dataset_evict); - } - if (err || winner) { + if (err != 0 || (winner = dmu_buf_set_user_ie(dbuf, ds, + &ds->ds_phys, dsl_dataset_evict)) != NULL) { bplist_destroy(&ds->ds_pending_deadlist); dsl_deadlist_close(&ds->ds_deadlist); if (ds->ds_prev) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Feb 23 11:21:05 2013 (r247187) @@ -1658,7 +1658,8 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, zio_priority = ZIO_PRIORITY_SCRUB; needs_io = B_TRUE; scan_delay = zfs_scrub_delay; - } else if (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) { + } else { + ASSERT3U(scn->scn_phys.scn_func, ==, POOL_SCAN_RESILVER); zio_flags |= ZIO_FLAG_RESILVER; zio_priority = ZIO_PRIORITY_RESILVER; needs_io = B_FALSE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c Sat Feb 23 11:21:05 2013 (r247187) @@ -38,6 +38,7 @@ #include #include +#include #define MATCH_BITS 6 #define MATCH_MIN 3 @@ -51,7 +52,8 @@ lzjb_compress(void *s_start, void *d_sta { uchar_t *src = s_start; uchar_t *dst = d_start; - uchar_t *cpy, *copymap; + uchar_t *cpy; + uchar_t *copymap = NULL; int copymask = 1 << (NBBY - 1); int mlen, offset, hash; uint16_t *hp; @@ -100,7 +102,8 @@ lzjb_decompress(void *s_start, void *d_s uchar_t *src = s_start; uchar_t *dst = d_start; uchar_t *d_end = (uchar_t *)d_start + d_len; - uchar_t *cpy, copymap; + uchar_t *cpy; + uchar_t copymap = 0; int copymask = 1 << (NBBY - 1); while (dst < d_end) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sat Feb 23 11:21:05 2013 (r247187) @@ -110,7 +110,7 @@ refcount_count(refcount_t *rc) int64_t refcount_add_many(refcount_t *rc, uint64_t number, void *holder) { - reference_t *ref; + reference_t *ref = NULL; int64_t count; if (reference_tracking_enable) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sat Feb 23 11:21:05 2013 (r247187) @@ -660,7 +660,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu int buf_space; sa_attr_type_t *attrs, *attrs_start; int i, lot_count; - int hdrsize, spillhdrsize; + int hdrsize; + int spillhdrsize = 0; int used; dmu_object_type_t bonustype; sa_lot_t *lot; @@ -837,7 +838,7 @@ sa_attr_table_setup(objset_t *os, sa_att { sa_os_t *sa = os->os_sa; uint64_t sa_attr_count = 0; - uint64_t sa_reg_count; + uint64_t sa_reg_count = 0; int error = 0; uint64_t attr_value; sa_attr_table_t *tb; @@ -1645,7 +1646,8 @@ sa_modify_attrs(sa_handle_t *hdl, sa_att sa_bulk_attr_t *attr_desc; void *old_data[2]; int bonus_attr_count = 0; - int bonus_data_size, spill_data_size; + int bonus_data_size = 0; + int spill_data_size = 0; int spill_attr_count = 0; int error; uint16_t length; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 23 11:21:05 2013 (r247187) @@ -383,7 +383,7 @@ spa_prop_validate(spa_t *spa, nvlist_t * { nvpair_t *elem; int error = 0, reset_bootfs = 0; - uint64_t objnum; + uint64_t objnum = 0; boolean_t has_feature = B_FALSE; elem = NULL; @@ -1389,6 +1389,7 @@ spa_load_l2cache(spa_t *spa) newvdevs = kmem_alloc(nl2cache * sizeof (void *), KM_SLEEP); } else { nl2cache = 0; + newvdevs = NULL; } oldvdevs = sav->sav_vdevs; @@ -4702,7 +4703,7 @@ spa_vdev_detach(spa_t *spa, uint64_t gui vdev_t *rvd = spa->spa_root_vdev; vdev_t *vd, *pvd, *cvd, *tvd; boolean_t unspare = B_FALSE; - uint64_t unspare_guid; + uint64_t unspare_guid = 0; char *vdpath; ASSERT(spa_writeable(spa)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sat Feb 23 11:21:05 2013 (r247187) @@ -1198,7 +1198,8 @@ vdev_raidz_matrix_reconstruct(raidz_map_ uint64_t ccount; uint8_t *dst[VDEV_RAIDZ_MAXPARITY]; uint64_t dcount[VDEV_RAIDZ_MAXPARITY]; - uint8_t log, val; + uint8_t log = 0; + uint8_t val; int ll; uint8_t *invlog[VDEV_RAIDZ_MAXPARITY]; uint8_t *p, *pp; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Sat Feb 23 11:21:05 2013 (r247187) @@ -220,7 +220,7 @@ zap_leaf_array_create(zap_leaf_t *l, con uint16_t chunk_head; uint16_t *chunkp = &chunk_head; int byten = 0; - uint64_t value; + uint64_t value = 0; int shift = (integer_size-1)*8; int len = num_integers; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Sat Feb 23 11:21:05 2013 (r247187) @@ -51,7 +51,7 @@ zfs_ace_byteswap(void *buf, size_t size, { caddr_t end; caddr_t ptr; - zfs_ace_t *zacep; + zfs_ace_t *zacep = NULL; ace_t *acep; uint16_t entry_type; size_t entry_size; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Sat Feb 23 11:21:05 2013 (r247187) @@ -560,9 +560,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64 uint32_t fuid_idx = FUID_INDEX(id); uint32_t rid; idmap_stat status; - uint64_t idx; + uint64_t idx = 0; zfs_fuid_t *zfuid = NULL; - zfs_fuid_info_t *fuidp; + zfs_fuid_info_t *fuidp = NULL; /* * If POSIX ID, or entry is already a FUID then @@ -587,6 +587,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64 if (fuidp == NULL) return (UID_NOBODY); + VERIFY3U(type, >=, ZFS_OWNER); + VERIFY3U(type, <=, ZFS_ACE_GROUP); + switch (type) { case ZFS_ACE_USER: case ZFS_ACE_GROUP: @@ -603,7 +606,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64 idx = FUID_INDEX(fuidp->z_fuid_group); break; }; - domain = fuidp->z_domain_table[idx -1]; + domain = fuidp->z_domain_table[idx - 1]; } else { if (type == ZFS_OWNER || type == ZFS_ACE_USER) status = kidmap_getsidbyuid(crgetzone(cr), id, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Sat Feb 23 11:21:05 2013 (r247187) @@ -243,7 +243,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t itx_t *itx; lr_create_t *lr; lr_acl_create_t *lracl; - size_t aclsize; + size_t aclsize = (vsecp != NULL) ? vsecp->vsa_aclentsz : 0; size_t xvatsize = 0; size_t txsize; xvattr_t *xvap = (xvattr_t *)vap; @@ -273,7 +273,6 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t txsize = sizeof (*lr) + namesize + fuidsz + xvatsize; lrsize = sizeof (*lr); } else { - aclsize = (vsecp) ? vsecp->vsa_aclentsz : 0; txsize = sizeof (lr_acl_create_t) + namesize + fuidsz + ZIL_ACE_LENGTH(aclsize) + xvatsize; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Sat Feb 23 11:21:05 2013 (r247187) @@ -463,7 +463,7 @@ static void zfs_range_unlock_reader(znode_t *zp, rl_t *remove) { avl_tree_t *tree = &zp->z_range_avl; - rl_t *rl, *next; + rl_t *rl, *next = NULL; uint64_t len; /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Feb 23 11:21:05 2013 (r247187) @@ -389,11 +389,18 @@ zfs_register_callbacks(vfs_t *vfsp) objset_t *os = NULL; zfsvfs_t *zfsvfs = NULL; uint64_t nbmand; - int readonly, do_readonly = B_FALSE; - int setuid, do_setuid = B_FALSE; - int exec, do_exec = B_FALSE; - int xattr, do_xattr = B_FALSE; - int atime, do_atime = B_FALSE; + boolean_t readonly = B_FALSE; + boolean_t do_readonly = B_FALSE; + boolean_t setuid = B_FALSE; + boolean_t do_setuid = B_FALSE; + boolean_t exec = B_FALSE; + boolean_t do_exec = B_FALSE; + boolean_t devices = B_FALSE; + boolean_t do_devices = B_FALSE; + boolean_t xattr = B_FALSE; + boolean_t do_xattr = B_FALSE; + boolean_t atime = B_FALSE; + boolean_t do_atime = B_FALSE; int error = 0; ASSERT(vfsp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Feb 23 09:16:22 2013 (r247186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Feb 23 11:21:05 2013 (r247187) @@ -644,7 +644,7 @@ zfs_read(vnode_t *vp, uio_t *uio, int io zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os; ssize_t n, nbytes; - int error; + int error = 0; rl_t *rl; xuio_t *xuio = NULL; @@ -804,9 +804,9 @@ zfs_write(vnode_t *vp, uio_t *uio, int i ssize_t n, nbytes; rl_t *rl; int max_blksz = zfsvfs->z_max_blksz; - int error; + int error = 0; arc_buf_t *abuf; - iovec_t *aiov; + iovec_t *aiov = NULL; xuio_t *xuio = NULL; int i_iov = 0; int iovcnt = uio->uio_iovcnt; @@ -2476,6 +2476,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre odp = (struct dirent64 *)outbuf; } else { bufsize = bytes_wanted; + outbuf = NULL; odp = (struct dirent64 *)iovp->iov_base; } eodp = (struct edirent *)odp; @@ -2959,7 +2960,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i vattr_t oldva; xvattr_t tmpxvattr; uint_t mask = vap->va_mask; - uint_t saved_mask; + uint_t saved_mask = 0; uint64_t saved_mode; int trim_mask = 0; uint64_t new_mode; From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 11:58:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DEC213BB; Sat, 23 Feb 2013 11:58:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id A5D62A4E; Sat, 23 Feb 2013 11:58:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4637D5C43; Sat, 23 Feb 2013 12:58:11 +0100 (CET) Message-ID: <5128AED6.2020906@FreeBSD.org> Date: Sat, 23 Feb 2013 12:58:14 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver References: <201302222240.r1MMeAsu042087@svn.freebsd.org> <20130222235332.GB2454@kib.kiev.ua> In-Reply-To: <20130222235332.GB2454@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 11:58:14 -0000 On 2013-02-23 00:53, Konstantin Belousov wrote: > On Fri, Feb 22, 2013 at 10:40:10PM +0000, Dimitry Andric wrote: ... >> This should fix the long nops that still occurred in crt*.o, and >> possibly other object files, if the system was compiled for a CPU that >> does not support those, such as Geode. >> >> Note that gcc on i386 also does not pass through any -march, -mcpu or >> -mtune setting to gas, but this has not caused any trouble yet, because >> gas defaults to i386. > > Are you saying that assembler (in the 'cc' invocation) miscompiles > the .s files on i386 ? Why does it use instructions by default which > are not supported on the i486 architecture, implicitely ? The x86 backend always used to emit long nops, until upstream r164132, where this was fixed for the .c -> .o phase (-cc1 mode). This fix is also in 3.2 release, and in our tree. The .s -> .o phase (-cc1as mode) did not get passed the target CPU though, so it still defaulted to long nops. This was simply the default chosen by upstream. After upstream r175919, that problem should also be fixed. As far as I can see, the only remaining issue now is the emission of cmov instructions on CPUs that do not support them, and a fix for that is being worked on now. -Dimitry From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 12:31:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6ECB9CF3; Sat, 23 Feb 2013 12:31:53 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 614A1B83; Sat, 23 Feb 2013 12:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NCVr2h095181; Sat, 23 Feb 2013 12:31:53 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NCVrkC095180; Sat, 23 Feb 2013 12:31:53 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302231231.r1NCVrkC095180@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 23 Feb 2013 12:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247189 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 12:31:53 -0000 Author: keramida (doc committer) Date: Sat Feb 23 12:31:52 2013 New Revision: 247189 URL: http://svnweb.freebsd.org/changeset/base/247189 Log: Now that qsort(3) has a sample comparison function, point to that example from bsearch(3) too, so that we don't have to duplicate the example code in both places. PR: docs/176197 Reviewed by: stefanf Approved by: remko (mentor), gjb (mentor) MFC after: 1 week Modified: head/lib/libc/stdlib/bsearch.3 Modified: head/lib/libc/stdlib/bsearch.3 ============================================================================== --- head/lib/libc/stdlib/bsearch.3 Sat Feb 23 12:00:51 2013 (r247188) +++ head/lib/libc/stdlib/bsearch.3 Sat Feb 23 12:31:52 2013 (r247189) @@ -32,7 +32,7 @@ .\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd February 22, 2013 .Dt BSEARCH 3 .Os .Sh NAME @@ -71,6 +71,12 @@ less than, equal to, or greater than zer .Fa key object is found, respectively, to be less than, to match, or be greater than the array member. +See the +.Fa int_compare +sample function in +.Xr qsort 3 +for a comparison function that is also compatible with +.Fn bsearch . .Sh RETURN VALUES The .Fn bsearch From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 15:15:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 305989E5; Sat, 23 Feb 2013 15:15:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E74CF130; Sat, 23 Feb 2013 15:15:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NFFfek045122; Sat, 23 Feb 2013 15:15:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NFFfXP045121; Sat, 23 Feb 2013 15:15:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302231515.r1NFFfXP045121@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 23 Feb 2013 15:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247190 - head/tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 15:15:42 -0000 Author: jilles Date: Sat Feb 23 15:15:41 2013 New Revision: 247190 URL: http://svnweb.freebsd.org/changeset/base/247190 Log: sh: Test that the exit status is 1 if read encounters EOF. Added: head/tools/regression/bin/sh/builtins/read6.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/read6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read6.0 Sat Feb 23 15:15:41 2013 (r247190) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +: | read x +r=$? +[ "$r" = 1 ] From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 18:32:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD23A545; Sat, 23 Feb 2013 18:32:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98783CB9; Sat, 23 Feb 2013 18:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NIWgUN005640; Sat, 23 Feb 2013 18:32:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NIWgj0005639; Sat, 23 Feb 2013 18:32:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302231832.r1NIWgj0005639@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Feb 2013 18:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247195 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 18:32:42 -0000 Author: mav Date: Sat Feb 23 18:32:42 2013 New Revision: 247195 URL: http://svnweb.freebsd.org/changeset/base/247195 Log: Add basic and not very reliable protection against going to sleep with thread scheduled by interrupt fired after we entered critical section. None of cpu_sleep() implementations on ARM check sched_runnable() now, so put the first line of defence here. This mostly fixes unexpectedly long sleeps in synthetic tests of calloutng code and probably other situations. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Feb 23 16:14:07 2013 (r247194) +++ head/sys/arm/arm/machdep.c Sat Feb 23 18:32:42 2013 (r247195) @@ -45,6 +45,7 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_platform.h" +#include "opt_sched.h" #include "opt_timer.h" #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -433,19 +435,24 @@ void cpu_idle(int busy) { + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", + busy, curcpu); #ifndef NO_EVENTTIMERS if (!busy) { critical_enter(); cpu_idleclock(); } #endif - cpu_sleep(0); + if (!sched_runnable()) + cpu_sleep(0); #ifndef NO_EVENTTIMERS if (!busy) { cpu_activeclock(); critical_exit(); } #endif + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", + busy, curcpu); } int From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 19:27:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9AFE340; Sat, 23 Feb 2013 19:27:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95626E85; Sat, 23 Feb 2013 19:27:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NJRsIX021787; Sat, 23 Feb 2013 19:27:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NJRsXJ021786; Sat, 23 Feb 2013 19:27:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201302231927.r1NJRsXJ021786@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 23 Feb 2013 19:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247197 - head/sys/ia64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 19:27:54 -0000 Author: marcel Date: Sat Feb 23 19:27:53 2013 New Revision: 247197 URL: http://svnweb.freebsd.org/changeset/base/247197 Log: Enable PREEMPTION by default now that PR 147501 has been fixed. Modified: head/sys/ia64/conf/GENERIC Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sat Feb 23 18:59:14 2013 (r247196) +++ head/sys/ia64/conf/GENERIC Sat Feb 23 19:27:53 2013 (r247197) @@ -44,7 +44,7 @@ options NFSLOCKD # Network Lock Manager options NFSD # New 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 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 From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 20:19:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 54791114; Sat, 23 Feb 2013 20:19:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id E8AFA108; Sat, 23 Feb 2013 20:19:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1NKIveY011156; Sat, 23 Feb 2013 22:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1NKIveY011156 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1NKIvCV011155; Sat, 23 Feb 2013 22:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Feb 2013 22:18:57 +0200 From: Konstantin Belousov To: Dimitry Andric Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver Message-ID: <20130223201857.GD2454@kib.kiev.ua> References: <201302222240.r1MMeAsu042087@svn.freebsd.org> <20130222235332.GB2454@kib.kiev.ua> <5128AED6.2020906@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5gxpn/Q6ypwruk0T" Content-Disposition: inline In-Reply-To: <5128AED6.2020906@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 20:19:03 -0000 --5gxpn/Q6ypwruk0T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 23, 2013 at 12:58:14PM +0100, Dimitry Andric wrote: > On 2013-02-23 00:53, Konstantin Belousov wrote: > > On Fri, Feb 22, 2013 at 10:40:10PM +0000, Dimitry Andric wrote: > ... > >> This should fix the long nops that still occurred in crt*.o, and > >> possibly other object files, if the system was compiled for a CPU t= hat > >> does not support those, such as Geode. > >> > >> Note that gcc on i386 also does not pass through any -march, -mcpu = or > >> -mtune setting to gas, but this has not caused any trouble yet, bec= ause > >> gas defaults to i386. > > > > Are you saying that assembler (in the 'cc' invocation) miscompiles > > the .s files on i386 ? Why does it use instructions by default which > > are not supported on the i486 architecture, implicitely ? >=20 > The x86 backend always used to emit long nops, until upstream r164132, > where this was fixed for the .c -> .o phase (-cc1 mode). This fix is > also in 3.2 release, and in our tree. >=20 > The .s -> .o phase (-cc1as mode) did not get passed the target CPU > though, so it still defaulted to long nops. This was simply the default > chosen by upstream. After upstream r175919, that problem should also be > fixed. >=20 > As far as I can see, the only remaining issue now is the emission of > cmov instructions on CPUs that do not support them, and a fix for that > is being worked on now. Let me rephrase my question. What is the processor targeted by the cc on i386, when no -march flag is specified, for cc coming from clang, for both .c and .s files. Lets ignore known bugs, like long nops or cmovs. --5gxpn/Q6ypwruk0T Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRKSQwAAoJEJDCuSvBvK1BMPgP/iFQ5XZBpbAM3oyBezkOSTFy UEc1xgS3oA6WMItNoaoYIAz4Crq3H8b/VBj5XBaloV+6e5zxanLU1/aIiD/t6+T9 y2oGoLv1KcoGI379OcIme0qeORQTDhPTieaP4x+x3oQGtCBaUdjNTuyu71vEqgKf JhJTLL1zm6yKddenB3kO9T0a4JnF4pYCzHC6tUziGI6MzcofLCfNq58ZCGwdR3dj yagLTPWZV2djPhrCuBuHofDn8MjVgrgzIyUkBy4/OEcWWqVyk/53HUY5MC0mwGWO FEHuKWvgB7DX0ogtJn+QH6EJfK3TuP2+uW4t9eveNdSYpINNIXGZshHITianPpgz lTaz/+MY6eNm8oPpLPJ5pWx3AIhV5E8X1j85hlQmicdJZeJZCyoaRkkHKz2faxsm ThtcikG8mZY2IeOao7riqrWvUbTNdznFyq+OlxRUGo4UR6S9BH77P98ppQ0JJpJM pVKGghYS6mW1Pvy7noho0PB+9T+KRvpcOwmhFUAHbTAyz4bGGt5HloS4ODvn5RVo Dtp++WR7lVDhbv8Rxm4KKZanxtLN3jO0xlyNVTheIG4AXik36Wr5Sa7RAutXnnFf CvGYxt9SwNFil8hX3itMTk+lUVoNz79r8O6sBk0h03vFK2o21VDJq3sJuqzpgudv x+kDqMfzRRY1N+F3Qj8y =41fI -----END PGP SIGNATURE----- --5gxpn/Q6ypwruk0T-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 20:27:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A8E2323; Sat, 23 Feb 2013 20:27:04 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55E85147; Sat, 23 Feb 2013 20:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NKR4bL039837; Sat, 23 Feb 2013 20:27:04 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NKR4FJ039836; Sat, 23 Feb 2013 20:27:04 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302232027.r1NKR4FJ039836@svn.freebsd.org> From: Tim Kientzle Date: Sat, 23 Feb 2013 20:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247200 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 20:27:04 -0000 Author: kientzle Date: Sat Feb 23 20:27:03 2013 New Revision: 247200 URL: http://svnweb.freebsd.org/changeset/base/247200 Log: Print kernel args as late as possible before jumping into kernel. Modified: head/sys/boot/uboot/lib/elf_freebsd.c Modified: head/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- head/sys/boot/uboot/lib/elf_freebsd.c Sat Feb 23 19:45:43 2013 (r247199) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sat Feb 23 20:27:03 2013 (r247200) @@ -82,9 +82,9 @@ __elfN(uboot_exec)(struct preloaded_file entry = uboot_vm_translate(e->e_entry); printf("Kernel entry at 0x%x...\n", (unsigned)entry); - printf("Kernel args: %s\n", fp->f_args); dev_cleanup(); + printf("Kernel args: %s\n", fp->f_args); (*entry)((void *)mdp); panic("exec returned"); From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 20:34:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E37AE52D; Sat, 23 Feb 2013 20:34:48 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BDB65195; Sat, 23 Feb 2013 20:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NKYm0d042472; Sat, 23 Feb 2013 20:34:48 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NKYmWW042471; Sat, 23 Feb 2013 20:34:48 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302232034.r1NKYmWW042471@svn.freebsd.org> From: Tim Kientzle Date: Sat, 23 Feb 2013 20:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247201 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 20:34:49 -0000 Author: kientzle Date: Sat Feb 23 20:34:47 2013 New Revision: 247201 URL: http://svnweb.freebsd.org/changeset/base/247201 Log: "fdt addr" gets run from loader.rc before the kernel is loaded. This was broken by r247045 which tried to copy the FDT into the module directory immediately. Instead, store the address and arrange for the FDT to get copied into the module directory later when the usual FDT initialization runs. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 23 20:27:03 2013 (r247200) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 23 20:34:47 2013 (r247201) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #define CMD_REQUIRES_BLOB 0x01 -/* Local copy of FDT */ +/* Location of FDT yet to be loaded. */ +static struct fdt_header *fdt_to_load = NULL; +/* Local copy of FDT on heap. */ static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; @@ -252,13 +254,20 @@ fdt_setup_fdtp() { struct preloaded_file *bfp; struct fdt_header *hdr; - const char *s, *p; + const char *s; + char *p; vm_offset_t va; if ((bfp = file_findfile(NULL, "dtb")) != NULL) { printf("Using DTB from loaded file.\n"); return fdt_load_dtb(bfp->f_addr); - } + } + + if (fdt_to_load != NULL) { + printf("Using DTB from memory address 0x%08X.\n", + (unsigned int)fdt_to_load); + return fdt_load_dtb_addr(fdt_to_load); + } s = ub_env_get("fdtaddr"); if (s != NULL && *s != '\0') { @@ -810,8 +819,12 @@ command_fdt_internal(int argc, char *arg static int fdt_cmd_addr(int argc, char *argv[]) { + struct preloaded_file *fp; struct fdt_header *hdr; - const char *addr, *cp; + const char *addr; + char *cp; + + fdt_to_load = NULL; if (argc > 2) addr = argv[2]; @@ -820,15 +833,17 @@ fdt_cmd_addr(int argc, char *argv[]) return (CMD_ERROR); } - hdr = (struct fdt_header *)strtoul(addr, &cp, 0); + hdr = (struct fdt_header *)strtoul(addr, &cp, 16); if (cp == addr) { sprintf(command_errbuf, "Invalid address: %s", addr); return (CMD_ERROR); } - if (fdt_load_dtb_addr(hdr) != 0) - return (CMD_ERROR); + while ((fp = file_findfile(NULL, "dtb")) != NULL) { + file_discard(fp); + } + fdt_to_load = hdr; return (CMD_OK); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 22:19:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5D951698; Sat, 23 Feb 2013 22:19:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 01544800; Sat, 23 Feb 2013 22:19:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 781325C43; Sat, 23 Feb 2013 23:19:40 +0100 (CET) Message-ID: <51294081.1060505@FreeBSD.org> Date: Sat, 23 Feb 2013 23:19:45 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver References: <201302222240.r1MMeAsu042087@svn.freebsd.org> <20130222235332.GB2454@kib.kiev.ua> <5128AED6.2020906@FreeBSD.org> <20130223201857.GD2454@kib.kiev.ua> In-Reply-To: <20130223201857.GD2454@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 22:19:50 -0000 On 2013-02-23 21:18, Konstantin Belousov wrote: ... > Let me rephrase my question. > > What is the processor targeted by the cc on i386, when no -march flag is > specified, for cc coming from clang, for both .c and .s files. Lets ignore > known bugs, like long nops or cmovs. For i386 arch on FreeBSD, the default has always been i486. The cc1 stage, which compiles .c and .cpp to .o files, uses either this default target CPU, or otherwise the CPU specified on the command line. The cc1as stage, which assembles .s to .o files, only uses the target CPU setting to determine whether to emit long nops or not, at least on x86 arch. After the last fix, the default target is i486, so it will not emit long nops either, unless a higher CPU is specified. From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 22:46:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 98EE5C4B; Sat, 23 Feb 2013 22:46:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4538B3; Sat, 23 Feb 2013 22:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NMkRgQ081971; Sat, 23 Feb 2013 22:46:27 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NMkRHX081969; Sat, 23 Feb 2013 22:46:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302232246.r1NMkRHX081969@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 23 Feb 2013 22:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247204 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 22:46:27 -0000 Author: gonzo Date: Sat Feb 23 22:46:26 2013 New Revision: 247204 URL: http://svnweb.freebsd.org/changeset/base/247204 Log: Add macroses to properly map IO peripherals memory window from ARM physical memory address space to VideoCore address space Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Sat Feb 23 22:00:59 2013 (r247203) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Sat Feb 23 22:46:26 2013 (r247204) @@ -34,14 +34,28 @@ #define _BCM2835_VCBUS_H_ #define BCM2835_VCBUS_SDRAM_CACHED 0x40000000 +#define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 +#define BCM2835_ARM_IO_BASE 0x20000000 +#define BCM2835_ARM_IO_SIZE 0x02000000 + /* * Convert physical address to VC bus address. Should be used * when submitting address over mailbox interface */ #define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_CACHED) +/* Check whether pa bellong top IO window */ +#define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ + ((pa) < BCM2835_ARM_IO_BASE + BCM2835_ARM_IO_SIZE)) + +/* + * Convert physical address in IO space to VC bus address. + */ +#define IO_TO_VCBUS(pa) ((pa - BCM2835_ARM_IO_BASE) + \ + BCM2835_VCBUS_IO_BASE) + /* * Convert address from VC bus space to physical. Should be used * when address is returned by VC over mailbox interface. e.g. From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 22:48:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8CC4DCE; Sat, 23 Feb 2013 22:48:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBABB8C2; Sat, 23 Feb 2013 22:48:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NMmC3i082249; Sat, 23 Feb 2013 22:48:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NMmCPo082248; Sat, 23 Feb 2013 22:48:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302232248.r1NMmCPo082248@svn.freebsd.org> From: Dimitry Andric Date: Sat, 23 Feb 2013 22:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247205 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 22:48:13 -0000 Author: dim Date: Sat Feb 23 22:48:12 2013 New Revision: 247205 URL: http://svnweb.freebsd.org/changeset/base/247205 Log: Pull in r175962 from upstream llvm trunk: X86: Disable cmov-memory patterns on subtargets without cmov. Fixes PR15115. For the i386 arch, this should enable cmov instructions only on -march=pentiumpro and higher. Since our default CPU is i486, cmov instructions will now be disabled by default. MFC after: 1 week Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Feb 23 22:46:26 2013 (r247204) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Feb 23 22:48:12 2013 (r247205) @@ -1076,12 +1076,14 @@ def : Pat<(X86cmp GR64:$src1, 0), // inverted. multiclass CMOVmr { - def : Pat<(X86cmov (loadi16 addr:$src1), GR16:$src2, InvertedCond, EFLAGS), - (Inst16 GR16:$src2, addr:$src1)>; - def : Pat<(X86cmov (loadi32 addr:$src1), GR32:$src2, InvertedCond, EFLAGS), - (Inst32 GR32:$src2, addr:$src1)>; - def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, InvertedCond, EFLAGS), - (Inst64 GR64:$src2, addr:$src1)>; + let Predicates = [HasCMov] in { + def : Pat<(X86cmov (loadi16 addr:$src1), GR16:$src2, InvertedCond, EFLAGS), + (Inst16 GR16:$src2, addr:$src1)>; + def : Pat<(X86cmov (loadi32 addr:$src1), GR32:$src2, InvertedCond, EFLAGS), + (Inst32 GR32:$src2, addr:$src1)>; + def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, InvertedCond, EFLAGS), + (Inst64 GR64:$src2, addr:$src1)>; + } } defm : CMOVmr; From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 22:50:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3A167F8E; Sat, 23 Feb 2013 22:50:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2398ED; Sat, 23 Feb 2013 22:50:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NMowql084231; Sat, 23 Feb 2013 22:50:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NMovZE084223; Sat, 23 Feb 2013 22:50:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302232250.r1NMovZE084223@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 23 Feb 2013 22:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247206 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 22:50:59 -0000 Author: jilles Date: Sat Feb 23 22:50:57 2013 New Revision: 247206 URL: http://svnweb.freebsd.org/changeset/base/247206 Log: sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig. Added: head/tools/regression/bin/sh/builtins/wait4.0 (contents, props changed) head/tools/regression/bin/sh/builtins/wait5.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/jobs.c head/bin/sh/main.c head/bin/sh/trap.c head/bin/sh/trap.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Feb 23 22:48:12 2013 (r247205) +++ head/bin/sh/eval.c Sat Feb 23 22:50:57 2013 (r247206) @@ -301,7 +301,7 @@ evaltree(union node *n, int flags) } while (n != NULL); out: popstackmark(&smark); - if (pendingsigs) + if (pendingsig) dotrap(); if (eflag && exitstatus != 0 && do_etest) exitshell(exitstatus); Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Feb 23 22:48:12 2013 (r247205) +++ head/bin/sh/jobs.c Sat Feb 23 22:50:57 2013 (r247206) @@ -521,7 +521,7 @@ waitcmd(int argc, char **argv) } while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, (struct job *)NULL) != -1); in_waitcmd--; - return 0; + return pendingsig + 128; } Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sat Feb 23 22:48:12 2013 (r247205) +++ head/bin/sh/main.c Sat Feb 23 22:50:57 2013 (r247206) @@ -196,7 +196,7 @@ cmdloop(int top) TRACE(("cmdloop(%d) called\n", top)); setstackmark(&smark); for (;;) { - if (pendingsigs) + if (pendingsig) dotrap(); inter = 0; if (iflag && top) { Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sat Feb 23 22:48:12 2013 (r247205) +++ head/bin/sh/trap.c Sat Feb 23 22:50:57 2013 (r247206) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); MKINIT char sigmode[NSIG]; /* current value of signal */ -int pendingsigs; /* indicates some signal received */ +volatile sig_atomic_t pendingsig; /* indicates some signal received */ int in_dotrap; /* do we execute in a trap handler? */ static char *volatile trap[NSIG]; /* trap handler commands */ static volatile sig_atomic_t gotsig[NSIG]; @@ -388,22 +388,25 @@ onsig(int signo) return; } - if (signo != SIGCHLD || !ignore_sigchld) - gotsig[signo] = 1; - pendingsigs++; - /* If we are currently in a wait builtin, prepare to break it */ - if ((signo == SIGINT || signo == SIGQUIT) && in_waitcmd != 0) - breakwaitcmd = 1; - /* - * If a trap is set, not ignored and not the null command, we need - * to make sure traps are executed even when a child blocks signals. - */ - if (Tflag && - trap[signo] != NULL && - ! (trap[signo][0] == '\0') && - ! (trap[signo][0] == ':' && trap[signo][1] == '\0')) + if ((signo == SIGINT || signo == SIGQUIT) && in_waitcmd != 0) { breakwaitcmd = 1; + pendingsig = signo; + } + + if (trap[signo] != NULL && trap[signo][0] != '\0' && + (signo != SIGCHLD || !ignore_sigchld)) { + gotsig[signo] = 1; + pendingsig = signo; + + /* + * If a trap is set, not ignored and not the null command, we + * need to make sure traps are executed even when a child + * blocks signals. + */ + if (Tflag && !(trap[signo][0] == ':' && trap[signo][1] == '\0')) + breakwaitcmd = 1; + } #ifndef NO_HISTORY if (signo == SIGWINCH) @@ -424,7 +427,7 @@ dotrap(void) in_dotrap++; for (;;) { - pendingsigs = 0; + pendingsig = 0; for (i = 1; i < NSIG; i++) { if (gotsig[i]) { gotsig[i] = 0; Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Sat Feb 23 22:48:12 2013 (r247205) +++ head/bin/sh/trap.h Sat Feb 23 22:50:57 2013 (r247206) @@ -33,7 +33,7 @@ * $FreeBSD$ */ -extern int pendingsigs; +extern volatile sig_atomic_t pendingsig; extern int in_dotrap; extern volatile sig_atomic_t gotwinch; Added: head/tools/regression/bin/sh/builtins/wait4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/wait4.0 Sat Feb 23 22:50:57 2013 (r247206) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +trapped= +trap trapped=1 QUIT +{ kill -QUIT $$; sleep 1; exit 4; } >fifo1 & +wait $! fifo1 & +wait Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0ADEB306; Sat, 23 Feb 2013 22:58:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1C68957; Sat, 23 Feb 2013 22:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NMw4I1085203; Sat, 23 Feb 2013 22:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NMw4S2085202; Sat, 23 Feb 2013 22:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302232258.r1NMw4S2085202@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 23 Feb 2013 22:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247207 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 22:58:05 -0000 Author: gonzo Date: Sat Feb 23 22:58:04 2013 New Revision: 247207 URL: http://svnweb.freebsd.org/changeset/base/247207 Log: Bump per-device interrupt limit to more reasonable default. Some hardware like DMA and GPIO controllers might require more then 8 interrupts per device instance. Submitted by: Daisuke Aoyama Discussed with: gber@, raj@ Modified: head/sys/dev/fdt/fdt_common.h Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sat Feb 23 22:50:57 2013 (r247206) +++ head/sys/dev/fdt/fdt_common.h Sat Feb 23 22:58:04 2013 (r247207) @@ -39,7 +39,7 @@ #define FDT_MEM_REGIONS 8 -#define DI_MAX_INTR_NUM 8 +#define DI_MAX_INTR_NUM 32 struct fdt_pci_range { u_long base_pci; From owner-svn-src-head@FreeBSD.ORG Sat Feb 23 23:22:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 231F183C; Sat, 23 Feb 2013 23:22:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB87B9E6; Sat, 23 Feb 2013 23:22:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1NNMmET093761; Sat, 23 Feb 2013 23:22:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1NNMm4u093760; Sat, 23 Feb 2013 23:22:48 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302232322.r1NNMm4u093760@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 23 Feb 2013 23:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247208 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 23 Feb 2013 23:22:49 -0000 Author: gonzo Date: Sat Feb 23 23:22:48 2013 New Revision: 247208 URL: http://svnweb.freebsd.org/changeset/base/247208 Log: - Move dma, sdhci and mbox nodes down in dts in order to get them initialized after FPIO controller since they might rely on GPIO functionality - Update interrupts property of dma node to contain all allocated interrupts Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts ============================================================================== --- head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Sat Feb 23 22:58:04 2013 (r247207) +++ head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Sat Feb 23 23:22:48 2013 (r247208) @@ -95,27 +95,6 @@ clock-frequency = <1000000>; }; - dma: dma { - compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; - reg = <0x7000 0x1000>, <0xE05000 0x1000>; - interrupts = < - 26 /* 2 */ - 27 /* 3 */ - >; - interrupt-parent = <&intc>; - - broadcom,channels = <0>; /* Set by VideoCore */ - }; - - sdhci { - compatible = "broadcom,bcm2835-sdhci", "broadcom,bcm2708-sdhci"; - reg = <0x300000 0x100>; - interrupts = <70>; - interrupt-parent = <&intc>; - - clock-frequency = <50000000>; /* Set by VideoCore */ - }; - armtimer { /* Not AMBA compatible */ compatible = "broadcom,bcm2835-sp804", "arm,sp804"; @@ -124,23 +103,6 @@ interrupt-parent = <&intc>; }; - vc_mbox: mbox { - compatible = "broadcom,bcm2835-mbox", "broadcom,bcm2708-mbox"; - reg = <0xB880 0x40>; - interrupts = <1>; - interrupt-parent = <&intc>; - - /* Channels - * 0: Power - * 1: Frame buffer - * 2: Virtual UART - * 3: VCHIQ - * 4: LEDs - * 5: Buttons - * 6: Touch screen - */ - }; - watchdog0 { compatible = "broadcom,bcm2835-wdt", "broadcom,bcm2708-wdt"; reg = <0x10001c 0x0c>; /* 0x1c, 0x20, 0x24 */ @@ -461,6 +423,41 @@ }; }; + dma: dma { + compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; + reg = <0x7000 0x1000>, <0xE05000 0x1000>; + interrupts = <24 25 26 27 28 29 30 31 32 33 34 35 36>; + interrupt-parent = <&intc>; + + broadcom,channels = <0>; /* Set by VideoCore */ + }; + + vc_mbox: mbox { + compatible = "broadcom,bcm2835-mbox", "broadcom,bcm2708-mbox"; + reg = <0xB880 0x40>; + interrupts = <1>; + interrupt-parent = <&intc>; + + /* Channels + * 0: Power + * 1: Frame buffer + * 2: Virtual UART + * 3: VCHIQ + * 4: LEDs + * 5: Buttons + * 6: Touch screen + */ + }; + + sdhci { + compatible = "broadcom,bcm2835-sdhci", "broadcom,bcm2708-sdhci"; + reg = <0x300000 0x100>; + interrupts = <70>; + interrupt-parent = <&intc>; + + clock-frequency = <50000000>; /* Set by VideoCore */ + }; + uart0: uart0 { compatible = "broadcom,bcm2835-uart", "broadcom,bcm2708-uart", "arm,pl011", "arm,primecell"; reg = <0x201000 0x1000>;