From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 00:03:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D20FED17; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) (envelope-from eadler@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 9491FC06; Sun, 3 Feb 2013 00:03: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 r130307h051082; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1302xn9051065; Sun, 3 Feb 2013 00:02:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030002.r1302xn9051065@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 00:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246273 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 00:03:00 -0000 Author: eadler Date: Sun Feb 3 00:02:59 2013 New Revision: 246273 URL: http://svnweb.freebsd.org/changeset/base/246273 Log: MFC r243793,r243794: Add a few more translations from IDs to model name. PR: kern/174059 Approved by: cperciva (mentor, implicit) Modified: stable/8/sys/dev/sound/pci/hda/hdac.h stable/8/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.h Sat Feb 2 23:31:10 2013 (r246272) +++ stable/8/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246273) @@ -574,7 +574,10 @@ #define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) #define HDA_CODEC_NVIDIAMCP89 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000c) #define HDA_CODEC_NVIDIAGT240 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000d) +#define HDA_CODEC_NVIDIAGTS450 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0011) #define HDA_CODEC_NVIDIAGT440 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0014) +#define HDA_CODEC_NVIDIAGTX550 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0015) +#define HDA_CODEC_NVIDIAGTX570 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0018) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdacc.c Sat Feb 2 23:31:10 2013 (r246272) +++ stable/8/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246273) @@ -307,7 +307,10 @@ static const struct { { HDA_CODEC_NVIDIAGT21X, 0, "NVIDIA GT21x" }, { HDA_CODEC_NVIDIAMCP89, 0, "NVIDIA MCP89" }, { HDA_CODEC_NVIDIAGT240, 0, "NVIDIA GT240" }, + { HDA_CODEC_NVIDIAGTS450, 0, "NVIDIA GTS450" }, { HDA_CODEC_NVIDIAGT440, 0, "NVIDIA GT440" }, + { HDA_CODEC_NVIDIAGTX550, 0, "NVIDIA GTX550" }, + { HDA_CODEC_NVIDIAGTX570, 0, "NVIDIA GTX570" }, { HDA_CODEC_INTELIP, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELBL, 0, "Intel Bearlake" }, { HDA_CODEC_INTELCA, 0, "Intel Cantiga" }, From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 00:03:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DCD0AD18; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) (envelope-from eadler@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 A3461C0F; Sun, 3 Feb 2013 00:03: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 r13030jJ051093; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13030wZ051089; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030003.r13030wZ051089@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 00:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246274 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 00:03:01 -0000 Author: eadler Date: Sun Feb 3 00:02:59 2013 New Revision: 246274 URL: http://svnweb.freebsd.org/changeset/base/246274 Log: MFC r243793,r243794: Add a few more translations from IDs to model name. PR: kern/174059 Approved by: cperciva (mentor, implicit) Modified: stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246273) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246274) @@ -574,6 +574,10 @@ #define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) #define HDA_CODEC_NVIDIAMCP89 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000c) #define HDA_CODEC_NVIDIAGT240 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000d) +#define HDA_CODEC_NVIDIAGTS450 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0011) +#define HDA_CODEC_NVIDIAGT440 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0014) +#define HDA_CODEC_NVIDIAGTX550 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0015) +#define HDA_CODEC_NVIDIAGTX570 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0018) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246273) +++ stable/9/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246274) @@ -307,6 +307,10 @@ static const struct { { HDA_CODEC_NVIDIAGT21X, 0, "NVIDIA GT21x" }, { HDA_CODEC_NVIDIAMCP89, 0, "NVIDIA MCP89" }, { HDA_CODEC_NVIDIAGT240, 0, "NVIDIA GT240" }, + { HDA_CODEC_NVIDIAGTS450, 0, "NVIDIA GTS450" }, + { HDA_CODEC_NVIDIAGT440, 0, "NVIDIA GT440" }, + { HDA_CODEC_NVIDIAGTX550, 0, "NVIDIA GTX550" }, + { HDA_CODEC_NVIDIAGTX570, 0, "NVIDIA GTX570" }, { HDA_CODEC_INTELIP, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELBL, 0, "Intel Bearlake" }, { HDA_CODEC_INTELCA, 0, "Intel Cantiga" }, From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 00:19:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B9BB153; Sun, 3 Feb 2013 00:19:35 +0000 (UTC) (envelope-from jhibbits@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 3F68DCF4; Sun, 3 Feb 2013 00:19: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 r130JZkn055486; Sun, 3 Feb 2013 00:19:35 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r130JYsQ055484; Sun, 3 Feb 2013 00:19:34 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201302030019.r130JYsQ055484@svn.freebsd.org> From: Justin Hibbits Date: Sun, 3 Feb 2013 00:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246275 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 00:19:35 -0000 Author: jhibbits Date: Sun Feb 3 00:19:34 2013 New Revision: 246275 URL: http://svnweb.freebsd.org/changeset/base/246275 Log: Fix the PowerPC DTrace copy functions. The kernel doesn't hold the same view to the user map, so use the md copy in/out functions provided by the kernel. MFC with: r242723 Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sun Feb 3 00:02:59 2013 (r246274) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sun Feb 3 00:19:34 2013 (r246275) @@ -19,6 +19,8 @@ * * CDDL HEADER END * + * Portions Copyright 2012,2013 Justin Hibbits + * * $FreeBSD$ */ /* @@ -114,48 +116,6 @@ ASENTRY_NOPROF(dtrace_fulword) END(dtrace_fulword) /* -uint8_t -dtrace_fuword8_nocheck(void *addr) -*/ -ASENTRY_NOPROF(dtrace_fuword8_nocheck) - lbz %r3,0(%r3) - blr -END(dtrace_fuword8_nocheck) - -/* -uint16_t -dtrace_fuword16_nocheck(void *addr) -*/ -ASENTRY_NOPROF(dtrace_fuword16_nocheck) - lhz %r3,0(%r3) - blr -END(dtrace_fuword16_nocheck) - -/* -uint32_t -dtrace_fuword32_nocheck(void *addr) -*/ -ASENTRY_NOPROF(dtrace_fuword32_nocheck) - lwz %r3,0(%r3) - blr -END(dtrace_fuword32_nocheck) - -/* -uint64_t -dtrace_fuword64_nocheck(void *addr) -*/ -ASENTRY_NOPROF(dtrace_fuword64_nocheck) -#if defined(__powerpc64__) - ld %r3,0(%r3) -#else - lwz %r5,0(%r3) - lwz %r4,4(%r3) - mr %r3,%r5 -#endif - blr -END(dtrace_fuword64_nocheck) - -/* XXX: unoptimized void dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Sun Feb 3 00:02:59 2013 (r246274) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Sun Feb 3 00:19:34 2013 (r246275) @@ -19,6 +19,8 @@ * * CDDL HEADER END * + * Portions Copyright 2012,2013 Justin Hibbits + * * $FreeBSD$ */ /* @@ -45,11 +47,6 @@ #include "regset.h" -uint8_t dtrace_fuword8_nocheck(void *); -uint16_t dtrace_fuword16_nocheck(void *); -uint32_t dtrace_fuword32_nocheck(void *); -uint64_t dtrace_fuword64_nocheck(void *); - /* Offset to the LR Save word (ppc32) */ #define RETURN_OFFSET 4 #define RETURN_OFFSET64 8 @@ -462,31 +459,63 @@ dtrace_copyin(uintptr_t uaddr, uintptr_t volatile uint16_t *flags) { if (dtrace_copycheck(uaddr, kaddr, size)) - dtrace_copy(uaddr, kaddr, size); + if (copyin((const void *)uaddr, (void *)kaddr, size)) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } } void dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, volatile uint16_t *flags) { - if (dtrace_copycheck(uaddr, kaddr, size)) - dtrace_copy(kaddr, uaddr, size); + if (dtrace_copycheck(uaddr, kaddr, size)) { + if (copyout((const void *)kaddr, (void *)uaddr, size)) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } + } } void dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, volatile uint16_t *flags) { - if (dtrace_copycheck(uaddr, kaddr, size)) - dtrace_copystr(uaddr, kaddr, size, flags); + size_t actual; + int error; + + if (dtrace_copycheck(uaddr, kaddr, size)) { + error = copyinstr((const void *)uaddr, (void *)kaddr, + size, &actual); + + /* ENAMETOOLONG is not a fault condition. */ + if (error && error != ENAMETOOLONG) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } + } } +/* + * The bulk of this function could be replaced to match dtrace_copyinstr() + * if we ever implement a copyoutstr(). + */ void dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, volatile uint16_t *flags) { - if (dtrace_copycheck(uaddr, kaddr, size)) - dtrace_copystr(kaddr, uaddr, size, flags); + size_t len; + + if (dtrace_copycheck(uaddr, kaddr, size)) { + len = strlen((const char *)kaddr); + if (len > size) + len = size; + + if (copyout((const void *)kaddr, (void *)uaddr, len)) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } + } } uint8_t @@ -497,18 +526,21 @@ dtrace_fuword8(void *uaddr) cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; return (0); } - return (dtrace_fuword8_nocheck(uaddr)); + return (fubyte(uaddr)); } uint16_t dtrace_fuword16(void *uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { - DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; - return (0); + uint16_t ret = 0; + + if (dtrace_copycheck((uintptr_t)uaddr, (uintptr_t)&ret, sizeof(ret))) { + if (copyin((const void *)uaddr, (void *)&ret, sizeof(ret))) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } } - return (dtrace_fuword16_nocheck(uaddr)); + return ret; } uint32_t @@ -519,16 +551,19 @@ dtrace_fuword32(void *uaddr) cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; return (0); } - return (dtrace_fuword32_nocheck(uaddr)); + return (fuword32(uaddr)); } uint64_t dtrace_fuword64(void *uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { - DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; - return (0); + uint64_t ret = 0; + + if (dtrace_copycheck((uintptr_t)uaddr, (uintptr_t)&ret, sizeof(ret))) { + if (copyin((const void *)uaddr, (void *)&ret, sizeof(ret))) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + } } - return (dtrace_fuword64_nocheck(uaddr)); + return ret; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 01:08:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 489BB646; Sun, 3 Feb 2013 01:08:02 +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 22BC8DD7; Sun, 3 Feb 2013 01:08: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 r13181IF070191; Sun, 3 Feb 2013 01:08:01 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r131818W070189; Sun, 3 Feb 2013 01:08:01 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302030108.r131818W070189@svn.freebsd.org> From: Tim Kientzle Date: Sun, 3 Feb 2013 01:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246276 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 01:08:02 -0000 Author: kientzle Date: Sun Feb 3 01:08:01 2013 New Revision: 246276 URL: http://svnweb.freebsd.org/changeset/base/246276 Log: Another overhaul of the CPSW driver for BeagleBone Major changes: * Finally tracked down the flow control setting that seems to have been causing TX stalls and watchdog timeouts * RX and TX paths now share a lot more code * TX interrupt is no longer used; we instead GC finished tx queue entries at the bottom of the start routine. * TX start now queues fragmented packets directly; it only invokes defrag() for occasional very fragmented packets. * "sysctl dev.cpsw" dumps controller statistics and queue counts * Host Error Interrupt will give extensive debugging information if the controller chokes on the queued data. Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 3 00:19:34 2013 (r246275) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Feb 3 01:08:01 2013 (r246276) @@ -25,8 +25,22 @@ */ /* - * TI 3 Port Switch Ethernet (CPSW) Driver - * Found in TI8148, AM335x SoCs + * TI Common Platform Ethernet Switch (CPSW) Driver + * Found in TI8148 "DaVinci" and AM335x "Sitara" SoCs. + * + * This controller is documented in the AM335x Technical Reference + * Manual, in the TMS320DM814x DaVinci Digital Video Processors TRM + * and in the TMS320C6452 3 Port Switch Ethernet Subsystem TRM. + * + * It is basically a single Ethernet port (port 0) wired internally to + * a 3-port store-and-forward switch connected to two independent + * "sliver" controllers (port 1 and port 2). You can operate the + * controller in a variety of different ways by suitably configuring + * the slivers and the Address Lookup Engine (ALE) that routes packets + * between the ports. + * + * This code was developed and tested on a BeagleBone with + * an AM335x SoC. */ #include @@ -76,44 +90,82 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -static int cpsw_probe(device_t dev); -static int cpsw_attach(device_t dev); -static int cpsw_detach(device_t dev); -static int cpsw_shutdown(device_t dev); -static int cpsw_suspend(device_t dev); -static int cpsw_resume(device_t dev); - -static int cpsw_miibus_readreg(device_t dev, int phy, int reg); -static int cpsw_miibus_writereg(device_t dev, int phy, int reg, int value); - -static int cpsw_ifmedia_upd(struct ifnet *ifp); -static void cpsw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); - -static void cpsw_init(void *arg); -static void cpsw_init_locked(void *arg); -static void cpsw_start(struct ifnet *ifp); -static void cpsw_start_locked(struct ifnet *ifp); -static void cpsw_stop_locked(struct cpsw_softc *sc); -static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static int cpsw_init_slot_lists(struct cpsw_softc *sc); -static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); -static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); -static void cpsw_tx_watchdog(struct cpsw_softc *sc); +/* Device probe/attach/detach. */ +static int cpsw_probe(device_t); +static void cpsw_init_slots(struct cpsw_softc *); +static int cpsw_attach(device_t); +static void cpsw_free_slot(struct cpsw_softc *, struct cpsw_slot *); +static int cpsw_detach(device_t); + +/* Device Init/shutdown. */ +static void cpsw_init(void *); +static void cpsw_init_locked(void *); +static int cpsw_shutdown(device_t); +static void cpsw_shutdown_locked(struct cpsw_softc *); + +/* Device Suspend/Resume. */ +static int cpsw_suspend(device_t); +static int cpsw_resume(device_t); -static void cpsw_intr_rx_thresh(void *arg); +/* Ioctl. */ +static int cpsw_ioctl(struct ifnet *, u_long command, caddr_t data); + +static int cpsw_miibus_readreg(device_t, int phy, int reg); +static int cpsw_miibus_writereg(device_t, int phy, int reg, int value); + +/* Send/Receive packets. */ static void cpsw_intr_rx(void *arg); -static void cpsw_intr_rx_locked(void *arg); -static void cpsw_intr_tx(void *arg); -static void cpsw_intr_tx_locked(void *arg); -static void cpsw_intr_misc(void *arg); - -static void cpsw_ale_read_entry(struct cpsw_softc *sc, uint16_t idx, uint32_t *ale_entry); -static void cpsw_ale_write_entry(struct cpsw_softc *sc, uint16_t idx, uint32_t *ale_entry); -static int cpsw_ale_uc_entry_set(struct cpsw_softc *sc, uint8_t port, uint8_t *mac); -static int cpsw_ale_mc_entry_set(struct cpsw_softc *sc, uint8_t portmap, uint8_t *mac); -#ifdef CPSW_DEBUG -static void cpsw_ale_dump_table(struct cpsw_softc *sc); -#endif +static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *); +static void cpsw_rx_enqueue(struct cpsw_softc *); +static void cpsw_start(struct ifnet *); +static void cpsw_tx_enqueue(struct cpsw_softc *); +static int cpsw_tx_dequeue(struct cpsw_softc *); + +/* Misc interrupts and watchdog. */ +static void cpsw_intr_rx_thresh(void *); +static void cpsw_intr_misc(void *); +static void cpsw_tick(void *); +static void cpsw_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int cpsw_ifmedia_upd(struct ifnet *); +static void cpsw_tx_watchdog(struct cpsw_softc *); + +/* ALE support */ +static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t idx, uint32_t *ale_entry); +static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t idx, uint32_t *ale_entry); +static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t portmap, uint8_t *mac); +static int cpsw_ale_update_addresses(struct cpsw_softc *, int purge); +static void cpsw_ale_dump_table(struct cpsw_softc *); + +/* Statistics and sysctls. */ +static void cpsw_add_sysctls(struct cpsw_softc *); +static void cpsw_stats_collect(struct cpsw_softc *); +static int cpsw_stats_sysctl(SYSCTL_HANDLER_ARGS); + +/* + * Arbitrary limit on number of segments in an mbuf to be transmitted. + * Packets with more segments than this will be defragmented before + * they are queued. + */ +#define CPSW_TXFRAGS 8 + + +/* + * TODO: The CPSW subsystem (CPSW_SS) can drive two independent PHYs + * as separate Ethernet ports. To properly support this, we should + * break this into two separate devices: a CPSW_SS device that owns + * the interrupts and actually talks to the CPSW hardware, and a + * separate CPSW Ethernet child device for each Ethernet port. The RX + * interrupt, for example, would be part of CPSW_SS; it would receive + * a packet, note the input port, and then dispatch it to the child + * device's interface queue. Similarly for transmit. + * + * It's not clear to me whether the device tree should be restructured + * with a cpsw_ss node and two child nodes. That would allow specifying + * MAC addresses for each port, for example, but might be overkill. + * + * Unfortunately, I don't have hardware right now that supports two + * Ethernet ports via CPSW. + */ static device_method_t cpsw_methods[] = { /* Device interface */ @@ -137,7 +189,6 @@ static driver_t cpsw_driver = { static devclass_t cpsw_devclass; - DRIVER_MODULE(cpsw, simplebus, cpsw_driver, cpsw_devclass, 0, 0); DRIVER_MODULE(miibus, cpsw, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(cpsw, ether, 1, 1, 1); @@ -152,40 +203,109 @@ static struct resource_spec res_spec[] = { -1, 0 } }; -static struct { - driver_intr_t *handler; - char * description; -} cpsw_intrs[CPSW_INTR_COUNT + 1] = { - { cpsw_intr_rx_thresh, "CPSW RX threshold interrupt" }, - { cpsw_intr_rx, "CPSW RX interrupt" }, - { cpsw_intr_tx, "CPSW TX interrupt" }, - { cpsw_intr_misc, "CPSW misc interrupt" }, +/* Number of entries here must match size of stats + * array in struct cpsw_softc. */ +static struct cpsw_stat { + int reg; + char *oid; +} cpsw_stat_sysctls[CPSW_SYSCTL_COUNT] = { + {0x00, "GoodRxFrames"}, + {0x04, "BroadcastRxFrames"}, + {0x08, "MulticastRxFrames"}, + {0x0C, "PauseRxFrames"}, + {0x10, "RxCrcErrors"}, + {0x14, "RxAlignErrors"}, + {0x18, "OversizeRxFrames"}, + {0x1c, "RxJabbers"}, + {0x20, "ShortRxFrames"}, + {0x24, "RxFragments"}, + {0x30, "RxOctets"}, + {0x34, "GoodTxFrames"}, + {0x38, "BroadcastTxFrames"}, + {0x3c, "MulticastTxFrames"}, + {0x40, "PauseTxFrames"}, + {0x44, "DeferredTxFrames"}, + {0x48, "CollisionsTxFrames"}, + {0x4c, "SingleCollisionTxFrames"}, + {0x50, "MultipleCollisionTxFrames"}, + {0x54, "ExcessiveCollisions"}, + {0x58, "LateCollisions"}, + {0x5c, "TxUnderrun"}, + {0x60, "CarrierSenseErrors"}, + {0x64, "TxOctets"}, + {0x68, "RxTx64OctetFrames"}, + {0x6c, "RxTx65to127OctetFrames"}, + {0x70, "RxTx128to255OctetFrames"}, + {0x74, "RxTx256to511OctetFrames"}, + {0x78, "RxTx512to1024OctetFrames"}, + {0x7c, "RxTx1024upOctetFrames"}, + {0x80, "NetOctets"}, + {0x84, "RxStartOfFrameOverruns"}, + {0x88, "RxMiddleOfFrameOverruns"}, + {0x8c, "RxDmaOverruns"} }; -/* Locking macros */ +/* + * Basic debug support. + */ + +#define IF_DEBUG(sc) if (sc->cpsw_if_flags & IFF_DEBUG) + +static void +cpsw_debugf_head(const char *funcname) +{ + int t = (int)(time_second % (24 * 60 * 60)); + + printf("%02d:%02d:%02d %s ", t / (60 * 60), (t / 60) % 60, t % 60, funcname); +} + +#include +static void +cpsw_debugf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); + +} + +#define CPSW_DEBUGF(a) do { \ + IF_DEBUG(sc) { \ + cpsw_debugf_head(__func__); \ + cpsw_debugf a; \ + } \ +} while (0) + + +/* + * Locking macros + */ #define CPSW_TX_LOCK(sc) do { \ - mtx_assert(&(sc)->rx_lock, MA_NOTOWNED); \ - mtx_lock(&(sc)->tx_lock); \ + mtx_assert(&(sc)->rx.lock, MA_NOTOWNED); \ + mtx_lock(&(sc)->tx.lock); \ } while (0) -#define CPSW_TX_UNLOCK(sc) mtx_unlock(&(sc)->tx_lock) -#define CPSW_TX_LOCK_ASSERT(sc) mtx_assert(&(sc)->tx_lock, MA_OWNED) +#define CPSW_TX_UNLOCK(sc) mtx_unlock(&(sc)->tx.lock) +#define CPSW_TX_LOCK_ASSERT(sc) mtx_assert(&(sc)->tx.lock, MA_OWNED) #define CPSW_RX_LOCK(sc) do { \ - mtx_assert(&(sc)->tx_lock, MA_NOTOWNED); \ - mtx_lock(&(sc)->rx_lock); \ + mtx_assert(&(sc)->tx.lock, MA_NOTOWNED); \ + mtx_lock(&(sc)->rx.lock); \ } while (0) -#define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx_lock) -#define CPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx_lock, MA_OWNED) +#define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx.lock) +#define CPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx.lock, MA_OWNED) #define CPSW_GLOBAL_LOCK(sc) do { \ - if ((mtx_owned(&(sc)->tx_lock) ? 1 : 0) != \ - (mtx_owned(&(sc)->rx_lock) ? 1 : 0)) { \ + if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) != \ + (mtx_owned(&(sc)->rx.lock) ? 1 : 0)) { \ panic("cpsw deadlock possibility detection!"); \ } \ - mtx_lock(&(sc)->tx_lock); \ - mtx_lock(&(sc)->rx_lock); \ + mtx_lock(&(sc)->tx.lock); \ + mtx_lock(&(sc)->rx.lock); \ } while (0) #define CPSW_GLOBAL_UNLOCK(sc) do { \ @@ -198,35 +318,128 @@ static struct { CPSW_RX_LOCK_ASSERT(sc); \ } while (0) +/* + * Read/Write macros + */ +#define cpsw_read_4(sc, reg) bus_read_4(sc->res[0], reg) +#define cpsw_write_4(sc, reg, val) bus_write_4(sc->res[0], reg, val) -#include -static void -cpsw_debugf_head(const char *funcname) -{ - int t = (int)(time_second % (24 * 60 * 60)); +#define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16)) - printf("%02d:%02d:%02d %s ", t / (60 * 60), (t / 60) % 60, t % 60, funcname); +#define cpsw_cpdma_bd_paddr(sc, slot) \ + (slot->bd_offset + vtophys(rman_get_start(sc->res[0]))) +#define cpsw_cpdma_read_bd(sc, slot, val) \ + bus_read_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) +#define cpsw_cpdma_write_bd(sc, slot, val) \ + bus_write_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) +#define cpsw_cpdma_write_bd_next(sc, slot, next_slot) \ + cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot)) +#define cpsw_cpdma_read_bd_flags(sc, slot) \ + bus_read_2(sc->res[0], slot->bd_offset + 14) +#define cpsw_write_hdp_slot(sc, queue, slot) \ + cpsw_write_4(sc, (queue)->hdp_offset, cpsw_cpdma_bd_paddr(sc, slot)) +#define CP_OFFSET (CPSW_CPDMA_TX_CP(0) - CPSW_CPDMA_TX_HDP(0)) +#define cpsw_read_cp(sc, queue) \ + cpsw_read_4(sc, (queue)->hdp_offset + CP_OFFSET) +#define cpsw_write_cp(sc, queue, val) \ + cpsw_write_4(sc, (queue)->hdp_offset + CP_OFFSET, (val)) +#define cpsw_write_cp_slot(sc, queue, slot) \ + cpsw_write_cp(sc, queue, cpsw_cpdma_bd_paddr(sc, slot)) + +#if 0 +/* XXX temporary function versions for debugging. */ +static void +cpsw_write_hdp_slotX(struct cpsw_softc *sc, struct cpsw_queue *queue, struct cpsw_slot *slot) +{ + uint32_t reg = queue->hdp_offset; + uint32_t v = cpsw_cpdma_bd_paddr(sc, slot); + CPSW_DEBUGF(("HDP <=== 0x%08x (was 0x%08x)", v, cpsw_read_4(sc, reg))); + cpsw_write_4(sc, reg, v); } static void -cpsw_debugf(const char *fmt, ...) +cpsw_write_cp_slotX(struct cpsw_softc *sc, struct cpsw_queue *queue, struct cpsw_slot *slot) +{ + uint32_t v = cpsw_cpdma_bd_paddr(sc, slot); + CPSW_DEBUGF(("CP <=== 0x%08x (expecting 0x%08x)", v, cpsw_read_cp(sc, queue))); + cpsw_write_cp(sc, queue, v); +} +#endif + +/* + * Expanded dump routines for verbose debugging. + */ +static void +cpsw_dump_slot(struct cpsw_softc *sc, struct cpsw_slot *slot) { - va_list ap; + static const char *flags[] = {"SOP", "EOP", "Owner", "EOQ", + "TDownCmplt", "PassCRC", "Long", "Short", "MacCtl", "Overrun", + "PktErr1", "PortEn/PktErr0", "RxVlanEncap", "Port2", "Port1", + "Port0"}; + struct cpsw_cpdma_bd bd; + const char *sep; + int i; - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); + cpsw_cpdma_read_bd(sc, slot, &bd); + printf("BD Addr: 0x%08x Next: 0x%08x\n", cpsw_cpdma_bd_paddr(sc, slot), bd.next); + printf(" BufPtr: 0x%08x BufLen: 0x%08x\n", bd.bufptr, bd.buflen); + printf(" BufOff: 0x%08x PktLen: 0x%08x\n", bd.bufoff, bd.pktlen); + printf(" Flags: "); + sep = ""; + for (i = 0; i < 16; ++i) { + if (bd.flags & (1 << (15 - i))) { + printf("%s%s", sep, flags[i]); + sep = ","; + } + } printf("\n"); + if (slot->mbuf) { + printf(" Ether: %14D\n", + (char *)(slot->mbuf->m_hdr.mh_data), " "); + printf(" Packet: %16D\n", + (char *)(slot->mbuf->m_hdr.mh_data) + 14, " "); + } +} + +#define CPSW_DUMP_SLOT(cs, slot) do { \ + IF_DEBUG(sc) { \ + cpsw_dump_slot(sc, slot); \ + } \ +} while (0) + +static void +cpsw_dump_queue(struct cpsw_softc *sc, struct cpsw_slots *q) +{ + struct cpsw_slot *slot; + int i = 0; + int others = 0; + + STAILQ_FOREACH(slot, q, next) { + if (i > 4) + ++others; + else + cpsw_dump_slot(sc, slot); + ++i; + } + if (others) + printf(" ... and %d more.\n", others); + printf("\n"); } -#define CPSW_DEBUGF(a) do { \ - if (sc->cpsw_if_flags & IFF_DEBUG) { \ - cpsw_debugf_head(__func__); \ - cpsw_debugf a; \ - } \ +#define CPSW_DUMP_QUEUE(sc, q) do { \ + IF_DEBUG(sc) { \ + cpsw_dump_queue(sc, q); \ + } \ } while (0) + +/* + * + * Device Probe, Attach, Detach. + * + */ + static int cpsw_probe(device_t dev) { @@ -238,18 +451,107 @@ cpsw_probe(device_t dev) return (BUS_PROBE_DEFAULT); } + +static void +cpsw_init_slots(struct cpsw_softc *sc) +{ + struct cpsw_slot *slot; + int i; + + STAILQ_INIT(&sc->avail); + + /* Put the slot descriptors onto the global avail list. */ + for (i = 0; i < sizeof(sc->_slots) / sizeof(sc->_slots[0]); i++) { + slot = &sc->_slots[i]; + slot->bd_offset = cpsw_cpdma_bd_offset(i); + STAILQ_INSERT_TAIL(&sc->avail, slot, next); + } +} + +/* + * bind an interrupt, add the relevant info to sc->interrupts + */ +static int +cpsw_attach_interrupt(struct cpsw_softc *sc, struct resource *res, driver_intr_t *handler, const char *description) +{ + void **pcookie; + int error; + + sc->interrupts[sc->interrupt_count].res = res; + sc->interrupts[sc->interrupt_count].description = description; + pcookie = &sc->interrupts[sc->interrupt_count].ih_cookie; + + error = bus_setup_intr(sc->dev, res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, *handler, sc, pcookie); + if (error) + device_printf(sc->dev, + "could not setup %s\n", description); + else + ++sc->interrupt_count; + return (error); +} + +/* + * teardown everything in sc->interrupts. + */ +static void +cpsw_detach_interrupts(struct cpsw_softc *sc) +{ + int error; + int i; + + for (i = 0; i < sizeof(sc->interrupts) / sizeof(sc->interrupts[0]); ++i) { + if (!sc->interrupts[i].ih_cookie) + continue; + error = bus_teardown_intr(sc->dev, + sc->interrupts[i].res, sc->interrupts[i].ih_cookie); + if (error) + device_printf(sc->dev, "could not release %s\n", + sc->interrupts[i].description); + sc->interrupts[i].ih_cookie = NULL; + } +} + +static int +cpsw_add_slots(struct cpsw_softc *sc, struct cpsw_queue *queue, int requested) +{ + const int max_slots = sizeof(sc->_slots) / sizeof(sc->_slots[0]); + struct cpsw_slot *slot; + int i; + + if (requested < 0) + requested = max_slots; + + for (i = 0; i < requested; ++i) { + slot = STAILQ_FIRST(&sc->avail); + if (slot == NULL) + return (0); + if (bus_dmamap_create(sc->mbuf_dtag, 0, &slot->dmamap)) { + if_printf(sc->ifp, "failed to create dmamap\n"); + return (ENOMEM); + } + STAILQ_REMOVE_HEAD(&sc->avail, next); + STAILQ_INSERT_TAIL(&queue->avail, slot, next); + ++queue->avail_queue_len; + ++queue->queue_slots; + } + return (0); +} + static int cpsw_attach(device_t dev) { + bus_dma_segment_t segs[1]; struct cpsw_softc *sc = device_get_softc(dev); struct mii_softc *miisc; struct ifnet *ifp; void *phy_sc; - int i, error, phy; + int error, phy, nsegs; uint32_t reg; CPSW_DEBUGF(("")); + getbinuptime(&sc->attach_uptime); sc->dev = dev; sc->node = ofw_bus_get_node(dev); @@ -259,10 +561,10 @@ cpsw_attach(device_t dev) return (ENXIO); } /* Initialize mutexes */ - mtx_init(&sc->tx_lock, device_get_nameunit(dev), - "cpsw TX lock", MTX_DEF); - mtx_init(&sc->rx_lock, device_get_nameunit(dev), - "cpsw RX lock", MTX_DEF); + mtx_init(&sc->tx.lock, device_get_nameunit(dev), + "cpsw TX lock", MTX_DEF); + mtx_init(&sc->rx.lock, device_get_nameunit(dev), + "cpsw RX lock", MTX_DEF); /* Allocate IO and IRQ resources */ error = bus_alloc_resources(dev, res_spec, sc->res); @@ -272,11 +574,11 @@ cpsw_attach(device_t dev) return (ENXIO); } - reg = cpsw_read_4(CPSW_SS_IDVER); - device_printf(dev, "Version %d.%d (%d)\n", (reg >> 8 & 0x7), + reg = cpsw_read_4(sc, CPSW_SS_IDVER); + device_printf(dev, "CPSW SS Version %d.%d (%d)\n", (reg >> 8 & 0x7), reg & 0xFF, (reg >> 11) & 0x1F); - //cpsw_add_sysctls(sc); TODO + cpsw_add_sysctls(sc); /* Allocate a busdma tag and DMA safe memory for mbufs. */ error = bus_dma_tag_create( @@ -285,22 +587,14 @@ cpsw_attach(device_t dev) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, CPSW_TXFRAGS, /* maxsize, nsegments */ MCLBYTES, 0, /* maxsegsz, flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &sc->mbuf_dtag); /* dmatag */ if (error) { device_printf(dev, "bus_dma_tag_create failed\n"); cpsw_detach(dev); - return (ENOMEM); - } - - /* Initialize the tx_avail and rx_avail lists. */ - error = cpsw_init_slot_lists(sc); - if (error) { - device_printf(dev, "failed to allocate dmamaps\n"); - cpsw_detach(dev); - return (ENOMEM); + return (error); } /* Allocate network interface */ @@ -311,6 +605,16 @@ cpsw_attach(device_t dev) return (ENOMEM); } + /* Allocate the null mbuf and pre-sync it. */ + sc->null_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + memset(sc->null_mbuf->m_hdr.mh_data, 0, sc->null_mbuf->m_ext.ext_size); + bus_dmamap_create(sc->mbuf_dtag, 0, &sc->null_mbuf_dmamap); + bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->null_mbuf_dmamap, + sc->null_mbuf, segs, &nsegs, BUS_DMA_NOWAIT); + bus_dmamap_sync(sc->mbuf_dtag, sc->null_mbuf_dmamap, + BUS_DMASYNC_PREWRITE); + sc->null_mbuf_paddr = segs[0].ds_addr; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; @@ -321,11 +625,32 @@ cpsw_attach(device_t dev) ifp->if_start = cpsw_start; ifp->if_ioctl = cpsw_ioctl; - ifp->if_snd.ifq_drv_maxlen = CPSW_MAX_TX_BUFFERS - 1; + cpsw_init_slots(sc); + + /* Allocate slots to TX and RX queues. */ + STAILQ_INIT(&sc->rx.avail); + STAILQ_INIT(&sc->rx.active); + STAILQ_INIT(&sc->tx.avail); + STAILQ_INIT(&sc->tx.active); + // For now: 128 slots to TX, rest to RX. + // XXX TODO: start with 32/64 and grow dynamically based on demand. + if (cpsw_add_slots(sc, &sc->tx, 128) || cpsw_add_slots(sc, &sc->rx, -1)) { + device_printf(dev, "failed to allocate dmamaps\n"); + cpsw_detach(dev); + return (ENOMEM); + } + device_printf(dev, "Initial queue size TX=%d RX=%d\n", + sc->tx.queue_slots, sc->rx.queue_slots); + + ifp->if_snd.ifq_drv_maxlen = sc->tx.queue_slots; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); + sc->tx.hdp_offset = CPSW_CPDMA_TX_HDP(0); + sc->rx.hdp_offset = CPSW_CPDMA_RX_HDP(0); + /* Get high part of MAC address from control module (mac_id0_hi) */ + /* TODO: Get MAC ID1 as well as MAC ID0. */ ti_scm_reg_read_4(0x634, ®); sc->mac_addr[0] = reg & 0xFF; sc->mac_addr[1] = (reg >> 8) & 0xFF; @@ -338,11 +663,14 @@ cpsw_attach(device_t dev) sc->mac_addr[5] = (reg >> 8) & 0xFF; ether_ifattach(ifp, sc->mac_addr); - callout_init(&sc->wd_callout, 0); + callout_init(&sc->watchdog.callout, 0); /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ - cpsw_write_4(MDIOCONTROL, 1 << 30 | 1 << 18 | 0xFF); + cpsw_write_4(sc, MDIOCONTROL, 1 << 30 | 1 << 18 | 0xFF); + + /* Clear ALE */ + cpsw_write_4(sc, CPSW_ALE_CONTROL, 1 << 30); /* Attach PHY(s) */ error = mii_attach(dev, &sc->miibus, ifp, cpsw_ifmedia_upd, @@ -358,25 +686,38 @@ cpsw_attach(device_t dev) miisc = LIST_FIRST(&sc->mii->mii_phys); /* Select PHY and enable interrupts */ - cpsw_write_4(MDIOUSERPHYSEL0, 1 << 6 | (miisc->mii_phy & 0x1F)); - - /* Attach interrupt handlers */ - for (i = 1; i <= CPSW_INTR_COUNT; ++i) { - error = bus_setup_intr(dev, sc->res[i], - INTR_TYPE_NET | INTR_MPSAFE, - NULL, *cpsw_intrs[i - 1].handler, - sc, &sc->ih_cookie[i - 1]); - if (error) { - device_printf(dev, "could not setup %s\n", - cpsw_intrs[i].description); - cpsw_detach(dev); - return (error); - } + cpsw_write_4(sc, MDIOUSERPHYSEL0, 1 << 6 | (miisc->mii_phy & 0x1F)); + + /* Note: We don't use sc->res[3] (TX interrupt) */ + if (cpsw_attach_interrupt(sc, sc->res[1], + cpsw_intr_rx_thresh, "CPSW RX threshold interrupt") || + cpsw_attach_interrupt(sc, sc->res[2], + cpsw_intr_rx, "CPSW RX interrupt") || + cpsw_attach_interrupt(sc, sc->res[4], + cpsw_intr_misc, "CPSW misc interrupt")) { + cpsw_detach(dev); + return (ENXIO); } return (0); } +static void +cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot) +{ + int error; + + if (slot->dmamap) { + error = bus_dmamap_destroy(sc->mbuf_dtag, slot->dmamap); + KASSERT(error == 0, ("Mapping still active")); + slot->dmamap = NULL; + } + if (slot->mbuf) { + m_freem(slot->mbuf); + slot->mbuf = NULL; + } +} + static int cpsw_detach(device_t dev) { @@ -389,31 +730,20 @@ cpsw_detach(device_t dev) if (device_is_attached(dev)) { ether_ifdetach(sc->ifp); CPSW_GLOBAL_LOCK(sc); - cpsw_stop_locked(sc); + cpsw_shutdown_locked(sc); CPSW_GLOBAL_UNLOCK(sc); - callout_drain(&sc->wd_callout); + callout_drain(&sc->watchdog.callout); } bus_generic_detach(dev); device_delete_child(dev, sc->miibus); /* Stop and release all interrupts */ - for (i = 0; i < CPSW_INTR_COUNT; ++i) { - if (!sc->ih_cookie[i]) - continue; - - error = bus_teardown_intr(dev, sc->res[1 + i], sc->ih_cookie[i]); - if (error) - device_printf(dev, "could not release %s\n", - cpsw_intrs[i + 1].description); - } + cpsw_detach_interrupts(sc); /* Free dmamaps and mbufs */ - for (i = 0; i < CPSW_MAX_TX_BUFFERS; i++) { - cpsw_free_slot(sc, &sc->_tx_slots[i]); - } - for (i = 0; i < CPSW_MAX_RX_BUFFERS; i++) { - cpsw_free_slot(sc, &sc->_rx_slots[i]); + for (i = 0; i < sizeof(sc->_slots) / sizeof(sc->_slots[0]); ++i) { + cpsw_free_slot(sc, &sc->_slots[i]); } /* Free DMA tag */ @@ -424,30 +754,181 @@ cpsw_detach(device_t dev) bus_release_resources(dev, res_spec, sc->res); /* Destroy mutexes */ - mtx_destroy(&sc->rx_lock); - mtx_destroy(&sc->tx_lock); + mtx_destroy(&sc->rx.lock); + mtx_destroy(&sc->tx.lock); return (0); } -static int -cpsw_suspend(device_t dev) +/* + * + * Init/Shutdown. + * + */ + +static void +cpsw_reset(struct cpsw_softc *sc) { - struct cpsw_softc *sc = device_get_softc(dev); + int i; + + /* Reset RMII/RGMII wrapper. */ + cpsw_write_4(sc, CPSW_WR_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_WR_SOFT_RESET) & 1) + ; + + /* Disable TX and RX interrupts for all cores. */ + for (i = 0; i < 3; ++i) { + cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_TX_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_RX_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_MISC_EN(i), 0x00); + } + + /* Reset CPSW subsystem. */ + cpsw_write_4(sc, CPSW_SS_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_SS_SOFT_RESET) & 1) + ; + + /* Reset Sliver port 1 and 2 */ + for (i = 0; i < 2; i++) { + /* Reset */ + cpsw_write_4(sc, CPSW_SL_SOFT_RESET(i), 1); + while (cpsw_read_4(sc, CPSW_SL_SOFT_RESET(i)) & 1) + ; + } + + /* Reset DMA controller. */ + cpsw_write_4(sc, CPSW_CPDMA_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_CPDMA_SOFT_RESET) & 1) + ; + + /* Disable TX & RX DMA */ + cpsw_write_4(sc, CPSW_CPDMA_TX_CONTROL, 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_CONTROL, 0); + + /* Clear all queues. */ + for (i = 0; i < 8; i++) { + cpsw_write_4(sc, CPSW_CPDMA_TX_HDP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_HDP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_TX_CP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_CP(i), 0); + } + + /* Clear all interrupt Masks */ + cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_CLEAR, 0xFFFFFFFF); + cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_CLEAR, 0xFFFFFFFF); +} + +static void +cpsw_init(void *arg) +{ + struct cpsw_softc *sc = arg; CPSW_DEBUGF(("")); CPSW_GLOBAL_LOCK(sc); - cpsw_stop_locked(sc); + cpsw_init_locked(arg); CPSW_GLOBAL_UNLOCK(sc); - return (0); } -static int -cpsw_resume(device_t dev) +static void +cpsw_init_locked(void *arg) { - /* XXX TODO XXX */ - device_printf(dev, "%s\n", __FUNCTION__); - return (0); + struct ifnet *ifp; + struct cpsw_softc *sc = arg; + struct cpsw_slot *slot; + uint32_t i; + + CPSW_DEBUGF(("")); + ifp = sc->ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + getbinuptime(&sc->init_uptime); + + /* Reset the controller. */ + cpsw_reset(sc); + + /* Enable ALE */ + cpsw_write_4(sc, CPSW_ALE_CONTROL, 1 << 31 | 1 << 4); + + /* Init Sliver port 1 and 2 */ + for (i = 0; i < 2; i++) { + /* Set Slave Mapping */ + cpsw_write_4(sc, CPSW_SL_RX_PRI_MAP(i), 0x76543210); + cpsw_write_4(sc, CPSW_PORT_P_TX_PRI_MAP(i + 1), 0x33221100); + cpsw_write_4(sc, CPSW_SL_RX_MAXLEN(i), 0x5f2); + /* Set MACCONTROL for ports 0,1: IFCTL_B(16), IFCTL_A(15), + GMII_EN(5), FULLDUPLEX(1) */ + /* TODO: Docs claim that IFCTL_B and IFCTL_A do the same thing? */ + /* Huh? Docs call bit 0 "Loopback" some places, "FullDuplex" others. */ + cpsw_write_4(sc, CPSW_SL_MACCONTROL(i), 1 << 15 | 1 << 5 | 1); + } + + /* Set Host Port Mapping */ + cpsw_write_4(sc, CPSW_PORT_P0_CPDMA_TX_PRI_MAP, 0x76543210); + cpsw_write_4(sc, CPSW_PORT_P0_CPDMA_RX_CH_MAP, 0); + + /* Initialize ALE: all ports set to forwarding(3), initialize addrs */ + for (i = 0; i < 3; i++) + cpsw_write_4(sc, CPSW_ALE_PORTCTL(i), 3); + cpsw_ale_update_addresses(sc, 1); + + cpsw_write_4(sc, CPSW_SS_PTYPE, 0); + + /* Enable statistics for ports 0, 1 and 2 */ + cpsw_write_4(sc, CPSW_SS_STAT_PORT_EN, 7); + + /* Experiment: Turn off flow control */ + /* This seems to fix the watchdog resets that have plagued + earlier versions of this driver; I'm not yet sure if there + are negative effects yet. */ + cpsw_write_4(sc, CPSW_SS_FLOW_CONTROL, 0); + + /* Make IP hdr aligned with 4 */ + cpsw_write_4(sc, CPSW_CPDMA_RX_BUFFER_OFFSET, 2); + + /* Initialize RX Buffer Descriptors */ + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), 0); + + /* Enable TX & RX DMA */ + cpsw_write_4(sc, CPSW_CPDMA_TX_CONTROL, 1); + cpsw_write_4(sc, CPSW_CPDMA_RX_CONTROL, 1); + + /* Enable Interrupts for core 0 */ + cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(0), 0xFF); + cpsw_write_4(sc, CPSW_WR_C_RX_EN(0), 0xFF); + cpsw_write_4(sc, CPSW_WR_C_MISC_EN(0), 0x3F); + + /* Enable host Error Interrupt */ + cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3); + + /* Enable interrupts for RX Channel 0 */ + cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1); + + /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ + /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ + cpsw_write_4(sc, MDIOCONTROL, 1 << 30 | 1 << 18 | 0xFF); + + /* Select MII in GMII_SEL, Internal Delay mode */ + //ti_scm_reg_write_4(0x650, 0); + + /* Initialize active queues. */ + slot = STAILQ_FIRST(&sc->tx.active); + if (slot != NULL) + cpsw_write_hdp_slot(sc, &sc->tx, slot); + slot = STAILQ_FIRST(&sc->rx.active); + if (slot != NULL) + cpsw_write_hdp_slot(sc, &sc->rx, slot); + cpsw_rx_enqueue(sc); + + /* Activate network interface */ + sc->rx.running = 1; + sc->tx.running = 1; + sc->watchdog.timer = 0; + callout_reset(&sc->watchdog.callout, hz, cpsw_tick, sc); + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + } static int @@ -457,376 +938,139 @@ cpsw_shutdown(device_t dev) CPSW_DEBUGF(("")); CPSW_GLOBAL_LOCK(sc); - cpsw_stop_locked(sc); + cpsw_shutdown_locked(sc); CPSW_GLOBAL_UNLOCK(sc); return (0); } -static int -cpsw_miibus_ready(struct cpsw_softc *sc) +static void +cpsw_rx_teardown_locked(struct cpsw_softc *sc) { - uint32_t r, retries = CPSW_MIIBUS_RETRIES; - - while (--retries) { - r = cpsw_read_4(MDIOUSERACCESS0); - if ((r & 1 << 31) == 0) - return 1; - DELAY(CPSW_MIIBUS_DELAY); - } - return 0; -} + struct mbuf *received, *next; + int i = 0; -static int -cpsw_miibus_readreg(device_t dev, int phy, int reg) -{ - struct cpsw_softc *sc = device_get_softc(dev); - uint32_t cmd, r; - - if (!cpsw_miibus_ready(sc)) { - device_printf(dev, "MDIO not ready to read\n"); - return 0; - } - - /* Set GO, reg, phy */ - cmd = 1 << 31 | (reg & 0x1F) << 21 | (phy & 0x1F) << 16; - cpsw_write_4(MDIOUSERACCESS0, cmd); - - if (!cpsw_miibus_ready(sc)) { - device_printf(dev, "MDIO timed out during read\n"); - return 0; - } - - r = cpsw_read_4(MDIOUSERACCESS0); - if((r & 1 << 29) == 0) { - device_printf(dev, "Failed to read from PHY.\n"); - r = 0; - } - return (r & 0xFFFF); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 01:22:29 2013 Return-Path: Delivered-To: svn-src-all@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 D3C878DE; Sun, 3 Feb 2013 01:22:29 +0000 (UTC) (envelope-from eadler@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 AC8C4E19; Sun, 3 Feb 2013 01:22: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 r131MTws075465; Sun, 3 Feb 2013 01:22:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r131MTIh075462; Sun, 3 Feb 2013 01:22:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030122.r131MTIh075462@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 01:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246277 - in stable/9: tools/regression/usr.bin/printf usr.bin/printf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 01:22:29 -0000 Author: eadler Date: Sun Feb 3 01:22:28 2013 New Revision: 246277 URL: http://svnweb.freebsd.org/changeset/base/246277 Log: MFC r244407,r244409: POSIX requires that non-existent or null arguments be treated as if a zero argument were supplied. Add regression tests to catch this case as well. PR: bin/174521 Approved by: cperciva (mentor, implicit) Added: stable/9/tools/regression/usr.bin/printf/regress.zero.out - copied unchanged from r244407, head/tools/regression/usr.bin/printf/regress.zero.out Modified: stable/9/tools/regression/usr.bin/printf/regress.sh stable/9/usr.bin/printf/printf.c Directory Properties: stable/9/tools/regression/ (props changed) stable/9/usr.bin/printf/ (props changed) Modified: stable/9/tools/regression/usr.bin/printf/regress.sh ============================================================================== --- stable/9/tools/regression/usr.bin/printf/regress.sh Sun Feb 3 01:08:01 2013 (r246276) +++ stable/9/tools/regression/usr.bin/printf/regress.sh Sun Feb 3 01:22:28 2013 (r246277) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..11' +echo '1..12' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') @@ -15,5 +15,9 @@ REGRESSION_TEST(`m3', `printf "%%%s\n" a REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"') REGRESSION_TEST(`m5', `printf -- "-d\n"') REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc') +REGRESSION_TEST('zero', `printf "%u%u\n" 15') +REGRESSION_TEST('zero', `printf "%d%d\n" 15') +REGRESSION_TEST('zero', `printf "%d%u\n" 15') +REGRESSION_TEST('zero', `printf "%u%d\n" 15') REGRESSION_END() Copied: stable/9/tools/regression/usr.bin/printf/regress.zero.out (from r244407, head/tools/regression/usr.bin/printf/regress.zero.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/usr.bin/printf/regress.zero.out Sun Feb 3 01:22:28 2013 (r246277, copy of r244407, head/tools/regression/usr.bin/printf/regress.zero.out) @@ -0,0 +1 @@ +150 Modified: stable/9/usr.bin/printf/printf.c ============================================================================== --- stable/9/usr.bin/printf/printf.c Sun Feb 3 01:08:01 2013 (r246276) +++ stable/9/usr.bin/printf/printf.c Sun Feb 3 01:22:28 2013 (r246277) @@ -467,7 +467,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int int rval; if (!*gargv) { - *ip = 0; + *ip = *uip = 0; return (0); } if (**gargv == '"' || **gargv == '\'') { From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 01:54:26 2013 Return-Path: Delivered-To: svn-src-all@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 894D8C1F; Sun, 3 Feb 2013 01:54:26 +0000 (UTC) (envelope-from pfg@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 700D0EF2; Sun, 3 Feb 2013 01:54: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 r131sQfN084128; Sun, 3 Feb 2013 01:54:26 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r131sQZm084127; Sun, 3 Feb 2013 01:54:26 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302030154.r131sQZm084127@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 3 Feb 2013 01:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246278 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 01:54:26 -0000 Author: pfg Date: Sun Feb 3 01:54:25 2013 New Revision: 246278 URL: http://svnweb.freebsd.org/changeset/base/246278 Log: crunch: Sync some NetBSD changes Fix a couple of free's in previous commit. Obtained from: NetBSD MFC after: 1 week Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 01:22:28 2013 (r246277) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 01:54:25 2013 (r246278) @@ -384,6 +384,8 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) + free(strtabp); + if (nstrtabp != NULL) free(nstrtabp); return (rv); From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 03:29:35 2013 Return-Path: Delivered-To: svn-src-all@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 CC2E0822 for ; Sun, 3 Feb 2013 03:29:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 39EEE258 for ; Sun, 3 Feb 2013 03:29:34 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fr10so3690611lab.40 for ; Sat, 02 Feb 2013 19:29:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=n9ocOUrA+EyX3p8Ze9ZaJwncO7T6XAICwitsgnCLpyg=; b=jkR0ubmP+EHI+GcCeRowvePWfOdgIs6jI5UQ19ZrfMFIqHL594DoemgS++k5YGB+HI Fhf9ODiIGod3r8+tqYbMS7kTqKRZtKmktG82DknQUPAnCFnlEShoHlHSR4QcPlnlLnL/ tyyW1fZX7VJ9xPc6uD7ylW8sMGde5jy6A0n6I= 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 :x-gm-message-state; bh=n9ocOUrA+EyX3p8Ze9ZaJwncO7T6XAICwitsgnCLpyg=; b=OOUPJrjH05LC4rnnBVWTyxh1CxIQkXJi0HoCQKJLIMTK2/hKKwccMzZZI46ybWaSrj 3A3kSQdwimBrGYdCbk2kM6Z4RreV1o8+zcXUgHhYxEq7V5J7gqSBvCGZM9do85kR4Q4o BE+R0Fj7vZho8tylNXoSuKBL8f2S402rTsHhsdltqPW0lZVBQOyssj7yAcg7lR9xmidq 8aH3R4mYUeJThwCe/srH38GymlYUKlxlB0d39RgCJiCX6VgoxVes5Sas4gFeyHXWzoOv Jp+ew0ylnIpF7lcfBZOHX65O6j16OISjR6y8EZGQd5YzFrpG1e1/aQkxxKssD9ezgt3c lZhg== X-Received: by 10.152.106.5 with SMTP id gq5mr15502580lab.5.1359862173906; Sat, 02 Feb 2013 19:29:33 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.91.164 with HTTP; Sat, 2 Feb 2013 19:29:03 -0800 (PST) In-Reply-To: <201302030154.r131sQZm084127@svn.freebsd.org> References: <201302030154.r131sQZm084127@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 22:29:03 -0500 X-Google-Sender-Auth: TzUTALMaWWhR5LWiBlfusywj0-A Message-ID: Subject: Re: svn commit: r246278 - head/usr.sbin/crunch/crunchide To: "Pedro F. Giffuni" Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkereSQsFHn0hY5gloNeUcQnHHaq9UApxeZgvrxM9O3BY3eg+q76fy2TZOQLOpQ0mVGTql7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:29:35 -0000 On 2 February 2013 20:54, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Feb 3 01:54:25 2013 > New Revision: 246278 > URL: http://svnweb.freebsd.org/changeset/base/246278 > > Log: > crunch: Sync some NetBSD changes > > Fix a couple of free's in previous commit. > > Obtained from: NetBSD > MFC after: 1 week > > Modified: > head/usr.sbin/crunch/crunchide/exec_elf32.c > > Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c > ============================================================================== > --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 01:22:28 2013 (r246277) > +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 01:54:25 2013 (r246278) > @@ -384,6 +384,8 @@ out: > if (symtabp != NULL) > free(symtabp); > if (strtabp != NULL) > + free(strtabp); > + if (nstrtabp != NULL) > free(nstrtabp); Why bother checking for NULL here? 7.22.2.3.2 says that free(NULL) results in no action. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 03:38:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9506FB91; Sun, 3 Feb 2013 03:38:46 +0000 (UTC) (envelope-from eadler@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 570C42BF; Sun, 3 Feb 2013 03:38: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 r133cjs6015455; Sun, 3 Feb 2013 03:38:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133cjQQ015450; Sun, 3 Feb 2013 03:38:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030338.r133cjQQ015450@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246279 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:38:46 -0000 Author: eadler Date: Sun Feb 3 03:38:44 2013 New Revision: 246279 URL: http://svnweb.freebsd.org/changeset/base/246279 Log: MFC r244493: Make bsdgrep behave as gnugrep and as documented: -m should only stop reading the specific file, not any file. Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.bin/grep/grep.c stable/9/usr.bin/grep/grep.h stable/9/usr.bin/grep/util.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/grep.c Sun Feb 3 03:38:44 2013 (r246279) @@ -107,6 +107,7 @@ bool iflag; /* -i: ignore case */ bool lflag; /* -l: only show names of files with matches */ bool mflag; /* -m x: stop reading the files after x matches */ long long mcount; /* count for -m */ +long long mlimit; /* requested value for -m */ bool nflag; /* -n: show line numbers in front of matching lines */ bool oflag; /* -o: print only matching part */ bool qflag; /* -q: quiet mode (don't output anything) */ @@ -529,7 +530,7 @@ main(int argc, char *argv[]) case 'm': mflag = true; errno = 0; - mcount = strtoll(optarg, &ep, 10); + mlimit = mcount = strtoll(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == LLONG_MAX)) || ((errno == EINVAL) && (mcount == 0))) err(2, NULL); Modified: stable/9/usr.bin/grep/grep.h ============================================================================== --- stable/9/usr.bin/grep/grep.h Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/grep.h Sun Feb 3 03:38:44 2013 (r246279) @@ -115,6 +115,7 @@ extern bool Eflag, Fflag, Gflag, Hflag, extern bool dexclude, dinclude, fexclude, finclude, lbflag, nullflag; extern unsigned long long Aflag, Bflag; extern long long mcount; +extern long long mlimit; extern char *label; extern const char *color; extern int binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave; Modified: stable/9/usr.bin/grep/util.c ============================================================================== --- stable/9/usr.bin/grep/util.c Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/util.c Sun Feb 3 03:38:44 2013 (r246279) @@ -176,8 +176,7 @@ procfile(const char *fn) mode_t s; int c, t; - if (mflag && (mcount <= 0)) - return (0); + mcount = mlimit; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : getstr(1); From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 03:44:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 979DCD58; Sun, 3 Feb 2013 03:44:00 +0000 (UTC) (envelope-from eadler@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 8ABD92F0; Sun, 3 Feb 2013 03:44: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 r133i0KC017765; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133i0kl017764; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030344.r133i0kl017764@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246280 - stable/9/usr.sbin/pw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:44:00 -0000 Author: eadler Date: Sun Feb 3 03:43:59 2013 New Revision: 246280 URL: http://svnweb.freebsd.org/changeset/base/246280 Log: MFC r243896: Use strdup instead of malloc + strcpy Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.sbin/pw/pwupd.c Directory Properties: stable/9/usr.sbin/pw/ (props changed) Modified: stable/9/usr.sbin/pw/pwupd.c ============================================================================== --- stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:38:44 2013 (r246279) +++ stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:43:59 2013 (r246280) @@ -53,12 +53,10 @@ setpwdir(const char * dir) { if (dir == NULL) return -1; - else { - char * d = malloc(strlen(dir)+1); - if (d == NULL) - return -1; - pwpath = strcpy(d, dir); - } + else + pwpath = strdup(dir); + if (pwpath == NULL) + return -1; return 0; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 03:46:16 2013 Return-Path: Delivered-To: svn-src-all@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 EA708EDB; Sun, 3 Feb 2013 03:46:16 +0000 (UTC) (envelope-from eadler@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 D8D03307; Sun, 3 Feb 2013 03:46: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 r133kGS8018106; Sun, 3 Feb 2013 03:46:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133kGQ8018102; Sun, 3 Feb 2013 03:46:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030346.r133kGQ8018102@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246281 - stable/9/usr.sbin/cpucontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:46:17 -0000 Author: eadler Date: Sun Feb 3 03:46:16 2013 New Revision: 246281 URL: http://svnweb.freebsd.org/changeset/base/246281 Log: MFC r245491: Avoid clobbering errno with a call to fprintf PR: bin/173923 Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.sbin/cpucontrol/intel.c stable/9/usr.sbin/cpucontrol/via.c Directory Properties: stable/9/usr.sbin/cpucontrol/ (props changed) Modified: stable/9/usr.sbin/cpucontrol/intel.c ============================================================================== --- stable/9/usr.sbin/cpucontrol/intel.c Sun Feb 3 03:43:59 2013 (r246280) +++ stable/9/usr.sbin/cpucontrol/intel.c Sun Feb 3 03:46:16 2013 (r246281) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -266,7 +267,9 @@ matched: args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } Modified: stable/9/usr.sbin/cpucontrol/via.c ============================================================================== --- stable/9/usr.sbin/cpucontrol/via.c Sun Feb 3 03:43:59 2013 (r246280) +++ stable/9/usr.sbin/cpucontrol/via.c Sun Feb 3 03:46:16 2013 (r246281) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -204,7 +205,9 @@ via_update(const char *dev, const char * args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 04:04:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8CC0F28A for ; Sun, 3 Feb 2013 04:04:54 +0000 (UTC) (envelope-from giffunip@yahoo.com) Received: from nm22.bullet.mail.bf1.yahoo.com (nm22.bullet.mail.bf1.yahoo.com [98.139.212.181]) by mx1.freebsd.org (Postfix) with ESMTP id 80A21385 for ; Sun, 3 Feb 2013 04:04:53 +0000 (UTC) Received: from [98.139.215.143] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 03 Feb 2013 04:04:46 -0000 Received: from [98.139.212.196] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 03 Feb 2013 04:04:46 -0000 Received: from [127.0.0.1] by omp1005.mail.bf1.yahoo.com with NNFMP; 03 Feb 2013 04:04:46 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 505930.97641.bm@omp1005.mail.bf1.yahoo.com Received: (qmail 801 invoked by uid 60001); 3 Feb 2013 04:04:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1359864286; bh=m+znPX9+Zkyx1bUwVH6nXg8mnKtRaLwqpZnWtIVZzpA=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VC5BuE3QbCWd+QNwSWUSPv6zlR1k2sSlFqJJM5a0eWbQ/7v9D4PGsUccfObb9yUMAxtgAXb178CFd9kyNATN9GFzll6GWxY7JZb+HY7vCmpfX6COmBMvCnkH/wjpJy6jgV0saK/eAqVS5yjHChe9bRKfarAwiZj37CdFdcy8xM0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=jC0BdP6qjK16CGj3FE7A+ZRmnsK7iDVcXwqBqdRhPoz0d288JAO8Xwa4eY7enW9cBhTMHLXNYI657tlg6rOouiaA058UtD56WNngfHaKG+b3hbuLk0JZKwpXHq9oAKIAvGyFDEBYtg8fTHpB04CGLVpllYy1lKv8cb+dqHtkTsQ=; X-YMail-OSG: 4RUkJdkVM1mPRN5rVFeDa_GgTmWy2azgGuc7YTGs1i72K6. i2eR4VSeIFbo0ObpChx9vb.grVVNgGRYHNUt6Iuk_PPg_W3xbSD3Ie_9nX8E 9wax.1o3Zs4SWRopdmZQpAuMuKCadAReweOM_NK9lMG4QafUe3AwzqA3xlBp uHI8nJMvg7LowrevJc17My08ZyUpIrlS2aP4tElk3zUctGfotU5y3pizMiGF JfccPVH7LneEk9wR5jrG5tcTF7D.3bjLs3.ADznEC_ivQ3PGj3gRBy9Jr.fW 3UiWTJfH0iVOs3fbJan_jHY5SW6bI8obk.L0wN3HUUTId4twR_XGCXKy3RbQ 4db4VNHIDbWvLo1HuBnSo2G7vCpSGLag5eO5P7P36BL7FrXuFFlCPACRaPox wmDtyGDJ8vKRljQIwkfGR_oFwYwsUTyqwl0m0bMNLIgK5P1hEsa_5gqgZ5TF hemllGfWliwji8jWzcmngIa4ZZe9XI1v_3Oq5Bg0FDpK7OVT37S7c378hsm9 rC1zJ_Nmfj5v918mcyg-- Received: from [200.118.157.7] by web162102.mail.bf1.yahoo.com via HTTP; Sat, 02 Feb 2013 20:04:46 PST X-Rocket-MIMEInfo: 001.001, SGkgRWl0YW47CgoKLS0tLS0gTWVzc2FnZ2lvIG9yaWdpbmFsZSAtLS0tLQo.IERhOiBFaXRhbiBBZGxlcsKgCgo.IAo.IE9uIDIgRmVicnVhcnkgMjAxMyAyMDo1NCwgUGVkcm8gRi4gR2lmZnVuaSA8cGZnQGZyZWVic2Qub3JnPiB3cm90ZToKPj4gIEF1dGhvcjogcGZnCj4.ICBEYXRlOiBTdW4gRmViwqAgMyAwMTo1NDoyNSAyMDEzCj4.ICBOZXcgUmV2aXNpb246IDI0NjI3OAo.PiAgVVJMOiBodHRwOi8vc3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzI0NjI3OAo.PiAKPj4gIExvZzoKPj4gwqABMAEBAQE- X-RocketYMMF: giffunip X-Mailer: YahooMailWebService/0.8.131.499 References: <201302030154.r131sQZm084127@svn.freebsd.org> Message-ID: <1359864286.77306.YahooMailNeo@web162102.mail.bf1.yahoo.com> Date: Sat, 2 Feb 2013 20:04:46 -0800 (PST) From: Pedro Giffuni Subject: Re: svn commit: r246278 - head/usr.sbin/crunch/crunchide To: Eitan Adler In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Pedro Giffuni List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 04:04:54 -0000 Hi Eitan;=0A=0A=0A----- Messaggio originale -----=0A> Da: Eitan Adler=A0=0A= =0A> =0A> On 2 February 2013 20:54, Pedro F. Giffuni wrot= e:=0A>> Author: pfg=0A>> Date: Sun Feb=A0 3 01:54:25 2013=0A>> New Revis= ion: 246278=0A>> URL: http://svnweb.freebsd.org/changeset/base/246278=0A>>= =0A>> Log:=0A>> =A0 crunch: Sync some NetBSD changes=0A>> =0A>> =A0 Fix= a couple of free's in previous commit.=0A>> =0A>> =A0 Obtained from:=A0 = =A0 =A0 =A0 NetBSD=0A>> =A0 MFC after:=A0 =A0 1 week=0A>> =0A>> Modified:= =0A>> =A0 head/usr.sbin/crunch/crunchide/exec_elf32.c=0A>> =0A>> Modified= : head/usr.sbin/crunch/crunchide/exec_elf32.c=0A>> =0A> =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --= - head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb=A0 3 01:22:28 2013=A0= =A0 =0A> =A0 =A0 (r246277)=0A>> +++ head/usr.sbin/crunch/crunchide/exec_e= lf32.c Sun Feb=A0 3 01:54:25 2013=A0 =A0 =0A> =A0 =A0 (r246278)=0A>> @@ -3= 84,6 +384,8 @@ out:=0A>> =A0 =A0 =A0 =A0 if (symtabp !=3D NULL)=0A>> =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 free(symtabp);=0A>> =A0 =A0 =A0 =A0 if (strta= bp !=3D NULL)=0A>> +=A0 =A0 =A0 =A0 =A0 =A0 =A0 free(strtabp);=0A>> +=A0= =A0 =A0 if (nstrtabp !=3D NULL)=0A>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fre= e(nstrtabp);=0A> =0A> Why bother checking for NULL here?=A0 7.22.2.3.2 say= s that free(NULL)=0A> results in no action.=0A>=0A=0AYou are right. I was j= ust copying the NetBSD code blindly.=0A=0AI will clean that tomorrow when I= bring the mclinker fixes.=0A=0APedro.=A0=0A From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 06:52:56 2013 Return-Path: Delivered-To: svn-src-all@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 8CA4917A; Sun, 3 Feb 2013 06:52:56 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) by mx1.freebsd.org (Postfix) with ESMTP id 745299A6; Sun, 3 Feb 2013 06:52:55 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id gw10so3802103lab.27 for ; Sat, 02 Feb 2013 22:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=GvgPSKlDJib8ysXNi0iWbVjYdaaJcVU55Z/BQRYj9fI=; b=On7c/yZPlmcD4+HkhyqhUNLBYTDFOkXuZLuflMRWBjlne6dtmDjaBRp6jq652TTd7C T0UYEfds6/bNkvevbKuzV/c3c89Vi3pQOLCGnt5LQLTXgpteu5OoB9Jlj2ejVF/GkBLn g/ssBrfX4m2Iw1bkHU2ZBwo7BccPBDDD0OhUa1P4STwk22/MdqHcCPeQn4tgo0TQg07O lkJEEafad58D+rJxiqvX7oZ34soNzR+vebLAVZufuaY642MISgEpDFGyfEtJYpVIakLR BL+iOXXCOFsL/Xv9VhEtNXsDAyPLKqUyHZ3psTqyIbHZk+g0qCDbnCiH86RUa14W2Vx6 5Asg== X-Received: by 10.152.133.133 with SMTP id pc5mr15605726lab.32.1359874374446; Sat, 02 Feb 2013 22:52:54 -0800 (PST) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPS id t7sm4127419lbf.12.2013.02.02.22.52.52 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 02 Feb 2013 22:52:53 -0800 (PST) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.6/8.14.6) with ESMTP id r136qpb0001453; Sun, 3 Feb 2013 10:52:51 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.6/8.14.6/Submit) id r136qoOO001452; Sun, 3 Feb 2013 10:52:50 +0400 (MSK) (envelope-from dchagin) Date: Sun, 3 Feb 2013 10:52:50 +0400 From: Chagin Dmitry To: Alexander Leidinger Subject: Re: svn commit: r235063 - in head/sys: amd64/linux32 compat/linux i386/linux Message-ID: <20130203065250.GA1369@dchagin.static.corbina.net> References: <201205051942.q45Jgd3P071990@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <201205051942.q45Jgd3P071990@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 06:52:56 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 05, 2012 at 07:42:39PM +0000, Alexander Leidinger wrote: > Author: netchild > Date: Sat May 5 19:42:38 2012 > New Revision: 235063 > URL: http://svn.freebsd.org/changeset/base/235063 >=20 > Log: > - >500 static DTrace probes for the linuxulator > - DTrace scripts to check for errors, performance, ... > they serve mostly as examples of what you can do with the static prob= e;s > with moderate load the scripts may be overwhelmed, excessive lock-tra= cing > may influence program behavior (see the last design decission) > =20 > Design decissions: > - use "linuxulator" as the provider for the native bitsize; add the > bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) > - Add probes only for locks which are acquired in one function and rel= eased > in another function. Locks which are aquired and released in the same > function should be easy to pair in the code, inter-function > locking is more easy to verify in DTrace. > - Probes for locks should be fired after locking and before releasing = to > prevent races (to provide data/function stability in DTrace, see the > man-page of "dtrace -v ..." and the corresponding DTrace docs). Hi, what about to merge this to 9, 8?=20 >=20 --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlEOCUIACgkQ0t2Tb3OO/O28ogCgpKm1kkRTC87x27sbE15P7qnh ZAkAnjCLc6gDwJXN0lQ+mgK4o/8qA2Ec =VO0u -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 07:27:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4562342E; Sun, 3 Feb 2013 07:27:52 +0000 (UTC) (envelope-from jase@FreeBSD.org) Received: from svr06-mx.btshosting.co.uk (mx-2.btshosting.co.uk [178.63.196.248]) by mx1.freebsd.org (Postfix) with ESMTP id E5C33A6C; Sun, 3 Feb 2013 07:27:51 +0000 (UTC) Received: from [192.168.1.65] (5e0cd374.bb.sky.com [94.12.211.116]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id E391B34840; Sun, 3 Feb 2013 07:27:43 +0000 (UTC) Message-ID: <510E116C.1060009@FreeBSD.org> Date: Sun, 03 Feb 2013 07:27:40 +0000 From: Jase Thew Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r246239 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201302021120.r12BKbGX020113@svn.freebsd.org> In-Reply-To: <201302021120.r12BKbGX020113@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 07:27:52 -0000 On 02/02/2013 11:20, Andriy Gapon wrote: > Author: avg > Date: Sat Feb 2 11:20:36 2013 > New Revision: 246239 > URL: http://svnweb.freebsd.org/changeset/base/246239 > > Log: > MFC r245945: spa_generate_rootconf: add support for old vdev labels > Thanks! -- Jase Thew jase@FreeBSD.org FreeBSD Ports Committer From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 09:18:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42278CEA; Sun, 3 Feb 2013 09:18:59 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0231DE6C; Sun, 3 Feb 2013 09:18:58 +0000 (UTC) Received: from outgoing.leidinger.net (p57A39717.dip.t-dialin.net [87.163.151.23]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id AC2EF84406A; Sun, 3 Feb 2013 10:18:48 +0100 (CET) Received: from unknown (Titan.Leidinger.net [192.168.1.17]) by outgoing.leidinger.net (Postfix) with ESMTP id 1E72A537E; Sun, 3 Feb 2013 10:18:46 +0100 (CET) Date: Sun, 3 Feb 2013 10:18:44 +0100 From: Alexander Leidinger To: Chagin Dmitry Subject: Re: svn commit: r235063 - in head/sys: amd64/linux32 compat/linux i386/linux Message-ID: <20130203101844.00000ba1@unknown> In-Reply-To: <20130203065250.GA1369@dchagin.static.corbina.net> References: <201205051942.q45Jgd3P071990@svn.freebsd.org> <20130203065250.GA1369@dchagin.static.corbina.net> X-Mailer: Claws Mail 3.9.0cvs12 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: AC2EF84406A.A566C X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.12, required 6, autolearn=disabled, ALL_TRUSTED -1.00, AWL -0.19, TW_SV 0.08, T_RP_MATCHES_RCVD -0.01) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1360487929.31937@HjfB2tR+U2EGg/3BbXhaKA X-EBL-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Leidinger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 09:18:59 -0000 On Sun, 3 Feb 2013 10:52:50 +0400 Chagin Dmitry wrote: > On Sat, May 05, 2012 at 07:42:39PM +0000, Alexander Leidinger wrote: > > Author: netchild > > Date: Sat May 5 19:42:38 2012 > > New Revision: 235063 > > URL: http://svn.freebsd.org/changeset/base/235063 > > > > Log: > > - >500 static DTrace probes for the linuxulator > Hi, what about to merge this to 9, 8? Theoretically it should be easy to merge, but it depends upon some fixes to the dtrace code to DTRT (no crash) when the dtrace module is unloaded while other dtrace providers like the linuxulator-ones stay in the kernel. I don't know if those fixes are in 9 or 8. Apart from that I'm low on time, my time slots for FreeBSD are already reserved for some other things. I don't mind if someone else merges this (after verifying that the required dtrace fixes are merged). Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 09:57:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71C3B2D7; Sun, 3 Feb 2013 09:57:40 +0000 (UTC) (envelope-from avg@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 4BA63F67; Sun, 3 Feb 2013 09: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 r139veMU027216; Sun, 3 Feb 2013 09:57:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r139vd8n027213; Sun, 3 Feb 2013 09:57:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302030957.r139vd8n027213@svn.freebsd.org> From: Andriy Gapon Date: Sun, 3 Feb 2013 09:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246282 - in head/sys: conf kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 09:57:40 -0000 Author: avg Date: Sun Feb 3 09:57:39 2013 New Revision: 246282 URL: http://svnweb.freebsd.org/changeset/base/246282 Log: allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9) Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM), the static ktr_buf_init is used. Size of the static buffer is determined by a new kernel option KTR_BOOT_ENTRIES. Its default value is 1024. This commit builds on top of r243046. Reviewed by: alc MFC after: 17 days Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_ktr.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Feb 3 03:46:16 2013 (r246281) +++ head/sys/conf/NOTES Sun Feb 3 09:57:39 2013 (r246282) @@ -446,6 +446,8 @@ options KTRACE_REQUEST_POOL=101 # KTR is a kernel tracing facility imported from BSD/OS. It is # enabled with the KTR option. KTR_ENTRIES defines the number of # entries in the circular trace buffer; it may be an arbitrary number. +# KTR_BOOT_ENTRIES defines the number of entries during the early boot, +# before malloc(9) is functional. # KTR_COMPILE defines the mask of events to compile into the kernel as # defined by the KTR_* constants in . KTR_MASK defines the # initial value of the ktr_mask variable which determines at runtime @@ -459,7 +461,8 @@ options KTRACE_REQUEST_POOL=101 # if KTR_VERBOSE is not defined. See ktr(4) and ktrdump(8) for details. # options KTR -options KTR_ENTRIES=1024 +options KTR_BOOT_ENTRIES=1024 +options KTR_ENTRIES=(128 * 1024) options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR options KTR_CPUMASK=0x3 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Feb 3 03:46:16 2013 (r246281) +++ head/sys/conf/options Sun Feb 3 09:57:39 2013 (r246282) @@ -669,6 +669,7 @@ KTR_ALQ opt_ktr.h KTR_MASK opt_ktr.h KTR_CPUMASK opt_ktr.h KTR_COMPILE opt_global.h +KTR_BOOT_ENTRIES opt_global.h KTR_ENTRIES opt_global.h KTR_VERBOSE opt_ktr.h WITNESS opt_global.h Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Sun Feb 3 03:46:16 2013 (r246281) +++ head/sys/kern/kern_ktr.c Sun Feb 3 09:57:39 2013 (r246282) @@ -66,6 +66,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifndef KTR_BOOT_ENTRIES +#define KTR_BOOT_ENTRIES 1024 +#endif + #ifndef KTR_ENTRIES #define KTR_ENTRIES 1024 #endif @@ -96,9 +100,9 @@ FEATURE(ktr, "Kernel support for KTR ker volatile int ktr_idx = 0; int ktr_mask = KTR_MASK; int ktr_compile = KTR_COMPILE; -int ktr_entries = KTR_ENTRIES; +int ktr_entries = KTR_BOOT_ENTRIES; int ktr_version = KTR_VERSION; -struct ktr_entry ktr_buf_init[KTR_ENTRIES]; +struct ktr_entry ktr_buf_init[KTR_BOOT_ENTRIES]; struct ktr_entry *ktr_buf = ktr_buf_init; cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); static char ktr_cpumask_str[CPUSETBUFSIZ]; @@ -194,6 +198,28 @@ SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, sysctl_debug_ktr_mask, "IU", "Bitmask of KTR event classes for which logging is enabled"); +#if KTR_ENTRIES != KTR_BOOT_ENTRIES +/* + * A simplified version of sysctl_debug_ktr_entries. + * No need to care about SMP, scheduling, etc. + */ +static void +ktr_entries_initializer(void *dummy __unused) +{ + int mask; + + /* Temporarily disable ktr in case malloc() is being traced. */ + mask = ktr_mask; + ktr_mask = 0; + ktr_buf = malloc(sizeof(*ktr_buf) * KTR_ENTRIES, M_KTR, + M_WAITOK | M_ZERO); + ktr_entries = KTR_ENTRIES; + ktr_mask = mask; +} +SYSINIT(ktr_entries_initializer, SI_SUB_KMEM, SI_ORDER_ANY, + ktr_entries_initializer, NULL); +#endif + static int sysctl_debug_ktr_entries(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 10:23:24 2013 Return-Path: Delivered-To: svn-src-all@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 BAEA8935; Sun, 3 Feb 2013 10:23:24 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-la0-x229.google.com (la-in-x0229.1e100.net [IPv6:2a00:1450:4010:c03::229]) by mx1.freebsd.org (Postfix) with ESMTP id A1FCDD1; Sun, 3 Feb 2013 10:23:23 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id fo12so3851709lab.14 for ; Sun, 03 Feb 2013 02:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=CIzaeLPO5lAR1EdoXp9PkKfgj2oCMlJ1tJ037nwnjpw=; b=SXgzsleX6+hH3AeGuMIv9HeQLaReTv/DxQ0ABJmWLG8rv3wrA3tlYbwVQxSmGcaxt9 iP2u/UxPp7p63LbWbPbYivqb4/BCSiYG5CcgCsf8P9dUB4XOTXaQF3w8h3zNX3zqOKLu h5K/LgXV2MH5hZ5kCXXd4kkcE7DvdQe+mXe1U6eUY+idfCn2crkmJ2N5fo5VGjurLxRV wpg5PBSjKtnYLzWb3iY/XvXDj9TkfgDlm2kpPBbAtWTu2q7F1FOQ0mPYh1gtwq50+fVt 2Ij6O/P/KqX/HHCQA2EOzhlJcBqqcR2lRKFuxuW06uonW+kPsdaYK+oqEmPsw+2nzXsB iOkA== X-Received: by 10.112.25.198 with SMTP id e6mr6879571lbg.63.1359887001492; Sun, 03 Feb 2013 02:23:21 -0800 (PST) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPS id j9sm4273412lbd.13.2013.02.03.02.23.19 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Feb 2013 02:23:20 -0800 (PST) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.6/8.14.6) with ESMTP id r13ANIv8002026; Sun, 3 Feb 2013 14:23:18 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.6/8.14.6/Submit) id r13ANHvx002025; Sun, 3 Feb 2013 14:23:17 +0400 (MSK) (envelope-from dchagin) Date: Sun, 3 Feb 2013 14:23:17 +0400 From: Chagin Dmitry To: Alexander Leidinger Subject: Re: svn commit: r235063 - in head/sys: amd64/linux32 compat/linux i386/linux Message-ID: <20130203102316.GA1980@dchagin.static.corbina.net> References: <201205051942.q45Jgd3P071990@svn.freebsd.org> <20130203065250.GA1369@dchagin.static.corbina.net> <20130203101844.00000ba1@unknown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <20130203101844.00000ba1@unknown> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Leidinger , Chagin Dmitry X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 10:23:24 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 03, 2013 at 10:18:44AM +0100, Alexander Leidinger wrote: > On Sun, 3 Feb 2013 10:52:50 +0400 > Chagin Dmitry wrote: >=20 > > On Sat, May 05, 2012 at 07:42:39PM +0000, Alexander Leidinger wrote: > > > Author: netchild > > > Date: Sat May 5 19:42:38 2012 > > > New Revision: 235063 > > > URL: http://svn.freebsd.org/changeset/base/235063 > > >=20 > > > Log: > > > - >500 static DTrace probes for the linuxulator >=20 > > Hi, what about to merge this to 9, 8?=20 >=20 > Theoretically it should be easy to merge, but it depends upon some > fixes to the dtrace code to DTRT (no crash) when the dtrace module is > unloaded while other dtrace providers like the linuxulator-ones stay in > the kernel. I don't know if those fixes are in 9 or 8. >=20 > Apart from that I'm low on time, my time slots for FreeBSD are already > reserved for some other things. >=20 > I don't mind if someone else merges this (after verifying that the > required dtrace fixes are merged). >=20 Thank you! --=20 Have fun! chd --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlEOOpQACgkQ0t2Tb3OO/O1QngCfTFC6ZiaBCfvJp2CQi9qevZmR zYQAoIpIn0av2jgSo8Jfk3s33aFqLibU =5S9Q -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 10:23:29 2013 Return-Path: Delivered-To: svn-src-all@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 0345E938; Sun, 3 Feb 2013 10:23:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AC75DD2; Sun, 3 Feb 2013 10:23:27 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA07096; Sun, 03 Feb 2013 12:23:26 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U1wjN-0006CQ-Sm; Sun, 03 Feb 2013 12:23:25 +0200 Message-ID: <510E3A9D.7040005@FreeBSD.org> Date: Sun, 03 Feb 2013 12:23:25 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r246251 - head/sys/dev/acpica References: <201302021244.r12CiKgj046079@svn.freebsd.org> <20130202125122.GA4975@FreeBSD.org> <20130202151137.GA28366@FreeBSD.org> In-Reply-To: <20130202151137.GA28366@FreeBSD.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 10:23:29 -0000 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. >> >> Hmm, I was annoyed by this bug for a while. Will try to test it with >> 8-stable tonight, thanks! > > Andriy, it appears to me that ACPI code is substantially different between > 8-stable and head, so the patch cannot be applied as is. I'm not sure where > exactly inside acpi_EnterSleepState() does it belong. Could you provide me > with some guidance (or even patch for 8-stable)? Thanks. Yes, this is unfortunately so. It seems that some fellow developers who hack on ACPI-related code prefer to not MFC at all. I am not ready yet to provide a stable/8 patch and may give up on MFC to stable/8 altogether. P.S. logically the new block of code seems to belong to acpi_sleep_machdep() before intr_restore() call. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 10:26:27 2013 Return-Path: Delivered-To: svn-src-all@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 4A3DEC35; Sun, 3 Feb 2013 10:26:27 +0000 (UTC) (envelope-from hrs@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 1F767F5; Sun, 3 Feb 2013 10:26: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 r13AQR01036318; Sun, 3 Feb 2013 10:26:27 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13AQPo7036308; Sun, 3 Feb 2013 10:26:25 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201302031026.r13AQPo7036308@svn.freebsd.org> From: Hiroki Sato Date: Sun, 3 Feb 2013 10:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246283 - in head: . release release/amd64 release/i386 release/ia64 release/pc98 release/powerpc release/sparc64 share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 10:26:27 -0000 Author: hrs Date: Sun Feb 3 10:26:24 2013 New Revision: 246283 URL: http://svnweb.freebsd.org/changeset/base/246283 Log: - Add CHECKSUM.* support in Makefile[1]. - Use ln -fs to create a symlink. - Remove pkgadd for docports. - Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no. - Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE. - Use makefs(8) and gpart(8) for sparc64 ISO image[2]. - Add publisher option to makefs(8)[2]. Based on work by: gjb[1] Discussed with: marius, nwhitehorn[2] Modified: head/Makefile.inc1 head/release/Makefile head/release/amd64/mkisoimages.sh head/release/generate-release.sh head/release/i386/mkisoimages.sh head/release/ia64/mkisoimages.sh head/release/pc98/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/sparc64/mkisoimages.sh head/share/man/man7/release.7 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Feb 3 09:57:39 2013 (r246282) +++ head/Makefile.inc1 Sun Feb 3 10:26:24 2013 (r246283) @@ -27,6 +27,8 @@ # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians # BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) +# WORLD_FLAGS= additional flags to pass to make(1) during buildworld +# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel # # The intended user-driven targets are: @@ -245,7 +247,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/i MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ COMPILER_TYPE=${COMPILER_TYPE} BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ - ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ + ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ @@ -255,7 +257,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ - ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ + ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ @@ -288,7 +290,7 @@ WMAKE_COMPILER_TYPE= gcc WMAKE_COMPILER_TYPE= clang .endif WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} -WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} +WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" # 32 bit world @@ -378,7 +380,7 @@ IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFL # kernel stage KMAKEENV= ${WMAKEENV} -KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} +KMAKE= ${KMAKEENV} ${MAKE} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} # # buildworld Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/Makefile Sun Feb 3 10:26:24 2013 (r246283) @@ -34,6 +34,20 @@ TARGET_ARCH?= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist +# Define OSRELEASE by using newvars.sh +.if !defined(OSRELEASE) || empty(OSRELEASE) +.for _V in TYPE BRANCH REVISION +${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} +.endfor +.for _V in ${TARGET_ARCH} +.if !empty(TARGET:M${_V}) +OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} +.else +OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} +.endif +.endfor +.endif + .if !exists(${DOCDIR}) NODOC= true .endif @@ -117,7 +131,7 @@ system: packagesystem cp reldoc/* release .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf + ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf echo sendmail_enable=\"NONE\" > release/etc/rc.conf echo hostid_enable=\"NO\" >> release/etc/rc.conf cp ${.CURDIR}/rc.local release/etc @@ -142,7 +156,7 @@ bootonly: packagesystem cp reldoc/* bootonly .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf + ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc @@ -183,4 +197,9 @@ install: .if defined(DESTDIR) && !empty(DESTDIR) mkdir -p ${DESTDIR} .endif - cp -a ${IMAGES} ftp ${DESTDIR}/ + cp -a ftp ${DESTDIR}/ +.for I in ${IMAGES} + cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} +.endfor + cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 + cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/amd64/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -39,6 +39,7 @@ fi LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/generate-release.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -3,191 +3,98 @@ # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh [-r revision] [-d docrevision] \ -# [-p portsrevision] svn-branch scratch-dir +# Usage: generate-release.sh svn-branch[@revision] scratch-dir # # Environment variables: -# SVNROOT: SVN URL to FreeBSD source repository (by default, -# svn://svn.freebsd.org/base) -# MAKE_FLAGS: optional flags to pass to make (e.g. -j) -# RELSTRING: optional base name for media images (e.g. FreeBSD-9.0-RC2-amd64) -# -# Note: Since this requires a chroot, release cross-builds will not work! +# SVNROOTBASE: SVN base URL to FreeBSD repository (svn://svn.freebsd.org) +# SVNROOTSRC: URL to FreeBSD src tree (${SVNROOTBASE}/base) +# SVNROOTDOC: URL to FreeBSD doc tree (${SVNROOTBASE}/doc) +# SVNROOTPORTS:URL to FreeBSD ports tree (${SVNROOTBASE}/ports) +# BRANCHSRC: branch name of src (svn-branch[@revision]) +# BRANCHDOC: branch name of doc (head) +# BRANCHPORTS: branch name of ports (head) +# WORLD_FLAGS: optional flags to pass to buildworld (e.g. -j) +# KERNEL_FLAGS: optional flags to pass to buildkernel (e.g. -j) # # $FreeBSD$ # -unset B_ARCH -unset ARCH -unset MACHINE_ARCH - -HOST_ARCH=`uname -p` - usage() { - echo "Usage: $0 [-a arch] [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + echo "Usage: $0 svn-branch[@revision] scratch-dir" 2>&1 exit 1 } -arch_error () -{ - echo "Architecture ${OPTARG} cannot be built on host architecture ${HOST_ARCH}" - exit 1 -} - -REVISION= -DOCREVISION= -PORTSREVISION= -while getopts a:d:r:p: opt; do - case $opt in - a) - case "${OPTARG}" in - i386|amd64) - if [ "${HOST_ARCH}" != "amd64" ]; then - arch_error "${OPTARG}" - fi - ;; - powerpc|powerpc64) - if [ "${HOST_ARCH}" != "powerpc64" ]; then - arch_error "${OPTARG}" - fi - ;; - *) - arch_error "${OPTARG}" - ;; - esac - B_ARCH="$OPTARG" - ;; - d) - DOCREVISION="-r $OPTARG" - ;; - r) - REVISION="-r $OPTARG" - ;; - p) - PORTSREVISION="-r $OPTARG" - ;; - \?) - usage - ;; - esac -done -shift $(($OPTIND - 1)) - -# If target architecture is not specified, use hw.machine_arch -if [ "x${B_ARCH}" == "x" ]; then - B_ARCH="${HOST_ARCH}" -fi -ARCH_FLAGS="ARCH=${B_ARCH} TARGET_ARCH=${B_ARCH}" - if [ $# -lt 2 ]; then usage fi -if [ $(id -u) -ne 0 ]; then - echo "Needs to be run as root." +: ${SVNROOTBASE:=svn://svn.freebsd.org} +: ${SVNROOTSRC:=${SVNROOTBASE}/base} +: ${SVNROOTDOC:=${SVNROOTBASE}/doc} +: ${SVNROOTPORTS:=${SVNROOTBASE}/ports} +: ${SVNROOT:=${SVNROOTSRC}} # for backward compatibility +: ${SVN_CMD:=/usr/local/bin/svn} +BRANCHSRC=$1 +: ${BRANCHDOC:=head} +: ${BRANCHPORTS:=head} +: ${WORLD_FLAGS:=${MAKE_FLAGS}} +: ${KERNEL_FLAGS:=${MAKE_FLAGS}} +: ${CHROOTDIR:=$2} + +if [ ! -r "${CHROOTDIR}" ]; then + echo "${CHROOTDIR}: scratch dir not found." exit 1 fi -set -e # Everything must succeed - -case $MAKE_FLAGS in - *-j*) - ;; - *) - MAKE_FLAGS="$MAKE_FLAGS -j "$(sysctl -n hw.ncpu) - ;; +CHROOT_CMD="/usr/sbin/chroot ${CHROOTDIR}" +case ${TARGET} in +"") ;; +*) SETENV_TARGET="TARGET=$TARGET" ;; esac +case ${TARGET_ARCH} in +"") ;; +*) SETENV_TARGET_ARCH="TARGET_ARCH=$TARGET_ARCH" ;; +esac +SETENV="env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin" +CROSSENV="${SETENV_TARGET} ${SETENV_TARGET_ARCH}" +WMAKE="make -C /usr/src ${WORLD_FLAGS}" +NWMAKE="${WMAKE} __MAKE_CONF=/dev/null SRCCONF=/dev/null" +KMAKE="make -C /usr/src ${KERNEL_FLAGS}" +RMAKE="make -C /usr/src/release" -mkdir -p $2/usr/src - -svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION -svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION -svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION - -cd $2/usr/src -make $MAKE_FLAGS ${ARCH_FLAGS} buildworld -make $ARCH_FLAGS installworld distribution DESTDIR=$2 -mount -t devfs devfs $2/dev -trap "umount $2/dev" EXIT # Clean up devfs mount on exit - -# Most commands below are run in chroot, so fake getosreldate(3) right now -OSVERSION=$(grep '#define __FreeBSD_version' $2/usr/include/sys/param.h | awk '{print $3}') -export OSVERSION -BRANCH=$(grep '^BRANCH=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') -BRANCH=`echo ${BRANCH} | sed -e 's,",,g'` -REVISION=$(grep '^REVISION=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') -REVISION=`echo ${REVISION} | sed -e 's,",,g'` -OSRELEASE="${REVISION}-${BRANCH}" - -pkgng_install_docports () -{ - # Attempt to install docproj port from pkgng package. - chroot ${CHROOTDIR} /bin/sh -c 'env ASSUME_ALWAYS_YES=1 /usr/sbin/pkg install -y docproj-nojadetex' - # Check if docproj was installed, since pkg(8) returns '0' if unable - # to install a package from the repository. If it is not installed, - # fallback to installing using pkg_add(1). - chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg info -q docproj-nojadetex' || \ - pkgadd_install_docports -} - -build_compat9_port () -{ - chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/misc/compat9x BATCH=yes install clean' -} +if [ $(id -u) -ne 0 ]; then + echo "Needs to be run as root." + exit 1 +fi -pkgadd_install_docports () -{ - # Attempt to install docproj package with pkg_add(1). - # If not successful, build the docproj port. - if [ "${REVISION}" == "10.0" ]; then - # Packages for 10-CURRENT are still located in the 9-CURRENT - # directory. Override environment to use correct package - # location if building for 10-CURRENT. - PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/Latest/" - export PACKAGESITE - PACKAGEROOT="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/" - export PACKAGEROOT - PKG_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/All/" - export PKG_PATH - build_compat9_port - fi - chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg_add -r docproj-nojadetex' || \ - build_docports -} +set -e # Everything must succeed -build_docports() -{ - # Could not install textproc/docproj from pkg(8) or pkg_add(1). Build - # the port as final fallback. - chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITHOUT_SVN=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ - { echo "*** Could not build the textproj/docproj port. Exiting."; exit 2; } -} +mkdir -p ${CHROOTDIR}/usr/src +${SVN_CMD} co ${SVNROOT}/${BRANCHSRC} ${CHROOTDIR}/usr/src +${SVN_CMD} co ${SVNROOTDOC}/${BRANCHDOC} ${CHROOTDIR}/usr/doc +${SVN_CMD} co ${SVNROOTPORTS}/${BRANCHPORTS} ${CHROOTDIR}/usr/ports + +${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src ${WORLD_FLAGS} buildworld +${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src installworld distribution DESTDIR=${CHROOTDIR} +mount -t devfs devfs ${CHROOTDIR}/dev +trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit -if [ -d $2/usr/doc ]; then - cp /etc/resolv.conf $2/etc/resolv.conf +if [ -d ${CHROOTDIR}/usr/doc ]; then + cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf # Install docproj to build release documentation - CHROOTDIR="$2" - set +e - pkgng_install_docports "${CHROOTDIR}" - set -e -fi - -chroot $2 make -C /usr/src $MAKE_FLAGS ${ARCH_FLAGS} buildworld buildkernel -chroot $2 make -C /usr/src/release ${ARCH_FLAGS} release -chroot $2 make -C /usr/src/release install DESTDIR=/R - -if [ "x${OSVERSION}" == "x" ]; then - OSRELEASE=`chroot $2 uname -r` + ${CHROOT_CMD} /bin/sh -c \ + 'make -C /usr/ports/textproc/docproj \ + BATCH=yes \ + WITHOUT_SVN=yes \ + WITHOUT_JADETEX=yes \ + WITHOUT_X11=yes \ + WITHOUT_PYTHON=yes \ + install' fi -: ${RELSTRING=`chroot $2 uname -s`-${OSRELEASE}-${B_ARCH}} - -cd $2/R -for i in release.iso bootonly.iso memstick; do - mv $i $RELSTRING-$i -done -sha256 $RELSTRING-* > CHECKSUM.SHA256 -md5 $RELSTRING-* > CHECKSUM.MD5 - +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${WMAKE} buildworld +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${KMAKE} buildkernel +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${RMAKE} release +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${RMAKE} install DESTDIR=/R Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/i386/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -39,6 +39,7 @@ fi LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/ia64/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -75,8 +75,9 @@ else BOOTOPTS="" fi +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $BASE/etc/fstab -makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL $NAME $BASE $* +makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $BASE $* rm $BASE/etc/fstab rm -f $EFIPART exit 0 Modified: head/release/pc98/mkisoimages.sh ============================================================================== --- head/release/pc98/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/pc98/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -39,6 +39,7 @@ fi LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/powerpc/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -61,9 +61,9 @@ fi LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab rm /tmp/hfs-boot-block rm -rf $1/ppc - Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Sun Feb 3 09:57:39 2013 (r246282) +++ head/release/sparc64/mkisoimages.sh Sun Feb 3 10:26:24 2013 (r246283) @@ -22,51 +22,61 @@ # resulting ISO image, base-bits-dir contains the image contents and # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. - -publisher="The FreeBSD Project. http://www.freebsd.org/" -IMG=/tmp/bootfs -MNT=/mnt - -if [ "x$1" = "x-b" ]; then - dd if=/dev/zero of=${IMG} bs=512 count=1024 - MD=`mdconfig -a -t vnode -f ${IMG}` - sunlabel -w -B -b $4/boot/boot1 ${MD} auto - newfs -O1 -o space -m 0 /dev/${MD} - mount /dev/${MD} ${MNT} - mkdir ${MNT}/boot - cp $4/boot/loader ${MNT}/boot - umount ${MNT} - mdconfig -d -u ${MD#md} - bootable="-B ,,,,${IMG}" - shift -else - bootable="" -fi - if [ $# -lt 3 ]; then - echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' - rm -f ${IMG} + echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' > /dev/stderr exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - +case $1 in +-b) BOPT=$1; shift ;; +esac LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +# Create an ISO image +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 -B be -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* rm $1/etc/fstab -rm -f ${IMG} + +if [ "x$BOPT" != "x-b" ]; then + mv ${NAME}.tmp ${NAME} + exit 0 +fi +TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1 +BOOTFSDIR="${TMPIMGDIR}/bootfs" +BOOTFSIMG="${TMPIMGDIR}/bootfs.img" + +# Create a boot filesystem +mkdir -p "${BOOTFSDIR}/boot" +cp $4/boot/loader "${BOOTFSDIR}/boot" +makefs -t ffs -B be -M 512k "${BOOTFSIMG}" "${BOOTFSDIR}" +dd if=$4/boot/boot1 of="${BOOTFSIMG}" bs=512 conv=notrunc,sync + +# Create a boot ISO image +: ${CYLSIZE:=640} +ISOSIZE=$(stat -f %z ${NAME}.tmp) +ISOBLKS=$(((${ISOSIZE} + 511) / 512)) +ISOCYLS=$(((${ISOBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE})) + +BOOTFSSIZE=$(stat -f %z "${BOOTFSIMG}") +BOOTFSBLKS=$(((${BOOTFSSIZE} + 511) / 512)) +BOOTFSCYLS=$(((${BOOTFSBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE})) + +ENDCYL=$((${ISOCYLS} + ${BOOTFSCYLS})) +NSECTS=$((${ENDCYL} * 1 * ${CYLSIZE})) + +dd if=${NAME}.tmp of=${NAME} bs=${CYLSIZE}b conv=notrunc,sync +dd if=${BOOTFSIMG} of=${NAME} bs=${CYLSIZE}b seek=${ISOCYLS} conv=notrunc,sync +# The number of alternative cylinders is always 2. +dd if=/dev/zero of=${NAME} bs=${CYLSIZE}b seek=${ENDCYL} count=2 conv=notrunc,sync +rm -rf ${NAME}.tmp ${TMPIMGDIR} + +# Write VTOC8 label to boot ISO image +MD=`mdconfig -a -t vnode -S 512 -y 1 -x ${CYLSIZE} -f ${NAME}` +gpart create -s VTOC8 ${MD} +# !4: usr, for ISO image part +gpart add -i 1 -s $((${ISOCYLS} * ${CYLSIZE} * 512))b -t \!4 ${MD} +# !2: root, for bootfs part. +gpart add -i 6 -s $((${BOOTFSCYLS} * ${CYLSIZE} * 512))b -t \!2 ${MD} +mdconfig -d -u ${MD#md} Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Sun Feb 3 09:57:39 2013 (r246282) +++ head/share/man/man7/release.7 Sun Feb 3 10:26:24 2013 (r246283) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2013 +.Dd February 3, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -116,26 +116,40 @@ Note that because this uses a chroot, it .Fx release media. .Pp -Environment variables: -.Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev MAKE_FLAGS +Optional environment variables: +.Bl -tag -width ".Cm WORLD_FLAGS" +.It Ev WORLD_FLAGS This environment variable can be set to pass flags (e.g. -j) to .Xr make 1 -when invoked by the script. -.It Ev SVNROOT -The location of the FreeBSD SVN source, doc, and ports repositories. +when invoked to build a world by the script. +.It Ev KERNEL_FLAGS +This environment variable can be set to pass flags (e.g. -j) to +.Xr make 1 +when invoked to build a kernel by the script. +.It Ev SVNROOTBASE +The base part of URL of the FreeBSD SVN repositories. Defaults to -.Pa svn://svn.freebsd.org/base -for the source tree, -.Pa svn://svn.freebsd.org/ports/head -for the Ports Collection, and -.Pa svn://svn.freebsd.org/doc/head -for the Documentation Project source. -.It Ev RELSTRING -Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). -Defaults to the output of -.Ic `uname -s`-`uname -r`-`uname -p` -within the chroot. +.Pa svn://svn.freebsd.org . +.It Ev SVNROOTSRC +The URL of the FreeBSD SVN source repository. +Defaults to +.Pa ${SVNROOTBASE}/base . +.It Ev SVNROOTDOC +The URL of the FreeBSD SVN doc repository. +Defaults to +.Pa ${SVNROOTBASE}/doc . +.It Ev SVNROOTPORTS +The URL of the FreeBSD SVN ports repository. +Defaults to +.Pa ${SVNROOTBASE}/ports . +.It Ev BRANCHDOC +The branch name of the FreeBSD SVN doc repository. +Defaults to +.Pa head . +.It Ev BRANCHPORTS +The branch name of the FreeBSD SVN ports repository. +Defaults to +.Pa head . .El .Sh MAKEFILE TARGETS The release makefile @@ -155,15 +169,12 @@ platform. Copy all produced release media to .Pa ${DESTDIR} . .It Cm cdrom -Builds installation CD-ROM images. On some systems, this may require that -.Xr mkisofs 8 -be installed -.Pq Pa sysutils/cdrtools -and possibly that the +Builds installation CD-ROM images. +This may require the .Xr md 4 (memory disk) device driver be present in the kernel -(either by being compiled in or available as a module). This target -produces files called +(either by being compiled in or available as a module). +This target produces files called .Pa release.iso and .Pa bootonly.iso @@ -171,7 +182,8 @@ as its output. .It Cm memstick Builds an installation memory stick image named .Pa memstick . -Not applicable on all platforms. Requires that the +Not applicable on all platforms. +Requires that the .Xr md 4 (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). @@ -207,27 +219,32 @@ target invoked by .El .Sh ENVIRONMENT Optional variables: -.Bl -tag -width ".Va TARGET_ARCH" -.It Va WORLDDIR +.Bl -tag -width ".Ev TARGET_ARCH" +.It Ev OSRELEASE +Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). +Defaults to the output of +.Ic `uname -s`-`uname -r`-`uname -p` +within the chroot. +.It Ev WORLDDIR Location of a directory containing the src tree. By default, the directory above the one containing the makefile .Pq Pa src . -.It Va PORTSDIR +.It Ev PORTSDIR Location of a directory containing the ports tree. By default, .Pa /usr/ports . If it is unset or cannot be found, ports will not be included in the release. -.It Va DOCDIR +.It Ev DOCDIR Location of a directory containing the doc tree. By default, .Pa /usr/doc . If it is unset or cannot be found, most documentation will not be included in the release; see .Ev NODOC below. -.It Va NOPORTS +.It Ev NOPORTS If defined, the Ports Collection will be omitted from the release. -.It Va NOSRC +.It Ev NOSRC If set, do not include system source code in the release. -.It Va NODOC +.It Ev NODOC If defined, the XML-based documentation from the .Fx Documentation Project will not be built. @@ -236,33 +253,33 @@ However, the distribution will still be created with the minimal documentation set provided in .Pa src/share/doc . -.It Va TARGET +.It Ev TARGET The target hardware platform. This is analogous to the .Dq Nm uname Fl m output. This is necessary to cross-build some target architectures. For example, cross-building for PC98 machines requires -.Va TARGET_ARCH Ns = Ns Li i386 +.Ev TARGET_ARCH Ns = Ns Li i386 and -.Va TARGET Ns = Ns Li pc98 . +.Ev TARGET Ns = Ns Li pc98 . If not set, -.Va TARGET +.Ev TARGET defaults to the current hardware platform. -.It Va TARGET_ARCH +.It Ev TARGET_ARCH The target machine processor architecture. This is analogous to the .Dq Nm uname Fl p output. Set this to cross-build for a different architecture. If not set, -.Va TARGET_ARCH +.Ev TARGET_ARCH defaults to the current machine architecture, unless -.Va TARGET +.Ev TARGET is also set, in which case it defaults to the appropriate value for that platform. Typically, one only needs to set -.Va TARGET . +.Ev TARGET . .El .Sh FILES .Bl -tag -compact -width Pa @@ -299,7 +316,6 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export SVNROOT=svn://svn.freebsd.org/base sh generate-release.sh head /local3/release .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 12:17:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DA29E4B; Sun, 3 Feb 2013 12:17:51 +0000 (UTC) (envelope-from trasz@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 215D7632; Sun, 3 Feb 2013 12:17: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 r13CHpuG069453; Sun, 3 Feb 2013 12:17:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13CHnX5069446; Sun, 3 Feb 2013 12:17:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302031217.r13CHnX5069446@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 3 Feb 2013 12:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246284 - in stable/9: sbin/dumpfs sbin/growfs sbin/newfs sys/geom/label sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 12:17:51 -0000 Author: trasz Date: Sun Feb 3 12:17:49 2013 New Revision: 246284 URL: http://svnweb.freebsd.org/changeset/base/246284 Log: MFC r242379: Fix problem with geom_label(4) not recognizing UFS labels on filesystems extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation Modified: stable/9/sbin/dumpfs/dumpfs.c stable/9/sbin/growfs/growfs.c stable/9/sbin/newfs/mkfs.c stable/9/sbin/newfs/newfs.c stable/9/sbin/newfs/newfs.h stable/9/sys/geom/label/g_label_ufs.c stable/9/sys/ufs/ffs/fs.h Directory Properties: stable/9/sbin/dumpfs/ (props changed) stable/9/sbin/growfs/ (props changed) stable/9/sbin/newfs/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/dumpfs/dumpfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -277,8 +277,9 @@ dumpfs(const char *name) printf("unknown flags (%#x)", fsflags); putchar('\n'); printf("fsmnt\t%s\n", afs.fs_fsmnt); - printf("volname\t%s\tswuid\t%ju\n", - afs.fs_volname, (uintmax_t)afs.fs_swuid); + printf("volname\t%s\tswuid\t%ju\tprovidersize\t%ju\n", + afs.fs_volname, (uintmax_t)afs.fs_swuid, + (uintmax_t)afs.fs_providersize); printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t"); afs.fs_csp = calloc(1, afs.fs_cssize); if (bread(&disk, fsbtodb(&afs, afs.fs_csaddr), afs.fs_csp, afs.fs_cssize) == -1) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/growfs/growfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -1504,6 +1504,7 @@ main(int argc, char **argv) } sblock.fs_size = dbtofsb(&osblock, size / DEV_BSIZE); + sblock.fs_providersize = dbtofsb(&osblock, mediasize / DEV_BSIZE); /* * Are we really growing? Modified: stable/9/sbin/newfs/mkfs.c ============================================================================== --- stable/9/sbin/newfs/mkfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/mkfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -263,6 +263,7 @@ restart: } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_providersize = dbtofsb(&sblock, mediasize / sectorsize); /* * Before the filesystem is finally initialized, mark it Modified: stable/9/sbin/newfs/newfs.c ============================================================================== --- stable/9/sbin/newfs/newfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/newfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -94,6 +94,7 @@ int lflag; /* enable multilabel for fi int nflag; /* do not create .snap directory */ int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ +off_t mediasize; /* device size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ int fsize = 0; /* fragment size */ @@ -135,7 +136,6 @@ main(int argc, char *argv[]) char *cp, *special; intmax_t reserved; int ch, i, rval; - off_t mediasize; char part_name; /* partition name, default to full disk */ part_name = 'c'; Modified: stable/9/sbin/newfs/newfs.h ============================================================================== --- stable/9/sbin/newfs/newfs.h Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/newfs.h Sun Feb 3 12:17:49 2013 (r246284) @@ -87,6 +87,7 @@ extern int lflag; /* enable multilabel extern int nflag; /* do not create .snap directory */ extern int tflag; /* enable TRIM */ extern intmax_t fssize; /* file system size */ +extern off_t mediasize; /* device size */ extern int sectorsize; /* bytes/sector */ extern int realsectorsize; /* bytes/sector in hardware*/ extern int fsize; /* fragment size */ Modified: stable/9/sys/geom/label/g_label_ufs.c ============================================================================== --- stable/9/sys/geom/label/g_label_ufs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sys/geom/label/g_label_ufs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -86,7 +86,8 @@ g_label_ufs_taste_common(struct g_consum pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_size) { + ((pp->mediasize / fs->fs_fsize == fs->fs_size) || + (pp->mediasize / fs->fs_fsize == fs->fs_providersize))) { /* Valid UFS2. */ } else { g_free(fs); Modified: stable/9/sys/ufs/ffs/fs.h ============================================================================== --- stable/9/sys/ufs/ffs/fs.h Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sys/ufs/ffs/fs.h Sun Feb 3 12:17:49 2013 (r246284) @@ -332,7 +332,8 @@ struct fs { int32_t fs_old_cpc; /* cyl per cycle in postbl */ int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_unrefs; /* number of unreferenced inodes */ - int64_t fs_sparecon64[16]; /* old rotation block list head */ + int64_t fs_providersize; /* size of underlying GEOM provider */ + int64_t fs_sparecon64[15]; /* old rotation block list head */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ ufs_time_t fs_time; /* last time written */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 14:24:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BCEE5EA5; Sun, 3 Feb 2013 14:24:52 +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 AA58799A; Sun, 3 Feb 2013 14:24: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 r13EOqS1007709; Sun, 3 Feb 2013 14:24:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13EOquH007708; Sun, 3 Feb 2013 14:24:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302031424.r13EOquH007708@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Feb 2013 14:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246285 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 14:24:52 -0000 Author: kib Date: Sun Feb 3 14:24:52 2013 New Revision: 246285 URL: http://svnweb.freebsd.org/changeset/base/246285 Log: MFC r245977: Be conservative and do not try to consume more bytes than was requested from the server for the read operation. Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Feb 3 12:17:49 2013 (r246284) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Feb 3 14:24:52 2013 (r246285) @@ -1339,7 +1339,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); eof = fxdr_unsigned(int, *tl); } - NFSM_STRSIZ(retlen, rsize); + NFSM_STRSIZ(retlen, len); error = nfsm_mbufuio(nd, uiop, retlen); if (error) goto nfsmout; From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 15:54:59 2013 Return-Path: Delivered-To: svn-src-all@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 ACD5B1D3; Sun, 3 Feb 2013 15:54: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 9F37DD84; Sun, 3 Feb 2013 15:54: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 r13FsxQM034567; Sun, 3 Feb 2013 15:54:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13FswN8034562; Sun, 3 Feb 2013 15:54:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302031554.r13FswN8034562@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Feb 2013 15:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246288 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 15:54:59 -0000 Author: jilles Date: Sun Feb 3 15:54:57 2013 New Revision: 246288 URL: http://svnweb.freebsd.org/changeset/base/246288 Log: sh: Expand here documents in the current process. Expand here documents at the same point other redirections are expanded but use a non-fork subshell environment (like simple command substitutions) for compatibility. Substitition errors result in an empty here document like before. As a result, a fork is avoided for short (<4K) expanded here documents. Unexpanded here documents (with quoted end marker after <<) are not affected by this change. They already only forked when >4K. Side effects: * Order of expansion is slightly different. * Slow expansions are not executed in parallel with the redirected command. * A non-fork subshell environment is subtly different from a forked process. Modified: head/bin/sh/eval.c head/bin/sh/expand.c head/bin/sh/expand.h head/bin/sh/nodetypes head/bin/sh/redir.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Feb 3 15:23:28 2013 (r246287) +++ head/bin/sh/eval.c Sun Feb 3 15:54:57 2013 (r246288) @@ -92,6 +92,7 @@ static void evalfor(union node *, int); static union node *evalcase(union node *); static void evalsubshell(union node *, int); static void evalredir(union node *, int); +static void exphere(union node *, struct arglist *); static void expredir(union node *); static void evalpipe(union node *); static int is_valid_fast_cmdsubst(union node *n); @@ -488,6 +489,37 @@ evalredir(union node *n, int flags) } +static void +exphere(union node *redir, struct arglist *fn) +{ + struct jmploc jmploc; + struct jmploc *savehandler; + struct localvar *savelocalvars; + int need_longjmp = 0; + + redir->nhere.expdoc = nullstr; + savelocalvars = localvars; + localvars = NULL; + forcelocal++; + savehandler = handler; + if (setjmp(jmploc.loc)) + need_longjmp = exception != EXERROR && exception != EXEXEC; + else { + handler = &jmploc; + expandarg(redir->nhere.doc, fn, 0); + redir->nhere.expdoc = fn->list->text; + INTOFF; + } + handler = savehandler; + forcelocal--; + poplocalvars(); + localvars = savelocalvars; + if (need_longjmp) + longjmp(handler->loc, 1); + INTON; +} + + /* * Compute the names of the files in a redirection list. */ @@ -516,6 +548,9 @@ expredir(union node *n) fixredir(redir, fn.list->text, 1); } break; + case NXHERE: + exphere(redir, &fn); + break; } } } Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Feb 3 15:23:28 2013 (r246287) +++ head/bin/sh/expand.c Sun Feb 3 15:54:57 2013 (r246288) @@ -127,19 +127,6 @@ collate_range_cmp(wchar_t c1, wchar_t c2 return (wcscoll(s1, s2)); } -/* - * Expand shell variables and backquotes inside a here document. - * union node *arg the document - * int fd; where to write the expanded version - */ - -void -expandhere(union node *arg, int fd) -{ - expandarg(arg, (struct arglist *)NULL, 0); - xwrite(fd, stackblock(), expdest - stackblock()); -} - static char * stputs_quotes(const char *data, const char *syntax, char *p) { Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Sun Feb 3 15:23:28 2013 (r246287) +++ head/bin/sh/expand.h Sun Feb 3 15:54:57 2013 (r246288) @@ -57,7 +57,6 @@ struct arglist { union node; -void expandhere(union node *, int); void expandarg(union node *, struct arglist *, int); void expari(int); void rmescapes(char *); Modified: head/bin/sh/nodetypes ============================================================================== --- head/bin/sh/nodetypes Sun Feb 3 15:23:28 2013 (r246287) +++ head/bin/sh/nodetypes Sun Feb 3 15:54:57 2013 (r246288) @@ -138,6 +138,7 @@ NXHERE nhere # fd<type == NHERE) { - len = strlen(redir->nhere.doc->narg.text); - if (len <= PIPESIZE) { - xwrite(pip[1], redir->nhere.doc->narg.text, len); - goto out; - } + + if (redir->type == NXHERE) + p = redir->nhere.expdoc; + else + p = redir->nhere.doc->narg.text; + len = strlen(p); + if (len <= PIPESIZE) { + xwrite(pip[1], p, len); + goto out; } + if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { close(pip[0]); signal(SIGINT, SIG_IGN); @@ -270,10 +275,7 @@ openhere(union node *redir) signal(SIGHUP, SIG_IGN); signal(SIGTSTP, SIG_IGN); signal(SIGPIPE, SIG_DFL); - if (redir->type == NHERE) - xwrite(pip[1], redir->nhere.doc->narg.text, len); - else - expandhere(redir->nhere.doc, pip[1]); + xwrite(pip[1], p, len); _exit(0); } out: From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 17:16:34 2013 Return-Path: Delivered-To: svn-src-all@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 0270387E; Sun, 3 Feb 2013 17:16:33 +0000 (UTC) (envelope-from mckusick@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 DD8D3198; Sun, 3 Feb 2013 17:16: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 r13HGXH4060304; Sun, 3 Feb 2013 17:16:33 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13HGXNP060303; Sun, 3 Feb 2013 17:16:33 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201302031716.r13HGXNP060303@svn.freebsd.org> From: Kirk McKusick Date: Sun, 3 Feb 2013 17:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246289 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 17:16:34 -0000 Author: mckusick Date: Sun Feb 3 17:16:32 2013 New Revision: 246289 URL: http://svnweb.freebsd.org/changeset/base/246289 Log: For UFS2 i_blocks is unsigned. The current "sanity" check that it has gone below zero after the blocks in its inode are freed is a no-op which the compiler fails to warn about because of the use of the DIP macro. Change the sanity check to compare the number of blocks being freed against the value i_blocks. If the number of blocks being freed exceeds i_blocks, just set i_blocks to zero. Reported by: Pedro Giffuni (pfg@) MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sun Feb 3 15:54:57 2013 (r246288) +++ head/sys/ufs/ffs/ffs_inode.c Sun Feb 3 17:16:32 2013 (r246289) @@ -546,9 +546,9 @@ done: */ ip->i_size = length; DIP_SET(ip, i_size, length); - DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); - - if (DIP(ip, i_blocks) < 0) /* sanity */ + if (DIP(ip, i_blocks) >= blocksreleased) + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); + else /* sanity */ DIP_SET(ip, i_blocks, 0); ip->i_flag |= IN_CHANGE; #ifdef QUOTA From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 17:24:27 2013 Return-Path: Delivered-To: svn-src-all@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 45B01DD6; Sun, 3 Feb 2013 17:24:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E85101F1; Sun, 3 Feb 2013 17:24:25 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA09423; Sun, 03 Feb 2013 19:24:24 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U23Im-0006nL-86; Sun, 03 Feb 2013 19:24:24 +0200 Message-ID: <510E9D47.2030403@FreeBSD.org> Date: Sun, 03 Feb 2013 19:24:23 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: Kirk McKusick Subject: Re: svn commit: r246289 - head/sys/ufs/ffs References: <201302031716.r13HGXNP060303@svn.freebsd.org> In-Reply-To: <201302031716.r13HGXNP060303@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 17:24:27 -0000 on 03/02/2013 19:16 Kirk McKusick said the following: > Author: mckusick > Date: Sun Feb 3 17:16:32 2013 > New Revision: 246289 > URL: http://svnweb.freebsd.org/changeset/base/246289 > > Log: > For UFS2 i_blocks is unsigned. The current "sanity" check that it > has gone below zero after the blocks in its inode are freed is a > no-op which the compiler fails to warn about because of the use of > the DIP macro. Change the sanity check to compare the number of Just a note that clang actually warned about this one. It has a few more similar warnings for ufs/ffs code. > blocks being freed against the value i_blocks. If the number of > blocks being freed exceeds i_blocks, just set i_blocks to zero. > > Reported by: Pedro Giffuni (pfg@) > MFC after: 2 weeks > > Modified: > head/sys/ufs/ffs/ffs_inode.c > > Modified: head/sys/ufs/ffs/ffs_inode.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_inode.c Sun Feb 3 15:54:57 2013 (r246288) > +++ head/sys/ufs/ffs/ffs_inode.c Sun Feb 3 17:16:32 2013 (r246289) > @@ -546,9 +546,9 @@ done: > */ > ip->i_size = length; > DIP_SET(ip, i_size, length); > - DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); > - > - if (DIP(ip, i_blocks) < 0) /* sanity */ > + if (DIP(ip, i_blocks) >= blocksreleased) > + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); > + else /* sanity */ > DIP_SET(ip, i_blocks, 0); > ip->i_flag |= IN_CHANGE; > #ifdef QUOTA > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 18:14:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22821B44; Sun, 3 Feb 2013 18:14:40 +0000 (UTC) (envelope-from dchagin@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 EC253390; Sun, 3 Feb 2013 18:14: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 r13IEddM079261; Sun, 3 Feb 2013 18:14:39 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13IEcxt079247; Sun, 3 Feb 2013 18:14:38 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031814.r13IEcxt079247@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246290 - in stable/9/sys: amd64/linux32 compat/linux i386/linux modules/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:14:40 -0000 Author: dchagin Date: Sun Feb 3 18:14:37 2013 New Revision: 246290 URL: http://svnweb.freebsd.org/changeset/base/246290 Log: MFC r235063 (by netchild@): - >500 static DTrace probes for the linuxulator - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probes with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs). Manual merge futex part of r227293 (by ed@): Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. MFC r235078 (by uqs@): Fix make depend. Added: stable/9/sys/compat/linux/check_error.d - copied unchanged from r235063, head/sys/compat/linux/check_error.d stable/9/sys/compat/linux/check_internal_locks.d - copied unchanged from r235063, head/sys/compat/linux/check_internal_locks.d stable/9/sys/compat/linux/linux_dtrace.h - copied unchanged from r235063, head/sys/compat/linux/linux_dtrace.h stable/9/sys/compat/linux/stats_timing.d - copied unchanged from r235063, head/sys/compat/linux/stats_timing.d stable/9/sys/compat/linux/trace_futexes.d - copied unchanged from r235063, head/sys/compat/linux/trace_futexes.d Modified: stable/9/sys/amd64/linux32/linux.h stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/compat/linux/linux_emul.c stable/9/sys/compat/linux/linux_emul.h stable/9/sys/compat/linux/linux_fork.c stable/9/sys/compat/linux/linux_futex.c stable/9/sys/compat/linux/linux_mib.c stable/9/sys/compat/linux/linux_misc.c stable/9/sys/compat/linux/linux_sysctl.c stable/9/sys/compat/linux/linux_time.c stable/9/sys/compat/linux/linux_uid16.c stable/9/sys/compat/linux/linux_util.c stable/9/sys/compat/linux/linux_util.h stable/9/sys/i386/linux/linux.h stable/9/sys/i386/linux/linux_dummy.c stable/9/sys/modules/linux/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/linux32/linux.h ============================================================================== --- stable/9/sys/amd64/linux32/linux.h Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/amd64/linux32/linux.h Sun Feb 3 18:14:37 2013 (r246290) @@ -42,6 +42,7 @@ extern u_char linux_debug_map[]; #define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) #define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid #define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid +#define LINUX_DTRACE linuxulator32 #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_LINUX); Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Sun Feb 3 18:14:37 2013 (r246290) @@ -29,14 +29,23 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" +#include "opt_kdtrace.h" + #include +#include +#include #include #include #include #include +#include #include +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + DUMMY(stime); DUMMY(olduname); DUMMY(syslog); Copied: stable/9/sys/compat/linux/check_error.d (from r235063, head/sys/compat/linux/check_error.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/check_error.d Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/check_error.d) @@ -0,0 +1,144 @@ +#!/usr/sbin/dtrace -qs + +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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. + * + * 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$ + */ + +/* + * Report error conditions: + * - emulation errors (unsupportet stuff, unknown stuff, ...) + * - kernel errors (resource shortage, ...) + * - programming errors (errors which can happen, but should not happen) + */ + +linuxulator*:dummy::not_implemented, +linuxulator*:emul:proc_exit:child_clear_tid_error, +linuxulator*:emul:proc_exit:futex_failed, +linuxulator*:emul:linux_schedtail:copyout_error, +linuxulator*:futex:futex_get:error, +linuxulator*:futex:futex_sleep:requeue_error, +linuxulator*:futex:futex_sleep:sleep_error, +linuxulator*:futex:futex_wait:copyin_error, +linuxulator*:futex:futex_wait:itimerfix_error, +linuxulator*:futex:futex_wait:sleep_error, +linuxulator*:futex:futex_atomic_op:missing_access_check, +linuxulator*:futex:futex_atomic_op:unimplemented_op, +linuxulator*:futex:futex_atomic_op:unimplemented_cmp, +linuxulator*:futex:linux_sys_futex:unimplemented_clockswitch, +linuxulator*:futex:linux_sys_futex:copyin_error, +linuxulator*:futex:linux_sys_futex:unhandled_efault, +linuxulator*:futex:linux_sys_futex:unimplemented_lock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_unlock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_trylock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_wait_requeue_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_cmp_requeue_pi, +linuxulator*:futex:linux_sys_futex:unknown_operation, +linuxulator*:futex:linux_get_robust_list:copyout_error, +linuxulator*:futex:handle_futex_death:copyin_error, +linuxulator*:futex:fetch_robust_entry:copyin_error, +linuxulator*:futex:release_futexes:copyin_error, +linuxulator*:time:linux_clock_gettime:conversion_error, +linuxulator*:time:linux_clock_gettime:gettime_error, +linuxulator*:time:linux_clock_gettime:copyout_error, +linuxulator*:time:linux_clock_settime:conversion_error, +linuxulator*:time:linux_clock_settime:settime_error, +linuxulator*:time:linux_clock_settime:copyin_error, +linuxulator*:time:linux_clock_getres:conversion_error, +linuxulator*:time:linux_clock_getres:getres_error, +linuxulator*:time:linux_clock_getres:copyout_error, +linuxulator*:time:linux_nanosleep:conversion_error, +linuxulator*:time:linux_nanosleep:nanosleep_error, +linuxulator*:time:linux_nanosleep:copyout_error, +linuxulator*:time:linux_nanosleep:copyin_error, +linuxulator*:time:linux_clock_nanosleep:copyin_error, +linuxulator*:time:linux_clock_nanosleep:conversion_error, +linuxulator*:time:linux_clock_nanosleep:copyout_error, +linuxulator*:time:linux_clock_nanosleep:nanosleep_error, +linuxulator*:sysctl:handle_string:copyout_error, +linuxulator*:sysctl:linux_sysctl:copyin_error, +linuxulator*:mib:linux_sysctl_osname:sysctl_string_error, +linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error, +linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error, +linuxulator*:mib:linux_prison_create:vfs_copyopt_error, +linuxulator*:mib:linux_prison_check:vfs_copyopt_error, +linuxulator*:mib:linux_prison_check:vfs_getopt_error, +linuxulator*:mib:linux_prison_set:vfs_copyopt_error, +linuxulator*:mib:linux_prison_set:vfs_getopt_error, +linuxulator*:mib:linux_prison_get:vfs_setopt_error, +linuxulator*:mib:linux_prison_get:vfs_setopts_error +{ + printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc); + stack(); + ustack(); +} + +linuxulator*:util:linux_driver_get_name_dev:nullcall, +linuxulator*:util:linux_driver_get_major_minor:nullcall, +linuxulator*:futex:linux_sys_futex:invalid_cmp_requeue_use, +linuxulator*:futex:linux_sys_futex:deprecated_requeue, +linuxulator*:futex:linux_set_robust_list:size_error, +linuxulator*:time:linux_clock_getres:nullcall +{ + printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname); + stack(); + ustack(); +} + +linuxulator*:util:linux_driver_get_major_minor:notfound +{ + printf("WARNING: Application %s failed to find %s in %s:%s:%s, this may or may not be a problem.\n", execname, stringof(args[0]), probename, probeprov, probemod); + stack(); + ustack(); +} + +linuxulator*:time:linux_to_native_clockid:unknown_clockid +{ + printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0); +} + +linuxulator*:time:linux_to_native_clockid:unsupported_clockid, +linuxulator*:time:linux_clock_nanosleep:unsupported_clockid +{ + printf("WARNING: Application %s tried to use unsupported clockid (%d), this may or may not be a problem for the application.\nPatches to support this clockid are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0); +} + +linuxulator*:time:linux_clock_nanosleep:unsupported_flags +{ + printf("WARNING: Application %s tried to use unsupported flags (%d), this may or may not be a problem for the application.\nPatches to support those flags are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0); +} + +linuxulator*:sysctl:linux_sysctl:wrong_length +{ + printf("ERROR: Application %s issued a sysctl which failed the length restrictions.\nThe length passed is %d, the min length supported is 1 and the max length supported is %d.\n", execname, arg0, arg1); + stack(); + ustack(); +} + +linuxulator*:sysctl:linux_sysctl:unsupported_sysctl +{ + printf("ERROR: Application %s issued an unsupported sysctl (%s).\nPatches to support this sysctl are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, stringof(args[0])); +} Copied: stable/9/sys/compat/linux/check_internal_locks.d (from r235063, head/sys/compat/linux/check_internal_locks.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/check_internal_locks.d Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/check_internal_locks.d) @@ -0,0 +1,132 @@ +#!/usr/sbin/dtrace -qs + +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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. + * + * 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$ + */ + +/** + * Check if the internal locks are correctly acquired/released: + * - no recursive locking (mtx locks, write locks) + * - no unlocking of already unlocked one + * + * Print stacktrace if a lock is longer locked than about 10sec or more. + */ + +#pragma D option dynvarsize=32m +#pragma D option specsize=32m + +BEGIN +{ + check["emul_lock"] = 0; + check["emul_shared_rlock"] = 0; + check["emul_shared_wlock"] = 0; + check["futex_mtx"] = 0; +} + +linuxulator*:locks:emul_lock:locked, +linuxulator*:locks:emul_shared_wlock:locked, +linuxulator*:locks:futex_mtx:locked +/check[probefunc] > 0/ +{ + printf("ERROR: recursive lock of %s (%p),", probefunc, arg0); + printf(" or missing SDT probe in kernel. Stack trace follows:"); + stack(); +} + +linuxulator*:locks:emul_lock:locked, +linuxulator*:locks:emul_shared_rlock:locked, +linuxulator*:locks:emul_shared_wlock:locked, +linuxulator*:locks:futex_mtx:locked +{ + ++check[probefunc]; + @stats[probefunc] = count(); + + ts[probefunc] = timestamp; + spec[probefunc] = speculation(); +} + +linuxulator*:locks:emul_lock:unlock, +linuxulator*:locks:emul_shared_rlock:unlock, +linuxulator*:locks:emul_shared_wlock:unlock, +linuxulator*:locks:futex_mtx:unlock +/check[probefunc] == 0/ +{ + printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf(" missing SDT probe in kernel, or dtrace program started"); + printf(" while the %s was already held (race condition).", probefunc); + printf(" Stack trace follows:"); + stack(); +} + +linuxulator*:locks:emul_lock:unlock, +linuxulator*:locks:emul_shared_rlock:unlock, +linuxulator*:locks:emul_shared_wlock:unlock, +linuxulator*:locks:futex_mtx:unlock +{ + discard(spec[probefunc]); + spec[probefunc] = 0; + --check[probefunc]; +} + +/* Timeout handling */ + +tick-10s +/spec["emul_lock"] != 0 && timestamp - ts["emul_lock"] >= 9999999000/ +{ + commit(spec["emul_lock"]); + spec["emul_lock"] = 0; +} + +tick-10s +/spec["emul_shared_wlock"] != 0 && timestamp - ts["emul_shared_wlock"] >= 9999999000/ +{ + commit(spec["emul_shared_wlock"]); + spec["emul_shared_wlock"] = 0; +} + +tick-10s +/spec["emul_shared_rlock"] != 0 && timestamp - ts["emul_shared_rlock"] >= 9999999000/ +{ + commit(spec["emul_shared_rlock"]); + spec["emul_shared_rlock"] = 0; +} + +tick-10s +/spec["futex_mtx"] != 0 && timestamp - ts["futex_mtx"] >= 9999999000/ +{ + commit(spec["futex_mtx"]); + spec["futex_mtx"] = 0; +} + + +/* Statistics */ + +END +{ + printf("Number of locks per type:"); + printa(@stats); +} Copied: stable/9/sys/compat/linux/linux_dtrace.h (from r235063, head/sys/compat/linux/linux_dtrace.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/linux_dtrace.h Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/linux_dtrace.h) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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. + * + * 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$ + */ + +#ifndef _LINUX_DTRACE_H_ +#define _LINUX_DTRACE_H_ + +/** + * DTrace support macros for the linuxulator. + * + * Some wrapper macros to make it more easy to handle the linuxulator + * providers and to allow to make the name depend upon the bitsize. + * + * Basically this is the same as the normal SDT macros in sys/sdt.h. The + * difference is that the provider name is automatically inserted, and + * we do not use a different name for the probe-description. + */ + +#define LIN_SDT_PROVIDER_DEFINE(x) SDT_PROVIDER_DEFINE(x) +#define LIN_SDT_PROVIDER_DECLARE(x) SDT_PROVIDER_DECLARE(x) + +#define _LIN_SDT_PROBE_DECLARE(a, b, c, d) SDT_PROBE_DECLARE(a, b, c, d) +#define LIN_SDT_PROBE_DECLARE(a, b, c) _LIN_SDT_PROBE_DECLARE( \ + LINUX_DTRACE, a, b, c) + +#define _LIN_SDT_PROBE_DEFINE0(a, b, c, d) SDT_PROBE_DEFINE(a, \ + b, c, d, d) +#define LIN_SDT_PROBE_DEFINE0(a, b, c) _LIN_SDT_PROBE_DEFINE0(\ + LINUX_DTRACE, a, b, c) +#define _LIN_SDT_PROBE_DEFINE1(a, b, c, d, e) SDT_PROBE_DEFINE1(a, \ + b, c, d, d, e) +#define LIN_SDT_PROBE_DEFINE1(a, b, c, d) _LIN_SDT_PROBE_DEFINE1(\ + LINUX_DTRACE, a, b, c, d) +#define _LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f) SDT_PROBE_DEFINE2(a, \ + b, c, d, d, e, f) +#define LIN_SDT_PROBE_DEFINE2(a, b, c, d, e) _LIN_SDT_PROBE_DEFINE2(\ + LINUX_DTRACE, a, b, c, d, e) +#define _LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g) SDT_PROBE_DEFINE3(a, \ + b, c, d, d, e, f, g) +#define LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f) _LIN_SDT_PROBE_DEFINE3(\ + LINUX_DTRACE, a, b, c, d, e, f) +#define _LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h) SDT_PROBE_DEFINE4(a, \ + b, c, d, d, e, f, g, h) +#define LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g) _LIN_SDT_PROBE_DEFINE4(\ + LINUX_DTRACE, a, b, c, d, e, f, g) +#define _LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \ + SDT_PROBE_DEFINE5(a, b, c, d, d, e, f, g, h, i) +#define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ + LINUX_DTRACE, a, b, c, d, e, f, g, h) + +#define _LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e, f) SDT_PROBE_ARGTYPE(a, b,\ + c, d, e, f) +#define LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e) _LIN_SDT_PROBE_ARGTYPE( \ + LINUX_DTRACE, a, b, c, d, e) + +#define LIN_SDT_PROBE0(a, b, c) SDT_PROBE1(LINUX_DTRACE, a, b, \ + c, 0) +#define LIN_SDT_PROBE1(a, b, c, d) SDT_PROBE1(LINUX_DTRACE, a, b, \ + c, d) +#define LIN_SDT_PROBE2(a, b, c, d, e) SDT_PROBE2(LINUX_DTRACE, a, b, \ + c, d, e) +#define LIN_SDT_PROBE3(a, b, c, d, e, f) SDT_PROBE3(LINUX_DTRACE, a, b, \ + c, d, e, f) +#define LIN_SDT_PROBE4(a, b, c, d, e, f, g) SDT_PROBE4(LINUX_DTRACE, a, b, \ + c, d, e, f, g) +#define _LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i) SDT_PROBE(a, b, c, d, \ + e, f, g, h, i) +#define LIN_SDT_PROBE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE5(LINUX_DTRACE, \ + a, b, c, d, e, f, g, h) + +#endif /* _LINUX_DTRACE_H_ */ Modified: stable/9/sys/compat/linux/linux_emul.c ============================================================================== --- stable/9/sys/compat/linux/linux_emul.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_emul.c Sun Feb 3 18:14:37 2013 (r246290) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,9 +55,64 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); + +/** + * Special DTrace module "locks", it covers some linuxulator internal + * locks. + */ +LIN_SDT_PROBE_DEFINE1(locks, emul_lock, locked, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_lock, unlock, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, locked, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, unlock, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, locked, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, unlock, "struct sx *"); + +/** + * DTrace probes in this module. + */ +LIN_SDT_PROBE_DEFINE2(emul, em_find, entry, "struct proc *", "int"); +LIN_SDT_PROBE_DEFINE0(emul, em_find, return); +LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", "pid_t", + "int"); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, create_thread); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, fork); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, exec); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, return); +LIN_SDT_PROBE_DEFINE1(emul, proc_exit, entry, "struct proc *"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exit, futex_failed); +LIN_SDT_PROBE_DEFINE3(emul, proc_exit, reparent, "pid_t", "pid_t", + "struct proc *"); +LIN_SDT_PROBE_DEFINE1(emul, proc_exit, child_clear_tid_error, "int"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exit, return); +LIN_SDT_PROBE_DEFINE2(emul, proc_exec, entry, "struct proc *", + "struct image_params *"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exec, return); +LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, entry); +LIN_SDT_PROBE_DEFINE1(emul, linux_schedtail, copyout_error, "int"); +LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, return); +LIN_SDT_PROBE_DEFINE1(emul, linux_set_tid_address, entry, "int *"); +LIN_SDT_PROBE_DEFINE0(emul, linux_set_tid_address, return); +LIN_SDT_PROBE_DEFINE2(emul, linux_kill_threads, entry, "struct thread *", + "int"); +LIN_SDT_PROBE_DEFINE1(emul, linux_kill_threads, kill, "pid_t"); +LIN_SDT_PROBE_DEFINE0(emul, linux_kill_threads, return); + struct sx emul_shared_lock; struct mtx emul_lock; @@ -65,6 +122,8 @@ em_find(struct proc *p, int locked) { struct linux_emuldata *em; + LIN_SDT_PROBE2(emul, em_find, entry, p, locked); + if (locked == EMUL_DOLOCK) EMUL_LOCK(&emul_lock); @@ -73,6 +132,7 @@ em_find(struct proc *p, int locked) if (em == NULL && locked == EMUL_DOLOCK) EMUL_UNLOCK(&emul_lock); + LIN_SDT_PROBE1(emul, em_find, return, em); return (em); } @@ -82,8 +142,10 @@ linux_proc_init(struct thread *td, pid_t struct linux_emuldata *em, *p_em; struct proc *p; + LIN_SDT_PROBE3(emul, proc_init, entry, td, child, flags); + if (child != 0) { - /* non-exec call */ + /* fork or create a thread */ em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO); em->pid = child; em->pdeath_signal = 0; @@ -91,9 +153,12 @@ linux_proc_init(struct thread *td, pid_t em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { /* handled later in the code */ + LIN_SDT_PROBE0(emul, proc_init, create_thread); } else { struct linux_emuldata_shared *s; + LIN_SDT_PROBE0(emul, proc_init, fork); + s = malloc(sizeof *s, M_LINUX, M_WAITOK | M_ZERO); s->refs = 1; s->group_pid = child; @@ -102,6 +167,9 @@ linux_proc_init(struct thread *td, pid_t em->shared = s; } } else { + /* exec */ + LIN_SDT_PROBE0(emul, proc_init, exec); + /* lookup the old one */ em = em_find(td->td_proc, EMUL_DOLOCK); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); @@ -136,8 +204,7 @@ linux_proc_init(struct thread *td, pid_t * rwlock held */ } - } - if (child != 0) { + EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_INSERT_HEAD(&em->shared->threads, em, threads); EMUL_SHARED_WUNLOCK(&emul_shared_lock); @@ -149,6 +216,7 @@ linux_proc_init(struct thread *td, pid_t } else EMUL_UNLOCK(&emul_lock); + LIN_SDT_PROBE0(emul, proc_init, return); return (0); } @@ -164,6 +232,8 @@ linux_proc_exit(void *arg __unused, stru if (__predict_true(p->p_sysent != &elf_linux_sysvec)) return; + LIN_SDT_PROBE1(emul, proc_exit, entry, p); + release_futexes(p); /* find the emuldata */ @@ -173,6 +243,9 @@ linux_proc_exit(void *arg __unused, stru /* reparent all procs that are not a thread leader to initproc */ if (em->shared->group_pid != p->p_pid) { + LIN_SDT_PROBE3(emul, proc_exit, reparent, + em->shared->group_pid, p->p_pid, p); + child_clear_tid = em->child_clear_tid; EMUL_UNLOCK(&emul_lock); sx_xlock(&proctree_lock); @@ -208,7 +281,12 @@ linux_proc_exit(void *arg __unused, stru error = copyout(&null, child_clear_tid, sizeof(null)); if (error) { + LIN_SDT_PROBE1(emul, proc_exit, + child_clear_tid_error, error); + free(em, M_LINUX); + + LIN_SDT_PROBE0(emul, proc_exit, return); return; } @@ -224,8 +302,10 @@ linux_proc_exit(void *arg __unused, stru * this cannot happen at the moment and if this happens it * probably means there is a user space bug */ - if (error) + if (error) { + LIN_SDT_PROBE0(emul, proc_exit, futex_failed); printf(LMSG("futex stuff in proc_exit failed.\n")); + } } /* clean the stuff up */ @@ -250,6 +330,8 @@ linux_proc_exit(void *arg __unused, stru EMUL_UNLOCK(&emul_lock); } sx_xunlock(&proctree_lock); + + LIN_SDT_PROBE0(emul, proc_exit, return); } /* @@ -260,6 +342,9 @@ linux_proc_exit(void *arg __unused, stru void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { + if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { + LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp); + } if (__predict_false(imgp->sysent == &elf_linux_sysvec && p->p_sysent != &elf_linux_sysvec)) linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0); @@ -297,6 +382,10 @@ linux_proc_exec(void *arg __unused, stru free(em, M_LINUX); } + + if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { + LIN_SDT_PROBE0(emul, proc_exec, return); + } } void @@ -309,6 +398,8 @@ linux_schedtail(struct thread *td) p = td->td_proc; + LIN_SDT_PROBE1(emul, linux_schedtail, entry, p); + /* find the emuldata */ em = em_find(p, EMUL_DOLOCK); @@ -316,10 +407,18 @@ linux_schedtail(struct thread *td) child_set_tid = em->child_set_tid; EMUL_UNLOCK(&emul_lock); - if (child_set_tid != NULL) + if (child_set_tid != NULL) { error = copyout(&p->p_pid, (int *)child_set_tid, sizeof(p->p_pid)); + if (error != 0) { + LIN_SDT_PROBE1(emul, linux_schedtail, copyout_error, + error); + } + } + + LIN_SDT_PROBE0(emul, linux_schedtail, return); + return; } @@ -328,10 +427,7 @@ linux_set_tid_address(struct thread *td, { struct linux_emuldata *em; -#ifdef DEBUG - if (ldebug(set_tid_address)) - printf(ARGS(set_tid_address, "%p"), args->tidptr); -#endif + LIN_SDT_PROBE1(emul, linux_set_tid_address, entry, args->tidptr); /* find the emuldata */ em = em_find(td->td_proc, EMUL_DOLOCK); @@ -342,6 +438,8 @@ linux_set_tid_address(struct thread *td, td->td_retval[0] = td->td_proc->p_pid; EMUL_UNLOCK(&emul_lock); + + LIN_SDT_PROBE0(emul, linux_set_tid_address, return); return 0; } @@ -351,6 +449,8 @@ linux_kill_threads(struct thread *td, in struct linux_emuldata *em, *td_em, *tmp_em; struct proc *sp; + LIN_SDT_PROBE2(emul, linux_kill_threads, entry, td, sig); + td_em = em_find(td->td_proc, EMUL_DONTLOCK); KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n")); @@ -364,9 +464,10 @@ linux_kill_threads(struct thread *td, in if ((sp->p_flag & P_WEXIT) == 0) kern_psignal(sp, sig); PROC_UNLOCK(sp); -#ifdef DEBUG - printf(LMSG("linux_kill_threads: kill PID %d\n"), em->pid); -#endif + + LIN_SDT_PROBE1(emul, linux_kill_threads, kill, em->pid); } EMUL_SHARED_RUNLOCK(&emul_shared_lock); + + LIN_SDT_PROBE0(emul, linux_kill_threads, return); } Modified: stable/9/sys/compat/linux/linux_emul.h ============================================================================== --- stable/9/sys/compat/linux/linux_emul.h Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_emul.h Sun Feb 3 18:14:37 2013 (r246290) @@ -64,13 +64,42 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct proc *, int locked); -#define EMUL_LOCK(l) mtx_lock(l) -#define EMUL_UNLOCK(l) mtx_unlock(l) - -#define EMUL_SHARED_RLOCK(l) sx_slock(l) -#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l) -#define EMUL_SHARED_WLOCK(l) sx_xlock(l) -#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l) +/* + * DTrace probes for locks should be fired after locking and before releasing + * to prevent races (to provide data/function stability in dtrace, see the + * output of "dtrace -v ..." and the corresponding dtrace docs). + */ +#define EMUL_LOCK(l) do { \ + mtx_lock(l); \ + LIN_SDT_PROBE1(locks, emul_lock, \ + locked, l); \ + } while (0) +#define EMUL_UNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_lock, \ + unlock, l); \ + mtx_unlock(l); \ + } while (0) + +#define EMUL_SHARED_RLOCK(l) do { \ + sx_slock(l); \ + LIN_SDT_PROBE1(locks, emul_shared_rlock, \ + locked, l); \ + } while (0) +#define EMUL_SHARED_RUNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_shared_rlock, \ + unlock, l); \ + sx_sunlock(l); \ + } while (0) +#define EMUL_SHARED_WLOCK(l) do { \ + sx_xlock(l); \ + LIN_SDT_PROBE1(locks, emul_shared_wlock, \ + locked, l); \ + } while (0) +#define EMUL_SHARED_WUNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_shared_wlock, \ + unlock, l); \ + sx_xunlock(l); \ + } while (0) /* for em_find use */ #define EMUL_DOLOCK 1 Modified: stable/9/sys/compat/linux/linux_fork.c ============================================================================== --- stable/9/sys/compat/linux/linux_fork.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_fork.c Sun Feb 3 18:14:37 2013 (r246290) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,9 +50,17 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* Linuxulator-global DTrace probes */ +LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked); +LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock); + int linux_fork(struct thread *td, struct linux_fork_args *args) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:14:37 2013 (r246290) @@ -38,6 +38,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #endif #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -51,6 +52,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include +#include #include #include @@ -61,12 +63,133 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #endif +#include #include #include #include -MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); -MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* Linuxulator-global DTrace probes */ +LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked); +LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock); + +/** + * Futex part for the special DTrace module "locks". + */ +LIN_SDT_PROBE_DEFINE1(locks, futex_mtx, locked, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, futex_mtx, unlock, "struct mtx *"); + +/** + * Per futex probes. + */ +LIN_SDT_PROBE_DEFINE1(futex, futex, create, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(futex, futex, destroy, "struct sx *"); + +/** + * DTrace probes in this module. + */ +LIN_SDT_PROBE_DEFINE2(futex, futex_put, entry, "struct futex *", + "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_put, destroy, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_put, unlock, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE0(futex, futex_put, return); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, entry, "uint32_t *", "struct futex **", + "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, umtx_key_get_error, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, shared, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, null, "uint32_t *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, new, "uint32_t *", "uint32_t", "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get, entry, "uint32_t *", + "struct waiting_proc **", "struct futex **"); +LIN_SDT_PROBE_DEFINE0(futex, futex_get, error); +LIN_SDT_PROBE_DEFINE1(futex, futex_get, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, entry, "struct futex *", + "struct waiting_proc **", "int"); +LIN_SDT_PROBE_DEFINE5(futex, futex_sleep, requeue_error, "int", "uint32_t *", + "struct waiting_proc *", "uint32_t *", "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, sleep_error, "int", "uint32_t *", + "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE1(futex, futex_sleep, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_wake, entry, "struct futex *", "int", + "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, futex_wake, iterate, "uint32_t", + "struct waiting_proc *", "uin32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wake, wakeup, "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wake, return, "int"); +LIN_SDT_PROBE_DEFINE4(futex, futex_requeue, entry, "struct futex *", "int", + "struct futex *", "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, wakeup, "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_requeue, requeue, "uint32_t *", + "struct waiting_proc *", "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); +LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", + "struct waiting_proc **", "struct l_timespec *", "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, itimerfix_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", + "int", "uint32_t"); +LIN_SDT_PROBE_DEFINE4(futex, futex_atomic_op, decoded_op, "int", "int", "int", + "int"); +LIN_SDT_PROBE_DEFINE0(futex, futex_atomic_op, missing_access_check); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_op, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_cmp, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", + "struct linux_sys_futex_args *"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); +LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", + "uint32_t", "uint32_t"); +LIN_SDT_PROBE_DEFINE4(futex, linux_sys_futex, debug_wait_value_neq, + "uint32_t *", "uint32_t", "int", "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wake, "uint32_t *", + "uint32_t", "uint32_t"); +LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_cmp_requeue, "uint32_t *", + "uint32_t", "uint32_t", "uint32_t *", "struct l_timespec *"); +LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, debug_cmp_requeue_value_neq, + "uint32_t", "int"); +LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_wake_op, "uint32_t *", + "int", "uint32_t", "uint32_t *", "uint32_t"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unhandled_efault); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_lock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_unlock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_trylock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, deprecated_requeue); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_wait_requeue_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_cmp_requeue_pi); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, unknown_operation, "int"); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_set_robust_list, entry, "struct thread *", + "struct linux_set_robust_list_args *"); +LIN_SDT_PROBE_DEFINE0(futex, linux_set_robust_list, size_error); +LIN_SDT_PROBE_DEFINE1(futex, linux_set_robust_list, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_get_robust_list, entry, "struct thread *", + "struct linux_get_robust_list_args *"); +LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, copyout_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, handle_futex_death, entry, "struct proc *", + "uint32_t *", "int"); +LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, fetch_robust_entry, entry, + "struct linux_robust_list **", "struct linux_robust_list **", "int *"); +LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, return, "int"); +LIN_SDT_PROBE_DEFINE1(futex, release_futexes, entry, "struct proc *"); +LIN_SDT_PROBE_DEFINE1(futex, release_futexes, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE0(futex, release_futexes, return); + +static MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); +static MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); struct futex; @@ -90,13 +213,30 @@ struct futex_list futex_list; #define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) #define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) -#define FUTEX_INIT(f) sx_init_flags(&(f)->f_lck, "ftlk", SX_DUPOK) -#define FUTEX_DESTROY(f) sx_destroy(&(f)->f_lck) +#define FUTEX_INIT(f) do { \ + sx_init_flags(&(f)->f_lck, "ftlk", \ + SX_DUPOK); \ + LIN_SDT_PROBE1(futex, futex, create, \ + &(f)->f_lck); \ + } while (0) +#define FUTEX_DESTROY(f) do { \ + LIN_SDT_PROBE1(futex, futex, destroy, \ + &(f)->f_lck); \ + sx_destroy(&(f)->f_lck); \ + } while (0) #define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) struct mtx futex_mtx; /* protects the futex list */ -#define FUTEXES_LOCK mtx_lock(&futex_mtx) -#define FUTEXES_UNLOCK mtx_unlock(&futex_mtx) +#define FUTEXES_LOCK do { \ + mtx_lock(&futex_mtx); \ + LIN_SDT_PROBE1(locks, futex_mtx, \ + locked, &futex_mtx); \ + } while (0) +#define FUTEXES_UNLOCK do { \ + LIN_SDT_PROBE1(locks, futex_mtx, \ + unlock, &futex_mtx); \ + mtx_unlock(&futex_mtx); \ + } while (0) /* flags for futex_get() */ #define FUTEX_CREATE_WP 0x1 /* create waiting_proc */ @@ -123,6 +263,7 @@ int futex_xorl(int oparg, uint32_t *uadd static void futex_put(struct futex *f, struct waiting_proc *wp) { + LIN_SDT_PROBE2(futex, futex_put, entry, f, wp); FUTEX_ASSERT_LOCKED(f); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 18:27:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B134F97; Sun, 3 Feb 2013 18:27:57 +0000 (UTC) (envelope-from dchagin@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 9EFCE5E4; Sun, 3 Feb 2013 18:27:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13IRvbp084385; Sun, 3 Feb 2013 18:27:57 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13IRvEd084384; Sun, 3 Feb 2013 18:27:57 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031827.r13IRvEd084384@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246291 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:27:57 -0000 Author: dchagin Date: Sun Feb 3 18:27:57 2013 New Revision: 246291 URL: http://svnweb.freebsd.org/changeset/base/246291 Log: MFC r240387 (by kevlo@): Remove redundant check. Modified: stable/9/sys/compat/linux/linux_file.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_file.c ============================================================================== --- stable/9/sys/compat/linux/linux_file.c Sun Feb 3 18:14:37 2013 (r246290) +++ stable/9/sys/compat/linux/linux_file.c Sun Feb 3 18:27:57 2013 (r246291) @@ -381,11 +381,6 @@ getdents_common(struct thread *td, struc auio.uio_resid = buflen; auio.uio_offset = off; - if (cookies) { - free(cookies, M_TEMP); - cookies = NULL; - } - #ifdef MAC /* * Do directory search MAC check using non-cached credentials. From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 18:37:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2AE984F2; Sun, 3 Feb 2013 18:37:09 +0000 (UTC) (envelope-from dchagin@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 048BA696; Sun, 3 Feb 2013 18:37: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 r13Ib8kB087319; Sun, 3 Feb 2013 18:37:08 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13Ib8wb087318; Sun, 3 Feb 2013 18:37:08 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031837.r13Ib8wb087318@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246292 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:37:09 -0000 Author: dchagin Date: Sun Feb 3 18:37:08 2013 New Revision: 246292 URL: http://svnweb.freebsd.org/changeset/base/246292 Log: MFC r245908: Arithmetic on pointers takes into account the size of the type. Properly cast the pointer to avoid incorrect pointer scaling. Modified: stable/9/sys/compat/linux/linux_futex.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:27:57 2013 (r246291) +++ stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:37:08 2013 (r246292) @@ -1203,7 +1203,7 @@ release_futexes(struct proc *p) if (entry != pending) if (handle_futex_death(p, - (uint32_t *)entry + futex_offset, pi)) { + (uint32_t *)((caddr_t)entry + futex_offset), pi)) { LIN_SDT_PROBE0(futex, release_futexes, return); return; } @@ -1222,7 +1222,7 @@ release_futexes(struct proc *p) } if (pending) - handle_futex_death(p, (uint32_t *)pending + futex_offset, pip); + handle_futex_death(p, (uint32_t *)((caddr_t)pending + futex_offset), pip); LIN_SDT_PROBE0(futex, release_futexes, return); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 18:42:21 2013 Return-Path: Delivered-To: svn-src-all@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 16F6E67C; Sun, 3 Feb 2013 18:42:21 +0000 (UTC) (envelope-from avg@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 E3AB86AF; Sun, 3 Feb 2013 18:42: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 r13IgKxW089610; Sun, 3 Feb 2013 18:42:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13IgK7e089609; Sun, 3 Feb 2013 18:42:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302031842.r13IgK7e089609@svn.freebsd.org> From: Andriy Gapon Date: Sun, 3 Feb 2013 18:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246293 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:42:21 -0000 Author: avg Date: Sun Feb 3 18:42:20 2013 New Revision: 246293 URL: http://svnweb.freebsd.org/changeset/base/246293 Log: zfs: fix, improve and re-organize page_lookup and page_unlock Now they are split into two pairs: page_hold/page_unhold for mappedread and page_busy/page_unbusy for update_pages. For mappedread we simply hold a page that is to be used as a source if it is resident and valid (and not busy). This is sufficient since we are only doing page -> user buffer copying. There is no page <-> backing storage I/O involved. update_pages is now better split to properly handle the putpages case (page -> arc) and the regular write case (arc -> page). For the latter we use complete protocol of marking an object with paging-in-progress and marking a page with io_start (busy count). Also, in this case we remove the write bit from all page mappings and clear dirty bits of the pages, the former is needed to ensure that the latter does the right thing. Additionally we update a page if it is cached instead of just freeing it as was done before. This needs to be verified. A minor detail: ZFS-backed pages should always be either fully valid or fully invalid. Assert this and use simpler API that does not deal with sub-page blocks. Reviewed by: kib MFC after: 26 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 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 Sun Feb 3 18:37:08 2013 (r246292) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 3 18:42:20 2013 (r246293) @@ -323,7 +323,7 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt } static vm_page_t -page_lookup(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) +page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) { vm_object_t obj; vm_page_t pp; @@ -333,7 +333,7 @@ page_lookup(vnode_t *vp, int64_t start, for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && - vm_page_is_valid(pp, (vm_offset_t)off, nbytes)) { + pp->valid) { if ((pp->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and @@ -344,24 +344,74 @@ page_lookup(vnode_t *vp, int64_t start, vm_page_sleep(pp, "zfsmwb"); continue; } - vm_page_busy(pp); - vm_page_undirty(pp); } else { - if (vm_page_is_cached(obj, OFF_TO_IDX(start))) - vm_page_cache_free(obj, OFF_TO_IDX(start), - OFF_TO_IDX(start) + 1); - pp = NULL; + pp = vm_page_alloc(obj, OFF_TO_IDX(start), + VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | + VM_ALLOC_NOBUSY); } + + if (pp != NULL) { + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_object_pip_add(obj, 1); + vm_page_io_start(pp); + pmap_remove_write(pp); + vm_page_clear_dirty(pp, off, nbytes); + } + break; + } + return (pp); +} + +static void +page_unbusy(vm_page_t pp) +{ + + vm_page_io_finish(pp); + vm_object_pip_subtract(pp->object, 1); +} + +static vm_page_t +page_hold(vnode_t *vp, int64_t start) +{ + vm_object_t obj; + vm_page_t pp; + + obj = vp->v_object; + VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + + for (;;) { + if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && + pp->valid) { + if ((pp->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_reference(pp); + vm_page_sleep(pp, "zfsmwb"); + continue; + } + + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_page_lock(pp); + vm_page_hold(pp); + vm_page_unlock(pp); + + } else + pp = NULL; break; } return (pp); } static void -page_unlock(vm_page_t pp) +page_unhold(vm_page_t pp) { - vm_page_wakeup(pp); + vm_page_lock(pp); + vm_page_unhold(pp); + vm_page_unlock(pp); } static caddr_t @@ -392,6 +442,7 @@ update_pages(vnode_t *vp, int64_t start, { vm_object_t obj; struct sf_buf *sf; + caddr_t va; int off; ASSERT(vp->v_mount != NULL); @@ -402,27 +453,44 @@ update_pages(vnode_t *vp, int64_t start, VM_OBJECT_LOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; - int nbytes = MIN(PAGESIZE - off, len); + int nbytes = imin(PAGESIZE - off, len); - if ((pp = page_lookup(vp, start, off, nbytes)) != NULL) { - caddr_t va; + if (segflg == UIO_NOCOPY) { + pp = vm_page_lookup(obj, OFF_TO_IDX(start)); + KASSERT(pp != NULL, + ("zfs update_pages: NULL page in putpages case")); + KASSERT(off == 0, + ("zfs update_pages: unaligned data in putpages case")); + KASSERT(pp->valid == VM_PAGE_BITS_ALL, + ("zfs update_pages: invalid page in putpages case")); + KASSERT(pp->busy > 0, + ("zfs update_pages: unbusy page in putpages case")); + KASSERT(!pmap_page_is_write_mapped(pp), + ("zfs update_pages: writable page in putpages case")); + VM_OBJECT_UNLOCK(obj); + + va = zfs_map_page(pp, &sf); + (void) dmu_write(os, oid, start, nbytes, va, tx); + zfs_unmap_page(sf); + VM_OBJECT_LOCK(obj); + vm_page_undirty(pp); + } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { VM_OBJECT_UNLOCK(obj); + va = zfs_map_page(pp, &sf); - if (segflg == UIO_NOCOPY) { - (void) dmu_write(os, oid, start+off, nbytes, - va+off, tx); - } else { - (void) dmu_read(os, oid, start+off, nbytes, - va+off, DMU_READ_PREFETCH); - } + (void) dmu_read(os, oid, start+off, nbytes, + va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); + VM_OBJECT_LOCK(obj); - page_unlock(pp); + page_unbusy(pp); } len -= nbytes; off = 0; } + if (segflg != UIO_NOCOPY) + vm_object_pip_wakeupn(obj, 0); VM_OBJECT_UNLOCK(obj); } @@ -524,7 +592,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); - if (pp = page_lookup(vp, start, off, bytes)) { + if (pp = page_hold(vp, start)) { struct sf_buf *sf; caddr_t va; @@ -533,7 +601,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); VM_OBJECT_LOCK(obj); - page_unlock(pp); + page_unhold(pp); } else { VM_OBJECT_UNLOCK(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 19:23:22 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6AEBEF6; Sun, 3 Feb 2013 19:23:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 519F07A2; Sun, 3 Feb 2013 19:23:20 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA10073; Sun, 03 Feb 2013 21:23:19 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U259q-0006yS-SJ; Sun, 03 Feb 2013 21:23:18 +0200 Message-ID: <510EB926.7030307@FreeBSD.org> Date: Sun, 03 Feb 2013 21:23:18 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r246293 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201302031842.r13IgK7e089609@svn.freebsd.org> In-Reply-To: <201302031842.r13IgK7e089609@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 19:23:22 -0000 on 03/02/2013 20:42 Andriy Gapon said the following: > - vm_page_busy(pp); > - vm_page_undirty(pp); ZFS lookup_page previously had two interesting bugs that almost canceled each other. The first bug was that vm_page_undirty was called even if we read from a ZFS-backed page into a user buffer. Obviously this action didn't actually magically make the page clean. The second bug was that vm_page_undirty was called without doing pmap_remove_write() first and so, if the page was actually modified, the modified bit leaked back from a pmap to the dirty bits. So no harm was done. On the other hand, if a ZFS-backed dirty page was over-written with a content from ARC (which was first put there from a userland buffer), then the page stayed marked dirty for all the same reason (lack of pmap_remove_write). And so exactly the same data would have to be re-written to ARC / disk again. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 19:28:23 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 193EA29F; Sun, 3 Feb 2013 19:28:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F38EE7C8; Sun, 3 Feb 2013 19:28:21 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA10107; Sun, 03 Feb 2013 21:28:20 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U25Ei-0006z3-3s; Sun, 03 Feb 2013 21:28:20 +0200 Message-ID: <510EBA53.5020003@FreeBSD.org> Date: Sun, 03 Feb 2013 21:28:19 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r246293 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201302031842.r13IgK7e089609@svn.freebsd.org> <510EB926.7030307@FreeBSD.org> In-Reply-To: <510EB926.7030307@FreeBSD.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 19:28:23 -0000 on 03/02/2013 21:23 Andriy Gapon said the following: > on 03/02/2013 20:42 Andriy Gapon said the following: >> - vm_page_busy(pp); >> - vm_page_undirty(pp); > > ZFS lookup_page previously had two interesting bugs that almost canceled each other. > > The first bug was that vm_page_undirty was called even if we read from a > ZFS-backed page into a user buffer. Obviously this action didn't actually > magically make the page clean. > The second bug was that vm_page_undirty was called without doing > pmap_remove_write() first and so, if the page was actually modified, the > modified bit leaked back from a pmap to the dirty bits. So no harm was done. > > On the other hand, if a ZFS-backed dirty page was over-written with a content > from ARC (which was first put there from a userland buffer), then the page > stayed marked dirty for all the same reason (lack of pmap_remove_write). And so > exactly the same data would have to be re-written to ARC / disk again. Eh, just realized that on the third hand, this cancelled yet another bug :-) vm_page_undirty was called on the whole page even when only a part of it overlapped with the buffer and thus was supposed to become clean. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 20:06:17 2013 Return-Path: Delivered-To: svn-src-all@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 1466E8F3; Sun, 3 Feb 2013 20:06:17 +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 918B6872; Sun, 3 Feb 2013 20:06:15 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r13JxUPq008446; Mon, 4 Feb 2013 06:59:31 +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 mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r13JxJ0e029749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Feb 2013 06:59:21 +1100 Date: Mon, 4 Feb 2013 06:59:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon Subject: Re: svn commit: r246289 - head/sys/ufs/ffs In-Reply-To: <510E9D47.2030403@FreeBSD.org> Message-ID: <20130204062149.U2673@besplex.bde.org> References: <201302031716.r13HGXNP060303@svn.freebsd.org> <510E9D47.2030403@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=R7tbgqtX c=1 sm=1 a=3vEzreLPZ8cA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Nw6HGA-A-RMA:10 a=6I5d2MoRAAAA:8 a=Rmwyy1D4dMcYqB4_SWQA:9 a=CjuIK1q_8ugA:10 a=NUYoatYP61qPMpeu:21 a=N0skziyQfKIhW4rn:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Kirk McKusick X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 20:06:17 -0000 On Sun, 3 Feb 2013, Andriy Gapon wrote: > on 03/02/2013 19:16 Kirk McKusick said the following: >> Author: mckusick >> Date: Sun Feb 3 17:16:32 2013 >> New Revision: 246289 >> URL: http://svnweb.freebsd.org/changeset/base/246289 >> >> Log: >> For UFS2 i_blocks is unsigned. The current "sanity" check that it >> has gone below zero after the blocks in its inode are freed is a >> no-op which the compiler fails to warn about because of the use of >> the DIP macro. Change the sanity check to compare the number of > > Just a note that clang actually warned about this one. > It has a few more similar warnings for ufs/ffs code. I wondered how the DIP macro hid the warning. >> blocks being freed against the value i_blocks. If the number of >> blocks being freed exceeds i_blocks, just set i_blocks to zero. >> >> Reported by: Pedro Giffuni (pfg@) >> MFC after: 2 weeks Perhaps the larger bugs pointed to this warning were lost in translation: - di_blocks overflows for ffs1. This is now physically possible. di_blocks has type int32_t, as required to match st_blocks in the old struct stat (both will overflow at the same point). Since di_blocks counts DEV_BSIZE-blocks, overflow occurs at file size about 1TB for files without many holes. - st_blocks overflows for the old stat() syscall. For the new stat() syscall, st_blocks has type blkcnt_t = int64_t, so overflow is not physically possible. But cvtstat() silently overflows when the 64-bit st_blocks doesn't fit in the 32-bit one. - di_blocks for ffs2 has type uint64_t. This has a sign mismatch with both the ffs1 di_blocks and blkcnt_t. blkcnt_t is specified to be signed. i_blocks for ffs has the same type as di_blocks for ffs2 (unsigned ...), so it is mismatched too. The sign mismatches should cause more compiler warnings. These would point to further overflow possibilities. However, overflow is physically impossible even for va_bytes = i_blocks * DEV_BSIZE. So there are no extra overflows from the sign mismatches. Using the unsigned types just asks for more sign extension bugs like the one fixed here. ext2fs has the same bug. It is unnecessary in ext2fs, since there are no fragments so i_blocks can just count in units of fs blocks and these are naturally limited by the fs block type. The fs block type is uint32_t in ext2fs and int32_t in ffs1. So ext2fs really needs an unsigned type for i_blocks to get an extra bit without going to 64 bits. shell-init: could not get current directory: No such file or directory. Avoiding overflow depends on st_blocks having more than 32+9 value bits, so 32-bit stat() could still overflow and needs a clamp. However, the disk format is to store i_count in DEV_BSIZE units, so this doesn't work -- it has the same overflow problem as cvtstat(), at 32 bits instead of 31. Limiting the file size to ~1TB is not a good fix for this, since 1TB non-sparse files are not very common or useful, and the limit would also apply to sparse files. So block allocators should check that i_blocks won't overflow before increasing it. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 20:35:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CF868A8; Sun, 3 Feb 2013 20:35:38 +0000 (UTC) (envelope-from pfg@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 3D1D296C; Sun, 3 Feb 2013 20:35: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 r13KZc0r031801; Sun, 3 Feb 2013 20:35:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13KZc6o031800; Sun, 3 Feb 2013 20:35:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302032035.r13KZc6o031800@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 3 Feb 2013 20:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246296 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 20:35:38 -0000 Author: pfg Date: Sun Feb 3 20:35:37 2013 New Revision: 246296 URL: http://svnweb.freebsd.org/changeset/base/246296 Log: crunchide(1): support non-custom elf object layout The crunchide utility presumes the last 3 chunks of an ELF object layout are section headers, symbol table, and then string table. However, this is not specified in the ELF standards, and linkers may generate different layouts when doing partial linking (-r). This change is required to build FreeBSD with mclinker or the gold linker. PR: bin/174011 Submitted by: Pete Chou Reviewed by: Cristoph Mallon MFC after: 2 weeks Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 20:13:33 2013 (r246295) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 20:35:37 2013 (r246296) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -82,11 +83,9 @@ __FBSDID("$FreeBSD$"); #define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) #define htoxe32(x) ((data == ELFDATA2MSB) ? htobe32(x) : htole32(x)) -struct listelem { - struct listelem *next; - void *mem; - off_t file; - size_t size; +struct shlayout { + Elf_Shdr *shdr; + void *bufp; }; static ssize_t @@ -235,17 +234,20 @@ int ELFNAMEEND(hide)(int fd, const char *fn) { Elf_Ehdr ehdr; - Elf_Shdr *shdrp = NULL, *symtabshdr, *strtabshdr; + struct shlayout *layoutp = NULL; + Elf_Shdr *shdrp = NULL, *symtabshdr, *strtabshdr, *shstrtabshdr; + Elf_Shdr shdrshdr; Elf_Sym *symtabp = NULL; - char *strtabp = NULL; - Elf_Size nsyms, ewi; + char *shstrtabp = NULL, *strtabp = NULL; + Elf_Size nsyms, ewi; + Elf_Off off; ssize_t shdrsize; - int rv, i, weird; - size_t nstrtab_size, nstrtab_nextoff, fn_size; + int rv, i, weird, l, m, r, strtabidx; + size_t nstrtab_size, nstrtab_nextoff, fn_size, size; char *nstrtabp = NULL; unsigned char data; - Elf_Off maxoff, stroff; const char *weirdreason = NULL; + void *buf; rv = 0; if (xreadatoff(fd, &ehdr, 0, sizeof ehdr, fn) != sizeof ehdr) @@ -260,62 +262,123 @@ ELFNAMEEND(hide)(int fd, const char *fn) shdrsize) goto bad; - symtabshdr = strtabshdr = NULL; + symtabshdr = strtabshdr = shstrtabshdr = NULL; weird = 0; - maxoff = stroff = 0; for (i = 0; i < xe16toh(ehdr.e_shnum); i++) { - if (xewtoh(shdrp[i].sh_offset) > maxoff) - maxoff = xewtoh(shdrp[i].sh_offset); switch (xe32toh(shdrp[i].sh_type)) { case SHT_SYMTAB: - if (symtabshdr != NULL) + if (symtabshdr != NULL) { weird = 1; + weirdreason = "multiple symbol tables"; + } symtabshdr = &shdrp[i]; strtabshdr = &shdrp[xe32toh(shdrp[i].sh_link)]; - - /* Check whether the string table is the last section */ - stroff = xewtoh(shdrp[xe32toh(shdrp[i].sh_link)].sh_offset); - if (!weird && xe32toh(shdrp[i].sh_link) != (xe16toh(ehdr.e_shnum) - 1)) { - weird = 1; - weirdreason = "string table not last section"; - } + break; + case SHT_STRTAB: + if (i == xe16toh(ehdr.e_shstrndx)) + shstrtabshdr = &shdrp[i]; break; } } - if (! weirdreason) - weirdreason = "unsupported"; if (symtabshdr == NULL) goto out; - if (strtabshdr == NULL) + if (strtabshdr == NULL) { weird = 1; - if (!weird && stroff != maxoff) { + weirdreason = "string table does not exist"; + } + if (shstrtabshdr == NULL) { weird = 1; - weirdreason = "string table section not last in file"; - } + weirdreason = "section header string table does not exist"; + } + if (weirdreason == NULL) + weirdreason = "unsupported"; if (weird) { fprintf(stderr, "%s: weird executable (%s)\n", fn, weirdreason); goto bad; } /* + * sort section layout table by offset + */ + layoutp = xmalloc(sizeof(struct shlayout) * (xe16toh(ehdr.e_shnum) + 1), + fn, "layout table"); + if (layoutp == NULL) + goto bad; + + /* add a pseudo entry to represent the section header table */ + shdrshdr.sh_offset = ehdr.e_shoff; + shdrshdr.sh_size = htoxew(shdrsize); + shdrshdr.sh_addralign = htoxew(ELFSIZE / 8); + layoutp[xe16toh(ehdr.e_shnum)].shdr = &shdrshdr; + + /* insert and sort normal section headers */ + for (i = xe16toh(ehdr.e_shnum) - 1; i >= 0; i--) { + l = i + 1; + r = xe16toh(ehdr.e_shnum); + while (l <= r) { + m = ( l + r) / 2; + if (xewtoh(shdrp[i].sh_offset) > + xewtoh(layoutp[m].shdr->sh_offset)) + l = m + 1; + else + r = m - 1; + } + + if (r != i) { + memmove(&layoutp[i], &layoutp[i + 1], + sizeof(struct shlayout) * (r - i)); + } + + layoutp[r].shdr = &shdrp[i]; + layoutp[r].bufp = NULL; + } + + /* * load up everything we need */ - /* symbol table */ - if ((symtabp = xmalloc(xewtoh(symtabshdr->sh_size), fn, "symbol table")) - == NULL) - goto bad; - if ((size_t)xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), - xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) + /* load section string table for debug use */ + if ((shstrtabp = xmalloc(xewtoh(shstrtabshdr->sh_size), fn, + "section string table")) == NULL) + goto bad; + if ((size_t)xreadatoff(fd, shstrtabp, xewtoh(shstrtabshdr->sh_offset), + xewtoh(shstrtabshdr->sh_size), fn) != xewtoh(shstrtabshdr->sh_size)) goto bad; - /* string table */ - if ((strtabp = xmalloc(xewtoh(strtabshdr->sh_size), fn, "string table")) - == NULL) - goto bad; - if ((size_t)xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), - xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size)) - goto bad; + /* we need symtab, strtab, and everything behind strtab */ + strtabidx = INT_MAX; + for (i = 0; i < xe16toh(ehdr.e_shnum) + 1; i++) { + if (layoutp[i].shdr == &shdrshdr) { + /* not load section header again */ + layoutp[i].bufp = shdrp; + continue; + } + if (layoutp[i].shdr == shstrtabshdr) { + /* not load section string table again */ + layoutp[i].bufp = shstrtabp; + continue; + } + + if (layoutp[i].shdr == strtabshdr) + strtabidx = i; + if (layoutp[i].shdr == symtabshdr || i >= strtabidx) { + off = xewtoh(layoutp[i].shdr->sh_offset); + size = xewtoh(layoutp[i].shdr->sh_size); + layoutp[i].bufp = xmalloc(size, fn, + shstrtabp + xewtoh(layoutp[i].shdr->sh_name)); + if (layoutp[i].bufp == NULL) + goto bad; + if ((size_t)xreadatoff(fd, layoutp[i].bufp, off, size, fn) != + size) + goto bad; + + /* set symbol table and string table */ + if (layoutp[i].shdr == symtabshdr) + symtabp = layoutp[i].bufp; + else if (layoutp[i].shdr == strtabshdr) + strtabp = layoutp[i].bufp; + } + } nstrtab_size = 256; nstrtabp = xmalloc(nstrtab_size, fn, "new string table"); @@ -365,28 +428,62 @@ ELFNAMEEND(hide)(int fd, const char *fn) strtabshdr->sh_size = htoxew(nstrtab_nextoff); /* - * write new tables to the file + * update section header table in ascending order of offset */ - if (xwriteatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != - shdrsize) - goto bad; - if ((size_t)xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), - xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) - goto bad; - /* write new symbol table strings */ - if ((size_t)xwriteatoff(fd, nstrtabp, xewtoh(strtabshdr->sh_offset), - xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size)) - goto bad; + for (i = strtabidx + 1; i < xe16toh(ehdr.e_shnum) + 1; i++) { + Elf_Off off, align; + off = xewtoh(layoutp[i - 1].shdr->sh_offset) + + xewtoh(layoutp[i - 1].shdr->sh_size); + align = xewtoh(layoutp[i].shdr->sh_addralign); + off = (off + (align - 1)) & ~(align - 1); + layoutp[i].shdr->sh_offset = htoxew(off); + } + + /* + * write data to the file in descending order of offset + */ + for (i = xe16toh(ehdr.e_shnum); i >= 0; i--) { + if (layoutp[i].shdr == strtabshdr) { + /* new string table */ + buf = nstrtabp; + } else + buf = layoutp[i].bufp; + + if (layoutp[i].shdr == &shdrshdr || + layoutp[i].shdr == symtabshdr || i >= strtabidx) { + if (buf == NULL) + goto bad; + + /* + * update the offset of section header table in elf + * header if needed. + */ + if (layoutp[i].shdr == &shdrshdr && + ehdr.e_shoff != shdrshdr.sh_offset) { + ehdr.e_shoff = shdrshdr.sh_offset; + off = (ELFSIZE == 32) ? 32 : 44; + size = sizeof(Elf_Off); + if ((size_t)xwriteatoff(fd, &ehdr.e_shoff, off, size, + fn) != size) + goto bad; + } + + off = xewtoh(layoutp[i].shdr->sh_offset); + size = xewtoh(layoutp[i].shdr->sh_size); + if ((size_t)xwriteatoff(fd, buf, off, size, fn) != size) + goto bad; + } + } out: - if (shdrp != NULL) - free(shdrp); - if (symtabp != NULL) - free(symtabp); - if (strtabp != NULL) - free(strtabp); - if (nstrtabp != NULL) - free(nstrtabp); + if (layoutp != NULL) { + for (i = 0; i < xe16toh(ehdr.e_shnum) + 1; i++) { + if (layoutp[i].bufp != NULL) + free(layoutp[i].bufp); + } + free(layoutp); + } + free(nstrtabp); return (rv); bad: From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 20:40:42 2013 Return-Path: Delivered-To: svn-src-all@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 ACBF0A39; Sun, 3 Feb 2013 20:40:42 +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 70E60984; Sun, 3 Feb 2013 20:40: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 r13Kegi5032649; Sun, 3 Feb 2013 20:40:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13KegBV032648; Sun, 3 Feb 2013 20:40:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302032040.r13KegBV032648@svn.freebsd.org> From: Dimitry Andric Date: Sun, 3 Feb 2013 20:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246297 - head/lib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 20:40:42 -0000 Author: dim Date: Sun Feb 3 20:40:41 2013 New Revision: 246297 URL: http://svnweb.freebsd.org/changeset/base/246297 Log: Add several missing symbols to libcxxrt's symbol version map, and remove a few duplicates. This should fix building world with -stdlib=libc++ after r246028. Submitted by: Yamaya Takashi MFC after: 1 week X-MFC-With: r246028 Modified: head/lib/libcxxrt/Version.map Modified: head/lib/libcxxrt/Version.map ============================================================================== --- head/lib/libcxxrt/Version.map Sun Feb 3 20:35:37 2013 (r246296) +++ head/lib/libcxxrt/Version.map Sun Feb 3 20:40:41 2013 (r246297) @@ -208,7 +208,6 @@ CXXABI_1.3 { "typeinfo name for __cxxabiv1::__vmi_class_type_info"; "std::type_info::type_info(std::type_info const&)"; - "std::type_info::type_info(std::type_info const&)"; "std::type_info::operator=(std::type_info const&)"; @@ -238,18 +237,16 @@ CXXRT_1.0 { "std::type_info::operator!=(std::type_info const&) const"; "std::bad_cast::bad_cast(std::bad_cast const&)"; "std::bad_cast::bad_cast()"; - "std::bad_cast::bad_cast(std::bad_cast const&)"; - "std::bad_cast::bad_cast()"; "std::bad_cast::operator=(std::bad_cast const&)"; - "std::exception::exception(std::exception const&)"; - "std::exception::exception()"; + "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; + "std::bad_typeid::bad_typeid()"; + "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::exception::exception(std::exception const&)"; "std::exception::exception()"; "std::exception::operator=(std::exception const&)"; - - - - + "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; + "std::bad_alloc::bad_alloc()"; + "std::bad_alloc::operator=(std::bad_alloc const&)"; }; __cxa_allocate_dependent_exception; @@ -281,15 +278,16 @@ GLIBCXX_3.4 { "std::type_info::~type_info()"; "std::bad_cast::~bad_cast()"; + "std::bad_typeid::~bad_typeid()"; "std::exception::~exception()"; + "std::bad_alloc::~bad_alloc()"; + + "std::exception::what() const"; std::set_new_handler*; std::set_terminate*; std::set_unexpected*; - std::exception*; - std::bad_alloc; - std::bad_typeid; - std::type_info*; + std::type_info::__*; "vtable for std::bad_alloc"; "vtable for std::bad_cast"; @@ -299,10 +297,10 @@ GLIBCXX_3.4 { "typeinfo for std::bad_alloc"; "typeinfo for std::bad_typeid"; - "typeinfo for std::exception"; "typeinfo for std::bad_cast"; "typeinfo for std::exception"; "typeinfo for std::type_info"; + "typeinfo name for std::bad_alloc"; "typeinfo name for std::bad_typeid"; "typeinfo name for std::bad_cast"; "typeinfo name for std::exception"; From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 21:16:35 2013 Return-Path: Delivered-To: svn-src-all@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 37EFA71E; Sun, 3 Feb 2013 21:16:35 +0000 (UTC) (envelope-from pfg@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 1A4E7AA5; Sun, 3 Feb 2013 21:16: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 r13LGYOo044902; Sun, 3 Feb 2013 21:16:34 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13LGYKQ044901; Sun, 3 Feb 2013 21:16:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302032116.r13LGYKQ044901@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 3 Feb 2013 21:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246298 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 21:16:35 -0000 Author: pfg Date: Sun Feb 3 21:16:33 2013 New Revision: 246298 URL: http://svnweb.freebsd.org/changeset/base/246298 Log: crunchide(1): Put e_shnum into a local variable. This simplifies the code a bit. Submitted by: Cristoph Mallon MFC after: 2 weeks Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 20:40:41 2013 (r246297) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sun Feb 3 21:16:33 2013 (r246298) @@ -248,14 +248,16 @@ ELFNAMEEND(hide)(int fd, const char *fn) unsigned char data; const char *weirdreason = NULL; void *buf; + Elf_Half shnum; rv = 0; if (xreadatoff(fd, &ehdr, 0, sizeof ehdr, fn) != sizeof ehdr) goto bad; data = ehdr.e_ident[EI_DATA]; + shnum = xe16toh(ehdr.e_shnum); - shdrsize = xe16toh(ehdr.e_shnum) * xe16toh(ehdr.e_shentsize); + shdrsize = shnum * xe16toh(ehdr.e_shentsize); if ((shdrp = xmalloc(shdrsize, fn, "section header table")) == NULL) goto bad; if (xreadatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != @@ -264,7 +266,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) symtabshdr = strtabshdr = shstrtabshdr = NULL; weird = 0; - for (i = 0; i < xe16toh(ehdr.e_shnum); i++) { + for (i = 0; i < shnum; i++) { switch (xe32toh(shdrp[i].sh_type)) { case SHT_SYMTAB: if (symtabshdr != NULL) { @@ -300,7 +302,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) /* * sort section layout table by offset */ - layoutp = xmalloc(sizeof(struct shlayout) * (xe16toh(ehdr.e_shnum) + 1), + layoutp = xmalloc((shnum + 1) * sizeof(struct shlayout), fn, "layout table"); if (layoutp == NULL) goto bad; @@ -309,12 +311,12 @@ ELFNAMEEND(hide)(int fd, const char *fn) shdrshdr.sh_offset = ehdr.e_shoff; shdrshdr.sh_size = htoxew(shdrsize); shdrshdr.sh_addralign = htoxew(ELFSIZE / 8); - layoutp[xe16toh(ehdr.e_shnum)].shdr = &shdrshdr; + layoutp[shnum].shdr = &shdrshdr; /* insert and sort normal section headers */ - for (i = xe16toh(ehdr.e_shnum) - 1; i >= 0; i--) { + for (i = shnum; i-- != 0;) { l = i + 1; - r = xe16toh(ehdr.e_shnum); + r = shnum; while (l <= r) { m = ( l + r) / 2; if (xewtoh(shdrp[i].sh_offset) > @@ -332,6 +334,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) layoutp[r].shdr = &shdrp[i]; layoutp[r].bufp = NULL; } + ++shnum; /* * load up everything we need @@ -347,7 +350,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) /* we need symtab, strtab, and everything behind strtab */ strtabidx = INT_MAX; - for (i = 0; i < xe16toh(ehdr.e_shnum) + 1; i++) { + for (i = 0; i < shnum; i++) { if (layoutp[i].shdr == &shdrshdr) { /* not load section header again */ layoutp[i].bufp = shdrp; @@ -430,7 +433,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) /* * update section header table in ascending order of offset */ - for (i = strtabidx + 1; i < xe16toh(ehdr.e_shnum) + 1; i++) { + for (i = strtabidx + 1; i < shnum; i++) { Elf_Off off, align; off = xewtoh(layoutp[i - 1].shdr->sh_offset) + xewtoh(layoutp[i - 1].shdr->sh_size); @@ -442,7 +445,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) /* * write data to the file in descending order of offset */ - for (i = xe16toh(ehdr.e_shnum); i >= 0; i--) { + for (i = shnum; i-- != 0;) { if (layoutp[i].shdr == strtabshdr) { /* new string table */ buf = nstrtabp; @@ -477,7 +480,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) out: if (layoutp != NULL) { - for (i = 0; i < xe16toh(ehdr.e_shnum) + 1; i++) { + for (i = 0; i < shnum; i++) { if (layoutp[i].bufp != NULL) free(layoutp[i].bufp); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 21:30:02 2013 Return-Path: Delivered-To: svn-src-all@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 E02DFC7D; Sun, 3 Feb 2013 21:30:02 +0000 (UTC) (envelope-from pfg@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 D370FB08; Sun, 3 Feb 2013 21:30: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 r13LU2S3048632; Sun, 3 Feb 2013 21:30:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13LU29q048631; Sun, 3 Feb 2013 21:30:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302032130.r13LU29q048631@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 3 Feb 2013 21:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246299 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 21:30:03 -0000 Author: pfg Date: Sun Feb 3 21:30:02 2013 New Revision: 246299 URL: http://svnweb.freebsd.org/changeset/base/246299 Log: UFS: Remove dead assignment. Submitted by: Christoph Mallon MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sun Feb 3 21:16:33 2013 (r246298) +++ head/sys/ufs/ufs/ufs_lookup.c Sun Feb 3 21:30:02 2013 (r246299) @@ -1434,7 +1434,6 @@ ufs_checkpath(ino_t source_ino, ino_t pa return (0); if (target->i_number == ROOTINO) return (0); - error = 0; for (;;) { error = ufs_dir_dd_ino(vp, cred, &dd_ino); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 21:30:30 2013 Return-Path: Delivered-To: svn-src-all@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 36A8EDEE; Sun, 3 Feb 2013 21:30:30 +0000 (UTC) (envelope-from marius@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 2827BB0F; Sun, 3 Feb 2013 21:30: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 r13LUUqF050142; Sun, 3 Feb 2013 21:30:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13LUUTj050140; Sun, 3 Feb 2013 21:30:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201302032130.r13LUUTj050140@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Feb 2013 21:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246300 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 21:30:30 -0000 Author: marius Date: Sun Feb 3 21:30:29 2013 New Revision: 246300 URL: http://svnweb.freebsd.org/changeset/base/246300 Log: - Make pci_ns8250_ids[] const. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Sun Feb 3 21:30:02 2013 (r246299) +++ head/sys/dev/uart/uart_bus_pci.c Sun Feb 3 21:30:29 2013 (r246300) @@ -52,7 +52,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), DEVMETHOD(device_resume, uart_bus_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t uart_pci_driver = { @@ -71,7 +71,7 @@ struct pci_id { int rclk; }; -static struct pci_id pci_ns8250_ids[] = { +static const struct pci_id pci_ns8250_ids[] = { { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14, 128 * DEFAULT_RCLK }, { 0x1028, 0x0012, 0xffff, 0, "Dell RAC 4 Daughter Card Virtual UART", 0x14, @@ -134,8 +134,8 @@ static struct pci_id pci_ns8250_ids[] = { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; -static struct pci_id * -uart_pci_match(device_t dev, struct pci_id *id) +const static struct pci_id * +uart_pci_match(device_t dev, const struct pci_id *id) { uint16_t device, subdev, subven, vendor; @@ -160,7 +160,7 @@ static int uart_pci_probe(device_t dev) { struct uart_softc *sc; - struct pci_id *id; + const struct pci_id *id; sc = device_get_softc(dev); @@ -178,4 +178,4 @@ uart_pci_probe(device_t dev) return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0)); } -DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, 0, 0); +DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Feb 3 21:43:56 2013 Return-Path: Delivered-To: svn-src-all@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 A8EB5327; Sun, 3 Feb 2013 21:43:56 +0000 (UTC) (envelope-from marius@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 84A3FB79; Sun, 3 Feb 2013 21:43: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 r13LhuWW053812; Sun, 3 Feb 2013 21:43:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13LhuQ3053811; Sun, 3 Feb 2013 21:43:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201302032143.r13LhuQ3053811@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Feb 2013 21:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246301 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 21:43:56 -0000 Author: marius Date: Sun Feb 3 21:43:55 2013 New Revision: 246301 URL: http://svnweb.freebsd.org/changeset/base/246301 Log: Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant values to SYSCTL_ULONG(9) where possible. Submitted by: bde Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sun Feb 3 21:30:29 2013 (r246300) +++ head/sys/kern/kern_malloc.c Sun Feb 3 21:43:55 2013 (r246301) @@ -186,15 +186,16 @@ struct { */ static uma_zone_t mt_zone; -static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; -SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, - &vm_min_kernel_address, 0, "Min kernel address"); +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, NULL, + VM_MIN_KERNEL_ADDRESS, "Min kernel address"); +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, #ifndef __sparc64__ -static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; + NULL, VM_MAX_KERNEL_ADDRESS, +#else + &vm_max_kernel_address, 0, #endif -SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, - &vm_max_kernel_address, 0, "Max kernel address"); + "Max kernel address"); u_long vm_kmem_size; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, @@ -592,7 +593,6 @@ free(void *addr, struct malloc_type *mtp panic("free: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (!(slab->us_flags & UMA_SLAB_MALLOC)) { #ifdef INVARIANTS struct malloc_type **mtpp = addr; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 00:34:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EEC0563; Mon, 4 Feb 2013 00:34:34 +0000 (UTC) (envelope-from eadler@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 645DB157; Mon, 4 Feb 2013 00:34: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 r140YXOl006540; Mon, 4 Feb 2013 00:34:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YXFL006537; Mon, 4 Feb 2013 00:34:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YXFL006537@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246309 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:34 -0000 Author: eadler Date: Mon Feb 4 00:34:33 2013 New Revision: 246309 URL: http://svnweb.freebsd.org/changeset/base/246309 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/9/sbin/devd/devd.cc stable/9/sbin/devd/devd.hh Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Sun Feb 3 23:54:30 2013 (r246308) +++ stable/9/sbin/devd/devd.cc Mon Feb 4 00:34:33 2013 (r246309) @@ -151,7 +151,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -162,7 +162,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -426,7 +426,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -567,7 +567,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/9/sbin/devd/devd.hh ============================================================================== --- stable/9/sbin/devd/devd.hh Sun Feb 3 23:54:30 2013 (r246308) +++ stable/9/sbin/devd/devd.hh Mon Feb 4 00:34:33 2013 (r246309) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -169,7 +169,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 00:34:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8CE3564; Mon, 4 Feb 2013 00:34:35 +0000 (UTC) (envelope-from eadler@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 9A212158; Mon, 4 Feb 2013 00:34: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 r140YZlP006602; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YZWO006594; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YZWO006594@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246310 - stable/8/sbin/devd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:35 -0000 Author: eadler Date: Mon Feb 4 00:34:34 2013 New Revision: 246310 URL: http://svnweb.freebsd.org/changeset/base/246310 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.hh Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Feb 4 00:34:33 2013 (r246309) +++ stable/8/sbin/devd/devd.cc Mon Feb 4 00:34:34 2013 (r246310) @@ -120,7 +120,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -131,7 +131,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -343,7 +343,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -477,7 +477,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Feb 4 00:34:33 2013 (r246309) +++ stable/8/sbin/devd/devd.hh Mon Feb 4 00:34:34 2013 (r246310) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -168,7 +168,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 00:34:36 2013 Return-Path: Delivered-To: svn-src-all@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 5E880565; Mon, 4 Feb 2013 00:34:36 +0000 (UTC) (envelope-from eadler@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 387F7159; Mon, 4 Feb 2013 00:34: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 r140YaoC006612; Mon, 4 Feb 2013 00:34:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YZbe006610; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YZbe006610@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246311 - stable/7/sbin/devd X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:36 -0000 Author: eadler Date: Mon Feb 4 00:34:35 2013 New Revision: 246311 URL: http://svnweb.freebsd.org/changeset/base/246311 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/7/sbin/devd/devd.cc stable/7/sbin/devd/devd.hh Directory Properties: stable/7/sbin/devd/ (props changed) Modified: stable/7/sbin/devd/devd.cc ============================================================================== --- stable/7/sbin/devd/devd.cc Mon Feb 4 00:34:34 2013 (r246310) +++ stable/7/sbin/devd/devd.cc Mon Feb 4 00:34:35 2013 (r246311) @@ -120,7 +120,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -131,7 +131,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -342,7 +342,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -476,7 +476,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/7/sbin/devd/devd.hh ============================================================================== --- stable/7/sbin/devd/devd.hh Mon Feb 4 00:34:34 2013 (r246310) +++ stable/7/sbin/devd/devd.hh Mon Feb 4 00:34:35 2013 (r246311) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -168,7 +168,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 01:23:24 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A9EF8861; Mon, 4 Feb 2013 01:23:24 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 66F08334; Mon, 4 Feb 2013 01:23:24 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r141NNs3076280; Mon, 4 Feb 2013 01:23:23 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id ygkna2h59626rx83acrxh68vww; Mon, 04 Feb 2013 01:23:23 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: svn commit: r245803 - in head: . gnu/usr.bin share/man/man5 share/mk usr.bin/dtc Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201301221749.r0MHnpbC053016@svn.freebsd.org> Date: Sun, 3 Feb 2013 17:23:23 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <10F3BA43-0299-4492-8064-EBFAD7AC5AC7@kientzle.com> References: <201301221749.r0MHnpbC053016@svn.freebsd.org> To: David Chisnall X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 01:23:24 -0000 I'm finding it rather annoying that dtc isn't installed on systems that use device trees. Would there be any negative fallout from installing /usr/bin/dtc as part of the regular world? Tim P.S. In particular, I'm moving away from compiled-in device trees (in favor of having the loader read it from a separate file) in part so that the device tree file can be adjusted without having to recompile the kernel. On Jan 22, 2013, at 9:49 AM, David Chisnall wrote: > Author: theraven > Date: Tue Jan 22 17:49:51 2013 > New Revision: 245803 > URL: http://svnweb.freebsd.org/changeset/base/245803 >=20 > Log: > Import new (BSDL) device tree compiler. Now built by default, so = that it can't > be used on the host system (and not installed on the device, if = required). The > GPL'd one is still available if there are any devices that need it = (make > universe passes with it, including kernels that use fdt, but there = may be some > out-of-tree ones). WITH_GPL_DTC can be used to select the old one, = for now. >=20 > Probably won't be MFC'd, but we'll remove the GPL'd version in head = after the > new one has had a lot more testing and ship it in 10.0. >=20 > Added: > head/usr.bin/dtc/ > head/usr.bin/dtc/HACKING (contents, props changed) > head/usr.bin/dtc/Makefile (contents, props changed) > head/usr.bin/dtc/checking.cc (contents, props changed) > head/usr.bin/dtc/checking.hh (contents, props changed) > head/usr.bin/dtc/dtb.cc (contents, props changed) > head/usr.bin/dtc/dtb.hh (contents, props changed) > head/usr.bin/dtc/dtc.1 (contents, props changed) > head/usr.bin/dtc/dtc.cc (contents, props changed) > head/usr.bin/dtc/fdt.cc (contents, props changed) > head/usr.bin/dtc/fdt.hh (contents, props changed) > head/usr.bin/dtc/input_buffer.cc (contents, props changed) > head/usr.bin/dtc/input_buffer.hh (contents, props changed) > head/usr.bin/dtc/string.cc (contents, props changed) > head/usr.bin/dtc/string.hh (contents, props changed) > head/usr.bin/dtc/util.hh (contents, props changed) > Modified: > head/Makefile.inc1 > head/gnu/usr.bin/Makefile > head/share/man/man5/src.conf.5 > head/share/mk/bsd.own.mk >=20 > Modified: head/Makefile.inc1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/Makefile.inc1 Tue Jan 22 17:21:08 2013 = (r245802) > +++ head/Makefile.inc1 Tue Jan 22 17:49:51 2013 = (r245803) > @@ -1112,7 +1112,10 @@ _dtrace_tools=3D cddl/usr.bin/sgsmsg cddl/ > lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge > .endif >=20 > -.if ${MK_FDT} !=3D "no" > +# Default to building the BSDL DTC, but build the GPL one if users = explicitly > +# request it. > +_dtc=3D /usr.bin/dtc > +.if ${MK_GPL_DTC} !=3D "no" > _dtc=3D gnu/usr.bin/dtc > .endif >=20 >=20 > Modified: head/gnu/usr.bin/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/gnu/usr.bin/Makefile Tue Jan 22 17:21:08 2013 = (r245802) > +++ head/gnu/usr.bin/Makefile Tue Jan 22 17:49:51 2013 = (r245803) > @@ -30,7 +30,7 @@ _groff=3D groff > _cvs=3D cvs > .endif >=20 > -.if ${MK_FDT} !=3D "no" > +.if ${MK_GPL_DTC} !=3D "no" > _dtc=3D dtc > .endif >=20 >=20 > Modified: head/share/man/man5/src.conf.5 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man5/src.conf.5 Tue Jan 22 17:21:08 2013 = (r245802) > +++ head/share/man/man5/src.conf.5 Tue Jan 22 17:49:51 2013 = (r245803) > @@ -476,6 +476,9 @@ Set to not build GPIB bus support. > Set to not build > .Xr gpioctl 8 > as part of the base system. > +.It Va WITH_GPL_DTC > +Set to build the GPL'd version of the device tree compiler from = elinux.org, > +instead of the BSD licensed one. > .It Va WITHOUT_GROFF > .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 = 2011-02-22 08:13:49Z uqs > Set to not build >=20 > Modified: head/share/mk/bsd.own.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/mk/bsd.own.mk Tue Jan 22 17:21:08 2013 = (r245802) > +++ head/share/mk/bsd.own.mk Tue Jan 22 17:49:51 2013 = (r245803) > @@ -364,6 +364,7 @@ __DEFAULT_NO_OPTIONS =3D \ > BSD_GREP \ > CLANG_EXTRAS \ > CTF \ > + GPL_DTC \ > HESIOD \ > ICONV \ > IDEA \ >=20 > Added: head/usr.bin/dtc/HACKING > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/HACKING Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,65 @@ > +$FreeBSD$ > + > +Notes for people hacking on dtc > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > + > +This file contains some notes for people wishing to hack on dtc. > + > +Upstreaming > +----------- > + > +This code is developed in the FreeBSD svn repository: > + > +https://svn.freebsd.org/base/head/usr.bin/dtc > + > +If you got the source from anywhere else and wish to make changes, = please > +ensure that you are working against the latest version, or you may = end up > +fixing bugs that are already fixed upstream. Although the license = makes no > +requirement that you share any improvements that you make, patches = are very > +welcome. > + > +C++11 > +----- > + > +This project currently aims to compile with g++ 4.2.1 and so doesn't = make any > +use of C++11 features. It would be a good idea to relax this = restriction once > +clang is the default compiler for ARM, MIPS and PowerPC. > + > +This code makes use of a lot of iterator loops, which would be = cleaner using > +the new syntax in C++11. It also explicitly deletes a lot of objects = held in > +collections in destructors that have these collections as their = members. This > +could be simplified by using `shared_ptr`. > + > +The code does make use of `static_assert()`, but uses a macro in = utility.hh to > +remove these if they are not supported. The FreeBSD standard headers = also > +define a compatibility macro the implements static asserts in terms = of an array > +with 1 element on success and -1 elements on failure. > + > +Adding New Checks > +----------------- > + > +Currently, the biggest weakness of this version of the tool is that = it lacks > +most of the semantic checkers that can be implemented by simply = reading the > +ePAPR spec. The `checker` class provides a simple superclass for = implementing > +these quite easily. There are also helper methods on `device_tree` = for finding > +specific nodes, for checks that require some understanding of the = structure of > +the tree. > + > +We should probably add a parent pointer to the `node` class for = easily walking > +up the tree. > + > +Adding Direct C Output > +---------------------- > + > +The FreeBSD build system currently uses dtc to generate a blob and = then > +converts this to C source code. A new `output_writer` subclass could = easily > +generate the C directly. > + > +Parser Improvements > +------------------- > + > +There are a few FIXME lines in the parser for some corner cases that = are not > +currently used by FreeBSD. These are mainly related to labels in the = middle of > +values. These can be fixed by creating a new `property_value` with = the > +specified label, starting at the location of the label. Don't forget = to remove > +the associated comments from the BUGS section of the man page if you = fix this. >=20 > Added: head/usr.bin/dtc/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/Makefile Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,11 @@ > +# $FreeBSD$ > + > +PROG_CXX=3Ddtc > +SRCS=3D dtc.cc input_buffer.cc string.cc dtb.cc fdt.cc = checking.cc > +MAN=3D dtc.1 > + > +WARNS?=3D 3 > + > +NO_SHARED?=3DNO > + > +.include >=20 > Added: head/usr.bin/dtc/checking.cc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/checking.cc Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,210 @@ > +/*- > + * Copyright (c) 2013 David Chisnall > + * All rights reserved. > + * > + * This software was developed by SRI International and the = University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract = (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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$ > + */ > + > +#include "checking.hh" > + > +namespace dtc > +{ > +namespace fdt > +{ > +namespace checking > +{ > + > +bool > +checker::visit_node(device_tree *tree, node *n) > +{ > + path.push_back(std::make_pair(n->name, n->unit_address)); > + // Check this node > + if (!check_node(tree, n)) > + { > + return false; > + } > + // Now check its properties > + for (node::property_iterator i=3Dn->property_begin(), = e=3Dn->property_end() > + ; i!=3De ; ++i) > + { > + if (!check_property(tree, n, *i)) > + { > + return false; > + } > + } > + // And then recursively check the children > + for (node::child_iterator i=3Dn->child_begin(), e=3Dn->child_end()= ; i!=3De ; > + ++i) > + { > + if (!visit_node(tree, *i)) > + { > + return false; > + } > + } > + path.pop_back(); > + return true; > +} > + > +void > +checker::report_error(const char *errmsg) > +{ > + fprintf(stderr, "Error: %s, while checking node: ", errmsg); > + for (device_tree::node_path::iterator p=3Dpath.begin()+1, = pe=3Dpath.end() ; > + p!=3Dpe ; ++p) > + { > + putc('/', stderr); > + p->first.dump(); > + if (!(p->second.empty())) > + { > + putc('@', stderr); > + p->second.dump(); > + } > + } > + fprintf(stderr, " [-W%s]\n", checker_name); > +} > + > +bool > +property_checker::check_property(device_tree *tree, node *n, property = *p) > +{ > + if (p->get_key() =3D=3D key) > + { > + if (!check(tree, n, p)) > + { > + report_error("property check failed"); > + return false; > + } > + } > + return true; > +} > + > +bool > +property_size_checker::check(device_tree *tree, node *n, property *p) > +{ > + uint32_t psize =3D 0; > + for (property::value_iterator i=3Dp->begin(),e=3Dp->end() ; i!=3De= ; ++i) > + { > + if (!i->is_binary()) > + { > + return false; > + } > + psize +=3D i->byte_data.size(); > + } > + return psize =3D=3D size; > +} > + > +template > +void > +check_manager::add_property_type_checker(const char *name, string = prop) > +{ > + checkers.insert(std::make_pair(string(name), > + new property_type_checker(name, prop))); > +} > + > +void > +check_manager::add_property_size_checker(const char *name, > + string prop, > + uint32_t size) > +{ > + checkers.insert(std::make_pair(string(name), > + new property_size_checker(name, prop, size))); > +} > + > +check_manager::~check_manager() > +{ > + while (checkers.begin() !=3D checkers.end()) > + { > + delete checkers.begin()->second; > + checkers.erase(checkers.begin()); > + } > + while (disabled_checkers.begin() !=3D disabled_checkers.end()) > + { > + delete disabled_checkers.begin()->second; > + } > +} > + > +check_manager::check_manager() > +{ > + // NOTE: All checks listed here MUST have a corresponding line > + // in the man page! > + add_property_type_checker( > + "type-compatible", string("compatible")); > + add_property_type_checker( > + "type-model", string("model")); > + add_property_size_checker("type-phandle", string("phandle"), 4); > +} > + > +bool > +check_manager::run_checks(device_tree *tree, bool keep_going) > +{ > + bool success =3D true; > + for (std::map::iterator i=3Dcheckers.begin(), > + e=3Dcheckers.end() ; i!=3De ; ++i) > + { > + success &=3D i->second->check_tree(tree); > + if (!(success || keep_going)) > + { > + break; > + } > + } > + return success; > +} > + > +bool > +check_manager::disable_checker(string name) > +{ > + std::map::iterator checker =3D = checkers.find(name); > + if (checker !=3D checkers.end()) > + { > + disabled_checkers.insert(std::make_pair(name, > + = checker->second)); > + checkers.erase(checker); > + return true; > + } > + return false; > +} > + > +bool > +check_manager::enable_checker(string name) > +{ > + std::map::iterator checker =3D > + disabled_checkers.find(name); > + if (checker !=3D disabled_checkers.end()) > + { > + checkers.insert(std::make_pair(name, checker->second)); > + disabled_checkers.erase(checker); > + return true; > + } > + return false; > +} > + > +} // namespace checking > + > +} // namespace fdt > + > +} // namespace dtc > + >=20 > Added: head/usr.bin/dtc/checking.hh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/checking.hh Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,308 @@ > +/*- > + * Copyright (c) 2013 David Chisnall > + * All rights reserved. > + * > + * This software was developed by SRI International and the = University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract = (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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$ > + */ > + > +#ifndef _CHECKING_HH_ > +#define _CHECKING_HH_ > +#include "string.hh" > +#include "fdt.hh" > + > +namespace dtc > +{ > +namespace fdt > +{ > +namespace checking > +{ > +/** > + * Base class for all checkers. This will visit the entire tree and = perform > + * semantic checks defined in subclasses. Note that device trees are = generally > + * small (a few dozen nodes at most) and so we optimise for = flexibility and > + * extensibility here, not for performance. Each checker will visit = the entire > + * tree. > + */ > +class checker > +{ > + /** > + * The path to the current node being checked. This is used for > + * printing error messages. > + */ > + device_tree::node_path path; > + /** > + * The name of the checker. This is used for printing error = messages > + * and for enabling / disabling specific checkers from the = command > + * line.=20 > + */ > + const char *checker_name; > + /** > + * Visits each node, calling the checker functions on properties = and > + * nodes. > + */ > + bool visit_node(device_tree *tree, node *n); > + protected: > + /** > + * Prints the error message, along with the path to the node = that > + * caused the error and the name of the checker. > + */ > + void report_error(const char *errmsg); > + public: > + /** > + * Constructor. Takes the name of this checker, which is which = is used > + * when reporting errors. > + */ > + checker(const char *name) : checker_name(name) {} > + /** > + * Virtual destructor in case any subclasses need to do cleanup. > + */ > + virtual ~checker() {} > + /** > + * Method for checking that a node is valid. The root class = version > + * does nothing, subclasses should override this. > + */ > + virtual bool check_node(device_tree *tree, node *n) > + { > + return true; > + } > + /** > + * Method for checking that a property is valid. The root class > + * version does nothing, subclasses should override this. > + */ > + virtual bool check_property(device_tree *tree, node *n, property = *p) > + { > + return true; > + } > + /** > + * Runs the checker on the specified device tree. > + */ > + bool check_tree(fdt::device_tree *tree) > + { > + return visit_node(tree, tree->get_root()); > + } > +}; > + > +/** > + * Abstract base class for simple property checks. This class = defines a check > + * method for subclasses, which is invoked only when it finds a = property with > + * the matching name. To define simple property checkers, just = subclass this > + * and override the check() method. > + */ > +class property_checker : public checker > +{ > + /** > + * The name of the property that this checker is looking for. > + */ > + string key; > + public: > + /** > + * Implementation of the generic property-checking method that = checks > + * for a property with the name specified in the constructor=20 > + */ > + virtual bool check_property(device_tree *tree, node *n, property = *p); > + /** > + * Constructor. Takes the name of the checker and the name of = the > + * property to check. > + */ > + property_checker(const char* name, string property_name) > + : checker(name), key(property_name) {} > + /** > + * The check method, which subclasses should implement. > + */ > + virtual bool check(device_tree *tree, node *n, property *p) =3D = 0; > +}; > + > +/** > + * Property type checker. > + */ > +template > +struct property_type_checker : public property_checker > +{ > + /** > + * Constructor, takes the name of the checker and the name of = the > + * property to check as arguments. > + */ > + property_type_checker(const char* name, string property_name) :=20= > + property_checker(name, property_name) {} > + virtual bool check(device_tree *tree, node *n, property *p) =3D = 0; > +}; > + > +/** > + * Empty property checker. This checks that the property has no = value. > + */ > +template<> > +struct property_type_checker : public = property_checker > +{ > + property_type_checker(const char* name, string property_name) :=20= > + property_checker(name, property_name) {} > + virtual bool check(device_tree *tree, node *n, property *p) > + { > + return p->begin() =3D=3D p->end(); > + } > +}; > + > +/** > + * String property checker. This checks that the property has = exactly one > + * value, which is a string. > + */ > +template<> > +struct property_type_checker : public = property_checker > +{ > + property_type_checker(const char* name, string property_name) :=20= > + property_checker(name, property_name) {} > + virtual bool check(device_tree *tree, node *n, property *p) > + { > + return (p->begin() + 1 =3D=3D p->end()) && = p->begin()->is_string(); > + } > +}; > +/** > + * String list property checker. This checks that the property has = at least > + * one value, all of which are strings. > + */ > +template<> > +struct property_type_checker : > + public property_checker > +{ > + property_type_checker(const char* name, string property_name) :=20= > + property_checker(name, property_name) {} > + virtual bool check(device_tree *tree, node *n, property *p) > + { > + for (property::value_iterator i=3Dp->begin(),e=3Dp->end() = ; i!=3De ; > + ++i) > + { > + if (!(i->is_string() || i->is_string_list())) > + { > + return false; > + } > + } > + return p->begin() !=3D p->end(); > + } > +}; > + > +/** > + * Phandle property checker. This checks that the property has = exactly one > + * value, which is a valid phandle. > + */ > +template<> > +struct property_type_checker : public = property_checker > +{ > + property_type_checker(const char* name, string property_name) :=20= > + property_checker(name, property_name) {} > + virtual bool check(device_tree *tree, node *n, property *p) > + { > + return (p->begin() + 1 =3D=3D p->end()) &&=20 > + (tree->referenced_node(*p->begin()) !=3D 0); > + } > +}; > + > +/** > + * Check that a property has the correct size. > + */ > +struct property_size_checker : public property_checker > +{ > + /** > + * The expected size of the property. > + */ > + uint32_t size; > + public: > + /** > + * Constructor, takes the name of the checker, the name of the = property > + * to check, and its expected size as arguments. > + */ > + property_size_checker(const char* name, string property_name, = uint32_t bytes) > + : property_checker(name, property_name), size(bytes) {} > + /** > + * Check, validates that the property has the correct size. > + */ > + virtual bool check(device_tree *tree, node *n, property *p); > +}; > + > + > +/** > + * The check manager is the interface to running the checks. This = allows > + * default checks to be enabled, non-default checks to be enabled, = and so on. > + */ > +class check_manager > +{ > + /** > + * The enabled checkers, indexed by their names. The name is = used when > + * disabling checkers from the command line. When this manager = runs, > + * it will only run the checkers from this map. > + */ > + std::map checkers; > + /** > + * The disabled checkers. Moving checkers to this list disables = them, > + * but allows them to be easily moved back. > + */ > + std::map disabled_checkers; > + /** > + * Helper function for adding a property value checker. > + */ > + template > + void add_property_type_checker(const char *name, string prop); > + /** > + * Helper function for adding a simple type checker. > + */ > + void add_property_type_checker(const char *name, string prop); > + /** > + * Helper function for adding a property value checker. > + */ > + void add_property_size_checker(const char *name, > + string prop, > + uint32_t size); > + public: > + /** > + * Delete all of the checkers that are part of this checker = manager. > + */ > + ~check_manager(); > + /** > + * Default constructor, creates check manager containing all of = the > + * default checks. > + */ > + check_manager(); > + /** > + * Run all of the checks on the specified tree. > + */ > + bool run_checks(device_tree *tree, bool keep_going); > + /** > + * Disables the named checker. > + */ > + bool disable_checker(string name); > + /** > + * Enables the named checker. =20 > + */ > + bool enable_checker(string name); > +}; > + > +} // namespace checking > + > +} // namespace fdt > + > +} // namespace dtc > + > +#endif // !_CHECKING_HH_ >=20 > Added: head/usr.bin/dtc/dtb.cc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/dtb.cc Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,308 @@ > +/*- > + * Copyright (c) 2013 David Chisnall > + * All rights reserved. > + * > + * This software was developed by SRI International and the = University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract = (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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$ > + */ > + > +#include "dtb.hh" > +#include > + > +namespace dtc > +{ > +namespace dtb > +{ > + > +void output_writer::write_data(byte_buffer b) > +{ > + for (byte_buffer::iterator i=3Db.begin(), e=3Db.end(); i!=3De ; = i++) > + { > + write_data(*i); > + } > +} > + > +void > +binary_writer::write_string(string name) > +{ > + name.push_to_buffer(buffer); > + // Trailing nul > + buffer.push_back(0); > +} > + > +void > +binary_writer::write_data(uint8_t v) > +{ > + buffer.push_back(v); > +} > + > +void > +binary_writer::write_data(uint32_t v) > +{ > + while (buffer.size() % 4 !=3D 0) > + { > + buffer.push_back(0); > + } > + push_big_endian(buffer, v); > +} > + > +void > +binary_writer::write_data(uint64_t v) > +{ > + while (buffer.size() % 8 !=3D 0) > + { > + buffer.push_back(0); > + } > + push_big_endian(buffer, v); > +} > + > +void > +binary_writer::write_to_file(int fd) > +{ > + // FIXME: Check return > + write(fd, buffer.data(), buffer.size()); > +} > + > +uint32_t > +binary_writer::size() > +{ > + return buffer.size(); > +} > + > +void > +asm_writer::write_string(const char *c) > +{ > + while (*c) > + { > + buffer.push_back((uint8_t)*(c++)); > + } > +} > + > +void > +asm_writer::write_line(const char *c) > +{ > + if (byte_count !=3D 0) > + { > + byte_count =3D 0; > + buffer.push_back('\n'); > + } > + write_string(c); > +} > + > +void > +asm_writer::write_byte(uint8_t b) > +{ > + char out[3] =3D {0}; > + if (byte_count++ =3D=3D 0) > + { > + buffer.push_back('\t'); > + } > + write_string(".byte 0x"); > + snprintf(out, 3, "%.2hhx", b); > + buffer.push_back(out[0]); > + buffer.push_back(out[1]); > + if (byte_count =3D=3D 4) > + { > + buffer.push_back('\n'); > + byte_count =3D 0; > + } > + else > + { > + buffer.push_back(';'); > + buffer.push_back(' '); > + } > +} > + > +void > +asm_writer::write_label(string name) > +{ > + write_line("\t.globl "); > + name.push_to_buffer(buffer); > + buffer.push_back('\n'); > + name.push_to_buffer(buffer); > + buffer.push_back(':'); > + buffer.push_back('\n'); > + buffer.push_back('_'); > + name.push_to_buffer(buffer); > + buffer.push_back(':'); > + buffer.push_back('\n'); > +=09 > +} > + > +void > +asm_writer::write_comment(string name) > +{ > + write_line("\t/* "); > + name.push_to_buffer(buffer); > + write_string(" */\n"); > +} > + > +void > +asm_writer::write_string(string name) > +{ > + write_line("\t.string \""); > + name.push_to_buffer(buffer); > + write_line("\"\n"); > + bytes_written +=3D name.size() + 1; > +} > + > +void > +asm_writer::write_data(uint8_t v) > +{ > + write_byte(v); > + bytes_written++; > +} > + > +void > +asm_writer::write_data(uint32_t v) > +{ > + if (bytes_written % 4 !=3D 0) > + { > + write_line("\t.balign 4\n"); > + bytes_written +=3D (4 - (bytes_written % 4)); > + } > + write_byte((v >> 24) & 0xff); > + write_byte((v >> 16) & 0xff); > + write_byte((v >> 8) & 0xff); > + write_byte((v >> 0) & 0xff); > + bytes_written +=3D 4; > +} > + > +void > +asm_writer::write_data(uint64_t v) > +{ > + if (bytes_written % 8 !=3D 0) > + { > + write_line("\t.balign 8\n"); > + bytes_written +=3D (8 - (bytes_written % 8)); > + } > + write_byte((v >> 56) & 0xff); > + write_byte((v >> 48) & 0xff); > + write_byte((v >> 40) & 0xff); > + write_byte((v >> 32) & 0xff); > + write_byte((v >> 24) & 0xff); > + write_byte((v >> 16) & 0xff); > + write_byte((v >> 8) & 0xff); > + write_byte((v >> 0) & 0xff); > + bytes_written +=3D 8; > +} > + > +void > +asm_writer::write_to_file(int fd) > +{ > + // FIXME: Check return > + write(fd, buffer.data(), buffer.size()); > +} > + > +uint32_t > +asm_writer::size() > +{ > + return bytes_written; > +} > + > +void > +header::write(output_writer &out) > +{ > + out.write_label(string("dt_blob_start")); > + out.write_label(string("dt_header")); > + out.write_comment("magic"); > + out.write_data(magic); > + out.write_comment("totalsize"); > + out.write_data(totalsize); > + out.write_comment("off_dt_struct"); > + out.write_data(off_dt_struct); > + out.write_comment("off_dt_strings"); > + out.write_data(off_dt_strings); > + out.write_comment("off_mem_rsvmap"); > + out.write_data(off_mem_rsvmap); > + out.write_comment("version"); > + out.write_data(version); > + out.write_comment("last_comp_version"); > + out.write_data(last_comp_version); > + out.write_comment("boot_cpuid_phys"); > + out.write_data(boot_cpuid_phys); > + out.write_comment("size_dt_strings"); > + out.write_data(size_dt_strings); > + out.write_comment("size_dt_struct"); > + out.write_data(size_dt_struct); > +} > + > +bool > +header::read_dtb(input_buffer &input) > +{ > + if (!(input.consume_binary(magic) && magic =3D=3D 0xd00dfeed)) > + { > + fprintf(stderr, "Missing magic token in header. Got %" = PRIx32 > + " expected 0xd00dfeed\n", magic); > + return false; > + } > + return input.consume_binary(totalsize) && > + input.consume_binary(off_dt_struct) && > + input.consume_binary(off_dt_strings) && > + input.consume_binary(off_mem_rsvmap) && > + input.consume_binary(version) && > + input.consume_binary(last_comp_version) && > + input.consume_binary(boot_cpuid_phys) && > + input.consume_binary(size_dt_strings) && > + input.consume_binary(size_dt_struct); > +} > +uint32_t > +string_table::add_string(string str) > +{ > + std::map::iterator old =3D = string_offsets.find(str); > + if (old =3D=3D string_offsets.end()) > + { > + uint32_t start =3D size; > + // Don't forget the trailing nul > + size +=3D str.size() + 1; > + string_offsets.insert(std::make_pair(str, start)); > + strings.push_back(str); > + return start; > + } > + else > + { > + return old->second; > + } > +} > + > +void > +string_table::write(dtb::output_writer &writer) > +{ > + writer.write_comment(string("Strings table.")); > + writer.write_label(string("dt_strings_start")); > + for (std::vector::iterator i=3Dstrings.begin(), = e=3Dstrings.end() ; > + i!=3De ; ++i) > + { > + writer.write_string(*i); > + } > + writer.write_label(string("dt_strings_end")); > +} > + > +} // namespace dtb > + > +} // namespace dtc > + >=20 > Added: head/usr.bin/dtc/dtb.hh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/dtc/dtb.hh Tue Jan 22 17:49:51 2013 = (r245803) > @@ -0,0 +1,365 @@ > +/*- > + * Copyright (c) 2013 David Chisnall > + * All rights reserved. > + * > + * This software was developed by SRI International and the = University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract = (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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$ > + */ > + > +#ifndef _DTB_HH_ >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 02:37:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 093B3CCE; Mon, 4 Feb 2013 02:37:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 8734C847; Mon, 4 Feb 2013 02:37:40 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id 9so5167144iec.4 for ; Sun, 03 Feb 2013 18:37:39 -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 :user-agent; bh=Hp81WM8D/DTTKap51RuDCh2U5lIE78tvSjyP13e4obY=; b=sTOj1K9I1KctMVz//xmPtzjnQ6jzhnpuhFw6S5RyhBVXmHSSARY6QFfZtCVAP+iz+f /dvurCq0wlYe43vQTVk0bf2fAaSF4XREq/EUBCZvyFXCFOK56aDeQ419zipHQBE8tCCT mpQJoqWpiUrTArgyasGxAJXpJd/i1QeIRDcoP+wELjnS2m6UColZSULi9HUGDKtpWkHK Y3+doZQCw2BDw8DF5FXcKZLzZfboSou8uvs8DgJ8/wyRYtD0J069nUz8tIr1HyltKW6w OcGDycx2u9Lf0P9ykijbcmMGWpY8wx4vLJgax+AGOhbHi9f1lntQuMjmKpaailw6w4se hviA== X-Received: by 10.50.202.3 with SMTP id ke3mr4038866igc.49.1359945459475; Sun, 03 Feb 2013 18:37:39 -0800 (PST) Received: from oddish ([66.11.160.25]) by mx.google.com with ESMTPS id u4sm13712600igw.6.2013.02.03.18.37.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Feb 2013 18:37:38 -0800 (PST) Sender: Mark Johnston Date: Sun, 3 Feb 2013 19:37:30 -0500 From: Mark Johnston To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Message-ID: <20130204003701.GA1700@oddish> References: <201302021154.r12Bs0tp030831@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302021154.r12Bs0tp030831@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 02:37:41 -0000 On Sat, Feb 02, 2013 at 11:54:00AM +0000, Andriy Gapon wrote: > Author: avg > Date: Sat Feb 2 11:54:00 2013 > New Revision: 246245 > URL: http://svnweb.freebsd.org/changeset/base/246245 > > Log: > ng_ether: track interface renaming > > Also sanitize interface names that can potentially contain characters > that are prohibited in netgraph names. > > PR: kern/154850 (sanitizing of names) > Discussed with: eri, melifaro > Submitted by: Nikolay Denev (sanitizing code) > Reviewed by: eri, glebius > MFC after: 17 days > > Modified: > head/sys/netgraph/ng_ether.c > Hi Andriy, This commit seems to cause a panic during boot when creating the loopback interface. I couldn't get a core dump but the problem seems to happen when dereferencing ifp->if_l2com in the IFP2NG macro in ng_ether_ifnet_arrival_event(). In the case of lo(4) this pointer seems to be NULL (I suppose because lo(4) doesn't register itself in the if_com_alloc/free tables). The patch below fixes the panic for me. Thanks, -Mark diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 6266f40..f566346 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -410,7 +410,12 @@ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; - node_p node = IFP2NG(ifp); + node_p node; + + if (ifp->if_l2com == NULL) + return; + + node = IFP2NG(ifp); /* * Just return if it's a new interface without an ng_ether companion. From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 05:16:41 2013 Return-Path: Delivered-To: svn-src-all@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 D6F8255E; Mon, 4 Feb 2013 05:16:41 +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 770B0DA6; Mon, 4 Feb 2013 05:16:41 +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 r145GTjS030618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Feb 2013 16:16:31 +1100 Date: Mon, 4 Feb 2013 16:16:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl Subject: Re: svn commit: r246301 - head/sys/kern In-Reply-To: <201302032143.r13LhuQ3053811@svn.freebsd.org> Message-ID: <20130204160720.F1009@besplex.bde.org> References: <201302032143.r13LhuQ3053811@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=9tJy_2lEROAA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=oJKyWqhHDGzF01hoqg8A:9 a=CjuIK1q_8ugA:10 a=mXeW1zBZkXM7NW3O:21 a=MaVhI5ispiHdj2y6:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 05:16:41 -0000 On Sun, 3 Feb 2013, Marius Strobl wrote: > Log: > Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant > values to SYSCTL_ULONG(9) where possible. > > Submitted by: bde > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Sun Feb 3 21:30:29 2013 (r246300) > +++ head/sys/kern/kern_malloc.c Sun Feb 3 21:43:55 2013 (r246301) > @@ -186,15 +186,16 @@ struct { > */ > static uma_zone_t mt_zone; > > -static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > -SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > - &vm_min_kernel_address, 0, "Min kernel address"); > +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, NULL, > + VM_MIN_KERNEL_ADDRESS, "Min kernel address"); SYSCTL_*() (except SYSCTL_PROC()) is conventionally split after CTLFLAG* (to highlight the usual value pointer). This does a different splitting, presumably to highlight the value non-pointer. I'm not sure that that is maintainable. The convention for the usual case is often not followed. > > +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > #ifndef __sparc64__ > -static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > + NULL, VM_MAX_KERNEL_ADDRESS, > +#else > + &vm_max_kernel_address, 0, > #endif > -SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > - &vm_max_kernel_address, 0, "Max kernel address"); > + "Max kernel address"); I barely remember mentioning that. MD macros in general could in theory be any expression (say a function call), but if these ones were non-constant expressions then they wouldn't have worked in the old code either. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 06:59:34 2013 Return-Path: Delivered-To: svn-src-all@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 BB44CF97; Mon, 4 Feb 2013 06:59:34 +0000 (UTC) (envelope-from andrew@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 9426BFB9; Mon, 4 Feb 2013 06:59: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 r146xYic024172; Mon, 4 Feb 2013 06:59:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r146xXw4024168; Mon, 4 Feb 2013 06:59:33 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040659.r146xXw4024168@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 06:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246312 - in head/contrib: binutils/include/elf gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 06:59:34 -0000 Author: andrew Date: Mon Feb 4 06:59:33 2013 New Revision: 246312 URL: http://svnweb.freebsd.org/changeset/base/246312 Log: Extend GDB to check the value in the .note.tag section along with the .note.ABI-tag section. This helps on ARM EABI where the OS/ABI field is zero. It would be better to use the NOTES program header however this would require a more invasive change. Modified: head/contrib/binutils/include/elf/common.h head/contrib/gdb/gdb/osabi.c Modified: head/contrib/binutils/include/elf/common.h ============================================================================== --- head/contrib/binutils/include/elf/common.h Mon Feb 4 00:34:35 2013 (r246311) +++ head/contrib/binutils/include/elf/common.h Mon Feb 4 06:59:33 2013 (r246312) @@ -435,6 +435,10 @@ #define NT_FREEBSD_ABI_TAG 1 +/* Values for FreeBSD .note.tag notes. Note name is "FreeBSD". */ + +#define NT_FREEBSD_TAG 2 + /* These three macros disassemble and assemble a symbol table st_info field, which contains the symbol binding and symbol type. The STB_ and STT_ defines identify the binding and type. */ Modified: head/contrib/gdb/gdb/osabi.c ============================================================================== --- head/contrib/gdb/gdb/osabi.c Mon Feb 4 00:34:35 2013 (r246311) +++ head/contrib/gdb/gdb/osabi.c Mon Feb 4 06:59:33 2013 (r246312) @@ -463,6 +463,20 @@ generic_elf_osabi_sniff_abi_tag_sections return; } + + /* .note.tag notes, used by FreeBSD. */ + if (strcmp (name, ".note.tag") == 0) + { + /* FreeBSD. */ + if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_TAG)) + { + /* There is no need to check the version yet. */ + *osabi = GDB_OSABI_FREEBSD_ELF; + return; + } + + return; + } /* .note.netbsd.ident notes, used by NetBSD. */ if (strcmp (name, ".note.netbsd.ident") == 0 From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 07:41:37 2013 Return-Path: Delivered-To: svn-src-all@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 DCA263BA; Mon, 4 Feb 2013 07:41:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 71D99133; Mon, 4 Feb 2013 07:41:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA16707; Mon, 04 Feb 2013 09:41:34 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U2GgI-0008MB-9F; Mon, 04 Feb 2013 09:41:34 +0200 Message-ID: <510F662C.1080007@FreeBSD.org> Date: Mon, 04 Feb 2013 09:41:32 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: Mark Johnston Subject: Re: svn commit: r246245 - head/sys/netgraph References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <20130204003701.GA1700@oddish> In-Reply-To: <20130204003701.GA1700@oddish> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 07:41:37 -0000 on 04/02/2013 02:37 Mark Johnston said the following: > On Sat, Feb 02, 2013 at 11:54:00AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Sat Feb 2 11:54:00 2013 >> New Revision: 246245 >> URL: http://svnweb.freebsd.org/changeset/base/246245 >> >> Log: >> ng_ether: track interface renaming >> >> Also sanitize interface names that can potentially contain characters >> that are prohibited in netgraph names. >> >> PR: kern/154850 (sanitizing of names) >> Discussed with: eri, melifaro >> Submitted by: Nikolay Denev (sanitizing code) >> Reviewed by: eri, glebius >> MFC after: 17 days >> >> Modified: >> head/sys/netgraph/ng_ether.c >> > > Hi Andriy, > > This commit seems to cause a panic during boot when creating the > loopback interface. I couldn't get a core dump but the problem seems to > happen when dereferencing ifp->if_l2com in the IFP2NG macro in > ng_ether_ifnet_arrival_event(). In the case of lo(4) this pointer seems > to be NULL (I suppose because lo(4) doesn't register itself in the > if_com_alloc/free tables). > > The patch below fixes the panic for me. Mark, thank you for the report and sorry for the breakage. Could you please try the following patch (slightly different from your patch)? diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 6266f40..05ea402 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -410,11 +410,16 @@ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; - node_p node = IFP2NG(ifp); + node_p node; + + /* Only ethernet interfaces are of interest. */ + if (ifp->if_type != IFT_ETHER) + return; /* * Just return if it's a new interface without an ng_ether companion. */ + node = IFP2NG(ifp); if (node == NULL) return; > diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c > index 6266f40..f566346 100644 > --- a/sys/netgraph/ng_ether.c > +++ b/sys/netgraph/ng_ether.c > @@ -410,7 +410,12 @@ static void > ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) > { > char name[IFNAMSIZ]; > - node_p node = IFP2NG(ifp); > + node_p node; > + > + if (ifp->if_l2com == NULL) > + return; > + > + node = IFP2NG(ifp); > > /* > * Just return if it's a new interface without an ng_ether companion. > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 08:29:02 2013 Return-Path: Delivered-To: svn-src-all@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 EB99DA9E; Mon, 4 Feb 2013 08:29:02 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) by mx1.freebsd.org (Postfix) with ESMTP id 32F6D25F; Mon, 4 Feb 2013 08:29:01 +0000 (UTC) Received: from sluga.fer.hr (161.53.72.14) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server id 14.1.438.0; Mon, 4 Feb 2013 09:27:47 +0100 Received: from localhost ([161.53.19.63]) by sluga.fer.hr over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 4 Feb 2013 09:27:47 +0100 From: Marko Zec To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Date: Mon, 4 Feb 2013 09:27:43 +0100 User-Agent: KMail/1.9.10 References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <20130204003701.GA1700@oddish> <510F662C.1080007@FreeBSD.org> In-Reply-To: <510F662C.1080007@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201302040927.43559.zec@fer.hr> X-OriginalArrivalTime: 04 Feb 2013 08:27:47.0835 (UTC) FILETIME=[83762CB0:01CE02B1] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 08:29:03 -0000 On Monday 04 February 2013 08:41:32 Andriy Gapon wrote: > on 04/02/2013 02:37 Mark Johnston said the following: > > On Sat, Feb 02, 2013 at 11:54:00AM +0000, Andriy Gapon wrote: > >> Author: avg > >> Date: Sat Feb 2 11:54:00 2013 > >> New Revision: 246245 > >> URL: http://svnweb.freebsd.org/changeset/base/246245 > >> > >> Log: > >> ng_ether: track interface renaming > >> > >> Also sanitize interface names that can potentially contain > >> characters that are prohibited in netgraph names. > >> > >> PR: kern/154850 (sanitizing of names) > >> Discussed with: eri, melifaro > >> Submitted by: Nikolay Denev (sanitizing code) > >> Reviewed by: eri, glebius > >> MFC after: 17 days > >> > >> Modified: > >> head/sys/netgraph/ng_ether.c > > > > Hi Andriy, > > > > This commit seems to cause a panic during boot when creating the > > loopback interface. I couldn't get a core dump but the problem seems to > > happen when dereferencing ifp->if_l2com in the IFP2NG macro in > > ng_ether_ifnet_arrival_event(). In the case of lo(4) this pointer seems > > to be NULL (I suppose because lo(4) doesn't register itself in the > > if_com_alloc/free tables). > > > > The patch below fixes the panic for me. > > Mark, > > thank you for the report and sorry for the breakage. > Could you please try the following patch (slightly different from your > patch)? > > diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c > index 6266f40..05ea402 100644 > --- a/sys/netgraph/ng_ether.c > +++ b/sys/netgraph/ng_ether.c > @@ -410,11 +410,16 @@ static void > ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) > { > char name[IFNAMSIZ]; > - node_p node = IFP2NG(ifp); > + node_p node; > + > + /* Only ethernet interfaces are of interest. */ > + if (ifp->if_type != IFT_ETHER) > + return; And what about IFT_FDDI, IFT_XETHER, IFT_ISO88025, IFT_L2VLAN, IFT_BRIDGE, IFT_ARCNET, IFT_IEEE8023ADLAG, IFT_IEEE80211? Marko > /* > * Just return if it's a new interface without an ng_ether companion. > */ > + node = IFP2NG(ifp); > if (node == NULL) > return; > > > diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c > > index 6266f40..f566346 100644 > > --- a/sys/netgraph/ng_ether.c > > +++ b/sys/netgraph/ng_ether.c > > @@ -410,7 +410,12 @@ static void > > ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) > > { > > char name[IFNAMSIZ]; > > - node_p node = IFP2NG(ifp); > > + node_p node; > > + > > + if (ifp->if_l2com == NULL) > > + return; > > + > > + node = IFP2NG(ifp); > > > > /* > > * Just return if it's a new interface without an ng_ether companion. From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:28:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 96532E6A; Mon, 4 Feb 2013 09:28:37 +0000 (UTC) (envelope-from andrew@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 6F555725; Mon, 4 Feb 2013 09:28: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 r149SbTB071088; Mon, 4 Feb 2013 09:28:37 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r149SbZa071086; Mon, 4 Feb 2013 09:28:37 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040928.r149SbZa071086@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 09:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246314 - in head/contrib: gcc/config/arm libstdc++/libsupc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:28:37 -0000 Author: andrew Date: Mon Feb 4 09:28:36 2013 New Revision: 246314 URL: http://svnweb.freebsd.org/changeset/base/246314 Log: Allow the unwind functions int libgcc_s to interact correctly with libthr. _Unwind_ForcedUnwind in libgcc_s takes as one of it's parameters a stop function to tell it when to stop unwinding. One of the stop function's parameters is a _Unwind_Exception_Class. On most architectures this is an int64_t, however on ARM EABI the gcc developers have made this a char array with 8 items. While both of these take the same space they are passed into the stop function differently, an int64_t is passed in in registers r2 and r3, while the char[8] is passed in as a pointer to the first item in register r2. Because libthr expects the value to be an int64_t we would get incorrect results when it passes a function that take an int64_t but libgcc passes in a pointer to a char array including crashing. The fix is to update libgcc_s to make it pass an int64_t to the stop function and to libstdc++ as it expects _Unwind_Exception_Class to be an array. Modified: head/contrib/gcc/config/arm/unwind-arm.h head/contrib/libstdc++/libsupc++/unwind-cxx.h Modified: head/contrib/gcc/config/arm/unwind-arm.h ============================================================================== --- head/contrib/gcc/config/arm/unwind-arm.h Mon Feb 4 08:53:51 2013 (r246313) +++ head/contrib/gcc/config/arm/unwind-arm.h Mon Feb 4 09:28:36 2013 (r246314) @@ -87,7 +87,7 @@ extern "C" { struct _Unwind_Control_Block { - char exception_class[8]; + unsigned exception_class __attribute__((__mode__(__DI__))); void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); /* Unwinder cache, private fields for the unwinder's use */ struct @@ -186,7 +186,7 @@ extern "C" { /* Support functions for the PR. */ #define _Unwind_Exception _Unwind_Control_Block - typedef char _Unwind_Exception_Class[8]; + typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); void * _Unwind_GetLanguageSpecificData (_Unwind_Context *); _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *); Modified: head/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- head/contrib/libstdc++/libsupc++/unwind-cxx.h Mon Feb 4 08:53:51 2013 (r246313) +++ head/contrib/libstdc++/libsupc++/unwind-cxx.h Mon Feb 4 09:28:36 2013 (r246314) @@ -173,7 +173,7 @@ __get_exception_header_from_ue (_Unwind_ return reinterpret_cast<__cxa_exception *>(exc + 1) - 1; } -#ifdef __ARM_EABI_UNWINDER__ +#if defined(__ARM_EABI_UNWINDER__) && !defined(__FreeBSD__) static inline bool __is_gxx_exception_class(_Unwind_Exception_Class c) { @@ -200,13 +200,7 @@ __GXX_INIT_EXCEPTION_CLASS(_Unwind_Excep c[6] = '+'; c[7] = '\0'; } - -static inline void* -__gxx_caught_object(_Unwind_Exception* eo) -{ - return (void*)eo->barrier_cache.bitpattern[0]; -} -#else // !__ARM_EABI_UNWINDER__ +#else // !__ARM_EABI_UNWINDER__ || __FreeBSD__ // This is the exception class we report -- "GNUCC++\0". const _Unwind_Exception_Class __gxx_exception_class = ((((((((_Unwind_Exception_Class) 'G' @@ -223,8 +217,16 @@ __is_gxx_exception_class(_Unwind_Excepti { return c == __gxx_exception_class; } - #define __GXX_INIT_EXCEPTION_CLASS(c) c = __gxx_exception_class +#endif + +#ifdef __ARM_EABI_UNWINDER__ +static inline void* +__gxx_caught_object(_Unwind_Exception* eo) +{ + return (void*)eo->barrier_cache.bitpattern[0]; +} +#else // !__ARM_EABI_UNWINDER__ // GNU C++ personality routine, Version 0. extern "C" _Unwind_Reason_Code __gxx_personality_v0 From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:34:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D6E9224; Mon, 4 Feb 2013 09:34:26 +0000 (UTC) (envelope-from andrew@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 5ED2376C; Mon, 4 Feb 2013 09:34: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 r149YQeE073599; Mon, 4 Feb 2013 09:34:26 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r149YQ49073598; Mon, 4 Feb 2013 09:34:26 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040934.r149YQ49073598@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 09:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246315 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:34:26 -0000 Author: andrew Date: Mon Feb 4 09:34:25 2013 New Revision: 246315 URL: http://svnweb.freebsd.org/changeset/base/246315 Log: Fix xdev by using the install shell script as it knows about the -l argument thile the local version install may not. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Feb 4 09:28:36 2013 (r246314) +++ head/Makefile.inc1 Mon Feb 4 09:34:25 2013 (r246315) @@ -1733,7 +1733,8 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOU XDDIR=${XDEV_ARCH}-freebsd XDTP=/usr/${XDDIR} -CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} +CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ + INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDTP} \ TOOLS_PREFIX=${XDTP} From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:35:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 110453EB; Mon, 4 Feb 2013 09:35:49 +0000 (UTC) (envelope-from marius@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 EE2A8788; Mon, 4 Feb 2013 09: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 r149ZmIF073817; Mon, 4 Feb 2013 09:35:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r149ZmQa073815; Mon, 4 Feb 2013 09:35:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201302040935.r149ZmQa073815@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Feb 2013 09:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246316 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:35:49 -0000 Author: marius Date: Mon Feb 4 09:35:48 2013 New Revision: 246316 URL: http://svnweb.freebsd.org/changeset/base/246316 Log: Try to improve r242655 take III: move these SYSCTLs describing the kernel map, which is defined and initialized in vm/vm_kern.c, to the latter. Submitted by: alc Modified: head/sys/kern/kern_malloc.c head/sys/vm/vm_kern.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Feb 4 09:34:25 2013 (r246315) +++ head/sys/kern/kern_malloc.c Mon Feb 4 09:35:48 2013 (r246316) @@ -186,17 +186,6 @@ struct { */ static uma_zone_t mt_zone; -SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, NULL, - VM_MIN_KERNEL_ADDRESS, "Min kernel address"); - -SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, -#ifndef __sparc64__ - NULL, VM_MAX_KERNEL_ADDRESS, -#else - &vm_max_kernel_address, 0, -#endif - "Max kernel address"); - u_long vm_kmem_size; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Feb 4 09:34:25 2013 (r246315) +++ head/sys/vm/vm_kern.c Mon Feb 4 09:35:48 2013 (r246316) @@ -94,6 +94,17 @@ vm_map_t buffer_map=0; const void *zero_region; CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0); +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, + NULL, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); + +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, +#ifdef __sparc64__ + &vm_max_kernel_address, 0, +#else + NULL, VM_MAX_KERNEL_ADDRESS, +#endif + "Max kernel address"); + /* * kmem_alloc_nofault: * From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:42:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD8AC91C; Mon, 4 Feb 2013 09:42:12 +0000 (UTC) (envelope-from andrew@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 B0C357ED; Mon, 4 Feb 2013 09: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 r149gCXA076709; Mon, 4 Feb 2013 09:42:12 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r149gCTo076708; Mon, 4 Feb 2013 09:42:12 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040942.r149gCTo076708@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 09:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246317 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:42:12 -0000 Author: andrew Date: Mon Feb 4 09:42:12 2013 New Revision: 246317 URL: http://svnweb.freebsd.org/changeset/base/246317 Log: Add #undef TARGET_DEFAULT back as it shouldn't have been removed in r245539 Modified: head/contrib/gcc/config/arm/freebsd.h Modified: head/contrib/gcc/config/arm/freebsd.h ============================================================================== --- head/contrib/gcc/config/arm/freebsd.h Mon Feb 4 09:35:48 2013 (r246316) +++ head/contrib/gcc/config/arm/freebsd.h Mon Feb 4 09:42:12 2013 (r246317) @@ -85,6 +85,7 @@ while (false) #else /* Default it to use ATPCS with soft-VFP. */ +#undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_APCS_FRAME \ | TARGET_ENDIAN_DEFAULT) From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:42:38 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF8C6B69; Mon, 4 Feb 2013 09:42:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 928237F9; Mon, 4 Feb 2013 09:42:37 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA18041; Mon, 04 Feb 2013 11:42:33 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U2IZN-0008Xk-Bf; Mon, 04 Feb 2013 11:42:33 +0200 Message-ID: <510F8287.7030708@FreeBSD.org> Date: Mon, 04 Feb 2013 11:42:31 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: Marko Zec Subject: Re: svn commit: r246245 - head/sys/netgraph References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <20130204003701.GA1700@oddish> <510F662C.1080007@FreeBSD.org> <201302040927.43559.zec@fer.hr> In-Reply-To: <201302040927.43559.zec@fer.hr> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Mark Johnston , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:42:39 -0000 on 04/02/2013 10:27 Marko Zec said the following: > On Monday 04 February 2013 08:41:32 Andriy Gapon wrote: >> + /* Only ethernet interfaces are of interest. */ >> + if (ifp->if_type != IFT_ETHER) >> + return; > > > And what about IFT_FDDI, IFT_XETHER, IFT_ISO88025, IFT_L2VLAN, IFT_BRIDGE, > IFT_ARCNET, IFT_IEEE8023ADLAG, IFT_IEEE80211? Oh, I didn't realize that many drivers changed if_type after if_alloc. Honestly, the networking code is not my strong skill, I ventured here only because nobody else did... So what do you suggest? if_alloctype or a different approach? I'd like to prevent if_l2com being mis-interpreted as struct arpcom. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:43:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 372C7D17; Mon, 4 Feb 2013 09:43:44 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com [209.85.216.172]) by mx1.freebsd.org (Postfix) with ESMTP id 93B55810; Mon, 4 Feb 2013 09:43:43 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id b25so2575811qca.17 for ; Mon, 04 Feb 2013 01:43:37 -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=S94FPYgOd9WzTsAQUHiVxjZK2S0WB3ISKEsSB9xnzdo=; b=wT88VWwl7pROJD0U4y1KnSE/rVSH05E+/AZ01l0ciOuhzC/BJPWWVjmLGoJe4a0OIx 4ukbk8iBZaLsrFb5VjaI9iJaUJ3DC1jtbK1a3vI7zHABlUbXS+ljz46p9CqQlP57aF67 N425lld/MhBeRzMgYDdwcn58uUtnoSZ3/kHbdi3KgMzyRAyVta2mQKcbIW+THwKRNCSI b0y6nDQfAZWyiTWq+CmFZVpoR2Xk4pEOoicl2qOper28ykJTJfEbyr/5Arca8+0VTeeh V2wFov6ea0BXNkrAGBiSuYyr6gARt6sNAdTSkp6ops4dQLDEYCPy8Zw7/NwbCLO7xFx5 gBQA== MIME-Version: 1.0 X-Received: by 10.229.180.41 with SMTP id bs41mr4121510qcb.38.1359971016967; Mon, 04 Feb 2013 01:43:36 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.229.105.201 with HTTP; Mon, 4 Feb 2013 01:43:36 -0800 (PST) In-Reply-To: <201301231834.r0NIYLnp006407@svn.freebsd.org> References: <201301231834.r0NIYLnp006407@svn.freebsd.org> Date: Mon, 4 Feb 2013 12:43:36 +0300 X-Google-Sender-Auth: Cl1el2EvG_flZlKGTm2BMgVMux0 Message-ID: Subject: Re: svn commit: r245848 - head/sys/boot/i386/libi386 From: Sergey Kandaurov To: John Baldwin 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:43:44 -0000 On 23 January 2013 22:34, John Baldwin wrote: > Author: jhb > Date: Wed Jan 23 18:34:21 2013 > New Revision: 245848 > URL: http://svnweb.freebsd.org/changeset/base/245848 > > Log: > Always update the hw.uart.console hint anytime a change is made to the > comconsole setup. Previously the hint would be set when if you set a > custom port, but it would not be updated if you later set a custom speed. > > Also, leave the hw.uart.console hint mutable so it can be overridden or > unset by the user if needed. > > Reviewed by: kib (earlier version) > MFC after: 1 week Looks like this results in something wrong. I have a serial console at COM2 (uart1), but it chooses uart0 (1016 == 0x3F8), compare .flags and the final hw.uart.console value. hint.uart.0.at="isa" hint.uart.0.irq="4" hint.uart.0.port="0x3F8" hint.uart.1.at="isa" hint.uart.1.flags="0x10" hint.uart.1.irq="3" hint.uart.1.port="0x2F8" hw.uart.console="io:1016,br:9600" Or even: hint.uart.0.at="isa" hint.uart.0.disabled="1" hint.uart.0.irq="4" hint.uart.0.port="0x3F8" hint.uart.1.at="isa" hint.uart.1.flags="0x10" hint.uart.1.irq="3" hint.uart.1.port="0x2F8" hw.uart.console="io:1016,br:9600" > > Modified: > head/sys/boot/i386/libi386/comconsole.c > > Modified: head/sys/boot/i386/libi386/comconsole.c > ============================================================================== > --- head/sys/boot/i386/libi386/comconsole.c Wed Jan 23 18:19:50 2013 (r245847) > +++ head/sys/boot/i386/libi386/comconsole.c Wed Jan 23 18:34:21 2013 (r245848) > @@ -50,7 +50,6 @@ static int comc_init(int arg); > static void comc_putchar(int c); > static int comc_getchar(void); > static int comc_getspeed(void); > -static void set_hw_console_hint(void); > static int comc_ischar(void); > static int comc_parseint(const char *string); > static uint32_t comc_parse_pcidev(const char *string); > @@ -202,27 +201,14 @@ comc_port_set(struct env_var *ev, int fl > } > > if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && > - comc_port != port) { > + comc_port != port) > comc_setup(comc_curspeed, port); > - set_hw_console_hint(); > - } > > env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); > > return (CMD_OK); > } > > -static void > -set_hw_console_hint(void) > -{ > - char intbuf[64]; > - > - unsetenv("hw.uart.console"); > - sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); > - env_setenv("hw.uart.console", EV_VOLATILE, intbuf, > - env_noset, env_nounset); > -} > - > /* > * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. > * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] > @@ -288,7 +274,6 @@ comc_pcidev_handle(uint32_t locator) > comc_port_set, env_nounset); > > comc_setup(comc_curspeed, port); > - set_hw_console_hint(); > comc_locator = locator; > > return (CMD_OK); > @@ -318,8 +303,10 @@ static void > comc_setup(int speed, int port) > { > static int TRY_COUNT = 1000000; > + char intbuf[64]; > int tries; > > + unsetenv("hw.uart.console"); > comc_curspeed = speed; > comc_port = port; > > @@ -334,9 +321,11 @@ comc_setup(int speed, int port) > inb(comc_port + com_data); > while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); > > - if (tries < TRY_COUNT) > + if (tries < TRY_COUNT) { > comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); > - else > + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); > + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); > + } else > comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); > } > -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:48:50 2013 Return-Path: Delivered-To: svn-src-all@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 E5FEBEF8; Mon, 4 Feb 2013 09:48:50 +0000 (UTC) (envelope-from andrew@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 CEB2A849; Mon, 4 Feb 2013 09:48: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 r149moNp077725; Mon, 4 Feb 2013 09:48:50 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r149moiI077724; Mon, 4 Feb 2013 09:48:50 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302040948.r149moiI077724@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 09:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246318 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:48:51 -0000 Author: andrew Date: Mon Feb 4 09:48:50 2013 New Revision: 246318 URL: http://svnweb.freebsd.org/changeset/base/246318 Log: Use the STACKALIGN macro to alight the stack rather than with a magic mask. Submitted by: Christoph Mallon Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Mon Feb 4 09:42:12 2013 (r246317) +++ head/sys/arm/arm/vm_machdep.c Mon Feb 4 09:48:50 2013 (r246318) @@ -362,8 +362,8 @@ cpu_set_upcall_kse(struct thread *td, vo { struct trapframe *tf = td->td_frame; - tf->tf_usr_sp = ((int)stack->ss_sp + stack->ss_size - - sizeof(struct trapframe)) & ~7; + tf->tf_usr_sp = STACKALIGN((int)stack->ss_sp + stack->ss_size + - sizeof(struct trapframe)); tf->tf_pc = (int)entry; tf->tf_r0 = (int)arg; tf->tf_spsr = PSR_USR32_MODE; @@ -396,14 +396,13 @@ cpu_thread_alloc(struct thread *td) { td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages * PAGE_SIZE) - 1; - td->td_frame = (struct trapframe *) - ((u_int)td->td_kstack + USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1; /* * Ensure td_frame is aligned to an 8 byte boundary as it will be * placed into the stack pointer which must be 8 byte aligned in * the ARM EABI. */ - td->td_frame = (struct trapframe *)((u_int)td->td_frame & ~7); + td->td_frame = (struct trapframe *)STACKALIGN((u_int)td->td_kstack + + USPACE_SVC_STACK_TOP - sizeof(struct pcb) - 1); #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE); From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 09:58:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37F6E290; Mon, 4 Feb 2013 09:58:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) by mx1.freebsd.org (Postfix) with ESMTP id BF72D8A0; Mon, 4 Feb 2013 09:58:53 +0000 (UTC) Received: from sluga.fer.hr (161.53.72.14) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server id 14.1.438.0; Mon, 4 Feb 2013 10:58:49 +0100 Received: from localhost ([161.53.19.63]) by sluga.fer.hr over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 4 Feb 2013 10:58:49 +0100 From: Marko Zec To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Date: Mon, 4 Feb 2013 10:58:45 +0100 User-Agent: KMail/1.9.10 References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <201302040927.43559.zec@fer.hr> <510F8287.7030708@FreeBSD.org> In-Reply-To: <510F8287.7030708@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201302041058.45725.zec@fer.hr> X-OriginalArrivalTime: 04 Feb 2013 09:58:49.0441 (UTC) FILETIME=[3AD51D10:01CE02BE] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 09:58:54 -0000 On Monday 04 February 2013 10:42:31 Andriy Gapon wrote: > on 04/02/2013 10:27 Marko Zec said the following: > > On Monday 04 February 2013 08:41:32 Andriy Gapon wrote: > >> + /* Only ethernet interfaces are of interest. */ > >> + if (ifp->if_type != IFT_ETHER) > >> + return; > > > > And what about IFT_FDDI, IFT_XETHER, IFT_ISO88025, IFT_L2VLAN, > > IFT_BRIDGE, IFT_ARCNET, IFT_IEEE8023ADLAG, IFT_IEEE80211? > > Oh, I didn't realize that many drivers changed if_type after if_alloc. > Honestly, the networking code is not my strong skill, I ventured here > only because nobody else did... > > So what do you suggest? if_alloctype or a different approach? > I'd like to prevent if_l2com being mis-interpreted as struct arpcom. We already have this in vnet_ng_ether_init(): 865 TAILQ_FOREACH(ifp, &V_ifnet, if_link) { 866 if (ifp->if_type == IFT_ETHER 867 || ifp->if_type == IFT_L2VLAN) 868 ng_ether_attach(ifp); 869 } So at least in ng_ether_ifnet_arrival_event() we should do a check consistent to the above code. OTOH we don't check for interface types on entry into ng_ether_attach(), and perhaps a better strategy would be to move your ifp->if_type check there. Perhaps the check could be #defined as a macro to ensure consistency between vnet_ng_ether_init() and ng_ether_attach()? Marko From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 10:05:56 2013 Return-Path: Delivered-To: svn-src-all@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 9B9318AA; Mon, 4 Feb 2013 10:05:56 +0000 (UTC) (envelope-from andrew@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 846A8916; Mon, 4 Feb 2013 10:05: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 r14A5uUd083865; Mon, 4 Feb 2013 10:05:56 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14A5uKN083864; Mon, 4 Feb 2013 10:05:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302041005.r14A5uKN083864@svn.freebsd.org> From: Andrew Turner Date: Mon, 4 Feb 2013 10:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246319 - head/usr.bin/join X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 10:05:56 -0000 Author: andrew Date: Mon Feb 4 10:05:55 2013 New Revision: 246319 URL: http://svnweb.freebsd.org/changeset/base/246319 Log: Cast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf format string expects. This is only an issue on ARM EABI where wint_t is different to wchar_t. Modified: head/usr.bin/join/join.c Modified: head/usr.bin/join/join.c ============================================================================== --- head/usr.bin/join/join.c Mon Feb 4 09:48:50 2013 (r246318) +++ head/usr.bin/join/join.c Mon Feb 4 10:05:55 2013 (r246319) @@ -516,7 +516,7 @@ static void outfield(LINE *lp, u_long fieldno, int out_empty) { if (needsep++) - (void)printf("%lc", *tabchar); + (void)printf("%lc", (wint_t)*tabchar); if (!ferror(stdout)) { if (lp->fieldcnt <= fieldno || out_empty) { if (empty != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 11:06:11 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64C30700; Mon, 4 Feb 2013 11:06:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1820BC3B; Mon, 4 Feb 2013 11:06:09 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA18861; Mon, 04 Feb 2013 13:06:07 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <510F961F.1070104@FreeBSD.org> Date: Mon, 04 Feb 2013 13:06:07 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2 MIME-Version: 1.0 To: Marko Zec Subject: Re: svn commit: r246245 - head/sys/netgraph References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <201302040927.43559.zec@fer.hr> <510F8287.7030708@FreeBSD.org> <201302041058.45725.zec@fer.hr> In-Reply-To: <201302041058.45725.zec@fer.hr> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Mark Johnston , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 11:06:11 -0000 on 04/02/2013 11:58 Marko Zec said the following: > On Monday 04 February 2013 10:42:31 Andriy Gapon wrote: >> on 04/02/2013 10:27 Marko Zec said the following: >>> On Monday 04 February 2013 08:41:32 Andriy Gapon wrote: >>>> + /* Only ethernet interfaces are of interest. */ >>>> + if (ifp->if_type != IFT_ETHER) >>>> + return; >>> >>> And what about IFT_FDDI, IFT_XETHER, IFT_ISO88025, IFT_L2VLAN, >>> IFT_BRIDGE, IFT_ARCNET, IFT_IEEE8023ADLAG, IFT_IEEE80211? >> >> Oh, I didn't realize that many drivers changed if_type after if_alloc. >> Honestly, the networking code is not my strong skill, I ventured here >> only because nobody else did... >> >> So what do you suggest? if_alloctype or a different approach? >> I'd like to prevent if_l2com being mis-interpreted as struct arpcom. > > We already have this in vnet_ng_ether_init(): > > 865 TAILQ_FOREACH(ifp, &V_ifnet, if_link) { > 866 if (ifp->if_type == IFT_ETHER > 867 || ifp->if_type == IFT_L2VLAN) > 868 ng_ether_attach(ifp); > 869 } > > So at least in ng_ether_ifnet_arrival_event() we should do a check > consistent to the above code. OK, that makes sense. Although I am not sure if perhaps that check should be extended too. But that's not something for me to worry about. > OTOH we don't check for interface types on > entry into ng_ether_attach(), and perhaps a better strategy would be to > move your ifp->if_type check there. Definitely not move, perhaps copy... OTOH, ng_ether_attach is invoked via a different mechanism (an explicit hook), directly from ether_ifattach. And so, as you note, there seems to be an inconsistency between ether_ifattach->ng_ether_attach and vnet_ng_ether_init. If a bridge is created after ng_ether is loaded, then there would be ng_ether node for the bridge. If ng_ether is loaded after a bridge is created, then there would be no ng_ether node for it. Unless I miss something. But I don't know if we actually want ng_ether for a bridge (or something else of the types you listed)... > Perhaps the check could be #defined as > a macro to ensure consistency between vnet_ng_ether_init() and > ng_ether_attach()? Perhaps... -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 14:57:06 2013 Return-Path: Delivered-To: svn-src-all@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 9257F1CC; Mon, 4 Feb 2013 14:57:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA7CA2; Mon, 4 Feb 2013 14:57:06 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id bn7so4739771ieb.39 for ; Mon, 04 Feb 2013 06:57:06 -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 :user-agent; bh=QxWNfz9uf5GGvels76STA0WNZDu6g42RXNt9k4ghKCA=; b=YbPaF6baH9qFTbKU5c0gxjFZ+IAAiE5+AFoBXKThVKDMpnW8nC5iU+ujQYyr2xmP8x ORVIGcmatdNUAT7HbLBQEK7x0gK6BbJDxXmK1xWfse9Wt9o2OuFXvIIqpQcMb9jlKjHP wgS5uS5ZVlha841yk2EfKKdjy19M3NhNaXr88lu4Y/3wyUHr6Ru9ZxMfj022uwAbESeT NYArUPlIS4KlXeHgMB0GhT2zEZULiB8Lz58PEgYRo5Nz9YZObVlrQSqUVoDAw2dEwp/X pG18unsphiC0nD/P+5lngBi6ojmXokN3LMBZnazWtSyyi9QPcKaONfyej1fm41BtbgN/ erZA== X-Received: by 10.50.135.100 with SMTP id pr4mr2307363igb.37.1359989825933; Mon, 04 Feb 2013 06:57:05 -0800 (PST) Received: from oddish.sandvine.com ([64.7.137.182]) by mx.google.com with ESMTPS id uj6sm16645048igb.4.2013.02.04.06.57.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 06:57:04 -0800 (PST) Sender: Mark Johnston Date: Mon, 4 Feb 2013 07:56:52 -0500 From: Mark Johnston To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Message-ID: <20130204125652.GA1543@oddish.sandvine.com> References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <20130204003701.GA1700@oddish> <510F662C.1080007@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <510F662C.1080007@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Mark Johnston , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 14:57:06 -0000 On Mon, Feb 04, 2013 at 09:41:32AM +0200, Andriy Gapon wrote: > on 04/02/2013 02:37 Mark Johnston said the following: > > On Sat, Feb 02, 2013 at 11:54:00AM +0000, Andriy Gapon wrote: > >> Author: avg > >> Date: Sat Feb 2 11:54:00 2013 > >> New Revision: 246245 > >> URL: http://svnweb.freebsd.org/changeset/base/246245 > >> > >> Log: > >> ng_ether: track interface renaming > >> > >> Also sanitize interface names that can potentially contain characters > >> that are prohibited in netgraph names. > >> > >> PR: kern/154850 (sanitizing of names) > >> Discussed with: eri, melifaro > >> Submitted by: Nikolay Denev (sanitizing code) > >> Reviewed by: eri, glebius > >> MFC after: 17 days > >> > >> Modified: > >> head/sys/netgraph/ng_ether.c > >> > > > > Hi Andriy, > > > > This commit seems to cause a panic during boot when creating the > > loopback interface. I couldn't get a core dump but the problem seems to > > happen when dereferencing ifp->if_l2com in the IFP2NG macro in > > ng_ether_ifnet_arrival_event(). In the case of lo(4) this pointer seems > > to be NULL (I suppose because lo(4) doesn't register itself in the > > if_com_alloc/free tables). > > > > The patch below fixes the panic for me. > > Mark, > > thank you for the report and sorry for the breakage. > Could you please try the following patch (slightly different from your patch)? Thanks, I can confirm that this one works too. > > diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c > index 6266f40..05ea402 100644 > --- a/sys/netgraph/ng_ether.c > +++ b/sys/netgraph/ng_ether.c > @@ -410,11 +410,16 @@ static void > ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) > { > char name[IFNAMSIZ]; > - node_p node = IFP2NG(ifp); > + node_p node; > + > + /* Only ethernet interfaces are of interest. */ > + if (ifp->if_type != IFT_ETHER) > + return; > > /* > * Just return if it's a new interface without an ng_ether companion. > */ > + node = IFP2NG(ifp); > if (node == NULL) > return; > > From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 15:51:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A2DC62D; Mon, 4 Feb 2013 15:51:29 +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 2D8B5371; Mon, 4 Feb 2013 15:51: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 r14FpTOW091298; Mon, 4 Feb 2013 15:51:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14FpSxj091288; Mon, 4 Feb 2013 15:51:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041551.r14FpSxj091288@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 15:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 15:51:29 -0000 Author: des Date: Mon Feb 4 15:51:27 2013 New Revision: 246321 URL: http://svnweb.freebsd.org/changeset/base/246321 Log: MFH (r244992): remove firewire from GENERIC Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC stable/9/sys/ia64/conf/GENERIC stable/9/sys/pc98/conf/GENERIC stable/9/sys/powerpc/conf/GENERIC stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/amd64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -331,15 +331,6 @@ device ural # Ralink Technology RT2500 device urtw # Realtek RTL8187B/L wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/i386/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -344,15 +344,6 @@ device ural # Ralink Technology RT2500 device urtw # Realtek RTL8187B/L wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/ia64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -64,7 +64,6 @@ options KDB # Kernel debugger related options KDB_TRACE # Print a stack trace for a panic # Various "busses" -device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support device scbus # SCSI bus (required for ATA/SCSI) Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/pc98/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -269,7 +269,6 @@ device bpf # Berkeley packet filter #device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support -#device firewire # FireWire bus code #device sbp # SCSI over FireWire (Requires scbus and da) #device fwe # Ethernet over FireWire (non-standard!) Modified: stable/9/sys/powerpc/conf/GENERIC ============================================================================== --- stable/9/sys/powerpc/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/powerpc/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -163,12 +163,6 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) - # Misc device iicbus # I2C bus code device kiic # Keywest I2C Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/sparc64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -253,15 +253,6 @@ device uath # Atheros AR5523 wireless device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_audiocs # Crystal Semiconductor CS4231 From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 16:13:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B48DDEF; Mon, 4 Feb 2013 16:13:56 +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 345D56E1; Mon, 4 Feb 2013 16:13: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 r14GDupG098543; Mon, 4 Feb 2013 16:13:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14GDtO7098541; Mon, 4 Feb 2013 16:13:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041613.r14GDtO7098541@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246322 - stable/9/tools/build/options X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 16:13:56 -0000 Author: des Date: Mon Feb 4 16:13:55 2013 New Revision: 246322 URL: http://svnweb.freebsd.org/changeset/base/246322 Log: MFH (r228082): add missing documentation for WITH_LIBCPLUSPLUS MFH (r228159): add missing documentation for WITH_CTF Added: stable/9/tools/build/options/WITH_CTF - copied unchanged from r228159, head/tools/build/options/WITH_CTF stable/9/tools/build/options/WITH_LIBCPLUSPLUS - copied unchanged from r228082, head/tools/build/options/WITH_LIBCPLUSPLUS Modified: Directory Properties: stable/9/tools/build/options/ (props changed) Copied: stable/9/tools/build/options/WITH_CTF (from r228159, head/tools/build/options/WITH_CTF) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_CTF Mon Feb 4 16:13:55 2013 (r246322, copy of r228159, head/tools/build/options/WITH_CTF) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to compile with CTF (Compact C Type Format) data. +CTF data encapsulates a reduced form of debugging information +similar to DWARF and the venerable stabs and is required for DTrace. Copied: stable/9/tools/build/options/WITH_LIBCPLUSPLUS (from r228082, head/tools/build/options/WITH_LIBCPLUSPLUS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_LIBCPLUSPLUS Mon Feb 4 16:13:55 2013 (r246322, copy of r228082, head/tools/build/options/WITH_LIBCPLUSPLUS) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build libcxxrt and libc++. From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 16:20:14 2013 Return-Path: Delivered-To: svn-src-all@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 A8E5910E; Mon, 4 Feb 2013 16:20:14 +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 79F0271C; Mon, 4 Feb 2013 16:20: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 r14GKE72099605; Mon, 4 Feb 2013 16:20:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14GKEUu099604; Mon, 4 Feb 2013 16:20:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041620.r14GKEUu099604@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 16:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246323 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 16:20:14 -0000 Author: des Date: Mon Feb 4 16:20:13 2013 New Revision: 246323 URL: http://svnweb.freebsd.org/changeset/base/246323 Log: Regenerate Modified: stable/9/share/man/man5/src.conf.5 Modified: stable/9/share/man/man5/src.conf.5 ============================================================================== --- stable/9/share/man/man5/src.conf.5 Mon Feb 4 16:13:55 2013 (r246322) +++ stable/9/share/man/man5/src.conf.5 Mon Feb 4 16:20:13 2013 (r246323) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/9/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru +.\" from FreeBSD: stable/9/tools/build/options/makeman 236430 2012-06-02 02:26:37Z gjb .\" $FreeBSD$ -.Dd January 14, 2013 +.Dd February 4, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -207,7 +207,7 @@ and Set to enable the http statistics interface for named. This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_BINUTILS 222090 2011-05-19 05:13:25Z imp +.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_BINUTILS 235587 2012-05-18 02:00:01Z gjb Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic @@ -258,6 +258,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_CTF +.It .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG @@ -284,7 +286,7 @@ amd64/amd64, i386/i386, pc98/i386, power .\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_EXTRAS 231919 2012-02-19 23:35:56Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_IS_CC 233099 2012-03-17 22:29:05Z dim +.\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_IS_CC 235587 2012-05-18 02:00:01Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -318,6 +320,11 @@ When set, the following options are also .Va WITH_GSSAPI is set explicitly) .El +.It Va WITH_CTF +.\" from FreeBSD: stable/9/tools/build/options/WITH_CTF 246322 2013-02-04 16:13:55Z des +Set to compile with CTF (Compact C Type Format) data. +CTF data encapsulates a reduced form of debugging information +similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CTM .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build @@ -583,6 +590,9 @@ and On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. +.It Va WITH_LIBCPLUSPLUS +.\" from FreeBSD: stable/9/tools/build/options/WITH_LIBCPLUSPLUS 246322 2013-02-04 16:13:55Z des +Set to build libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the @@ -740,16 +750,6 @@ Set to not build NLS catalogs. .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . -.It Va WITH_NMTREE -.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245241 2013-01-09 21:07:08Z brooks -Set to install -.Xr nmtree 8 -as -.Xr mtree 8 . -By default -.Xr fmtree 8 -is installed as -.Xr mtree 8 . .It Va WITHOUT_NS_CACHING .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the @@ -887,7 +887,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -.\" from FreeBSD: stable/9/tools/build/options/WITH_SHARED_TOOLCHAIN 235398 2012-05-13 13:57:53Z kib +.\" from FreeBSD: stable/9/tools/build/options/WITH_SHARED_TOOLCHAIN 235587 2012-05-18 02:00:01Z gjb Set to build the toolchain binaries shared. The set includes .Xr cc 1 , @@ -1010,11 +1010,11 @@ protocols (usable only via 802.1X). .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO -.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZONEINFO 171994 2007-08-27 20:01:08Z remko +.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZONEINFO 235587 2012-05-18 02:00:01Z gjb Set to not build the timezone database. .El .Sh FILES -.Bl -tag -compact +.Bl -tag -compact -width Pa .It Pa /etc/src.conf .It Pa /usr/share/mk/bsd.own.mk .El From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 17:29:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AAF17E30; Mon, 4 Feb 2013 17:29:13 +0000 (UTC) (envelope-from avg@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 9973CD2E; Mon, 4 Feb 2013 17:29: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 r14HTDjJ020954; Mon, 4 Feb 2013 17:29:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14HTD0U020953; Mon, 4 Feb 2013 17:29:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302041729.r14HTD0U020953@svn.freebsd.org> From: Andriy Gapon Date: Mon, 4 Feb 2013 17:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246324 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 17:29:13 -0000 Author: avg Date: Mon Feb 4 17:29:13 2013 New Revision: 246324 URL: http://svnweb.freebsd.org/changeset/base/246324 Log: ng_ether_ifnet_arrival_event: check interface type before using IFP2NG The check is copied from vnet_ng_ether_init. Not sure if it covers all the types that we want to support with ng_ether. Reported by: markj Discussed with: zec MFC after: 10 days X-MFC with: r246245 Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Mon Feb 4 16:20:13 2013 (r246323) +++ head/sys/netgraph/ng_ether.c Mon Feb 4 17:29:13 2013 (r246324) @@ -410,11 +410,17 @@ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; - node_p node = IFP2NG(ifp); + node_p node; + + /* Only ethernet interfaces are of interest. */ + if (ifp->if_type != IFT_ETHER + && ifp->if_type != IFT_L2VLAN) + return; /* * Just return if it's a new interface without an ng_ether companion. */ + node = IFP2NG(ifp); if (node == NULL) return; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 17:41:18 2013 Return-Path: Delivered-To: svn-src-all@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 8228341A; Mon, 4 Feb 2013 17:41:18 +0000 (UTC) (envelope-from sjg@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 7420DE33; Mon, 4 Feb 2013 17:41: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 r14HfIRL025929; Mon, 4 Feb 2013 17:41:18 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14HfI9p025924; Mon, 4 Feb 2013 17:41:18 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201302041741.r14HfI9p025924@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 4 Feb 2013 17:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246325 - in head/usr.bin/bmake: . unit-tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 17:41:18 -0000 Author: sjg Date: Mon Feb 4 17:41:17 2013 New Revision: 246325 URL: http://svnweb.freebsd.org/changeset/base/246325 Log: Missed adding Makefile.config and unit-tests/Makefile should allow FreeBSD make to do 'obj'. Approved by: marcel (mentor) Added: head/usr.bin/bmake/Makefile.config (contents, props changed) Modified: head/usr.bin/bmake/unit-tests/Makefile Added: head/usr.bin/bmake/Makefile.config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bmake/Makefile.config Mon Feb 4 17:41:17 2013 (r246325) @@ -0,0 +1,21 @@ +# This is a generated file, do NOT edit! +# See contrib/bmake/bsd.after-import.mk +# +# $FreeBSD$ + +SRCTOP?= ${.CURDIR:H:H} + +# things set by configure + +prefix= /usr +srcdir= ${SRCTOP}/contrib/bmake +CC?= gcc +DEFAULT_SYS_PATH= .../share/mk:/usr/share/mk + +CPPFLAGS+= +CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H +LDFLAGS= +LIBOBJS= ${LIBOBJDIR}stresep$U.o +LDADD= +USE_META= yes +FILEMON_H= /usr/include/dev/filemon/filemon.h Modified: head/usr.bin/bmake/unit-tests/Makefile ============================================================================== --- head/usr.bin/bmake/unit-tests/Makefile Mon Feb 4 17:29:13 2013 (r246324) +++ head/usr.bin/bmake/unit-tests/Makefile Mon Feb 4 17:41:17 2013 (r246325) @@ -79,10 +79,12 @@ TOOL_TR?= tr TOOL_DIFF?= diff DIFF_FLAGS?= -u +.if defined(.PARSEDIR) # ensure consistent results from sort(1) LC_ALL= C LANG= C .export LANG LC_ALL +.endif # The driver. # We always pretend .MAKE was called 'make' From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 18:49:17 2013 Return-Path: Delivered-To: svn-src-all@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 20ABED03; Mon, 4 Feb 2013 18:49:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw11.york.ac.uk (mail-gw11.york.ac.uk [144.32.129.150]) by mx1.freebsd.org (Postfix) with ESMTP id DDC7D387; Mon, 4 Feb 2013 18:49:16 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:29038) by mail-gw11.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1U2R6K-0006vw-SO; Mon, 04 Feb 2013 18:49:08 +0000 Date: Mon, 4 Feb 2013 18:49:08 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@thunderhorn.york.ac.uk To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf In-Reply-To: <201302041551.r14FpSxj091288@svn.freebsd.org> Message-ID: References: <201302041551.r14FpSxj091288@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="830102327-512815803-1360003748=:27206" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 18:49:17 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --830102327-512815803-1360003748=:27206 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 4 Feb 2013, Dag-Erling Sm=C3=B8rgrav wrote: > Author: des > Date: Mon Feb 4 15:51:27 2013 > New Revision: 246321 > URL: http://svnweb.freebsd.org/changeset/base/246321 >=20 > Log: > MFH (r244992): remove firewire from GENERIC Although I do think this merge is a good idea, I think that this deserves= =20 an entry in UPDATING, as it is a stable branch. Perhaps include "you can= =20 still load it as a module" or similar, but you could also say something=20 like "It has been removed as it has been one of the main causes of issue=20 with suspend/resume" and so use it as a chance to advertise that this will= =20 fix s/r for many users :-) Gavin --830102327-512815803-1360003748=:27206-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 19:05:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62F4769B; Mon, 4 Feb 2013 19:05:54 +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 5565571A; Mon, 4 Feb 2013 19:05: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 r14J5sKj051038; Mon, 4 Feb 2013 19:05:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14J5sZ5051037; Mon, 4 Feb 2013 19:05:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041905.r14J5sZ5051037@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 19:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246328 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 19:05:54 -0000 Author: des Date: Mon Feb 4 19:05:53 2013 New Revision: 246328 URL: http://svnweb.freebsd.org/changeset/base/246328 Log: Sort by MK_* knob like the comment says MFC after: 1 week Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Feb 4 18:39:05 2013 (r246327) +++ head/lib/Makefile Mon Feb 4 19:05:53 2013 (r246328) @@ -177,6 +177,11 @@ _libiconv_modules= libiconv_modules _libipx= libipx .endif +.if ${MK_LIBCPLUSPLUS} != "no" +_libcxxrt= libcxxrt +_libcplusplus= libc++ +.endif + .if ${MK_LIBTHR} != "no" _libthr= libthr .endif @@ -221,11 +226,6 @@ _librtld_db= librtld_db _libmp= libmp .endif -.if ${MK_LIBCPLUSPLUS} != "no" -_libcxxrt= libcxxrt -_libcplusplus= libc++ -.endif - .if ${MK_PMC} != "no" _libpmc= libpmc .endif From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 19:17:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF2A5BF7; Mon, 4 Feb 2013 19:17:15 +0000 (UTC) (envelope-from delphij@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 D23137CB; Mon, 4 Feb 2013 19:17: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 r14JHFTM054419; Mon, 4 Feb 2013 19:17:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14JHFrV054418; Mon, 4 Feb 2013 19:17:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302041917.r14JHFrV054418@svn.freebsd.org> From: Xin LI Date: Mon, 4 Feb 2013 19:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246329 - head/sbin/recoverdisk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 19:17:15 -0000 Author: delphij Date: Mon Feb 4 19:17:15 2013 New Revision: 246329 URL: http://svnweb.freebsd.org/changeset/base/246329 Log: Use stripesize as smallest block size if it's available. MFC after: 2 weeks Modified: head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Mon Feb 4 19:05:53 2013 (r246328) +++ head/sbin/recoverdisk/recoverdisk.c Mon Feb 4 19:17:15 2013 (r246329) @@ -156,6 +156,7 @@ main(int argc, char * const argv[]) int error, state; u_char *buf; u_int sectorsize; + u_int stripesize; time_t t1, t2; struct stat sb; u_int n, snapshot = 60; @@ -201,6 +202,10 @@ main(int argc, char * const argv[]) if (error < 0) err(1, "DIOCGSECTORSIZE failed"); + error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize); + if (error == 0 && stripesize > sectorsize) + sectorsize = stripesize; + minsize = sectorsize; bigsize = (bigsize / sectorsize) * sectorsize; From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 19:22:46 2013 Return-Path: Delivered-To: svn-src-all@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 0C246E62; Mon, 4 Feb 2013 19:22:46 +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 9F0F881C; Mon, 4 Feb 2013 19:22:45 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CA9F56BC6; Mon, 4 Feb 2013 19:22:44 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 66ECBAD2F; Mon, 4 Feb 2013 20:22:44 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gavin Atkinson Subject: Re: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf References: <201302041551.r14FpSxj091288@svn.freebsd.org> Date: Mon, 04 Feb 2013 20:22:43 +0100 In-Reply-To: (Gavin Atkinson's message of "Mon, 4 Feb 2013 18:49:08 +0000 (GMT)") Message-ID: <8638xbnat8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 19:22:46 -0000 Gavin Atkinson writes: > Although I do think this merge is a good idea, I think that this deserves= =20 > an entry in UPDATING, as it is a stable branch. Will do. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 20:46:14 2013 Return-Path: Delivered-To: svn-src-all@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 347772DE; Mon, 4 Feb 2013 20:46:14 +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 130B1D32; Mon, 4 Feb 2013 20:46:14 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 60ED4B926; Mon, 4 Feb 2013 15:46:13 -0500 (EST) From: John Baldwin To: Andriy Gapon Subject: Re: svn commit: r246282 - in head/sys: conf kern Date: Mon, 4 Feb 2013 14:29:01 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302030957.r139vd8n027213@svn.freebsd.org> In-Reply-To: <201302030957.r139vd8n027213@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302041429.01477.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Feb 2013 15:46:13 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 20:46:14 -0000 On Sunday, February 03, 2013 4:57:39 am Andriy Gapon wrote: > Author: avg > Date: Sun Feb 3 09:57:39 2013 > New Revision: 246282 > URL: http://svnweb.freebsd.org/changeset/base/246282 > > Log: > allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9) > > Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM), > the static ktr_buf_init is used. Size of the static buffer is determined > by a new kernel option KTR_BOOT_ENTRIES. Its default value is 1024. > > This commit builds on top of r243046. Does this lose "early" entries once the SYSINIT runs? It doesn't seem to make any effort to copy the existing entries over to the new buffer? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 20:46:16 2013 Return-Path: Delivered-To: svn-src-all@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 D2CD52E3; Mon, 4 Feb 2013 20:46:16 +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 AF9A6D34; Mon, 4 Feb 2013 20:46:16 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 30BFAB9A0; Mon, 4 Feb 2013 15:46:16 -0500 (EST) From: John Baldwin To: Sergey Kandaurov Subject: Re: svn commit: r245848 - head/sys/boot/i386/libi386 Date: Mon, 4 Feb 2013 14:46:55 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301231834.r0NIYLnp006407@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201302041446.55786.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Feb 2013 15:46:16 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 20:46:16 -0000 On Monday, February 04, 2013 4:43:36 am Sergey Kandaurov wrote: > On 23 January 2013 22:34, John Baldwin wrote: > > Author: jhb > > Date: Wed Jan 23 18:34:21 2013 > > New Revision: 245848 > > URL: http://svnweb.freebsd.org/changeset/base/245848 > > > > Log: > > Always update the hw.uart.console hint anytime a change is made to the > > comconsole setup. Previously the hint would be set when if you set a > > custom port, but it would not be updated if you later set a custom speed. > > > > Also, leave the hw.uart.console hint mutable so it can be overridden or > > unset by the user if needed. > > > > Reviewed by: kib (earlier version) > > MFC after: 1 week > > Looks like this results in something wrong. > I have a serial console at COM2 (uart1), but it chooses uart0 > (1016 == 0x3F8), compare .flags and the final hw.uart.console value. Do you have a working console in the loader? It is setting the hint based on what the loader uses. I use this to use COM2 for both loader and kernel: console="comconsole vidconsole" comconsole_port=0x2f8 Note that when hw.uart.console is set, any flags set in hint.uart.X.flags to set the console are ignored. If you are not using -h in /boot.config or setting 'console' for the loader to enable a serial console then the loader should not be setting hw.uart.console (if it is, that is a bug to be fixed). However, configuring the kernel to use a different serial console from the loader seems very odd. You should be able to manually set hw.uart.console in loader.conf if you are doing that. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 20:56:35 2013 Return-Path: Delivered-To: svn-src-all@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 221ECBD2; Mon, 4 Feb 2013 20:56:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CB09EE1D; Mon, 4 Feb 2013 20:56:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA24625; Mon, 04 Feb 2013 22:56:26 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U2T5V-0009cw-TY; Mon, 04 Feb 2013 22:56:25 +0200 Message-ID: <51102076.8030302@FreeBSD.org> Date: Mon, 04 Feb 2013 22:56:22 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r246282 - in head/sys: conf kern References: <201302030957.r139vd8n027213@svn.freebsd.org> <201302041429.01477.jhb@freebsd.org> In-Reply-To: <201302041429.01477.jhb@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 20:56:35 -0000 on 04/02/2013 21:29 John Baldwin said the following: > On Sunday, February 03, 2013 4:57:39 am Andriy Gapon wrote: >> Author: avg >> Date: Sun Feb 3 09:57:39 2013 >> New Revision: 246282 >> URL: http://svnweb.freebsd.org/changeset/base/246282 >> >> Log: >> allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9) >> >> Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM), >> the static ktr_buf_init is used. Size of the static buffer is determined >> by a new kernel option KTR_BOOT_ENTRIES. Its default value is 1024. >> >> This commit builds on top of r243046. > > Does this lose "early" entries once the SYSINIT runs? It doesn't seem to make > any effort to copy the existing entries over to the new buffer? Yes, this is true and glebius has also noticed that... I think that a simple bcopy should be fine here? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 21:50:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 262C1B9C; Mon, 4 Feb 2013 21:50:56 +0000 (UTC) (envelope-from avg@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 14AE5250; Mon, 4 Feb 2013 21:50: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 r14LotLN003094; Mon, 4 Feb 2013 21:50:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14Lot9x003093; Mon, 4 Feb 2013 21:50:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302042150.r14Lot9x003093@svn.freebsd.org> From: Andriy Gapon Date: Mon, 4 Feb 2013 21:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246330 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 21:50:56 -0000 Author: avg Date: Mon Feb 4 21:50:55 2013 New Revision: 246330 URL: http://svnweb.freebsd.org/changeset/base/246330 Log: ktr: copy content from the early static buffer if KTR_ENTRIES != KTR_BOOT_ENTRIES Reported by: glebius, jhb Pointyhat to: avg MFC after: 14 days X-MFC with: r246282 Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Mon Feb 4 19:17:15 2013 (r246329) +++ head/sys/kern/kern_ktr.c Mon Feb 4 21:50:55 2013 (r246330) @@ -213,6 +213,7 @@ ktr_entries_initializer(void *dummy __un ktr_mask = 0; ktr_buf = malloc(sizeof(*ktr_buf) * KTR_ENTRIES, M_KTR, M_WAITOK | M_ZERO); + memcpy(ktr_buf, ktr_buf_init, sizeof(ktr_buf_init)); ktr_entries = KTR_ENTRIES; ktr_mask = mask; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 21:58:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AF8AF32; Mon, 4 Feb 2013 21:58:58 +0000 (UTC) (envelope-from avg@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 564E9294; Mon, 4 Feb 2013 21:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r14LwwVm004308; Mon, 4 Feb 2013 21:58:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14LwwwQ004307; Mon, 4 Feb 2013 21:58:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302042158.r14LwwwQ004307@svn.freebsd.org> From: Andriy Gapon Date: Mon, 4 Feb 2013 21:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246331 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 21:58:58 -0000 Author: avg Date: Mon Feb 4 21:58:57 2013 New Revision: 246331 URL: http://svnweb.freebsd.org/changeset/base/246331 Log: ktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES Suggested by: adrian MFC after: 14 days X-MFC with: r246282 Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Mon Feb 4 21:50:55 2013 (r246330) +++ head/sys/kern/kern_ktr.c Mon Feb 4 21:58:57 2013 (r246331) @@ -198,7 +198,7 @@ SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, sysctl_debug_ktr_mask, "IU", "Bitmask of KTR event classes for which logging is enabled"); -#if KTR_ENTRIES != KTR_BOOT_ENTRIES +#if KTR_ENTRIES > KTR_BOOT_ENTRIES /* * A simplified version of sysctl_debug_ktr_entries. * No need to care about SMP, scheduling, etc. From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 00:37:46 2013 Return-Path: Delivered-To: svn-src-all@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 93B5F1CB; Tue, 5 Feb 2013 00:37:46 +0000 (UTC) (envelope-from yongari@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 84565B29; Tue, 5 Feb 2013 00:37: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 r150bktZ053090; Tue, 5 Feb 2013 00:37:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r150bkP1053085; Tue, 5 Feb 2013 00:37:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201302050037.r150bkP1053085@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 5 Feb 2013 00:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246341 - head/sys/dev/age X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 00:37:46 -0000 Author: yongari Date: Tue Feb 5 00:37:45 2013 New Revision: 246341 URL: http://svnweb.freebsd.org/changeset/base/246341 Log: Rework jumbo frame handling. QAC confirmed that the controller requires 8 bytes alignment on RX buffer. Given that non-jumbo frame works on any alignments I guess this DMA limitation for RX buffer could be jumbo frame specific one. Also I'm not sure whether this DMA limitation is related with 64bit DMA. Previously age(4) disabled 64bit DMA addressing due to silent data corruption. So we may need more testing on re-enabling 64bit DMA in future. While I'm here, change mbuf chaining algorithm to use fixed sized buffer and force software checksum if controller reports length error. According to QAC, RFD is not updated at all for jumbo frame so it works just like alc(4) controllers. This change also added alignment fixup for strict alignment architectures. Because I'm not aware of any non-x86 machines that use age(4) controllers it's just for completeness at this moment. Wit this change, jumbo frame should work with age(4). Tested by: Christian Gusenbauer < c47g <> gmx dot at > MFC after: 1 week Modified: head/sys/dev/age/if_age.c head/sys/dev/age/if_agevar.h Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Feb 5 00:33:32 2013 (r246340) +++ head/sys/dev/age/if_age.c Tue Feb 5 00:37:45 2013 (r246341) @@ -142,6 +142,9 @@ static int age_init_rx_ring(struct age_s static void age_init_rr_ring(struct age_softc *); static void age_init_cmb_block(struct age_softc *); static void age_init_smb_block(struct age_softc *); +#ifndef __NO_STRICT_ALIGNMENT +static struct mbuf *age_fixup_rx(struct ifnet *, struct mbuf *); +#endif static int age_newbuf(struct age_softc *, struct age_rxdesc *); static void age_rxvlan(struct age_softc *); static void age_rxfilter(struct age_softc *); @@ -1133,7 +1136,7 @@ again: /* Create tag for Rx buffers. */ error = bus_dma_tag_create( sc->age_cdata.age_buffer_tag, /* parent */ - 1, 0, /* alignment, boundary */ + AGE_RX_BUF_ALIGN, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -2268,16 +2271,53 @@ age_txintr(struct age_softc *sc, int tpd } } +#ifndef __NO_STRICT_ALIGNMENT +static struct mbuf * +age_fixup_rx(struct ifnet *ifp, struct mbuf *m) +{ + struct mbuf *n; + int i; + uint16_t *src, *dst; + + src = mtod(m, uint16_t *); + dst = src - 3; + + if (m->m_next == NULL) { + for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) + *dst++ = *src++; + m->m_data -= 6; + return (m); + } + /* + * Append a new mbuf to received mbuf chain and copy ethernet + * header from the mbuf chain. This can save lots of CPU + * cycles for jumbo frame. + */ + MGETHDR(n, M_NOWAIT, MT_DATA); + if (n == NULL) { + ifp->if_iqdrops++; + m_freem(m); + return (NULL); + } + bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); + m->m_data += ETHER_HDR_LEN; + m->m_len -= ETHER_HDR_LEN; + n->m_len = ETHER_HDR_LEN; + M_MOVE_PKTHDR(n, m); + n->m_next = m; + return (n); +} +#endif + /* Receive a frame. */ static void age_rxeof(struct age_softc *sc, struct rx_rdesc *rxrd) { struct age_rxdesc *rxd; - struct rx_desc *desc; struct ifnet *ifp; struct mbuf *mp, *m; uint32_t status, index, vtag; - int count, nsegs, pktlen; + int count, nsegs; int rx_cons; AGE_LOCK_ASSERT(sc); @@ -2289,9 +2329,7 @@ age_rxeof(struct age_softc *sc, struct r nsegs = AGE_RX_NSEGS(index); sc->age_cdata.age_rxlen = AGE_RX_BYTES(le32toh(rxrd->len)); - if ((status & AGE_RRD_ERROR) != 0 && - (status & (AGE_RRD_CRC | AGE_RRD_CODE | AGE_RRD_DRIBBLE | - AGE_RRD_RUNT | AGE_RRD_OFLOW | AGE_RRD_TRUNC)) != 0) { + if ((status & (AGE_RRD_ERROR | AGE_RRD_LENGTH_NOK)) != 0) { /* * We want to pass the following frames to upper * layer regardless of error status of Rx return @@ -2301,33 +2339,31 @@ age_rxeof(struct age_softc *sc, struct r * o frame length and protocol specific length * does not match. */ - sc->age_cdata.age_rx_cons += nsegs; - sc->age_cdata.age_rx_cons %= AGE_RX_RING_CNT; - return; + status |= AGE_RRD_IPCSUM_NOK | AGE_RRD_TCP_UDPCSUM_NOK; + if ((status & (AGE_RRD_CRC | AGE_RRD_CODE | AGE_RRD_DRIBBLE | + AGE_RRD_RUNT | AGE_RRD_OFLOW | AGE_RRD_TRUNC)) != 0) + return; } - pktlen = 0; for (count = 0; count < nsegs; count++, AGE_DESC_INC(rx_cons, AGE_RX_RING_CNT)) { rxd = &sc->age_cdata.age_rxdesc[rx_cons]; mp = rxd->rx_m; - desc = rxd->rx_desc; /* Add a new receive buffer to the ring. */ if (age_newbuf(sc, rxd) != 0) { ifp->if_iqdrops++; /* Reuse Rx buffers. */ - if (sc->age_cdata.age_rxhead != NULL) { + if (sc->age_cdata.age_rxhead != NULL) m_freem(sc->age_cdata.age_rxhead); - AGE_RXCHAIN_RESET(sc); - } break; } - /* The length of the first mbuf is computed last. */ - if (count != 0) { - mp->m_len = AGE_RX_BYTES(le32toh(desc->len)); - pktlen += mp->m_len; - } + /* + * Assume we've received a full sized frame. + * Actual size is fixed when we encounter the end of + * multi-segmented frame. + */ + mp->m_len = AGE_RX_BUF_SIZE; /* Chain received mbufs. */ if (sc->age_cdata.age_rxhead == NULL) { @@ -2342,14 +2378,20 @@ age_rxeof(struct age_softc *sc, struct r } if (count == nsegs - 1) { + /* Last desc. for this frame. */ + m = sc->age_cdata.age_rxhead; + m->m_flags |= M_PKTHDR; /* * It seems that L1 controller has no way * to tell hardware to strip CRC bytes. */ - sc->age_cdata.age_rxlen -= ETHER_CRC_LEN; + m->m_pkthdr.len = sc->age_cdata.age_rxlen - + ETHER_CRC_LEN; if (nsegs > 1) { + /* Set last mbuf size. */ + mp->m_len = sc->age_cdata.age_rxlen - + ((nsegs - 1) * AGE_RX_BUF_SIZE); /* Remove the CRC bytes in chained mbufs. */ - pktlen -= ETHER_CRC_LEN; if (mp->m_len <= ETHER_CRC_LEN) { sc->age_cdata.age_rxtail = sc->age_cdata.age_rxprev_tail; @@ -2360,15 +2402,9 @@ age_rxeof(struct age_softc *sc, struct r } else { mp->m_len -= ETHER_CRC_LEN; } - } - - m = sc->age_cdata.age_rxhead; - m->m_flags |= M_PKTHDR; + } else + m->m_len = m->m_pkthdr.len; m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = sc->age_cdata.age_rxlen; - /* Set the first mbuf length. */ - m->m_len = sc->age_cdata.age_rxlen - pktlen; - /* * Set checksum information. * It seems that L1 controller can compute partial @@ -2383,9 +2419,9 @@ age_rxeof(struct age_softc *sc, struct r */ if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && (status & AGE_RRD_IPV4) != 0) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; if ((status & AGE_RRD_IPCSUM_NOK) == 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + m->m_pkthdr.csum_flags |= + CSUM_IP_CHECKED | CSUM_IP_VALID; if ((status & (AGE_RRD_TCP | AGE_RRD_UDP)) && (status & AGE_RRD_TCP_UDPCSUM_NOK) == 0) { m->m_pkthdr.csum_flags |= @@ -2406,22 +2442,21 @@ age_rxeof(struct age_softc *sc, struct r m->m_pkthdr.ether_vtag = AGE_RX_VLAN_TAG(vtag); m->m_flags |= M_VLANTAG; } - +#ifndef __NO_STRICT_ALIGNMENT + m = age_fixup_rx(ifp, m); + if (m != NULL) +#endif + { /* Pass it on. */ AGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); AGE_LOCK(sc); - - /* Reset mbuf chains. */ - AGE_RXCHAIN_RESET(sc); + } } } - if (count != nsegs) { - sc->age_cdata.age_rx_cons += nsegs; - sc->age_cdata.age_rx_cons %= AGE_RX_RING_CNT; - } else - sc->age_cdata.age_rx_cons = rx_cons; + /* Reset mbuf chains. */ + AGE_RXCHAIN_RESET(sc); } static int @@ -2456,16 +2491,16 @@ age_rxintr(struct age_softc *sc, int rr_ * I'm not sure whether this check is really needed. */ pktlen = AGE_RX_BYTES(le32toh(rxrd->len)); - if (nsegs != ((pktlen + (MCLBYTES - ETHER_ALIGN - 1)) / - (MCLBYTES - ETHER_ALIGN))) + if (nsegs != (pktlen + (AGE_RX_BUF_SIZE - 1)) / AGE_RX_BUF_SIZE) break; - prog++; /* Received a frame. */ age_rxeof(sc, rxrd); /* Clear return ring. */ rxrd->index = 0; AGE_DESC_INC(rr_cons, AGE_RR_RING_CNT); + sc->age_cdata.age_rx_cons += nsegs; + sc->age_cdata.age_rx_cons %= AGE_RX_RING_CNT; } if (prog > 0) { @@ -3065,7 +3100,9 @@ age_newbuf(struct age_softc *sc, struct if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; - m_adj(m, ETHER_ALIGN); +#ifndef __NO_STRICT_ALIGNMENT + m_adj(m, AGE_RX_BUF_ALIGN); +#endif if (bus_dmamap_load_mbuf_sg(sc->age_cdata.age_rx_tag, sc->age_cdata.age_rx_sparemap, m, segs, &nsegs, 0) != 0) { Modified: head/sys/dev/age/if_agevar.h ============================================================================== --- head/sys/dev/age/if_agevar.h Tue Feb 5 00:33:32 2013 (r246340) +++ head/sys/dev/age/if_agevar.h Tue Feb 5 00:37:45 2013 (r246341) @@ -43,6 +43,12 @@ #define AGE_TSO_MAXSEGSIZE 4096 #define AGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) #define AGE_MAXTXSEGS 32 +#define AGE_RX_BUF_ALIGN 8 +#ifndef __NO_STRICT_ALIGNMENT +#define AGE_RX_BUF_SIZE (MCLBYTES - AGE_RX_BUF_ALIGN) +#else +#define AGE_RX_BUF_SIZE (MCLBYTES) +#endif #define AGE_ADDR_LO(x) ((uint64_t) (x) & 0xFFFFFFFF) #define AGE_ADDR_HI(x) ((uint64_t) (x) >> 32) From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 02:25:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A798FD7F; Tue, 5 Feb 2013 02:25:14 +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 8B45CEF9; Tue, 5 Feb 2013 02:25: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 r152PEtg085807; Tue, 5 Feb 2013 02:25:14 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r152PDa2085802; Tue, 5 Feb 2013 02:25:13 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201302050225.r152PDa2085802@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 5 Feb 2013 02:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246342 - in head/sys: arm/allwinner arm/conf 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 02:25:14 -0000 Author: ganbold (doc committer) Date: Tue Feb 5 02:25:13 2013 New Revision: 246342 URL: http://svnweb.freebsd.org/changeset/base/246342 Log: Add gpio driver and update dts and kernel config accordingly. Approved by: gonzo@ Added: head/sys/arm/allwinner/a10_gpio.c (contents, props changed) Modified: head/sys/arm/allwinner/files.a10 head/sys/arm/conf/CUBIEBOARD head/sys/boot/fdt/dts/cubieboard.dts Added: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_gpio.c Tue Feb 5 02:25:13 2013 (r246342) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Luiz Otavio O Souza. + * 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. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "gpio_if.h" + +/* + * A10 have 9 banks of gpio. + * 32 pins per bank: + * PA0 - PA17 | PB0 - PB23 | PC0 - PC24 + * PD0 - PD27 | PE0 - PE31 | PF0 - PF5 + * PG0 - PG9 | PH0 - PH27 | PI0 - PI12 + */ + +#define A10_GPIO_PINS 288 +#define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + +struct a10_gpio_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + int sc_gpio_npins; + 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) + +#define A10_GPIO_GP_CFG(_bank, _pin) 0x00 + ((_bank) * 0x24) + ((_pin)<<2) +#define A10_GPIO_GP_DAT(_bank) 0x10 + ((_bank) * 0x24) +#define A10_GPIO_GP_DRV(_bank, _pin) 0x14 + ((_bank) * 0x24) + ((_pin)<<2) +#define A10_GPIO_GP_PUL(_bank, _pin) 0x1c + ((_bank) * 0x24) + ((_pin)<<2) + +#define A10_GPIO_GP_INT_CFG0 0x200 +#define A10_GPIO_GP_INT_CFG1 0x204 +#define A10_GPIO_GP_INT_CFG2 0x208 +#define A10_GPIO_GP_INT_CFG3 0x20c + +#define A10_GPIO_GP_INT_CTL 0x210 +#define A10_GPIO_GP_INT_STA 0x214 +#define A10_GPIO_GP_INT_DEB 0x218 + +#define A10_GPIO_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define A10_GPIO_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +static uint32_t +a10_gpio_get_function(struct a10_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, func, offset; + + bank = pin / 32; + pin = pin - 32 * bank; + func = pin >> 3; + offset = ((pin & 0x07) << 2); + + A10_GPIO_LOCK(sc); + func = (A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, func)) >> offset) & 7; + A10_GPIO_UNLOCK(sc); + + return (func); +} + +static uint32_t +a10_gpio_func_flag(uint32_t nfunc) +{ + + switch (nfunc) { + case A10_GPIO_INPUT: + return (GPIO_PIN_INPUT); + case A10_GPIO_OUTPUT: + return (GPIO_PIN_OUTPUT); + } + return (0); +} + +static void +a10_gpio_set_function(struct a10_gpio_softc *sc, uint32_t pin, uint32_t f) +{ + uint32_t bank, func, data, offset; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = pin / 32; + pin = pin - 32 * bank; + func = pin >> 3; + offset = ((pin & 0x07) << 2); + + data = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, func)); + data &= ~(7 << offset); + data |= (f << offset); + A10_GPIO_WRITE(sc, A10_GPIO_GP_CFG(bank, func), data); +} + +static void +a10_gpio_set_pud(struct a10_gpio_softc *sc, uint32_t pin, uint32_t state) +{ + uint32_t bank, offset, pull, val; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = pin / 32; + pin = pin - 32 * bank; + pull = pin >> 4; + offset = ((pin & 0x0f) << 1); + + val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pull)); + val &= ~(0x03 << offset); + val |= (state << offset); + A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pull), val); +} + +static void +a10_gpio_pin_configure(struct a10_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + A10_GPIO_LOCK(sc); + + /* + * Manage input/output. + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + a10_gpio_set_function(sc, pin->gp_pin, + A10_GPIO_OUTPUT); + } else { + pin->gp_flags |= GPIO_PIN_INPUT; + a10_gpio_set_function(sc, pin->gp_pin, + A10_GPIO_INPUT); + } + } + + /* Manage Pull-up/pull-down. */ + pin->gp_flags &= ~(GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN); + if (flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) { + if (flags & GPIO_PIN_PULLUP) { + pin->gp_flags |= GPIO_PIN_PULLUP; + a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_PULLUP); + } else { + pin->gp_flags |= GPIO_PIN_PULLDOWN; + a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_PULLDOWN); + } + } else + a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_NONE); + + A10_GPIO_UNLOCK(sc); +} + +static int +a10_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = A10_GPIO_PINS - 1; + return (0); +} + +static int +a10_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + A10_GPIO_LOCK(sc); + *caps = sc->sc_gpio_pins[i].gp_caps; + A10_GPIO_UNLOCK(sc); + + return (0); +} + +static int +a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + A10_GPIO_LOCK(sc); + *flags = sc->sc_gpio_pins[i].gp_flags; + A10_GPIO_UNLOCK(sc); + + return (0); +} + +static int +a10_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + A10_GPIO_LOCK(sc); + memcpy(name, sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME); + A10_GPIO_UNLOCK(sc); + + return (0); +} + +static int +a10_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + /* Filter out unwanted flags. */ + if ((flags &= sc->sc_gpio_pins[i].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together. */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + /* Can't mix pull-up/pull-down together. */ + if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == + (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) + return (EINVAL); + + a10_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); + + return (0); +} + +static int +a10_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset, data; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin - 32 * bank; + offset = pin & 0x1f; + + A10_GPIO_LOCK(sc); + data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + if (value) + data |= (1 << offset); + else + data &= ~(1 << offset); + A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank), data); + A10_GPIO_UNLOCK(sc); + + return (0); +} + +static int +a10_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset, reg_data; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin - 32 * bank; + offset = pin & 0x1f; + + A10_GPIO_LOCK(sc); + reg_data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + A10_GPIO_UNLOCK(sc); + *val = (reg_data & (1 << offset)) ? 1 : 0; + + return (0); +} + +static int +a10_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, data, offset; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + pin = pin - 32 * bank; + offset = pin & 0x1f; + + A10_GPIO_LOCK(sc); + data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank)); + if (data & (1 << offset)) + data &= ~(1 << offset); + else + data |= (1 << offset); + A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank), data); + A10_GPIO_UNLOCK(sc); + + return (0); +} + +static int +a10_gpio_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-gpio")) + return (ENXIO); + + device_set_desc(dev, "Allwinner GPIO controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +a10_gpio_attach(device_t dev) +{ + struct a10_gpio_softc *sc = device_get_softc(dev); + uint32_t func; + int i, rid; + phandle_t gpio; + + sc->sc_dev = dev; + + mtx_init(&sc->sc_mtx, "a10 gpio", "gpio", MTX_DEF); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Find our node. */ + gpio = ofw_bus_get_node(sc->sc_dev); + + if (!OF_hasprop(gpio, "gpio-controller")) + /* Node is not a GPIO controller. */ + goto fail; + + /* Initialize the software controlled pins. */ + for (i = 0; i < A10_GPIO_PINS; i++) { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", i); + func = a10_gpio_get_function(sc, i); + sc->sc_gpio_pins[i].gp_pin = i; + sc->sc_gpio_pins[i].gp_caps = A10_GPIO_DEFAULT_CAPS; + sc->sc_gpio_pins[i].gp_flags = a10_gpio_func_flag(func); + } + sc->sc_gpio_npins = i; + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); + +fail: + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + return (ENXIO); +} + +static int +a10_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t a10_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a10_gpio_probe), + DEVMETHOD(device_attach, a10_gpio_attach), + DEVMETHOD(device_detach, a10_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, a10_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, a10_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, a10_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, a10_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, a10_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, a10_gpio_pin_get), + DEVMETHOD(gpio_pin_set, a10_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, a10_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t a10_gpio_devclass; + +static driver_t a10_gpio_driver = { + "gpio", + a10_gpio_methods, + sizeof(struct a10_gpio_softc), +}; + +DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0); Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Tue Feb 5 00:37:45 2013 (r246341) +++ head/sys/arm/allwinner/files.a10 Tue Feb 5 02:25:13 2013 (r246342) @@ -10,6 +10,7 @@ arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard arm/allwinner/a10_clk.c standard +arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci arm/allwinner/timer.c standard arm/allwinner/aintc.c standard Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue Feb 5 00:37:45 2013 (r246341) +++ head/sys/arm/conf/CUBIEBOARD Tue Feb 5 02:25:13 2013 (r246342) @@ -99,7 +99,7 @@ device random # Entropy device #device iic # GPIO -#device gpio +device gpio device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: head/sys/boot/fdt/dts/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/cubieboard.dts Tue Feb 5 00:37:45 2013 (r246341) +++ head/sys/boot/fdt/dts/cubieboard.dts Tue Feb 5 02:25:13 2013 (r246342) @@ -76,6 +76,15 @@ clock-frequency = < 24000000 >; }; + GPIO: gpio@01c20800 { + #gpio-cells = <3>; + compatible = "allwinner,sun4i-gpio"; + gpio-controller; + reg =< 0x01c20800 0x400 >; + interrupts = < 28 >; + interrupt-parent = <&AINTC>; + }; + usb1: usb@01c1c000 { compatible = "allwinner,usb-ehci", "usb-ehci"; reg = <0x01c1c000 0x1000>; From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 02:58:00 2013 Return-Path: Delivered-To: svn-src-all@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 188809BD; Tue, 5 Feb 2013 02:58:00 +0000 (UTC) (envelope-from pfg@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 00D0396; Tue, 5 Feb 2013 02:58: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 r152vxXn095356; Tue, 5 Feb 2013 02:57:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r152vxlF095355; Tue, 5 Feb 2013 02:57:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050257.r152vxlF095355@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 02:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246346 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 02:58:00 -0000 Author: pfg Date: Tue Feb 5 02:57:59 2013 New Revision: 246346 URL: http://svnweb.freebsd.org/changeset/base/246346 Log: crunchgen: Permit use of alternative linkers. Submitted by: Pete Chou MFC after: 1 week Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Tue Feb 5 02:45:02 2013 (r246345) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Tue Feb 5 02:57:59 2013 (r246346) @@ -979,6 +979,7 @@ top_makefile_rules(FILE *outmk) { prog_t *p; + fprintf(outmk, "LD?= ld\n"); if ( subtract_strlst(&libs, &libs_so) ) fprintf(outmk, "# NOTE: Some LIBS declarations below overridden by LIBS_SO\n"); @@ -1108,7 +1109,7 @@ prog_makefile_rules(FILE *outmk, prog_t fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\tld -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:01:04 2013 Return-Path: Delivered-To: svn-src-all@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 A893AB96; Tue, 5 Feb 2013 03:01:04 +0000 (UTC) (envelope-from pfg@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 9BD0A101; Tue, 5 Feb 2013 03:01: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 r15314Y6097936; Tue, 5 Feb 2013 03:01:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15314AD097935; Tue, 5 Feb 2013 03:01:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050301.r15314AD097935@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246347 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:01:04 -0000 Author: pfg Date: Tue Feb 5 03:01:04 2013 New Revision: 246347 URL: http://svnweb.freebsd.org/changeset/base/246347 Log: ext2fs: Use EXT2_LINK_MAX instead of LINK_MAX Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Feb 5 02:57:59 2013 (r246346) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Feb 5 03:01:04 2013 (r246347) @@ -730,7 +730,7 @@ ext2_link(ap) goto out; } ip = VTOI(vp); - if ((nlink_t)ip->i_nlink >= LINK_MAX) { + if ((nlink_t)ip->i_nlink >= EXT2_LINK_MAX) { error = EMLINK; goto out; } @@ -841,7 +841,7 @@ abortit: goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); - if (ip->i_nlink >= LINK_MAX) { + if (ip->i_nlink >= EXT2_LINK_MAX) { VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; @@ -939,7 +939,7 @@ abortit: * parent we don't fool with the link count. */ if (doingdirectory && newparent) { - if ((nlink_t)dp->i_nlink >= LINK_MAX) { + if ((nlink_t)dp->i_nlink >= EXT2_LINK_MAX) { error = EMLINK; goto bad; } @@ -1160,7 +1160,7 @@ ext2_mkdir(ap) panic("ext2_mkdir: no name"); #endif dp = VTOI(dvp); - if ((nlink_t)dp->i_nlink >= LINK_MAX) { + if ((nlink_t)dp->i_nlink >= EXT2_LINK_MAX) { error = EMLINK; goto out; } @@ -1524,7 +1524,7 @@ ext2_pathconf(ap) switch (ap->a_name) { case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; + *ap->a_retval = EXT2_LINK_MAX; return (0); case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:08:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52E0CF0A; Tue, 5 Feb 2013 03:08:57 +0000 (UTC) (envelope-from pfg@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 461791A3; Tue, 5 Feb 2013 03:08:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1538vDY099429; Tue, 5 Feb 2013 03:08:57 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1538vXY099428; Tue, 5 Feb 2013 03:08:57 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050308.r1538vXY099428@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246348 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:08:57 -0000 Author: pfg Date: Tue Feb 5 03:08:56 2013 New Revision: 246348 URL: http://svnweb.freebsd.org/changeset/base/246348 Log: ext2fs: Use nitems(). Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:01:04 2013 (r246347) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:08:56 2013 (r246348) @@ -88,9 +88,8 @@ static u_char ext2_ft_to_dt[] = { DT_SOCK, /* EXT2_FT_SOCK */ DT_LNK, /* EXT2_FT_SYMLINK */ }; -#define FTTODT(ft) \ - ((ft) > sizeof(ext2_ft_to_dt) / sizeof(ext2_ft_to_dt[0]) ? \ - DT_UNKNOWN : ext2_ft_to_dt[(ft)]) +#define FTTODT(ft) \ + ((ft) > nitems(ext2_ft_to_dt) ? DT_UNKNOWN : ext2_ft_to_dt[(ft)]) static u_char dt_to_ext2_ft[] = { EXT2_FT_UNKNOWN, /* DT_UNKNOWN */ @@ -109,9 +108,8 @@ static u_char dt_to_ext2_ft[] = { EXT2_FT_UNKNOWN, /* unused */ EXT2_FT_UNKNOWN, /* DT_WHT */ }; -#define DTTOFT(dt) \ - ((dt) > sizeof(dt_to_ext2_ft) / sizeof(dt_to_ext2_ft[0]) ? \ - EXT2_FT_UNKNOWN : dt_to_ext2_ft[(dt)]) +#define DTTOFT(dt) \ + ((dt) > nitems(dt_to_ext2_ft) ? EXT2_FT_UNKNOWN : dt_to_ext2_ft[(dt)]) static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:13:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0F713F0; Tue, 5 Feb 2013 03:13:06 +0000 (UTC) (envelope-from pfg@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 93D761F3; Tue, 5 Feb 2013 03:13: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 r153D6oh001862; Tue, 5 Feb 2013 03:13:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r153D6nA001860; Tue, 5 Feb 2013 03:13:06 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050313.r153D6nA001860@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246349 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:13:06 -0000 Author: pfg Date: Tue Feb 5 03:13:05 2013 New Revision: 246349 URL: http://svnweb.freebsd.org/changeset/base/246349 Log: ext2fs: Correct off-by-one errors in FFTODT() and DDTOFT(). Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:08:56 2013 (r246348) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:13:05 2013 (r246349) @@ -89,7 +89,7 @@ static u_char ext2_ft_to_dt[] = { DT_LNK, /* EXT2_FT_SYMLINK */ }; #define FTTODT(ft) \ - ((ft) > nitems(ext2_ft_to_dt) ? DT_UNKNOWN : ext2_ft_to_dt[(ft)]) + ((ft) < nitems(ext2_ft_to_dt) ? ext2_ft_to_dt[(ft)] : DT_UNKNOWN) static u_char dt_to_ext2_ft[] = { EXT2_FT_UNKNOWN, /* DT_UNKNOWN */ @@ -109,7 +109,7 @@ static u_char dt_to_ext2_ft[] = { EXT2_FT_UNKNOWN, /* DT_WHT */ }; #define DTTOFT(dt) \ - ((dt) > nitems(dt_to_ext2_ft) ? EXT2_FT_UNKNOWN : dt_to_ext2_ft[(dt)]) + ((dt) < nitems(dt_to_ext2_ft) ? dt_to_ext2_ft[(dt)] : EXT2_FT_UNKNOWN) static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:17:42 2013 Return-Path: Delivered-To: svn-src-all@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 9D2D25B3; Tue, 5 Feb 2013 03:17:42 +0000 (UTC) (envelope-from pfg@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 79D2B228; Tue, 5 Feb 2013 03:17: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 r153Hg44002515; Tue, 5 Feb 2013 03:17:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r153HgTw002514; Tue, 5 Feb 2013 03:17:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050317.r153HgTw002514@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246350 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:17:42 -0000 Author: pfg Date: Tue Feb 5 03:17:41 2013 New Revision: 246350 URL: http://svnweb.freebsd.org/changeset/base/246350 Log: ext2fs: Remove useless rootino local variable. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:13:05 2013 (r246349) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:17:41 2013 (r246350) @@ -1086,7 +1086,7 @@ ext2_checkpath(source, target, cred) struct ucred *cred; { struct vnode *vp; - int error, rootino, namlen; + int error, namlen; struct dirtemplate dirbuf; vp = ITOV(target); @@ -1094,9 +1094,8 @@ ext2_checkpath(source, target, cred) error = EEXIST; goto out; } - rootino = EXT2_ROOTINO; error = 0; - if (target->i_number == rootino) + if (target->i_number == EXT2_ROOTINO) goto out; for (;;) { @@ -1121,7 +1120,7 @@ ext2_checkpath(source, target, cred) error = EINVAL; break; } - if (dirbuf.dotdot_ino == rootino) + if (dirbuf.dotdot_ino == EXT2_ROOTINO) break; vput(vp); if ((error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:23:57 2013 Return-Path: Delivered-To: svn-src-all@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 1BB0393E; Tue, 5 Feb 2013 03:23:57 +0000 (UTC) (envelope-from pfg@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 0EB11276; Tue, 5 Feb 2013 03:23:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r153NuwM004929; Tue, 5 Feb 2013 03:23:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r153Nudo004928; Tue, 5 Feb 2013 03:23:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050323.r153Nudo004928@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246351 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:23:57 -0000 Author: pfg Date: Tue Feb 5 03:23:56 2013 New Revision: 246351 URL: http://svnweb.freebsd.org/changeset/base/246351 Log: ext2fs: Remove unused em_e2fsb definition.. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_mount.h Modified: head/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- head/sys/fs/ext2fs/ext2_mount.h Tue Feb 5 03:17:41 2013 (r246350) +++ head/sys/fs/ext2fs/ext2_mount.h Tue Feb 5 03:23:56 2013 (r246351) @@ -48,7 +48,6 @@ struct ext2mount { struct vnode *um_devvp; /* block device mounted vnode */ struct m_ext2fs *um_e2fs; /* EXT2FS */ -#define em_e2fsb um_e2fs->e2fs u_long um_nindir; /* indirect ptrs per block */ u_long um_bptrtodb; /* indir ptr to disk block */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 03:26:35 2013 Return-Path: Delivered-To: svn-src-all@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 79425AD8; Tue, 5 Feb 2013 03:26:35 +0000 (UTC) (envelope-from pfg@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 5556B292; Tue, 5 Feb 2013 03:26: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 r153QZjK005306; Tue, 5 Feb 2013 03:26:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r153QZJC005305; Tue, 5 Feb 2013 03:26:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302050326.r153QZJC005305@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 5 Feb 2013 03:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246352 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 03:26:35 -0000 Author: pfg Date: Tue Feb 5 03:26:34 2013 New Revision: 246352 URL: http://svnweb.freebsd.org/changeset/base/246352 Log: ext2fs: move assignment where it is not dead. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:23:56 2013 (r246351) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 5 03:26:34 2013 (r246352) @@ -1094,9 +1094,10 @@ ext2_checkpath(source, target, cred) error = EEXIST; goto out; } - error = 0; - if (target->i_number == EXT2_ROOTINO) + if (target->i_number == EXT2_ROOTINO) { + error = 0; goto out; + } for (;;) { if (vp->v_type != VDIR) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 04:13:35 2013 Return-Path: Delivered-To: svn-src-all@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 2BFCA14A; Tue, 5 Feb 2013 04:13:35 +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 061733D2; Tue, 5 Feb 2013 04:13: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 r154DYFQ019823; Tue, 5 Feb 2013 04:13:34 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r154DYbQ019821; Tue, 5 Feb 2013 04:13:34 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201302050413.r154DYbQ019821@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 5 Feb 2013 04:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246353 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 04:13:35 -0000 Author: ganbold (doc committer) Date: Tue Feb 5 04:13:34 2013 New Revision: 246353 URL: http://svnweb.freebsd.org/changeset/base/246353 Log: Remove two dead assignments and make use of sc more explicit and clear Submitted by: Christoph Mallon Approved by: gonzo@ Modified: head/sys/arm/allwinner/a10_clk.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Tue Feb 5 03:26:34 2013 (r246352) +++ head/sys/arm/allwinner/a10_clk.c Tue Feb 5 04:13:34 2013 (r246353) @@ -62,10 +62,10 @@ struct a10_ccm_softc { static struct a10_ccm_softc *a10_ccm_sc = NULL; -#define ccm_read_4(reg) \ - bus_space_read_4(a10_ccm_sc->bst, a10_ccm_sc->bsh, reg) -#define ccm_write_4(reg, val) \ - bus_space_write_4(a10_ccm_sc->bst, a10_ccm_sc->bsh, reg, val) +#define ccm_read_4(sc, reg) \ + bus_space_read_4((sc)->bst, (sc)->bsh, (reg)) +#define ccm_write_4(sc, reg, val) \ + bus_space_write_4((sc)->bst, (sc)->bsh, (reg), (val)) static int a10_ccm_probe(device_t dev) @@ -121,24 +121,24 @@ int a10_clk_usb_activate(void) { struct a10_ccm_softc *sc = a10_ccm_sc; - uint32_t reg_value = 0; + uint32_t reg_value; if (sc == NULL) return ENXIO; /* Gating AHB clock for USB */ - reg_value = ccm_read_4(CCM_AHB_GATING0); + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); reg_value |= CCM_AHB_GATING_USB0; /* AHB clock gate usb0 */ reg_value |= CCM_AHB_GATING_EHCI1; /* AHB clock gate ehci1 */ - ccm_write_4(CCM_AHB_GATING0, reg_value); + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); /* Enable clock for USB */ - reg_value = ccm_read_4(CCM_USB_CLK); + reg_value = ccm_read_4(sc, CCM_USB_CLK); reg_value |= CCM_USB_PHY; /* USBPHY */ reg_value |= CCM_USB0_RESET; /* disable reset for USB0 */ reg_value |= CCM_USB1_RESET; /* disable reset for USB1 */ reg_value |= CCM_USB2_RESET; /* disable reset for USB2 */ - ccm_write_4(CCM_USB_CLK, reg_value); + ccm_write_4(sc, CCM_USB_CLK, reg_value); return (0); } @@ -147,24 +147,24 @@ int a10_clk_usb_deactivate(void) { struct a10_ccm_softc *sc = a10_ccm_sc; - uint32_t reg_value = 0; + uint32_t reg_value; if (sc == NULL) return ENXIO; /* Disable clock for USB */ - reg_value = ccm_read_4(CCM_USB_CLK); + reg_value = ccm_read_4(sc, CCM_USB_CLK); reg_value &= ~CCM_USB_PHY; /* USBPHY */ reg_value &= ~CCM_USB0_RESET; /* reset for USB0 */ reg_value &= ~CCM_USB1_RESET; /* reset for USB1 */ reg_value &= ~CCM_USB2_RESET; /* reset for USB2 */ - ccm_write_4(CCM_USB_CLK, reg_value); + ccm_write_4(sc, CCM_USB_CLK, reg_value); /* Disable gating AHB clock for USB */ - reg_value = ccm_read_4(CCM_AHB_GATING0); + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); reg_value &= ~CCM_AHB_GATING_USB0; /* disable AHB clock gate usb0 */ reg_value &= ~CCM_AHB_GATING_EHCI1; /* disable AHB clock gate ehci1 */ - ccm_write_4(CCM_AHB_GATING0, reg_value); + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 05:16:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46EB0784; Tue, 5 Feb 2013 05:16:03 +0000 (UTC) (envelope-from andrew@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 2158876F; Tue, 5 Feb 2013 05:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r155G2SO037800; Tue, 5 Feb 2013 05:16:03 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r155G2Vi037799; Tue, 5 Feb 2013 05:16:02 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302050516.r155G2Vi037799@svn.freebsd.org> From: Andrew Turner Date: Tue, 5 Feb 2013 05:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246354 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 05:16:03 -0000 Author: andrew Date: Tue Feb 5 05:16:02 2013 New Revision: 246354 URL: http://svnweb.freebsd.org/changeset/base/246354 Log: Build clang for little-endian arm by default. Due to size issues when built with gcc disable CLANG_FULL for now. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Feb 5 04:13:34 2013 (r246353) +++ head/share/mk/bsd.own.mk Tue Feb 5 05:16:02 2013 (r246354) @@ -389,9 +389,13 @@ __T=${TARGET_ARCH} .else __T=${MACHINE_ARCH} .endif -# Clang is only for x86 and powerpc right now, by default. +# Clang is only for x86, powerpc and little-endian arm right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL +.elif ${__T} == "arm" || ${__T} == "armv6" +__DEFAULT_YES_OPTIONS+=CLANG +# GCC is unable to build the full clang on arm, disable it by default. +__DEFAULT_NO_OPTIONS+=CLANG_FULL .else __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL .endif From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 07:21:24 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4A559611; Tue, 5 Feb 2013 07:21:24 +0000 (UTC) Date: Tue, 5 Feb 2013 07:21:24 +0000 From: Alexey Dokuchaev To: Andriy Gapon Subject: Re: svn commit: r246251 - head/sys/dev/acpica Message-ID: <20130205072124.GA97885@FreeBSD.org> References: <201302021244.r12CiKgj046079@svn.freebsd.org> <20130202125122.GA4975@FreeBSD.org> <20130202151137.GA28366@FreeBSD.org> <510E3A9D.7040005@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <510E3A9D.7040005@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 07:21:24 -0000 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. ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 07:46:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E31A8BBD; Tue, 5 Feb 2013 07:46:17 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx1.freebsd.org (Postfix) with ESMTP id 0C67AC1B; Tue, 5 Feb 2013 07:46:16 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id hn17so2540206wib.10 for ; Mon, 04 Feb 2013 23:46:16 -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=z6BNFIvAqcL5z2BIIFyQaZLmeA8CycbqmjmzBo+cgI4=; b=g7wVW0yecpU55gZfJVJLS9Kx08cAVmuDS3AcjnJcbGVYdXzk3w8wn5w/PquJQz1qgb Va4eRc/44oNp50uJrIv0j7PpgThV/rjaoxnAfbj0PDW9tDgf8NlQUSNbHr/MT6WpZxy4 /CyV+V1u0vu9s2UqhbrRSE862fYwg7+6p89ae3qukk2TilNX9rTF92Wh5ivHE91PeHKr awvCRAC3CQr1sc9h0grCccPB6oYZSur+X49cJzVgN9zIaLhLZzLJBbp7yU3YFT1vsW+Q e3KLacUmuXG3zHJNNRI7QV1cnrQMugfy5YtOI4wYwCxPmeNmUJsD958LJN7sec7fdD9O KSTA== MIME-Version: 1.0 X-Received: by 10.180.85.8 with SMTP id d8mr15075500wiz.4.1360050375905; Mon, 04 Feb 2013 23:46:15 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.195.12.163 with HTTP; Mon, 4 Feb 2013 23:46:15 -0800 (PST) In-Reply-To: <201302041446.55786.jhb@freebsd.org> References: <201301231834.r0NIYLnp006407@svn.freebsd.org> <201302041446.55786.jhb@freebsd.org> Date: Tue, 5 Feb 2013 10:46:15 +0300 X-Google-Sender-Auth: rHSrf6qW7eqGcHsS8fZsT4d95rg Message-ID: Subject: Re: svn commit: r245848 - head/sys/boot/i386/libi386 From: Sergey Kandaurov To: John Baldwin 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 07:46:18 -0000 On 4 February 2013 23:46, John Baldwin wrote: > On Monday, February 04, 2013 4:43:36 am Sergey Kandaurov wrote: >> On 23 January 2013 22:34, John Baldwin wrote: >> > Author: jhb >> > Date: Wed Jan 23 18:34:21 2013 >> > New Revision: 245848 >> > URL: http://svnweb.freebsd.org/changeset/base/245848 >> > >> > Log: >> > Always update the hw.uart.console hint anytime a change is made to the >> > comconsole setup. Previously the hint would be set when if you set a >> > custom port, but it would not be updated if you later set a custom speed. >> > >> > Also, leave the hw.uart.console hint mutable so it can be overridden or >> > unset by the user if needed. >> > >> > Reviewed by: kib (earlier version) >> > MFC after: 1 week >> >> Looks like this results in something wrong. >> I have a serial console at COM2 (uart1), but it chooses uart0 >> (1016 == 0x3F8), compare .flags and the final hw.uart.console value. > > Do you have a working console in the loader? It is setting the hint based > on what the loader uses. I use this to use COM2 for both loader and > kernel: > > console="comconsole vidconsole" > comconsole_port=0x2f8 Yep, with new changes I still have a working console in the loader. I don't see output starting from kernel boot until login prompt. > Note that when hw.uart.console is set, any flags set in hint.uart.X.flags > to set the console are ignored. If you are not using -h in /boot.config or > setting 'console' for the loader to enable a serial console then the loader > should not be setting hw.uart.console (if it is, that is a bug to be fixed). > However, configuring the kernel to use a different serial console from the > loader seems very odd. You should be able to manually set hw.uart.console in > loader.conf if you are doing that. Err.. No, I haven't set hw.uart.console. Sorry for being misleading. The cited snippet from my previous mail was to demonstrate how the resulting hw.uart.console value depends (or rather not :)) on hints. All I have (changed) wrt console is: /boot/device.hints #hint.uart.0.flags="0x10" hint.uart.1.flags="0x10" /boot/loader.conf boot_multicons="YES" boot_serial="YES" boot_verbose="YES" console="comconsole,vidconsole" This setup worked for ages. To isolate this problem I took /boot/loader from my older current machine (also with COM2) to replace it here, and it started to work again. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:40:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A273756E; Tue, 5 Feb 2013 09:40:32 +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 85ABB875; Tue, 5 Feb 2013 09:40: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 r159eWb3018783; Tue, 5 Feb 2013 09:40:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159eVnK018775; Tue, 5 Feb 2013 09:40:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201302050940.r159eVnK018775@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 5 Feb 2013 09:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246355 - in stable/9/sys: dev/netmap net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:40:32 -0000 Author: luigi Date: Tue Feb 5 09:40:31 2013 New Revision: 246355 URL: http://svnweb.freebsd.org/changeset/base/246355 Log: MFH: sync netmap with the version in HEAD Deleted: stable/9/sys/dev/netmap/netmap_mem1.c Modified: stable/9/sys/dev/netmap/if_em_netmap.h stable/9/sys/dev/netmap/if_igb_netmap.h stable/9/sys/dev/netmap/if_lem_netmap.h stable/9/sys/dev/netmap/if_re_netmap.h stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h stable/9/sys/dev/netmap/netmap_mem2.c stable/9/sys/net/netmap.h stable/9/sys/net/netmap_user.h Modified: stable/9/sys/dev/netmap/if_em_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_em_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_em_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -171,7 +171,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) @@ -292,6 +292,8 @@ em_netmap_rxsync(struct ifnet *ifp, u_in l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->status); @@ -299,6 +301,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: stable/9/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_igb_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_igb_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -125,7 +125,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) @@ -263,6 +263,8 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -270,6 +272,7 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: stable/9/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_lem_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_lem_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -253,6 +253,8 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i l = adapter->next_rx_desc_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; uint32_t staterr = le32toh(curr->status); @@ -266,6 +268,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i len = 0; } ring->slot[j].len = len; + ring->slot[j].flags = slot_flags; bus_dmamap_sync(adapter->rxtag, adapter->rx_buffer_area[l].map, BUS_DMASYNC_POSTREAD); Modified: stable/9/sys/dev/netmap/if_re_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_re_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_re_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -245,6 +245,8 @@ re_netmap_rxsync(struct ifnet *ifp, u_in l = sc->rl_ldata.rl_rx_prodidx; /* next pkt to check */ j = netmap_idx_n2k(kring, l); /* the kring index */ if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = kring->nr_hwavail; n < lim ; n++) { struct rl_desc *cur_rx = &sc->rl_ldata.rl_rx_list[l]; uint32_t rxstat = le32toh(cur_rx->rl_cmdstat); @@ -256,6 +258,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in /* XXX subtract crc */ total_len = (total_len < 4) ? 0 : total_len - 4; kring->ring->slot[j].len = total_len; + kring->ring->slot[j].flags = slot_flags; /* sync was in re_newbuf() */ bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, rxd[l].rx_dmamap, BUS_DMASYNC_POSTREAD); Modified: stable/9/sys/dev/netmap/netmap.c ============================================================================== --- stable/9/sys/dev/netmap/netmap.c Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/netmap.c Tue Feb 5 09:40:31 2013 (r246355) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#define NM_BRIDGE + /* * This module supports memory mapped access to network devices, * see netmap(4). @@ -52,6 +54,16 @@ * transmit or receive queues (or all queues for a given interface). */ +#ifdef linux +#include "bsd_glue.h" +static netdev_tx_t linux_netmap_start(struct sk_buff *skb, struct net_device *dev); +#endif /* linux */ + +#ifdef __APPLE__ +#include "osx_glue.h" +#endif /* __APPLE__ */ + +#ifdef __FreeBSD__ #include /* prerequisite */ __FBSDID("$FreeBSD$"); @@ -78,21 +90,16 @@ __FBSDID("$FreeBSD$"); #include #include /* BIOCIMMEDIATE */ #include -#include -#include #include /* bus_dmamap_* */ MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map"); +#endif /* __FreeBSD__ */ -/* - * lock and unlock for the netmap memory allocator - */ -#define NMA_LOCK() mtx_lock(&nm_mem->nm_mtx); -#define NMA_UNLOCK() mtx_unlock(&nm_mem->nm_mtx); -struct netmap_mem_d; -static struct netmap_mem_d *nm_mem; /* Our memory allocator. */ +#include +#include u_int netmap_total_buffers; +u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ /* user-controlled variables */ @@ -105,16 +112,215 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, verbos CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); -int netmap_buf_size = 2048; -TUNABLE_INT("hw.netmap.buf_size", &netmap_buf_size); -SYSCTL_INT(_dev_netmap, OID_AUTO, buf_size, - CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); int netmap_mitigate = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); int netmap_no_pendintr = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +int netmap_drop = 0; /* debugging */ +int netmap_flags = 0; /* debug flags */ +int netmap_fwd = 0; /* force transparent mode */ +int netmap_copy = 0; /* debugging, copy content */ + +SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); + +#ifdef NM_BRIDGE /* support for netmap bridge */ + +/* + * system parameters. + * + * All switched ports have prefix NM_NAME. + * The switch has a max of NM_BDG_MAXPORTS ports (often stored in a bitmap, + * so a practical upper bound is 64). + * Each tx ring is read-write, whereas rx rings are readonly (XXX not done yet). + * The virtual interfaces use per-queue lock instead of core lock. + * In the tx loop, we aggregate traffic in batches to make all operations + * faster. The batch size is NM_BDG_BATCH + */ +#define NM_NAME "vale" /* prefix for the interface */ +#define NM_BDG_MAXPORTS 16 /* up to 64 ? */ +#define NM_BRIDGE_RINGSIZE 1024 /* in the device */ +#define NM_BDG_HASH 1024 /* forwarding table entries */ +#define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ +#define NM_BRIDGES 4 /* number of bridges */ +int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ +SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); + +#ifdef linux +#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) +#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) +#else /* !linux */ +#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ +#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) +#ifdef __FreeBSD__ +#include +#include +#endif /* __FreeBSD__ */ +#define prefetch(x) __builtin_prefetch(x) +#endif /* !linux */ + +static void bdg_netmap_attach(struct ifnet *ifp); +static int bdg_netmap_reg(struct ifnet *ifp, int onoff); +/* per-tx-queue entry */ +struct nm_bdg_fwd { /* forwarding entry for a bridge */ + void *buf; + uint64_t dst; /* dst mask */ + uint32_t src; /* src index ? */ + uint16_t len; /* src len */ +}; + +struct nm_hash_ent { + uint64_t mac; /* the top 2 bytes are the epoch */ + uint64_t ports; +}; + +/* + * Interfaces for a bridge are all in ports[]. + * The array has fixed size, an empty entry does not terminate + * the search. + */ +struct nm_bridge { + struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; + int n_ports; + uint64_t act_ports; + int freelist; /* first buffer index */ + NM_SELINFO_T si; /* poll/select wait queue */ + NM_LOCK_T bdg_lock; /* protect the selinfo ? */ + + /* the forwarding table, MAC+ports */ + struct nm_hash_ent ht[NM_BDG_HASH]; + + int namelen; /* 0 means free */ + char basename[IFNAMSIZ]; +}; + +struct nm_bridge nm_bridges[NM_BRIDGES]; + +#define BDG_LOCK(b) mtx_lock(&(b)->bdg_lock) +#define BDG_UNLOCK(b) mtx_unlock(&(b)->bdg_lock) + +/* + * NA(ifp)->bdg_port port index + */ + +// XXX only for multiples of 64 bytes, non overlapped. +static inline void +pkt_copy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + if (unlikely(l >= 1024)) { + bcopy(src, dst, l); + return; + } + for (; likely(l > 0); l-=64) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } +} + +/* + * locate a bridge among the existing ones. + * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. + * We assume that this is called with a name of at least NM_NAME chars. + */ +static struct nm_bridge * +nm_find_bridge(const char *name) +{ + int i, l, namelen, e; + struct nm_bridge *b = NULL; + + namelen = strlen(NM_NAME); /* base length */ + l = strlen(name); /* actual length */ + for (i = namelen + 1; i < l; i++) { + if (name[i] == ':') { + namelen = i; + break; + } + } + if (namelen >= IFNAMSIZ) + namelen = IFNAMSIZ; + ND("--- prefix is '%.*s' ---", namelen, name); + + /* use the first entry for locking */ + BDG_LOCK(nm_bridges); // XXX do better + for (e = -1, i = 1; i < NM_BRIDGES; i++) { + b = nm_bridges + i; + if (b->namelen == 0) + e = i; /* record empty slot */ + else if (strncmp(name, b->basename, namelen) == 0) { + ND("found '%.*s' at %d", namelen, name, i); + break; + } + } + if (i == NM_BRIDGES) { /* all full */ + if (e == -1) { /* no empty slot */ + b = NULL; + } else { + b = nm_bridges + e; + strncpy(b->basename, name, namelen); + b->namelen = namelen; + } + } + BDG_UNLOCK(nm_bridges); + return b; +} +#endif /* NM_BRIDGE */ + + +/* + * Fetch configuration from the device, to cope with dynamic + * reconfigurations after loading the module. + */ +static int +netmap_update_config(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + u_int txr, txd, rxr, rxd; + + txr = txd = rxr = rxd = 0; + if (na->nm_config) { + na->nm_config(ifp, &txr, &txd, &rxr, &rxd); + } else { + /* take whatever we had at init time */ + txr = na->num_tx_rings; + txd = na->num_tx_desc; + rxr = na->num_rx_rings; + rxd = na->num_rx_desc; + } + + if (na->num_tx_rings == txr && na->num_tx_desc == txd && + na->num_rx_rings == rxr && na->num_rx_desc == rxd) + return 0; /* nothing changed */ + if (netmap_verbose || na->refcount > 0) { + D("stored config %s: txring %d x %d, rxring %d x %d", + ifp->if_xname, + na->num_tx_rings, na->num_tx_desc, + na->num_rx_rings, na->num_rx_desc); + D("new config %s: txring %d x %d, rxring %d x %d", + ifp->if_xname, txr, txd, rxr, rxd); + } + if (na->refcount == 0) { + D("configuration changed (but fine)"); + na->num_tx_rings = txr; + na->num_tx_desc = txd; + na->num_rx_rings = rxr; + na->num_rx_desc = rxd; + return 0; + } + D("configuration changed while active, this is bad..."); + return 1; +} /*------------- memory allocator -----------------*/ #ifdef NETMAP_MEM2 @@ -124,23 +330,62 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen #endif /* !NETMAP_MEM2 */ /*------------ end of memory allocator ----------*/ -/* Structure associated to each thread which registered an interface. */ + +/* Structure associated to each thread which registered an interface. + * + * The first 4 fields of this structure are written by NIOCREGIF and + * read by poll() and NIOC?XSYNC. + * There is low contention among writers (actually, a correct user program + * should have no contention among writers) and among writers and readers, + * so we use a single global lock to protect the structure initialization. + * Since initialization involves the allocation of memory, we reuse the memory + * allocator lock. + * Read access to the structure is lock free. Readers must check that + * np_nifp is not NULL before using the other fields. + * If np_nifp is NULL initialization has not been performed, so they should + * return an error to userlevel. + * + * The ref_done field is used to regulate access to the refcount in the + * memory allocator. The refcount must be incremented at most once for + * each open("/dev/netmap"). The increment is performed by the first + * function that calls netmap_get_memory() (currently called by + * mmap(), NIOCGINFO and NIOCREGIF). + * If the refcount is incremented, it is then decremented when the + * private structure is destroyed. + */ struct netmap_priv_d { - struct netmap_if *np_nifp; /* netmap interface descriptor. */ + struct netmap_if * volatile np_nifp; /* netmap interface descriptor. */ struct ifnet *np_ifp; /* device for which we hold a reference */ int np_ringid; /* from the ioctl */ u_int np_qfirst, np_qlast; /* range of rings to scan */ uint16_t np_txpoll; + + unsigned long ref_done; /* use with NMA_LOCK held */ }; +static int +netmap_get_memory(struct netmap_priv_d* p) +{ + int error = 0; + NMA_LOCK(); + if (!p->ref_done) { + error = netmap_memory_finalize(); + if (!error) + p->ref_done = 1; + } + NMA_UNLOCK(); + return error; +} + /* * File descriptor's private data destructor. * * Call nm_register(ifp,0) to stop netmap mode on the interface and * revert to normal operation. We expect that np_ifp has not gone. */ +/* call with NMA_LOCK held */ static void netmap_dtor_locked(void *data) { @@ -153,7 +398,8 @@ netmap_dtor_locked(void *data) if (na->refcount <= 0) { /* last instance */ u_int i, j, lim; - D("deleting last netmap instance for %s", ifp->if_xname); + if (netmap_verbose) + D("deleting last instance for %s", ifp->if_xname); /* * there is a race here with *_netmap_task() and * netmap_poll(), which don't run under NETMAP_REG_LOCK. @@ -180,7 +426,6 @@ netmap_dtor_locked(void *data) selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); /* release all buffers */ - NMA_LOCK(); for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; lim = na->tx_rings[i].nkr_num_slots; @@ -200,30 +445,136 @@ netmap_dtor_locked(void *data) /* XXX kqueue(9) needed; these will mirror knlist_init. */ /* knlist_destroy(&na->tx_si.si_note); */ /* knlist_destroy(&na->rx_si.si_note); */ - NMA_UNLOCK(); netmap_free_rings(na); wakeup(na); } netmap_if_free(nifp); } +static void +nm_if_rele(struct ifnet *ifp) +{ +#ifndef NM_BRIDGE + if_rele(ifp); +#else /* NM_BRIDGE */ + int i, full; + struct nm_bridge *b; + + if (strncmp(ifp->if_xname, NM_NAME, sizeof(NM_NAME) - 1)) { + if_rele(ifp); + return; + } + if (!DROP_BDG_REF(ifp)) + return; + b = ifp->if_bridge; + BDG_LOCK(nm_bridges); + BDG_LOCK(b); + ND("want to disconnect %s from the bridge", ifp->if_xname); + full = 0; + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + if (b->bdg_ports[i] == ifp) { + b->bdg_ports[i] = NULL; + bzero(ifp, sizeof(*ifp)); + free(ifp, M_DEVBUF); + break; + } + else if (b->bdg_ports[i] != NULL) + full = 1; + } + BDG_UNLOCK(b); + if (full == 0) { + ND("freeing bridge %d", b - nm_bridges); + b->namelen = 0; + } + BDG_UNLOCK(nm_bridges); + if (i == NM_BDG_MAXPORTS) + D("ouch, cannot find ifp to remove"); +#endif /* NM_BRIDGE */ +} static void netmap_dtor(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; - struct netmap_adapter *na = NA(ifp); + struct netmap_adapter *na; - na->nm_lock(ifp, NETMAP_REG_LOCK, 0); - netmap_dtor_locked(data); - na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + NMA_LOCK(); + if (ifp) { + na = NA(ifp); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); + netmap_dtor_locked(data); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - if_rele(ifp); + nm_if_rele(ifp); + } + if (priv->ref_done) { + netmap_memory_deref(); + } + NMA_UNLOCK(); bzero(priv, sizeof(*priv)); /* XXX for safety */ free(priv, M_DEVBUF); } +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#include + +static struct cdev_pager_ops saved_cdev_pager_ops; + +static int +netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + if (netmap_verbose) + D("first mmap for %p", handle); + return saved_cdev_pager_ops.cdev_pg_ctor(handle, + size, prot, foff, cred, color); +} + +static void +netmap_dev_pager_dtor(void *handle) +{ + saved_cdev_pager_ops.cdev_pg_dtor(handle); + ND("ready to release memory for %p", handle); +} + + +static struct cdev_pager_ops netmap_cdev_pager_ops = { + .cdev_pg_ctor = netmap_dev_pager_ctor, + .cdev_pg_dtor = netmap_dev_pager_dtor, + .cdev_pg_fault = NULL, +}; + +static int +netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, + vm_size_t objsize, vm_object_t *objp, int prot) +{ + vm_object_t obj; + + ND("cdev %p foff %jd size %jd objp %p prot %d", cdev, + (intmax_t )*foff, (intmax_t )objsize, objp, prot); + obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, + curthread->td_ucred); + ND("returns obj %p", obj); + if (obj == NULL) + return EINVAL; + if (saved_cdev_pager_ops.cdev_pg_fault == NULL) { + ND("initialize cdev_pager_ops"); + saved_cdev_pager_ops = *(obj->un_pager.devp.ops); + netmap_cdev_pager_ops.cdev_pg_fault = + saved_cdev_pager_ops.cdev_pg_fault; + }; + obj->un_pager.devp.ops = &netmap_cdev_pager_ops; + *objp = obj; + return 0; +} +#endif /* __FreeBSD__ */ + /* * mmap(2) support for the "netmap" device. @@ -235,6 +586,7 @@ netmap_dtor(void *data) * Return 0 on success, -1 otherwise. */ +#ifdef __FreeBSD__ static int netmap_mmap(__unused struct cdev *dev, #if __FreeBSD_version < 900000 @@ -245,75 +597,222 @@ netmap_mmap(__unused struct cdev *dev, #endif ) { + int error = 0; + struct netmap_priv_d *priv; + if (nprot & PROT_EXEC) return (-1); // XXX -1 or EINVAL ? + error = devfs_get_cdevpriv((void **)&priv); + if (error == EBADF) { /* called on fault, memory is initialized */ + ND(5, "handling fault at ofs 0x%x", offset); + error = 0; + } else if (error == 0) /* make sure memory is set */ + error = netmap_get_memory(priv); + if (error) + return (error); + ND("request for offset 0x%x", (uint32_t)offset); *paddr = netmap_ofstophys(offset); - return (0); + return (*paddr ? 0 : ENOMEM); } +static int +netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + if (netmap_verbose) + D("dev %p fflag 0x%x devtype %d td %p", + dev, fflag, devtype, td); + return 0; +} + +static int +netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct netmap_priv_d *priv; + int error; + + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return ENOMEM; + + error = devfs_set_cdevpriv(priv, netmap_dtor); + if (error) + return error; + + return 0; +} +#endif /* __FreeBSD__ */ + /* * Handlers for synchronization of the queues from/to the host. - * - * netmap_sync_to_host() passes packets up. We are called from a - * system call in user process context, and the only contention - * can be among multiple user threads erroneously calling - * this routine concurrently. In principle we should not even - * need to lock. + * Netmap has two operating modes: + * - in the default mode, the rings connected to the host stack are + * just another ring pair managed by userspace; + * - in transparent mode (XXX to be defined) incoming packets + * (from the host or the NIC) are marked as NS_FORWARD upon + * arrival, and the user application has a chance to reset the + * flag for packets that should be dropped. + * On the RXSYNC or poll(), packets in RX rings between + * kring->nr_kcur and ring->cur with NS_FORWARD still set are moved + * to the other side. + * The transfer NIC --> host is relatively easy, just encapsulate + * into mbufs and we are done. The host --> NIC side is slightly + * harder because there might not be room in the tx ring so it + * might take a while before releasing the buffer. + */ + +/* + * pass a chain of buffers to the host stack as coming from 'dst' */ static void -netmap_sync_to_host(struct netmap_adapter *na) +netmap_send_up(struct ifnet *dst, struct mbuf *head) { - struct netmap_kring *kring = &na->tx_rings[na->num_tx_rings]; - struct netmap_ring *ring = kring->ring; - struct mbuf *head = NULL, *tail = NULL, *m; - u_int k, n, lim = kring->nkr_num_slots - 1; + struct mbuf *m; - k = ring->cur; - if (k > lim) { - netmap_ring_reinit(kring); - return; + /* send packets up, outside the lock */ + while ((m = head) != NULL) { + head = head->m_nextpkt; + m->m_nextpkt = NULL; + if (netmap_verbose & NM_VERB_HOST) + D("sending up pkt %p size %d", m, MBUF_LEN(m)); + NM_SEND_UP(dst, m); } - // na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); +} - /* Take packets from hwcur to cur and pass them up. +struct mbq { + struct mbuf *head; + struct mbuf *tail; + int count; +}; + +/* + * put a copy of the buffers marked NS_FORWARD into an mbuf chain. + * Run from hwcur to cur - reserved + */ +static void +netmap_grab_packets(struct netmap_kring *kring, struct mbq *q, int force) +{ + /* Take packets from hwcur to cur-reserved and pass them up. * In case of no buffers we give up. At the end of the loop, * the queue is drained in all cases. + * XXX handle reserved */ + int k = kring->ring->cur - kring->ring->reserved; + u_int n, lim = kring->nkr_num_slots - 1; + struct mbuf *m, *tail = q->tail; + + if (k < 0) + k = k + kring->nkr_num_slots; for (n = kring->nr_hwcur; n != k;) { - struct netmap_slot *slot = &ring->slot[n]; + struct netmap_slot *slot = &kring->ring->slot[n]; n = (n == lim) ? 0 : n + 1; + if ((slot->flags & NS_FORWARD) == 0 && !force) + continue; if (slot->len < 14 || slot->len > NETMAP_BUF_SIZE) { D("bad pkt at %d len %d", n, slot->len); continue; } - m = m_devget(NMB(slot), slot->len, 0, na->ifp, NULL); + slot->flags &= ~NS_FORWARD; // XXX needed ? + m = m_devget(NMB(slot), slot->len, 0, kring->na->ifp, NULL); if (m == NULL) break; if (tail) tail->m_nextpkt = m; else - head = m; + q->head = m; tail = m; + q->count++; m->m_nextpkt = NULL; } + q->tail = tail; +} + +/* + * called under main lock to send packets from the host to the NIC + * The host ring has packets from nr_hwcur to (cur - reserved) + * to be sent down. We scan the tx rings, which have just been + * flushed so nr_hwcur == cur. Pushing packets down means + * increment cur and decrement avail. + * XXX to be verified + */ +static void +netmap_sw_to_nic(struct netmap_adapter *na) +{ + struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; + struct netmap_kring *k1 = &na->tx_rings[0]; + int i, howmany, src_lim, dst_lim; + + howmany = kring->nr_hwavail; /* XXX otherwise cur - reserved - nr_hwcur */ + + src_lim = kring->nkr_num_slots; + for (i = 0; howmany > 0 && i < na->num_tx_rings; i++, k1++) { + ND("%d packets left to ring %d (space %d)", howmany, i, k1->nr_hwavail); + dst_lim = k1->nkr_num_slots; + while (howmany > 0 && k1->ring->avail > 0) { + struct netmap_slot *src, *dst, tmp; + src = &kring->ring->slot[kring->nr_hwcur]; + dst = &k1->ring->slot[k1->ring->cur]; + tmp = *src; + src->buf_idx = dst->buf_idx; + src->flags = NS_BUF_CHANGED; + + dst->buf_idx = tmp.buf_idx; + dst->len = tmp.len; + dst->flags = NS_BUF_CHANGED; + ND("out len %d buf %d from %d to %d", + dst->len, dst->buf_idx, + kring->nr_hwcur, k1->ring->cur); + + if (++kring->nr_hwcur >= src_lim) + kring->nr_hwcur = 0; + howmany--; + kring->nr_hwavail--; + if (++k1->ring->cur >= dst_lim) + k1->ring->cur = 0; + k1->ring->avail--; + } + kring->ring->cur = kring->nr_hwcur; // XXX + k1++; + } +} + +/* + * netmap_sync_to_host() passes packets up. We are called from a + * system call in user process context, and the only contention + * can be among multiple user threads erroneously calling + * this routine concurrently. + */ +static void +netmap_sync_to_host(struct netmap_adapter *na) +{ + struct netmap_kring *kring = &na->tx_rings[na->num_tx_rings]; + struct netmap_ring *ring = kring->ring; + u_int k, lim = kring->nkr_num_slots - 1; + struct mbq q = { NULL, NULL }; + + k = ring->cur; + if (k > lim) { + netmap_ring_reinit(kring); + return; + } + // na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); + + /* Take packets from hwcur to cur and pass them up. + * In case of no buffers we give up. At the end of the loop, + * the queue is drained in all cases. + */ + netmap_grab_packets(kring, &q, 1); kring->nr_hwcur = k; kring->nr_hwavail = ring->avail = lim; // na->nm_lock(na->ifp, NETMAP_CORE_UNLOCK, 0); - /* send packets up, outside the lock */ - while ((m = head) != NULL) { - head = head->m_nextpkt; - m->m_nextpkt = NULL; - if (netmap_verbose & NM_VERB_HOST) - D("sending up pkt %p size %d", m, MBUF_LEN(m)); - NM_SEND_UP(na->ifp, m); - } + netmap_send_up(na->ifp, q.head); } /* @@ -323,15 +822,19 @@ netmap_sync_to_host(struct netmap_adapte * * This routine also does the selrecord if called from the poll handler * (we know because td != NULL). + * + * NOTE: on linux, selrecord() is defined as a macro and uses pwait + * as an additional hidden argument. */ static void -netmap_sync_from_host(struct netmap_adapter *na, struct thread *td) +netmap_sync_from_host(struct netmap_adapter *na, struct thread *td, void *pwait) { struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; struct netmap_ring *ring = kring->ring; u_int j, n, lim = kring->nkr_num_slots; u_int k = ring->cur, resvd = ring->reserved; + (void)pwait; /* disable unused warnings */ na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); if (k >= lim) { netmap_ring_reinit(kring); @@ -370,15 +873,73 @@ netmap_sync_from_host(struct netmap_adap static int get_ifp(const char *name, struct ifnet **ifp) { +#ifdef NM_BRIDGE + struct ifnet *iter = NULL; + + do { + struct nm_bridge *b; + int i, l, cand = -1; + + if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) + break; + b = nm_find_bridge(name); + if (b == NULL) { + D("no bridges available for '%s'", name); + return (ENXIO); + } + /* XXX locking */ + BDG_LOCK(b); + /* lookup in the local list of ports */ + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + iter = b->bdg_ports[i]; + if (iter == NULL) { + if (cand == -1) + cand = i; /* potential insert point */ + continue; + } + if (!strcmp(iter->if_xname, name)) { + ADD_BDG_REF(iter); + ND("found existing interface"); + BDG_UNLOCK(b); + break; + } + } + if (i < NM_BDG_MAXPORTS) /* already unlocked */ + break; + if (cand == -1) { + D("bridge full, cannot create new port"); +no_port: + BDG_UNLOCK(b); + *ifp = NULL; + return EINVAL; + } + ND("create new bridge port %s", name); + /* space for forwarding list after the ifnet */ + l = sizeof(*iter) + + sizeof(struct nm_bdg_fwd)*NM_BDG_BATCH ; + iter = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!iter) + goto no_port; + strcpy(iter->if_xname, name); + bdg_netmap_attach(iter); + b->bdg_ports[cand] = iter; + iter->if_bridge = b; + ADD_BDG_REF(iter); + BDG_UNLOCK(b); + ND("attaching virtual bridge %p", b); + } while (0); + *ifp = iter; + if (! *ifp) +#endif /* NM_BRIDGE */ *ifp = ifunit_ref(name); if (*ifp == NULL) return (ENXIO); /* can do this if the capability exists and if_pspare[0] * points to the netmap descriptor. */ - if ((*ifp)->if_capabilities & IFCAP_NETMAP && NA(*ifp)) + if (NETMAP_CAPABLE(*ifp)) return 0; /* valid pointer, we hold the refcount */ - if_rele(*ifp); + nm_if_rele(*ifp); return EINVAL; // not NETMAP capable } @@ -402,7 +963,7 @@ netmap_ring_reinit(struct netmap_kring * u_int i, lim = kring->nkr_num_slots - 1; int errors = 0; - D("called for %s", kring->na->ifp->if_xname); + RD(10, "called for %s", kring->na->ifp->if_xname); if (ring->cur > lim) errors++; for (i = 0; i <= lim; i++) { @@ -424,9 +985,9 @@ netmap_ring_reinit(struct netmap_kring * int pos = kring - kring->na->tx_rings; int n = kring->na->num_tx_rings + 1; - D("total %d errors", errors); + RD(10, "total %d errors", errors); errors++; - D("%s %s[%d] reinit, cur %d -> %d avail %d -> %d", + RD(10, "%s %s[%d] reinit, cur %d -> %d avail %d -> %d", kring->na->ifp->if_xname, pos < n ? "TX" : "RX", pos < n ? pos : pos - n, ring->cur, kring->nr_hwcur, @@ -474,6 +1035,7 @@ netmap_set_ringid(struct netmap_priv_d * priv->np_txpoll = (ringid & NETMAP_NO_TX_POLL) ? 0 : 1; if (need_lock) na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); + if (netmap_verbose) { if (ringid & NETMAP_SW_RING) D("ringid %s set to SW RING", ifp->if_xname); else if (ringid & NETMAP_HW_RING) @@ -481,6 +1043,7 @@ netmap_set_ringid(struct netmap_priv_d * priv->np_qfirst); else D("ringid %s set to all %d HW RINGS", ifp->if_xname, lim); + } return 0; } @@ -498,8 +1061,8 @@ netmap_set_ringid(struct netmap_priv_d * * Return 0 on success, errno otherwise. */ static int -netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:43:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DE58800; Tue, 5 Feb 2013 09:43:40 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [178.238.39.38]) by mx1.freebsd.org (Postfix) with ESMTP id D70468A7; Tue, 5 Feb 2013 09:43:39 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 3E6E61CC55A2; Tue, 5 Feb 2013 10:36:32 +0100 (CET) Date: Tue, 5 Feb 2013 10:36:32 +0100 From: Roman Divacky To: Andrew Turner Subject: Re: svn commit: r246354 - head/share/mk Message-ID: <20130205093632.GA15394@freebsd.org> References: <201302050516.r155G2Vi037799@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302050516.r155G2Vi037799@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:43:40 -0000 Just for comparison whats the size difference between clang built clang and gcc built clang on arm? On Tue, Feb 05, 2013 at 05:16:02AM +0000, Andrew Turner wrote: > Author: andrew > Date: Tue Feb 5 05:16:02 2013 > New Revision: 246354 > URL: http://svnweb.freebsd.org/changeset/base/246354 > > Log: > Build clang for little-endian arm by default. Due to size issues when built > with gcc disable CLANG_FULL for now. > > Modified: > head/share/mk/bsd.own.mk > > Modified: head/share/mk/bsd.own.mk > ============================================================================== > --- head/share/mk/bsd.own.mk Tue Feb 5 04:13:34 2013 (r246353) > +++ head/share/mk/bsd.own.mk Tue Feb 5 05:16:02 2013 (r246354) > @@ -389,9 +389,13 @@ __T=${TARGET_ARCH} > .else > __T=${MACHINE_ARCH} > .endif > -# Clang is only for x86 and powerpc right now, by default. > +# Clang is only for x86, powerpc and little-endian arm right now, by default. > .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} > __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL > +.elif ${__T} == "arm" || ${__T} == "armv6" > +__DEFAULT_YES_OPTIONS+=CLANG > +# GCC is unable to build the full clang on arm, disable it by default. > +__DEFAULT_NO_OPTIONS+=CLANG_FULL > .else > __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL > .endif From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:50:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D01F4C19; Tue, 5 Feb 2013 09:50:33 +0000 (UTC) (envelope-from delphij@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 A9E2990A; Tue, 5 Feb 2013 09:50: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 r159oXMN020627; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oX1x020626; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oX1x020626@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:33 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/9/lib/libc/gen/glob.c Directory Properties: stable/9/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/8/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/glob.c ============================================================================== --- stable/9/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/9/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -715,16 +715,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:50:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30D80C1A; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) (envelope-from delphij@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 0A4BF90B; Tue, 5 Feb 2013 09:50: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 r159oX4L020635; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oXOR020634; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oXOR020634@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:34 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/8/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/glob.c ============================================================================== --- stable/8/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/8/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -710,16 +710,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:50:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 843EBC1B; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) (envelope-from delphij@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 5E20990C; Tue, 5 Feb 2013 09:50: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 r159oYXk020643; Tue, 5 Feb 2013 09:50:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oY0O020642; Tue, 5 Feb 2013 09:50:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oY0O020642@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:34 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/7/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/glob.c ============================================================================== --- stable/7/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/7/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -710,16 +710,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37EC11EC; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@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 23A29952; Tue, 5 Feb 2013 09:53: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 r159rXbS022608; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rXe1022607; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rXe1022607@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/8/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/glob.c ============================================================================== --- stable/8/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/8/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -89,6 +89,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -148,15 +167,18 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -166,8 +188,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -181,11 +203,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -238,11 +259,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -261,7 +288,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -431,7 +459,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -524,7 +552,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -542,7 +570,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -558,6 +586,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -601,7 +638,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -647,6 +684,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -697,14 +747,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -726,6 +777,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-all@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 402F01ED; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@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 23A93953; Tue, 5 Feb 2013 09:53: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 r159rX7K022602; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rXLU022601; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rXLU022601@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/9/lib/libc/gen/glob.c Directory Properties: stable/9/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/8/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/glob.c ============================================================================== --- stable/9/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/9/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -94,6 +94,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -153,15 +172,18 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -171,8 +193,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -186,11 +208,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -243,11 +264,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -266,7 +293,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -436,7 +464,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -529,7 +557,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -547,7 +575,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -563,6 +591,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -606,7 +643,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -652,6 +689,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -702,14 +752,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -731,6 +782,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A9C71EE; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@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 4B0BE954; Tue, 5 Feb 2013 09:53: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 r159rYlq022616; Tue, 5 Feb 2013 09:53:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rYVK022614; Tue, 5 Feb 2013 09:53:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rYVK022614@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/7/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/glob.c ============================================================================== --- stable/7/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/7/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -89,6 +89,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -148,15 +167,18 @@ static Char *g_strchr(Char *, wchar_t); static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -166,8 +188,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -181,11 +203,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -238,11 +259,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -261,7 +288,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -431,7 +459,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -524,7 +552,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -542,7 +570,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -558,6 +586,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -601,7 +638,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -647,6 +684,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -697,14 +747,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -726,6 +777,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 11:46:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ACF9F8F7; Tue, 5 Feb 2013 11:46:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE1DDD; Tue, 5 Feb 2013 11:46:06 +0000 (UTC) Received: from mxin3-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MHQ005MLVZ8Y040@smtp5.clear.net.nz>; Wed, 06 Feb 2013 00:30:59 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin32.paradise.net.nz with ESMTP; Wed, 06 Feb 2013 00:30:58 +1300 Date: Wed, 06 Feb 2013 00:30:10 +1300 From: Andrew Turner Subject: Re: svn commit: r246354 - head/share/mk In-reply-to: <20130205093632.GA15394@freebsd.org> To: Roman Divacky Message-id: <20130206003010.3f9aaa37@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <201302050516.r155G2Vi037799@svn.freebsd.org> <20130205093632.GA15394@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 11:46:06 -0000 On Tue, 5 Feb 2013 10:36:32 +0100 Roman Divacky wrote: > Just for comparison whats the size difference between clang built > clang and gcc built clang on arm? When I use WITHOUT_CLANG_FULL: clang built with gcc is 43MB clang built with clang is 25MB When I use WITH_CLANG_FULL: clang built with gcc fails to link clang built with clang is 28MB Andrew From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 12:18:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E485A75; Tue, 5 Feb 2013 12:18:39 +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 CD47A335; Tue, 5 Feb 2013 12:18: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 r15CIdkc068452; Tue, 5 Feb 2013 12:18:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15CIdE2068451; Tue, 5 Feb 2013 12:18:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051218.r15CIdE2068451@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 12:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246358 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 12:18:40 -0000 Author: des Date: Tue Feb 5 12:18:39 2013 New Revision: 246358 URL: http://svnweb.freebsd.org/changeset/base/246358 Log: Load the pfsync module if necessary. Reviewed by: glebius@ MFC after: 1 week Modified: head/etc/rc.d/pfsync Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Tue Feb 5 09:53:32 2013 (r246357) +++ head/etc/rc.d/pfsync Tue Feb 5 12:18:39 2013 (r246358) @@ -35,6 +35,7 @@ pfsync_start() if [ -n "${pfsync_syncpeer}" ]; then _syncpeer="syncpeer ${pfsync_syncpeer}" fi + load_kld pfsync ifconfig pfsync0 $_syncpeer syncdev $pfsync_syncdev $pfsync_ifconfig up } From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 12:37:51 2013 Return-Path: Delivered-To: svn-src-all@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 84EAD637; Tue, 5 Feb 2013 12:37:51 +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 763AD678; Tue, 5 Feb 2013 12:37: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 r15CbpE6074188; Tue, 5 Feb 2013 12:37:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15CbpCe074187; Tue, 5 Feb 2013 12:37:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302051237.r15CbpCe074187@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 5 Feb 2013 12:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246359 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 12:37:51 -0000 Author: hselasky Date: Tue Feb 5 12:37:50 2013 New Revision: 246359 URL: http://svnweb.freebsd.org/changeset/base/246359 Log: Fix depend target. Modified: head/sys/boot/usb/Makefile Modified: head/sys/boot/usb/Makefile ============================================================================== --- head/sys/boot/usb/Makefile Tue Feb 5 12:18:39 2013 (r246358) +++ head/sys/boot/usb/Makefile Tue Feb 5 12:37:50 2013 (r246359) @@ -42,13 +42,13 @@ OBJCOPY?= objcopy SYSCC?= cc CFLAGS+= -DBOOTPROG=\"usbloader\" -CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE="\"bsd_global.h\"" +CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE=\"bsd_global.h\" CFLAGS+= -ffunction-sections -fdata-sections CFLAGS+= -ffreestanding CFLAGS+= -Wformat -Wall -CFLAGS+= -I ${S} -CFLAGS+= -I ${T} -CFLAGS+= -I ${.CURDIR} +CFLAGS+= -I${S} +CFLAGS+= -I${T} +CFLAGS+= -I${.CURDIR} CFLAGS+= -g .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 13:30:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ECB16506; Tue, 5 Feb 2013 13:30:08 +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 D0336921; Tue, 5 Feb 2013 13:30: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 r15DU8YE090819; Tue, 5 Feb 2013 13:30:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15DU7vn090633; Tue, 5 Feb 2013 13:30:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302051330.r15DU7vn090633@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 5 Feb 2013 13:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246360 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 13:30:09 -0000 Author: hselasky Date: Tue Feb 5 13:30:07 2013 New Revision: 246360 URL: http://svnweb.freebsd.org/changeset/base/246360 Log: Fix some nits. Modified: head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Tue Feb 5 12:37:50 2013 (r246359) +++ head/sys/dev/usb/usb_bus.h Tue Feb 5 13:30:07 2013 (r246360) @@ -51,7 +51,9 @@ struct usb_bus_stat { struct usb_bus { struct usb_bus_stat stats_err; struct usb_bus_stat stats_ok; +#if USB_HAVE_ROOT_MOUNT_HOLD struct root_hold_token *bus_roothold; +#endif /* * There are two callback processes. One for Giant locked * callbacks. One for non-Giant locked callbacks. This should Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Tue Feb 5 12:37:50 2013 (r246359) +++ head/sys/dev/usb/usb_dynamic.c Tue Feb 5 13:30:07 2013 (r246360) @@ -68,7 +68,7 @@ usb_temp_setup_by_index_t *usb_temp_setu usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w; usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w; usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w; -devclass_t usb_devclass_ptr = NULL; +devclass_t usb_devclass_ptr; static usb_error_t usb_temp_setup_by_index_w(struct usb_device *udev, uint16_t index) Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Feb 5 12:37:50 2013 (r246359) +++ head/sys/dev/usb/usb_msctest.c Tue Feb 5 13:30:07 2013 (r246360) @@ -848,7 +848,7 @@ usb_msc_eject(struct usb_device *udev, u sizeof(scsi_tct_eject), USB_MS_HZ); break; default: - printf("usb_msc_eject: unknown eject method (%d)\n", method); + DPRINTF("Unknown eject method (%d)\n", method); break; } DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Tue Feb 5 12:37:50 2013 (r246359) +++ head/sys/dev/usb/usb_process.c Tue Feb 5 13:30:07 2013 (r246360) @@ -24,8 +24,6 @@ * SUCH DAMAGE. */ -#define USB_DEBUG_VAR usb_proc_debug - #ifdef USB_GLOBAL_INCLUDE_FILE #include USB_GLOBAL_INCLUDE_FILE #else @@ -52,6 +50,8 @@ #include #include #include + +#define USB_DEBUG_VAR usb_proc_debug #include #include Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Feb 5 12:37:50 2013 (r246359) +++ head/sys/dev/usb/usb_request.c Tue Feb 5 13:30:07 2013 (r246360) @@ -800,8 +800,6 @@ usbd_req_reset_port(struct usb_device *u /* check for errors */ if (err) goto done; -#ifdef USB_DEBUG -#endif n = 0; while (1) { /* wait for the device to recover from reset */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:29:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E83774BC; Tue, 5 Feb 2013 14:29:37 +0000 (UTC) (envelope-from zeising@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 C2E33CEC; Tue, 5 Feb 2013 14:29: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 r15ETbW9008264; Tue, 5 Feb 2013 14:29:37 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15ETb7n008263; Tue, 5 Feb 2013 14:29:37 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201302051429.r15ETb7n008263@svn.freebsd.org> From: Niclas Zeising Date: Tue, 5 Feb 2013 14:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246361 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:29:38 -0000 Author: zeising (doc,ports committer) Date: Tue Feb 5 14:29:37 2013 New Revision: 246361 URL: http://svnweb.freebsd.org/changeset/base/246361 Log: Bump .Dd for the change in r246121. Approved by: joel (mentor) Modified: head/sbin/devd/devd.8 Modified: head/sbin/devd/devd.8 ============================================================================== --- head/sbin/devd/devd.8 Tue Feb 5 13:30:07 2013 (r246360) +++ head/sbin/devd/devd.8 Tue Feb 5 14:29:37 2013 (r246361) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2005 +.Dd January 30, 2013 .Dt DEVD 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:39:38 2013 Return-Path: Delivered-To: svn-src-all@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 4F3A0754; Tue, 5 Feb 2013 14:39:38 +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 32B4FD74; Tue, 5 Feb 2013 14:39: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 r15Edc8e011204; Tue, 5 Feb 2013 14:39:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15EdcE7011203; Tue, 5 Feb 2013 14:39:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051439.r15EdcE7011203@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246362 - head/games/fortune/datfiles X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:39:38 -0000 Author: des Date: Tue Feb 5 14:39:37 2013 New Revision: 246362 URL: http://svnweb.freebsd.org/changeset/base/246362 Log: Remove political propaganda Modified: head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:29:37 2013 (r246361) +++ head/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:39:37 2013 (r246362) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:44:28 2013 Return-Path: Delivered-To: svn-src-all@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 19716941; Tue, 5 Feb 2013 14:44: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 E5B0FDC3; Tue, 5 Feb 2013 14:44: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 r15EiRH2013520; Tue, 5 Feb 2013 14:44:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15EiPKh013499; Tue, 5 Feb 2013 14:44:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302051444.r15EiPKh013499@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 5 Feb 2013 14:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246363 - in head/sys: boot/usb dev/usb dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:44:28 -0000 Author: hselasky Date: Tue Feb 5 14:44:25 2013 New Revision: 246363 URL: http://svnweb.freebsd.org/changeset/base/246363 Log: Add defines to more easily allow a single threaded version of the FreeBSD USB stack. This is useful for non-kernel purposes, like the loader. Modified: head/sys/boot/usb/bsd_global.h head/sys/boot/usb/bsd_kernel.c head/sys/boot/usb/bsd_kernel.h head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/boot/usb/bsd_global.h ============================================================================== --- head/sys/boot/usb/bsd_global.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/boot/usb/bsd_global.h Tue Feb 5 14:44:25 2013 (r246363) @@ -60,4 +60,6 @@ #include #include +extern struct usb_process usb_process[USB_PROC_MAX]; + #endif /* _BSD_GLOBAL_H_ */ Modified: head/sys/boot/usb/bsd_kernel.c ============================================================================== --- head/sys/boot/usb/bsd_kernel.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/boot/usb/bsd_kernel.c Tue Feb 5 14:44:25 2013 (r246363) @@ -26,7 +26,8 @@ #include -static struct usb_process usb_process[USB_PROC_MAX]; +struct usb_process usb_process[USB_PROC_MAX]; + static device_t usb_pci_root; /*------------------------------------------------------------------------* @@ -977,41 +978,6 @@ repeat: return (worked); } -int -usb_proc_create(struct usb_process *up, struct mtx *p_mtx, - const char *pmesg, uint8_t prio) -{ -#define USB_PROC_OFFSET(a,b) \ - ((int)(((long)&((struct usb_bus *)0)->a) - \ - ((long)&((struct usb_bus *)0)->b))) - - /* figure out which process we are creating */ - switch ((int)((long)up - (long)p_mtx)) { - case USB_PROC_OFFSET(giant_callback_proc, bus_mtx): - up->up_ptr = (void *)(usb_process + 2); - break; - case USB_PROC_OFFSET(non_giant_callback_proc, bus_mtx): - up->up_ptr = (void *)(usb_process + 2); - break; - case USB_PROC_OFFSET(explore_proc, bus_mtx): - up->up_ptr = (void *)(usb_process + 0); - break; - case USB_PROC_OFFSET(control_xfer_proc, bus_mtx): - up->up_ptr = (void *)(usb_process + 1); - break; - default: - up->up_ptr = (void *)(usb_process + 1); - break; - } - return (0); /* success */ -} - -void -usb_proc_free(struct usb_process *up) -{ - /* NOP */ -} - void * usb_proc_msignal(struct usb_process *up, void *_pm0, void *_pm1) { @@ -1021,10 +987,6 @@ usb_proc_msignal(struct usb_process *up, usb_size_t d; uint8_t t; - /* find the correct parent */ - while (up->up_ptr != NULL) - up = (struct usb_process *)up->up_ptr; - t = 0; if (pm0->pm_qentry.tqe_prev) { @@ -1104,10 +1066,6 @@ usb_proc_mwait(struct usb_process *up, v struct usb_proc_msg *pm0 = _pm0; struct usb_proc_msg *pm1 = _pm1; - /* find the correct parent */ - while (up->up_ptr != NULL) - up = (struct usb_process *)up->up_ptr; - /* Just remove the messages from the queue. */ if (pm0->pm_qentry.tqe_prev) { TAILQ_REMOVE(&up->up_qhead, pm0, pm_qentry); Modified: head/sys/boot/usb/bsd_kernel.h ============================================================================== --- head/sys/boot/usb/bsd_kernel.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/boot/usb/bsd_kernel.h Tue Feb 5 14:44:25 2013 (r246363) @@ -40,6 +40,10 @@ #define M_USB 0 #define M_USBDEV 0 #define USB_PROC_MAX 3 +#define USB_BUS_GIANT_PROC(bus) (usb_process + 2) +#define USB_BUS_NON_GIANT_PROC(bus) (usb_process + 2) +#define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0) +#define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1) #define SYSCTL_DECL(...) #define SYSCTL_NODE(name,...) struct { } name __used #define SYSCTL_INT(...) Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/controller/usb_controller.c Tue Feb 5 14:44:25 2013 (r246363) @@ -214,27 +214,29 @@ usb_detach(device_t dev) USB_BUS_LOCK(bus); /* Queue detach job */ - usb_proc_msignal(&bus->explore_proc, + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->detach_msg[0], &bus->detach_msg[1]); /* Wait for detach to complete */ - usb_proc_mwait(&bus->explore_proc, + usb_proc_mwait(USB_BUS_EXPLORE_PROC(bus), &bus->detach_msg[0], &bus->detach_msg[1]); USB_BUS_UNLOCK(bus); +#if USB_HAVE_PER_BUS_PROCESS /* Get rid of USB callback processes */ - usb_proc_free(&bus->giant_callback_proc); - usb_proc_free(&bus->non_giant_callback_proc); + usb_proc_free(USB_BUS_GIANT_PROC(bus)); + usb_proc_free(USB_BUS_NON_GIANT_PROC(bus)); /* Get rid of USB explore process */ - usb_proc_free(&bus->explore_proc); + usb_proc_free(USB_BUS_EXPLORE_PROC(bus)); /* Get rid of control transfer process */ - usb_proc_free(&bus->control_xfer_proc); + usb_proc_free(USB_BUS_CONTROL_XFER_PROC(bus)); +#endif #if USB_HAVE_PF usbpf_detach(bus); @@ -258,11 +260,11 @@ usb_suspend(device_t dev) } USB_BUS_LOCK(bus); - usb_proc_msignal(&bus->explore_proc, + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->suspend_msg[0], &bus->suspend_msg[1]); if (usb_no_suspend_wait == 0) { /* wait for suspend callback to be executed */ - usb_proc_mwait(&bus->explore_proc, + usb_proc_mwait(USB_BUS_EXPLORE_PROC(bus), &bus->suspend_msg[0], &bus->suspend_msg[1]); } USB_BUS_UNLOCK(bus); @@ -286,7 +288,7 @@ usb_resume(device_t dev) } USB_BUS_LOCK(bus); - usb_proc_msignal(&bus->explore_proc, + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->resume_msg[0], &bus->resume_msg[1]); USB_BUS_UNLOCK(bus); @@ -311,11 +313,11 @@ usb_shutdown(device_t dev) device_printf(bus->bdev, "Controller shutdown\n"); USB_BUS_LOCK(bus); - usb_proc_msignal(&bus->explore_proc, + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->shutdown_msg[0], &bus->shutdown_msg[1]); if (usb_no_shutdown_wait == 0) { /* wait for shutdown callback to be executed */ - usb_proc_mwait(&bus->explore_proc, + usb_proc_mwait(USB_BUS_EXPLORE_PROC(bus), &bus->shutdown_msg[0], &bus->shutdown_msg[1]); } USB_BUS_UNLOCK(bus); @@ -358,9 +360,9 @@ usb_bus_explore(struct usb_proc_msg *pm) * The following three lines of code are only here to * recover from DDB: */ - usb_proc_rewakeup(&bus->control_xfer_proc); - usb_proc_rewakeup(&bus->giant_callback_proc); - usb_proc_rewakeup(&bus->non_giant_callback_proc); + usb_proc_rewakeup(USB_BUS_CONTROL_XFER_PROC(bus)); + usb_proc_rewakeup(USB_BUS_GIANT_PROC(bus)); + usb_proc_rewakeup(USB_BUS_NON_GIANT_PROC(bus)); #endif USB_BUS_UNLOCK(bus); @@ -585,7 +587,7 @@ usb_power_wdog(void *arg) * The following line of code is only here to recover from * DDB: */ - usb_proc_rewakeup(&bus->explore_proc); /* recover from DDB */ + usb_proc_rewakeup(USB_BUS_EXPLORE_PROC(bus)); /* recover from DDB */ #endif #if USB_HAVE_POWERD @@ -708,8 +710,6 @@ usb_bus_attach(struct usb_proc_msg *pm) static void usb_attach_sub(device_t dev, struct usb_bus *bus) { - const char *pname = device_get_nameunit(dev); - mtx_lock(&Giant); if (usb_devclass_ptr == NULL) usb_devclass_ptr = devclass_find("usbus"); @@ -749,28 +749,31 @@ usb_attach_sub(device_t dev, struct usb_ bus->shutdown_msg[1].hdr.pm_callback = &usb_bus_shutdown; bus->shutdown_msg[1].bus = bus; +#if USB_HAVE_PER_BUS_PROCESS /* Create USB explore and callback processes */ - if (usb_proc_create(&bus->giant_callback_proc, - &bus->bus_mtx, pname, USB_PRI_MED)) { + if (usb_proc_create(USB_BUS_GIANT_PROC(bus), + &bus->bus_mtx, device_get_nameunit(dev), USB_PRI_MED)) { device_printf(dev, "WARNING: Creation of USB Giant " "callback process failed.\n"); - } else if (usb_proc_create(&bus->non_giant_callback_proc, - &bus->bus_mtx, pname, USB_PRI_HIGH)) { + } else if (usb_proc_create(USB_BUS_NON_GIANT_PROC(bus), + &bus->bus_mtx, device_get_nameunit(dev), USB_PRI_HIGH)) { device_printf(dev, "WARNING: Creation of USB non-Giant " "callback process failed.\n"); - } else if (usb_proc_create(&bus->explore_proc, - &bus->bus_mtx, pname, USB_PRI_MED)) { + } else if (usb_proc_create(USB_BUS_EXPLORE_PROC(bus), + &bus->bus_mtx, device_get_nameunit(dev), USB_PRI_MED)) { device_printf(dev, "WARNING: Creation of USB explore " "process failed.\n"); - } else if (usb_proc_create(&bus->control_xfer_proc, - &bus->bus_mtx, pname, USB_PRI_MED)) { + } else if (usb_proc_create(USB_BUS_CONTROL_XFER_PROC(bus), + &bus->bus_mtx, device_get_nameunit(dev), USB_PRI_MED)) { device_printf(dev, "WARNING: Creation of USB control transfer " "process failed.\n"); - } else { + } else +#endif + { /* Get final attach going */ USB_BUS_LOCK(bus); - usb_proc_msignal(&bus->explore_proc, + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->attach_msg[0], &bus->attach_msg[1]); USB_BUS_UNLOCK(bus); @@ -778,7 +781,6 @@ usb_attach_sub(device_t dev, struct usb_ usb_needs_explore(bus, 1); } } - SYSUNINIT(usb_bus_unload, SI_SUB_KLD, SI_ORDER_ANY, usb_bus_unload, NULL); /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/controller/xhci.c Tue Feb 5 14:44:25 2013 (r246363) @@ -547,19 +547,12 @@ xhci_init(struct xhci_softc *sc, device_ sc->sc_config_msg[1].hdr.pm_callback = &xhci_configure_msg; sc->sc_config_msg[1].bus = &sc->sc_bus; - if (usb_proc_create(&sc->sc_config_proc, - &sc->sc_bus.bus_mtx, device_get_nameunit(self), USB_PRI_MED)) { - printf("WARNING: Creation of XHCI configure " - "callback process failed.\n"); - } return (0); } void xhci_uninit(struct xhci_softc *sc) { - usb_proc_free(&sc->sc_config_proc); - usb_bus_mem_free_all(&sc->sc_bus, &xhci_iterate_hw_softc); cv_destroy(&sc->sc_cmd_cv); @@ -2684,7 +2677,7 @@ xhci_transfer_insert(struct usb_xfer *xf DPRINTFN(8, "Not running\n"); /* start configuration */ - (void)usb_proc_msignal(&sc->sc_config_proc, + (void)usb_proc_msignal(USB_BUS_CONTROL_XFER_PROC(&sc->sc_bus), &sc->sc_config_msg[0], &sc->sc_config_msg[1]); return (0); } @@ -3652,7 +3645,7 @@ xhci_start_dma_delay(struct usb_xfer *xf /* put transfer on interrupt queue (again) */ usbd_transfer_enqueue(&sc->sc_bus.intr_q, xfer); - (void)usb_proc_msignal(&sc->sc_config_proc, + (void)usb_proc_msignal(USB_BUS_CONTROL_XFER_PROC(&sc->sc_bus), &sc->sc_config_msg[0], &sc->sc_config_msg[1]); } Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/controller/xhci.h Tue Feb 5 14:44:25 2013 (r246363) @@ -434,8 +434,7 @@ struct xhci_softc { struct xhci_hw_softc sc_hw; /* base device */ struct usb_bus sc_bus; - /* configure process */ - struct usb_process sc_config_proc; + /* configure message */ struct usb_bus_msg sc_config_msg[2]; union xhci_hub_desc sc_hub_desc; Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_bus.h Tue Feb 5 14:44:25 2013 (r246363) @@ -54,6 +54,13 @@ struct usb_bus { #if USB_HAVE_ROOT_MOUNT_HOLD struct root_hold_token *bus_roothold; #endif + +#if USB_HAVE_PER_BUS_PROCESS +#define USB_BUS_GIANT_PROC(bus) (&(bus)->giant_callback_proc) +#define USB_BUS_NON_GIANT_PROC(bus) (&(bus)->non_giant_callback_proc) +#define USB_BUS_EXPLORE_PROC(bus) (&(bus)->explore_proc) +#define USB_BUS_CONTROL_XFER_PROC(bus) (&(bus)->control_xfer_proc) + /* * There are two callback processes. One for Giant locked * callbacks. One for non-Giant locked callbacks. This should @@ -67,6 +74,7 @@ struct usb_bus { /* Control request process */ struct usb_process control_xfer_proc; +#endif struct usb_bus_msg explore_msg[2]; struct usb_bus_msg detach_msg[2]; Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_device.c Tue Feb 5 14:44:25 2013 (r246363) @@ -2128,7 +2128,7 @@ usb_free_device(struct usb_device *udev, * anywhere: */ USB_BUS_LOCK(udev->bus); - usb_proc_mwait(&udev->bus->non_giant_callback_proc, + usb_proc_mwait(USB_BUS_NON_GIANT_PROC(udev->bus), &udev->cs_msg[0], &udev->cs_msg[1]); USB_BUS_UNLOCK(udev->bus); Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_freebsd.h Tue Feb 5 14:44:25 2013 (r246363) @@ -44,6 +44,7 @@ #define USB_HAVE_PF 1 #define USB_HAVE_ROOT_MOUNT_HOLD 1 #define USB_HAVE_ID_SECTION 1 +#define USB_HAVE_PER_BUS_PROCESS 1 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_freebsd_loader.h Tue Feb 5 14:44:25 2013 (r246363) @@ -44,6 +44,7 @@ #define USB_HAVE_PF 0 #define USB_HAVE_ROOT_MOUNT_HOLD 0 #define USB_HAVE_ID_SECTION 0 +#define USB_HAVE_PER_BUS_PROCESS 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_hub.c Tue Feb 5 14:44:25 2013 (r246363) @@ -1917,7 +1917,7 @@ usb_needs_explore(struct usb_bus *bus, u if (do_probe) { bus->do_probe = 1; } - if (usb_proc_msignal(&bus->explore_proc, + if (usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->explore_msg[0], &bus->explore_msg[1])) { /* ignore */ } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Feb 5 14:39:37 2013 (r246362) +++ head/sys/dev/usb/usb_transfer.c Tue Feb 5 14:44:25 2013 (r246363) @@ -965,14 +965,14 @@ usbd_transfer_setup(struct usb_device *u * deadlock! */ if (setup_start == usb_control_ep_cfg) - info->done_p = - &udev->bus->control_xfer_proc; + info->done_p = + USB_BUS_CONTROL_XFER_PROC(udev->bus); else if (xfer_mtx == &Giant) - info->done_p = - &udev->bus->giant_callback_proc; + info->done_p = + USB_BUS_GIANT_PROC(udev->bus); else - info->done_p = - &udev->bus->non_giant_callback_proc; + info->done_p = + USB_BUS_NON_GIANT_PROC(udev->bus); } /* reset sizes */ @@ -2614,7 +2614,7 @@ usbd_pipe_start(struct usb_xfer_queue *p } else if (udev->ctrl_xfer[1]) { info = udev->ctrl_xfer[1]->xroot; usb_proc_msignal( - &info->bus->non_giant_callback_proc, + USB_BUS_NON_GIANT_PROC(info->bus), &udev->cs_msg[0], &udev->cs_msg[1]); } else { /* should not happen */ @@ -3216,10 +3216,10 @@ usbd_transfer_poll(struct usb_xfer **ppx } /* Make sure cv_signal() and cv_broadcast() is not called */ - udev->bus->control_xfer_proc.up_msleep = 0; - udev->bus->explore_proc.up_msleep = 0; - udev->bus->giant_callback_proc.up_msleep = 0; - udev->bus->non_giant_callback_proc.up_msleep = 0; + USB_BUS_CONTROL_XFER_PROC(udev->bus)->up_msleep = 0; + USB_BUS_EXPLORE_PROC(udev->bus)->up_msleep = 0; + USB_BUS_GIANT_PROC(udev->bus)->up_msleep = 0; + USB_BUS_NON_GIANT_PROC(udev->bus)->up_msleep = 0; /* poll USB hardware */ (udev->bus->methods->xfer_poll) (udev->bus); From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:53:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 375F5CC2; Tue, 5 Feb 2013 14:53:06 +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 1AFDEE35; Tue, 5 Feb 2013 14:53: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 r15Er5jc016419; Tue, 5 Feb 2013 14:53:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15Er52l016417; Tue, 5 Feb 2013 14:53:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051453.r15Er52l016417@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246364 - stable/9/games/fortune/datfiles X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:53:06 -0000 Author: des Date: Tue Feb 5 14:53:05 2013 New Revision: 246364 URL: http://svnweb.freebsd.org/changeset/base/246364 Log: MFH r246362: remove political propaganda Modified: stable/9/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/9/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:44:25 2013 (r246363) +++ stable/9/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:05 2013 (r246364) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:53:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E5F3DD7; Tue, 5 Feb 2013 14:53:17 +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 622A8E38; Tue, 5 Feb 2013 14:53: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 r15ErH4d016479; Tue, 5 Feb 2013 14:53:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15ErHJk016478; Tue, 5 Feb 2013 14:53:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051453.r15ErHJk016478@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246365 - stable/8/games/fortune/datfiles X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:53:17 -0000 Author: des Date: Tue Feb 5 14:53:16 2013 New Revision: 246365 URL: http://svnweb.freebsd.org/changeset/base/246365 Log: MFH r246362: remove political propaganda Modified: stable/8/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/8/games/fortune/ (props changed) Modified: stable/8/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/8/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:05 2013 (r246364) +++ stable/8/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:16 2013 (r246365) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 14:55:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2642152; Tue, 5 Feb 2013 14:55:34 +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 CBCFFE8C; Tue, 5 Feb 2013 14:55: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 r15EtX36016857; Tue, 5 Feb 2013 14:55:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15EtXrB016855; Tue, 5 Feb 2013 14:55:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051455.r15EtXrB016855@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246366 - stable/7/games/fortune/datfiles X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:55:35 -0000 Author: des Date: Tue Feb 5 14:55:33 2013 New Revision: 246366 URL: http://svnweb.freebsd.org/changeset/base/246366 Log: MFH r246362: remove political propaganda Modified: stable/7/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/7/games/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/7/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:16 2013 (r246365) +++ stable/7/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:55:33 2013 (r246366) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 15:45:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 444C17E; Tue, 5 Feb 2013 15:45:55 +0000 (UTC) (envelope-from lifanov@mail.lifanov.com) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2FDE4214; Tue, 5 Feb 2013 15:45:55 +0000 (UTC) Received: from [10.1.3.40] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 1C21519FAB8; Tue, 5 Feb 2013 15:45:53 +0000 (UTC) Message-ID: <51112930.3040403@mail.lifanov.com> Date: Tue, 05 Feb 2013 10:45:52 -0500 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> In-Reply-To: <201302051439.r15EdcE7011203@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 15:45:55 -0000 On 02/05/2013 09:39 AM, Dag-Erling Smørgrav wrote: > Author: des Date: Tue Feb 5 14:39:37 2013 New Revision: 246362 > URL: http://svnweb.freebsd.org/changeset/base/246362 > > Log: Remove political propaganda > > Modified: head/games/fortune/datfiles/fortunes-o.real > > Modified: head/games/fortune/datfiles/fortunes-o.real > ============================================================================== > > --- head/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:29:37 2013 (r246361) > +++ head/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:39:37 > 2013 (r246362) @@ -11437,233 +11437,6 @@ two new uses for sheep. > Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 > Undeniable Truths of Life: - -(1) The greatest threat to the human > spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, > EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of > Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's > 35 Undeniable Truths of Life: - -(11) Neither the United States, > nor anyone else, "imposes" freedom on - the people of other > nations. Freedom is not an imposition. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's > 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- > "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% > -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To > dictatorships, peace means the absence of opposition. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, > peace means the absence of threat. - - -- "The Limbaugh Letter," > Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 > Undeniable Truths of Life: - -(15) The Peace Movement in the United > States was, whether by accident or - design, pro-communist. - - > -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% > -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The > collective knowledge and wisdom of seasoned citizens is the - > most valuable, yet untapped, resource our young people have. - - -- > "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% > -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest > football team in the history of civilization was the - > Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's > 35 Undeniable Truths of Life: - -(18) There is no such thing as > "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," > Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 > Undeniable Truths of Life: - -(19) Regardless of the pain in our > memories, nostalgia only reminds us - of the good times in our > past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, > Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The > single greatest threat to the free people of the world is posed - > by the heinous idea of centralized government control. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - > - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. > -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion > is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(22) Morality is not defined by individual choice. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot > explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(24) Feminism was established so that unattractive women could > have - easier access to the mainstream of society. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only > human emotion which cannot be controlled. You - either do or > you don't. You can't fake it. (Except women, and - thank God > they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(26) The only difference between Mikhail Gorbachev and previous > Soviet - leaders is that he is alive. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's > 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually > left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, > EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of > Life: - -(28) Abraham Lincoln saved this nation. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles > Raiders will never be the team they were when they - called > Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(3) Peace does not mean the elimination of nuclear weapons. - - > -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% > -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United > States will again go to war. - - -- "The Limbaugh Letter," > Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 > Undeniable Truths of Life: - -(31) To more and more American > intellectuals, a victorious United States - is a sinful United > States. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(32) The fact that American intellectuals rue a victorious > United States - is frightening and ominous. - - -- "The > Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush > Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always > be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(34) The fact that there will always be poor people is not the > fault of - the rich. - - -- "The Limbaugh Letter," Copyright > 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths > of Life: - -(35) Rather than feel guilty as some do, you should > thank God for making - you an American. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's > 35 Undeniable Truths of Life: - -(4) Peace does not mean the > absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright > 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths > of Life: - -(6) Ours is a world governed by the aggressive use of > force. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(7) There is only one way to eliminate nuclear weapons. Use > them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, > Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace > cannot be achieved merely by developing an "understanding" - > among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM > Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: > - -(9) Americans opposing America is not always sacred nor > courageous ... - it is sometimes dangerous. - - -- "The Limbaugh > Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty > young whore named Ms. Meggs, "The men like to spread my two legs, > Then slip in between, > _______________________________________________ > 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" > Remove political propaganda -- Why? This is the "offensive" file. It's supposed to have potentially offensive political, sexist, religious, racist, and miscellaneously off content. The man page is clear about this and comes with a warning. - Nikolai Lifanov From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:45:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 997DC8F8; Tue, 5 Feb 2013 16:45:44 +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 6F7F2836; Tue, 5 Feb 2013 16:45:44 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5F123B911; Tue, 5 Feb 2013 11:45:43 -0500 (EST) From: John Baldwin To: Sergey Kandaurov Subject: Re: svn commit: r245848 - head/sys/boot/i386/libi386 Date: Tue, 5 Feb 2013 11:11:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201301231834.r0NIYLnp006407@svn.freebsd.org> <201302041446.55786.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201302051111.44833.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Feb 2013 11:45:43 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:45:44 -0000 On Tuesday, February 05, 2013 2:46:15 am Sergey Kandaurov wrote: > Err.. No, I haven't set hw.uart.console. Sorry for being misleading. > The cited snippet from my previous mail was to demonstrate how the > resulting hw.uart.console value depends (or rather not :)) on hints. > All I have (changed) wrt console is: > > /boot/device.hints > #hint.uart.0.flags="0x10" > hint.uart.1.flags="0x10" > > /boot/loader.conf > boot_multicons="YES" > boot_serial="YES" > boot_verbose="YES" > console="comconsole,vidconsole" > > This setup worked for ages. To isolate this problem I took /boot/loader > from my older current machine (also with COM2) to replace it here, > and it started to work again. Right, so with this setup, you are using a non-working serial console for the loader on COM1 and then wanting the kernel to use COM2? Why? If you want to do that, set hw.uart.console manually. I think that is a very rare case and that most folks want to use the same console in both the loader and kernel. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:45:47 2013 Return-Path: Delivered-To: svn-src-all@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 2B3938FA; Tue, 5 Feb 2013 16:45:47 +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 019B4837; Tue, 5 Feb 2013 16:45:47 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 54C38B97C; Tue, 5 Feb 2013 11:45:46 -0500 (EST) From: John Baldwin To: Andriy Gapon Subject: Re: svn commit: r246282 - in head/sys: conf kern Date: Tue, 5 Feb 2013 11:15:02 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302030957.r139vd8n027213@svn.freebsd.org> <201302041429.01477.jhb@freebsd.org> <51102076.8030302@FreeBSD.org> In-Reply-To: <51102076.8030302@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302051115.03275.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Feb 2013 11:45:46 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:45:47 -0000 On Monday, February 04, 2013 3:56:22 pm Andriy Gapon wrote: > on 04/02/2013 21:29 John Baldwin said the following: > > On Sunday, February 03, 2013 4:57:39 am Andriy Gapon wrote: > >> Author: avg > >> Date: Sun Feb 3 09:57:39 2013 > >> New Revision: 246282 > >> URL: http://svnweb.freebsd.org/changeset/base/246282 > >> > >> Log: > >> allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9) > >> > >> Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM), > >> the static ktr_buf_init is used. Size of the static buffer is determined > >> by a new kernel option KTR_BOOT_ENTRIES. Its default value is 1024. > >> > >> This commit builds on top of r243046. > > > > Does this lose "early" entries once the SYSINIT runs? It doesn't seem to make > > any effort to copy the existing entries over to the new buffer? > > Yes, this is true and glebius has also noticed that... > I think that a simple bcopy should be fine here? Almost. To handle the case where the boot buffer might have wrapped I think you should copy the entries at the "end" into the head of the KTR buffer first, then the entries from the front to the current index, and then update the index to point at the end (it should effectively be KTR_BOOT_ENTRIES I think). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:45:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 636838FC; Tue, 5 Feb 2013 16:45:49 +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 40F1E839; Tue, 5 Feb 2013 16:45:49 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8CC16B9AC; Tue, 5 Feb 2013 11:45:48 -0500 (EST) From: John Baldwin To: "Dag-Erling SmXXrgrav" Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Date: Tue, 5 Feb 2013 11:45:40 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302051439.r15EdcE7011203@svn.freebsd.org> In-Reply-To: <201302051439.r15EdcE7011203@svn.freebsd.org> MIME-Version: 1.0 Message-Id: <201302051145.40104.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Feb 2013 11:45:48 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:45:49 -0000 On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > Author: des > Date: Tue Feb 5 14:39:37 2013 > New Revision: 246362 > URL: http://svnweb.freebsd.org/changeset/base/246362 > > Log: > Remove political propaganda > > Modified: > head/games/fortune/datfiles/fortunes-o.real *sigh* I'm sure there are other quotes that people who do not share your political persuasion might find propaganda or offensive, etc. Censorship and freedom of speech is quite a sticky widget, and I think the only truly sane policy is that fortune files are append-only (unless we outright remove them and that seems excessive). And new things should have a very high bar to be added to fortune. Perhaps we should move fortunes-o to ports entirely? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:48:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0A57D63; Tue, 5 Feb 2013 16:48:00 +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 ABDD1862; Tue, 5 Feb 2013 16:48:00 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A07946CE4; Tue, 5 Feb 2013 16:47:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 28200ADF1; Tue, 5 Feb 2013 17:47:58 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nikolai Lifanov Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <51112930.3040403@mail.lifanov.com> Date: Tue, 05 Feb 2013 17:47:58 +0100 In-Reply-To: <51112930.3040403@mail.lifanov.com> (Nikolai Lifanov's message of "Tue, 05 Feb 2013 10:45:52 -0500") Message-ID: <86ehgu4sht.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:48:01 -0000 Nikolai Lifanov writes: > Remove political propaganda -- Why? Because FreeBSD does not engage in politics. > This is the "offensive" file. Yes, and it is meant for dirty jokes and the like. These are not dirty jokes. Some of these quotes are harmless, but others verge on hate speech. We already had this discussion when they were added way back when, and the consensus was that we *shouldn't* have them. However, the person who added them was extremely vocal about them (and about what he perceived as political censorship etc.), so as a compromise, we moved them to -o. That person is no longer with the project, so there is no longer a need for such compromise. Besides, what I removed were not isolated quotes, but a complete copy of a copyrighted work, and therefore legally questionable. > It's supposed to have potentially offensive political, sexist, > religious, racist, and miscellaneously off content. If there is racist content in that file, it should be removed. The only people who think racist jokes are OK ("geez, they're just jokes, lighten up") are those who have never been at the receiving end of them and are incapable of empathizing with those who have. There is a word for people like that: they're called "racists". DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:51:01 2013 Return-Path: Delivered-To: svn-src-all@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 B9AB06D; Tue, 5 Feb 2013 16:51:01 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ie0-x230.google.com (ie-in-x0230.1e100.net [IPv6:2607:f8b0:4001:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id 4E47C899; Tue, 5 Feb 2013 16:51:01 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id k13so494720iea.21 for ; Tue, 05 Feb 2013 08:51:01 -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=E338upMqPOamVg9wBiGkEcci0mqX8UWMSYJDCinT6OA=; b=lTGjCNy12X5gDxDfch3afA016d3LRr+j95EVrMdngekoyWzi8wP5H9mTKufQBIg9Bo VVl+sKk1BPYZPmGPptF8Ijoze1mVCh5xxxU+rcHj+X4wsw+PidsaVMLUWNXlTRtN0YEd Emrb9ForMFLyQeWvQM+086JeqckuMafSgPyuHLXh2pYGy9xzwVcw1psl0uYWlXrBbM32 EvH21FF6tpVY26u/ANJYgc1O95YQo9Hq8tigePfKHD4oJ1gR0DeHuOfmrN6J48Aqkgdk K3g+0FvXzo0iouvcxdj4tGnzhqQNNoTyqojA4z6qTyyIINQnGRI8j2Klos7FejMzs7yj fglA== MIME-Version: 1.0 X-Received: by 10.50.242.73 with SMTP id wo9mr14302115igc.36.1360083060955; Tue, 05 Feb 2013 08:51:00 -0800 (PST) Received: by 10.42.79.17 with HTTP; Tue, 5 Feb 2013 08:51:00 -0800 (PST) In-Reply-To: <201302051145.40104.jhb@freebsd.org> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> Date: Tue, 5 Feb 2013 11:51:00 -0500 Message-ID: Subject: Re: svn commit: r246362 - head/games/fortune/datfiles From: Benjamin Kaduk To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:51:01 -0000 On Tue, Feb 5, 2013 at 11:45 AM, John Baldwin wrote: > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > > Author: des > > Date: Tue Feb 5 14:39:37 2013 > > New Revision: 246362 > > URL: http://svnweb.freebsd.org/changeset/base/246362 > > > > Log: > > Remove political propaganda > > > > Modified: > > head/games/fortune/datfiles/fortunes-o.real > > *sigh* > > I'm sure there are other quotes that people who do not share your political > persuasion might find propaganda or offensive, etc. Censorship and freedom > of speech is quite a sticky widget, and I think the only truly sane policy > is that fortune files are append-only (unless we outright remove them and > that seems excessive). And new things should have a very high bar to be > added to fortune. Perhaps we should move fortunes-o to ports entirely? > I am more concerned about the insta-MFC than the removal per se. Only security or legal issues are cause to go under 3 days, was my impression. -Ben From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:55:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62080261; Tue, 5 Feb 2013 16:55:25 +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 2369F8D1; Tue, 5 Feb 2013 16:55:25 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 6BEEA6CFC; Tue, 5 Feb 2013 16:55:24 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 23459ADF4; Tue, 5 Feb 2013 17:55:24 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Benjamin Kaduk Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> Date: Tue, 05 Feb 2013 17:55:23 +0100 In-Reply-To: (Benjamin Kaduk's message of "Tue, 5 Feb 2013 11:51:00 -0500") Message-ID: <86a9ri4s5g.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (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, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:55:25 -0000 Benjamin Kaduk writes: > I am more concerned about the insta-MFC than the removal per se. > Only security or legal issues are cause to go under 3 days, was my > impression. The text I removed was a full copy of the source document, rather than selected quotes from it, so yes, there is a legal issue as well. However, my primary motivation is that these are not jokes or "words of wisdom" but political statements, and FreeBSD does not engage in politics. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 16:57:44 2013 Return-Path: Delivered-To: svn-src-all@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 13201438; Tue, 5 Feb 2013 16:57:44 +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 CA130900; Tue, 5 Feb 2013 16:57:43 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 29EC06D05; Tue, 5 Feb 2013 16:57:42 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D0027ADF7; Tue, 5 Feb 2013 17:57:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> Date: Tue, 05 Feb 2013 17:57:41 +0100 In-Reply-To: <201302051145.40104.jhb@freebsd.org> (John Baldwin's message of "Tue, 5 Feb 2013 11:45:40 -0500") Message-ID: <8662264s1m.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 16:57:44 -0000 John Baldwin writes: > I'm sure there are other quotes that people who do not share your > political persuasion might find propaganda or offensive, etc. If you think this is about my political persuasion, feel free to point out left-leaning material and I will remove it as well. > And new things should have a very high bar to be added to fortune. The bar, in this specific case, was set at "whatever will shut up the person who committed them" (resulting in a move to -o rather than an outright reversal). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 17:01:43 2013 Return-Path: Delivered-To: svn-src-all@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 7597A780; Tue, 5 Feb 2013 17:01:43 +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 53186947; Tue, 5 Feb 2013 17:01:43 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BB081B9AC; Tue, 5 Feb 2013 12:01:42 -0500 (EST) From: John Baldwin To: Benjamin Kaduk Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Date: Tue, 5 Feb 2013 11:58:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201302051158.55117.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Feb 2013 12:01:42 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 17:01:43 -0000 On Tuesday, February 05, 2013 11:51:00 am Benjamin Kaduk wrote: > On Tue, Feb 5, 2013 at 11:45 AM, John Baldwin wrote: > > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > > > Author: des > > > Date: Tue Feb 5 14:39:37 2013 > > > New Revision: 246362 > > > URL: http://svnweb.freebsd.org/changeset/base/246362 > > > > > > Log: > > > Remove political propaganda > > > > > > Modified: > > > head/games/fortune/datfiles/fortunes-o.real > > > > *sigh* > > > > I'm sure there are other quotes that people who do not share your political > > persuasion might find propaganda or offensive, etc. Censorship and freedom > > of speech is quite a sticky widget, and I think the only truly sane policy > > is that fortune files are append-only (unless we outright remove them and > > that seems excessive). And new things should have a very high bar to be > > added to fortune. Perhaps we should move fortunes-o to ports entirely? > > > > I am more concerned about the insta-MFC than the removal per se. > Only security or legal issues are cause to go under 3 days, was my > impression. Yes, the insta-MFC is also not appropriate, esp. for something that you know is going to raise eyebrows when it is committed. Having to debate this sort of thing in public on mailing lists is also distinctly unhelpful and very distracting from productive work. Also, I'd like to preemptively ask developers to refrain from any further commits to the fortunes datfiles for the time being as the last thing we need is a commit war over this sort of thing. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 17:14:12 2013 Return-Path: Delivered-To: svn-src-all@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 B9895C91; Tue, 5 Feb 2013 17:14:12 +0000 (UTC) (envelope-from utisoft@gmail.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 676DE9F2; Tue, 5 Feb 2013 17:14:12 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id c12so539653ieb.34 for ; Tue, 05 Feb 2013 09:14:11 -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=jfd3iPHkxta5RlwCOHNANIY1KdUu54M7dkl8ptfxI4g=; b=LlDh0wNudhSI8nC8zZ/r3gksvB2scLB1YRlTJabmOf5AdS8HDn6u409DPfwclggbXH RHJbYJ81tgDpemX+ViFqIaLSV4DDRSCNSp0Py3Pq3YDsVj9vX67YqDe8UiVG620xuoGS LBPZiqn3WP0QU/aIM65RcVhvTBGRkrUKrIv4Z6V/AYyUJSeF+NDDkEkiUyZ9h1C7B0Sg Fy+1HFr0z8beSkUKF7MBJ0DPk1fKdmqNtDxF6OIy/YmngSIerTZTczNh2etu1bC/t02e 4fEXkxP/HDzTE7qZsxK19FwABjbTznsD0cYHvoVnfuhQCcip+CL1Wt8EyH1eXw0Kb6PS SZYA== MIME-Version: 1.0 X-Received: by 10.50.178.10 with SMTP id cu10mr14827029igc.75.1360084451456; Tue, 05 Feb 2013 09:14:11 -0800 (PST) Received: by 10.64.16.73 with HTTP; Tue, 5 Feb 2013 09:14:11 -0800 (PST) Received: by 10.64.16.73 with HTTP; Tue, 5 Feb 2013 09:14:11 -0800 (PST) In-Reply-To: <201302051158.55117.jhb@freebsd.org> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <201302051158.55117.jhb@freebsd.org> Date: Tue, 5 Feb 2013 17:14:11 +0000 Message-ID: Subject: Re: svn commit: r246362 - head/games/fortune/datfiles From: Chris Rees To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Benjamin Kaduk , svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 17:14:12 -0000 On 5 Feb 2013 17:01, "John Baldwin" wrote: > > On Tuesday, February 05, 2013 11:51:00 am Benjamin Kaduk wrote: > > On Tue, Feb 5, 2013 at 11:45 AM, John Baldwin wrote: > > > > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > > > > Author: des > > > > Date: Tue Feb 5 14:39:37 2013 > > > > New Revision: 246362 > > > > URL: http://svnweb.freebsd.org/changeset/base/246362 > > > > > > > > Log: > > > > Remove political propaganda > > > > > > > > Modified: > > > > head/games/fortune/datfiles/fortunes-o.real > > > > > > *sigh* > > > > > > I'm sure there are other quotes that people who do not share your political > > > persuasion might find propaganda or offensive, etc. Censorship and freedom > > > of speech is quite a sticky widget, and I think the only truly sane policy > > > is that fortune files are append-only (unless we outright remove them and > > > that seems excessive). And new things should have a very high bar to be > > > added to fortune. Perhaps we should move fortunes-o to ports entirely? > > > > > > > I am more concerned about the insta-MFC than the removal per se. > > Only security or legal issues are cause to go under 3 days, was my > > impression. > > Yes, the insta-MFC is also not appropriate, esp. for something that you know > is going to raise eyebrows when it is committed. Having to debate this sort > of thing in public on mailing lists is also distinctly unhelpful and very > distracting from productive work. Also, I'd like to preemptively ask > developers to refrain from any further commits to the fortunes datfiles for > the time being as the last thing we need is a commit war over this sort of > thing. Moving the -o file to ports as you suggested is probably the best idea. Or simply allowing people to fetch their own.... I don't see why we should have trash installed by default on a professional operating system; we have higher standards in other areas. Chris From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 18:40:21 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7159781E; Tue, 5 Feb 2013 18:40:21 +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 4DF09F3A; Tue, 5 Feb 2013 18:40:21 +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 r15IFjEc055730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Feb 2013 10:15:45 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r15IFiGA055729; Tue, 5 Feb 2013 10:15:44 -0800 (PST) (envelope-from jmg) Date: Tue, 5 Feb 2013 10:15:44 -0800 From: John-Mark Gurney To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130205181544.GV1410@funkthat.com> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <51112930.3040403@mail.lifanov.com> <86ehgu4sht.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ehgu4sht.fsf@ds4.des.no> 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]); Tue, 05 Feb 2013 10:15:45 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 18:40:21 -0000 Dag-Erling Smrgrav wrote this message on Tue, Feb 05, 2013 at 17:47 +0100: > > It's supposed to have potentially offensive political, sexist, > > religious, racist, and miscellaneously off content. > > If there is racist content in that file, it should be removed. The only > people who think racist jokes are OK ("geez, they're just jokes, lighten > up") are those who have never been at the receiving end of them and are > incapable of empathizing with those who have. There is a word for > people like that: they're called "racists". Clearly you don't run fortune -o very often, or you'd be removing a lot more from the file... -- 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-all@FreeBSD.ORG Tue Feb 5 18:55:12 2013 Return-Path: Delivered-To: svn-src-all@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 3BA16C75; Tue, 5 Feb 2013 18:55:12 +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 2476DFDC; Tue, 5 Feb 2013 18:55: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 r15ItBHb091485; Tue, 5 Feb 2013 18:55:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15ItAI4091481; Tue, 5 Feb 2013 18:55:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302051855.r15ItAI4091481@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Feb 2013 18:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246367 - in head: etc/mtree include usr.sbin/bhyve usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 18:55:12 -0000 Author: jhb Date: Tue Feb 5 18:55:09 2013 New Revision: 246367 URL: http://svnweb.freebsd.org/changeset/base/246367 Log: Install and as userland headers in /usr/include. MFC after: 2 weeks Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/usr.sbin/bhyve/Makefile head/usr.sbin/pciconf/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Feb 5 14:55:33 2013 (r246366) +++ head/etc/mtree/BSD.include.dist Tue Feb 5 18:55:09 2013 (r246367) @@ -100,6 +100,8 @@ dev acpica .. + agp + .. an .. bktr @@ -136,6 +138,8 @@ .. pbio .. + pci + .. powermac_nvram .. ppbus Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Feb 5 14:55:33 2013 (r246366) +++ head/include/Makefile Tue Feb 5 18:55:09 2013 (r246367) @@ -42,9 +42,10 @@ LDIRS= bsm cam geom net net80211 netatal sys vm LSUBDIRS= cam/ata cam/scsi \ - dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ + dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ + dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ - dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ + dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/udf fs/unionfs \ @@ -154,7 +155,7 @@ copies: done .endif .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr:Ndev/nand} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i @@ -162,6 +163,9 @@ copies: cd ${.CURDIR}/../sys/dev/acpica; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica + cd ${.CURDIR}/../sys/dev/agp; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \ + ${DESTDIR}${INCLUDEDIR}/dev/agp cd ${.CURDIR}/../sys/dev/bktr; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ ${DESTDIR}${INCLUDEDIR}/dev/bktr @@ -172,6 +176,9 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ ${DESTDIR}${INCLUDEDIR}/dev/nand .endif + cd ${.CURDIR}/../sys/dev/pci; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ + ${DESTDIR}${INCLUDEDIR}/dev/pci cd ${.CURDIR}/../sys/contrib/altq/altq; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/altq @@ -225,7 +232,7 @@ symlinks: ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr:Ndev/nand} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -236,6 +243,11 @@ symlinks: ln -fs ../../../../sys/dev/acpica/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ done + cd ${.CURDIR}/../sys/dev/agp; \ + for h in agpreg.h; do \ + ln -fs ../../../../sys/dev/agp/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/agp; \ + done cd ${.CURDIR}/../sys/dev/bktr; \ for h in ioctl_*.h; do \ ln -fs ../../../../sys/dev/bktr/$$h \ @@ -248,6 +260,11 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/dev/nand; \ done .endif + cd ${.CURDIR}/../sys/dev/pci; \ + for h in pcireg.h; do \ + ln -fs ../../../../sys/dev/pci/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/pci; \ + done .for i in ${LSUBSUBDIRS} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Feb 5 14:55:33 2013 (r246366) +++ head/usr.sbin/bhyve/Makefile Tue Feb 5 18:55:09 2013 (r246367) @@ -22,6 +22,4 @@ LDADD= -lvmmapi -lmd -lpthread WARNS?= 2 -CFLAGS+= -I${.CURDIR}/../../sys - .include Modified: head/usr.sbin/pciconf/Makefile ============================================================================== --- head/usr.sbin/pciconf/Makefile Tue Feb 5 14:55:33 2013 (r246366) +++ head/usr.sbin/pciconf/Makefile Tue Feb 5 18:55:09 2013 (r246367) @@ -5,8 +5,6 @@ PROG= pciconf SRCS= pciconf.c cap.c err.c MAN= pciconf.8 -CFLAGS+= -I${.CURDIR}/../../sys - WARNS?= 3 .include From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 19:10:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05519E8; Tue, 5 Feb 2013 19:10:51 +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 DD3DA107; Tue, 5 Feb 2013 19:10: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 r15JAobK097253; Tue, 5 Feb 2013 19:10:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15JAoMn097251; Tue, 5 Feb 2013 19:10:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302051910.r15JAoMn097251@svn.freebsd.org> From: Dimitry Andric Date: Tue, 5 Feb 2013 19:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246368 - in stable/9: gnu/lib/libsupc++ lib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 19:10:51 -0000 Author: dim Date: Tue Feb 5 19:10:50 2013 New Revision: 246368 URL: http://svnweb.freebsd.org/changeset/base/246368 Log: MFC r246028 (by theraven): Fix some symbol version mismatches between libstdc++ and libsupc++/libcxxrt that were causing the runtime and STL libraries to see different versions of various classes and functions when libstdc++ is used as a filter. Note: This changes the ABI for libcxxrt, but libcxxrt is currently only in -STABLE for testing and is not used by anything unless explicitly enabled by the end user. No default compiler configurations use it. libc++ will need to be recompiled after this change. make buildworld will do this automatically, but make in lib/libc++ will not necessarily work unless the new libcxxrt is installed first. PR: kern/171610, stand/175453 Reviewed by: kib MFC r246297: Add several missing symbols to libcxxrt's symbol version map, and remove a few duplicates. This should fix building world with -stdlib=libc++ after r246028. Submitted by: Yamaya Takashi Modified: stable/9/gnu/lib/libsupc++/Version.map stable/9/lib/libcxxrt/Version.map Directory Properties: stable/9/gnu/lib/libsupc++/ (props changed) stable/9/lib/libcxxrt/ (props changed) Modified: stable/9/gnu/lib/libsupc++/Version.map ============================================================================== --- stable/9/gnu/lib/libsupc++/Version.map Tue Feb 5 18:55:09 2013 (r246367) +++ stable/9/gnu/lib/libsupc++/Version.map Tue Feb 5 19:10:50 2013 (r246368) @@ -142,8 +142,37 @@ GLIBCXX_3.4 { _ZdaPvRKSt9nothrow_t; _ZdlPv; _ZdlPvRKSt9nothrow_t; + extern "C++" { + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + + std::bad_alloc; + std::bad_cast; + std::exception*; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::exception"; + }; }; +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_alloc::what() const"; + "std::bad_cast::what() const"; + "std::bad_typeid::what() const"; + }; +} GLIBCXX_3.4; + CXXABI_1.3.1 { __cxa_get_exception_ptr; Modified: stable/9/lib/libcxxrt/Version.map ============================================================================== --- stable/9/lib/libcxxrt/Version.map Tue Feb 5 18:55:09 2013 (r246367) +++ stable/9/lib/libcxxrt/Version.map Tue Feb 5 19:10:50 2013 (r246368) @@ -208,19 +208,7 @@ CXXABI_1.3 { "typeinfo name for __cxxabiv1::__vmi_class_type_info"; "std::type_info::type_info(std::type_info const&)"; - "std::type_info::type_info(std::type_info const&)"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; "std::type_info::operator=(std::type_info const&)"; - "std::unexpected()"; - "std::get_terminate()"; - "std::set_terminate(void (*)())"; - "std::get_unexpected()"; - "std::set_unexpected(void (*)())"; - "std::set_new_handler(void (*)())"; - "std::uncaught_exception()"; - "std::terminate()"; # Extensions @@ -243,69 +231,22 @@ CXXABI_1.3.1 { CXXRT_1.0 { extern "C++" { - "std::bad_cast::what() const"; - "std::bad_typeid::what() const"; - "std::bad_alloc::what() const"; - "std::exception::what() const"; "std::type_info::name() const"; "std::type_info::before(std::type_info const&) const"; "std::type_info::operator==(std::type_info const&) const"; "std::type_info::operator!=(std::type_info const&) const"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::bad_cast::bad_cast(std::bad_cast const&)"; "std::bad_cast::bad_cast()"; - "std::bad_cast::bad_cast(std::bad_cast const&)"; - "std::bad_cast::bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; "std::bad_cast::operator=(std::bad_cast const&)"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::operator=(std::bad_alloc const&)"; - "std::exception::exception(std::exception const&)"; - "std::exception::exception()"; + "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; + "std::bad_typeid::bad_typeid()"; + "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::exception::exception(std::exception const&)"; "std::exception::exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; "std::exception::operator=(std::exception const&)"; - - - "vtable for std::bad_typeid"; - "vtable for std::bad_cast"; - "vtable for std::bad_alloc"; - "vtable for std::exception"; - "vtable for std::type_info"; - "typeinfo for std::bad_typeid"; - "typeinfo for std::bad_cast"; - "typeinfo for std::bad_alloc"; - "typeinfo for std::exception"; - "typeinfo for std::type_info"; - "typeinfo name for std::bad_typeid"; - "typeinfo name for std::bad_cast"; - "typeinfo name for std::bad_alloc"; - "typeinfo name for std::exception"; - "typeinfo name for std::type_info"; - - "std::type_info::__is_function_p() const"; - "std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const"; - "std::type_info::__is_pointer_p() const"; - - + "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; + "std::bad_alloc::bad_alloc()"; + "std::bad_alloc::operator=(std::bad_alloc const&)"; }; __cxa_allocate_dependent_exception; @@ -317,6 +258,7 @@ CXXRT_1.0 { } CXXABI_1.3.1; + GLIBCXX_3.4 { extern "C++" { "operator delete[](void*)"; @@ -327,5 +269,51 @@ GLIBCXX_3.4 { "operator new[](unsigned long)"; "operator new(unsigned long)"; "operator new(unsigned long, std::nothrow_t const&)"; + + "std::unexpected()"; + "std::get_terminate()"; + "std::get_unexpected()"; + "std::uncaught_exception()"; + "std::terminate()"; + + "std::type_info::~type_info()"; + "std::bad_cast::~bad_cast()"; + "std::bad_typeid::~bad_typeid()"; + "std::exception::~exception()"; + "std::bad_alloc::~bad_alloc()"; + + "std::exception::what() const"; + + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + std::type_info::__*; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::bad_typeid"; + "vtable for std::exception"; + "vtable for std::type_info"; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_typeid"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + "typeinfo for std::type_info"; + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::bad_typeid"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + "typeinfo name for std::type_info"; + }; }; + +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_typeid::what() const"; + "std::bad_cast::what() const"; + "std::bad_alloc::what() const"; + }; +} GLIBCXX_3.4; + From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 20:03:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0202AB23; Tue, 5 Feb 2013 20:03:59 +0000 (UTC) (envelope-from andrew@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 CB33E378; Tue, 5 Feb 2013 20:03:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r15K3w9C012728; Tue, 5 Feb 2013 20:03:58 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15K3wQu012726; Tue, 5 Feb 2013 20:03:58 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302052003.r15K3wQu012726@svn.freebsd.org> From: Andrew Turner Date: Tue, 5 Feb 2013 20:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246369 - in head: lib/libstand sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 20:03:59 -0000 Author: andrew Date: Tue Feb 5 20:03:58 2013 New Revision: 246369 URL: http://svnweb.freebsd.org/changeset/base/246369 Log: * Add the integer div & mod functions and ARM EABI support functions to libstand. * Stop linking the ARM U-Boot loader against libgcc now libstand has the required symbols. Modified: head/lib/libstand/Makefile head/sys/boot/arm/uboot/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Tue Feb 5 19:10:50 2013 (r246368) +++ head/lib/libstand/Makefile Tue Feb 5 20:03:58 2013 (r246369) @@ -61,7 +61,20 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memc .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen + +.if ${MK_ARM_EABI} == "no" SRCS+= divsi3.S +.else +# Compiler support functions +.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c +SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c + +.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/ +SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S +SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S +.endif + .endif .if ${MACHINE_CPUARCH} == "ia64" .PATH: ${.CURDIR}/../libc/ia64/string Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Tue Feb 5 19:10:50 2013 (r246368) +++ head/sys/boot/arm/uboot/Makefile Tue Feb 5 20:03:58 2013 (r246369) @@ -112,8 +112,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} ${LIBGCC} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand -lgcc +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 20:08:34 2013 Return-Path: Delivered-To: svn-src-all@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 52A08CC8; Tue, 5 Feb 2013 20:08:34 +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 45228395; Tue, 5 Feb 2013 20:08: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 r15K8YYM013602; Tue, 5 Feb 2013 20:08:34 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15K8YtG013601; Tue, 5 Feb 2013 20:08:34 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302052008.r15K8YtG013601@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 5 Feb 2013 20:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246370 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 20:08:34 -0000 Author: pluknet Date: Tue Feb 5 20:08:33 2013 New Revision: 246370 URL: http://svnweb.freebsd.org/changeset/base/246370 Log: Remove reference to the rlist code from comments, and fix a typo visible in the resulted change. Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Tue Feb 5 20:03:58 2013 (r246369) +++ head/sys/kern/subr_blist.c Tue Feb 5 20:08:33 2013 (r246370) @@ -52,14 +52,10 @@ * radix tree should be able to operate well no matter how much * fragmentation there is and no matter how large a bitmap is used. * - * Unlike the rlist code, the blist code wires all necessary memory at - * creation time. Neither allocations nor frees require interaction with - * the memory subsystem. In contrast, the rlist code may allocate memory - * on an rlist_free() call. The non-blocking features of the blist code - * are used to great advantage in the swap code (vm/nswap_pager.c). The - * rlist code uses a little less overall memory than the blist code (but - * due to swap interleaving not all that much less), but the blist code - * scales much, much better. + * The blist code wires all necessary memory at creation time. Neither + * allocations nor frees require interaction with the memory subsystem. + * The non-blocking features of the blist code are used in the swap code + * (vm/swap_pager.c). * * LAYOUT: The radix tree is layed out recursively using a * linear array. Each meta node is immediately followed (layed out From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 20:26:30 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 638C56C; Tue, 5 Feb 2013 20:26:30 +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 269A4695; Tue, 5 Feb 2013 20:26:29 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 569976FBF; Tue, 5 Feb 2013 20:26:28 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 218F3AE10; Tue, 5 Feb 2013 21:26:26 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John-Mark Gurney Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <51112930.3040403@mail.lifanov.com> <86ehgu4sht.fsf@ds4.des.no> <20130205181544.GV1410@funkthat.com> Date: Tue, 05 Feb 2013 21:26:25 +0100 In-Reply-To: <20130205181544.GV1410@funkthat.com> (John-Mark Gurney's message of "Tue, 5 Feb 2013 10:15:44 -0800") Message-ID: <86zjzi33ta.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 20:26:30 -0000 John-Mark Gurney writes: > Clearly you don't run fortune -o very often, or you'd be removing a lot > more from the file... Actually, I spent about fifteen minutes this afternoon running fortune -o repeatedly and didn't come across much, except one joke which could be considered antisemitic. There was nothing that came anywhere close to Limbaugh's "the purpose of feminism is to give ugly women a place in society". If you think that's just a tasteless joke (disregarding for a moment the fact that he actually means it), try replacing "feminism" and "ugly women" with categories you fit in and epithets that might apply to you, and you'll understand why it is not acceptable. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 20:55:56 2013 Return-Path: Delivered-To: svn-src-all@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 48050894; Tue, 5 Feb 2013 20:55:56 +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 AC6057F8; Tue, 5 Feb 2013 20:55:55 +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 r15Ktm84029653; Wed, 6 Feb 2013 00:55:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r15Ktlex029652; Wed, 6 Feb 2013 00:55:47 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 6 Feb 2013 00:55:47 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130205205547.GI26896@FreeBSD.org> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <201302051158.55117.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302051158.55117.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 20:55:56 -0000 On Tue, Feb 05, 2013 at 11:58:54AM -0500, John Baldwin wrote: J> > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: J> > > > Author: des J> > > > Date: Tue Feb 5 14:39:37 2013 J> > > > New Revision: 246362 J> > > > URL: http://svnweb.freebsd.org/changeset/base/246362 J> > > > J> > > > Log: J> > > > Remove political propaganda J> > > > J> > > > Modified: J> > > > head/games/fortune/datfiles/fortunes-o.real J> > > J> > > *sigh* J> > > J> > > I'm sure there are other quotes that people who do not share your political J> > > persuasion might find propaganda or offensive, etc. Censorship and freedom J> > > of speech is quite a sticky widget, and I think the only truly sane policy J> > > is that fortune files are append-only (unless we outright remove them and J> > > that seems excessive). And new things should have a very high bar to be J> > > added to fortune. Perhaps we should move fortunes-o to ports entirely? J> > > J> > J> > I am more concerned about the insta-MFC than the removal per se. J> > Only security or legal issues are cause to go under 3 days, was my J> > impression. J> J> Yes, the insta-MFC is also not appropriate, esp. for something that you know J> is going to raise eyebrows when it is committed. Having to debate this sort J> of thing in public on mailing lists is also distinctly unhelpful and very J> distracting from productive work. Also, I'd like to preemptively ask J> developers to refrain from any further commits to the fortunes datfiles for J> the time being as the last thing we need is a commit war over this sort of J> thing. What about just moving the entire games subdirectory to ports repo? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 21:17:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D75AC34; Tue, 5 Feb 2013 21:17:45 +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 CD11E8AF; Tue, 5 Feb 2013 21:17:44 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 44915B91E; Tue, 5 Feb 2013 16:17:44 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Date: Tue, 5 Feb 2013 16:17:25 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> In-Reply-To: <20130205205547.GI26896@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201302051617.25454.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Feb 2013 16:17:44 -0500 (EST) Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 21:17:45 -0000 On Tuesday, February 05, 2013 3:55:47 pm Gleb Smirnoff wrote: > On Tue, Feb 05, 2013 at 11:58:54AM -0500, John Baldwin wrote: > J> > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > J> > > > Author: des > J> > > > Date: Tue Feb 5 14:39:37 2013 > J> > > > New Revision: 246362 > J> > > > URL: http://svnweb.freebsd.org/changeset/base/246362 > J> > > > > J> > > > Log: > J> > > > Remove political propaganda > J> > > > > J> > > > Modified: > J> > > > head/games/fortune/datfiles/fortunes-o.real > J> > > > J> > > *sigh* > J> > > > J> > > I'm sure there are other quotes that people who do not share your political > J> > > persuasion might find propaganda or offensive, etc. Censorship and freedom > J> > > of speech is quite a sticky widget, and I think the only truly sane policy > J> > > is that fortune files are append-only (unless we outright remove them and > J> > > that seems excessive). And new things should have a very high bar to be > J> > > added to fortune. Perhaps we should move fortunes-o to ports entirely? > J> > > > J> > > J> > I am more concerned about the insta-MFC than the removal per se. > J> > Only security or legal issues are cause to go under 3 days, was my > J> > impression. > J> > J> Yes, the insta-MFC is also not appropriate, esp. for something that you know > J> is going to raise eyebrows when it is committed. Having to debate this sort > J> of thing in public on mailing lists is also distinctly unhelpful and very > J> distracting from productive work. Also, I'd like to preemptively ask > J> developers to refrain from any further commits to the fortunes datfiles for > J> the time being as the last thing we need is a commit war over this sort of > J> thing. > > What about just moving the entire games subdirectory to ports repo? We've already moved most of it many years ago. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 5 22:54:10 2013 Return-Path: Delivered-To: svn-src-all@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 8D4004E1; Tue, 5 Feb 2013 22:54:10 +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 75949DB2; Tue, 5 Feb 2013 22:54: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 r15MsAgP070334; Tue, 5 Feb 2013 22:54:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15MsACE070333; Tue, 5 Feb 2013 22:54:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302052254.r15MsACE070333@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 5 Feb 2013 22:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246371 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 22:54:10 -0000 Author: jilles Date: Tue Feb 5 22:54:09 2013 New Revision: 246371 URL: http://svnweb.freebsd.org/changeset/base/246371 Log: sh: Do not test for digit_contig in mksyntax. ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters 0123456789 are contiguous. The generated syntax.c and syntax.h remain the same. Submitted by: Christoph Mallon Modified: head/bin/sh/mksyntax.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Tue Feb 5 20:08:33 2013 (r246370) +++ head/bin/sh/mksyntax.c Tue Feb 5 22:54:09 2013 (r246371) @@ -107,14 +107,12 @@ static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ -static int digit_contig;/* true if digits are contiguous */ static void filltable(const char *); static void init(void); static void add(const char *, const char *); static void print(const char *); static void output_type_macros(void); -static void digit_convert(void); int main(int argc __unused, char **argv __unused) @@ -125,7 +123,6 @@ main(int argc __unused, char **argv __un int i; char buf[80]; int pos; - static char digit[] = "0123456789"; /* Create output files */ if ((cfile = fopen("syntax.c", "w")) == NULL) { @@ -158,11 +155,6 @@ main(int argc __unused, char **argv __un base = 1; if (sign) base += 1 << (nbits - 1); - digit_contig = 1; - for (i = 0 ; i < 10 ; i++) { - if (digit[i] != '0' + i) - digit_contig = 0; - } fputs("#include \n", hfile); @@ -248,8 +240,6 @@ main(int argc __unused, char **argv __un add("_", "ISUNDER"); add("#?$!-*@", "ISSPECL"); print("is_type"); - if (! digit_contig) - digit_convert(); exit(0); } @@ -341,12 +331,13 @@ print(const char *name) */ static const char *macro[] = { - "#define is_digit(c)\t((is_type+SYNBASE)[(int)c] & ISDIGIT)", + "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t((is_type+SYNBASE)[(int)c] & (ISUPPER|ISLOWER))", "#define is_name(c)\t((is_type+SYNBASE)[(int)c] & (ISUPPER|ISLOWER|ISUNDER))", "#define is_in_name(c)\t((is_type+SYNBASE)[(int)c] & (ISUPPER|ISLOWER|ISUNDER|ISDIGIT))", "#define is_special(c)\t((is_type+SYNBASE)[(int)c] & (ISSPECL|ISDIGIT))", + "#define digit_val(c)\t((c) - '0')", NULL }; @@ -355,41 +346,6 @@ output_type_macros(void) { const char **pp; - if (digit_contig) - macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; for (pp = macro ; *pp ; pp++) fprintf(hfile, "%s\n", *pp); - if (digit_contig) - fputs("#define digit_val(c)\t((c) - '0')\n", hfile); - else - fputs("#define digit_val(c)\t(digit_value[c])\n", hfile); -} - - - -/* - * Output digit conversion table (if digits are not contiguous). - */ - -static void -digit_convert(void) -{ - int maxdigit; - static char digit[] = "0123456789"; - char *p; - int i; - - maxdigit = 0; - for (p = digit ; *p ; p++) - if (*p > maxdigit) - maxdigit = *p; - fputs("extern const char digit_value[];\n", hfile); - fputs("\n\nconst char digit_value[] = {\n", cfile); - for (i = 0 ; i <= maxdigit ; i++) { - for (p = digit ; *p && *p != i ; p++); - if (*p == '\0') - p = digit; - fprintf(cfile, " %d,\n", (int)(p - digit)); - } - fputs("};\n", cfile); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 00:01:29 2013 Return-Path: Delivered-To: svn-src-all@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 788E0F75; Wed, 6 Feb 2013 00:01:29 +0000 (UTC) (envelope-from andrew@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 6678FFD6; Wed, 6 Feb 2013 00:01: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 r1601SjV090852; Wed, 6 Feb 2013 00:01:28 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1601Sfx090851; Wed, 6 Feb 2013 00:01:28 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201302060001.r1601Sfx090851@svn.freebsd.org> From: Andrew Turner Date: Wed, 6 Feb 2013 00:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246372 - head/lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 00:01:29 -0000 Author: andrew Date: Wed Feb 6 00:01:28 2013 New Revision: 246372 URL: http://svnweb.freebsd.org/changeset/base/246372 Log: Add the __aeabi_mem* functions to compiler-rt as clang uses them. Modified: head/lib/libcompiler_rt/Makefile Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Tue Feb 5 22:54:09 2013 (r246371) +++ head/lib/libcompiler_rt/Makefile Wed Feb 6 00:01:28 2013 (r246372) @@ -188,6 +188,10 @@ SRCS+= ${file}.c .if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ + aeabi_memcmp.S \ + aeabi_memcpy.S \ + aeabi_memmove.S \ + aeabi_memset.S \ aeabi_uidivmod.S \ aeabi_uldivmod.S .endif From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 00:42:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6D6D5E8; Wed, 6 Feb 2013 00:42:24 +0000 (UTC) (envelope-from delphij@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 A47C619A; Wed, 6 Feb 2013 00:42: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 r160gOaI003271; Wed, 6 Feb 2013 00:42:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r160gN3x003262; Wed, 6 Feb 2013 00:42:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302060042.r160gN3x003262@svn.freebsd.org> From: Xin LI Date: Wed, 6 Feb 2013 00:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246373 - stable/9/contrib/one-true-awk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 00:42:24 -0000 Author: delphij Date: Wed Feb 6 00:42:23 2013 New Revision: 246373 URL: http://svnweb.freebsd.org/changeset/base/246373 Log: MFC: one-true-awk 20121220. Modified: stable/9/contrib/one-true-awk/FIXES stable/9/contrib/one-true-awk/main.c stable/9/contrib/one-true-awk/makefile stable/9/contrib/one-true-awk/proto.h stable/9/contrib/one-true-awk/run.c stable/9/contrib/one-true-awk/tran.c Directory Properties: stable/9/contrib/one-true-awk/ (props changed) Modified: stable/9/contrib/one-true-awk/FIXES ============================================================================== --- stable/9/contrib/one-true-awk/FIXES Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/FIXES Wed Feb 6 00:42:23 2013 (r246373) @@ -25,6 +25,22 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Dec 20, 2012: + fiddled makefile to get correct yacc and bison flags. pick yacc + (linux) or bison (mac) as necessary. + + added __attribute__((__noreturn__)) to a couple of lines in + proto.h, to silence someone's enthusiastic checker. + + fixed obscure call by value bug in split(a[1],a) reported on + 9fans. the management of temporary values is just a mess; i + took a shortcut by making an extra string copy. thanks + to paul patience and arnold robbins for passing it on and for + proposed patches. + + tiny fiddle in setfval to eliminate -0 results in T.expr, which + has irritated me for 20+ years. + Aug 10, 2011: another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Modified: stable/9/contrib/one-true-awk/main.c ============================================================================== --- stable/9/contrib/one-true-awk/main.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/main.c Wed Feb 6 00:42:23 2013 (r246373) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110810 (FreeBSD)"; +const char *version = "version 20121220 (FreeBSD)"; #define DEBUG #include Modified: stable/9/contrib/one-true-awk/makefile ============================================================================== --- stable/9/contrib/one-true-awk/makefile Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/makefile Wed Feb 6 00:42:23 2013 (r246373) @@ -26,15 +26,15 @@ CFLAGS = -g CFLAGS = -O2 CFLAGS = -CC = gcc -Wall -g -CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing -YACC = bison -y -YACC = yacc -YFLAGS = -d +YACC = bison -d -y +YACC = yacc -d -S +#YFLAGS = -d -S + # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o Modified: stable/9/contrib/one-true-awk/proto.h ============================================================================== --- stable/9/contrib/one-true-awk/proto.h Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/proto.h Wed Feb 6 00:42:23 2013 (r246373) @@ -46,7 +46,7 @@ extern void freetr(Node *); extern int hexstr(uschar **); extern int quoted(uschar **); extern char *cclenter(const char *); -extern void overflo(const char *); +extern void overflo(const char *) __attribute__((__noreturn__)); extern void cfoll(fa *, Node *); extern int first(Node *); extern void follow(Node *); @@ -132,7 +132,7 @@ extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...); +extern void FATAL(const char *, ...) __attribute__((__noreturn__)); extern void WARNING(const char *, ...); extern void error(void); extern void eprint(void); Modified: stable/9/contrib/one-true-awk/run.c ============================================================================== --- stable/9/contrib/one-true-awk/run.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/run.c Wed Feb 6 00:42:23 2013 (r246373) @@ -1213,13 +1213,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1339,6 +1339,7 @@ Cell *split(Node **a, int nnn) /* split( } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } Modified: stable/9/contrib/one-true-awk/tran.c ============================================================================== --- stable/9/contrib/one-true-awk/tran.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/tran.c Wed Feb 6 00:42:23 2013 (r246373) @@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ + if (f == -0) /* who would have thought this possible? */ + f = 0; dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 00:43:12 2013 Return-Path: Delivered-To: svn-src-all@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 0CF3C75E; Wed, 6 Feb 2013 00:43:12 +0000 (UTC) (envelope-from delphij@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 D89921A7; Wed, 6 Feb 2013 00:43: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 r160hBR7003425; Wed, 6 Feb 2013 00:43:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r160hAJZ003418; Wed, 6 Feb 2013 00:43:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302060043.r160hAJZ003418@svn.freebsd.org> From: Xin LI Date: Wed, 6 Feb 2013 00:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246374 - stable/8/contrib/one-true-awk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 00:43:12 -0000 Author: delphij Date: Wed Feb 6 00:43:10 2013 New Revision: 246374 URL: http://svnweb.freebsd.org/changeset/base/246374 Log: MFC: one-true-awk 20121220. Modified: stable/8/contrib/one-true-awk/FIXES stable/8/contrib/one-true-awk/main.c stable/8/contrib/one-true-awk/makefile stable/8/contrib/one-true-awk/proto.h stable/8/contrib/one-true-awk/run.c stable/8/contrib/one-true-awk/tran.c Directory Properties: stable/8/contrib/one-true-awk/ (props changed) Modified: stable/8/contrib/one-true-awk/FIXES ============================================================================== --- stable/8/contrib/one-true-awk/FIXES Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/FIXES Wed Feb 6 00:43:10 2013 (r246374) @@ -25,6 +25,22 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Dec 20, 2012: + fiddled makefile to get correct yacc and bison flags. pick yacc + (linux) or bison (mac) as necessary. + + added __attribute__((__noreturn__)) to a couple of lines in + proto.h, to silence someone's enthusiastic checker. + + fixed obscure call by value bug in split(a[1],a) reported on + 9fans. the management of temporary values is just a mess; i + took a shortcut by making an extra string copy. thanks + to paul patience and arnold robbins for passing it on and for + proposed patches. + + tiny fiddle in setfval to eliminate -0 results in T.expr, which + has irritated me for 20+ years. + Aug 10, 2011: another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Modified: stable/8/contrib/one-true-awk/main.c ============================================================================== --- stable/8/contrib/one-true-awk/main.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/main.c Wed Feb 6 00:43:10 2013 (r246374) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110810 (FreeBSD)"; +const char *version = "version 20121220 (FreeBSD)"; #define DEBUG #include Modified: stable/8/contrib/one-true-awk/makefile ============================================================================== --- stable/8/contrib/one-true-awk/makefile Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/makefile Wed Feb 6 00:43:10 2013 (r246374) @@ -26,15 +26,15 @@ CFLAGS = -g CFLAGS = -O2 CFLAGS = -CC = gcc -Wall -g -CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing -YACC = bison -y -YACC = yacc -YFLAGS = -d +YACC = bison -d -y +YACC = yacc -d -S +#YFLAGS = -d -S + # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o Modified: stable/8/contrib/one-true-awk/proto.h ============================================================================== --- stable/8/contrib/one-true-awk/proto.h Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/proto.h Wed Feb 6 00:43:10 2013 (r246374) @@ -46,7 +46,7 @@ extern void freetr(Node *); extern int hexstr(uschar **); extern int quoted(uschar **); extern char *cclenter(const char *); -extern void overflo(const char *); +extern void overflo(const char *) __attribute__((__noreturn__)); extern void cfoll(fa *, Node *); extern int first(Node *); extern void follow(Node *); @@ -132,7 +132,7 @@ extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...); +extern void FATAL(const char *, ...) __attribute__((__noreturn__)); extern void WARNING(const char *, ...); extern void error(void); extern void eprint(void); Modified: stable/8/contrib/one-true-awk/run.c ============================================================================== --- stable/8/contrib/one-true-awk/run.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/run.c Wed Feb 6 00:43:10 2013 (r246374) @@ -1213,13 +1213,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1339,6 +1339,7 @@ Cell *split(Node **a, int nnn) /* split( } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } Modified: stable/8/contrib/one-true-awk/tran.c ============================================================================== --- stable/8/contrib/one-true-awk/tran.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/tran.c Wed Feb 6 00:43:10 2013 (r246374) @@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ + if (f == -0) /* who would have thought this possible? */ + f = 0; dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 01:03:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B932A02; Wed, 6 Feb 2013 01:03:14 +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 014EF227; Wed, 6 Feb 2013 01:03: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 r1613Dmt009458; Wed, 6 Feb 2013 01:03:13 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1613DRB009456; Wed, 6 Feb 2013 01:03:13 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201302060103.r1613DRB009456@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Wed, 6 Feb 2013 01:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246375 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 01:03:14 -0000 Author: ganbold (doc committer) Date: Wed Feb 6 01:03:13 2013 New Revision: 246375 URL: http://svnweb.freebsd.org/changeset/base/246375 Log: Use and set gpio pin to high to power up usb. Approved by: gonzo@ Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Wed Feb 6 00:43:10 2013 (r246374) +++ head/sys/arm/allwinner/a10_ehci.c Wed Feb 6 01:03:13 2013 (r246375) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -58,6 +59,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gpio_if.h" + #include "a10_clk.h" #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" @@ -70,8 +73,9 @@ __FBSDID("$FreeBSD$"); #define SW_ULPI_BYPASS (1 << 0) #define SW_AHB_INCRX_ALIGN (1 << 8) -#define SW_AHB_INCR4 (1 << 9) +#define SW_AHB_INCR4 (1 << 9) #define SW_AHB_INCR8 (1 << 10) +#define GPIO_USB2_PWR 227 #define A10_READ_4(sc, reg) \ bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) @@ -101,6 +105,7 @@ a10_ehci_attach(device_t self) { ehci_softc_t *sc = device_get_softc(self); bus_space_handle_t bsh; + device_t sc_gpio_dev; int err; int rid; uint32_t reg_value = 0; @@ -153,6 +158,13 @@ a10_ehci_attach(device_t self) sprintf(sc->sc_vendor, "Allwinner"); + /* Get the GPIO device, we need this to give power to USB */ + sc_gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (sc_gpio_dev == NULL) { + device_printf(self, "Error: failed to get the GPIO device\n"); + goto error; + } + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); if (err) { @@ -166,6 +178,10 @@ a10_ehci_attach(device_t self) /* Enable clock for USB */ a10_clk_usb_activate(); + /* Give power to USB */ + GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_OUTPUT); + GPIO_PIN_SET(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_HIGH); + /* Enable passby */ reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); reg_value |= SW_AHB_INCR8; /* AHB INCR8 enable */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 02:18:30 2013 Return-Path: Delivered-To: svn-src-all@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 6F4EEA4E; Wed, 6 Feb 2013 02:18:30 +0000 (UTC) (envelope-from grog@lemis.com) Received: from w3.lemis.com (w3.lemis.com [208.86.224.149]) by mx1.freebsd.org (Postfix) with ESMTP id 47B27714; Wed, 6 Feb 2013 02:18:29 +0000 (UTC) Received: from eureka.lemis.com (1032.x.rootbsd.net [208.86.224.149]) by w3.lemis.com (Postfix) with ESMTP id 4A0253B74B; Wed, 6 Feb 2013 02:18:22 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 810D7F74FA; Wed, 6 Feb 2013 13:18:18 +1100 (EST) Date: Wed, 6 Feb 2013 13:18:18 +1100 From: Greg 'groggy' Lehey To: John Baldwin Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130206021818.GB2899@eureka.lemis.com> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline In-Reply-To: <201302051145.40104.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Organization: The FreeBSD Project Phone: +61-3-5346-1370 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 02:18:30 -0000 --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 5 February 2013 at 11:45:40 -0500, John Baldwin wrote: > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: >> Author: des >> Date: Tue Feb 5 14:39:37 2013 >> New Revision: 246362 >> URL: http://svnweb.freebsd.org/changeset/base/246362 >> >> Log: >> Remove political propaganda >> >> Modified: >> head/games/fortune/datfiles/fortunes-o.real > > *sigh* > > I'm sure there are other quotes that people who do not share your > political persuasion might find propaganda or offensive, etc. > Censorship and freedom of speech is quite a sticky widget, and I > think the only truly sane policy is that fortune files are > append-only (unless we outright remove them and that seems > excessive). And new things should have a very high bar to be added > to fortune. Perhaps we should move fortunes-o to ports entirely? Agreed, it shouldn't be up to individuals to decide which fortunes are *too* offensive. In this case, I suspect that there's a distinct difference between the perceptions of people inside and outside the USA. I also find Limbaugh particularly hard to stomach, but I don't think it should have been removed. The real issue I see is that, for whatever reason, the Limbaugh fortunes pop up far too frequently. It's as if the random number generation is failing. Comments? Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft MUA reports problems, please read http://tinyurl.com/broken-mua --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlERvWkACgkQIubykFB6QiOi/gCgnFml35BZJoETJAQgHtOAc0Pm py8An2ZjouDNjsWwkf4DoJR8Pu9Czky9 =3RaQ -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 02:51:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97475E67; Wed, 6 Feb 2013 02:51:26 +0000 (UTC) (envelope-from pfg@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 71B7D7E1; Wed, 6 Feb 2013 02:51: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 r162pQSI042069; Wed, 6 Feb 2013 02:51:26 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r162pQVQ042067; Wed, 6 Feb 2013 02:51:26 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302060251.r162pQVQ042067@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 6 Feb 2013 02:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246376 - stable/9/sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 02:51:26 -0000 Author: pfg Date: Wed Feb 6 02:51:25 2013 New Revision: 246376 URL: http://svnweb.freebsd.org/changeset/base/246376 Log: MFC r246299; UFS: Remove dead assignment. PR: kern/175794 Submitted by: Christoph Mallon Modified: stable/9/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 01:03:13 2013 (r246375) +++ stable/9/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 02:51:25 2013 (r246376) @@ -1432,7 +1432,6 @@ ufs_checkpath(ino_t source_ino, ino_t pa return (0); if (target->i_number == ROOTINO) return (0); - error = 0; for (;;) { error = ufs_dir_dd_ino(vp, cred, &dd_ino); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 03:00:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5477186; Wed, 6 Feb 2013 03:00:18 +0000 (UTC) (envelope-from pfg@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 D7D9282D; Wed, 6 Feb 2013 03:00: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 r1630Iq5043401; Wed, 6 Feb 2013 03:00:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1630Ir7043400; Wed, 6 Feb 2013 03:00:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302060300.r1630Ir7043400@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 6 Feb 2013 03:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246377 - stable/8/sys/ufs/ufs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 03:00:19 -0000 Author: pfg Date: Wed Feb 6 03:00:18 2013 New Revision: 246377 URL: http://svnweb.freebsd.org/changeset/base/246377 Log: MFC r246299; UFS: Remove dead assignment. PR: kern/175794 Submitted by: Christoph Mallon Modified: stable/8/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 02:51:25 2013 (r246376) +++ stable/8/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 03:00:18 2013 (r246377) @@ -1415,7 +1415,6 @@ ufs_checkpath(ino_t source_ino, ino_t pa return (0); if (target->i_number == ROOTINO) return (0); - error = 0; for (;;) { error = ufs_dir_dd_ino(vp, cred, &dd_ino); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 04:53:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BFB489E4; Wed, 6 Feb 2013 04:53:01 +0000 (UTC) (envelope-from neel@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 B0C39CE6; Wed, 6 Feb 2013 04:53:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r164r1dT078564; Wed, 6 Feb 2013 04:53:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r164r1kX078552; Wed, 6 Feb 2013 04:53:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302060453.r164r1kX078552@svn.freebsd.org> From: Neel Natu Date: Wed, 6 Feb 2013 04:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246384 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 04:53:01 -0000 Author: neel Date: Wed Feb 6 04:53:00 2013 New Revision: 246384 URL: http://svnweb.freebsd.org/changeset/base/246384 Log: Compute the number of initial kernel page table pages (NKPT) dynamically. This eliminates the need to recompile the kernel when the default value of NKPT is not big enough - for e.g. when loading large kernel modules or memory disk images from the loader. If NKPT is defined in the kernel configuration file then it overrides the dynamic calculation. Reviewed by: alc, kib Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Wed Feb 6 04:40:02 2013 (r246383) +++ head/sys/amd64/amd64/minidump_machdep.c Wed Feb 6 04:53:00 2013 (r246384) @@ -232,7 +232,7 @@ minidumpsys(struct dumperinfo *di) /* Walk page table pages, set bits in vm_page_dump */ pmapsize = 0; pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); - for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, + for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, kernel_vm_end); ) { /* * We always write a page, even if it is zero. Each @@ -364,7 +364,7 @@ minidumpsys(struct dumperinfo *di) /* Dump kernel page directory pages */ bzero(fakepd, sizeof(fakepd)); pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); - for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, + for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, kernel_vm_end); va += NBPDP) { i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Feb 6 04:40:02 2013 (r246383) +++ head/sys/amd64/amd64/pmap.c Wed Feb 6 04:53:00 2013 (r246384) @@ -202,6 +202,10 @@ struct pmap kernel_pmap_store; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ +int nkpt; +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, + "Number of kernel page table pages allocated on bootup"); + static int ndmpdp; static vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; @@ -495,17 +499,42 @@ allocpages(vm_paddr_t *firstaddr, int n) CTASSERT(powerof2(NDMPML4E)); +/* number of kernel PDP slots */ +#define NKPDPE(ptpgs) howmany((ptpgs), NPDEPG) + static void -create_pagetables(vm_paddr_t *firstaddr) +nkpt_init(vm_paddr_t addr) { - int i, j, ndm1g; + int pt_pages; + +#ifdef NKPT + pt_pages = NKPT; +#else + pt_pages = howmany(addr, 1 << PDRSHIFT); + pt_pages += NKPDPE(pt_pages); - /* Allocate pages */ - KPTphys = allocpages(firstaddr, NKPT); - KPML4phys = allocpages(firstaddr, 1); - KPDPphys = allocpages(firstaddr, NKPML4E); - KPDphys = allocpages(firstaddr, NKPDPE); + /* + * Add some slop beyond the bare minimum required for bootstrapping + * the kernel. + * + * This is quite important when allocating KVA for kernel modules. + * The modules are required to be linked in the negative 2GB of + * the address space. If we run out of KVA in this region then + * pmap_growkernel() will need to allocate page table pages to map + * the entire 512GB of KVA space which is an unnecessary tax on + * physical memory. + */ + pt_pages += 8; /* 16MB additional slop for kernel modules */ +#endif + nkpt = pt_pages; +} +static void +create_pagetables(vm_paddr_t *firstaddr) +{ + int i, j, ndm1g, nkpdpe; + + /* Allocate page table pages for the direct map */ ndmpdp = (ptoa(Maxmem) + NBPDP - 1) >> PDPSHIFT; if (ndmpdp < 4) /* Minimum 4GB of dirmap */ ndmpdp = 4; @@ -517,6 +546,22 @@ create_pagetables(vm_paddr_t *firstaddr) DMPDphys = allocpages(firstaddr, ndmpdp - ndm1g); dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT; + /* Allocate pages */ + KPML4phys = allocpages(firstaddr, 1); + KPDPphys = allocpages(firstaddr, NKPML4E); + + /* + * Allocate the initial number of kernel page table pages required to + * bootstrap. We defer this until after all memory-size dependent + * allocations are done (e.g. direct map), so that we don't have to + * build in too much slop in our estimate. + */ + nkpt_init(*firstaddr); + nkpdpe = NKPDPE(nkpt); + + KPTphys = allocpages(firstaddr, nkpt); + KPDphys = allocpages(firstaddr, nkpdpe); + /* Fill in the underlying page table pages */ /* Read-only from zero to physfree */ /* XXX not fully used, underneath 2M pages */ @@ -526,7 +571,7 @@ create_pagetables(vm_paddr_t *firstaddr) } /* Now map the page tables at their location within PTmap */ - for (i = 0; i < NKPT; i++) { + for (i = 0; i < nkpt; i++) { ((pd_entry_t *)KPDphys)[i] = KPTphys + (i << PAGE_SHIFT); ((pd_entry_t *)KPDphys)[i] |= PG_RW | PG_V; } @@ -539,7 +584,7 @@ create_pagetables(vm_paddr_t *firstaddr) } /* And connect up the PD to the PDP */ - for (i = 0; i < NKPDPE; i++) { + for (i = 0; i < nkpdpe; i++) { ((pdp_entry_t *)KPDPphys)[i + KPDPI] = KPDphys + (i << PAGE_SHIFT); ((pdp_entry_t *)KPDPphys)[i + KPDPI] |= PG_RW | PG_V | PG_U; @@ -768,7 +813,7 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - for (i = 0; i < NKPT; i++) { + for (i = 0; i < nkpt; i++) { mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], @@ -1995,7 +2040,7 @@ pmap_growkernel(vm_offset_t addr) * any new kernel page table pages between "kernel_vm_end" and * "KERNBASE". */ - if (KERNBASE < addr && addr <= KERNBASE + NKPT * NBPDR) + if (KERNBASE < addr && addr <= KERNBASE + nkpt * NBPDR) return; addr = roundup2(addr, NBPDR); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Feb 6 04:40:02 2013 (r246383) +++ head/sys/amd64/include/pmap.h Wed Feb 6 04:53:00 2013 (r246384) @@ -113,13 +113,7 @@ ((unsigned long)(l2) << PDRSHIFT) | \ ((unsigned long)(l1) << PAGE_SHIFT)) -/* Initial number of kernel page tables. */ -#ifndef NKPT -#define NKPT 32 -#endif - #define NKPML4E 1 /* number of kernel PML4 slots */ -#define NKPDPE howmany(NKPT, NPDEPG)/* number of kernel PDP slots */ #define NUPML4E (NPML4EPG/2) /* number of userland PML4 pages */ #define NUPDPE (NUPML4E*NPDPEPG)/* number of userland PDP pages */ @@ -181,6 +175,7 @@ typedef u_int64_t pml4_entry_t; #define PML4map ((pd_entry_t *)(addr_PML4map)) #define PML4pml4e ((pd_entry_t *)(addr_PML4pml4e)) +extern int nkpt; /* Initial number of kernel page tables */ extern u_int64_t KPDPphys; /* physical address of kernel level 3 */ extern u_int64_t KPML4phys; /* physical address of kernel level 4 */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 06:44:43 2013 Return-Path: Delivered-To: svn-src-all@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 2AF68CF9; Wed, 6 Feb 2013 06:44:43 +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 1E177EA; Wed, 6 Feb 2013 06:44: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 r166igLo011340; Wed, 6 Feb 2013 06:44:42 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r166igaM011339; Wed, 6 Feb 2013 06:44:42 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302060644.r166igaM011339@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 6 Feb 2013 06:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246385 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 06:44:43 -0000 Author: np Date: Wed Feb 6 06:44:42 2013 New Revision: 246385 URL: http://svnweb.freebsd.org/changeset/base/246385 Log: Busy-wait when cold. Reported by: gnn, jhb MFC after: 3 days Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Feb 6 04:53:00 2013 (r246384) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Feb 6 06:44:42 2013 (r246385) @@ -35,7 +35,12 @@ __FBSDID("$FreeBSD$"); #include "firmware/t4fw_interface.h" #undef msleep -#define msleep(x) pause("t4hw", (x) * hz / 1000) +#define msleep(x) do { \ + if (cold) \ + DELAY((x) * 1000); \ + else \ + pause("t4hw", (x) * hz / 1000); \ +} while (0) /** * t4_wait_op_done_val - wait until an operation is completed From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:18:10 2013 Return-Path: Delivered-To: svn-src-all@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 1897765B; Wed, 6 Feb 2013 07:18:10 +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 7092422D; Wed, 6 Feb 2013 07:18:08 +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 r167I7s0032141; Wed, 6 Feb 2013 11:18:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r167I7DQ032140; Wed, 6 Feb 2013 11:18:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 6 Feb 2013 11:18:07 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130206071807.GN26896@FreeBSD.org> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> <201302051617.25454.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302051617.25454.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:18:10 -0000 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. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:20:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EB976813; Wed, 6 Feb 2013 07:20:09 +0000 (UTC) (envelope-from hrs@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 DE79D246; Wed, 6 Feb 2013 07:20: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 r167K9um021334; Wed, 6 Feb 2013 07:20:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167K9jE021333; Wed, 6 Feb 2013 07:20:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201302060720.r167K9jE021333@svn.freebsd.org> From: Hiroki Sato Date: Wed, 6 Feb 2013 07:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246386 - stable/9/sys/ia64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:20:10 -0000 Author: hrs Date: Wed Feb 6 07:20:09 2013 New Revision: 246386 URL: http://svnweb.freebsd.org/changeset/base/246386 Log: MFC: Remove firewire devices missed in r244992. Modified: stable/9/sys/ia64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Wed Feb 6 06:44:42 2013 (r246385) +++ stable/9/sys/ia64/conf/GENERIC Wed Feb 6 07:20:09 2013 (r246386) @@ -167,11 +167,6 @@ device uslcom # SI Labs CP2101/CP2102 device uvisor # Visor and Palm devices device uvscom # USB serial support for DDI pocket's PHS -# FireWire support -device fwip # IP over FireWire (RFC 2734,3146) -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (need scbus & da) - # Various (pseudo) devices device ether # Ethernet support device faith # IPv6-to-IPv4 relaying (translation) From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:27:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66B16AEF; Wed, 6 Feb 2013 07:27:26 +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 414D1293; Wed, 6 Feb 2013 07:27: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 r167RQp9023873; Wed, 6 Feb 2013 07:27:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167RQqS023872; Wed, 6 Feb 2013 07:27:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201302060727.r167RQqS023872@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 6 Feb 2013 07:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246387 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:27:26 -0000 Author: glebius Date: Wed Feb 6 07:27:25 2013 New Revision: 246387 URL: http://svnweb.freebsd.org/changeset/base/246387 Log: Fixes to QUEUE_MACRO_DEBUG support: - Add const quilifiers to fields that store value of __FILE__. - Use long type for fields that store value of __LINE__. - Sort and style(9) debugging fields. - Add initializer for debugging fields into TAILQ_INITIALIZER macro. PR: 175759 Submitted by: Andrey Simonenko Reviewed by: bde Modified: head/sys/sys/queue.h Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Wed Feb 6 07:20:09 2013 (r246386) +++ head/sys/sys/queue.h Wed Feb 6 07:27:25 2013 (r246387) @@ -105,13 +105,14 @@ #ifdef QUEUE_MACRO_DEBUG /* Store the last 2 places the queue element or head was altered */ struct qm_trace { - char * lastfile; - int lastline; - char * prevfile; - int prevline; + unsigned long lastline; + unsigned long prevline; + const char *lastfile; + const char *prevfile; }; #define TRACEBUF struct qm_trace trace; +#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } , #define TRASHIT(x) do {(x) = (void *)-1;} while (0) #define QMD_SAVELINK(name, link) void **name = (void *)&(link) @@ -134,6 +135,7 @@ struct qm_trace { #define QMD_TRACE_HEAD(head) #define QMD_SAVELINK(name, link) #define TRACEBUF +#define TRACEBUF_INITIALIZER #define TRASHIT(x) #endif /* QUEUE_MACRO_DEBUG */ @@ -461,7 +463,7 @@ struct name { \ } #define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } + { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } #define TAILQ_ENTRY(type) \ struct { \ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:42:08 2013 Return-Path: Delivered-To: svn-src-all@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 1CDF4FE1; Wed, 6 Feb 2013 07:42:08 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id A150F33B; Wed, 6 Feb 2013 07:42:07 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 1F373E3F07B; Wed, 6 Feb 2013 08:42:06 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0husBVdGyKDF; Wed, 6 Feb 2013 08:42:03 +0100 (CET) Received: from jd.benders.se (jd.benders.se [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 75A3BE3F079; Wed, 6 Feb 2013 08:42:03 +0100 (CET) Date: Wed, 6 Feb 2013 08:42:01 +0100 From: Joel Dahl To: Gleb Smirnoff Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130206074201.GG21730@jd.benders.se> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> <201302051617.25454.jhb@freebsd.org> <20130206071807.GN26896@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130206071807.GN26896@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Benjamin Kaduk , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:42:08 -0000 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. -- Joel From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:54:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6BB055DF; Wed, 6 Feb 2013 07:54:47 +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 434953DB; Wed, 6 Feb 2013 07:54: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 r167slZ2032565; Wed, 6 Feb 2013 07:54:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167skjQ032562; Wed, 6 Feb 2013 07:54:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060754.r167skjQ032562@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 07:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246388 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:54:47 -0000 Author: mm Date: Wed Feb 6 07:54:46 2013 New Revision: 246388 URL: http://svnweb.freebsd.org/changeset/base/246388 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13934:9e23a7f7b812 Illumos ZFS issues: 3422 zpool create/syseventd race yield non-importable pool 3425 first write to a new zvol can fail with EFBIG Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Wed Feb 6 07:27:25 2013 (r246387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Wed Feb 6 07:54:46 2013 (r246388) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -284,6 +284,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u delta = P2NPHASE(off, dn->dn_datablksz); } + min_ibs = max_ibs = dn->dn_indblkshift; if (dn->dn_maxblkid > 0) { /* * The blocksize can't change, @@ -291,13 +292,6 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u */ ASSERT(dn->dn_datablkshift != 0); min_bs = max_bs = dn->dn_datablkshift; - min_ibs = max_ibs = dn->dn_indblkshift; - } else if (dn->dn_indblkshift > max_ibs) { - /* - * This ensures that if we reduce DN_MAX_INDBLKSHIFT, - * the code will still work correctly on older pools. - */ - min_ibs = max_ibs = dn->dn_indblkshift; } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Wed Feb 6 07:27:25 2013 (r246387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Wed Feb 6 07:54:46 2013 (r246388) @@ -1327,7 +1327,8 @@ vdev_validate(vdev_t *vd, boolean_t stri if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { uint64_t aux_guid = 0; nvlist_t *nvl; - uint64_t txg = strict ? spa->spa_config_txg : -1ULL; + uint64_t txg = spa_last_synced_txg(spa) != 0 ? + spa_last_synced_txg(spa) : -1ULL; if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, @@ -1511,7 +1512,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd, spa_last_synced_txg(spa)); + (void) vdev_validate(vd, B_TRUE); } /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:54:47 2013 Return-Path: Delivered-To: svn-src-all@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 A8A8C5E0; Wed, 6 Feb 2013 07:54:47 +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 993F33DC; Wed, 6 Feb 2013 07:54: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 r167slTD032573; Wed, 6 Feb 2013 07:54:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167slCJ032571; Wed, 6 Feb 2013 07:54:47 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060754.r167slCJ032571@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 07:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246388 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:54:47 -0000 Author: mm Date: Wed Feb 6 07:54:46 2013 New Revision: 246388 URL: http://svnweb.freebsd.org/changeset/base/246388 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13934:9e23a7f7b812 Illumos ZFS issues: 3422 zpool create/syseventd race yield non-importable pool 3425 first write to a new zvol can fail with EFBIG Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Wed Feb 6 07:27:25 2013 (r246387) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Wed Feb 6 07:54:46 2013 (r246388) @@ -528,13 +528,12 @@ get_configs(libzfs_handle_t *hdl, pool_l * version * pool guid * name - * pool txg (if available) * comment (if available) * pool state * hostid (if available) * hostname (if available) */ - uint64_t state, version, pool_txg; + uint64_t state, version; char *comment = NULL; version = fnvlist_lookup_uint64(tmp, @@ -550,11 +549,6 @@ get_configs(libzfs_handle_t *hdl, pool_l fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, name); - if (nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0) - fnvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_TXG, pool_txg); - if (nvlist_lookup_string(tmp, ZPOOL_CONFIG_COMMENT, &comment) == 0) fnvlist_add_string(config, From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 07:59:14 2013 Return-Path: Delivered-To: svn-src-all@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 B4D53A0C; Wed, 6 Feb 2013 07:59:14 +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 A689E63A; Wed, 6 Feb 2013 07:59: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 r167xERl033192; Wed, 6 Feb 2013 07:59:14 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167xEN2033191; Wed, 6 Feb 2013 07:59:14 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060759.r167xEN2033191@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 07:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246389 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:59:14 -0000 Author: mm Date: Wed Feb 6 07:59:14 2013 New Revision: 246389 URL: http://svnweb.freebsd.org/changeset/base/246389 Log: Update vendor/illumos/dist to illumos-gate version 13936:60077db1e2cc Illumos ZFS issues: 3380 zfs man page: documentation for zfs allow is confusing Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Wed Feb 6 07:54:46 2013 (r246388) +++ vendor/illumos/dist/man/man1m/zfs.1m Wed Feb 6 07:59:14 2013 (r246389) @@ -24,10 +24,10 @@ .\" Copyright 2011 Joshua M. Clulow .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. -.\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. +.\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved. .\" -.TH ZFS 1M "Sep 16, 2012" +.TH ZFS 1M "Jan 26, 2013" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -38,12 +38,12 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR +\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIfilesystem\fR .fi .LP .nf -\fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR +\fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fB-V\fR \fIsize\fR \fIvolume\fR .fi .LP @@ -53,7 +53,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...] +\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,\fIsnap\fR[%\fIsnap\fR]]... .fi .LP @@ -69,7 +69,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR .fi .LP @@ -95,24 +95,25 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-H\fR][\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]] - [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ... +\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-H\fR][\fB-o\fR \fIproperty\fR[,\fIproperty\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] + [\fB-s\fR \fIproperty\fR]... [\fB-S\fR \fIproperty\fR]... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR]... .fi .LP .nf -\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... +\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR... .fi .LP .nf -\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-t\fR \fItype\fR[,...]] - [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... +\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] + [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fBall\fR | \fIproperty\fR[,\fIproperty\fR]... + \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR... .fi .LP .nf -\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ... +\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR... .fi .LP @@ -127,14 +128,14 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ... - [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR +\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIfield\fR]... + [\fB-S\fR \fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR .fi .LP .nf -\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ... - [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR +\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIfield\fR]... + [\fB-S\fR \fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR .fi .LP @@ -184,44 +185,47 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] - \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBallow\fR [\fB-ldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... + \fIperm\fR|\fI@setname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR|\fBeveryone\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... + \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] - \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... + [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR|\fBeveryone\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] + \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] \fIfilesystem\fR|\fIvolume\fR .fi .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR +\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] + \fIfilesystem\fR|\fIvolume\fR .fi .LP @@ -1590,7 +1594,7 @@ Displays a help message. .sp .ne 2 .na -\fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... +\fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIfilesystem\fR\fR .ad .sp .6 @@ -1631,7 +1635,7 @@ property is specified in multiple \fB-o\ .ne 2 .na \fB\fBzfs create\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR -\fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR\fR +\fIproperty\fR=\fIvalue\fR]... \fB-V\fR \fIsize\fR \fIvolume\fR\fR .ad .sp .6 .RS 4n @@ -1778,7 +1782,7 @@ behavior for mounted file systems in use .sp .ne 2 .na -\fBzfs destroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...] +\fBzfs destroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,\fIsnap\fR[%\fIsnap\fR]]... .ad .sp .6 .RS 4n @@ -1874,7 +1878,7 @@ behavior for mounted file systems in use .sp .ne 2 .na -\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... +\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR... .ad .sp .6 @@ -1960,7 +1964,7 @@ that are to be destroyed. .sp .ne 2 .na -\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... +\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR .ad .sp .6 @@ -2075,9 +2079,9 @@ only dataset that can be renamed recursi .ne 2 .na \fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-H\fR] [\fB-o\fR -\fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR -\fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... -[\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR +\fIproperty\fR[,\fIproperty\fR]...] [ \fB-t\fR \fItype\fR[,\fItype\fR]...] [ \fB-s\fR +\fIproperty\fR ]... [ \fB-S\fR \fIproperty\fR ]... +[\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR]...\fR .ad .sp .6 .RS 4n @@ -2228,7 +2232,7 @@ specifying \fB-t snapshot\fR displays on .ne 2 .na \fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR -\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR +\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...\fR .ad .sp .6 .RS 4n @@ -2246,8 +2250,8 @@ Properties" section. .ne 2 .na \fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR -\fIfield\fR[,...] [\fB-t\fR \fItype\fR[,...]] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | -\fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR +\fIfield\fR[,\fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] [\fB-s\fR \fIsource\fR[,\fIsource\fR]... \fBall\fR | +\fIproperty\fR[,\fIproperty\fR]... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...\fR .ad .sp .6 .RS 4n @@ -2346,7 +2350,7 @@ Display numbers in parseable (exact) val .ne 2 .na \fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR -\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR +\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...\fR .ad .sp .6 .RS 4n @@ -2443,10 +2447,10 @@ supported by this software. .sp .ne 2 .na -\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] -[\fB-s\fR \fIfield\fR] ... -[\fB-S\fR \fIfield\fR] ... -[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR +\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] +[\fB-s\fR \fIfield\fR]... +[\fB-S\fR \fIfield\fR]... +[\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR .ad .sp .6 .RS 4n @@ -2486,7 +2490,7 @@ Use exact (parsable) numeric output. .sp .ne 2 .na -\fB\fB-o\fR \fIfield\fR[,...]\fR +\fB\fB-o\fR \fIfield\fR[,\fIfield\fR]...\fR .ad .sp .6 .RS 4n @@ -2519,7 +2523,7 @@ Sort by this field in reverse order. See .sp .ne 2 .na -\fB\fB-t\fR \fItype\fR[,...]\fR +\fB\fB-t\fR \fItype\fR[,\fItype\fR]...\fR .ad .sp .6 .RS 4n @@ -2551,10 +2555,10 @@ will report that the POSIX entity has th .sp .ne 2 .na -\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] -[\fB-s\fR \fIfield\fR] ... -[\fB-S\fR \fIfield\fR] ... -[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR +\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] +[\fB-s\fR \fIfield\fR]... +[\fB-S\fR \fIfield\fR]... +[\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR .ad .sp .6 .RS 4n @@ -3003,13 +3007,13 @@ volume. See the other forms of \fBzfs al .sp .ne 2 .na -\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] -\fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR +\fB\fBzfs allow\fR [\fB-ldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... +\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]... \fIfilesystem\fR|\fIvolume\fR\fR .ad .br .na -\fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] -\fIfilesystem\fR | \fIvolume\fR\fR +\fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR|\fBeveryone\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]... +\fIfilesystem\fR|\fIvolume\fR\fR .ad .sp .6 .RS 4n @@ -3018,14 +3022,14 @@ non-privileged users. .sp .ne 2 .na -\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR +[\fB-ug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... .ad .sp .6 .RS 4n Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword -"everyone", then as a user name, and lastly as a group name. To specify a user +\fBeveryone,\fR then as a user name, and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options. .RE @@ -3033,11 +3037,21 @@ group with the same name as a user, use .sp .ne 2 .na -\fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR +\fB-e\fR|\fBeveryone\fR +.ad +.sp .6 +.RS 4n +Specifies that the permissions be delegated to everyone. +.RE + +.sp +.ne 2 +.na +\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]... .ad .sp .6 .RS 4n -Specifies that the permissions be delegated to "everyone." Multiple permissions +The permissions to delegate. Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which begin with an at sign (\fB@\fR) , may be specified. See the @@ -3047,7 +3061,7 @@ set names, which begin with an at sign ( .sp .ne 2 .na -\fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR +[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR .ad .sp .6 .RS 4n @@ -3135,7 +3149,7 @@ zoned property .sp .ne 2 .na -\fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] +\fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]... \fIfilesystem\fR|\fIvolume\fR\fR .ad .sp .6 @@ -3147,7 +3161,7 @@ creator of any newly-created descendent .sp .ne 2 .na -\fB\fBzfs allow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] +\fB\fBzfs allow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]... \fIfilesystem\fR|\fIvolume\fR\fR .ad .sp .6 @@ -3163,18 +3177,17 @@ characters long. .sp .ne 2 .na -\fB\fBzfs unallow\fR [\fB-rldug\fR] -"\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] -[\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR +\fB\fBzfs unallow\fR [\fB-rldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... +[\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]...] \fIfilesystem\fR|\fIvolume\fR\fR .ad .br .na -\fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] +\fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR|\fBeveryone\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]...] \fIfilesystem\fR|\fIvolume\fR\fR .ad .br .na -\fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR +\fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]...]\fR .ad .br .na @@ -3186,8 +3199,8 @@ Removes permissions that were granted wi permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified \fIuser\fR, -\fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the -\fB-e\fR option) only removes the permissions that were granted to "everyone", +\fIgroup\fR, or everyone are removed. Specifying \fBeveryone\fR (or using the +\fB-e\fR option) only removes the permissions that were granted to everyone, not all permissions for every user and group. See the \fBzfs allow\fR command for a description of the \fB-ldugec\fR options. .sp @@ -3206,7 +3219,7 @@ Recursively remove the permissions from .ne 2 .na \fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR -[\fIperm\fR|@\fIsetname\fR[,...]]\fR +[\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|@\fIsetname\fR]...]\fR .ad .br .na From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:14:59 2013 Return-Path: Delivered-To: svn-src-all@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 11506D71; Wed, 6 Feb 2013 08:14:59 +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 DF8586EC; Wed, 6 Feb 2013 08:14:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r168Ew6P039047; Wed, 6 Feb 2013 08:14:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168EwGO039046; Wed, 6 Feb 2013 08:14:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060814.r168EwGO039046@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246390 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:14:59 -0000 Author: mm Date: Wed Feb 6 08:14:58 2013 New Revision: 246390 URL: http://svnweb.freebsd.org/changeset/base/246390 Log: Update vendor-sys/illumos/dist to illumos-gate version 13937:6b4f289e7094 Illumos ZFS issues: 3468 mdb enhancements for zfs development (not relevant for FreeBSD) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Wed Feb 6 07:59:14 2013 (r246389) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Wed Feb 6 08:14:58 2013 (r246390) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_REFCOUNT_H @@ -52,8 +53,8 @@ typedef struct refcount { kmutex_t rc_mtx; list_t rc_list; list_t rc_removed; - int64_t rc_count; - int64_t rc_removed_count; + uint64_t rc_count; + uint64_t rc_removed_count; } refcount_t; /* Note: refcount_t must be initialized with refcount_create() */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:17:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F227CF4D; Wed, 6 Feb 2013 08:17:29 +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 CB9C0710; Wed, 6 Feb 2013 08: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 r168HTSu039428; Wed, 6 Feb 2013 08:17:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168HTKF039427; Wed, 6 Feb 2013 08:17:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060817.r168HTKF039427@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246391 - vendor-sys/illumos/dist/uts/common/dtrace vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:17:30 -0000 Author: mm Date: Wed Feb 6 08:17:29 2013 New Revision: 246391 URL: http://svnweb.freebsd.org/changeset/base/246391 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13939:20e4d8d8da6d illumos dtrace issues: 3511 dtrace.c erroneously checks for memory alignment on amd64 Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Wed Feb 6 08:14:58 2013 (r246390) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Wed Feb 6 08:17:29 2013 (r246391) @@ -355,7 +355,7 @@ static kmutex_t dtrace_errlock; #define DTRACE_STORE(type, tomax, offset, what) \ *((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what); -#ifndef __i386 +#ifndef __x86 #define DTRACE_ALIGNCHECK(addr, size, flags) \ if (addr & (size - 1)) { \ *flags |= CPU_DTRACE_BADALIGN; \ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:17:30 2013 Return-Path: Delivered-To: svn-src-all@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 5C665F4E; Wed, 6 Feb 2013 08:17:30 +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 2B246711; Wed, 6 Feb 2013 08:17: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 r168HUEq039434; Wed, 6 Feb 2013 08:17:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168HUmW039433; Wed, 6 Feb 2013 08:17:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060817.r168HUmW039433@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246391 - vendor-sys/illumos/dist/uts/common/dtrace vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:17:30 -0000 Author: mm Date: Wed Feb 6 08:17:29 2013 New Revision: 246391 URL: http://svnweb.freebsd.org/changeset/base/246391 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13939:20e4d8d8da6d illumos dtrace issues: 3511 dtrace.c erroneously checks for memory alignment on amd64 Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Wed Feb 6 08:14:58 2013 (r246390) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Wed Feb 6 08:17:29 2013 (r246391) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -32,44 +34,51 @@ * a runtime error. * * SECTION: Pointers and Arrays/Generic Pointers - * - * NOTES: - * This test doesn't apply to x86; for the time being, we're working - * around this with the preprocessor. */ #pragma D option quiet -int array[3]; -uintptr_t uptr; +#if defined(__i386) || defined(__amd64) +#define __x86 1 +#endif + +int array[2]; +char *ptr; int *p; int *q; int *r; BEGIN { -#ifdef __i386 + array[0] = 0x12345678; + array[1] = 0xabcdefff; + + ptr = (char *) &array[0]; + + p = (int *) (ptr); + q = (int *) (ptr + 2); + r = (int *) (ptr + 3); + + printf("*p: 0x%x\n", *p); + printf("*q: 0x%x\n", *q); + printf("*r: 0x%x\n", *r); + + /* + * On x86, the above unaligned memory accesses are allowed and should + * not result in the ERROR probe firing. + */ +#ifdef __x86 exit(1); #else - array[0] = 20; - array[1] = 40; - array[2] = 80; - - uptr = (uintptr_t) &array[0]; - - p = (int *) (uptr); - q = (int *) (uptr + 2); - r = (int *) (uptr + 3); - - printf("array[0]: %d\t*p: %d\n", array[0], *p); - printf("array[1]: %d\t*q: %d\n", array[1], *q); - printf("array[2]: %d\t*r: %d\n", array[2], *r); - exit(0); #endif } ERROR { +#ifdef __x86 + exit(0); +#else exit(1); +#endif } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:21:44 2013 Return-Path: Delivered-To: svn-src-all@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 65D5D536; Wed, 6 Feb 2013 08:21:44 +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 49200769; Wed, 6 Feb 2013 08:21: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 r168LiSZ041601; Wed, 6 Feb 2013 08:21:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168LfBW041577; Wed, 6 Feb 2013 08:21:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060821.r168LfBW041577@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246392 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:21:44 -0000 Author: mm Date: Wed Feb 6 08:21:40 2013 New Revision: 246392 URL: http://svnweb.freebsd.org/changeset/base/246392 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13941:d48547176ab4 Illumos ZFS issues: 3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Feb 6 08:21:40 2013 (r246392) @@ -823,7 +823,6 @@ buf_cons(void *vbuf, void *unused, int k bzero(buf, sizeof (arc_buf_t)); mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL); - rw_init(&buf->b_data_lock, NULL, RW_DEFAULT, NULL); arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS); return (0); @@ -853,7 +852,6 @@ buf_dest(void *vbuf, void *unused) arc_buf_t *buf = vbuf; mutex_destroy(&buf->b_evict_lock); - rw_destroy(&buf->b_data_lock); arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS); } @@ -2779,42 +2777,11 @@ arc_read_done(zio_t *zio) * * arc_read_done() will invoke all the requested "done" functions * for readers of this block. - * - * Normal callers should use arc_read and pass the arc buffer and offset - * for the bp. But if you know you don't need locking, you can use - * arc_read_bp. */ int -arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - int err; - - if (pbuf == NULL) { - /* - * XXX This happens from traverse callback funcs, for - * the objset_phys_t block. - */ - return (arc_read_nolock(pio, spa, bp, done, private, priority, - zio_flags, arc_flags, zb)); - } - - ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); - ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); - rw_enter(&pbuf->b_data_lock, RW_READER); - - err = arc_read_nolock(pio, spa, bp, done, private, priority, - zio_flags, arc_flags, zb); - rw_exit(&pbuf->b_data_lock); - - return (err); -} - -int -arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) +arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, + void *private, int priority, int zio_flags, uint32_t *arc_flags, + const zbookmark_t *zb) { arc_buf_hdr_t *hdr; arc_buf_t *buf; @@ -3294,19 +3261,6 @@ arc_release(arc_buf_t *buf, void *tag) } } -/* - * Release this buffer. If it does not match the provided BP, fill it - * with that block's contents. - */ -/* ARGSUSED */ -int -arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa, - zbookmark_t *zb) -{ - arc_release(buf, tag); - return (0); -} - int arc_released(arc_buf_t *buf) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Wed Feb 6 08:21:40 2013 (r246392) @@ -135,7 +135,7 @@ bptree_add(objset_t *os, uint64_t obj, b /* ARGSUSED */ static int -bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { int err; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed Feb 6 08:21:40 2013 (r246392) @@ -513,7 +513,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t spa_t *spa; zbookmark_t zb; uint32_t aflags = ARC_NOWAIT; - arc_buf_t *pbuf; DB_DNODE_ENTER(db); dn = DB_DNODE(db); @@ -575,14 +574,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t db->db.db_object, db->db_level, db->db_blkid); dbuf_add_ref(db, NULL); - /* ZIO_FLAG_CANFAIL callers have to check the parent zio's error */ - if (db->db_parent) - pbuf = db->db_parent->db_buf; - else - pbuf = db->db_objset->os_phys_buf; - - (void) dsl_read(zio, spa, db->db_blkptr, pbuf, + (void) arc_read(zio, spa, db->db_blkptr, dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ, (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED, &aflags, &zb); @@ -982,7 +975,6 @@ void dbuf_release_bp(dmu_buf_impl_t *db) { objset_t *os; - zbookmark_t zb; DB_GET_OBJSET(&os, db); ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); @@ -990,13 +982,7 @@ dbuf_release_bp(dmu_buf_impl_t *db) list_link_active(&os->os_dsl_dataset->ds_synced_link)); ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf)); - zb.zb_objset = os->os_dsl_dataset ? - os->os_dsl_dataset->ds_object : 0; - zb.zb_object = db->db.db_object; - zb.zb_level = db->db_level; - zb.zb_blkid = db->db_blkid; - (void) arc_release_bp(db->db_buf, db, - db->db_blkptr, os->os_spa, &zb); + (void) arc_release(db->db_buf, db); } dbuf_dirty_record_t * @@ -1831,7 +1817,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki if (bp && !BP_IS_HOLE(bp)) { int priority = dn->dn_type == DMU_OT_DDT_ZAP ? ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ; - arc_buf_t *pbuf; dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; zbookmark_t zb; @@ -1839,13 +1824,8 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET, dn->dn_object, 0, blkid); - if (db) - pbuf = db->db_buf; - else - pbuf = dn->dn_objset->os_phys_buf; - - (void) dsl_read(NULL, dn->dn_objset->os_spa, - bp, pbuf, NULL, NULL, priority, + (void) arc_read(NULL, dn->dn_objset->os_spa, + bp, NULL, NULL, priority, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, &zb); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Wed Feb 6 08:21:40 2013 (r246392) @@ -105,7 +105,7 @@ report_dnode(struct diffarg *da, uint64_ /* ARGSUSED */ static int -diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { struct diffarg *da = arg; @@ -132,9 +132,9 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons int blksz = BP_GET_LSIZE(bp); int i; - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); blk = abuf->b_data; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Wed Feb 6 08:21:40 2013 (r246392) @@ -277,12 +277,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat aflags |= ARC_L2CACHE; dprintf_bp(os->os_rootbp, "reading %s", ""); - /* - * XXX when bprewrite scrub can change the bp, - * and this is called from dmu_objset_open_ds_os, the bp - * could change, and we'll need a lock. - */ - err = dsl_read_nolock(NULL, spa, os->os_rootbp, + err = arc_read(NULL, spa, os->os_rootbp, arc_getbuf_func, &os->os_phys_buf, ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb); if (err) { @@ -1173,8 +1168,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio SET_BOOKMARK(&zb, os->os_dsl_dataset ? os->os_dsl_dataset->ds_object : DMU_META_OBJSET, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf, - os->os_rootbp, os->os_spa, &zb)); + arc_release(os->os_phys_buf, &os->os_phys_buf); dmu_write_policy(os, NULL, 0, 0, &zp); @@ -1813,7 +1807,7 @@ dmu_objset_prefetch(const char *name, vo SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - (void) dsl_read_nolock(NULL, dsl_dataset_get_spa(ds), + (void) arc_read(NULL, dsl_dataset_get_spa(ds), &ds->ds_phys->ds_bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Wed Feb 6 08:21:40 2013 (r246392) @@ -301,7 +301,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t /* ARGSUSED */ static int -backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { dmu_sendarg_t *dsp = arg; @@ -330,9 +330,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co uint32_t aflags = ARC_WAIT; arc_buf_t *abuf; - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); blk = abuf->b_data; @@ -349,9 +349,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); - if (arc_read_nolock(NULL, spa, bp, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data); @@ -361,9 +361,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) { + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) { if (zfs_send_corrupt_data) { /* Send a block filled with 0x"zfs badd bloc" */ abuf = arc_buf_alloc(spa, blksz, &abuf, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Wed Feb 6 08:21:40 2013 (r246392) @@ -62,9 +62,9 @@ typedef struct traverse_data { } traverse_data_t; static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object); + uint64_t objset, uint64_t object); static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, - arc_buf_t *buf, uint64_t objset, uint64_t object); + uint64_t objset, uint64_t object); static int traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) @@ -81,7 +81,7 @@ traverse_zil_block(zilog_t *zilog, blkpt SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, bp->blk_cksum.zc_word[ZIL_ZC_SEQ]); - (void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, td->td_arg); + (void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg); return (0); } @@ -105,7 +105,7 @@ traverse_zil_record(zilog_t *zilog, lr_t SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid, ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp)); - (void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, + (void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg); } return (0); @@ -182,7 +182,7 @@ traverse_pause(traverse_data_t *td, cons static void traverse_prefetch_metadata(traverse_data_t *td, - arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_t *zb) { uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; @@ -200,14 +200,13 @@ traverse_prefetch_metadata(traverse_data if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE) return; - (void) arc_read(NULL, td->td_spa, bp, - pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &flags, zb); + (void) arc_read(NULL, td->td_spa, bp, NULL, NULL, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); } static int traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_t *zb) { zbookmark_t czb; int err = 0, lasterr = 0; @@ -228,8 +227,7 @@ traverse_visitbp(traverse_data_t *td, co } if (BP_IS_HOLE(bp)) { - err = td->td_func(td->td_spa, NULL, NULL, pbuf, zb, dnp, - td->td_arg); + err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg); return (err); } @@ -249,7 +247,7 @@ traverse_visitbp(traverse_data_t *td, co } if (td->td_flags & TRAVERSE_PRE) { - err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp, + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == TRAVERSE_VISIT_NO_CHILDREN) return (0); @@ -265,8 +263,7 @@ traverse_visitbp(traverse_data_t *td, co blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; - err = dsl_read(NULL, td->td_spa, bp, pbuf, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); @@ -276,7 +273,7 @@ traverse_visitbp(traverse_data_t *td, co SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, zb->zb_blkid * epb + i); - traverse_prefetch_metadata(td, buf, &cbp[i], &czb); + traverse_prefetch_metadata(td, &cbp[i], &czb); } /* recursively visitbp() blocks below this */ @@ -284,7 +281,7 @@ traverse_visitbp(traverse_data_t *td, co SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, zb->zb_blkid * epb + i); - err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb); + err = traverse_visitbp(td, dnp, &cbp[i], &czb); if (err) { if (!hard) break; @@ -296,21 +293,20 @@ traverse_visitbp(traverse_data_t *td, co int i; int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; - err = dsl_read(NULL, td->td_spa, bp, pbuf, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); dnp = buf->b_data; for (i = 0; i < epb; i++) { - prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset, + prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset, zb->zb_blkid * epb + i); } /* recursively visitbp() blocks below this */ for (i = 0; i < epb; i++) { - err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset, + err = traverse_dnode(td, &dnp[i], zb->zb_objset, zb->zb_blkid * epb + i); if (err) { if (!hard) @@ -323,24 +319,23 @@ traverse_visitbp(traverse_data_t *td, co objset_phys_t *osp; dnode_phys_t *dnp; - err = dsl_read_nolock(NULL, td->td_spa, bp, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); osp = buf->b_data; dnp = &osp->os_meta_dnode; - prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset, + prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { prefetch_dnode_metadata(td, &osp->os_userused_dnode, - buf, zb->zb_objset, DMU_USERUSED_OBJECT); + zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, - buf, zb->zb_objset, DMU_USERUSED_OBJECT); + zb->zb_objset, DMU_USERUSED_OBJECT); } - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (err && hard) { lasterr = err; @@ -348,7 +343,7 @@ traverse_visitbp(traverse_data_t *td, co } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_userused_dnode; - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_USERUSED_OBJECT); } if (err && hard) { @@ -357,7 +352,7 @@ traverse_visitbp(traverse_data_t *td, co } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_groupused_dnode; - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_GROUPUSED_OBJECT); } } @@ -367,8 +362,7 @@ traverse_visitbp(traverse_data_t *td, co post: if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { - err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp, - td->td_arg); + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; } @@ -384,25 +378,25 @@ post: static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object) + uint64_t objset, uint64_t object) { int j; zbookmark_t czb; for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); - traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb); + traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb); } if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); - traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb); + traverse_prefetch_metadata(td, &dnp->dn_spill, &czb); } } static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object) + uint64_t objset, uint64_t object) { int j, err = 0, lasterr = 0; zbookmark_t czb; @@ -410,7 +404,7 @@ traverse_dnode(traverse_data_t *td, cons for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); - err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb); + err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb); if (err) { if (!hard) break; @@ -420,7 +414,7 @@ traverse_dnode(traverse_data_t *td, cons if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); - err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb); + err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb); if (err) { if (!hard) return (err); @@ -433,8 +427,7 @@ traverse_dnode(traverse_data_t *td, cons /* ARGSUSED */ static int traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, - void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { prefetch_data_t *pfd = arg; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; @@ -455,10 +448,8 @@ traverse_prefetcher(spa_t *spa, zilog_t cv_broadcast(&pfd->pd_cv); mutex_exit(&pfd->pd_mtx); - (void) dsl_read(NULL, spa, bp, pbuf, NULL, NULL, - ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, - &aflags, zb); + (void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb); return (0); } @@ -476,7 +467,7 @@ traverse_prefetch_thread(void *arg) SET_BOOKMARK(&czb, td.td_objset, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - (void) traverse_visitbp(&td, NULL, NULL, td.td_rootbp, &czb); + (void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb); mutex_enter(&td_main->td_pfd->pd_mtx); td_main->td_pfd->pd_exited = B_TRUE; @@ -540,7 +531,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t SET_BOOKMARK(&czb, td.td_objset, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - err = traverse_visitbp(&td, NULL, NULL, rootbp, &czb); + err = traverse_visitbp(&td, NULL, rootbp, &czb); mutex_enter(&pd.pd_mtx); pd.pd_cancel = B_TRUE; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Feb 6 08:21:40 2013 (r246392) @@ -1260,7 +1260,7 @@ struct killarg { /* ARGSUSED */ static int -kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { struct killarg *ka = arg; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Feb 6 08:21:40 2013 (r246392) @@ -366,24 +366,6 @@ dsl_free_sync(zio_t *pio, dsl_pool_t *dp zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags)); } -int -dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - return (arc_read(pio, spa, bpp, pbuf, done, private, - priority, zio_flags, arc_flags, zb)); -} - -int -dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - return (arc_read_nolock(pio, spa, bpp, done, private, - priority, zio_flags, arc_flags, zb)); -} - static uint64_t dsl_scan_ds_maxtxg(dsl_dataset_t *ds) { @@ -554,12 +536,8 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid); - /* - * XXX need to make sure all of these arc_read() prefetches are - * done before setting xlateall (similar to dsl_read()) - */ (void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp, - buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, + NULL, NULL, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb); } @@ -617,8 +595,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -640,8 +617,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da } else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) { uint32_t flags = ARC_WAIT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -653,8 +629,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da int i, j; int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -676,8 +651,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da uint32_t flags = ARC_WAIT; objset_phys_t *osp; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Feb 6 08:21:40 2013 (r246392) @@ -1732,7 +1732,7 @@ spa_load_verify_done(zio_t *zio) /*ARGSUSED*/ static int spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { if (bp != NULL) { zio_t *rio = arg; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Wed Feb 6 08:21:40 2013 (r246392) @@ -49,7 +49,6 @@ struct arc_buf { arc_buf_hdr_t *b_hdr; arc_buf_t *b_next; kmutex_t b_evict_lock; - krwlock_t b_data_lock; void *b_data; arc_evict_func_t *b_efunc; void *b_private; @@ -93,8 +92,6 @@ void arc_buf_add_ref(arc_buf_t *buf, voi int arc_buf_remove_ref(arc_buf_t *buf, void *tag); int arc_buf_size(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); -int arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa, - zbookmark_t *zb); int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); @@ -104,10 +101,7 @@ boolean_t arc_buf_eviction_needed(arc_bu int arc_referenced(arc_buf_t *buf); #endif -int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); -int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, +int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, void *private, int priority, int flags, uint32_t *arc_flags, const zbookmark_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h Wed Feb 6 08:21:40 2013 (r246392) @@ -40,8 +40,7 @@ struct zilog; struct arc_buf; typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp, - void *arg); + const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg); #define TRAVERSE_PRE (1<<0) #define TRAVERSE_POST (1<<1) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Wed Feb 6 08:21:40 2013 (r246392) @@ -134,12 +134,6 @@ void dsl_pool_willuse_space(dsl_pool_t * void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); -int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); -int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Wed Feb 6 08:21:40 2013 (r246392) @@ -190,7 +190,7 @@ zil_read_log_block(zilog_t *zilog, const SET_BOOKMARK(&zb, bp->blk_cksum.zc_word[ZIL_ZC_OBJSET], ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, bp->blk_cksum.zc_word[ZIL_ZC_SEQ]); - error = dsl_read_nolock(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf, + error = arc_read(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb); if (error == 0) { @@ -266,7 +266,7 @@ zil_read_log_data(zilog_t *zilog, const SET_BOOKMARK(&zb, dmu_objset_id(zilog->zl_os), lr->lr_foid, ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp)); - error = arc_read_nolock(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf, + error = arc_read(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb); if (error == 0) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Wed Feb 6 08:21:40 2013 (r246392) @@ -1994,7 +1994,7 @@ zio_ddt_collision(zio_t *zio, ddt_t *ddt ddt_exit(ddt); - error = arc_read_nolock(NULL, spa, &blk, + error = arc_read(NULL, spa, &blk, arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, &zio->io_bookmark); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Wed Feb 6 08:21:40 2013 (r246392) @@ -236,7 +236,7 @@ struct maparg { /*ARGSUSED*/ static int -zvol_map_block(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +zvol_map_block(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { struct maparg *ma = arg; From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:21:44 2013 Return-Path: Delivered-To: svn-src-all@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 D2AF2537; Wed, 6 Feb 2013 08:21:44 +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 A069276A; Wed, 6 Feb 2013 08:21: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 r168Liu3041607; Wed, 6 Feb 2013 08:21:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168LiPh041606; Wed, 6 Feb 2013 08:21:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060821.r168LiPh041606@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246392 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:21:44 -0000 Author: mm Date: Wed Feb 6 08:21:40 2013 New Revision: 246392 URL: http://svnweb.freebsd.org/changeset/base/246392 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13941:d48547176ab4 Illumos ZFS issues: 3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt) Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Feb 6 08:17:29 2013 (r246391) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Feb 6 08:21:40 2013 (r246392) @@ -1016,7 +1016,7 @@ visit_indirect(spa_t *spa, const dnode_p arc_buf_t *buf; uint64_t fill = 0; - err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf, + err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); @@ -2073,9 +2073,8 @@ zdb_blkptr_done(zio_t *zio) mutex_exit(&spa->spa_scrub_lock); } -/* ARGSUSED */ static int -zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; @@ -2476,7 +2475,7 @@ typedef struct zdb_ddt_entry { /* ARGSUSED */ static int zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { avl_tree_t *t = arg; avl_index_t where; From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:26:59 2013 Return-Path: Delivered-To: svn-src-all@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 D2B548A9; Wed, 6 Feb 2013 08:26:59 +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 C2BEA7AA; Wed, 6 Feb 2013 08:26: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 r168Qx3m042350; Wed, 6 Feb 2013 08:26:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168QuCC042323; Wed, 6 Feb 2013 08:26:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060826.r168QuCC042323@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246393 - in vendor/illumos/dist: cmd/dtrace/test/tst/common/funcs cmd/dtrace/test/tst/common/misc cmd/dtrace/test/tst/common/pointers cmd/dtrace/test/tst/common/print cmd/dtrace/test/t... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:26:59 -0000 Author: mm Date: Wed Feb 6 08:26:55 2013 New Revision: 246393 URL: http://svnweb.freebsd.org/changeset/base/246393 Log: Update vendor/illumos/dist to illumos-gate version 13944:bbcbb468dc37 Illumos dtrace issues: 3519 DTrace fails to resolve const types from fbt 3520 dtrace internal error -- token type 316 is not a valid D compilation token 3521 clean up dtrace unit tests Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/types/tst.const.d Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.copyin.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dynopt.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.copyin.d vendor/illumos/dist/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d vendor/illumos/dist/lib/libdtrace/common/dt_cc.c vendor/illumos/dist/lib/libdtrace/common/dt_decl.c vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.copyin.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.copyin.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.copyin.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -52,3 +54,8 @@ BEGIN printf("envp[0] = \"%s\"", copyinstr(envp)); exit(0); } + +BEGIN +{ + exit(1) +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #pragma D option quiet @@ -36,3 +38,8 @@ BEGIN printf("%s\n", strjoin("", "")); exit(0); } + +BEGIN +{ + exit(1); +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dynopt.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dynopt.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dynopt.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,38 +24,45 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #pragma D option quiet #pragma D option switchrate=1ms #pragma D option aggrate=1ms -tick-100ms +tick-50ms { i++; } -tick-100ms -/i > 1/ +tick-50ms +/!(i & 1) && i > 1/ { setopt("quiet", "no"); setopt("quiet"); setopt("quiet"); setopt("quiet", "yes"); @["abc"] = count(); +} + +tick-50ms +/(i & 1) && i > 1/ +{ printa("%@d\n", @); } -tick-100ms -/i == 5/ +tick-50ms +/i == 10/ { setopt("switchrate", "5sec"); setopt("aggrate", "5sec"); } -tick-100ms -/i == 31/ +tick-50ms +/i == 61/ { exit(0); } Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: This test reproduces the alignment error. @@ -39,9 +41,10 @@ BEGIN { - x = (int *) 64; + x = (int *)64; y = *x; trace(y); + exit(0); } ERROR Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -44,6 +46,7 @@ BEGIN y = (int *) (x - 3300778156056); *y = 3; trace(*y); + exit(0); } ERROR Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -39,9 +41,10 @@ BEGIN { - y = (int *) (-33007); + y = (int *)-33007; *y = 3; trace(*y); + exit(0); } ERROR Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Demonstrating valid memory access. @@ -40,10 +42,11 @@ BEGIN { x = (int *)alloca(sizeof (int)); - printf("Address x: %x\n", (int) x); - y = (int *) (x - 2); + printf("Address x: %x\n", (int)x); + y = (int *)(x - 2); *y = 3; - printf("Address y: %x\tValue: %d\n", (int) y, *y); + printf("Address y: %x\tValue: %d\n", (int)y, *y); + exit(0); } ERROR Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d Wed Feb 6 08:26:55 2013 (r246393) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + print(@); +} + +BEGIN +{ + exit(0); +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Feb 6 08:26:55 2013 (r246393) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print((void)`p0); } + +BEGIN +{ + exit(0); +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Feb 6 08:26:55 2013 (r246393) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print(); } + +BEGIN +{ + exit(0); +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.copyin.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,7 +41,7 @@ */ -#pragma D option bufsize=16 +#pragma D option bufsize=32 #pragma D option bufpolicy=ring #pragma D option statusrate=1nsec Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh Wed Feb 6 08:26:55 2013 (r246393) @@ -25,7 +25,9 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# ############################################################################ # ASSERTION: @@ -70,7 +72,7 @@ EOF #chmod 555 the .d file chmod 555 $dfilename >/dev/null 2>&1 -if [ &? -ne 0 ]; then +if [ $? -ne 0 ]; then print -u2 "chmod $dfilename failed" exit 1 fi Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,8 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,3 +40,8 @@ BEGIN trace(); } + +BEGIN +{ + exit(0); +} Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Feb 6 08:26:55 2013 (r246393) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -37,3 +39,8 @@ BEGIN { trace((void)`kmem_flags); } + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/types/tst.const.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/types/tst.const.d Wed Feb 6 08:26:55 2013 (r246393) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Make sure we can scope types with modifiers. + */ + +BEGIN +{ + trace((D`int *)0); + trace((const D`int *)0); + exit(0); +} Modified: vendor/illumos/dist/lib/libdtrace/common/dt_cc.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_cc.c Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/lib/libdtrace/common/dt_cc.c Wed Feb 6 08:26:55 2013 (r246393) @@ -676,6 +676,12 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no "%s( ) may not be applied to a translated pointer\n", act); } + if (dnp->dn_args->dn_kind == DT_NODE_AGG) { + dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG, + "%s( ) may not be applied to an aggregation%s\n", act, + istrace ? "" : " -- did you mean printa()?"); + } + dt_cg(yypcb, dnp->dn_args); /* Modified: vendor/illumos/dist/lib/libdtrace/common/dt_decl.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_decl.c Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/lib/libdtrace/common/dt_decl.c Wed Feb 6 08:26:55 2013 (r246393) @@ -21,6 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -251,11 +252,6 @@ dt_decl_spec(ushort_t kind, char *name) ddp->dd_kind = kind; ddp->dd_name = name; - if (name != NULL && strchr(name, '`') != NULL) { - xyerror(D_DECL_SCOPE, "D scoping operator may not be used " - "in a type name\n"); - } - return (dt_decl_check(ddp)); } Modified: vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h Wed Feb 6 08:21:40 2013 (r246392) +++ vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h Wed Feb 6 08:26:55 2013 (r246393) @@ -190,8 +190,10 @@ typedef enum { D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */ D_TRACE_VOID, /* trace() argument has void type */ D_TRACE_DYN, /* trace() argument has dynamic type */ + D_TRACE_AGG, /* trace() argument is an aggregation */ D_PRINT_VOID, /* print() argument has void type */ D_PRINT_DYN, /* print() argument has dynamic type */ + D_PRINT_AGG, /* print() argument is an aggregation */ D_TRACEMEM_ADDR, /* tracemem() address bad type */ D_TRACEMEM_SIZE, /* tracemem() size bad type */ D_TRACEMEM_ARGS, /* tracemem() illegal number of args */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 08:29:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10921A22; Wed, 6 Feb 2013 08:29:01 +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 0320F7BD; Wed, 6 Feb 2013 08:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r168T0ul042648; Wed, 6 Feb 2013 08:29:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r168T0kB042647; Wed, 6 Feb 2013 08:29:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302060829.r168T0kB042647@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Feb 2013 08:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246394 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:29:01 -0000 Author: mm Date: Wed Feb 6 08:29:00 2013 New Revision: 246394 URL: http://svnweb.freebsd.org/changeset/base/246394 Log: Update vendor-sys/illumos/dist to illumos-gate version 13945:7a9c1d41dfbe Illumos ZFS issues: 3507 Tunable to allow block allocation even on degraded vdevs Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Wed Feb 6 08:26:55 2013 (r246393) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Wed Feb 6 08:29:00 2013 (r246394) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #include @@ -91,6 +92,11 @@ int metaslab_prefetch_limit = SPA_DVAS_P int metaslab_smo_bonus_pct = 150; /* + * Should we be willing to write data to degraded vdevs? + */ +boolean_t zfs_write_to_degraded = B_FALSE; + +/* * ========================================================================== * Metaslab classes * ========================================================================== @@ -1377,10 +1383,13 @@ top: /* * Avoid writing single-copy data to a failing vdev + * unless the user instructs us that it is okay. */ if ((vd->vdev_stat.vs_write_errors > 0 || vd->vdev_state < VDEV_STATE_HEALTHY) && - d == 0 && dshift == 3) { + d == 0 && dshift == 3 && + !(zfs_write_to_degraded && vd->vdev_state == + VDEV_STATE_DEGRADED)) { all_zero = B_FALSE; goto next; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 11:08:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00CB1E70; Wed, 6 Feb 2013 11:08:11 +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 DB0AC118; Wed, 6 Feb 2013 11:08: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 r16B8BKf088653; Wed, 6 Feb 2013 11:08:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16B8BF1088652; Wed, 6 Feb 2013 11:08:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061108.r16B8BF1088652@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 11:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246395 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:08:12 -0000 Author: hselasky Date: Wed Feb 6 11:08:11 2013 New Revision: 246395 URL: http://svnweb.freebsd.org/changeset/base/246395 Log: MFC r246113 and r246126: Add missing NULL pointer check. Reported by: Lars Engels Modified: stable/9/sys/dev/usb/controller/xhci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Wed Feb 6 08:29:00 2013 (r246394) +++ stable/9/sys/dev/usb/controller/xhci.c Wed Feb 6 11:08:11 2013 (r246395) @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF( + "short TD has no alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr || From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 11:10:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4CD3FF8; Wed, 6 Feb 2013 11:10:42 +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 AC494132; Wed, 6 Feb 2013 11:10: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 r16BAgRo090604; Wed, 6 Feb 2013 11:10:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16BAgiQ090602; Wed, 6 Feb 2013 11:10:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061110.r16BAgiQ090602@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 11:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246396 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:10:42 -0000 Author: hselasky Date: Wed Feb 6 11:10:41 2013 New Revision: 246396 URL: http://svnweb.freebsd.org/changeset/base/246396 Log: MFC r246113 and r246126: Add missing NULL pointer check. Reported by: Lars Engels Modified: stable/8/sys/dev/usb/controller/xhci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Wed Feb 6 11:08:11 2013 (r246395) +++ stable/8/sys/dev/usb/controller/xhci.c Wed Feb 6 11:10:41 2013 (r246396) @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF( + "short TD has no alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr || From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 11:16:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5FB31232; Wed, 6 Feb 2013 11:16:19 +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 52597166; Wed, 6 Feb 2013 11:16: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 r16BGJtE091367; Wed, 6 Feb 2013 11:16:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16BGJMJ091366; Wed, 6 Feb 2013 11:16:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061116.r16BGJMJ091366@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 11:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246397 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:16:19 -0000 Author: hselasky Date: Wed Feb 6 11:16:18 2013 New Revision: 246397 URL: http://svnweb.freebsd.org/changeset/base/246397 Log: Make sure that all mouse buttons are released when clients using /dev/consolectl close. This fixes a problem where if a USB mouse is detached while a button is pressed, that button is never released. MFC after: 1 week Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Feb 6 11:10:41 2013 (r246396) +++ head/sys/dev/syscons/syscons.c Wed Feb 6 11:16:18 2013 (r246397) @@ -253,11 +253,13 @@ static struct ttydevsw sc_ttydevsw = { }; static d_ioctl_t consolectl_ioctl; +static d_close_t consolectl_close; static struct cdevsw consolectl_devsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, .d_ioctl = consolectl_ioctl, + .d_close = consolectl_close, .d_name = "consolectl", }; @@ -1561,6 +1563,23 @@ consolectl_ioctl(struct cdev *dev, u_lon return sctty_ioctl(dev->si_drv1, cmd, data, td); } +static int +consolectl_close(struct cdev *dev, int flags, int mode, struct thread *td) +{ +#ifndef SC_NO_SYSMOUSE + mouse_info_t info; + memset(&info, 0, sizeof(info)); + info.operation = MOUSE_ACTION; + + /* + * Make sure all buttons are released when moused and other + * console daemons exit, so that no buttons are left pressed. + */ + (void) sctty_ioctl(dev->si_drv1, CONS_MOUSECTL, (caddr_t)&info, td); +#endif + return (0); +} + static void sc_cnprobe(struct consdev *cp) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 11:19:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 031C63D4; Wed, 6 Feb 2013 11:19:56 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.31]) by mx1.freebsd.org (Postfix) with ESMTP id 8DBD218C; Wed, 6 Feb 2013 11:19:55 +0000 (UTC) Received: from [78.35.134.81] (helo=fabiankeil.de) by smtprelay04.ispgateway.de with esmtpsa (SSLv3:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1U32iK-0004Pl-HA; Wed, 06 Feb 2013 11:58:52 +0100 Date: Wed, 6 Feb 2013 11:53:47 +0100 From: Fabian Keil To: Greg 'groggy' Lehey Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130206115347.00720818@fabiankeil.de> In-Reply-To: <20130206021818.GB2899@eureka.lemis.com> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <20130206021818.GB2899@eureka.lemis.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/M15pQTEgYfLA4C7=CXfzTb8"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= , svn-src-all@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:19:56 -0000 --Sig_/M15pQTEgYfLA4C7=CXfzTb8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Greg 'groggy' Lehey wrote: > On Tuesday, 5 February 2013 at 11:45:40 -0500, John Baldwin wrote: > > On Tuesday, February 05, 2013 9:39:38 am Dag-Erling SmXXrgrav wrote: > >> Author: des > >> Date: Tue Feb 5 14:39:37 2013 > >> New Revision: 246362 > >> URL: http://svnweb.freebsd.org/changeset/base/246362 > >> > >> Log: > >> Remove political propaganda > >> > >> Modified: > >> head/games/fortune/datfiles/fortunes-o.real > > > > *sigh* > > > > I'm sure there are other quotes that people who do not share your > > political persuasion might find propaganda or offensive, etc. > > Censorship and freedom of speech is quite a sticky widget, and I > > think the only truly sane policy is that fortune files are > > append-only (unless we outright remove them and that seems > > excessive). And new things should have a very high bar to be added > > to fortune. Perhaps we should move fortunes-o to ports entirely? >=20 > Agreed, it shouldn't be up to individuals to decide which fortunes are > *too* offensive. In this case, I suspect that there's a distinct > difference between the perceptions of people inside and outside the > USA. I also find Limbaugh particularly hard to stomach, but I don't > think it should have been removed. I'm somewhat amused that Limbaugh quotes are apparently considered too offensive for fortunes-o.real, while the Hitler quotes from games/fortune/datfiles/fortunes don't even qualify for fotunes-o. At least the first two aren't exactly pro-feminism either and I'm sure they could offend someone somewhere. > The real issue I see is that, for whatever reason, the Limbaugh > fortunes pop up far too frequently. It's as if the random number > generation is failing. Comments? D=C3=A9j=C3=A0 vu: http://lists.freebsd.org/pipermail/freebsd-current/2005-July/053125.html Fabian --Sig_/M15pQTEgYfLA4C7=CXfzTb8 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlESNloACgkQBYqIVf93VJ3u4QCff5jcmMo/Agxn+Xzo5YKtjh8C IW8An1lG61NEvs7pqjs/cbfQj9bCLL5f =niRb -----END PGP SIGNATURE----- --Sig_/M15pQTEgYfLA4C7=CXfzTb8-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:12:43 2013 Return-Path: Delivered-To: svn-src-all@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 46AAB53E; Wed, 6 Feb 2013 13:12:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CF3608F2; Wed, 6 Feb 2013 13:12:41 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA16332; Wed, 06 Feb 2013 15:12:40 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <511256C7.6080406@FreeBSD.org> Date: Wed, 06 Feb 2013 15:12:39 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130206 Thunderbird/17.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r246282 - in head/sys: conf kern References: <201302030957.r139vd8n027213@svn.freebsd.org> <201302041429.01477.jhb@freebsd.org> <51102076.8030302@FreeBSD.org> <201302051115.03275.jhb@freebsd.org> In-Reply-To: <201302051115.03275.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:12:43 -0000 on 05/02/2013 18:15 John Baldwin said the following: > Almost. To handle the case where the boot buffer might have wrapped I think > you should copy the entries at the "end" into the head of the KTR buffer > first, then the entries from the front to the current index, and then update > the index to point at the end (it should effectively be KTR_BOOT_ENTRIES > I think). I decided to just copy the whole buffer. That should cover all the possible cases and should not be too expensive. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:13:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5430D784; Wed, 6 Feb 2013 13:13:16 +0000 (UTC) (envelope-from zont@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 46ED48FD; Wed, 6 Feb 2013 13: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 r16DDGqt023752; Wed, 6 Feb 2013 13:13:16 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DDGoY023751; Wed, 6 Feb 2013 13:13:16 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061313.r16DDGoY023751@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246400 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:13:16 -0000 Author: zont Date: Wed Feb 6 13:13:15 2013 New Revision: 246400 URL: http://svnweb.freebsd.org/changeset/base/246400 Log: MFC r245457: - Detect when we are in KVM. Modified: stable/9/sys/kern/subr_param.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_param.c ============================================================================== --- stable/9/sys/kern/subr_param.c Wed Feb 6 11:59:32 2013 (r246399) +++ stable/9/sys/kern/subr_param.c Wed Feb 6 13:13:15 2013 (r246400) @@ -159,6 +159,7 @@ static const char *const vm_bnames[] = { "Plex86", /* Plex86 */ "Bochs", /* Bochs */ "Xen", /* Xen */ + "Seabios", /* KVM */ NULL }; @@ -167,6 +168,7 @@ static const char *const vm_pnames[] = { "Virtual Machine", /* Microsoft VirtualPC */ "VirtualBox", /* Sun xVM VirtualBox */ "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ NULL }; From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:14:31 2013 Return-Path: Delivered-To: svn-src-all@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 68F0C923; Wed, 6 Feb 2013 13:14:31 +0000 (UTC) (envelope-from zont@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 5673A914; Wed, 6 Feb 2013 13:14: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 r16DEVrS023957; Wed, 6 Feb 2013 13:14:31 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DEVOh023956; Wed, 6 Feb 2013 13:14:31 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061314.r16DEVOh023956@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246401 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:14:31 -0000 Author: zont Date: Wed Feb 6 13:14:30 2013 New Revision: 246401 URL: http://svnweb.freebsd.org/changeset/base/246401 Log: MFC r245457: - Detect when we are in KVM. Modified: stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Wed Feb 6 13:13:15 2013 (r246400) +++ stable/8/sys/kern/subr_param.c Wed Feb 6 13:14:30 2013 (r246401) @@ -155,6 +155,7 @@ static const char *const vm_bnames[] = { "Plex86", /* Plex86 */ "Bochs", /* Bochs */ "Xen", /* Xen */ + "Seabios", /* KVM */ NULL }; @@ -163,6 +164,7 @@ static const char *const vm_pnames[] = { "Virtual Machine", /* Microsoft VirtualPC */ "VirtualBox", /* Sun xVM VirtualBox */ "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ NULL }; From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:16:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C960CE3; Wed, 6 Feb 2013 13:16:44 +0000 (UTC) (envelope-from zont@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 F379F93E; Wed, 6 Feb 2013 13:16: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 r16DGh6Y024338; Wed, 6 Feb 2013 13:16:43 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DGh6m024337; Wed, 6 Feb 2013 13:16:43 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061316.r16DGh6m024337@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246402 - stable/9/usr.sbin/inetd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:16:44 -0000 Author: zont Date: Wed Feb 6 13:16:43 2013 New Revision: 246402 URL: http://svnweb.freebsd.org/changeset/base/246402 Log: MFC r245696: - Force inetd to have listen queue size to be set to the value of kern.ipc.somaxconn instead of hardcoded value 64. Modified: stable/9/usr.sbin/inetd/inetd.c Directory Properties: stable/9/usr.sbin/inetd/ (props changed) Modified: stable/9/usr.sbin/inetd/inetd.c ============================================================================== --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401) +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) } } if (sep->se_socktype == SOCK_STREAM) - listen(sep->se_fd, 64); + listen(sep->se_fd, -1); enable(sep); if (debug) { warnx("registered %s on %d", From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:17:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C8DFEF6; Wed, 6 Feb 2013 13:17:42 +0000 (UTC) (envelope-from zont@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 7E92C95D; Wed, 6 Feb 2013 13:17: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 r16DHgxs024484; Wed, 6 Feb 2013 13:17:42 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DHgxf024483; Wed, 6 Feb 2013 13:17:42 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061317.r16DHgxf024483@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246403 - stable/8/usr.sbin/inetd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:17:42 -0000 Author: zont Date: Wed Feb 6 13:17:41 2013 New Revision: 246403 URL: http://svnweb.freebsd.org/changeset/base/246403 Log: MFC r245696: - Force inetd to have listen queue size to be set to the value of kern.ipc.somaxconn instead of hardcoded value 64. Modified: stable/8/usr.sbin/inetd/inetd.c Directory Properties: stable/8/usr.sbin/inetd/ (props changed) Modified: stable/8/usr.sbin/inetd/inetd.c ============================================================================== --- stable/8/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) +++ stable/8/usr.sbin/inetd/inetd.c Wed Feb 6 13:17:41 2013 (r246403) @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) } } if (sep->se_socktype == SOCK_STREAM) - listen(sep->se_fd, 64); + listen(sep->se_fd, -1); enable(sep); if (debug) { warnx("registered %s on %d", From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:49:57 2013 Return-Path: Delivered-To: svn-src-all@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 0B07BB29; Wed, 6 Feb 2013 13:49:57 +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 F1BC6ACC; Wed, 6 Feb 2013 13:49: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 r16DnuYi032654; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DnuQ3032653; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302061349.r16DnuQ3032653@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Feb 2013 13:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246404 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:49:57 -0000 Author: kib Date: Wed Feb 6 13:49:56 2013 New Revision: 246404 URL: http://svnweb.freebsd.org/changeset/base/246404 Log: MFC r246118: The case of pid == WAIT_MYPGRP for the kern_wait() is already handled in kern_wait6(), which is called by kern_wait(). Remove the redundand check, introduced in r243136, and add a comment noting this, to make the code less confusing. Modified: stable/9/sys/kern/kern_exit.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Wed Feb 6 13:17:41 2013 (r246403) +++ stable/9/sys/kern/kern_exit.c Wed Feb 6 13:49:56 2013 (r246404) @@ -1019,20 +1019,18 @@ kern_wait(struct thread *td, pid_t pid, struct rusage *rusage) { struct __wrusage wru, *wrup; - struct proc *q; idtype_t idtype; id_t id; int ret; + /* + * Translate the special pid values into the (idtype, pid) + * pair for kern_wait6. The WAIT_MYPGRP case is handled by + * kern_wait6() on its own. + */ if (pid == WAIT_ANY) { idtype = P_ALL; id = 0; - } else if (pid == WAIT_MYPGRP) { - idtype = P_PGID; - q = td->td_proc; - PROC_LOCK(q); - id = (id_t)q->p_pgid; - PROC_UNLOCK(q); } else if (pid < 0) { idtype = P_PGID; id = (id_t)-pid; @@ -1040,10 +1038,12 @@ kern_wait(struct thread *td, pid_t pid, idtype = P_PID; id = (id_t)pid; } + if (rusage != NULL) wrup = &wru; else wrup = NULL; + /* * For backward compatibility we implicitly add flags WEXITED * and WTRAPPED here. From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:54:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32E78D53; Wed, 6 Feb 2013 13:54:00 +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 01AD1AF4; Wed, 6 Feb 2013 13:54: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 r16DrxB6034669; Wed, 6 Feb 2013 13:53:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DrxgG034668; Wed, 6 Feb 2013 13:53:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302061353.r16DrxgG034668@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Feb 2013 13:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246405 - stable/9/tools/test/pthread_vfork X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:54:00 -0000 Author: kib Date: Wed Feb 6 13:53:59 2013 New Revision: 246405 URL: http://svnweb.freebsd.org/changeset/base/246405 Log: MFC r246119: Rework the handling of the children for the pthread_vfork_test. The trivial handler for SIGCHLD is installed, and SIGCHLD is blocked, to not abandon our zombies to init(8). This way, the zombies are around slightly longer, allowing to actually exercise the logic for p_pwait use by the test. Modified: stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Directory Properties: stable/9/tools/test/pthread_vfork/ (props changed) Modified: stable/9/tools/test/pthread_vfork/pthread_vfork_test.c ============================================================================== --- stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Wed Feb 6 13:49:56 2013 (r246404) +++ stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Wed Feb 6 13:53:59 2013 (r246405) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -39,10 +41,11 @@ __FBSDID("$FreeBSD$"); #define NUM_THREADS 100 -void * -vfork_test(void *threadid) +static void * +vfork_test(void *threadid __unused) { - pid_t pid; + pid_t pid, wpid; + int status; for (;;) { pid = vfork(); @@ -50,10 +53,20 @@ vfork_test(void *threadid) _exit(0); else if (pid == -1) err(1, "Failed to vfork"); + else { + wpid = waitpid(pid, &status, 0); + if (wpid == -1) + err(1, "waitpid"); + } } return (NULL); } +static void +sighandler(int signo __unused) +{ +} + /* * This program invokes multiple threads and each thread calls * vfork() system call. @@ -63,19 +76,24 @@ main(void) { pthread_t threads[NUM_THREADS]; struct sigaction reapchildren; + sigset_t sigchld_mask; int rc, t; memset(&reapchildren, 0, sizeof(reapchildren)); - reapchildren.sa_handler = SIG_IGN; - - /* Automatically reap zombies. */ + reapchildren.sa_handler = sighandler; if (sigaction(SIGCHLD, &reapchildren, NULL) == -1) err(1, "Could not sigaction(SIGCHLD)"); + sigemptyset(&sigchld_mask); + sigaddset(&sigchld_mask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigchld_mask, NULL) == -1) + err(1, "sigprocmask"); + for (t = 0; t < NUM_THREADS; t++) { - rc = pthread_create(&threads[t], NULL, vfork_test, (void *)t); + rc = pthread_create(&threads[t], NULL, vfork_test, &t); if (rc) errc(1, rc, "pthread_create"); } + pause(); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 13:55:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23B50EFB; Wed, 6 Feb 2013 13:55:03 +0000 (UTC) (envelope-from nyan@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 16661B1A; Wed, 6 Feb 2013 13:55:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16Dt2B9034841; Wed, 6 Feb 2013 13:55:02 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16Dt2qp034840; Wed, 6 Feb 2013 13:55:02 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201302061355.r16Dt2qp034840@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 6 Feb 2013 13:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246406 - stable/9/sys/pc98/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:55:03 -0000 Author: nyan Date: Wed Feb 6 13:55:02 2013 New Revision: 246406 URL: http://svnweb.freebsd.org/changeset/base/246406 Log: MFi386: Remove firewire devices. Modified: stable/9/sys/pc98/conf/GENERIC Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Wed Feb 6 13:53:59 2013 (r246405) +++ stable/9/sys/pc98/conf/GENERIC Wed Feb 6 13:55:02 2013 (r246406) @@ -268,10 +268,6 @@ device bpf # Berkeley packet filter #device ural # Ralink Technology RT2500USB wireless NICs #device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -#device sbp # SCSI over FireWire (Requires scbus and da) -#device fwe # Ethernet over FireWire (non-standard!) - # Sound support #device sound # Generic sound driver (required) #device snd_mss # Microsoft Sound System From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:12:14 2013 Return-Path: Delivered-To: svn-src-all@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 4A6DD62C; Wed, 6 Feb 2013 14:12:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id E0E0CD6C; Wed, 6 Feb 2013 14:12:13 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r16ECDYw010769; Wed, 6 Feb 2013 07:12:13 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r16EC13g033243; Wed, 6 Feb 2013 07:12:01 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: svn commit: r246402 - stable/9/usr.sbin/inetd From: Ian Lepore To: Andrey Zonov In-Reply-To: <201302061316.r16DGh6m024337@svn.freebsd.org> References: <201302061316.r16DGh6m024337@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 06 Feb 2013 07:12:00 -0700 Message-ID: <1360159920.93359.594.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:12:14 -0000 On Wed, 2013-02-06 at 13:16 +0000, Andrey Zonov wrote: > Author: zont > Date: Wed Feb 6 13:16:43 2013 > New Revision: 246402 > URL: http://svnweb.freebsd.org/changeset/base/246402 > > Log: > MFC r245696: > - Force inetd to have listen queue size to be set to the value of > kern.ipc.somaxconn instead of hardcoded value 64. > > Modified: > stable/9/usr.sbin/inetd/inetd.c > Directory Properties: > stable/9/usr.sbin/inetd/ (props changed) > > Modified: stable/9/usr.sbin/inetd/inetd.c > ============================================================================== > --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401) > +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) > @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) > } > } > if (sep->se_socktype == SOCK_STREAM) > - listen(sep->se_fd, 64); > + listen(sep->se_fd, -1); > enable(sep); > if (debug) { > warnx("registered %s on %d", I recently discovered that the posix documentation for listen(2) states that a queue depth less than zero is to be treated as if zero were specified, and the behavior for zero is to minimize the length of the queue to the smallest value the implementation supports (with words that imply the desired (but not required) effect is to stop listening if possible). Given that, perhaps it's unwise to expand the amount of code we've got that relies on this freebsd-specific non-conformance? -- Ian From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:22:07 2013 Return-Path: Delivered-To: svn-src-all@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 263F7C8A; Wed, 6 Feb 2013 14:22:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CDB13DF3; Wed, 6 Feb 2013 14:22:05 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA17072; Wed, 06 Feb 2013 16:22:04 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <5112670B.5030003@FreeBSD.org> Date: Wed, 06 Feb 2013 16:22:03 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130206 Thunderbird/17.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r246282 - in head/sys: conf kern References: <201302030957.r139vd8n027213@svn.freebsd.org> <201302041429.01477.jhb@freebsd.org> <51102076.8030302@FreeBSD.org> <201302051115.03275.jhb@freebsd.org> <511256C7.6080406@FreeBSD.org> In-Reply-To: <511256C7.6080406@FreeBSD.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:22:07 -0000 on 06/02/2013 15:12 Andriy Gapon said the following: > on 05/02/2013 18:15 John Baldwin said the following: >> Almost. To handle the case where the boot buffer might have wrapped I think >> you should copy the entries at the "end" into the head of the KTR buffer >> first, then the entries from the front to the current index, and then update >> the index to point at the end (it should effectively be KTR_BOOT_ENTRIES >> I think). > > I decided to just copy the whole buffer. That should cover all the possible cases > and should not be too expensive. > Hmm, or not. Let me think again about the wrap-around case and a larger buffer. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:30:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2E00F3EE; Wed, 6 Feb 2013 14:30:06 +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 E6051E7F; Wed, 6 Feb 2013 14:30:05 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 6B8836D02; Wed, 6 Feb 2013 14:29:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 36E40AEAB; Wed, 6 Feb 2013 15:29:59 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Fabian Keil Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <20130206021818.GB2899@eureka.lemis.com> <20130206115347.00720818@fabiankeil.de> Date: Wed, 06 Feb 2013 15:29:58 +0100 In-Reply-To: <20130206115347.00720818@fabiankeil.de> (Fabian Keil's message of "Wed, 6 Feb 2013 11:53:47 +0100") Message-ID: <86halph5w9.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Greg 'groggy' Lehey , svn-src-all@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:30:06 -0000 Fabian Keil writes: > I'm somewhat amused that Limbaugh quotes are apparently considered > too offensive for fortunes-o.real, while the Hitler quotes from > games/fortune/datfiles/fortunes don't even qualify for fotunes-o. That was, believe it or not, the result of a lengthy discussion in which it was concluded that the Hitler quotes were appropriate because they were intended to ridicule his views. I don't necessarily agree with that line of reasoning, but the difference here is that while Hitler is relatively ancient history, Limbaugh is very much part of the current political landscape and were added by someone who espouses his views, which in my mind makes them political propaganda. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:34:44 2013 Return-Path: Delivered-To: svn-src-all@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 20720518; Wed, 6 Feb 2013 14:34:44 +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 CF44CEAE; Wed, 6 Feb 2013 14:34:43 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 0EBC16D1A; Wed, 6 Feb 2013 14:34:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D28C9AEAE; Wed, 6 Feb 2013 15:34:42 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gleb Smirnoff Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> <201302051617.25454.jhb@freebsd.org> <20130206071807.GN26896@FreeBSD.org> Date: Wed, 06 Feb 2013 15:34:42 +0100 In-Reply-To: <20130206071807.GN26896@FreeBSD.org> (Gleb Smirnoff's message of "Wed, 6 Feb 2013 11:18:07 +0400") Message-ID: <86d2wdh5od.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:34:44 -0000 Gleb Smirnoff writes: > The yesterday bikeshed proves that "most" isn't enough. :( The entire > games subdir needs to be moved. fortune(6) in itself is quite useful (try it with -e freebsd-tips). Some of the content is objectionable, but that does not justify removing the tool itself, although I wish we'd sort out the build process so strfile(8) didn't have to be a build tool. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:37:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 601296A0; Wed, 6 Feb 2013 14:37:01 +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 14175ED0; Wed, 6 Feb 2013 14:37:00 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 51AE36D22; Wed, 6 Feb 2013 14:37:00 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 0B267AEB0; Wed, 6 Feb 2013 15:37:00 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Greg 'groggy' Lehey Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <20130206021818.GB2899@eureka.lemis.com> Date: Wed, 06 Feb 2013 15:36:59 +0100 In-Reply-To: <20130206021818.GB2899@eureka.lemis.com> (Greg Lehey's message of "Wed, 6 Feb 2013 13:18:18 +1100") Message-ID: <868v71h5kk.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (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, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:37:01 -0000 Greg 'groggy' Lehey writes: > The real issue I see is that, for whatever reason, the Limbaugh > fortunes pop up far too frequently. It's as if the random number > generation is failing. Comments? Not sure how often is too often, but there were 35 of them, which is approximately 1.5% of fortunes-o, so even with a fair random generator, they'd show up quite often. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 14:41:52 2013 Return-Path: Delivered-To: svn-src-all@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 F171AA86; Wed, 6 Feb 2013 14:41:51 +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 B7859F24; Wed, 6 Feb 2013 14:41:51 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A4CD9B915; Wed, 6 Feb 2013 09:41:49 -0500 (EST) From: John Baldwin To: Andriy Gapon Subject: Re: svn commit: r246282 - in head/sys: conf kern Date: Wed, 6 Feb 2013 08:22:10 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302030957.r139vd8n027213@svn.freebsd.org> <201302051115.03275.jhb@freebsd.org> <511256C7.6080406@FreeBSD.org> In-Reply-To: <511256C7.6080406@FreeBSD.org> X-KMail-Markup: true MIME-Version: 1.0 Message-Id: <201302060822.10573.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 06 Feb 2013 09:41:49 -0500 (EST) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:41:52 -0000 On Wednesday, February 06, 2013 8:12:39 am Andriy Gapon wrote: > on 05/02/2013 18:15 John Baldwin said the following: > > Almost. To handle the case where the boot buffer might have wrapped I think > > you should copy the entries at the "end" into the head of the KTR buffer > > first, then the entries from the front to the current index, and then update > > the index to point at the end (it should effectively be KTR_BOOT_ENTRIES > > I think). > > I decided to just copy the whole buffer. That should cover all the possible cases > and should not be too expensive. Hmm, I think this doesn't quite work. Suppose the buffer has wrapped but only a few new entries are logged (so that there are zero'd entries at the end of the larger buffer). In this case that things like 'ktrdump' and 'show ktr' will only show events from the start of the buffer up to the index and will miss the old events after the current index. (They walk the buffer backwards and stop at the first "empty" entry.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 15:18:47 2013 Return-Path: Delivered-To: svn-src-all@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 315D6D80; Wed, 6 Feb 2013 15:18:47 +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 23D5B1D4; Wed, 6 Feb 2013 15:18: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 r16FIknr057712; Wed, 6 Feb 2013 15:18:46 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16FIkeC057711; Wed, 6 Feb 2013 15:18:46 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302061518.r16FIkeC057711@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 6 Feb 2013 15:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246412 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 15:18:47 -0000 Author: pluknet Date: Wed Feb 6 15:18:46 2013 New Revision: 246412 URL: http://svnweb.freebsd.org/changeset/base/246412 Log: Prezero the acl structure which is to be copied to usermode, to avoid leakage of the previous content of padding and unitialized fields. Reported by: Ilia Noskov Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Wed Feb 6 15:08:41 2013 (r246411) +++ head/sys/kern/vfs_acl.c Wed Feb 6 15:18:46 2013 (r246412) @@ -247,7 +247,7 @@ vacl_get_acl(struct thread *td, struct v struct acl *inkernelacl; int error; - inkernelacl = acl_alloc(M_WAITOK); + inkernelacl = acl_alloc(M_WAITOK | M_ZERO); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_vnode_check_getacl(td->td_ucred, vp, type); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 15:36:16 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1FCD90D; Wed, 6 Feb 2013 15:36:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 688A8308; Wed, 6 Feb 2013 15:36:16 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r16FaFSa011707; Wed, 6 Feb 2013 08:36:15 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r16FaCeI033362; Wed, 6 Feb 2013 08:36:12 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: svn commit: r246397 - head/sys/dev/syscons From: Ian Lepore To: Hans Petter Selasky In-Reply-To: <201302061116.r16BGJMJ091366@svn.freebsd.org> References: <201302061116.r16BGJMJ091366@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 06 Feb 2013 08:36:12 -0700 Message-ID: <1360164972.93359.606.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 15:36:16 -0000 On Wed, 2013-02-06 at 11:16 +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Feb 6 11:16:18 2013 > New Revision: 246397 > URL: http://svnweb.freebsd.org/changeset/base/246397 > > Log: > Make sure that all mouse buttons are released when clients > using /dev/consolectl close. This fixes a problem where if > a USB mouse is detached while a button is pressed, that > button is never released. > > MFC after: 1 week > > Modified: > head/sys/dev/syscons/syscons.c > > Modified: head/sys/dev/syscons/syscons.c > ============================================================================== > --- head/sys/dev/syscons/syscons.c Wed Feb 6 11:10:41 2013 (r246396) > +++ head/sys/dev/syscons/syscons.c Wed Feb 6 11:16:18 2013 (r246397) > @@ -253,11 +253,13 @@ static struct ttydevsw sc_ttydevsw = { > }; > > static d_ioctl_t consolectl_ioctl; > +static d_close_t consolectl_close; > > static struct cdevsw consolectl_devsw = { > .d_version = D_VERSION, > - .d_flags = D_NEEDGIANT, > + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, > .d_ioctl = consolectl_ioctl, > + .d_close = consolectl_close, > .d_name = "consolectl", > }; > > @@ -1561,6 +1563,23 @@ consolectl_ioctl(struct cdev *dev, u_lon > return sctty_ioctl(dev->si_drv1, cmd, data, td); > } > > +static int > +consolectl_close(struct cdev *dev, int flags, int mode, struct thread *td) > +{ > +#ifndef SC_NO_SYSMOUSE > + mouse_info_t info; > + memset(&info, 0, sizeof(info)); > + info.operation = MOUSE_ACTION; > + > + /* > + * Make sure all buttons are released when moused and other > + * console daemons exit, so that no buttons are left pressed. > + */ > + (void) sctty_ioctl(dev->si_drv1, CONS_MOUSECTL, (caddr_t)&info, td); > +#endif > + return (0); > +} > + > static void > sc_cnprobe(struct consdev *cp) > { I think the D_TRACKCLOSE flag is not what you want here. Based on my (admittedly still vague) understanding of it, that flag is almost never the right thing for a driver to use. If you need that action to be taken when the last open instance of the driver is closed, that's what you get without D_TRACKCLOSE. If you need it to be called as many times as the open routine was called... well, that's the the confusing thing. It's not clear to me that there's any way to get that effect, but the cdevpriv destructor may be the closest thing available. I think the essential problem is that open and close are not strictly paired. For example, a forked child inherits open descriptors without open() calls happening, and revoke() is a way to destroy references without a close() call. But the details of all this are murky to me, and the most-enlightening mailing list posts you can find on it are full of phrases like "vref counters for devfs nodes" and "vnode is reclaimed" that make the discussion difficult to follow if you're not intimate with the internals of the vm system. -- Ian From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 16:20:18 2013 Return-Path: Delivered-To: svn-src-all@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 83851AA0; Wed, 6 Feb 2013 16:20:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1BF71B; Wed, 6 Feb 2013 16:20:16 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 376074392; Wed, 06 Feb 2013 17:20:14 +0100 From: Hans Petter Selasky To: Ian Lepore Subject: Re: svn commit: r246397 - head/sys/dev/syscons Date: Wed, 6 Feb 2013 17:21:24 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201302061116.r16BGJMJ091366@svn.freebsd.org> <1360164972.93359.606.camel@revolution.hippie.lan> In-Reply-To: <1360164972.93359.606.camel@revolution.hippie.lan> X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 16:20:18 -0000 On Wednesday 06 February 2013 16:36:12 Ian Lepore wrote: > On Wed, 2013-02-06 at 11:16 +0000, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Wed Feb 6 11:16:18 2013 > > New Revision: 246397 > > URL: http://svnweb.freebsd.org/changeset/base/246397 > > > > Log: > > Make sure that all mouse buttons are released when clients > > using /dev/consolectl close. This fixes a problem where if > > a USB mouse is detached while a button is pressed, that > > button is never released. > > > > MFC after: 1 week > > > > Modified: > > head/sys/dev/syscons/syscons.c > > > > Modified: head/sys/dev/syscons/syscons.c > > ========================================================================= > > ===== --- head/sys/dev/syscons/syscons.c Wed Feb 6 11:10:41 > > 2013 (r246396) +++ head/sys/dev/syscons/syscons.c Wed Feb 6 11:16:18 > > 2013 (r246397) @@ -253,11 +253,13 @@ static struct ttydevsw sc_ttydevsw > > = { > > > > }; > > > > static d_ioctl_t consolectl_ioctl; > > > > +static d_close_t consolectl_close; > > > > static struct cdevsw consolectl_devsw = { > > > > .d_version = D_VERSION, > > > > - .d_flags = D_NEEDGIANT, > > + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, > > > > .d_ioctl = consolectl_ioctl, > > > > + .d_close = consolectl_close, > > > > .d_name = "consolectl", > > > > }; > > > > @@ -1561,6 +1563,23 @@ consolectl_ioctl(struct cdev *dev, u_lon > > > > return sctty_ioctl(dev->si_drv1, cmd, data, td); > > > > } > > > > +static int > > +consolectl_close(struct cdev *dev, int flags, int mode, struct thread > > *td) +{ > > +#ifndef SC_NO_SYSMOUSE > > + mouse_info_t info; > > + memset(&info, 0, sizeof(info)); > > + info.operation = MOUSE_ACTION; > > + > > + /* > > + * Make sure all buttons are released when moused and other > > + * console daemons exit, so that no buttons are left pressed. > > + */ > > + (void) sctty_ioctl(dev->si_drv1, CONS_MOUSECTL, (caddr_t)&info, td); > > +#endif > > + return (0); > > +} > > + > > > > static void > > sc_cnprobe(struct consdev *cp) > > { > Hi Ian, > I think the D_TRACKCLOSE flag is not what you want here. Based on my > (admittedly still vague) understanding of it, that flag is almost never > the right thing for a driver to use. > > If you need that action to be taken when the last open instance of the > driver is closed, I don't want to wait until the last instance is closed. There are multiple instances of moused, for example. Each instance has a handle on /dev/consolectl . When one moused instance exits it closes this handle and I want to flush the mouse buttons. I tought about adding a cdevpriv structure to keep track of the mouse buttons on this file handle, though that seems to be overkill. > that's what you get without D_TRACKCLOSE. If you need > it to be called as many times as the open routine was called... well, > that's the the confusing thing. It's not clear to me that there's any > way to get that effect, but the cdevpriv destructor may be the closest > thing available. D_TRACKCLOSE was added to get the close call through each time. > > I think the essential problem is that open and close are not strictly > paired. That only happens when you destroy the device and the consolectl device is not destroyed. Else they will be paired. > For example, a forked child inherits open descriptors without > open() calls happening, and revoke() is a way to destroy references > without a close() call. But the details of all this are murky to me, > and the most-enlightening mailing list posts you can find on it are full > of phrases like "vref counters for devfs nodes" and "vnode is reclaimed" > that make the discussion difficult to follow if you're not intimate with > the internals of the vm system. Right, what other clients of /dev/consolectl do we have? And do some of them pass on the FD like you describe? --HPS From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 17:06:53 2013 Return-Path: Delivered-To: svn-src-all@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 4870A7DB; Wed, 6 Feb 2013 17:06: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 2C28AAEA; Wed, 6 Feb 2013 17:06: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 r16H6row088895; Wed, 6 Feb 2013 17:06:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16H6qMo088889; Wed, 6 Feb 2013 17:06:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302061706.r16H6qMo088889@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Feb 2013 17:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246417 - in head/sys: fs/nfs kern nfsclient sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 17:06:53 -0000 Author: jhb Date: Wed Feb 6 17:06:51 2013 New Revision: 246417 URL: http://svnweb.freebsd.org/changeset/base/246417 Log: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Also, instead of setting PBDRY on individual sleeps, the NFS client now sets the TDF_SBDRY flag around each NFS request and stop signals are masked for all sleeps during that region (the previous change missed sleeps in lockmgr locks). The end result is that stop signals sent to threads performing an NFS request are completely ignored until after the NFS request has finished processing and the thread prepares to return to userland. This restores the behavior of stop signals being transparent to userland processes while still preventing threads from suspending while holding NFS locks. Reviewed by: kib MFC after: 1 month Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/kern/kern_sig.c head/sys/kern/subr_sleepqueue.c head/sys/nfsclient/nfs_krpc.c head/sys/sys/signalvar.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Feb 6 16:43:35 2013 (r246416) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Feb 6 17:06:51 2013 (r246417) @@ -1031,7 +1031,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -1052,7 +1051,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -1081,8 +1080,10 @@ 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); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void @@ -1091,6 +1092,7 @@ 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/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Feb 6 16:43:35 2013 (r246416) +++ head/sys/kern/kern_sig.c Wed Feb 6 17:06:51 2013 (r246417) @@ -2364,6 +2364,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2404,12 +2411,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2529,6 +2537,34 @@ tdsigcleanup(struct thread *td) } +/* Defer the delivery of SIGSTOP for the current thread. */ +void +sigdeferstop(struct thread *td) +{ + + KASSERT(!(td->td_flags & TDF_SBDRY), + ("attempt to set TDF_SBDRY recursively")); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop(struct thread *td) +{ + + KASSERT(td->td_flags & TDF_SBDRY, + ("attempt to clear already-cleared TDF_SBDRY")); + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + /* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. @@ -2561,7 +2597,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2677,10 +2713,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed Feb 6 16:43:35 2013 (r246416) +++ head/sys/kern/subr_sleepqueue.c Wed Feb 6 17:06:51 2013 (r246417) @@ -352,8 +352,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -600,7 +598,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -747,7 +745,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Wed Feb 6 16:43:35 2013 (r246416) +++ head/sys/nfsclient/nfs_krpc.c Wed Feb 6 17:06:51 2013 (r246417) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,10 @@ 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); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void @@ -759,6 +760,7 @@ 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/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Wed Feb 6 16:43:35 2013 (r246416) +++ head/sys/sys/signalvar.h Wed Feb 6 17:06:51 2013 (r246417) @@ -328,6 +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); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 17:32:24 2013 Return-Path: Delivered-To: svn-src-all@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 B715D41A; Wed, 6 Feb 2013 17:32:24 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A292BCE9; Wed, 6 Feb 2013 17:32:24 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3F6FC1A3C1F; Wed, 6 Feb 2013 09:32:24 -0800 (PST) Message-ID: <511293A7.1050701@mu.org> Date: Wed, 06 Feb 2013 09:32:23 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= Subject: Re: svn commit: r246362 - head/games/fortune/datfiles References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <20130206021818.GB2899@eureka.lemis.com> <868v71h5kk.fsf@ds4.des.no> In-Reply-To: <868v71h5kk.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Greg 'groggy' Lehey , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 17:32:24 -0000 On 2/6/13 6:36 AM, Dag-Erling Smørgrav wrote: > Greg 'groggy' Lehey writes: >> The real issue I see is that, for whatever reason, the Limbaugh >> fortunes pop up far too frequently. It's as if the random number >> generation is failing. Comments? > Not sure how often is too often, but there were 35 of them, which is > approximately 1.5% of fortunes-o, so even with a fair random generator, > they'd show up quite often. > > DES As an aside, I'm not sure if the presence of them is meant to offend liberals or conservatives because regardless of your affiliation they are pretty hilarious. -Alfred From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 17:43:06 2013 Return-Path: Delivered-To: svn-src-all@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 C93E564E; Wed, 6 Feb 2013 17:43:06 +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 AC28AD54; Wed, 6 Feb 2013 17:43: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 r16Hh6GT001216; Wed, 6 Feb 2013 17:43:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16Hh6nA001213; Wed, 6 Feb 2013 17:43:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061743.r16Hh6nA001213@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 17:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246421 - in head/sys/dev/sound: pcm usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 17:43:06 -0000 Author: hselasky Date: Wed Feb 6 17:43:05 2013 New Revision: 246421 URL: http://svnweb.freebsd.org/changeset/base/246421 Log: Add support for buttons on USB audio devices, like Volume Up and Volume Down. Reviewed by: mav @ MFC after: 1 week Modified: head/sys/dev/sound/pcm/mixer.c head/sys/dev/sound/pcm/mixer.h head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Wed Feb 6 17:27:41 2013 (r246420) +++ head/sys/dev/sound/pcm/mixer.c Wed Feb 6 17:43:05 2013 (r246421) @@ -1492,3 +1492,30 @@ mixer_get_lock(struct snd_mixer *m) } return (m->lock); } + +int +mix_get_locked(struct snd_mixer *m, u_int dev, int *pleft, int *pright) +{ + int level; + + level = mixer_get(m, dev); + if (level < 0) { + *pright = *pleft = -1; + return (-1); + } + + *pleft = level & 0xFF; + *pright = (level >> 8) & 0xFF; + + return (0); +} + +int +mix_set_locked(struct snd_mixer *m, u_int dev, int left, int right) +{ + int level; + + level = (left & 0xFF) | ((right & 0xFF) << 8); + + return (mixer_set(m, dev, level)); +} Modified: head/sys/dev/sound/pcm/mixer.h ============================================================================== --- head/sys/dev/sound/pcm/mixer.h Wed Feb 6 17:27:41 2013 (r246420) +++ head/sys/dev/sound/pcm/mixer.h Wed Feb 6 17:43:05 2013 (r246421) @@ -45,6 +45,8 @@ void mixer_hwvol_step(device_t dev, int int mixer_busy(struct snd_mixer *m); +int mix_get_locked(struct snd_mixer *m, u_int dev, int *pleft, int *pright); +int mix_set_locked(struct snd_mixer *m, u_int dev, int left, int right); int mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right); int mix_get(struct snd_mixer *m, u_int dev); int mix_setrecsrc(struct snd_mixer *m, u_int32_t src); Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Feb 6 17:27:41 2013 (r246420) +++ head/sys/dev/sound/usb/uaudio.c Wed Feb 6 17:43:05 2013 (r246421) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define USB_DEBUG_VAR uaudio_debug @@ -277,16 +278,37 @@ struct uaudio_search_result { uint8_t is_input; }; +enum { + UAUDIO_HID_RX_TRANSFER, + UAUDIO_HID_N_TRANSFER, +}; + +struct uaudio_hid { + struct usb_xfer *xfer[UAUDIO_HID_N_TRANSFER]; + struct hid_location volume_up_loc; + struct hid_location volume_down_loc; + uint32_t flags; +#define UAUDIO_HID_VALID 0x0001 +#define UAUDIO_HID_HAS_ID 0x0002 +#define UAUDIO_HID_HAS_VOLUME_UP 0x0004 +#define UAUDIO_HID_HAS_VOLUME_DOWN 0x0008 + uint8_t iface_index; + uint8_t volume_up_id; + uint8_t volume_down_id; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_hid sc_hid; struct uaudio_search_result sc_mixer_clocks; struct uaudio_mixer_node sc_mixer_node; struct mtx *sc_mixer_lock; + struct snd_mixer *sc_mixer_dev; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; @@ -407,6 +429,7 @@ static usb_callback_t uaudio_chan_record static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; +static usb_callback_t uaudio_hid_rx_callback; /* ==== USB mixer ==== */ @@ -500,6 +523,9 @@ static void umidi_close(struct usb_fifo static void umidi_init(device_t dev); static int umidi_probe(device_t dev); static int umidi_detach(device_t dev); +static int uaudio_hid_probe(struct uaudio_softc *sc, + struct usb_attach_arg *uaa); +static void uaudio_hid_detach(struct uaudio_softc *sc); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( @@ -624,6 +650,18 @@ static const struct usb_config }, }; +static const struct usb_config + uaudio_hid_config[UAUDIO_HID_N_TRANSFER] = { + [UAUDIO_HID_RX_TRANSFER] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use wMaxPacketSize */ + .flags = {.short_xfer_ok = 1,}, + .callback = &uaudio_hid_rx_callback, + }, +}; + static devclass_t uaudio_devclass; static device_method_t uaudio_methods[] = { @@ -896,7 +934,7 @@ uaudio_attach(device_t dev) } device_printf(dev, "MIDI sequencer.\n"); } else { - device_printf(dev, "No midi sequencer.\n"); + device_printf(dev, "No MIDI sequencer.\n"); } DPRINTF("doing child attach\n"); @@ -926,6 +964,12 @@ uaudio_attach(device_t dev) goto detach; } + if (uaudio_hid_probe(sc, uaa) == 0) { + device_printf(dev, "HID volume keys found.\n"); + } else { + device_printf(dev, "No HID volume keys found.\n"); + } + /* reload all mixer settings */ uaudio_mixer_reload_all(sc); @@ -1034,6 +1078,8 @@ uaudio_detach(device_t dev) if (sc->sc_rec_chan.valid) usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); + uaudio_hid_detach(sc); + if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } @@ -1213,6 +1259,18 @@ uaudio_chan_fill_info_sub(struct uaudio_ alt_index++; } + if ((!(sc->sc_hid.flags & UAUDIO_HID_VALID)) && + (id->bInterfaceClass == UICLASS_HID) && + (id->bInterfaceSubClass == 0) && + (id->bInterfaceProtocol == 0) && + (alt_index == 0) && + usbd_get_iface(udev, curidx) != NULL) { + DPRINTF("Found HID interface at %d\n", + curidx); + sc->sc_hid.flags |= UAUDIO_HID_VALID; + sc->sc_hid.iface_index = curidx; + } + uma_if_class = ((id->bInterfaceClass == UICLASS_AUDIO) || ((id->bInterfaceClass == UICLASS_VENDOR) && @@ -2490,6 +2548,9 @@ uaudio_mixer_reload_all(struct uaudio_so pmc->update[chan / 8] |= (1 << (chan % 8)); } usbd_transfer_start(sc->sc_mixer_xfer[0]); + + /* start HID volume keys, if any */ + usbd_transfer_start(sc->sc_hid.xfer[0]); mtx_unlock(sc->sc_mixer_lock); } @@ -4818,6 +4879,7 @@ uaudio_mixer_init_sub(struct uaudio_soft DPRINTF("\n"); sc->sc_mixer_lock = mixer_get_lock(m); + sc->sc_mixer_dev = m; if (usbd_transfer_setup(sc->sc_udev, &sc->sc_mixer_iface_index, sc->sc_mixer_xfer, uaudio_mixer_config, 1, sc, @@ -5452,6 +5514,162 @@ umidi_detach(device_t dev) return (0); } +static void +uaudio_hid_rx_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uaudio_softc *sc = usbd_xfer_softc(xfer); + const uint8_t *buffer = usbd_xfer_get_frame_buffer(xfer, 0); + struct snd_mixer *m; + int v; + int v_l; + int v_r; + uint8_t id; + int actlen; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + DPRINTF("actlen=%d\n", actlen); + + if (actlen != 0 && + (sc->sc_hid.flags & UAUDIO_HID_HAS_ID)) { + id = *buffer; + buffer++; + actlen--; + } else { + id = 0; + } + + m = sc->sc_mixer_dev; + + if ((sc->sc_hid.flags & UAUDIO_HID_HAS_VOLUME_UP) && + (sc->sc_hid.volume_up_id == id) && + hid_get_data(buffer, actlen, + &sc->sc_hid.volume_up_loc)) { + + DPRINTF("Volume Up\n"); + + v = mix_get_locked(m, SOUND_MIXER_PCM, &v_l, &v_r); + if (v == 0) { + v = ((v_l + v_r) / 2) + 5; + if (v > 100) + v = 100; + mix_set_locked(m, SOUND_MIXER_PCM, v, v); + } + } + + if ((sc->sc_hid.flags & UAUDIO_HID_HAS_VOLUME_DOWN) && + (sc->sc_hid.volume_down_id == id) && + hid_get_data(buffer, actlen, + &sc->sc_hid.volume_down_loc)) { + + DPRINTF("Volume Down\n"); + + v = mix_get_locked(m, SOUND_MIXER_PCM, &v_l, &v_r); + if (v == 0) { + v = ((v_l + v_r) / 2) - 5; + if (v < 0) + v = 0; + mix_set_locked(m, SOUND_MIXER_PCM, v, v); + } + } + + case USB_ST_SETUP: +tr_setup: + /* check if we can put more data into the FIFO */ + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static int +uaudio_hid_probe(struct uaudio_softc *sc, + struct usb_attach_arg *uaa) +{ + void *d_ptr; + uint32_t flags; + uint16_t d_len; + uint8_t id; + int error; + + if (!(sc->sc_hid.flags & UAUDIO_HID_VALID)) + return (-1); + + if (sc->sc_mixer_lock == NULL) + return (-1); + + /* Get HID descriptor */ + error = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, + &d_len, M_TEMP, sc->sc_hid.iface_index); + + if (error) { + DPRINTF("error reading report description\n"); + return (-1); + } + + /* check if there is an ID byte */ + hid_report_size(d_ptr, d_len, hid_input, &id); + + if (id != 0) + sc->sc_hid.flags |= UAUDIO_HID_HAS_ID; + + if (hid_locate(d_ptr, d_len, + HID_USAGE2(HUP_CONSUMER, 0xE9 /* Volume Increment */), + hid_input, 0, &sc->sc_hid.volume_up_loc, &flags, + &sc->sc_hid.volume_up_id)) { + if (flags & HIO_VARIABLE) + sc->sc_hid.flags |= UAUDIO_HID_HAS_VOLUME_UP; + DPRINTFN(1, "Found Volume Up key\n"); + } + + if (hid_locate(d_ptr, d_len, + HID_USAGE2(HUP_CONSUMER, 0xEA /* Volume Decrement */), + hid_input, 0, &sc->sc_hid.volume_down_loc, &flags, + &sc->sc_hid.volume_down_id)) { + if (flags & HIO_VARIABLE) + sc->sc_hid.flags |= UAUDIO_HID_HAS_VOLUME_DOWN; + DPRINTFN(1, "Found Volume Down key\n"); + } + + free(d_ptr, M_TEMP); + + if (!(sc->sc_hid.flags & (UAUDIO_HID_HAS_VOLUME_UP | + UAUDIO_HID_HAS_VOLUME_DOWN))) { + DPRINTFN(1, "Did not find any volume related keys\n"); + return (-1); + } + + /* prevent the uhid driver from attaching */ + usbd_set_parent_iface(uaa->device, sc->sc_hid.iface_index, + sc->sc_mixer_iface_index); + + /* allocate USB transfers */ + error = usbd_transfer_setup(uaa->device, &sc->sc_hid.iface_index, + sc->sc_hid.xfer, uaudio_hid_config, UAUDIO_HID_N_TRANSFER, + sc, sc->sc_mixer_lock); + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + return (-1); + } + return (0); +} + +static void +uaudio_hid_detach(struct uaudio_softc *sc) +{ + usbd_transfer_unsetup(sc->sc_hid.xfer, UAUDIO_HID_N_TRANSFER); +} + DRIVER_MODULE(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0); MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:21:37 2013 Return-Path: Delivered-To: svn-src-all@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 1FB03728; Wed, 6 Feb 2013 18:21:37 +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 EC006F5D; Wed, 6 Feb 2013 18:21: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 r16ILa8E014154; Wed, 6 Feb 2013 18:21:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16ILaGE014152; Wed, 6 Feb 2013 18:21:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061821.r16ILaGE014152@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246424 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:21:37 -0000 Author: mav Date: Wed Feb 6 18:21:36 2013 New Revision: 246424 URL: http://svnweb.freebsd.org/changeset/base/246424 Log: MFC r238595, r238596: Add bunch of new ASC/ASCQ values from T10 site. Modified: stable/9/sys/cam/scsi/scsi_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Wed Feb 6 18:04:28 2013 (r246423) +++ stable/9/sys/cam/scsi/scsi_all.c Wed Feb 6 18:21:36 2013 (r246424) @@ -768,7 +768,7 @@ static struct asc_table_entry asc_table[ * * SCSI ASC/ASCQ Assignments * Numeric Sorted Listing - * as of 7/29/08 + * as of 5/20/12 * * D - DIRECT ACCESS DEVICE (SBC-2) device column key * .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- @@ -854,6 +854,12 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ "Conflicting SA creation request") }, + /* DT B */ + { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ + "Logical unit transitioning to another power condition") }, + /* DT P B */ + { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + "Extended copy information available") }, /* D W O BK */ { SST(0x01, 0x00, SS_RDEF, "No index/sector signal") }, @@ -923,6 +929,33 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x04, 0x13, SS_RDEF, /* XXX TBD */ "Logical unit not ready, SA creation in progress") }, + /* D B */ + { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, space allocation in progress") }, + /* M */ + { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, robotics disabled") }, + /* M */ + { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, configuration required") }, + /* M */ + { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, calibration required") }, + /* M */ + { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, a door is open") }, + /* M */ + { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, operating in sequential mode") }, + /* DT B */ + { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, START/STOP UNIT command in progress") }, + /* D B */ + { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, sanitize in progress") }, + /* DT MAEB */ + { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, additional power use not yet granted") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -989,6 +1022,12 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */ "Warning - degraded power to non-volatile cache") }, + /* DTLPWROMAEBKVF */ + { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */ + "Warning - power loss expected") }, + /* D */ + { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */ + "Warning - device statistics notification available") }, /* T R */ { SST(0x0C, 0x00, SS_RDEF, "Write error") }, @@ -1031,6 +1070,9 @@ static struct asc_table_entry asc_table[ /* DTLPWRO AEBKVF */ { SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */ "Write error - not enough unsolicited data") }, + /* DT W O BK */ + { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */ + "Multiple write errors") }, /* R */ { SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */ "Defects in error window") }, @@ -1076,6 +1118,12 @@ static struct asc_table_entry asc_table[ /* DT W O */ { SST(0x10, 0x03, SS_RDEF, /* XXX TBD */ "Logical block reference tag check failed") }, + /* T */ + { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */ + "Logical block protection error on recovered buffer data") }, + /* T */ + { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ + "Logical block protection method error") }, /* DT WRO BK */ { SST(0x11, 0x00, SS_FATAL|EIO, "Unrecovered read error") }, @@ -1280,6 +1328,9 @@ static struct asc_table_entry asc_table[ /* DT WRO BK */ { SST(0x1D, 0x00, SS_FATAL, "Miscompare during verify operation") }, + /* D B */ + { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */ + "Miscomparable verify of unmapped LBA") }, /* D W O BK */ { SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE, "Recovered ID with ECC correction") }, @@ -1322,6 +1373,9 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, + /* T */ + { SST(0x20, 0x0C, SS_FATAL | EINVAL, + "Illegal command when not in append-only mode") }, /* DT WRO BK */ { SST(0x21, 0x00, SS_FATAL | EINVAL, "Logical block address out of range") }, @@ -1337,6 +1391,39 @@ static struct asc_table_entry asc_table[ /* D */ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, + /* DT P B */ + { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + "Invalid token operation, cause not reportable") }, + /* DT P B */ + { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + "Invalid token operation, unsupported token type") }, + /* DT P B */ + { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote token usage not supported") }, + /* DT P B */ + { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote ROD token creation not supported") }, + /* DT P B */ + { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token unknown") }, + /* DT P B */ + { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token corrupt") }, + /* DT P B */ + { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token revoked") }, + /* DT P B */ + { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token expired") }, + /* DT P B */ + { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token cancelled") }, + /* DT P B */ + { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token deleted") }, + /* DT P B */ + { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, "Invalid field in CDB") }, @@ -1445,6 +1532,9 @@ static struct asc_table_entry asc_table[ /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, + /* D B */ + { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, "Not ready to ready change, medium may have changed") }, @@ -1543,6 +1633,9 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */ "SA creation capabilities data has changed") }, + /* T M V */ + { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */ + "Medium removal prevention preempted") }, /* DTLPWRO K */ { SST(0x2B, 0x00, SS_RDEF, "Copy cannot execute since host cannot disconnect") }, @@ -1582,6 +1675,9 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */ "Not reserved") }, + /* D */ + { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */ + "ORWRITE generation does not match") }, /* T */ { SST(0x2D, 0x00, SS_RDEF, "Overwrite error on update in place") }, @@ -1645,6 +1741,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x30, 0x12, SS_RDEF, /* XXX TBD */ "Incompatible volume qualifier") }, + /* M */ + { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ + "Cleaning volume expired") }, /* DT WRO BK */ { SST(0x31, 0x00, SS_RDEF, "Medium format corrupted") }, @@ -1654,6 +1753,9 @@ static struct asc_table_entry asc_table[ /* R */ { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, + /* D B */ + { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, @@ -1702,6 +1804,9 @@ static struct asc_table_entry asc_table[ /* B */ { SST(0x38, 0x06, SS_RDEF, /* XXX TBD */ "ESN - device busy class event") }, + /* D */ + { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */ + "Thin provisioning soft threshold reached") }, /* DTL WROMAE K */ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, @@ -1801,6 +1906,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */ "Data transfer device inserted") }, + /* T */ + { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */ + "Too many logical objects on partition to support operation") }, /* DTLPWROMAE K */ { SST(0x3D, 0x00, SS_RDEF, "Invalid bits in IDENTIFY message") }, @@ -1904,6 +2012,9 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x44, 0x00, SS_RDEF, "Internal target failure") }, + /* DT P MAEBKVF */ + { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ + "Persistent reservation information lost") }, /* DT B */ { SST(0x44, 0x71, SS_RDEF, /* XXX TBD */ "ATA device failed set features") }, @@ -1967,6 +2078,27 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */ "Initiator response timeout") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */ + "Connection lost") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */ + "Data-in buffer error") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */ + "Data-out buffer error") }, /* DTLPWROMAEBKVF */ { SST(0x4C, 0x00, SS_RDEF, "Logical unit failed self-configuration") }, @@ -2012,6 +2144,18 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x53, 0x04, SS_RDEF, /* XXX TBD */ "Medium thread or unthread failure") }, + /* M */ + { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */ + "Volume identifier invalid") }, + /* T */ + { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */ + "Volume identifier missing") }, + /* M */ + { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */ + "Duplicate volume identifier") }, + /* M */ + { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */ + "Element status unknown") }, /* P */ { SST(0x54, 0x00, SS_RDEF, "SCSI to host system interface failure") }, @@ -2048,6 +2192,15 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */ "Data currently unavailable") }, + /* DTLPWROMAEBKVF */ + { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */ + "Insufficient power for operation") }, + /* DT P B */ + { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD") }, + /* DT P B */ + { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2354,6 +2507,24 @@ static struct asc_table_entry asc_table[ /* DTLPWRO A K */ { SST(0x5E, 0x04, SS_RDEF, "Standby condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x05, SS_RDEF, + "Idle-B condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x06, SS_RDEF, + "Idle-B condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x07, SS_RDEF, + "Idle-C condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x08, SS_RDEF, + "Idle-C condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x09, SS_RDEF, + "Standby-Y condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x0A, SS_RDEF, + "Standby-Y condition activated by command") }, /* B */ { SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */ "Power state change to active") }, From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:22:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 108428A1; Wed, 6 Feb 2013 18:22:53 +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 EA740F6F; Wed, 6 Feb 2013 18:22: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 r16IMqJb014395; Wed, 6 Feb 2013 18:22:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IMqId014394; Wed, 6 Feb 2013 18:22:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061822.r16IMqId014394@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246425 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:22:53 -0000 Author: mav Date: Wed Feb 6 18:22:52 2013 New Revision: 246425 URL: http://svnweb.freebsd.org/changeset/base/246425 Log: MFC r238595, r238596: Add bunch of new ASC/ASCQ values from T10 site. Modified: stable/8/sys/cam/scsi/scsi_all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Wed Feb 6 18:21:36 2013 (r246424) +++ stable/8/sys/cam/scsi/scsi_all.c Wed Feb 6 18:22:52 2013 (r246425) @@ -753,7 +753,7 @@ static struct asc_table_entry asc_table[ * * SCSI ASC/ASCQ Assignments * Numeric Sorted Listing - * as of 7/29/08 + * as of 5/20/12 * * D - DIRECT ACCESS DEVICE (SBC-2) device column key * .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- @@ -839,6 +839,12 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ "Conflicting SA creation request") }, + /* DT B */ + { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ + "Logical unit transitioning to another power condition") }, + /* DT P B */ + { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + "Extended copy information available") }, /* D W O BK */ { SST(0x01, 0x00, SS_RDEF, "No index/sector signal") }, @@ -908,6 +914,33 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x04, 0x13, SS_RDEF, /* XXX TBD */ "Logical unit not ready, SA creation in progress") }, + /* D B */ + { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, space allocation in progress") }, + /* M */ + { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, robotics disabled") }, + /* M */ + { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, configuration required") }, + /* M */ + { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, calibration required") }, + /* M */ + { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, a door is open") }, + /* M */ + { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, operating in sequential mode") }, + /* DT B */ + { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, START/STOP UNIT command in progress") }, + /* D B */ + { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, sanitize in progress") }, + /* DT MAEB */ + { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, additional power use not yet granted") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -974,6 +1007,12 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */ "Warning - degraded power to non-volatile cache") }, + /* DTLPWROMAEBKVF */ + { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */ + "Warning - power loss expected") }, + /* D */ + { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */ + "Warning - device statistics notification available") }, /* T R */ { SST(0x0C, 0x00, SS_RDEF, "Write error") }, @@ -1016,6 +1055,9 @@ static struct asc_table_entry asc_table[ /* DTLPWRO AEBKVF */ { SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */ "Write error - not enough unsolicited data") }, + /* DT W O BK */ + { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */ + "Multiple write errors") }, /* R */ { SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */ "Defects in error window") }, @@ -1061,6 +1103,12 @@ static struct asc_table_entry asc_table[ /* DT W O */ { SST(0x10, 0x03, SS_RDEF, /* XXX TBD */ "Logical block reference tag check failed") }, + /* T */ + { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */ + "Logical block protection error on recovered buffer data") }, + /* T */ + { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ + "Logical block protection method error") }, /* DT WRO BK */ { SST(0x11, 0x00, SS_RDEF, "Unrecovered read error") }, @@ -1265,6 +1313,9 @@ static struct asc_table_entry asc_table[ /* DT WRO BK */ { SST(0x1D, 0x00, SS_FATAL, "Miscompare during verify operation") }, + /* D B */ + { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */ + "Miscomparable verify of unmapped LBA") }, /* D W O BK */ { SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE, "Recovered ID with ECC correction") }, @@ -1307,6 +1358,9 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, + /* T */ + { SST(0x20, 0x0C, SS_FATAL | EINVAL, + "Illegal command when not in append-only mode") }, /* DT WRO BK */ { SST(0x21, 0x00, SS_FATAL | EINVAL, "Logical block address out of range") }, @@ -1322,6 +1376,39 @@ static struct asc_table_entry asc_table[ /* D */ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, + /* DT P B */ + { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + "Invalid token operation, cause not reportable") }, + /* DT P B */ + { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + "Invalid token operation, unsupported token type") }, + /* DT P B */ + { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote token usage not supported") }, + /* DT P B */ + { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote ROD token creation not supported") }, + /* DT P B */ + { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token unknown") }, + /* DT P B */ + { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token corrupt") }, + /* DT P B */ + { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token revoked") }, + /* DT P B */ + { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token expired") }, + /* DT P B */ + { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token cancelled") }, + /* DT P B */ + { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token deleted") }, + /* DT P B */ + { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, "Invalid field in CDB") }, @@ -1430,6 +1517,9 @@ static struct asc_table_entry asc_table[ /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, + /* D B */ + { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, "Not ready to ready change, medium may have changed") }, @@ -1528,6 +1618,9 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */ "SA creation capabilities data has changed") }, + /* T M V */ + { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */ + "Medium removal prevention preempted") }, /* DTLPWRO K */ { SST(0x2B, 0x00, SS_RDEF, "Copy cannot execute since host cannot disconnect") }, @@ -1567,6 +1660,9 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */ "Not reserved") }, + /* D */ + { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */ + "ORWRITE generation does not match") }, /* T */ { SST(0x2D, 0x00, SS_RDEF, "Overwrite error on update in place") }, @@ -1630,6 +1726,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x30, 0x12, SS_RDEF, /* XXX TBD */ "Incompatible volume qualifier") }, + /* M */ + { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ + "Cleaning volume expired") }, /* DT WRO BK */ { SST(0x31, 0x00, SS_RDEF, "Medium format corrupted") }, @@ -1639,6 +1738,9 @@ static struct asc_table_entry asc_table[ /* R */ { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, + /* D B */ + { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, @@ -1687,6 +1789,9 @@ static struct asc_table_entry asc_table[ /* B */ { SST(0x38, 0x06, SS_RDEF, /* XXX TBD */ "ESN - device busy class event") }, + /* D */ + { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */ + "Thin provisioning soft threshold reached") }, /* DTL WROMAE K */ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, @@ -1786,6 +1891,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */ "Data transfer device inserted") }, + /* T */ + { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */ + "Too many logical objects on partition to support operation") }, /* DTLPWROMAE K */ { SST(0x3D, 0x00, SS_RDEF, "Invalid bits in IDENTIFY message") }, @@ -1889,6 +1997,9 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x44, 0x00, SS_RDEF, "Internal target failure") }, + /* DT P MAEBKVF */ + { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ + "Persistent reservation information lost") }, /* DT B */ { SST(0x44, 0x71, SS_RDEF, /* XXX TBD */ "ATA device failed set features") }, @@ -1952,6 +2063,27 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */ "Initiator response timeout") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */ + "Connection lost") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */ + "Data-in buffer error") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */ + "Data-out buffer error") }, /* DTLPWROMAEBKVF */ { SST(0x4C, 0x00, SS_RDEF, "Logical unit failed self-configuration") }, @@ -1997,6 +2129,18 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x53, 0x04, SS_RDEF, /* XXX TBD */ "Medium thread or unthread failure") }, + /* M */ + { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */ + "Volume identifier invalid") }, + /* T */ + { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */ + "Volume identifier missing") }, + /* M */ + { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */ + "Duplicate volume identifier") }, + /* M */ + { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */ + "Element status unknown") }, /* P */ { SST(0x54, 0x00, SS_RDEF, "SCSI to host system interface failure") }, @@ -2033,6 +2177,15 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */ "Data currently unavailable") }, + /* DTLPWROMAEBKVF */ + { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */ + "Insufficient power for operation") }, + /* DT P B */ + { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD") }, + /* DT P B */ + { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2339,6 +2492,24 @@ static struct asc_table_entry asc_table[ /* DTLPWRO A K */ { SST(0x5E, 0x04, SS_RDEF, "Standby condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x05, SS_RDEF, + "Idle-B condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x06, SS_RDEF, + "Idle-B condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x07, SS_RDEF, + "Idle-C condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x08, SS_RDEF, + "Idle-C condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x09, SS_RDEF, + "Standby-Y condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x0A, SS_RDEF, + "Standby-Y condition activated by command") }, /* B */ { SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */ "Power state change to active") }, From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:30:54 2013 Return-Path: Delivered-To: svn-src-all@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 EF651A76; Wed, 6 Feb 2013 18:30:54 +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 E1366FB2; Wed, 6 Feb 2013 18:30: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 r16IUsY5016932; Wed, 6 Feb 2013 18:30:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IUslq016923; Wed, 6 Feb 2013 18:30:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061830.r16IUslq016923@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246426 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:30:55 -0000 Author: mav Date: Wed Feb 6 18:30:53 2013 New Revision: 246426 URL: http://svnweb.freebsd.org/changeset/base/246426 Log: MFC r240948 (by trasz): Fix panic in CTL caused by trying to free invalid pointers passed by the userland process via the IOCTL interface. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:22:52 2013 (r246425) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:30:53 2013 (r246426) @@ -2075,6 +2075,11 @@ ctl_copyin_args(int num_be_args, struct goto bailout; for (i = 0; i < num_be_args; i++) { + args[i].kname = NULL; + args[i].kvalue = NULL; + } + + for (i = 0; i < num_be_args; i++) { uint8_t *tmpptr; args[i].kname = ctl_copyin_alloc(args[i].name, From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:32:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 305F4BE1; Wed, 6 Feb 2013 18:32:14 +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 0899AFBD; Wed, 6 Feb 2013 18:32: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 r16IWD4U017441; Wed, 6 Feb 2013 18:32:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IWDlS017437; Wed, 6 Feb 2013 18:32:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061832.r16IWDlS017437@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246427 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:32:14 -0000 Author: mav Date: Wed Feb 6 18:32:12 2013 New Revision: 246427 URL: http://svnweb.freebsd.org/changeset/base/246427 Log: MFC r240993 (by trasz): Remove useless NULL checks after M_WAITOK allocations. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_backend_block.c stable/9/sys/cam/ctl/ctl_backend_ramdisk.c stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:32:12 2013 (r246427) @@ -1520,12 +1520,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio ext_sglist = (struct ctl_sg_entry *)malloc(ext_sglen, M_CTL, M_WAITOK); - if (ext_sglist == NULL) { - ctl_set_internal_failure(ctsio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - return (CTL_RETVAL_COMPLETE); - } ext_sglist_malloced = 1; if (copyin(ctsio->ext_data_ptr, ext_sglist, ext_sglen) != 0) { @@ -2028,11 +2022,6 @@ ctl_copyin_alloc(void *user_addr, int le void *kptr; kptr = malloc(len, M_CTL, M_WAITOK | M_ZERO); - if (kptr == NULL) { - snprintf(error_str, error_str_len, "Cannot allocate %d bytes", - len); - return (NULL); - } if (copyin(user_addr, kptr, len) != 0) { snprintf(error_str, error_str_len, "Error copying %d bytes " @@ -2764,12 +2753,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, new_err_desc = malloc(sizeof(*new_err_desc), M_CTL, M_WAITOK | M_ZERO); - if (new_err_desc == NULL) { - printf("%s: CTL_ERROR_INJECT: error allocating %zu " - "bytes\n", __func__, sizeof(*new_err_desc)); - retval = ENOMEM; - break; - } bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); @@ -4203,11 +4186,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } if (ctl_lun == NULL) { lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - if (lun == NULL) { - be_lun->lun_config_status(lun->be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - return (-ENOMEM); - } lun->flags = CTL_LUN_MALLOCED; } else lun = ctl_lun; @@ -5061,12 +5039,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -5202,12 +5174,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -5573,12 +5539,6 @@ ctl_format(struct ctl_scsiio *ctsio) if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -6368,11 +6328,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; ctsio->kern_data_resid = 0; @@ -6607,12 +6562,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) #endif ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6794,12 +6743,6 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6864,12 +6807,6 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6977,12 +6914,6 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } memset(ctsio->kern_data_ptr, 0, total_len); ctsio->kern_sg_entries = 0; @@ -7138,12 +7069,6 @@ retry: mtx_unlock(&softc->ctl_lock); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7876,11 +7801,6 @@ ctl_persistent_reserve_out(struct ctl_sc if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; ctsio->kern_data_resid = 0; @@ -8692,13 +8612,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio (num_luns * sizeof(struct scsi_report_luns_lundata)); ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8821,12 +8734,6 @@ ctl_request_sense(struct ctl_scsiio *cts sense_format = SSD_TYPE_FIXED; ctsio->kern_data_ptr = malloc(sizeof(*sense_ptr), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 18:32:12 2013 (r246427) @@ -376,9 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - if (beio == NULL) - break; - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); @@ -1092,15 +1089,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc */ beio->sg_segs[i].len = min(MAXPHYS, len_left); beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); - /* - * uma_zalloc() can in theory return NULL even with M_WAITOK - * if it can't pull more memory into the zone. - */ - if (beio->sg_segs[i].addr == NULL) { - ctl_set_busy(&io->scsiio); - ctl_complete_beio(beio); - return; - } DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); @@ -1660,13 +1648,6 @@ ctl_be_block_create(struct ctl_be_block_ be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK); - if (be_lun == NULL) { - snprintf(req->error_str, sizeof(req->error_str), - "%s: error allocating %zd bytes", __func__, - sizeof(*be_lun)); - goto bailout_error; - } - be_lun->softc = softc; STAILQ_INIT(&be_lun->input_queue); STAILQ_INIT(&be_lun->config_write_queue); @@ -1705,12 +1686,6 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, M_WAITOK | M_ZERO); - if (be_lun->dev_path == NULL) { - snprintf(req->error_str, sizeof(req->error_str), - "%s: error allocating %d bytes", __func__, - file_arg->vallen); - goto bailout_error; - } strlcpy(be_lun->dev_path, (char *)file_arg->value, file_arg->vallen); Modified: stable/9/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Wed Feb 6 18:32:12 2013 (r246427) @@ -134,7 +134,7 @@ ctl_backend_ramdisk_init(void) { struct ctl_be_ramdisk_softc *softc; #ifdef CTL_RAMDISK_PAGES - int i, j; + int i; #endif @@ -151,17 +151,8 @@ ctl_backend_ramdisk_init(void) softc->ramdisk_pages = (uint8_t **)malloc(sizeof(uint8_t *) * softc->num_pages, M_RAMDISK, M_WAITOK); - for (i = 0; i < softc->num_pages; i++) { + for (i = 0; i < softc->num_pages; i++) softc->ramdisk_pages[i] = malloc(PAGE_SIZE, M_RAMDISK,M_WAITOK); - if (softc->ramdisk_pages[i] == NULL) { - for (j = 0; j < i; j++) { - free(softc->ramdisk_pages[j], M_RAMDISK); - } - free(softc->ramdisk_pages, M_RAMDISK); - panic("RAMDisk initialization failed\n"); - return (1); /* NOTREACHED */ - } - } #else softc->ramdisk_buffer = (uint8_t *)malloc(softc->rd_size, M_RAMDISK, M_WAITOK); @@ -313,13 +304,6 @@ ctl_backend_ramdisk_submit(union ctl_io io->scsiio.kern_data_ptr = malloc(sizeof(struct ctl_sg_entry) * num_sg_entries, M_RAMDISK, M_WAITOK); - if (io->scsiio.kern_data_ptr == NULL) { - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; for (i = 0, len_filled = 0; i < num_sg_entries; i++, len_filled += PAGE_SIZE) { Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:32:12 2013 (r246427) @@ -1694,11 +1694,6 @@ ctlfe_onoffline(void *arg, int online) return; } ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } xpt_setup_ccb(&ccb->ccb_h, path, /*priority*/ 1); sim = xpt_path_sim(path); @@ -1900,12 +1895,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i } softc = malloc(sizeof(*softc), M_CTLFE, M_WAITOK | M_ZERO); - if (softc == NULL) { - printf("%s: could not allocate %zd bytes for softc\n", - __func__, sizeof(*softc)); - xpt_free_path(path); - return (1); - } sim = xpt_path_sim(path); mtx_lock(sim->mtx); periph = cam_periph_find(path, "ctl"); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:36:28 2013 Return-Path: Delivered-To: svn-src-all@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 F2BCEED; Wed, 6 Feb 2013 18:36:27 +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 D65C4D3; Wed, 6 Feb 2013 18:36: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 r16IaR3g018227; Wed, 6 Feb 2013 18:36:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IaRCr018224; Wed, 6 Feb 2013 18:36:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061836.r16IaRCr018224@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246429 - in stable/9/sys/cam: ctl scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:36:28 -0000 Author: mav Date: Wed Feb 6 18:36:26 2013 New Revision: 246429 URL: http://svnweb.freebsd.org/changeset/base/246429 Log: MFC r242174: Remove several uses of numeric priorities from immediate CCB setups. Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Wed Feb 6 18:36:26 2013 (r246429) @@ -240,7 +240,7 @@ cfcs_init(void) goto bailout; } - xpt_setup_ccb(&csa.ccb_h, softc->path, /*priority*/ 5); + xpt_setup_ccb(&csa.ccb_h, softc->path, CAM_PRIORITY_NONE); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE; csa.callback = cfcs_async; Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:36:26 2013 (r246429) @@ -334,7 +334,7 @@ ctlfeasync(void *callback_arg, uint32_t return; } xpt_setup_ccb(&ccb->ccb_h, cpi->ccb_h.path, - /*priority*/ 1); + CAM_PRIORITY_NONE); sim = xpt_path_sim(cpi->ccb_h.path); @@ -571,7 +571,7 @@ ctlferegister(struct cam_periph *periph, callout_init_mtx(&softc->dma_callout, sim->mtx, /*flags*/ 0); periph->softc = softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -668,7 +668,7 @@ ctlfeoninvalidate(struct cam_periph *per softc = (struct ctlfe_lun_softc *)periph->softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -1694,7 +1694,7 @@ ctlfe_onoffline(void *arg, int online) return; } ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, path, /*priority*/ 1); + xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); sim = xpt_path_sim(path); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Feb 6 18:36:26 2013 (r246429) @@ -1459,7 +1459,7 @@ dasysctlinit(void *context, int pending) * Add some addressing info. */ memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1); + xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cam_periph_lock(periph); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:40:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9198D3DB; Wed, 6 Feb 2013 18:40:08 +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 83BE4108; Wed, 6 Feb 2013 18: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 r16Ie8P4019362; Wed, 6 Feb 2013 18:40:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16Ie8Nh019250; Wed, 6 Feb 2013 18:40:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061840.r16Ie8Nh019250@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246431 - in stable/9/sys/cam: . scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:40:08 -0000 Author: mav Date: Wed Feb 6 18:40:07 2013 New Revision: 246431 URL: http://svnweb.freebsd.org/changeset/base/246431 Log: MFC r242175: Remove priority enforcement from xpt_ation(). It is not good and even not safe in some cases to reduce CCB priority after it was scheduled with high priority. This fixes reproducible deadlock when command sent through the pass interface while ATA XPT recovers from command timeout. Instead of that enforce priority at passioctl(). libcam provides no obvious interface to specify CCB priority and so much (all?) code specifies zero (highest) priority. This change limits pass CCBs priority to NORMAL run level, allowing XPT to complete bus and device recovery after reset before running any payload. Modified: stable/9/sys/cam/cam.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam.h ============================================================================== --- stable/9/sys/cam/cam.h Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/cam.h Wed Feb 6 18:40:07 2013 (r246431) @@ -83,6 +83,7 @@ typedef struct { #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 #define CAM_PRIORITY_TO_RL(x) ((x) >> 8) +#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 18:40:07 2013 (r246431) @@ -2466,9 +2466,6 @@ xpt_action(union ccb *start_ccb) CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); start_ccb->ccb_h.status = CAM_REQ_INPROG; - /* Compatibility for RL-unaware code. */ - if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0) - start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); } Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:40:07 2013 (r246431) @@ -521,6 +521,7 @@ passioctl(struct cdev *dev, u_long cmd, struct cam_periph *periph; struct pass_softc *softc; int error; + uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) @@ -553,6 +554,11 @@ passioctl(struct cdev *dev, u_long cmd, break; } + /* Compatibility for RL/priority-unaware code. */ + priority = inccb->ccb_h.pinfo.priority; + if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL)) + priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL); + /* * Non-immediate CCBs need a CCB from the per-device pool * of CCBs, which is scheduled by the transport layer. @@ -561,15 +567,14 @@ passioctl(struct cdev *dev, u_long cmd, */ if ((inccb->ccb_h.func_code & XPT_FC_QUEUED) && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) { - ccb = cam_periph_getccb(periph, - inccb->ccb_h.pinfo.priority); + ccb = cam_periph_getccb(periph, priority); ccb_malloced = 0; } else { ccb = xpt_alloc_ccb_nowait(); if (ccb != NULL) xpt_setup_ccb(&ccb->ccb_h, periph->path, - inccb->ccb_h.pinfo.priority); + priority); ccb_malloced = 1; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 18:41:13 2013 Return-Path: Delivered-To: svn-src-all@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 DB6A657C; Wed, 6 Feb 2013 18:41:13 +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 B4A0F11B; Wed, 6 Feb 2013 18:41: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 r16IfDSh020630; Wed, 6 Feb 2013 18:41:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IfDgh020627; Wed, 6 Feb 2013 18:41:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061841.r16IfDgh020627@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246432 - in stable/8/sys/cam: . scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:41:13 -0000 Author: mav Date: Wed Feb 6 18:41:12 2013 New Revision: 246432 URL: http://svnweb.freebsd.org/changeset/base/246432 Log: MFC r242175: Remove priority enforcement from xpt_ation(). It is not good and even not safe in some cases to reduce CCB priority after it was scheduled with high priority. This fixes reproducible deadlock when command sent through the pass interface while ATA XPT recovers from command timeout. Instead of that enforce priority at passioctl(). libcam provides no obvious interface to specify CCB priority and so much (all?) code specifies zero (highest) priority. This change limits pass CCBs priority to NORMAL run level, allowing XPT to complete bus and device recovery after reset before running any payload. Modified: stable/8/sys/cam/cam.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/scsi/scsi_pass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/cam.h ============================================================================== --- stable/8/sys/cam/cam.h Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/cam.h Wed Feb 6 18:41:12 2013 (r246432) @@ -83,6 +83,7 @@ typedef struct { #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 #define CAM_PRIORITY_TO_RL(x) ((x) >> 8) +#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/cam_xpt.c Wed Feb 6 18:41:12 2013 (r246432) @@ -2413,9 +2413,6 @@ xpt_action(union ccb *start_ccb) CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); start_ccb->ccb_h.status = CAM_REQ_INPROG; - /* Compatibility for RL-unaware code. */ - if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0) - start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); } Modified: stable/8/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:41:12 2013 (r246432) @@ -428,6 +428,7 @@ passioctl(struct cdev *dev, u_long cmd, struct cam_periph *periph; struct pass_softc *softc; int error; + uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) @@ -460,6 +461,11 @@ passioctl(struct cdev *dev, u_long cmd, break; } + /* Compatibility for RL/priority-unaware code. */ + priority = inccb->ccb_h.pinfo.priority; + if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL)) + priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL); + /* * Non-immediate CCBs need a CCB from the per-device pool * of CCBs, which is scheduled by the transport layer. @@ -468,15 +474,14 @@ passioctl(struct cdev *dev, u_long cmd, */ if ((inccb->ccb_h.func_code & XPT_FC_QUEUED) && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) { - ccb = cam_periph_getccb(periph, - inccb->ccb_h.pinfo.priority); + ccb = cam_periph_getccb(periph, priority); ccb_malloced = 0; } else { ccb = xpt_alloc_ccb_nowait(); if (ccb != NULL) xpt_setup_ccb(&ccb->ccb_h, periph->path, - inccb->ccb_h.pinfo.priority); + priority); ccb_malloced = 1; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 21:05:03 2013 Return-Path: Delivered-To: svn-src-all@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 6AA6FD52; Wed, 6 Feb 2013 21:05:03 +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 415F8A11; Wed, 6 Feb 2013 21:05:03 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 03C01B915; Wed, 6 Feb 2013 16:05:02 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r246417 - in head/sys: fs/nfs kern nfsclient sys Date: Wed, 6 Feb 2013 12:11:13 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302061706.r16H6qMo088889@svn.freebsd.org> In-Reply-To: <201302061706.r16H6qMo088889@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302061211.14184.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 06 Feb 2013 16:05:02 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 21:05:03 -0000 On Wednesday, February 06, 2013 12:06:52 pm John Baldwin wrote: > Author: jhb > Date: Wed Feb 6 17:06:51 2013 > New Revision: 246417 > URL: http://svnweb.freebsd.org/changeset/base/246417 > > Log: > Rework the handling of stop signals in the NFS client. The changes in > 195702, 195703, and 195821 prevented a thread from suspending while holding > locks inside of NFS by forcing the thread to fail sleeps with EINTR or > ERESTART but defer the thread suspension to the user boundary. However, > this had the effect that stopping a process during an NFS request could > abort the request and trigger EINTR errors that were visible to userland > processes (previously the thread would have suspended and completed the > request once it was resumed). > > This change instead effectively masks stop signals while in the NFS client. > It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot > be masked directly. Also, instead of setting PBDRY on individual sleeps, > the NFS client now sets the TDF_SBDRY flag around each NFS request and > stop signals are masked for all sleeps during that region (the previous > change missed sleeps in lockmgr locks). The end result is that stop > signals sent to threads performing an NFS request are completely > ignored until after the NFS request has finished processing and the > thread prepares to return to userland. This restores the behavior of > stop signals being transparent to userland processes while still > preventing threads from suspending while holding NFS locks. > > Reviewed by: kib > MFC after: 1 month I have a test case (included below). You give it a path to a file on an interruptible NFS mount as the sole argument. In the broken case you will see lots of reads fail with EINTR. #include #include #include #include #include #include #include #include #include static void usage(void) { fprintf(stderr, "Usage: nfsintr \n"); exit(1); } static volatile sig_atomic_t info; static void child_info_handler(int sig) { info = 1; } /* * Check to see if STOP/CONT signals affect I/O. One process * continually opens a file with O_DIRECT and reads it while another * process keeps pausing the first with SIGSTOP. */ static void child(const char *path) { char buf[128 * 1024]; struct stat sb; ssize_t nread; off_t off; int fd, shorts; if (signal(SIGINFO, child_info_handler) == SIG_ERR) err(1, "signal(SIGINFO) (child)"); shorts = 0; while (getppid() != 1) { fd = open(path, O_RDONLY | O_DIRECT); while (fd < 0) { if (errno == EINTR) warn("open(%s)", path); else err(1, "open(%s)", path); } while (fstat(fd, &sb) < 0) { if (errno == EINTR) warn("fstat"); else err(1, "fstat"); } for (;;) { if (info) { if (shorts > 0) printf("nfsintr: %d short reads\n", shorts); shorts = 0; info = 0; } nread = read(fd, buf, sizeof(buf)); if (nread < 0) { if (errno == EINTR) warn("read"); else err(1, "read"); continue; } if (nread == 0) break; if (nread == sizeof(buf)) continue; if (nread < (ssize_t)sizeof(buf)) { off = lseek(fd, SEEK_CUR, 0); if (off < 0) err(1, "lseek"); if (off == sb.st_size) break; /* * These happen a lot. warnx("short read: %zd", nread); */ shorts++; continue; } } close(fd); } } static void parent(pid_t pid) { for (;;) { if (kill(pid, SIGSTOP) < 0) { if (errno == ESRCH) return; err(1, "kill(SIGSTOP)"); } usleep(500); if (kill(pid, SIGCONT) < 0) { if (errno == ESRCH) return; err(1, "kill(SIGCONT)"); } usleep(500); } } int main(int ac, char **av) { pid_t pid; if (ac != 2) usage(); if (access(av[1], R_OK) < 0) err(1, "Unable to access file %s", av[1]); if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) err(1, "signal(SIGCHLD)"); pid = fork(); if (pid < 0) err(1, "fork"); if (pid == 0) child(av[1]); else parent(pid); return (0); } -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:07:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE993B9; Wed, 6 Feb 2013 22:07:41 +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 B2464E5A; Wed, 6 Feb 2013 22:07: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 r16M7flq083048; Wed, 6 Feb 2013 22:07:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16M7d92083023; Wed, 6 Feb 2013 22:07:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062207.r16M7d92083023@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:07:41 -0000 Author: mav Date: Wed Feb 6 22:07:38 2013 New Revision: 246437 URL: http://svnweb.freebsd.org/changeset/base/246437 Log: MFC r235911, r235980, r238739, r238740, r238894, r239213, r241488, r241952, r242173, r242621, r242634, r242638, r242647, r242720, r244418, r244508, r245891: Revamp the CAM enclosure services driver. This updated driver uses an in-kernel daemon to track state changes and publishes physical path location information for disk elements into the CAM device database. Sponsored by: Spectra Logic Corporation Sponsored by: iXsystems, Inc. Added: stable/9/sys/cam/scsi/scsi_enc.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc.c stable/9/sys/cam/scsi/scsi_enc.h - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc.h stable/9/sys/cam/scsi/scsi_enc_internal.h - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc_internal.h stable/9/sys/cam/scsi/scsi_enc_safte.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_safte.c stable/9/sys/cam/scsi/scsi_enc_ses.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_ses.c Deleted: stable/9/sys/cam/scsi/scsi_ses.c Modified: stable/9/share/examples/ses/Makefile.inc stable/9/share/examples/ses/sesd/sesd.0 stable/9/share/examples/ses/srcs/eltsub.c stable/9/share/examples/ses/srcs/getencstat.c stable/9/share/examples/ses/srcs/getnobj.c stable/9/share/examples/ses/srcs/getobjmap.c stable/9/share/examples/ses/srcs/getobjstat.c stable/9/share/examples/ses/srcs/inienc.c stable/9/share/examples/ses/srcs/sesd.c stable/9/share/examples/ses/srcs/setencstat.c stable/9/share/examples/ses/srcs/setobjstat.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/cam/scsi/scsi_ses.h stable/9/sys/conf/files stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/modules/cam/Makefile stable/9/usr.bin/kdump/mkioctls Directory Properties: stable/9/share/examples/ses/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/share/examples/ses/Makefile.inc ============================================================================== --- stable/9/share/examples/ses/Makefile.inc Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/Makefile.inc Wed Feb 6 22:07:38 2013 (r246437) @@ -32,7 +32,6 @@ # mjacob@feral.com # -CFLAGS+= -I/usr/include/cam/scsi -DSESINC="" BINDIR?= /usr/sbin CLEANFILES+= ${MAN} Modified: stable/9/share/examples/ses/sesd/sesd.0 ============================================================================== --- stable/9/share/examples/ses/sesd/sesd.0 Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/sesd/sesd.0 Wed Feb 6 22:07:38 2013 (r246437) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2000 +.Dd November 5, 2012 .Dt SESD 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd monitor SCSI Environmental Services Devices .Sh SYNOPSIS .Nm +.Op Fl c .Op Fl d .Op Fl t Ar poll-interval .Ar device @@ -57,7 +58,9 @@ poll each device for a change in state. .Pp The following options may be used: .Bl -tag -width Ds -.It Fl p Ar poll-interval +.It Fl c +Try to clear enclosure status after read. +.It Fl t Ar poll-interval Change the interval of polling from the default 30 seconds to the number of seconds specified. .It Fl d Modified: stable/9/share/examples/ses/srcs/eltsub.c ============================================================================== --- stable/9/share/examples/ses/srcs/eltsub.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/eltsub.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,10 +33,13 @@ */ #include +#include +#include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" @@ -46,79 +49,82 @@ geteltnm(int type) static char rbuf[132]; switch (type) { - case SESTYP_UNSPECIFIED: + case ELMTYP_UNSPECIFIED: sprintf(rbuf, "Unspecified"); break; - case SESTYP_DEVICE: - sprintf(rbuf, "Device"); + case ELMTYP_DEVICE: + sprintf(rbuf, "Device Slot"); break; - case SESTYP_POWER: - sprintf(rbuf, "Power supply"); + case ELMTYP_POWER: + sprintf(rbuf, "Power Supply"); break; - case SESTYP_FAN: - sprintf(rbuf, "Cooling element"); + case ELMTYP_FAN: + sprintf(rbuf, "Cooling"); break; - case SESTYP_THERM: - sprintf(rbuf, "Temperature sensors"); + case ELMTYP_THERM: + sprintf(rbuf, "Temperature Sensors"); break; - case SESTYP_DOORLOCK: + case ELMTYP_DOORLOCK: sprintf(rbuf, "Door Lock"); break; - case SESTYP_ALARM: + case ELMTYP_ALARM: sprintf(rbuf, "Audible alarm"); break; - case SESTYP_ESCC: - sprintf(rbuf, "Enclosure services controller electronics"); + case ELMTYP_ESCC: + sprintf(rbuf, "Enclosure Services Controller Electronics"); break; - case SESTYP_SCC: - sprintf(rbuf, "SCC controller electronics"); + case ELMTYP_SCC: + sprintf(rbuf, "SCC Controller Electronics"); break; - case SESTYP_NVRAM: - sprintf(rbuf, "Nonvolatile cache"); + case ELMTYP_NVRAM: + sprintf(rbuf, "Nonvolatile Cache"); break; - case SESTYP_UPS: - sprintf(rbuf, "Uninterruptible power supply"); + case ELMTYP_INV_OP_REASON: + sprintf(rbuf, "Invalid Operation Reason"); break; - case SESTYP_DISPLAY: + case ELMTYP_UPS: + sprintf(rbuf, "Uninterruptible Power Supply"); + break; + case ELMTYP_DISPLAY: sprintf(rbuf, "Display"); break; - case SESTYP_KEYPAD: - sprintf(rbuf, "Key pad entry device"); + case ELMTYP_KEYPAD: + sprintf(rbuf, "Key Pad Entry"); break; - case SESTYP_ENCLOSURE: + case ELMTYP_ENCLOSURE: sprintf(rbuf, "Enclosure"); break; - case SESTYP_SCSIXVR: - sprintf(rbuf, "SCSI port/transceiver"); + case ELMTYP_SCSIXVR: + sprintf(rbuf, "SCSI Port/Transceiver"); break; - case SESTYP_LANGUAGE: + case ELMTYP_LANGUAGE: sprintf(rbuf, "Language"); break; - case SESTYP_COMPORT: + case ELMTYP_COMPORT: sprintf(rbuf, "Communication Port"); break; - case SESTYP_VOM: + case ELMTYP_VOM: sprintf(rbuf, "Voltage Sensor"); break; - case SESTYP_AMMETER: + case ELMTYP_AMMETER: sprintf(rbuf, "Current Sensor"); break; - case SESTYP_SCSI_TGT: - sprintf(rbuf, "SCSI target port"); + case ELMTYP_SCSI_TGT: + sprintf(rbuf, "SCSI Target Port"); break; - case SESTYP_SCSI_INI: - sprintf(rbuf, "SCSI initiator port"); + case ELMTYP_SCSI_INI: + sprintf(rbuf, "SCSI Initiator Port"); break; - case SESTYP_SUBENC: - sprintf(rbuf, "Simple sub-enclosure"); + case ELMTYP_SUBENC: + sprintf(rbuf, "Simple Subenclosure"); break; - case SESTYP_ARRAY: - sprintf(rbuf, "Array device"); + case ELMTYP_ARRAY_DEV: + sprintf(rbuf, "Array Device Slot"); break; - case SESTYP_SASEXPANDER: + case ELMTYP_SAS_EXP: sprintf(rbuf, "SAS Expander"); break; - case SESTYP_SASCONNECTOR: + case ELMTYP_SAS_CONN: sprintf(rbuf, "SAS Connector"); break; default: @@ -134,31 +140,34 @@ scode2ascii(u_char code) static char rbuf[32]; switch (code & 0xf) { case SES_OBJSTAT_UNSUPPORTED: - sprintf(rbuf, "status not supported"); + sprintf(rbuf, "Unsupported"); break; case SES_OBJSTAT_OK: - sprintf(rbuf, "ok"); + sprintf(rbuf, "OK"); break; case SES_OBJSTAT_CRIT: - sprintf(rbuf, "critical"); + sprintf(rbuf, "Critical"); break; case SES_OBJSTAT_NONCRIT: - sprintf(rbuf, "non-critical"); + sprintf(rbuf, "Noncritical"); break; case SES_OBJSTAT_UNRECOV: - sprintf(rbuf, "unrecoverable"); + sprintf(rbuf, "Unrecoverable"); break; case SES_OBJSTAT_NOTINSTALLED: - sprintf(rbuf, "not installed"); + sprintf(rbuf, "Not Installed"); break; case SES_OBJSTAT_UNKNOWN: - sprintf(rbuf, "unknown status"); + sprintf(rbuf, "Unknown"); break; case SES_OBJSTAT_NOTAVAIL: - sprintf(rbuf, "status not available"); + sprintf(rbuf, "Not Available"); + break; + case SES_OBJSTAT_NOACCESS: + sprintf(rbuf, "No Access Allowed"); break; default: - sprintf(rbuf, "unknown status code %x", code & 0xf); + sprintf(rbuf, "", code & 0xf); break; } return (rbuf); @@ -171,7 +180,11 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "Status=%s (bytes=0x%02x 0x%02x 0x%02x 0x%02x)", - scode, cstat[0], cstat[1], cstat[2], cstat[3]); + sprintf(ebuf, "status: %s%s%s%s (0x%02x 0x%02x 0x%02x 0x%02x)", + scode, + (cstat[0] & 0x40) ? ", Prd.Fail" : "", + (cstat[0] & 0x20) ? ", Disabled" : "", + (cstat[0] & 0x10) ? ", Swapped" : "", + cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } Modified: stable/9/share/examples/ses/srcs/getencstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/getencstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getencstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,20 +33,25 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" int main(int a, char **v) { - ses_object *objp; - ses_objstat ob; + encioc_element_t *objp; + encioc_elm_status_t ob; + encioc_elm_desc_t objd; + encioc_elm_devnames_t objdn; int fd, nobj, f, i, verbose, quiet, errors; u_char estat; @@ -73,13 +78,13 @@ main(int a, char **v) perror(*v); continue; } - if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) { - perror("SESIOC_GETNOBJ"); + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { + perror("ENCIOC_GETNELM"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) { - perror("SESIOC_GETENCSTAT"); + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) { + perror("ENCIOC_GETENCSTAT"); (void) close(fd); continue; } @@ -113,38 +118,64 @@ main(int a, char **v) } } fprintf(stdout, ">\n"); - objp = calloc(nobj, sizeof (ses_object)); + objp = calloc(nobj, sizeof (encioc_element_t)); if (objp == NULL) { perror("calloc"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) { - perror("SESIOC_GETOBJMAP"); + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { + perror("ENCIOC_GETELMMAP"); (void) close(fd); continue; } for (i = 0; i < nobj; i++) { - ob.obj_id = objp[i].obj_id; - if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) { - perror("SESIOC_GETOBJSTAT"); + ob.elm_idx = objp[i].elm_idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &ob) < 0) { + perror("ENCIOC_GETELMSTAT"); (void) close(fd); break; } - if ((ob.cstat[0] & 0xf) == SES_OBJSTAT_OK) { - if (verbose) { - fprintf(stdout, - "Element 0x%x: %s OK (%s)\n", - ob.obj_id, - geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, - ob.cstat)); - } + bzero(&objd, sizeof(objd)); + objd.elm_idx = objp[i].elm_idx; + objd.elm_desc_len = UINT16_MAX; + objd.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (objd.elm_desc_str == NULL) { + perror("calloc"); + (void) close(fd); continue; } - fprintf(stdout, "Element 0x%x: %s, %s\n", - ob.obj_id, geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, ob.cstat)); + if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t)&objd) < 0) { + perror("ENCIOC_GETELMDESC"); + (void) close(fd); + break; + } + bzero(&objdn, sizeof(objdn)); + objdn.elm_idx = objp[i].elm_idx; + objdn.elm_names_size = 128; + objdn.elm_devnames = calloc(128, sizeof(char)); + if (objdn.elm_devnames == NULL) { + perror("calloc"); + (void) close(fd); + break; + } + /* + * This ioctl isn't critical and has a good chance + * of returning -1. + */ + (void)ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t)&objdn); + fprintf(stdout, "Element 0x%x: %s", ob.elm_idx, + geteltnm(objp[i].elm_type)); + fprintf(stdout, ", %s", + stat2ascii(objp[i].elm_type, ob.cstat)); + if (objd.elm_desc_len > 0) + fprintf(stdout, ", descriptor: '%s'", + objd.elm_desc_str); + if (objdn.elm_names_len > 0) + fprintf(stdout, ", dev: '%s'", + objdn.elm_devnames); + fprintf(stdout, "\n"); + free(objdn.elm_devnames); } free(objp); (void) close(fd); Modified: stable/9/share/examples/ses/srcs/getnobj.c ============================================================================== --- stable/9/share/examples/ses/srcs/getnobj.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getnobj.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,12 +33,15 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include int main(int argc, char **argv) Modified: stable/9/share/examples/ses/srcs/getobjmap.c ============================================================================== --- stable/9/share/examples/ses/srcs/getobjmap.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getobjmap.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" Modified: stable/9/share/examples/ses/srcs/getobjstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/getobjstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getobjstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -32,11 +32,14 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: stable/9/share/examples/ses/srcs/inienc.c ============================================================================== --- stable/9/share/examples/ses/srcs/inienc.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/inienc.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: stable/9/share/examples/ses/srcs/sesd.c ============================================================================== --- stable/9/share/examples/ses/srcs/sesd.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/sesd.c Wed Feb 6 22:07:38 2013 (r246437) @@ -32,14 +32,18 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include #include #include +#include #include -#include SESINC +#include +#include #define ALLSTAT (SES_ENCSTAT_UNRECOV | SES_ENCSTAT_CRITICAL | \ SES_ENCSTAT_NONCRITICAL | SES_ENCSTAT_INFO) @@ -52,29 +56,33 @@ int main(int a, char **v) { static const char *usage = - "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; - int fd, polltime, dev, devbase, nodaemon; - ses_encstat stat, *carray; + "usage: %s [ -c ] [ -d ] [ -t pollinterval ] device [ device ]\n"; + int fd, polltime, dev, nodaemon, clear, c; + encioc_enc_status_t stat, nstat, *carray; if (a < 2) { fprintf(stderr, usage, *v); return (1); } - devbase = 1; - - if (strcmp(v[1], "-d") == 0) { - nodaemon = 1; - devbase++; - } else { - nodaemon = 0; - } - - if (a > 2 && strcmp(v[2], "-t") == 0) { - devbase += 2; - polltime = atoi(v[3]); - } else { - polltime = 30; + nodaemon = 0; + polltime = 30; + clear = 0; + while ((c = getopt(a, v, "cdt:")) != -1) { + switch (c) { + case 'c': + clear = 1; + break; + case 'd': + nodaemon = 1; + break; + case 't': + polltime = atoi(optarg); + break; + default: + fprintf(stderr, usage, *v); + return (1); + } } carray = malloc(a); @@ -82,20 +90,20 @@ main(int a, char **v) perror("malloc"); return (1); } - for (dev = devbase; dev < a; dev++) - carray[dev] = (ses_encstat) -1; + for (dev = optind; dev < a; dev++) + carray[dev] = (encioc_enc_status_t) -1; /* * Check to make sure we can open all devices */ - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { perror(v[dev]); return (1); } - if (ioctl(fd, SESIOC_INIT, NULL) < 0) { - fprintf(stderr, "%s: SESIOC_INIT fails- %s\n", + if (ioctl(fd, ENCIOC_INIT, NULL) < 0) { + fprintf(stderr, "%s: ENCIOC_INIT fails- %s\n", v[dev], strerror(errno)); return (1); } @@ -112,7 +120,7 @@ main(int a, char **v) } for (;;) { - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { syslog(LOG_ERR, "%s: %m", v[dev]); @@ -122,12 +130,20 @@ main(int a, char **v) /* * Get the actual current enclosure status. */ - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) { + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &stat) < 0) { syslog(LOG_ERR, - "%s: SESIOC_GETENCSTAT- %m", v[dev]); + "%s: ENCIOC_GETENCSTAT- %m", v[dev]); (void) close(fd); continue; } + if (stat != 0 && clear) { + nstat = 0; + if (ioctl(fd, ENCIOC_SETENCSTAT, + (caddr_t) &nstat) < 0) { + syslog(LOG_ERR, + "%s: ENCIOC_SETENCSTAT- %m", v[dev]); + } + } (void) close(fd); if (stat == carray[dev]) @@ -139,9 +155,8 @@ main(int a, char **v) "%s: Enclosure Status OK", v[dev]); } if (stat & SES_ENCSTAT_INFO) { - syslog(LOG_INFO, - "%s: Enclosure Status Has Information", - v[dev]); + syslog(LOG_NOTICE, + "%s: Enclosure Has Information", v[dev]); } if (stat & SES_ENCSTAT_NONCRITICAL) { syslog(LOG_WARNING, Modified: stable/9/share/examples/ses/srcs/setencstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/setencstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/setencstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; long val; - ses_encstat stat; + encioc_enc_status_t stat; if (a != 3) { fprintf(stderr, "usage: %s device enclosure_status\n", *v); @@ -57,9 +60,9 @@ main(int a, char **v) } val = strtol(v[2], NULL, 0); - stat = (ses_encstat) val; - if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) { - perror("SESIOC_SETENCSTAT"); + stat = (encioc_enc_status_t)val; + if (ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &stat) < 0) { + perror("ENCIOC_SETENCSTAT"); } (void) close(fd); return (0); Modified: stable/9/share/examples/ses/srcs/setobjstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/setobjstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/setobjstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; int i; - ses_objstat obj; + encioc_elm_status_t obj; long cvt; char *x; @@ -64,7 +67,7 @@ usage: if (x == v[2]) { goto usage; } - obj.obj_id = cvt; + obj.elm_idx = cvt; for (i = 0; i < 4; i++) { x = v[3 + i]; cvt = strtol(v[3 + i], &x, 0); @@ -73,8 +76,8 @@ usage: } obj.cstat[i] = cvt; } - if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) { - perror("SESIOC_SETOBJSTAT"); + if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &obj) < 0) { + perror("ENCIOC_SETELMSTAT"); } (void) close(fd); return (0); Copied and modified: stable/9/sys/cam/scsi/scsi_enc.c (from r235911, head/sys/cam/scsi/scsi_enc.c) ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Thu May 24 14:07:44 2012 (r235911, copy source) +++ stable/9/sys/cam/scsi/scsi_enc.c Wed Feb 6 22:07:38 2013 (r246437) @@ -56,15 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include - MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers"); /* Enclosure type independent driver */ -#define SEN_ID "UNISYS SUN_SEN" -#define SEN_ID_LEN 24 - static d_open_t enc_open; static d_close_t enc_close; static d_ioctl_t enc_ioctl; @@ -136,15 +131,8 @@ enc_oninvalidate(struct cam_periph *peri */ enc->enc_flags |= ENC_FLAG_SHUTDOWN; if (enc->enc_daemon != NULL) { - /* Signal and wait for the ses daemon to terminate. */ + /* Signal the ses daemon to terminate. */ wakeup(enc->enc_daemon); - /* - * We're called with the SIM mutex held, but we're dropping - * the update mutex here on sleep. So we have to manually - * drop the SIM mutex. - */ - cam_periph_sleep(enc->periph, enc->enc_daemon, - PUSER, "thtrm", 0); } callout_drain(&enc->status_updater); @@ -567,7 +555,7 @@ enc_runcmd(struct enc_softc *enc, char * cdbl = IOCDBLEN; } - ccb = cam_periph_getccb(enc->periph, 1); + ccb = cam_periph_getccb(enc->periph, CAM_PRIORITY_NORMAL); if (enc->enc_type == ENC_SEMB_SES || enc->enc_type == ENC_SEMB_SAFT) { tdlen = min(dlen, 1020); tdlen = (tdlen + 3) & ~3; @@ -635,9 +623,8 @@ enc_log(struct enc_softc *enc, const cha /* * Is this a device that supports enclosure services? * - * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's - * an ENC device. If it happens to be an old UNISYS SEN device, we can - * handle that too. + * It's a a pretty simple ruleset- if it is device type + * 0x0D (13), it's an ENCLOSURE device. */ #define SAFTE_START 44 @@ -664,13 +651,9 @@ enc_type(struct ccb_getdev *cgd) iqd = (unsigned char *)&cgd->inq_data; buflen = min(sizeof(cgd->inq_data), SID_ADDITIONAL_LENGTH(&cgd->inq_data)); - if (buflen < 8+SEN_ID_LEN) - return (ENC_NONE); if ((iqd[0] & 0x1f) == T_ENCLOSURE) { - if (STRNCMP(&iqd[8], SEN_ID, SEN_ID_LEN) == 0) { - return (ENC_SEN); - } else if ((iqd[2] & 0x7) > 2) { + if ((iqd[2] & 0x7) > 2) { return (ENC_SES); } else { return (ENC_SES_SCSI2); @@ -839,6 +822,7 @@ enc_daemon(void *arg) } enc->enc_daemon = NULL; cam_periph_unlock(enc->periph); + cam_periph_release(enc->periph); kproc_exit(0); } @@ -849,6 +833,9 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, enc->periph->sim->mtx, 0); + if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + return (ENXIO); + result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, /*stackpgs*/0, "enc_daemon%d", enc->periph->unit_number); @@ -857,7 +844,8 @@ enc_kproc_init(enc_softc_t *enc) cam_periph_lock(enc->periph); enc->enc_vec.poll_status(enc); cam_periph_unlock(enc->periph); - } + } else + cam_periph_release(enc->periph); return (result); } @@ -887,11 +875,6 @@ enc_ctor(struct cam_periph *periph, void char *tname; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("enc_ctor: periph was NULL!!\n"); - goto out; - } - if (cgd == NULL) { printf("enc_ctor: no getdev CCB, can't register device\n"); goto out; @@ -920,7 +903,6 @@ enc_ctor(struct cam_periph *periph, void case ENC_SEMB_SAFT: err = safte_softc_init(enc); break; - case ENC_SEN: case ENC_NONE: default: ENC_FREE(enc); @@ -955,7 +937,7 @@ enc_ctor(struct cam_periph *periph, void err = enc_kproc_init(enc); if (err) { xpt_print(periph->path, - "error %d string enc_daemon\n", err); + "error %d starting enc_daemon\n", err); goto out; } } @@ -987,9 +969,6 @@ enc_ctor(struct cam_periph *periph, void case ENC_SES_PASSTHROUGH: tname = "ENC Passthrough Device"; break; - case ENC_SEN: - tname = "UNISYS SEN Device (NOT HANDLED YET)"; - break; case ENC_SAFT: tname = "SAF-TE Compliant Device"; break; Copied: stable/9/sys/cam/scsi/scsi_enc.h (from r235911, head/sys/cam/scsi/scsi_enc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/cam/scsi/scsi_enc.h Wed Feb 6 22:07:38 2013 (r246437, copy of r235911, head/sys/cam/scsi/scsi_enc.h) @@ -0,0 +1,219 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2000 by Matthew Jacob + * 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, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * the GNU Public License ("GPL"). + * + * 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. + * + */ +#ifndef _SCSI_ENC_H_ +#define _SCSI_ENC_H_ + +#include + +#define ENCIOC ('s' - 040) +#define ENCIOC_GETNELM _IO(ENCIOC, 1) +#define ENCIOC_GETELMMAP _IO(ENCIOC, 2) +#define ENCIOC_GETENCSTAT _IO(ENCIOC, 3) +#define ENCIOC_SETENCSTAT _IO(ENCIOC, 4) +#define ENCIOC_GETELMSTAT _IO(ENCIOC, 5) +#define ENCIOC_SETELMSTAT _IO(ENCIOC, 6) +#define ENCIOC_GETTEXT _IO(ENCIOC, 7) +#define ENCIOC_INIT _IO(ENCIOC, 8) +#define ENCIOC_GETELMDESC _IO(ENCIOC, 9) +#define ENCIOC_GETELMDEVNAMES _IO(ENCIOC, 10) +#define ENCIOC_GETSTRING _IO(ENCIOC, 11) +#define ENCIOC_SETSTRING _IO(ENCIOC, 12) + +/* + * Platform Independent Definitions for enclosure devices. + */ +/* + * SCSI Based Environmental Services Application Defines + * + * Based almost entirely on SCSI-3 ENC Revision 8A specification, + * but slightly abstracted as the underlying device may in fact + * be a SAF-TE or vendor unique device. + */ +/* + * ENC Driver Operations: + * (The defines themselves are platform and access method specific) + * + * ENCIOC_GETNELM + * ENCIOC_GETELMMAP + * ENCIOC_GETENCSTAT + * ENCIOC_SETENCSTAT + * ENCIOC_GETELMSTAT + * ENCIOC_SETELMSTAT + * ENCIOC_INIT + * + * + * An application finds out how many elements an enclosure instance + * is managing by performing a ENCIOC_GETNELM operation. It then + * performs a ENCIOC_GETELMMAP to get the map that contains the + * elment identifiers for all elements (see encioc_element_t below). + * This information is static. + * + * The application may perform ENCIOC_GETELMSTAT operations to retrieve + * status on an element (see the enc_elm_status_t structure below), + * ENCIOC_SETELMSTAT operations to set status for an element. + * + * Similarly, overall enclosure status me be fetched or set via + * ENCIOC_GETENCSTAT or ENCIOC_SETENCSTAT operations (see encioc_enc_status_t + * below). + * + * Readers should note that there is nothing that requires either a set + * or a clear operation to actually latch and do anything in the target. + * + * A ENCIOC_INIT operation causes the enclosure to be initialized. + */ + +/* Element Types */ +typedef enum { + ELMTYP_UNSPECIFIED = 0x00, + ELMTYP_DEVICE = 0x01, + ELMTYP_POWER = 0x02, + ELMTYP_FAN = 0x03, + ELMTYP_THERM = 0x04, + ELMTYP_DOORLOCK = 0x05, + ELMTYP_ALARM = 0x06, + ELMTYP_ESCC = 0x07, /* Enclosure SCC */ + ELMTYP_SCC = 0x08, /* SCC */ + ELMTYP_NVRAM = 0x09, + ELMTYP_INV_OP_REASON = 0x0a, + ELMTYP_UPS = 0x0b, + ELMTYP_DISPLAY = 0x0c, + ELMTYP_KEYPAD = 0x0d, + ELMTYP_ENCLOSURE = 0x0e, + ELMTYP_SCSIXVR = 0x0f, + ELMTYP_LANGUAGE = 0x10, + ELMTYP_COMPORT = 0x11, + ELMTYP_VOM = 0x12, + ELMTYP_AMMETER = 0x13, + ELMTYP_SCSI_TGT = 0x14, + ELMTYP_SCSI_INI = 0x15, + ELMTYP_SUBENC = 0x16, + ELMTYP_ARRAY_DEV = 0x17, + ELMTYP_SAS_EXP = 0x18, /* SAS expander */ + ELMTYP_SAS_CONN = 0x19 /* SAS connector */ +} elm_type_t; + +typedef struct encioc_element { + /* Element Index */ + unsigned int elm_idx; + + /* ID of SubEnclosure containing Element*/ + unsigned int elm_subenc_id; + + /* Element Type */ + elm_type_t elm_type; +} encioc_element_t; + +/* + * Overall Enclosure Status + */ +typedef unsigned char encioc_enc_status_t; + +/* + * Element Status + */ +typedef struct encioc_elm_status { + unsigned int elm_idx; + unsigned char cstat[4]; +} encioc_elm_status_t; + +/* + * ENC String structure, for StringIn and StringOut commands; use this with + * the ENCIOC_GETSTRING and ENCIOC_SETSTRING ioctls. + */ +typedef struct encioc_string { + size_t bufsiz; /* IN/OUT: length of string provided/returned */ +#define ENC_STRING_MAX 0xffff + uint8_t *buf; /* IN/OUT: string */ +} encioc_string_t; + +/*============================================================================*/ + +/* + * SES v2 r20 6.1.10 (pg 39) - Element Descriptor diagnostic page + * Tables 21, 22, and 23 + */ +typedef struct encioc_elm_desc { + unsigned int elm_idx; /* IN: elment requested */ + uint16_t elm_desc_len; /* IN: buffer size; OUT: bytes written */ + char *elm_desc_str; /* IN/OUT: buffer for descriptor data */ +} encioc_elm_desc_t; + +/* + * ENCIOC_GETELMDEVNAMES: + * ioctl structure to get an element's device names, if available + */ +typedef struct encioc_elm_devnames { + unsigned int elm_idx; /* IN: element index */ + size_t elm_names_size;/* IN: size of elm_devnames */ + size_t elm_names_len; /* OUT: actual size returned */ + /* + * IN/OUT: comma separated list of peripheral driver + * instances servicing this element. + */ + char *elm_devnames; +} encioc_elm_devnames_t; + +/* ioctl structure for requesting FC info for a port */ +typedef struct encioc_elm_fc_port { + unsigned int elm_idx; + unsigned int port_idx; + struct ses_elm_fc_port port_data; +} encioc_elm_fc_port_t; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:22:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3972F3C3; Wed, 6 Feb 2013 22:22:16 +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 0896CEF9; Wed, 6 Feb 2013 22:22: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 r16MMFqi088750; Wed, 6 Feb 2013 22:22:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MMF2U088748; Wed, 6 Feb 2013 22:22:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062222.r16MMF2U088748@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246438 - in stable/9/sys/cam: . scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:22:16 -0000 Author: mav Date: Wed Feb 6 22:22:15 2013 New Revision: 246438 URL: http://svnweb.freebsd.org/changeset/base/246438 Log: MFC r241503: XPT_DEV_MATCH is probably the only xpt_action() method that is called without holding SIM lock. It really doesn't need that lock, but adding it removes that specific exception, allowing to assert locking there later. Modified: stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:07:38 2013 (r246437) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:22:15 2013 (r246438) @@ -582,7 +582,9 @@ xptioctl(struct cdev *dev, u_long cmd, c /* * This is an immediate CCB, we can send it on directly. */ + CAM_SIM_LOCK(xpt_path_sim(xpt_periph->path)); xpt_action(inccb); + CAM_SIM_UNLOCK(xpt_path_sim(xpt_periph->path)); /* * Map the buffers back into user space. @@ -2815,6 +2817,11 @@ xpt_action_default(union ccb *start_ccb) position_type = CAM_DEV_POS_PDRV; } + /* + * Note that we drop the SIM lock here, because the EDT + * traversal code needs to do its own locking. + */ + CAM_SIM_UNLOCK(xpt_path_sim(cdm->ccb_h.path)); switch(position_type & CAM_DEV_POS_TYPEMASK) { case CAM_DEV_POS_EDT: xptedtmatch(cdm); @@ -2826,6 +2833,7 @@ xpt_action_default(union ccb *start_ccb) cdm->status = CAM_DEV_MATCH_ERROR; break; } + CAM_SIM_LOCK(xpt_path_sim(cdm->ccb_h.path)); if (cdm->status == CAM_DEV_MATCH_ERROR) start_ccb->ccb_h.status = CAM_REQ_CMP_ERR; Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Feb 6 22:07:38 2013 (r246437) +++ stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Feb 6 22:22:15 2013 (r246438) @@ -901,9 +901,10 @@ ses_path_iter_devid_callback(enc_softc_t device_pattern->data.devid_pat.id_len); memset(&cdm, 0, sizeof(cdm)); - if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, CAM_XPT_PATH_ID, - CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + if (xpt_create_path_unlocked(&cdm.ccb_h.path, /*periph*/NULL, + CAM_XPT_PATH_ID, + CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) return; cdm.ccb_h.func_code = XPT_DEV_MATCH; @@ -913,8 +914,11 @@ ses_path_iter_devid_callback(enc_softc_t cdm.match_buf_len = sizeof(match_result); cdm.matches = &match_result; + sim = xpt_path_sim(cdm.ccb_h.path); + CAM_SIM_LOCK(sim); xpt_action((union ccb *)&cdm); xpt_free_path(cdm.ccb_h.path); + CAM_SIM_UNLOCK(sim); if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP || (cdm.status != CAM_DEV_MATCH_LAST From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:25:29 2013 Return-Path: Delivered-To: svn-src-all@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 132FE57C; Wed, 6 Feb 2013 22:25:29 +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 EACF0F22; Wed, 6 Feb 2013 22:25: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 r16MPSev089273; Wed, 6 Feb 2013 22:25:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MPSd1089271; Wed, 6 Feb 2013 22:25:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062225.r16MPSd1089271@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246439 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:25:29 -0000 Author: mav Date: Wed Feb 6 22:25:28 2013 New Revision: 246439 URL: http://svnweb.freebsd.org/changeset/base/246439 Log: MFC r242358 (by trasz): Use M_ZERO instead of explicit memsets and bzeros. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 22:22:15 2013 (r246438) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 22:25:28 2013 (r246439) @@ -957,11 +957,10 @@ ctl_init(void) if (ctl_disable != 0) return; - control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK); + control_softc = malloc(sizeof(*control_softc), M_DEVBUF, + M_WAITOK | M_ZERO); softc = control_softc; - memset(softc, 0, sizeof(*softc)); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "cam/ctl"); @@ -3271,14 +3270,13 @@ ctl_pool_create(struct ctl_softc *ctl_so retval = 0; - pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT); + pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, + M_NOWAIT | M_ZERO); if (pool == NULL) { retval = -ENOMEM; goto bailout; } - memset(pool, 0, sizeof(*pool)); - pool->type = pool_type; pool->ctl_softc = ctl_softc; @@ -6561,7 +6559,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len, page_len, total_len); #endif - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6574,7 +6572,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - memset(ctsio->kern_data_ptr, 0, total_len); switch (ctsio->cdb[0]) { case MODE_SENSE_6: { @@ -6742,7 +6739,7 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6751,8 +6748,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - /* * If the maximum LBA is greater than 0xfffffffe, the user must * issue a SERVICE ACTION IN (16) command, with the read capacity @@ -6806,7 +6801,7 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6822,8 +6817,6 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); @@ -6913,8 +6906,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - memset(ctsio->kern_data_ptr, 0, total_len); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; @@ -7068,7 +7060,7 @@ retry: } mtx_unlock(&softc->ctl_lock); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7084,8 +7076,6 @@ retry: ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(ctsio->kern_data_ptr, 0, total_len); - mtx_lock(&softc->ctl_lock); switch (cdb->action) { case SPRI_RK: { // read keys @@ -8611,7 +8601,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); - ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO); lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8630,8 +8620,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - memset(lun_data, 0, lun_datalen); - /* * We set this to the actual data length, regardless of how much * space we actually have to return results. If the user looks at @@ -8907,7 +8895,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc * XXX KDM GFP_??? We probably don't want to wait here, * unless we end up having a process/thread context. */ - ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8930,8 +8918,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(pages, 0, sup_page_size); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -8971,7 +8957,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* XXX KDM which malloc flags here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8994,8 +8980,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(sn_ptr, 0, sizeof(*sn_ptr)); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -9065,7 +9049,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio sizeof(struct scsi_vpd_id_trgt_port_grp_id); /* XXX KDM which malloc flags here ?? */ - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9096,7 +9080,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio CTL_WWPN_LEN); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - memset(devid_ptr, 0, devid_len); /* * The control device is always connected. The disk device, on the @@ -9296,7 +9279,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * that much. */ /* XXX KDM what malloc flags should we use here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9318,8 +9301,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->kern_total_len = alloc_len; } - memset(inq_ptr, 0, sizeof(*inq_ptr)); - /* * If we have a LUN configured, report it as connected. Otherwise, * report that it is offline or no device is supported, depending Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 22:22:15 2013 (r246438) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 22:25:28 2013 (r246439) @@ -376,7 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:30:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10B4E767; Wed, 6 Feb 2013 22:30:41 +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 02B1FF67; Wed, 6 Feb 2013 22:30: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 r16MUee0090166; Wed, 6 Feb 2013 22:30:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MUetE090164; Wed, 6 Feb 2013 22:30:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062230.r16MUetE090164@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246440 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:30:41 -0000 Author: mav Date: Wed Feb 6 22:30:40 2013 New Revision: 246440 URL: http://svnweb.freebsd.org/changeset/base/246440 Log: MFC r244001 (by ken): Fix a panic during CAM EDT traversal. The problem was a race condition between the EDT traversal used by things like 'camcontrol devlist', and CAM peripheral driver removal. The EDT traversal code holds the CAM topology lock, and wants to show devices that have been invalidated. It acquires a reference to the peripheral to make sure the peripheral it is examining doesn't go away. However, because the peripheral removal code in camperiphfree() drops the CAM topology lock to call the peripheral's destructor routine, we can run into a situation where the EDT traversal increments the peripheral reference count after free process is already in progress. At that point, the reference count is ignored, because it was 0 when we started the process. Fix this race by setting a flag, CAM_PERIPH_FREE, that I previously added and checked in xptperiphtraverse() and xptpdperiphtravsere(), but failed to use. If the EDT traversal code sees that flag, it will know that the peripheral free process has already started, and that it should not access that peripheral. Also, fix an inconsistency in the locking between xptpdperiphtraverse() and xptperiphtraverse(). They now both hold the CAM topology lock while calling the peripheral traversal function. cam_xpt.c: Change xptperiphtraverse() to hold the CAM topology lock across calls to the traversal function. Take out the comment in xptpdperiphtraverse() that referenced the locking inconsistency. cam_periph.c: Set the CAM_PERIPH_FREE flag when we are in the process of freeing a peripheral driver. Sponsored by: Spectra Logic Corporation Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Feb 6 22:25:28 2013 (r246439) +++ stable/9/sys/cam/cam_periph.c Wed Feb 6 22:30:40 2013 (r246440) @@ -615,6 +615,14 @@ camperiphfree(struct cam_periph *periph) } /* + * We need to set this flag before dropping the topology lock, to + * let anyone who is traversing the list that this peripheral is + * about to be freed, and there will be no more reference count + * checks. + */ + periph->flags |= CAM_PERIPH_FREE; + + /* * The peripheral destructor semantics dictate calling with only the * SIM mutex held. Since it might sleep, it should not be called * with the topology lock held. Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:25:28 2013 (r246439) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:30:40 2013 (r246440) @@ -2178,8 +2178,8 @@ xptperiphtraverse(struct cam_ed *device, * invalidated, but not peripherals that are scheduled to * be freed. So instead of calling cam_periph_acquire(), * which will fail if the periph has been invalidated, we - * just check for the free flag here. If it is free, we - * skip to the next periph. + * just check for the free flag here. If it is in the + * process of being freed, we skip to the next periph. */ if (periph->flags & CAM_PERIPH_FREE) { next_periph = SLIST_NEXT(periph, periph_links); @@ -2192,16 +2192,9 @@ xptperiphtraverse(struct cam_ed *device, */ periph->refcount++; - xpt_unlock_buses(); - retval = tr_func(periph, arg); /* - * We need the lock for list traversal. - */ - xpt_lock_buses(); - - /* * Grab the next peripheral before we release this one, so * our next pointer is still valid. */ @@ -2283,11 +2276,6 @@ xptpdperiphtraverse(struct periph_driver */ periph->refcount++; - /* - * XXX KDM we have the toplogy lock here, but in - * xptperiphtraverse(), we drop it before calling the - * traversal function. Which is correct? - */ retval = tr_func(periph, arg); /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:32:46 2013 Return-Path: Delivered-To: svn-src-all@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 47003909; Wed, 6 Feb 2013 22:32:46 +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 36C31F8A; Wed, 6 Feb 2013 22:32: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 r16MWknB091955; Wed, 6 Feb 2013 22:32:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MWkvD091954; Wed, 6 Feb 2013 22:32:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062232.r16MWkvD091954@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246441 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:32:46 -0000 Author: mav Date: Wed Feb 6 22:32:45 2013 New Revision: 246441 URL: http://svnweb.freebsd.org/changeset/base/246441 Log: MFC r244016 (by ken): Make sure we hold the SIM lock when calling xpt_free_path(). Sponsored by: Spectra Logic Corporation Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:30:40 2013 (r246440) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:32:45 2013 (r246441) @@ -1822,8 +1822,6 @@ ctlfe_onoffline(void *arg, int online) xpt_action(ccb); - CAM_SIM_UNLOCK(sim); - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("%s: SIM %s (path id %d) target %s failed with " "status %#x\n", @@ -1836,9 +1834,12 @@ ctlfe_onoffline(void *arg, int online) (online != 0) ? "enable" : "disable"); } - free(ccb, M_TEMP); xpt_free_path(path); + CAM_SIM_UNLOCK(sim); + + free(ccb, M_TEMP); + return; } @@ -1920,10 +1921,10 @@ ctlfe_lun_enable(void *arg, struct ctl_i 0, softc); - mtx_unlock(sim->mtx); - xpt_free_path(path); + mtx_unlock(sim->mtx); + return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 22:39:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A253EA9; Wed, 6 Feb 2013 22:39:46 +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 0571F28; Wed, 6 Feb 2013 22:39: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 r16Mdjep093291; Wed, 6 Feb 2013 22:39:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MdjAg093290; Wed, 6 Feb 2013 22:39:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062239.r16MdjAg093290@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246442 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:39:46 -0000 Author: mav Date: Wed Feb 6 22:39:45 2013 New Revision: 246442 URL: http://svnweb.freebsd.org/changeset/base/246442 Log: MFC r236426 (by mjacob): Print FC PortID as a hex number. This makes it easy to figure out domain, etc.. Zero ATIO and INOTify allocations. It makes for much less guesswork when looking at the structure and seeing 'deadc0de' present. Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:32:45 2013 (r246441) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:39:45 2013 (r246442) @@ -499,7 +499,7 @@ ctlfeasync(void *callback_arg, uint32_t dev_chg = (struct ac_device_changed *)ac->contract_data; - printf("%s: WWPN %#jx port %u path %u target %u %s\n", + printf("%s: WWPN %#jx port 0x%06x path %u target %u %s\n", __func__, dev_chg->wwpn, dev_chg->port, xpt_path_path_id(path), dev_chg->target, (dev_chg->arrived == 0) ? "left" : "arrived"); @@ -590,7 +590,7 @@ ctlferegister(struct cam_periph *periph, union ccb *new_ccb; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, - M_NOWAIT); + M_ZERO|M_NOWAIT); if (new_ccb == NULL) { status = CAM_RESRC_UNAVAIL; break; @@ -624,7 +624,7 @@ ctlferegister(struct cam_periph *periph, union ccb *new_ccb; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, - M_NOWAIT); + M_ZERO|M_NOWAIT); if (new_ccb == NULL) { status = CAM_RESRC_UNAVAIL; break; From owner-svn-src-all@FreeBSD.ORG Wed Feb 6 23:51:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E356F309; Wed, 6 Feb 2013 23:51:09 +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 382FD3F3; Wed, 6 Feb 2013 23:51:09 +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 r16Np0JY070420; Thu, 7 Feb 2013 01:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r16Np0JY070420 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r16Np0d3070419; Thu, 7 Feb 2013 01:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Feb 2013 01:51:00 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump Message-ID: <20130206235100.GD2522@kib.kiev.ua> References: <201302062207.r16M7d92083023@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mF1peDl4f1TE7z5s" Content-Disposition: inline In-Reply-To: <201302062207.r16M7d92083023@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-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 23:51:10 -0000 --mF1peDl4f1TE7z5s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: > Author: mav > Date: Wed Feb 6 22:07:38 2013 > New Revision: 246437 > URL: http://svnweb.freebsd.org/changeset/base/246437 >=20 > Log: > MFC r235911, r235980, r238739, r238740, r238894, r239213, r241488, r241= 952, > r242173, r242621, r242634, r242638, r242647, r242720, r244418, r244508, > r245891: > Revamp the CAM enclosure services driver. > This updated driver uses an in-kernel daemon to track state changes and > publishes physical path location information for disk elements into the > CAM device database. > =20 > Sponsored by: Spectra Logic Corporation > Sponsored by: iXsystems, Inc. >=20 > Added: > stable/9/sys/cam/scsi/scsi_enc.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc.c > stable/9/sys/cam/scsi/scsi_enc.h > - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc.h > stable/9/sys/cam/scsi/scsi_enc_internal.h > - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc_internal= =2Eh > stable/9/sys/cam/scsi/scsi_enc_safte.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_safte.c > stable/9/sys/cam/scsi/scsi_enc_ses.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_ses.c > Deleted: > stable/9/sys/cam/scsi/scsi_ses.c > Modified: > stable/9/share/examples/ses/Makefile.inc > stable/9/share/examples/ses/sesd/sesd.0 > stable/9/share/examples/ses/srcs/eltsub.c > stable/9/share/examples/ses/srcs/getencstat.c > stable/9/share/examples/ses/srcs/getnobj.c > stable/9/share/examples/ses/srcs/getobjmap.c > stable/9/share/examples/ses/srcs/getobjstat.c > stable/9/share/examples/ses/srcs/inienc.c > stable/9/share/examples/ses/srcs/sesd.c > stable/9/share/examples/ses/srcs/setencstat.c > stable/9/share/examples/ses/srcs/setobjstat.c > stable/9/sys/cam/scsi/scsi_pt.c > stable/9/sys/cam/scsi/scsi_ses.h > stable/9/sys/conf/files > stable/9/sys/fs/devfs/devfs_vnops.c > stable/9/sys/modules/cam/Makefile > stable/9/usr.bin/kdump/mkioctls Why is this code kept and developed in the share/examples ? --mF1peDl4f1TE7z5s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJREuxkAAoJEJDCuSvBvK1BNjAP/3kppr0JUW2+/kf2/FfppUc0 L7fwsEkAbPEL9wFCwgTzixA8pcIlT7FOH5z2uyCUyH5bZKD1/e0HwE/iliWm5hDZ ZpvxRJOwtyksaZaWZx9rqA7MT03S0G1HxTR0J+pz39k8ssnL3eUktKXPNmEz3bgA AxDHCqAS2wa0CNF9U8SeqYWFxuqEnP/JK4PEobJZU5RM8MNL07YMLsLYp4xVytrr mbUbNl6HQlLJsFt6eNs/RilGVT9FJ3xLEmhHWgTmzaFnpsGt0Is0InhiWOAClK38 WlVSZ3WukiPJkcxyOeh5QNkjDqs+IQ/0gkzAQ+WNAgs/nYR91vhZA0qHtqA+wsLX OowF61WeIg2aZG4gGw+SjpU/SMgQcKNlF6yZNOVzhK43aoKXl9FVrA83C/HBnzJr w9QhMH/9+m8KA1lnz6qdNR+X7JjtM3hY740hJw+l4qx7jYtfNdiWYweyIeTueO1w 5o4N9sVVmDEe/AkPrRlFiINyQFEYAwAsDDybspIbd0yTQqw/evUeE5gXkG8/Fl1T WGxc4kyrKSbcUv45TzJSGSCGvN1vTIzFYmpUBdX/kdEwqyEvkZ9jRz4kcyB94fXt H2LaORiNBI6I86em9ziZG80BmrJ/Q9thdSMmZGu0/HHXS28gHHWJQpkP1yccBH88 B0BAbW/K7RKqdMvpS4qY =/5c/ -----END PGP SIGNATURE----- --mF1peDl4f1TE7z5s-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 00:19:01 2013 Return-Path: Delivered-To: svn-src-all@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 DA9FE93D; Thu, 7 Feb 2013 00:19:01 +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 4853E724; Thu, 7 Feb 2013 00:19:01 +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 r170Iv7s073260; Thu, 7 Feb 2013 02:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r170Iv7s073260 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r170IvQk073259; Thu, 7 Feb 2013 02:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Feb 2013 02:18:57 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump Message-ID: <20130207001857.GE2522@kib.kiev.ua> References: <201302062207.r16M7d92083023@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NcuWGV+7VxnbytuS" Content-Disposition: inline In-Reply-To: <201302062207.r16M7d92083023@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-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 00:19:01 -0000 --NcuWGV+7VxnbytuS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: > stable/9/sys/fs/devfs/devfs_vnops.c Did you forgot to merge r235922 ? --NcuWGV+7VxnbytuS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJREvLwAAoJEJDCuSvBvK1Bm3wQAJ4Mv9uTQ5mcXA7KcN2pqXoO Jjp92Poi0pqA8y/ngZlHlROk5JQTfi4wS1II3nt/UjztTym93FD1wJl6gt25Ss/E 66JgJJOHQ3Ympb8IRqE2MWkzntgTB6h+8XAzVt1hW6Y9QxxzlcqCGhdGFIwSmyYi rwcsGl0qOVb7ifvJe1p4k6qhb2F0HnvTuQnk6bJG4NQvrqwXO/SpPsaI4TfxvuKT 8+6CtBrf1BKB02MEzt10Q8k/5TiFHf78RiRBn/fL2i3KJBERX5nczUu8NuLL+dNN sGISYFjnR7nq1S+tJEUA8Y3969XcEa+Jp8JqYdz49ogq9SSajbO79MSafYHjqg/X r5AMOulfCUPagPjHw/m1lFkhkpyJiifvBUNm2xF5BZgxazK+W1ZRwXx2Yq1MQRQJ s2blw6xhBz3b8kMJ94q8BdiY0uAoQPQaG3SU6YIS5TxUdGsvnUhhqbOZhdyAoBmq z7iV5N4DontIeZveEMkrXM/9AiaEnZAYF0dWlpRDTypfXhbRtxXCVGS0S0T6pYJ8 xE7qe+W9eGqKlhz4N5p6MYyVPeJ/SqdzQEG4yny1Tf2cXnETit/sma0UMsCD9ZSk eBhpwoJJmpuf6tYgS7jPTpps9KmP9BvWJH699vuTd3pYJfWpJv038UCSdo8ujogQ mu440BnDTw3DL/e9WjwQ =ENB0 -----END PGP SIGNATURE----- --NcuWGV+7VxnbytuS-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 00:24:24 2013 Return-Path: Delivered-To: svn-src-all@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 22E65C20; Thu, 7 Feb 2013 00:24:24 +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 0000B760; Thu, 7 Feb 2013 00:24:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r170ONOA025909; Thu, 7 Feb 2013 00:24:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r170ONES025908; Thu, 7 Feb 2013 00:24:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302070024.r170ONES025908@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Feb 2013 00:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246446 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 00:24:24 -0000 Author: pjd Date: Thu Feb 7 00:24:23 2013 New Revision: 246446 URL: http://svnweb.freebsd.org/changeset/base/246446 Log: Add AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr() function, which is currently unused. Sponsored by: The FreeBSD Foundation Modified: head/sys/security/audit/audit.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Wed Feb 6 23:48:04 2013 (r246445) +++ head/sys/security/audit/audit.h Thu Feb 7 00:24:23 2013 (r246446) @@ -261,6 +261,11 @@ void audit_thread_free(struct thread *t audit_arg_socket((sodomain), (sotype), (soprotocol)); \ } while (0) +#define AUDIT_ARG_SOCKADDR(td, sa) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_sockaddr((td), (sa)); \ +} while (0) + #define AUDIT_ARG_SUID(suid) do { \ if (AUDITING_TD(curthread)) \ audit_arg_suid((suid)); \ @@ -353,6 +358,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_SIGNUM(signum) #define AUDIT_ARG_SGID(sgid) #define AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol) +#define AUDIT_ARG_SOCKADDR(td, sa) #define AUDIT_ARG_SUID(suid) #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 00:27:12 2013 Return-Path: Delivered-To: svn-src-all@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 2A03BDBD; Thu, 7 Feb 2013 00:27:12 +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 1C6C7786; Thu, 7 Feb 2013 00:27: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 r170RBAJ026363; Thu, 7 Feb 2013 00:27:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r170RBOS026362; Thu, 7 Feb 2013 00:27:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302070027.r170RBOS026362@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Feb 2013 00:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246447 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 00:27:12 -0000 Author: pjd Date: Thu Feb 7 00:27:11 2013 New Revision: 246447 URL: http://svnweb.freebsd.org/changeset/base/246447 Log: Minor style tweaks. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Feb 7 00:24:23 2013 (r246446) +++ head/sys/kern/uipc_syscalls.c Thu Feb 7 00:27:11 2013 (r246447) @@ -956,11 +956,11 @@ kern_recvit(td, s, mp, fromseg, controlp int i; ssize_t len; int error; - struct mbuf *m, *control = 0; + struct mbuf *m, *control = NULL; caddr_t ctlbuf; struct file *fp; struct socket *so; - struct sockaddr *fromsa = 0; + struct sockaddr *fromsa = NULL; #ifdef KTRACE struct uio *ktruio = NULL; #endif @@ -1001,8 +1001,8 @@ kern_recvit(td, s, mp, fromseg, controlp ktruio = cloneuio(&auio); #endif len = auio.uio_resid; - error = soreceive(so, &fromsa, &auio, (struct mbuf **)0, - (mp->msg_control || controlp) ? &control : (struct mbuf **)0, + error = soreceive(so, &fromsa, &auio, NULL, + (mp->msg_control || controlp) ? &control : NULL, &mp->msg_flags); if (error) { if (auio.uio_resid != len && (error == ERESTART || @@ -1020,7 +1020,7 @@ kern_recvit(td, s, mp, fromseg, controlp td->td_retval[0] = len - auio.uio_resid; if (mp->msg_name) { len = mp->msg_namelen; - if (len <= 0 || fromsa == 0) + if (len <= 0 || fromsa == NULL) len = 0; else { /* save sa_len before it is destroyed by MSG_COMPAT */ @@ -1095,7 +1095,7 @@ out: if (fromsa) free(fromsa, M_SONAME); - if (error == 0 && controlp != NULL) + if (error == 0 && controlp != NULL) *controlp = control; else if (control) m_freem(control); @@ -1716,7 +1716,7 @@ getsockaddr(namp, uaddr, len) struct sendfile_sync { struct mtx mtx; struct cv cv; - unsigned count; + unsigned count; }; /* @@ -2233,7 +2233,7 @@ retry_space: } /* Quit outer loop on error or when we're done. */ - if (done) + if (done) break; if (error) goto done; @@ -2333,7 +2333,7 @@ sys_sctp_peeloff(td, uap) CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) + if (so == NULL) goto noconnection; /* * Before changing the flags on the socket, we have to bump the @@ -2387,12 +2387,12 @@ int sys_sctp_generic_sendmsg (td, uap) struct thread *td; struct sctp_generic_sendmsg_args /* { - int sd, - caddr_t msg, - int mlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, + int sd, + caddr_t msg, + int mlen, + caddr_t to, + __socklen_t tolen, + struct sctp_sndrcvinfo *sinfo, int flags } */ *uap; { @@ -2498,12 +2498,12 @@ int sys_sctp_generic_sendmsg_iov(td, uap) struct thread *td; struct sctp_generic_sendmsg_iov_args /* { - int sd, - struct iovec *iov, - int iovlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, + int sd, + struct iovec *iov, + int iovlen, + caddr_t to, + __socklen_t tolen, + struct sctp_sndrcvinfo *sinfo, int flags } */ *uap; { @@ -2625,12 +2625,12 @@ int sys_sctp_generic_recvmsg(td, uap) struct thread *td; struct sctp_generic_recvmsg_args /* { - int sd, - struct iovec *iov, + int sd, + struct iovec *iov, int iovlen, - struct sockaddr *from, + struct sockaddr *from, __socklen_t *fromlenaddr, - struct sctp_sndrcvinfo *sinfo, + struct sctp_sndrcvinfo *sinfo, int *msg_flags } */ *uap; { @@ -2696,7 +2696,7 @@ sys_sctp_generic_recvmsg(td, uap) } auio.uio_iov = iov; auio.uio_iovcnt = uap->iovlen; - auio.uio_segflg = UIO_USERSPACE; + auio.uio_segflg = UIO_USERSPACE; auio.uio_rw = UIO_READ; auio.uio_td = td; auio.uio_offset = 0; /* XXX */ @@ -2767,7 +2767,7 @@ sys_sctp_generic_recvmsg(td, uap) out: free(iov, M_IOV); out1: - if (fp) + if (fp) fdrop(fp, td); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 00:36:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7466A74; Thu, 7 Feb 2013 00:36:01 +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 62F997D1; Thu, 7 Feb 2013 00:36:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r170a14W029159; Thu, 7 Feb 2013 00:36:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r170a1dY029157; Thu, 7 Feb 2013 00:36:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302070036.r170a1dY029157@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Feb 2013 00:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246448 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 00:36:01 -0000 Author: pjd Date: Thu Feb 7 00:36:00 2013 New Revision: 246448 URL: http://svnweb.freebsd.org/changeset/base/246448 Log: Audit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and recvfrom(2) syscalls. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Feb 7 00:27:11 2013 (r246447) +++ head/sys/kern/uipc_syscalls.c Thu Feb 7 00:36:00 2013 (r246448) @@ -238,6 +238,7 @@ kern_bind(td, fd, sa) int error; AUDIT_ARG_FD(fd); + AUDIT_ARG_SOCKADDR(td, sa); error = getsock_cap(td->td_proc->p_fd, fd, CAP_BIND, &fp, NULL); if (error) return (error); @@ -452,6 +453,7 @@ kern_accept(struct thread *td, int s, st *namelen = 0; goto done; } + AUDIT_ARG_SOCKADDR(td, sa); if (name) { /* check sa_len before it is destroyed */ if (*namelen > sa->sa_len) @@ -547,6 +549,7 @@ kern_connect(td, fd, sa) int interrupted = 0; AUDIT_ARG_FD(fd); + AUDIT_ARG_SOCKADDR(td, sa); error = getsock_cap(td->td_proc->p_fd, fd, CAP_CONNECT, &fp, NULL); if (error) return (error); @@ -763,8 +766,10 @@ kern_sendit(td, s, mp, flags, control, s AUDIT_ARG_FD(s); rights = CAP_WRITE; - if (mp->msg_name != NULL) + if (mp->msg_name != NULL) { + AUDIT_ARG_SOCKADDR(td, mp->msg_name); rights |= CAP_CONNECT; + } error = getsock_cap(td->td_proc->p_fd, s, rights, &fp, NULL); if (error) return (error); @@ -1009,6 +1014,8 @@ kern_recvit(td, s, mp, fromseg, controlp error == EINTR || error == EWOULDBLOCK)) error = 0; } + if (fromsa != NULL) + AUDIT_ARG_SOCKADDR(td, fromsa); #ifdef KTRACE if (ktruio != NULL) { ktruio->uio_resid = len - auio.uio_resid; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 02:15:26 2013 Return-Path: Delivered-To: svn-src-all@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 B72CD16D; Thu, 7 Feb 2013 02:15:26 +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 91A31AEC; Thu, 7 Feb 2013 02:15: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 r172FQoD059173; Thu, 7 Feb 2013 02:15:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r172FPcw059169; Thu, 7 Feb 2013 02:15:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302070215.r172FPcw059169@svn.freebsd.org> From: Adrian Chadd Date: Thu, 7 Feb 2013 02:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246450 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 02:15:26 -0000 Author: adrian Date: Thu Feb 7 02:15:25 2013 New Revision: 246450 URL: http://svnweb.freebsd.org/changeset/base/246450 Log: Methodize the process of adding the software TX queue to the taskqueue. Move it (for now) to the TX taskqueue. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 7 00:48:42 2013 (r246449) +++ head/sys/dev/ath/if_ath.c Thu Feb 7 02:15:25 2013 (r246450) @@ -4230,9 +4230,9 @@ ath_tx_processq(struct ath_softc *sc, st ieee80211_ff_flush(ic, txq->axq_ac); #endif - /* Kick the TXQ scheduler */ + /* Kick the software TXQ scheduler */ if (dosched) { - taskqueue_enqueue(sc->sc_tx_tq, &sc->sc_txqtask); + ath_tx_swq_kick(sc); } ATH_KTR(sc, ATH_KTR_TXCOMP, 1, Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Thu Feb 7 00:48:42 2013 (r246449) +++ head/sys/dev/ath/if_ath_misc.h Thu Feb 7 02:15:25 2013 (r246450) @@ -120,12 +120,24 @@ extern void ath_tx_update_tim(struct ath extern void ath_start(struct ifnet *ifp); extern void ath_start_task(void *arg, int npending); +/* + * Kick the frame TX task. + */ static inline void ath_tx_kick(struct ath_softc *sc) { - /* XXX eventually try sc_tx_tq? */ taskqueue_enqueue(sc->sc_tx_tq, &sc->sc_txpkttask); } +/* + * Kick the software TX queue task. + */ +static inline void +ath_tx_swq_kick(struct ath_softc *sc) +{ + + taskqueue_enqueue(sc->sc_tx_tq, &sc->sc_txqtask); +} + #endif Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Feb 7 00:48:42 2013 (r246449) +++ head/sys/dev/ath/if_ath_tx.c Thu Feb 7 02:15:25 2013 (r246450) @@ -2999,9 +2999,11 @@ ath_tx_tid_resume(struct ath_softc *sc, } ath_tx_tid_sched(sc, tid); - /* Punt some frames to the hardware if needed */ - //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); - taskqueue_enqueue(sc->sc_tx_tq, &sc->sc_txqtask); + + /* + * Queue the software TX scheduler. + */ + ath_tx_swq_kick(sc); } /* Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Thu Feb 7 00:48:42 2013 (r246449) +++ head/sys/dev/ath/if_ath_tx_edma.c Thu Feb 7 02:15:25 2013 (r246450) @@ -655,7 +655,7 @@ ath_edma_tx_processq(struct ath_softc *s * the txq task for _one_ TXQ. This should be fixed. */ if (dosched) - taskqueue_enqueue(sc->sc_tx_tq, &sc->sc_txqtask); + ath_tx_swq_kick(sc); } static void From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 04:49:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B79B12FE; Thu, 7 Feb 2013 04:49:29 +0000 (UTC) (envelope-from bjk@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 8B388D8; Thu, 7 Feb 2013 04:49: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 r174nTfS004774; Thu, 7 Feb 2013 04:49:29 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r174nTWD004773; Thu, 7 Feb 2013 04:49:29 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201302070449.r174nTWD004773@svn.freebsd.org> From: Benjamin Kaduk Date: Thu, 7 Feb 2013 04:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246451 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 04:49:29 -0000 Author: bjk (doc committer) Date: Thu Feb 7 04:49:28 2013 New Revision: 246451 URL: http://svnweb.freebsd.org/changeset/base/246451 Log: MFC r245051: Grammar fixes and some wordsmithing Discussed with: rmacklem Approved by: hrs (mentor) Modified: stable/9/usr.sbin/gssd/gssd.8 Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.8 ============================================================================== --- stable/9/usr.sbin/gssd/gssd.8 Thu Feb 7 02:15:25 2013 (r246450) +++ stable/9/usr.sbin/gssd/gssd.8 Thu Feb 7 04:49:28 2013 (r246451) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2012 +.Dd December 30, 2012 .Dt GSSD 8 .Os .Sh NAME @@ -53,25 +53,22 @@ will not fork when it starts. Look for an appropriate credential cache file in this list of directories. The list should be full pathnames from root, separated by ':' characters. Usually this list will simply be "/tmp". -Without this option, the +Without this option, .Nm -daemon assumes that the credential cache file is called /tmp/krb5cc_, +assumes that the credential cache file is called /tmp/krb5cc_, where is the effective uid for the RPC caller. .It Fl c Ar file-substring Set a file-substring for the credential cache file names. Only files with this substring embedded in their names will be -selected as candidates when the +selected as candidates when .Fl s has been specified. If not specified, it defaults to "krb5cc_". .It Fl r Ar preferred-realm -Set a preferred Kerberos realm for the search of the directory list for -a credentials cache file. -When set, files with TGT credentials for this realm will be selected over -other credential files. -This option is only meaningful when the -.Fl s -option has been specified. +Use Kerberos credentials for this realm when searching for +credentials in directories specified with +.Fl s . +If not specified, the default Kerberos realm will be used. .El .Sh FILES .Bl -tag -width ".Pa /etc/krb5.keytab" -compact From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 06:48:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49A38DAB; Thu, 7 Feb 2013 06:48:48 +0000 (UTC) (envelope-from neel@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 24C3936C; Thu, 7 Feb 2013 06:48: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 r176mm93040111; Thu, 7 Feb 2013 06:48:48 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r176mmKS040110; Thu, 7 Feb 2013 06:48:48 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302070648.r176mmKS040110@svn.freebsd.org> From: Neel Natu Date: Thu, 7 Feb 2013 06:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246452 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 06:48:48 -0000 Author: neel Date: Thu Feb 7 06:48:47 2013 New Revision: 246452 URL: http://svnweb.freebsd.org/changeset/base/246452 Log: If an interrupt event's assign_cpu method fails, then restore the original cpuset mask for the associated interrupt thread. The text used above is verbatim from r195249 and the code should now be in line with the intent of that commit. Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Thu Feb 7 04:49:28 2013 (r246451) +++ head/sys/kern/kern_intr.c Thu Feb 7 06:48:47 2013 (r246452) @@ -336,7 +336,7 @@ intr_event_bind(struct intr_event *ie, u if (ie->ie_cpu == NOCPU) CPU_COPY(cpuset_root, &mask); else - CPU_SET(cpu, &mask); + CPU_SET(ie->ie_cpu, &mask); id = ie->ie_thread->it_thread->td_tid; mtx_unlock(&ie->ie_lock); (void)cpuset_setthread(id, &mask); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 07:50:18 2013 Return-Path: Delivered-To: svn-src-all@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 17EE35AB; Thu, 7 Feb 2013 07:50:18 +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 0A577723; Thu, 7 Feb 2013 07:50: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 r177oH1l058538; Thu, 7 Feb 2013 07:50:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r177oHiC058531; Thu, 7 Feb 2013 07:50:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302070750.r177oHiC058531@svn.freebsd.org> From: Adrian Chadd Date: Thu, 7 Feb 2013 07:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246453 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 07:50:18 -0000 Author: adrian Date: Thu Feb 7 07:50:16 2013 New Revision: 246453 URL: http://svnweb.freebsd.org/changeset/base/246453 Log: Create a new TX lock specifically for queuing frames. This now separates out the act of queuing frames from the act of running TX and TX completion. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_pci.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 7 06:48:47 2013 (r246452) +++ head/sys/dev/ath/if_ath.c Thu Feb 7 07:50:16 2013 (r246453) @@ -2687,7 +2687,7 @@ ath_txq_qadd(struct ifnet *ifp, struct m struct mbuf *m; /* XXX recursive TX completion -> TX? */ - ATH_TX_UNLOCK_ASSERT(sc); + ATH_TX_IC_UNLOCK_ASSERT(sc); /* * We grab the node pointer, but we don't deref @@ -2749,7 +2749,7 @@ ath_txq_qadd(struct ifnet *ifp, struct m * into the driver. */ - ATH_TX_LOCK(sc); + ATH_TX_IC_LOCK(sc); /* * Throw the single frame onto the queue. @@ -2797,7 +2797,7 @@ ath_txq_qadd(struct ifnet *ifp, struct m m = m->m_nextpkt; } - ATH_TX_UNLOCK(sc); + ATH_TX_IC_UNLOCK(sc); return (0); bad: @@ -2825,13 +2825,13 @@ ath_txq_qflush(struct ifnet *ifp) TAILQ_INIT(&txlist); /* Grab lock */ - ATH_TX_LOCK(sc); + ATH_TX_IC_LOCK(sc); /* Copy everything out of sc_txbuf_list into txlist */ TAILQ_CONCAT(&txlist, &sc->sc_txbuf_list, bf_list); /* Unlock */ - ATH_TX_UNLOCK(sc); + ATH_TX_IC_UNLOCK(sc); /* Now, walk the list, freeing things */ while ((bf = TAILQ_FIRST(&txlist)) != NULL) { @@ -2879,16 +2879,9 @@ ath_txq_qrun(struct ifnet *ifp) */ /* Copy everything out of sc_txbuf_list into txlist */ - ATH_TX_LOCK(sc); + ATH_TX_IC_LOCK(sc); TAILQ_CONCAT(&txlist, &sc->sc_txbuf_list, bf_list); - ATH_TX_UNLOCK(sc); - - /* - * For now, the ath_tx_start() code sits behind the same lock; - * worry about serialising this in a taskqueue later. - */ - - ATH_TX_LOCK(sc); + ATH_TX_IC_UNLOCK(sc); /* * Attempt to transmit each frame. @@ -2899,6 +2892,7 @@ ath_txq_qrun(struct ifnet *ifp) * It would be nice to chain together TX fragments in this * way so they can be aborted together. */ + ATH_TX_LOCK(sc); TAILQ_FOREACH_SAFE(bf, &txlist, bf_list, bf_next) { /* * Clear, because we're going to reuse this Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Thu Feb 7 06:48:47 2013 (r246452) +++ head/sys/dev/ath/if_ath_ahb.c Thu Feb 7 07:50:16 2013 (r246453) @@ -195,6 +195,7 @@ ath_ahb_attach(device_t dev) ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); ATH_TX_LOCK_INIT(sc); + ATH_TX_IC_LOCK_INIT(sc); ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); @@ -204,6 +205,7 @@ ath_ahb_attach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_TX_LOCK_DESTROY(sc); + ATH_TX_IC_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); @@ -247,6 +249,7 @@ ath_ahb_detach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_TX_LOCK_DESTROY(sc); + ATH_TX_IC_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Thu Feb 7 06:48:47 2013 (r246452) +++ head/sys/dev/ath/if_ath_pci.c Thu Feb 7 07:50:16 2013 (r246453) @@ -251,6 +251,7 @@ ath_pci_attach(device_t dev) ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); ATH_TX_LOCK_INIT(sc); + ATH_TX_IC_LOCK_INIT(sc); ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); @@ -260,6 +261,7 @@ ath_pci_attach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_IC_LOCK_DESTROY(sc); ATH_TX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); @@ -302,6 +304,7 @@ ath_pci_detach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_IC_LOCK_DESTROY(sc); ATH_TX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Feb 7 06:48:47 2013 (r246452) +++ head/sys/dev/ath/if_athvar.h Thu Feb 7 07:50:16 2013 (r246453) @@ -520,8 +520,10 @@ struct ath_softc { char sc_pcu_mtx_name[32]; struct mtx sc_rx_mtx; /* RX access mutex */ char sc_rx_mtx_name[32]; - struct mtx sc_tx_mtx; /* TX access mutex */ + struct mtx sc_tx_mtx; /* TX handling/comp mutex */ char sc_tx_mtx_name[32]; + struct mtx sc_tx_ic_mtx; /* TX queue mutex */ + char sc_tx_ic_mtx_name[32]; struct taskqueue *sc_tq; /* private task queue */ struct taskqueue *sc_tx_tq; /* private TX task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ @@ -795,10 +797,8 @@ struct ath_softc { #define ATH_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) /* - * The TX lock is non-reentrant and serialises the TX send operations. - * (ath_start(), ath_raw_xmit().) It doesn't yet serialise the TX - * completion operations; thus it can't be used (yet!) to protect - * hardware / software TXQ operations. + * The TX lock is non-reentrant and serialises the TX frame send + * and completion operations. */ #define ATH_TX_LOCK_INIT(_sc) do {\ snprintf((_sc)->sc_tx_mtx_name, \ @@ -817,6 +817,26 @@ struct ath_softc { MA_NOTOWNED) /* + * The IC TX lock is non-reentrant and serialises packet queuing from + * the upper layers. + */ +#define ATH_TX_IC_LOCK_INIT(_sc) do {\ + snprintf((_sc)->sc_tx_ic_mtx_name, \ + sizeof((_sc)->sc_tx_ic_mtx_name), \ + "%s IC TX lock", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_tx_ic_mtx, (_sc)->sc_tx_ic_mtx_name, \ + NULL, MTX_DEF); \ + } while (0) +#define ATH_TX_IC_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_tx_ic_mtx) +#define ATH_TX_IC_LOCK(_sc) mtx_lock(&(_sc)->sc_tx_ic_mtx) +#define ATH_TX_IC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_tx_ic_mtx) +#define ATH_TX_IC_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_tx_ic_mtx, \ + MA_OWNED) +#define ATH_TX_IC_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_tx_ic_mtx, \ + MA_NOTOWNED) + +/* * The PCU lock is non-recursive and should be treated as a spinlock. * Although currently the interrupt code is run in netisr context and * doesn't require this, this may change in the future. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 08:20:04 2013 Return-Path: Delivered-To: svn-src-all@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 C5F95C88; Thu, 7 Feb 2013 08:20:04 +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 B7789840; Thu, 7 Feb 2013 08:20: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 r178K4Fw067709; Thu, 7 Feb 2013 08:20:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r178K4P0067706; Thu, 7 Feb 2013 08:20:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302070820.r178K4P0067706@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 7 Feb 2013 08:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246454 - in head/sys/dev/sound: pcm usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:20:04 -0000 Author: hselasky Date: Thu Feb 7 08:20:03 2013 New Revision: 246454 URL: http://svnweb.freebsd.org/changeset/base/246454 Log: Add support for mute buttons on USB audio devices and use the hwvol interface to adjust the mixer settings. MFC after: 1 week Modified: head/sys/dev/sound/pcm/mixer.c head/sys/dev/sound/pcm/mixer.h head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Thu Feb 7 07:50:16 2013 (r246453) +++ head/sys/dev/sound/pcm/mixer.c Thu Feb 7 08:20:03 2013 (r246454) @@ -893,14 +893,8 @@ mixer_hwvol_init(device_t dev) } void -mixer_hwvol_mute(device_t dev) +mixer_hwvol_mute_locked(struct snd_mixer *m) { - struct snd_mixer *m; - struct cdev *pdev; - - pdev = mixer_get_devt(dev); - m = pdev->si_drv1; - snd_mtxlock(m->lock); if (m->hwvol_muted) { m->hwvol_muted = 0; mixer_set(m, m->hwvol_mixer, m->hwvol_mute_level); @@ -909,19 +903,26 @@ mixer_hwvol_mute(device_t dev) m->hwvol_mute_level = mixer_get(m, m->hwvol_mixer); mixer_set(m, m->hwvol_mixer, 0); } - snd_mtxunlock(m->lock); } void -mixer_hwvol_step(device_t dev, int left_step, int right_step) +mixer_hwvol_mute(device_t dev) { struct snd_mixer *m; - int level, left, right; struct cdev *pdev; pdev = mixer_get_devt(dev); m = pdev->si_drv1; snd_mtxlock(m->lock); + mixer_hwvol_mute_locked(m); + snd_mtxunlock(m->lock); +} + +void +mixer_hwvol_step_locked(struct snd_mixer *m, int left_step, int right_step) +{ + int level, left, right; + if (m->hwvol_muted) { m->hwvol_muted = 0; level = m->hwvol_mute_level; @@ -929,15 +930,31 @@ mixer_hwvol_step(device_t dev, int left_ level = mixer_get(m, m->hwvol_mixer); if (level != -1) { left = level & 0xff; - right = level >> 8; + right = (level >> 8) & 0xff; left += left_step * m->hwvol_step; if (left < 0) left = 0; + else if (left > 100) + left = 100; right += right_step * m->hwvol_step; if (right < 0) right = 0; + else if (right > 100) + right = 100; mixer_set(m, m->hwvol_mixer, left | right << 8); } +} + +void +mixer_hwvol_step(device_t dev, int left_step, int right_step) +{ + struct snd_mixer *m; + struct cdev *pdev; + + pdev = mixer_get_devt(dev); + m = pdev->si_drv1; + snd_mtxlock(m->lock); + mixer_hwvol_step_locked(m, left_step, right_step); snd_mtxunlock(m->lock); } Modified: head/sys/dev/sound/pcm/mixer.h ============================================================================== --- head/sys/dev/sound/pcm/mixer.h Thu Feb 7 07:50:16 2013 (r246453) +++ head/sys/dev/sound/pcm/mixer.h Thu Feb 7 08:20:03 2013 (r246454) @@ -40,7 +40,9 @@ int mixer_ioctl_cmd(struct cdev *i_dev, int mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi); int mixer_hwvol_init(device_t dev); +void mixer_hwvol_mute_locked(struct snd_mixer *m); void mixer_hwvol_mute(device_t dev); +void mixer_hwvol_step_locked(struct snd_mixer *m, int l_step, int r_step); void mixer_hwvol_step(device_t dev, int left_step, int right_step); int mixer_busy(struct snd_mixer *m); Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Feb 7 07:50:16 2013 (r246453) +++ head/sys/dev/sound/usb/uaudio.c Thu Feb 7 08:20:03 2013 (r246454) @@ -287,14 +287,17 @@ struct uaudio_hid { struct usb_xfer *xfer[UAUDIO_HID_N_TRANSFER]; struct hid_location volume_up_loc; struct hid_location volume_down_loc; + struct hid_location mute_loc; uint32_t flags; #define UAUDIO_HID_VALID 0x0001 #define UAUDIO_HID_HAS_ID 0x0002 #define UAUDIO_HID_HAS_VOLUME_UP 0x0004 #define UAUDIO_HID_HAS_VOLUME_DOWN 0x0008 +#define UAUDIO_HID_HAS_MUTE 0x0010 uint8_t iface_index; uint8_t volume_up_id; uint8_t volume_down_id; + uint8_t mute_id; }; struct uaudio_softc { @@ -1012,6 +1015,8 @@ uaudio_attach_sub(device_t dev, kobj_cla goto detach; sc->sc_mixer_init = 1; + mixer_hwvol_init(dev); + snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); if (pcm_register(dev, sc, @@ -5520,9 +5525,6 @@ uaudio_hid_rx_callback(struct usb_xfer * struct uaudio_softc *sc = usbd_xfer_softc(xfer); const uint8_t *buffer = usbd_xfer_get_frame_buffer(xfer, 0); struct snd_mixer *m; - int v; - int v_l; - int v_r; uint8_t id; int actlen; @@ -5543,6 +5545,16 @@ uaudio_hid_rx_callback(struct usb_xfer * m = sc->sc_mixer_dev; + if ((sc->sc_hid.flags & UAUDIO_HID_HAS_MUTE) && + (sc->sc_hid.mute_id == id) && + hid_get_data(buffer, actlen, + &sc->sc_hid.mute_loc)) { + + DPRINTF("Mute toggle\n"); + + mixer_hwvol_mute_locked(m); + } + if ((sc->sc_hid.flags & UAUDIO_HID_HAS_VOLUME_UP) && (sc->sc_hid.volume_up_id == id) && hid_get_data(buffer, actlen, @@ -5550,13 +5562,7 @@ uaudio_hid_rx_callback(struct usb_xfer * DPRINTF("Volume Up\n"); - v = mix_get_locked(m, SOUND_MIXER_PCM, &v_l, &v_r); - if (v == 0) { - v = ((v_l + v_r) / 2) + 5; - if (v > 100) - v = 100; - mix_set_locked(m, SOUND_MIXER_PCM, v, v); - } + mixer_hwvol_step_locked(m, 1, 1); } if ((sc->sc_hid.flags & UAUDIO_HID_HAS_VOLUME_DOWN) && @@ -5566,13 +5572,7 @@ uaudio_hid_rx_callback(struct usb_xfer * DPRINTF("Volume Down\n"); - v = mix_get_locked(m, SOUND_MIXER_PCM, &v_l, &v_r); - if (v == 0) { - v = ((v_l + v_r) / 2) - 5; - if (v < 0) - v = 0; - mix_set_locked(m, SOUND_MIXER_PCM, v, v); - } + mixer_hwvol_step_locked(m, -1, -1); } case USB_ST_SETUP: @@ -5641,10 +5641,20 @@ uaudio_hid_probe(struct uaudio_softc *sc DPRINTFN(1, "Found Volume Down key\n"); } + if (hid_locate(d_ptr, d_len, + HID_USAGE2(HUP_CONSUMER, 0xE2 /* Mute */), + hid_input, 0, &sc->sc_hid.mute_loc, &flags, + &sc->sc_hid.mute_id)) { + if (flags & HIO_VARIABLE) + sc->sc_hid.flags |= UAUDIO_HID_HAS_MUTE; + DPRINTFN(1, "Found Mute key\n"); + } + free(d_ptr, M_TEMP); if (!(sc->sc_hid.flags & (UAUDIO_HID_HAS_VOLUME_UP | - UAUDIO_HID_HAS_VOLUME_DOWN))) { + UAUDIO_HID_HAS_VOLUME_DOWN | + UAUDIO_HID_HAS_MUTE))) { DPRINTFN(1, "Did not find any volume related keys\n"); return (-1); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 08:27:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C14D4DA; Thu, 7 Feb 2013 08:27:49 +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 0198DC12; Thu, 7 Feb 2013 08:27: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 r178RmjK070291; Thu, 7 Feb 2013 08:27:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r178RmIW070290; Thu, 7 Feb 2013 08:27:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302070827.r178RmIW070290@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Feb 2013 08:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246455 - stable/9/sys/fs/devfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:27:49 -0000 Author: mav Date: Thu Feb 7 08:27:48 2013 New Revision: 246455 URL: http://svnweb.freebsd.org/changeset/base/246455 Log: MFC r235922: Revert devfs part of r235911. I was unaware about old but unfinished discussion between kib@ and gibbs@ about it. Modified: stable/9/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Thu Feb 7 08:20:03 2013 (r246454) +++ stable/9/sys/fs/devfs/devfs_vnops.c Thu Feb 7 08:27:48 2013 (r246455) @@ -1276,53 +1276,8 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; - struct cdev_priv *cdp; de = ap->a_vp->v_data; - cdp = de->de_cdp; - - if (cdp != NULL && (cdp->cdp_c.si_flags & SI_ALIAS) != 0) { - struct devfs_mount *dmp; - struct prison *pr; - char *mp; - int mp_len; - int pr_path_len; - int err; - - /* - * For device aliases, construct an absolute symlink (to - * shorten its length and avoid the ugliness of a relative - * link) by prepending the fully qualified path to the root - * of this devfs. For a non-jailed process, the devfs root - * is our mount point. For a jailed process, we must remove - * any jail prefix in our mount point so that our response - * matches the user process's world view. - */ - dmp = VFSTODEVFS(ap->a_vp->v_mount); - mp = dmp->dm_mount->mnt_stat.f_mntonname; - mp_len = strlen(mp); - - pr = ap->a_cred->cr_prison; - pr_path_len = strlen(pr->pr_path); - - if (strncmp(pr->pr_path, mp, pr_path_len) == 0 - && mp[pr_path_len] == '/') { - mp += pr_path_len; - mp_len -= pr_path_len; - } - - err = uiomove(mp, mp_len, ap->a_uio); - if (err != 0) - return (err); - - /* - * Devfs cannot be the root file system, so its - * mount point must always be terminated by a '/'. - */ - err = uiomove("/", 1, ap->a_uio); - if (err != 0) - return (err); - } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 08:28:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CA61B641; Thu, 7 Feb 2013 08:28:15 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x232.google.com (la-in-x0232.1e100.net [IPv6:2a00:1450:4010:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id C3D34C1A; Thu, 7 Feb 2013 08:28:14 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ec20so2330084lab.37 for ; Thu, 07 Feb 2013 00:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=iTT1vyUOqQh1aPTjjhXIRGk4rDULL6StAfQf7FQ5vG0=; b=uTkD3N238Boon86YmXoGA1GUocVqlcLNccddoh1/q6Yv3G3pL+Zbr2jXooNtUgVeVH QMdIkjVqJkHSwUd4lUfZG/VNdRZJFNzmjOtxCExRexk9mbQ/V267kxWhkcOIfgqz+ZfE SdC8WV5wy/YoMCbJmrIuz5Pmh+ZG0xxWSmJ6+/5NLVYX6pbRoakN9vwxo97LVDrdiwmC GkPmA7D6QKBZUFFe0zQmbIQOm0G8/GfXknrk4ETZc8VK30BwT1r3Y4lGa5YBP8uWmpJZ OIU6/fZo9yLuFhNJGDoUUu0toeefTHCaMsCD1Vre3xiF2LG+zXFQppkJARl0YMTDxPVN FCeg== X-Received: by 10.112.99.197 with SMTP id es5mr413523lbb.30.1360225693820; Thu, 07 Feb 2013 00:28:13 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id b13sm5324726lbd.10.2013.02.07.00.28.11 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 00:28:12 -0800 (PST) Sender: Alexander Motin Message-ID: <51136599.2030107@FreeBSD.org> Date: Thu, 07 Feb 2013 10:28:09 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130125 Thunderbird/17.0.2 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump References: <201302062207.r16M7d92083023@svn.freebsd.org> <20130207001857.GE2522@kib.kiev.ua> In-Reply-To: <20130207001857.GE2522@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:28:15 -0000 On 07.02.2013 02:18, Konstantin Belousov wrote: > On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: >> stable/9/sys/fs/devfs/devfs_vnops.c > > Did you forgot to merge r235922 ? Yes, sorry, fixed. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 08:59:46 2013 Return-Path: Delivered-To: svn-src-all@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 8ACD2475; Thu, 7 Feb 2013 08:59:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 4718AE7D; Thu, 7 Feb 2013 08:59:46 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1U3NKZ-0009jw-Oz; Thu, 07 Feb 2013 12:59:43 +0400 Date: Thu, 7 Feb 2013 12:59:43 +0400 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r246362 - head/games/fortune/datfiles Message-ID: <20130207085943.GA67709@zxy.spb.ru> References: <201302051439.r15EdcE7011203@svn.freebsd.org> <201302051145.40104.jhb@freebsd.org> <201302051158.55117.jhb@freebsd.org> <20130205205547.GI26896@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130205205547.GI26896@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Benjamin Kaduk , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:59:46 -0000 On Wed, Feb 06, 2013 at 12:55:47AM +0400, Gleb Smirnoff wrote: > J> Yes, the insta-MFC is also not appropriate, esp. for something that you know > J> is going to raise eyebrows when it is committed. Having to debate this sort > J> of thing in public on mailing lists is also distinctly unhelpful and very > J> distracting from productive work. Also, I'd like to preemptively ask > J> developers to refrain from any further commits to the fortunes datfiles for > J> the time being as the last thing we need is a commit war over this sort of > J> thing. > > What about just moving the entire games subdirectory to ports repo? Not fortune! Some nice hints for beginners placed in fortune file From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 10:37:37 2013 Return-Path: Delivered-To: svn-src-all@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 08F84E2B; Thu, 7 Feb 2013 10:37:37 +0000 (UTC) (envelope-from pgj@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 EFB61377; Thu, 7 Feb 2013 10:37: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 r17AbaUB009685; Thu, 7 Feb 2013 10:37:36 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17AbaMg009683; Thu, 7 Feb 2013 10:37:36 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201302071037.r17AbaMg009683@svn.freebsd.org> From: Gabor Pali Date: Thu, 7 Feb 2013 10:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r246458 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 10:37:37 -0000 Author: pgj (ports committer) Date: Thu Feb 7 10:37:36 2013 New Revision: 246458 URL: http://svnweb.freebsd.org/changeset/base/246458 Log: Activate commit bit for achim (Achim Leubner), mentored by scottl and emaste. Achim has worked for Intel, Adaptec, and now PMC writing FreeBSD drivers for various RAID cards. His work includes the iir(4) driver, stewardship and updates to the aac(4) driver, and a new aacraid(4) driver that is ready to commit to the tree. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Feb 7 10:24:04 2013 (r246457) +++ svnadmin/conf/access Thu Feb 7 10:37:36 2013 (r246458) @@ -18,6 +18,7 @@ # use "Approved by: core (implicit)" to that type of commits. # ache +achim adrian ae akiyama Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Feb 7 10:24:04 2013 (r246457) +++ svnadmin/conf/mentors Thu Feb 7 10:37:36 2013 (r246458) @@ -10,6 +10,7 @@ # Sort by mentee login name. # Mentee Mentor Optional comment +achim scottl Co-mentor: emaste anchie bz art avg Co-mentor: marcel benl philip Co-mentor: simon From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 11:08:03 2013 Return-Path: Delivered-To: svn-src-all@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 CCEFFD99; Thu, 7 Feb 2013 11:08:03 +0000 (UTC) (envelope-from theraven@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 B5993721; Thu, 7 Feb 2013 11:08:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17B83uG018916; Thu, 7 Feb 2013 11:08:03 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17B83Qi018915; Thu, 7 Feb 2013 11:08:03 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201302071108.r17B83Qi018915@svn.freebsd.org> From: David Chisnall Date: Thu, 7 Feb 2013 11:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246462 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 11:08:03 -0000 Author: theraven Date: Thu Feb 7 11:08:03 2013 New Revision: 246462 URL: http://svnweb.freebsd.org/changeset/base/246462 Log: Fix a copy-and-paste error in libcxxrt. Modified: head/contrib/libcxxrt/exception.cc Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Thu Feb 7 11:01:56 2013 (r246461) +++ head/contrib/libcxxrt/exception.cc Thu Feb 7 11:08:03 2013 (r246462) @@ -1387,7 +1387,7 @@ namespace std { if (thread_local_handlers) { return pathscale::set_unexpected(f); } - return ATOMIC_SWAP(&terminateHandler, f); + return ATOMIC_SWAP(&unexpectedHandler, f); } /** * Sets the function that is called to terminate the program. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 11:09:17 2013 Return-Path: Delivered-To: svn-src-all@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 13F76F3F; Thu, 7 Feb 2013 11:09:17 +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 01C0373E; Thu, 7 Feb 2013 11:09: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 r17B9GJI019167; Thu, 7 Feb 2013 11:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17B9GG2019165; Thu, 7 Feb 2013 11:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302071109.r17B9GG2019165@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 7 Feb 2013 11:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246463 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 11:09:17 -0000 Author: pluknet Date: Thu Feb 7 11:09:16 2013 New Revision: 246463 URL: http://svnweb.freebsd.org/changeset/base/246463 Log: MFC r226043 (manually): Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly valid - we don't allow for setting it on a file, for example - but it's not something we should assert on. For STABLE kernel, it changes nothing, because it's not compiled with INVARIANTS. If it was, it would fix crashes. It also fixes an assert in libc encountered with NFSv4 without nfsuserd(8) running. Approved by: trasz Modified: stable/8/sys/kern/subr_acl_nfs4.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_acl_nfs4.c ============================================================================== --- stable/8/sys/kern/subr_acl_nfs4.c Thu Feb 7 11:08:03 2013 (r246462) +++ stable/8/sys/kern/subr_acl_nfs4.c Thu Feb 7 11:09:16 2013 (r246463) @@ -105,7 +105,6 @@ _acl_denies(const struct acl *aclp, int if (denied_explicitly != NULL) *denied_explicitly = 0; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -730,7 +729,6 @@ acl_nfs4_sync_mode_from_acl(mode_t *_mod mode_t old_mode = *_mode, mode = 0, seen = 0; const struct acl_entry *entry; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -856,7 +854,6 @@ acl_nfs4_compute_inherited_acl(const str struct acl_entry *entry, *copy; KASSERT(child_aclp->acl_cnt == 0, ("child_aclp->acl_cnt == 0")); - KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 13:09:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DADA348B; Thu, 7 Feb 2013 13:09:23 +0000 (UTC) (envelope-from theraven@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 CCFFED56; Thu, 7 Feb 2013 13:09:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17D9NTD056213; Thu, 7 Feb 2013 13:09:23 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17D9KGR056184; Thu, 7 Feb 2013 13:09:20 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201302071309.r17D9KGR056184@svn.freebsd.org> From: David Chisnall Date: Thu, 7 Feb 2013 13:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246468 - in vendor/libc++/dist: include src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 13:09:23 -0000 Author: theraven Date: Thu Feb 7 13:09:19 2013 New Revision: 246468 URL: http://svnweb.freebsd.org/changeset/base/246468 Log: Import new libc++ to vendor branch. Modified: vendor/libc++/dist/include/__config vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/array vendor/libc++/dist/include/atomic vendor/libc++/dist/include/cmath vendor/libc++/dist/include/functional vendor/libc++/dist/include/future vendor/libc++/dist/include/istream vendor/libc++/dist/include/iterator vendor/libc++/dist/include/limits vendor/libc++/dist/include/locale vendor/libc++/dist/include/memory vendor/libc++/dist/include/ostream vendor/libc++/dist/include/random vendor/libc++/dist/include/regex vendor/libc++/dist/include/string vendor/libc++/dist/include/type_traits vendor/libc++/dist/include/vector vendor/libc++/dist/src/chrono.cpp vendor/libc++/dist/src/debug.cpp vendor/libc++/dist/src/exception.cpp vendor/libc++/dist/src/future.cpp vendor/libc++/dist/src/hash.cpp vendor/libc++/dist/src/locale.cpp vendor/libc++/dist/src/string.cpp vendor/libc++/dist/src/thread.cpp Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/__config Thu Feb 7 13:09:19 2013 (r246468) @@ -66,6 +66,12 @@ # endif #endif // _WIN32 +#ifdef __linux__ +# if defined(__GNUC__) && _GNUC_VER >= 403 +# define _LIBCP_HAS_IS_BASE_OF +# endif +#endif + #ifdef __sun__ # include # ifdef _LITTLE_ENDIAN Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/algorithm Thu Feb 7 13:09:19 2013 (r246468) @@ -1528,10 +1528,10 @@ copy(_InputIterator __first, _InputItera // copy_backward -template +template inline _LIBCPP_INLINE_VISIBILITY _OutputIterator -__copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { while (__first != __last) *--__result = *--__last; Modified: vendor/libc++/dist/include/array ============================================================================== --- vendor/libc++/dist/include/array Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/array Thu Feb 7 13:09:19 2013 (r246468) @@ -310,6 +310,7 @@ _LIBCPP_INLINE_VISIBILITY inline _Tp& get(array<_Tp, _Size>& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)"); return __a[_Ip]; } @@ -318,6 +319,7 @@ _LIBCPP_INLINE_VISIBILITY inline const _Tp& get(const array<_Tp, _Size>& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)"); return __a[_Ip]; } @@ -328,6 +330,7 @@ _LIBCPP_INLINE_VISIBILITY inline _Tp&& get(array<_Tp, _Size>&& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)"); return _VSTD::move(__a[_Ip]); } Modified: vendor/libc++/dist/include/atomic ============================================================================== --- vendor/libc++/dist/include/atomic Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/atomic Thu Feb 7 13:09:19 2013 (r246468) @@ -33,6 +33,7 @@ template T kill_dependency(T y // lock-free property +#define ATOMIC_BOOL_LOCK_FREE unspecified #define ATOMIC_CHAR_LOCK_FREE unspecified #define ATOMIC_CHAR16_T_LOCK_FREE unspecified #define ATOMIC_CHAR32_T_LOCK_FREE unspecified @@ -41,6 +42,7 @@ template T kill_dependency(T y #define ATOMIC_INT_LOCK_FREE unspecified #define ATOMIC_LONG_LOCK_FREE unspecified #define ATOMIC_LLONG_LOCK_FREE unspecified +#define ATOMIC_POINTER_LOCK_FREE unspecified // flag type and operations @@ -472,6 +474,7 @@ template // Atomics for standard typedef types +typedef atomic atomic_bool; typedef atomic atomic_char; typedef atomic atomic_schar; typedef atomic atomic_uchar; @@ -1454,6 +1457,7 @@ atomic_signal_fence(memory_order __m) _N // Atomics for standard typedef types +typedef atomic atomic_bool; typedef atomic atomic_char; typedef atomic atomic_schar; typedef atomic atomic_uchar; @@ -1499,14 +1503,16 @@ typedef atomic atomic_uintmax // lock-free property -#define ATOMIC_CHAR_LOCK_FREE 0 -#define ATOMIC_CHAR16_T_LOCK_FREE 0 -#define ATOMIC_CHAR32_T_LOCK_FREE 0 -#define ATOMIC_WCHAR_T_LOCK_FREE 0 -#define ATOMIC_SHORT_LOCK_FREE 0 -#define ATOMIC_INT_LOCK_FREE 0 -#define ATOMIC_LONG_LOCK_FREE 0 -#define ATOMIC_LLONG_LOCK_FREE 0 +#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE +#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE +#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE +#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE +#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE +#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE +#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE +#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE +#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE #endif // !__has_feature(cxx_atomic) Modified: vendor/libc++/dist/include/cmath ============================================================================== --- vendor/libc++/dist/include/cmath Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/cmath Thu Feb 7 13:09:19 2013 (r246468) @@ -137,21 +137,21 @@ long double tanhl(long double x); // C99 -bool signbit(floating_point x); +bool signbit(arithmetic x); -int fpclassify(floating_point x); +int fpclassify(arithmetic x); -bool isfinite(floating_point x); -bool isinf(floating_point x); -bool isnan(floating_point x); -bool isnormal(floating_point x); - -bool isgreater(floating_point x, floating_point y); -bool isgreaterequal(floating_point x, floating_point y); -bool isless(floating_point x, floating_point y); -bool islessequal(floating_point x, floating_point y); -bool islessgreater(floating_point x, floating_point y); -bool isunordered(floating_point x, floating_point y); +bool isfinite(arithmetic x); +bool isinf(arithmetic x); +bool isnan(arithmetic x); +bool isnormal(arithmetic x); + +bool isgreater(arithmetic x, arithmetic y); +bool isgreaterequal(arithmetic x, arithmetic y); +bool isless(arithmetic x, arithmetic y); +bool islessequal(arithmetic x, arithmetic y); +bool islessgreater(arithmetic x, arithmetic y); +bool isunordered(arithmetic x, arithmetic y); floating_point acosh (arithmetic x); float acoshf(float x); @@ -325,10 +325,10 @@ __libcpp_signbit(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type signbit(_A1 __x) _NOEXCEPT { - return __libcpp_signbit(__x); + return __libcpp_signbit((typename std::__promote<_A1>::type)__x); } #endif // signbit @@ -349,10 +349,10 @@ __libcpp_fpclassify(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, int>::type +typename std::enable_if::value, int>::type fpclassify(_A1 __x) _NOEXCEPT { - return __libcpp_fpclassify(__x); + return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x); } #endif // fpclassify @@ -373,10 +373,10 @@ __libcpp_isfinite(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isfinite(_A1 __x) _NOEXCEPT { - return __libcpp_isfinite(__x); + return __libcpp_isfinite((typename std::__promote<_A1>::type)__x); } #endif // isfinite @@ -397,10 +397,10 @@ __libcpp_isinf(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isinf(_A1 __x) _NOEXCEPT { - return __libcpp_isinf(__x); + return __libcpp_isinf((typename std::__promote<_A1>::type)__x); } #endif // isinf @@ -421,10 +421,10 @@ __libcpp_isnan(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isnan(_A1 __x) _NOEXCEPT { - return __libcpp_isnan(__x); + return __libcpp_isnan((typename std::__promote<_A1>::type)__x); } #endif // isnan @@ -445,10 +445,10 @@ __libcpp_isnormal(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isnormal(_A1 __x) _NOEXCEPT { - return __libcpp_isnormal(__x); + return __libcpp_isnormal((typename std::__promote<_A1>::type)__x); } #endif // isnormal @@ -471,13 +471,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isgreater(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isgreater(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreater((type)__x, (type)__y); } #endif // isgreater @@ -500,13 +501,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isgreaterequal(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreaterequal((type)__x, (type)__y); } #endif // isgreaterequal @@ -529,13 +531,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isless(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isless(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isless((type)__x, (type)__y); } #endif // isless @@ -558,13 +561,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type islessequal(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_islessequal(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessequal((type)__x, (type)__y); } #endif // islessequal @@ -587,13 +591,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_islessgreater(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessgreater((type)__x, (type)__y); } #endif // islessgreater @@ -616,13 +621,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isunordered(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isunordered(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isunordered((type)__x, (type)__y); } #endif // isunordered Modified: vendor/libc++/dist/include/functional ============================================================================== --- vendor/libc++/dist/include/functional Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/functional Thu Feb 7 13:09:19 2013 (r246468) @@ -1088,7 +1088,7 @@ class _LIBCPP_VISIBLE function<_Rp(_ArgT public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> { typedef __function::__base<_Rp(_ArgTypes...)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; + typename aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; template Modified: vendor/libc++/dist/include/future ============================================================================== --- vendor/libc++/dist/include/future Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/future Thu Feb 7 13:09:19 2013 (r246468) @@ -470,7 +470,11 @@ public: {return (__state_ & __constructed) || (__exception_ != nullptr);} _LIBCPP_INLINE_VISIBILITY - void __set_future_attached() {__state_ |= __future_attached;} + void __set_future_attached() + { + lock_guard __lk(__mut_); + __state_ |= __future_attached; + } _LIBCPP_INLINE_VISIBILITY bool __has_future_attached() const {return __state_ & __future_attached;} @@ -1753,7 +1757,7 @@ template class __packaged_task_function<_Rp(_ArgTypes...)> { typedef __packaged_task_base<_Rp(_ArgTypes...)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; + typename aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; public: Modified: vendor/libc++/dist/include/istream ============================================================================== --- vendor/libc++/dist/include/istream Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/istream Thu Feb 7 13:09:19 2013 (r246468) @@ -1243,6 +1243,7 @@ template streamsize basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n) { + __gc_ = 0; streamsize __c = this->rdbuf()->in_avail(); switch (__c) { Modified: vendor/libc++/dist/include/iterator ============================================================================== --- vendor/libc++/dist/include/iterator Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/iterator Thu Feb 7 13:09:19 2013 (r246468) @@ -822,9 +822,9 @@ private: public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT - : __sbuf_(__s.rdbuf()) {__test_for_eof();} + : __sbuf_(__s.rdbuf()) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT - : __sbuf_(__s) {__test_for_eof();} + : __sbuf_(__s) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT : __sbuf_(__p.__sbuf_) {} Modified: vendor/libc++/dist/include/limits ============================================================================== --- vendor/libc++/dist/include/limits Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/limits Thu Feb 7 13:09:19 2013 (r246468) @@ -479,6 +479,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -525,6 +572,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -571,6 +665,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -616,6 +757,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_LIMITS Modified: vendor/libc++/dist/include/locale ============================================================================== --- vendor/libc++/dist/include/locale Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/locale Thu Feb 7 13:09:19 2013 (r246468) @@ -354,7 +354,7 @@ size_t __mbsrtowcs_l(wchar_t *__dest, co #endif } -_LIBCPP_ALWAYS_INLINE inline +inline int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -368,7 +368,7 @@ int __sprintf_l(char *__s, locale_t __l, return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -382,7 +382,7 @@ int __snprintf_l(char *__s, size_t __n, return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -396,7 +396,7 @@ int __asprintf_l(char **__s, locale_t __ return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -830,11 +830,11 @@ __num_get_signed_integral(const char* __ { if (__a != __a_end) { - int __save_errno = errno; + typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - int __current_errno = errno; + typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -870,11 +870,11 @@ __num_get_unsigned_integral(const char* __err = ios_base::failbit; return 0; } - int __save_errno = errno; + typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - int __current_errno = errno; + typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -2895,6 +2895,10 @@ template ::id; +template +const bool +moneypunct<_CharT, _International>::intl; + _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) Modified: vendor/libc++/dist/include/memory ============================================================================== --- vendor/libc++/dist/include/memory Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/memory Thu Feb 7 13:09:19 2013 (r246468) @@ -1571,7 +1571,10 @@ struct _LIBCPP_VISIBLE allocator_traits __construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) { while (__end1 != __begin1) - construct(__a, _VSTD::__to_raw_pointer(--__end2), _VSTD::move_if_noexcept(*--__end1)); + { + construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1)); + --__end2; + } } template Modified: vendor/libc++/dist/include/ostream ============================================================================== --- vendor/libc++/dist/include/ostream Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/ostream Thu Feb 7 13:09:19 2013 (r246468) @@ -1100,17 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(co sentry __sen(*this); if (__sen && __n) { - typedef ostreambuf_iterator<_CharT, _Traits> _Op; - _Op __o(*this); - for (; __n; --__n, ++__o, ++__s) - { - *__o = *__s; - if (__o.failed()) - { - this->setstate(ios_base::badbit); - break; - } - } + if (this->rdbuf()->sputn(__s, __n) != __n) + this->setstate(ios_base::badbit); } #ifndef _LIBCPP_NO_EXCEPTIONS } Modified: vendor/libc++/dist/include/random ============================================================================== --- vendor/libc++/dist/include/random Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/random Thu Feb 7 13:09:19 2013 (r246468) @@ -1931,6 +1931,22 @@ private: }; template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::increment; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; + +template template void linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, @@ -2230,6 +2246,90 @@ private: template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed; + +template void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::seed(result_type __sd) @@ -2552,6 +2652,19 @@ private: }; template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; + +template + _LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type + subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; + +template void subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, integral_constant) @@ -2823,6 +2936,12 @@ public: }; template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size; + +template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block; + +template typename discard_block_engine<_Engine, __p, __r>::result_type discard_block_engine<_Engine, __p, __r>::operator()() { @@ -3314,6 +3433,9 @@ private: } }; +template + _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size; + template bool operator==( Modified: vendor/libc++/dist/include/regex ============================================================================== --- vendor/libc++/dist/include/regex Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/regex Thu Feb 7 13:09:19 2013 (r246468) @@ -2843,6 +2843,27 @@ private: }; template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::nosubs; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::optimize; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::collate; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::ECMAScript; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::basic; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::extended; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::awk; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::grep; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::egrep; + +template void basic_regex<_CharT, _Traits>::swap(basic_regex& __r) { Modified: vendor/libc++/dist/include/string ============================================================================== --- vendor/libc++/dist/include/string Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/string Thu Feb 7 13:09:19 2013 (r246468) @@ -3374,7 +3374,7 @@ basic_string<_CharT, _Traits, _Allocator { const_pointer __p = data(); const_pointer __pe = __p + __sz; - for (const_pointer __ps = __p + __pos; __p != __pe; ++__ps) + for (const_pointer __ps = __p + __pos; __ps != __pe; ++__ps) if (!traits_type::eq(*__ps, __c)) return static_cast(__ps - __p); } Modified: vendor/libc++/dist/include/type_traits ============================================================================== --- vendor/libc++/dist/include/type_traits Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/type_traits Thu Feb 7 13:09:19 2013 (r246468) @@ -617,7 +617,28 @@ struct _LIBCPP_VISIBLE is_base_of #else // __has_feature(is_base_of) -#error is_base_of not implemented. +namespace __is_base_of_imp +{ +template +struct _Dst +{ + _Dst(const volatile _Tp &); +}; +template +struct _Src +{ + operator const volatile _Tp &(); + template operator const _Dst<_Up> &(); +}; +template struct __one { typedef char type; }; +template typename __one(declval<_Src<_Dp> >()))>::type __test(int); +template __two __test(...); +} + +template +struct _LIBCPP_VISIBLE is_base_of + : public integral_constant::value && + sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {}; #endif // __has_feature(is_base_of) Modified: vendor/libc++/dist/include/vector ============================================================================== --- vendor/libc++/dist/include/vector Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/include/vector Thu Feb 7 13:09:19 2013 (r246468) @@ -1458,7 +1458,8 @@ vector<_Tp, _Allocator>::__push_back_slo allocator_type& __a = this->__alloc(); __split_buffer __v(__recommend(size() + 1), size(), __a); // __v.push_back(_VSTD::forward<_Up>(__x)); - __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Up>(__x)); + __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Up>(__x)); + __v.__end_++; __swap_out_circular_buffer(__v); } @@ -1505,7 +1506,8 @@ vector<_Tp, _Allocator>::__emplace_back_ allocator_type& __a = this->__alloc(); __split_buffer __v(__recommend(size() + 1), size(), __a); // __v.emplace_back(_VSTD::forward<_Args>(__args)...); - __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Args>(__args)...); + __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Args>(__args)...); + __v.__end_++; __swap_out_circular_buffer(__v); } Modified: vendor/libc++/dist/src/chrono.cpp ============================================================================== --- vendor/libc++/dist/src/chrono.cpp Thu Feb 7 12:59:38 2013 (r246467) +++ vendor/libc++/dist/src/chrono.cpp Thu Feb 7 13:09:19 2013 (r246468) @@ -24,6 +24,8 @@ namespace chrono // system_clock +const bool system_clock::is_steady; + system_clock::time_point system_clock::now() _NOEXCEPT { @@ -46,6 +48,8 @@ system_clock::from_time_t(time_t t) _NOE // steady_clock +const bool steady_clock::is_steady; + #if __APPLE__ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 13:10:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87394600; Thu, 7 Feb 2013 13:10:22 +0000 (UTC) (envelope-from theraven@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 4B2F9D67; Thu, 7 Feb 2013 13:10: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 r17DAMYk056595; Thu, 7 Feb 2013 13:10:22 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17DAMij056594; Thu, 7 Feb 2013 13:10:22 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201302071310.r17DAMij056594@svn.freebsd.org> From: David Chisnall Date: Thu, 7 Feb 2013 13:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246469 - vendor/libc++/r174563 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 13:10:22 -0000 Author: theraven Date: Thu Feb 7 13:10:21 2013 New Revision: 246469 URL: http://svnweb.freebsd.org/changeset/base/246469 Log: Tag new libc++ import. Added: vendor/libc++/r174563/ - copied from r246468, vendor/libc++/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 14:49:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FD55796; Thu, 7 Feb 2013 14:49:56 +0000 (UTC) (envelope-from achim@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 2DD70355; Thu, 7 Feb 2013 14:49: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 r17Enu6i088252; Thu, 7 Feb 2013 14:49:56 GMT (envelope-from achim@svn.freebsd.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17Enugl088251; Thu, 7 Feb 2013 14:49:56 GMT (envelope-from achim@svn.freebsd.org) Message-Id: <201302071449.r17Enugl088251@svn.freebsd.org> From: Achim Leubner Date: Thu, 7 Feb 2013 14:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246471 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 14:49:56 -0000 Author: achim Date: Thu Feb 7 14:49:55 2013 New Revision: 246471 URL: http://svnweb.freebsd.org/changeset/base/246471 Log: Add myself as a src committer and my mentor relationship. Approved by: emaste (co-mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Feb 7 14:45:56 2013 (r246470) +++ head/share/misc/committers-src.dot Thu Feb 7 14:49:55 2013 (r246471) @@ -93,6 +93,7 @@ node [color=lightblue2, style=filled, bg # Current src committers go here. Try to keep things sorted. ache [label="Andrey Chernov\nache@FreeBSD.org\n1993/10/31"] +achim [label="Achim Leubner\nachim@FreeBSD.org\n2013/01/23"] adrian [label="Adrian Chadd\nadrian@FreeBSD.org\n2000/07/03"] ae [label="Andrey V. Elsukov\nae@FreeBSD.org\n2010/06/03"] akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"] @@ -380,6 +381,7 @@ ed -> uqs eivind -> des eivind -> rwatson +emaste -> achim emaste -> rstone emaste -> dteske emaste -> markj @@ -616,6 +618,7 @@ sbruno -> jimharris schweikh -> dds +scottl -> achim scottl -> jimharris scottl -> pjd scottl -> sah From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 14:53:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB8B9BFB; Thu, 7 Feb 2013 14:53:34 +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 CDEA038D; Thu, 7 Feb 2013 14:53: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 r17ErYEP090421; Thu, 7 Feb 2013 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17ErYK4090418; Thu, 7 Feb 2013 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071453.r17ErYK4090418@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 14:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246472 - in head/sys: fs/devfs kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 14:53:34 -0000 Author: kib Date: Thu Feb 7 14:53:33 2013 New Revision: 246472 URL: http://svnweb.freebsd.org/changeset/base/246472 Log: Stop translating the ERESTART error from the open(2) into EINTR. Posix requires that open(2) is restartable for SA_RESTART. For non-posix objects, in particular, devfs nodes, still disable automatic restart of the opens. The open call to a driver could have significant side effects for the hardware. Noted and reviewed by: jilles Discussed with: bde MFC after: 2 weeks Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_syscalls.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Feb 7 14:49:55 2013 (r246471) +++ head/sys/fs/devfs/devfs_vnops.c Thu Feb 7 14:53:33 2013 (r246472) @@ -1089,8 +1089,11 @@ devfs_open(struct vop_open_args *ap) vn_lock(vp, vlocked | LK_RETRY); dev_relthread(dev, ref); - if (error) + if (error != 0) { + if (error == ERESTART) + error = EINTR; return (error); + } #if 0 /* /dev/console */ KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp")); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Feb 7 14:49:55 2013 (r246471) +++ head/sys/kern/vfs_syscalls.c Thu Feb 7 14:53:33 2013 (r246472) @@ -1106,8 +1106,6 @@ kern_openat(struct thread *td, int fd, c goto success; } - if (error == ERESTART) - error = EINTR; goto bad; } td->td_dupfd = 0; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:11:45 2013 Return-Path: Delivered-To: svn-src-all@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 6C897C3B; Thu, 7 Feb 2013 15:11:44 +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 74CB6707; Thu, 7 Feb 2013 15:11: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 r17FBijA097259; Thu, 7 Feb 2013 15:11:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FBi2P097258; Thu, 7 Feb 2013 15:11:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071511.r17FBi2P097258@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 15:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246476 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:11:45 -0000 Author: kib Date: Thu Feb 7 15:11:43 2013 New Revision: 246476 URL: http://svnweb.freebsd.org/changeset/base/246476 Log: Document the ERESTART translation to EINTR for devfs nodes. Based on the submission by: jilles MFC after: 2 weeks Modified: head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Thu Feb 7 15:08:35 2013 (r246475) +++ head/lib/libc/sys/open.2 Thu Feb 7 15:11:43 2013 (r246476) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd March 25, 2011 +.Dd February 7, 2013 .Dt OPEN 2 .Os .Sh NAME @@ -244,6 +244,17 @@ It returns \-1 on failure. The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp +If a sleeping open of a device node from +.Xr devfs 5 +is interrupted by a signal, the call always fails with +.Er EINTR , +even if the +.Dv SA_RESTART +flag is set for the signal. +A sleeping open of a fifo (see +.Xr mkfifo 2 ) +is restarted as normal. +.Pp When a new file is created it is given the group of the directory which contains it. .Pp From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:20:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3811478A; Thu, 7 Feb 2013 15:20:57 +0000 (UTC) (envelope-from rrs@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 29BA07D5; Thu, 7 Feb 2013 15:20:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17FKvkh000660; Thu, 7 Feb 2013 15:20:57 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FKt5n000647; Thu, 7 Feb 2013 15:20:55 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201302071520.r17FKt5n000647@svn.freebsd.org> From: Randall Stewart Date: Thu, 7 Feb 2013 15:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246482 - in head/sys: dev/bxe dev/e1000 dev/ixgbe dev/oce net ofed/drivers/net/mlx4 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:20:57 -0000 Author: rrs Date: Thu Feb 7 15:20:54 2013 New Revision: 246482 URL: http://svnweb.freebsd.org/changeset/base/246482 Log: This fixes a out-of-order problem with several of the newer drivers. The basic problem was that the driver was pulling the mbuf off the drbr ring and then when sending with xmit(), encounting a full transmit ring. Thus the lower layer xmit() function would return an error, and the drivers would then append the data back on to the ring. For TCP this is a horrible scenario sure to bring on a fast-retransmit. The fix is to use drbr_peek() to pull the data pointer but not remove it from the ring. If it fails then we either call the new drbr_putback or drbr_advance method. Advance moves it forward (we do this sometimes when the xmit() function frees the mbuf). When we succeed we always call advance. The putback will always copy the mbuf back to the top of the ring. Note that the putback *cannot* be used with a drbr_dequeue() only with drbr_peek(). We most of the time, in putback, would not need to copy it back since most likey the mbuf is still the same, but sometimes xmit() functions will change the mbuf via a pullup or other call. So the optimial case for the single consumer is to always copy it back. If we ever do a multiple_consumer (for lagg?) we will need a test and atomic in the put back possibly a seperate putback_mc() in the ring buf. Reviewed by: jhb@freebsd.org, jlv@freebsd.org Modified: head/sys/dev/bxe/if_bxe.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c head/sys/dev/oce/oce_if.c head/sys/net/if_var.h head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/sys/buf_ring.h Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/bxe/if_bxe.c Thu Feb 7 15:20:54 2013 (r246482) @@ -9506,24 +9506,15 @@ bxe_tx_mq_start_locked(struct ifnet *ifp BXE_FP_LOCK_ASSERT(fp); - if (m == NULL) { - /* No new work, check for pending frames. */ - next = drbr_dequeue(ifp, fp->br); - } else if (drbr_needs_enqueue(ifp, fp->br)) { - /* Both new and pending work, maintain packet order. */ + if (m != NULL) { rc = drbr_enqueue(ifp, fp->br, m); if (rc != 0) { fp->tx_soft_errors++; goto bxe_tx_mq_start_locked_exit; } - next = drbr_dequeue(ifp, fp->br); - } else - /* New work only, nothing pending. */ - next = m; - + } /* Keep adding entries while there are frames to send. */ - while (next != NULL) { - + while ((next = drbr_peek(ifp, fp->br)) != NULL) { /* The transmit mbuf now belongs to us, keep track of it. */ fp->tx_mbuf_alloc++; @@ -9537,23 +9528,22 @@ bxe_tx_mq_start_locked(struct ifnet *ifp if (__predict_false(rc != 0)) { fp->tx_encap_failures++; /* Very Bad Frames(tm) may have been dropped. */ - if (next != NULL) { + if (next == NULL) { + drbr_advance(ifp, fp->br); + } else { + drbr_putback(ifp, fp->br, next); /* * Mark the TX queue as full and save * the frame. */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; fp->tx_frame_deferred++; - - /* This may reorder frame. */ - rc = drbr_enqueue(ifp, fp->br, next); fp->tx_mbuf_alloc--; } - /* Stop looking for more work. */ break; } - + drbr_advance(ifp, fp->br); /* The transmit frame was enqueued successfully. */ tx_count++; @@ -9574,8 +9564,6 @@ bxe_tx_mq_start_locked(struct ifnet *ifp ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; break; } - - next = drbr_dequeue(ifp, fp->br); } /* No TX packets were dequeued. */ Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/e1000/if_em.c Thu Feb 7 15:20:54 2013 (r246482) @@ -905,22 +905,24 @@ em_mq_start_locked(struct ifnet *ifp, st } enq = 0; - if (m == NULL) { - next = drbr_dequeue(ifp, txr->br); - } else if (drbr_needs_enqueue(ifp, txr->br)) { - if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) + if (m != NULL) { + err = drbr_enqueue(ifp, txr->br, m); + if (err) { return (err); - next = drbr_dequeue(ifp, txr->br); - } else - next = m; + } + } /* Process the queue */ - while (next != NULL) { + while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = em_xmit(txr, &next)) != 0) { - if (next != NULL) - err = drbr_enqueue(ifp, txr->br, next); - break; + if (next == NULL) { + drbr_advance(ifp, txr->br); + } else { + drbr_putback(ifp, txr->br, next); + } + break; } + drbr_advance(ifp, txr->br); enq++; ifp->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) @@ -928,7 +930,6 @@ em_mq_start_locked(struct ifnet *ifp, st ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - next = drbr_dequeue(ifp, txr->br); } if (enq > 0) { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/e1000/if_igb.c Thu Feb 7 15:20:54 2013 (r246482) @@ -350,6 +350,16 @@ TUNABLE_INT("hw.igb.max_interrupt_rate", SYSCTL_INT(_hw_igb, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &igb_max_interrupt_rate, 0, "Maximum interrupts per second"); +#if __FreeBSD_version >= 800000 +/* +** Tuneable number of buffers in the buf-ring (drbr_xxx) +*/ +static int igb_buf_ring_size = IGB_BR_SIZE; +TUNABLE_INT("hw.igb.buf_ring_size", &igb_buf_ring_size); +SYSCTL_INT(_hw_igb, OID_AUTO, buf_ring_size, CTLFLAG_RDTUN, + &igb_buf_ring_size, 0, "Size of the bufring"); +#endif + /* ** Header split causes the packet header to ** be dma'd to a seperate mbuf from the payload. @@ -965,12 +975,13 @@ igb_mq_start(struct ifnet *ifp, struct m ** out-of-order delivery, but ** settle for it if that fails */ - if (m) + if (m != NULL) drbr_enqueue(ifp, txr->br, m); err = igb_mq_start_locked(ifp, txr); IGB_TX_UNLOCK(txr); } else { - err = drbr_enqueue(ifp, txr->br, m); + if (m != NULL) + err = drbr_enqueue(ifp, txr->br, m); taskqueue_enqueue(que->tq, &txr->txq_task); } @@ -994,12 +1005,22 @@ igb_mq_start_locked(struct ifnet *ifp, s enq = 0; /* Process the queue */ - while ((next = drbr_dequeue(ifp, txr->br)) != NULL) { + while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = igb_xmit(txr, &next)) != 0) { - if (next != NULL) - err = drbr_enqueue(ifp, txr->br, next); + if (next == NULL) { + /* It was freed, move forward */ + drbr_advance(ifp, txr->br); + } else { + /* + * Still have one left, it may not be + * the same since the transmit function + * may have changed it. + */ + drbr_putback(ifp, txr->br, next); + } break; } + drbr_advance(ifp, txr->br); enq++; ifp->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) @@ -3301,7 +3322,7 @@ igb_allocate_queues(struct adapter *adap } #if __FreeBSD_version >= 800000 /* Allocate a buf ring */ - txr->br = buf_ring_alloc(IGB_BR_SIZE, M_DEVBUF, + txr->br = buf_ring_alloc(igb_buf_ring_size, M_DEVBUF, M_WAITOK, &txr->tx_mtx); #endif } Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/ixgbe/ixgbe.c Thu Feb 7 15:20:54 2013 (r246482) @@ -832,22 +832,24 @@ ixgbe_mq_start_locked(struct ifnet *ifp, } enqueued = 0; - if (m == NULL) { - next = drbr_dequeue(ifp, txr->br); - } else if (drbr_needs_enqueue(ifp, txr->br)) { - if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) + if (m != NULL) { + err = drbr_enqueue(ifp, txr->br, m); + if (err) { return (err); - next = drbr_dequeue(ifp, txr->br); - } else - next = m; + } + } /* Process the queue */ - while (next != NULL) { + while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = ixgbe_xmit(txr, &next)) != 0) { - if (next != NULL) - err = drbr_enqueue(ifp, txr->br, next); + if (next == NULL) { + drbr_advance(ifp, txr->br); + } else { + drbr_putback(ifp, txr->br, next); + } break; } + drbr_advance(ifp, txr->br); enqueued++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); @@ -855,7 +857,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); - next = drbr_dequeue(ifp, txr->br); } if (enqueued > 0) { Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/ixgbe/ixv.c Thu Feb 7 15:20:54 2013 (r246482) @@ -620,22 +620,23 @@ ixv_mq_start_locked(struct ifnet *ifp, s ixv_txeof(txr); enqueued = 0; - if (m == NULL) { - next = drbr_dequeue(ifp, txr->br); - } else if (drbr_needs_enqueue(ifp, txr->br)) { - if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) + if (m != NULL) { + err = drbr_enqueue(ifp, txr->br, m); + if (err) { return (err); - next = drbr_dequeue(ifp, txr->br); - } else - next = m; - + } + } /* Process the queue */ - while (next != NULL) { + while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = ixv_xmit(txr, &next)) != 0) { - if (next != NULL) - err = drbr_enqueue(ifp, txr->br, next); + if (next == NULL) { + drbr_advance(ifp, txr->br); + } else { + drbr_putback(ifp, txr->br, next); + } break; } + drbr_advance(ifp, txr->br); enqueued++; ifp->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) @@ -648,7 +649,6 @@ ixv_mq_start_locked(struct ifnet *ifp, s ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - next = drbr_dequeue(ifp, txr->br); } if (enqueued > 0) { Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/dev/oce/oce_if.c Thu Feb 7 15:20:54 2013 (r246482) @@ -1166,29 +1166,27 @@ oce_multiq_transmit(struct ifnet *ifp, s return status; } - if (m == NULL) - next = drbr_dequeue(ifp, br); - else if (drbr_needs_enqueue(ifp, br)) { + if (m != NULL) { if ((status = drbr_enqueue(ifp, br, m)) != 0) return status; - next = drbr_dequeue(ifp, br); - } else - next = m; - - while (next != NULL) { + } + while ((next = drbr_peek(ifp, br)) != NULL) { if (oce_tx(sc, &next, queue_index)) { - if (next != NULL) { + if (next == NULL) { + drbr_advance(ifp, br); + } else { + drbr_putback(ifp, br, next); wq->tx_stats.tx_stops ++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; status = drbr_enqueue(ifp, br, next); } break; } + drbr_advance(ifp, br); ifp->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); - next = drbr_dequeue(ifp, br); } return status; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/net/if_var.h Thu Feb 7 15:20:54 2013 (r246482) @@ -622,6 +622,45 @@ drbr_enqueue(struct ifnet *ifp, struct b } static __inline void +drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new) +{ + /* + * The top of the list needs to be swapped + * for this one. + */ +#ifdef ALTQ + if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { + /* + * Peek in altq case dequeued it + * so put it back. + */ + IFQ_DRV_PREPEND(&ifp->if_snd, new); + return; + } +#endif + buf_ring_putback_sc(br, new); +} + +static __inline struct mbuf * +drbr_peek(struct ifnet *ifp, struct buf_ring *br) +{ +#ifdef ALTQ + struct mbuf *m; + if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { + /* + * Pull it off like a dequeue + * since drbr_advance() does nothing + * for altq and drbr_putback() will + * use the old prepend function. + */ + IFQ_DEQUEUE(&ifp->if_snd, m); + return (m); + } +#endif + return(buf_ring_peek(br)); +} + +static __inline void drbr_flush(struct ifnet *ifp, struct buf_ring *br) { struct mbuf *m; @@ -648,7 +687,7 @@ drbr_dequeue(struct ifnet *ifp, struct b #ifdef ALTQ struct mbuf *m; - if (ALTQ_IS_ENABLED(&ifp->if_snd)) { + if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { IFQ_DEQUEUE(&ifp->if_snd, m); return (m); } @@ -656,6 +695,18 @@ drbr_dequeue(struct ifnet *ifp, struct b return (buf_ring_dequeue_sc(br)); } +static __inline void +drbr_advance(struct ifnet *ifp, struct buf_ring *br) +{ +#ifdef ALTQ + /* Nothing to do here since peek dequeues in altq case */ + if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) + return; +#endif + return (buf_ring_advance_sc(br)); +} + + static __inline struct mbuf * drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br, int (*func) (struct mbuf *, void *), void *arg) Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Thu Feb 7 15:20:54 2013 (r246482) @@ -931,22 +931,21 @@ mlx4_en_transmit_locked(struct ifnet *de } enqueued = 0; - if (m == NULL) { - next = drbr_dequeue(dev, ring->br); - } else if (drbr_needs_enqueue(dev, ring->br)) { + if (m != NULL) { if ((err = drbr_enqueue(dev, ring->br, m)) != 0) return (err); - next = drbr_dequeue(dev, ring->br); - } else - next = m; - + } /* Process the queue */ - while (next != NULL) { + while ((next = drbr_peek(ifp, ring->br)) != NULL) { if ((err = mlx4_en_xmit(dev, tx_ind, &next)) != 0) { - if (next != NULL) - err = drbr_enqueue(dev, ring->br, next); + if (next == NULL) { + drbr_advance(ifp, ring->br); + } else { + drbr_putback(ifp, ring->br, next); + } break; } + drbr_advance(ifp, ring->br); enqueued++; dev->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) @@ -955,7 +954,6 @@ mlx4_en_transmit_locked(struct ifnet *de ETHER_BPF_MTAP(dev, next); if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - next = drbr_dequeue(dev, ring->br); } if (enqueued > 0) Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Thu Feb 7 15:19:12 2013 (r246481) +++ head/sys/sys/buf_ring.h Thu Feb 7 15:20:54 2013 (r246482) @@ -208,6 +208,54 @@ buf_ring_dequeue_sc(struct buf_ring *br) } /* + * single-consumer advance after a peek + * use where it is protected by a lock + * e.g. a network driver's tx queue lock + */ +static __inline void +buf_ring_advance_sc(struct buf_ring *br) +{ + uint32_t cons_head, cons_next; + uint32_t prod_tail; + + cons_head = br->br_cons_head; + prod_tail = br->br_prod_tail; + + cons_next = (cons_head + 1) & br->br_cons_mask; + if (cons_head == prod_tail) + return; + br->br_cons_head = cons_next; +#ifdef DEBUG_BUFRING + br->br_ring[cons_head] = NULL; +#endif + br->br_cons_tail = cons_next; +} + +/* + * Used to return a buffer (most likely already there) + * to the top od the ring. The caller should *not* + * have used any dequeue to pull it out of the ring + * but instead should have used the peek() function. + * This is normally used where the transmit queue + * of a driver is full, and an mubf must be returned. + * Most likely whats in the ring-buffer is what + * is being put back (since it was not removed), but + * sometimes the lower transmit function may have + * done a pullup or other function that will have + * changed it. As an optimzation we always put it + * back (since jhb says the store is probably cheaper), + * if we have to do a multi-queue version we will need + * the compare and an atomic. + */ +static __inline void +buf_ring_putback_sc(struct buf_ring *br, void *new) +{ + KASSERT(br->br_cons_head != br->br_prod_tail, + ("Buf-Ring has none in putback")) ; + br->br_ring[br->br_cons_head] = new; +} + +/* * return a pointer to the first entry in the ring * without modifying it, or NULL if the ring is empty * race-prone if not protected by a lock From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:34:23 2013 Return-Path: Delivered-To: svn-src-all@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 860CCEF2; Thu, 7 Feb 2013 15:34:23 +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 6D25488C; Thu, 7 Feb 2013 15:34:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17FYN4N004237; Thu, 7 Feb 2013 15:34:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FYMew004229; Thu, 7 Feb 2013 15:34:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071534.r17FYMew004229@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 15:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246484 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:34:23 -0000 Author: kib Date: Thu Feb 7 15:34:22 2013 New Revision: 246484 URL: http://svnweb.freebsd.org/changeset/base/246484 Log: When vforked child is traced, the debugging events are not generated until child performs exec(). The behaviour is reasonable when a debugger is the real parent, because the parent is stopped until exec(), and sending a debugging event to the debugger would deadlock both parent and child. On the other hand, when debugger is not the parent of the vforked child, not sending debugging signals makes it impossible to debug across vfork. Fix the issue by declining generating debug signals only when vfork() was done and child called ptrace(PT_TRACEME). Set a new process flag P_PPTRACE from the attach code for PT_TRACEME, if P_PPWAIT flag is set, which indicates that the process was created with vfork() and still did not execed. Check P_PPTRACE from issignal(), instead of refusing the trace outright for the P_PPWAIT case. The scope of P_PPTRACE is exactly contained in the scope of P_PPWAIT. Found and tested by: zont Reviewed by: pluknet MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_sig.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Feb 7 15:22:50 2013 (r246483) +++ head/sys/kern/kern_exec.c Thu Feb 7 15:34:22 2013 (r246484) @@ -640,7 +640,7 @@ interpret: */ p->p_flag |= P_EXEC; if (p->p_pptr && (p->p_flag & P_PPWAIT)) { - p->p_flag &= ~P_PPWAIT; + p->p_flag &= ~(P_PPWAIT | P_PPTRACE); cv_broadcast(&p->p_pwait); } Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Feb 7 15:22:50 2013 (r246483) +++ head/sys/kern/kern_exit.c Thu Feb 7 15:34:22 2013 (r246484) @@ -266,7 +266,7 @@ exit1(struct thread *td, int rv) PROC_LOCK(p); rv = p->p_xstat; /* Event handler could change exit status */ stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPWAIT); + p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); /* * Stop the real interval timer. If the handler is currently Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Feb 7 15:22:50 2013 (r246483) +++ head/sys/kern/kern_sig.c Thu Feb 7 15:34:22 2013 (r246484) @@ -2618,7 +2618,7 @@ issignal(struct thread *td, int stop_all sigqueue_delete(&p->p_sigqueue, sig); continue; } - if (p->p_flag & P_TRACED && (p->p_flag & P_PPWAIT) == 0) { + if (p->p_flag & P_TRACED && (p->p_flag & P_PPTRACE) == 0) { /* * If traced, always stop. * Remove old signal from queue before the stop. Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Feb 7 15:22:50 2013 (r246483) +++ head/sys/kern/sys_process.c Thu Feb 7 15:34:22 2013 (r246484) @@ -822,6 +822,8 @@ kern_ptrace(struct thread *td, int req, case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ p->p_flag |= P_TRACED; + if (p->p_flag & P_PPWAIT) + p->p_flag |= P_PPTRACE; p->p_oppid = p->p_pptr->p_pid; break; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Feb 7 15:22:50 2013 (r246483) +++ head/sys/sys/proc.h Thu Feb 7 15:34:22 2013 (r246484) @@ -636,6 +636,7 @@ struct proc { #define P_INMEM 0x10000000 /* Loaded into memory. */ #define P_SWAPPINGOUT 0x20000000 /* Process is being swapped out. */ #define P_SWAPPINGIN 0x40000000 /* Process is being swapped in. */ +#define P_PPTRACE 0x80000000 /* PT_TRACEME by vforked child. */ #define P_STOPPED (P_STOPPED_SIG|P_STOPPED_SINGLE|P_STOPPED_TRACE) #define P_SHOULDSTOP(p) ((p)->p_flag & P_STOPPED) From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:36:25 2013 Return-Path: Delivered-To: svn-src-all@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 7AE55119; Thu, 7 Feb 2013 15:36:25 +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 6D9C58A9; Thu, 7 Feb 2013 15:36: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 r17FaP44004558; Thu, 7 Feb 2013 15:36:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FaPuC004557; Thu, 7 Feb 2013 15:36:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071536.r17FaPuC004557@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 15:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246485 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:36:25 -0000 Author: kib Date: Thu Feb 7 15:36:24 2013 New Revision: 246485 URL: http://svnweb.freebsd.org/changeset/base/246485 Log: Document the detail of interaction between vfork and PT_TRACEME. MFC after: 2 weeks Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Thu Feb 7 15:34:22 2013 (r246484) +++ head/lib/libc/sys/ptrace.2 Thu Feb 7 15:36:24 2013 (r246485) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 19, 2012 +.Dd February 7, 2013 .Dt PTRACE 2 .Os .Sh NAME @@ -100,6 +100,16 @@ or any of the routines built on it it will stop before executing the first instruction of the new image. Also, any setuid or setgid bits on the executable being executed will be ignored. +If the child was created by +.Xr vfork 2 +system call or +.Xr rfork(2) +call with the +.Dv RFMEM +flag specified, the debugging events are reported to the parent +only after the +.Xr execve 2 +is executed. .It Dv PT_READ_I , Dv PT_READ_D These requests read a single .Vt int From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:37:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8928B491; Thu, 7 Feb 2013 15:37:52 +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 7AB198DB; Thu, 7 Feb 2013 15:37: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 r17FbqCW004905; Thu, 7 Feb 2013 15:37:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FbqmM004904; Thu, 7 Feb 2013 15:37:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071537.r17FbqmM004904@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 15:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246486 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:37:52 -0000 Author: kib Date: Thu Feb 7 15:37:51 2013 New Revision: 246486 URL: http://svnweb.freebsd.org/changeset/base/246486 Log: Document P_PPTRACE. MFC after: 2 weeks Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Feb 7 15:36:24 2013 (r246485) +++ head/bin/ps/ps.1 Thu Feb 7 15:37:51 2013 (r246486) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 18, 2012 +.Dd February 7, 2013 .Dt PS 1 .Os .Sh NAME @@ -323,6 +323,7 @@ the include file .It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory" .It Dv "P_SWAPPINGOUT" Ta No "0x20000000" Ta "Process is being swapped out" .It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in" +.It Dv "P_PPTRACE" Ta No "0x80000000" Ta "Vforked child issued ptrace(PT_TRACEME)" .El .It Cm label The MAC label of the process. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 15:45:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A32DA881; Thu, 7 Feb 2013 15:45:32 +0000 (UTC) (envelope-from theraven@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 7D60393A; Thu, 7 Feb 2013 15:45: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 r17FjWFV007688; Thu, 7 Feb 2013 15:45:32 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FjSK9007660; Thu, 7 Feb 2013 15:45:28 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201302071545.r17FjSK9007660@svn.freebsd.org> From: David Chisnall Date: Thu, 7 Feb 2013 15:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246487 - in head/contrib/libc++: include src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 15:45:32 -0000 Author: theraven Date: Thu Feb 7 15:45:28 2013 New Revision: 246487 URL: http://svnweb.freebsd.org/changeset/base/246487 Log: Import new libc++ to head. Various small fixes and cleanups. MFC after: 2 weeks Modified: head/contrib/libc++/include/__config head/contrib/libc++/include/algorithm head/contrib/libc++/include/array head/contrib/libc++/include/atomic head/contrib/libc++/include/cmath head/contrib/libc++/include/functional head/contrib/libc++/include/future head/contrib/libc++/include/istream head/contrib/libc++/include/iterator head/contrib/libc++/include/limits head/contrib/libc++/include/locale head/contrib/libc++/include/memory head/contrib/libc++/include/ostream head/contrib/libc++/include/random head/contrib/libc++/include/regex head/contrib/libc++/include/string head/contrib/libc++/include/type_traits head/contrib/libc++/include/vector head/contrib/libc++/src/chrono.cpp head/contrib/libc++/src/debug.cpp head/contrib/libc++/src/exception.cpp head/contrib/libc++/src/future.cpp head/contrib/libc++/src/hash.cpp head/contrib/libc++/src/locale.cpp head/contrib/libc++/src/string.cpp head/contrib/libc++/src/thread.cpp Directory Properties: head/contrib/libc++/ (props changed) Modified: head/contrib/libc++/include/__config ============================================================================== --- head/contrib/libc++/include/__config Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/__config Thu Feb 7 15:45:28 2013 (r246487) @@ -66,6 +66,12 @@ # endif #endif // _WIN32 +#ifdef __linux__ +# if defined(__GNUC__) && _GNUC_VER >= 403 +# define _LIBCP_HAS_IS_BASE_OF +# endif +#endif + #ifdef __sun__ # include # ifdef _LITTLE_ENDIAN Modified: head/contrib/libc++/include/algorithm ============================================================================== --- head/contrib/libc++/include/algorithm Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/algorithm Thu Feb 7 15:45:28 2013 (r246487) @@ -1528,10 +1528,10 @@ copy(_InputIterator __first, _InputItera // copy_backward -template +template inline _LIBCPP_INLINE_VISIBILITY _OutputIterator -__copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { while (__first != __last) *--__result = *--__last; Modified: head/contrib/libc++/include/array ============================================================================== --- head/contrib/libc++/include/array Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/array Thu Feb 7 15:45:28 2013 (r246487) @@ -310,6 +310,7 @@ _LIBCPP_INLINE_VISIBILITY inline _Tp& get(array<_Tp, _Size>& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)"); return __a[_Ip]; } @@ -318,6 +319,7 @@ _LIBCPP_INLINE_VISIBILITY inline const _Tp& get(const array<_Tp, _Size>& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)"); return __a[_Ip]; } @@ -328,6 +330,7 @@ _LIBCPP_INLINE_VISIBILITY inline _Tp&& get(array<_Tp, _Size>&& __a) _NOEXCEPT { + static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)"); return _VSTD::move(__a[_Ip]); } Modified: head/contrib/libc++/include/atomic ============================================================================== --- head/contrib/libc++/include/atomic Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/atomic Thu Feb 7 15:45:28 2013 (r246487) @@ -33,6 +33,7 @@ template T kill_dependency(T y // lock-free property +#define ATOMIC_BOOL_LOCK_FREE unspecified #define ATOMIC_CHAR_LOCK_FREE unspecified #define ATOMIC_CHAR16_T_LOCK_FREE unspecified #define ATOMIC_CHAR32_T_LOCK_FREE unspecified @@ -41,6 +42,7 @@ template T kill_dependency(T y #define ATOMIC_INT_LOCK_FREE unspecified #define ATOMIC_LONG_LOCK_FREE unspecified #define ATOMIC_LLONG_LOCK_FREE unspecified +#define ATOMIC_POINTER_LOCK_FREE unspecified // flag type and operations @@ -472,6 +474,7 @@ template // Atomics for standard typedef types +typedef atomic atomic_bool; typedef atomic atomic_char; typedef atomic atomic_schar; typedef atomic atomic_uchar; @@ -1454,6 +1457,7 @@ atomic_signal_fence(memory_order __m) _N // Atomics for standard typedef types +typedef atomic atomic_bool; typedef atomic atomic_char; typedef atomic atomic_schar; typedef atomic atomic_uchar; @@ -1499,14 +1503,16 @@ typedef atomic atomic_uintmax // lock-free property -#define ATOMIC_CHAR_LOCK_FREE 0 -#define ATOMIC_CHAR16_T_LOCK_FREE 0 -#define ATOMIC_CHAR32_T_LOCK_FREE 0 -#define ATOMIC_WCHAR_T_LOCK_FREE 0 -#define ATOMIC_SHORT_LOCK_FREE 0 -#define ATOMIC_INT_LOCK_FREE 0 -#define ATOMIC_LONG_LOCK_FREE 0 -#define ATOMIC_LLONG_LOCK_FREE 0 +#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE +#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE +#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE +#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE +#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE +#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE +#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE +#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE +#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE #endif // !__has_feature(cxx_atomic) Modified: head/contrib/libc++/include/cmath ============================================================================== --- head/contrib/libc++/include/cmath Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/cmath Thu Feb 7 15:45:28 2013 (r246487) @@ -137,21 +137,21 @@ long double tanhl(long double x); // C99 -bool signbit(floating_point x); +bool signbit(arithmetic x); -int fpclassify(floating_point x); +int fpclassify(arithmetic x); -bool isfinite(floating_point x); -bool isinf(floating_point x); -bool isnan(floating_point x); -bool isnormal(floating_point x); - -bool isgreater(floating_point x, floating_point y); -bool isgreaterequal(floating_point x, floating_point y); -bool isless(floating_point x, floating_point y); -bool islessequal(floating_point x, floating_point y); -bool islessgreater(floating_point x, floating_point y); -bool isunordered(floating_point x, floating_point y); +bool isfinite(arithmetic x); +bool isinf(arithmetic x); +bool isnan(arithmetic x); +bool isnormal(arithmetic x); + +bool isgreater(arithmetic x, arithmetic y); +bool isgreaterequal(arithmetic x, arithmetic y); +bool isless(arithmetic x, arithmetic y); +bool islessequal(arithmetic x, arithmetic y); +bool islessgreater(arithmetic x, arithmetic y); +bool isunordered(arithmetic x, arithmetic y); floating_point acosh (arithmetic x); float acoshf(float x); @@ -325,10 +325,10 @@ __libcpp_signbit(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type signbit(_A1 __x) _NOEXCEPT { - return __libcpp_signbit(__x); + return __libcpp_signbit((typename std::__promote<_A1>::type)__x); } #endif // signbit @@ -349,10 +349,10 @@ __libcpp_fpclassify(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, int>::type +typename std::enable_if::value, int>::type fpclassify(_A1 __x) _NOEXCEPT { - return __libcpp_fpclassify(__x); + return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x); } #endif // fpclassify @@ -373,10 +373,10 @@ __libcpp_isfinite(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isfinite(_A1 __x) _NOEXCEPT { - return __libcpp_isfinite(__x); + return __libcpp_isfinite((typename std::__promote<_A1>::type)__x); } #endif // isfinite @@ -397,10 +397,10 @@ __libcpp_isinf(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isinf(_A1 __x) _NOEXCEPT { - return __libcpp_isinf(__x); + return __libcpp_isinf((typename std::__promote<_A1>::type)__x); } #endif // isinf @@ -421,10 +421,10 @@ __libcpp_isnan(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isnan(_A1 __x) _NOEXCEPT { - return __libcpp_isnan(__x); + return __libcpp_isnan((typename std::__promote<_A1>::type)__x); } #endif // isnan @@ -445,10 +445,10 @@ __libcpp_isnormal(_A1 __x) _NOEXCEPT template inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type +typename std::enable_if::value, bool>::type isnormal(_A1 __x) _NOEXCEPT { - return __libcpp_isnormal(__x); + return __libcpp_isnormal((typename std::__promote<_A1>::type)__x); } #endif // isnormal @@ -471,13 +471,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isgreater(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isgreater(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreater((type)__x, (type)__y); } #endif // isgreater @@ -500,13 +501,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isgreaterequal(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isgreaterequal((type)__x, (type)__y); } #endif // isgreaterequal @@ -529,13 +531,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isless(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isless(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isless((type)__x, (type)__y); } #endif // isless @@ -558,13 +561,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type islessequal(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_islessequal(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessequal((type)__x, (type)__y); } #endif // islessequal @@ -587,13 +591,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_islessgreater(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_islessgreater((type)__x, (type)__y); } #endif // islessgreater @@ -616,13 +621,14 @@ template inline _LIBCPP_INLINE_VISIBILITY typename std::enable_if < - std::is_floating_point<_A1>::value && - std::is_floating_point<_A2>::value, + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, bool >::type isunordered(_A1 __x, _A2 __y) _NOEXCEPT { - return __libcpp_isunordered(__x, __y); + typedef typename std::__promote<_A1, _A2>::type type; + return __libcpp_isunordered((type)__x, (type)__y); } #endif // isunordered Modified: head/contrib/libc++/include/functional ============================================================================== --- head/contrib/libc++/include/functional Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/functional Thu Feb 7 15:45:28 2013 (r246487) @@ -1088,7 +1088,7 @@ class _LIBCPP_VISIBLE function<_Rp(_ArgT public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> { typedef __function::__base<_Rp(_ArgTypes...)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; + typename aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; template Modified: head/contrib/libc++/include/future ============================================================================== --- head/contrib/libc++/include/future Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/future Thu Feb 7 15:45:28 2013 (r246487) @@ -470,7 +470,11 @@ public: {return (__state_ & __constructed) || (__exception_ != nullptr);} _LIBCPP_INLINE_VISIBILITY - void __set_future_attached() {__state_ |= __future_attached;} + void __set_future_attached() + { + lock_guard __lk(__mut_); + __state_ |= __future_attached; + } _LIBCPP_INLINE_VISIBILITY bool __has_future_attached() const {return __state_ & __future_attached;} @@ -1753,7 +1757,7 @@ template class __packaged_task_function<_Rp(_ArgTypes...)> { typedef __packaged_task_base<_Rp(_ArgTypes...)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; + typename aligned_storage<3*sizeof(void*)>::type __buf_; __base* __f_; public: Modified: head/contrib/libc++/include/istream ============================================================================== --- head/contrib/libc++/include/istream Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/istream Thu Feb 7 15:45:28 2013 (r246487) @@ -1243,6 +1243,7 @@ template streamsize basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n) { + __gc_ = 0; streamsize __c = this->rdbuf()->in_avail(); switch (__c) { Modified: head/contrib/libc++/include/iterator ============================================================================== --- head/contrib/libc++/include/iterator Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/iterator Thu Feb 7 15:45:28 2013 (r246487) @@ -822,9 +822,9 @@ private: public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT - : __sbuf_(__s.rdbuf()) {__test_for_eof();} + : __sbuf_(__s.rdbuf()) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT - : __sbuf_(__s) {__test_for_eof();} + : __sbuf_(__s) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT : __sbuf_(__p.__sbuf_) {} Modified: head/contrib/libc++/include/limits ============================================================================== --- head/contrib/libc++/include/limits Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/limits Thu Feb 7 15:45:28 2013 (r246487) @@ -479,6 +479,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -525,6 +572,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -571,6 +665,53 @@ public: }; template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + +template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> { @@ -616,6 +757,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_LIMITS Modified: head/contrib/libc++/include/locale ============================================================================== --- head/contrib/libc++/include/locale Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/locale Thu Feb 7 15:45:28 2013 (r246487) @@ -354,7 +354,7 @@ size_t __mbsrtowcs_l(wchar_t *__dest, co #endif } -_LIBCPP_ALWAYS_INLINE inline +inline int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -368,7 +368,7 @@ int __sprintf_l(char *__s, locale_t __l, return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -382,7 +382,7 @@ int __snprintf_l(char *__s, size_t __n, return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -396,7 +396,7 @@ int __asprintf_l(char **__s, locale_t __ return __res; } -_LIBCPP_ALWAYS_INLINE inline +inline int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -830,11 +830,11 @@ __num_get_signed_integral(const char* __ { if (__a != __a_end) { - int __save_errno = errno; + typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - int __current_errno = errno; + typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -870,11 +870,11 @@ __num_get_unsigned_integral(const char* __err = ios_base::failbit; return 0; } - int __save_errno = errno; + typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - int __current_errno = errno; + typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -2895,6 +2895,10 @@ template ::id; +template +const bool +moneypunct<_CharT, _International>::intl; + _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) Modified: head/contrib/libc++/include/memory ============================================================================== --- head/contrib/libc++/include/memory Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/memory Thu Feb 7 15:45:28 2013 (r246487) @@ -1571,7 +1571,10 @@ struct _LIBCPP_VISIBLE allocator_traits __construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) { while (__end1 != __begin1) - construct(__a, _VSTD::__to_raw_pointer(--__end2), _VSTD::move_if_noexcept(*--__end1)); + { + construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1)); + --__end2; + } } template Modified: head/contrib/libc++/include/ostream ============================================================================== --- head/contrib/libc++/include/ostream Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/ostream Thu Feb 7 15:45:28 2013 (r246487) @@ -1100,17 +1100,8 @@ basic_ostream<_CharT, _Traits>::write(co sentry __sen(*this); if (__sen && __n) { - typedef ostreambuf_iterator<_CharT, _Traits> _Op; - _Op __o(*this); - for (; __n; --__n, ++__o, ++__s) - { - *__o = *__s; - if (__o.failed()) - { - this->setstate(ios_base::badbit); - break; - } - } + if (this->rdbuf()->sputn(__s, __n) != __n) + this->setstate(ios_base::badbit); } #ifndef _LIBCPP_NO_EXCEPTIONS } Modified: head/contrib/libc++/include/random ============================================================================== --- head/contrib/libc++/include/random Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/random Thu Feb 7 15:45:28 2013 (r246487) @@ -1931,6 +1931,22 @@ private: }; template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::increment; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; + +template template void linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, @@ -2230,6 +2246,90 @@ private: template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed; + +template void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::seed(result_type __sd) @@ -2552,6 +2652,19 @@ private: }; template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; + +template + _LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type + subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; + +template void subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, integral_constant) @@ -2823,6 +2936,12 @@ public: }; template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size; + +template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block; + +template typename discard_block_engine<_Engine, __p, __r>::result_type discard_block_engine<_Engine, __p, __r>::operator()() { @@ -3314,6 +3433,9 @@ private: } }; +template + _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size; + template bool operator==( Modified: head/contrib/libc++/include/regex ============================================================================== --- head/contrib/libc++/include/regex Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/regex Thu Feb 7 15:45:28 2013 (r246487) @@ -2843,6 +2843,27 @@ private: }; template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::nosubs; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::optimize; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::collate; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::ECMAScript; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::basic; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::extended; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::awk; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::grep; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::egrep; + +template void basic_regex<_CharT, _Traits>::swap(basic_regex& __r) { Modified: head/contrib/libc++/include/string ============================================================================== --- head/contrib/libc++/include/string Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/string Thu Feb 7 15:45:28 2013 (r246487) @@ -3374,7 +3374,7 @@ basic_string<_CharT, _Traits, _Allocator { const_pointer __p = data(); const_pointer __pe = __p + __sz; - for (const_pointer __ps = __p + __pos; __p != __pe; ++__ps) + for (const_pointer __ps = __p + __pos; __ps != __pe; ++__ps) if (!traits_type::eq(*__ps, __c)) return static_cast(__ps - __p); } Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/type_traits Thu Feb 7 15:45:28 2013 (r246487) @@ -617,7 +617,28 @@ struct _LIBCPP_VISIBLE is_base_of #else // __has_feature(is_base_of) -#error is_base_of not implemented. +namespace __is_base_of_imp +{ +template +struct _Dst +{ + _Dst(const volatile _Tp &); +}; +template +struct _Src +{ + operator const volatile _Tp &(); + template operator const _Dst<_Up> &(); +}; +template struct __one { typedef char type; }; +template typename __one(declval<_Src<_Dp> >()))>::type __test(int); +template __two __test(...); +} + +template +struct _LIBCPP_VISIBLE is_base_of + : public integral_constant::value && + sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {}; #endif // __has_feature(is_base_of) Modified: head/contrib/libc++/include/vector ============================================================================== --- head/contrib/libc++/include/vector Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/include/vector Thu Feb 7 15:45:28 2013 (r246487) @@ -1458,7 +1458,8 @@ vector<_Tp, _Allocator>::__push_back_slo allocator_type& __a = this->__alloc(); __split_buffer __v(__recommend(size() + 1), size(), __a); // __v.push_back(_VSTD::forward<_Up>(__x)); - __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Up>(__x)); + __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Up>(__x)); + __v.__end_++; __swap_out_circular_buffer(__v); } @@ -1505,7 +1506,8 @@ vector<_Tp, _Allocator>::__emplace_back_ allocator_type& __a = this->__alloc(); __split_buffer __v(__recommend(size() + 1), size(), __a); // __v.emplace_back(_VSTD::forward<_Args>(__args)...); - __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_++), _VSTD::forward<_Args>(__args)...); + __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Args>(__args)...); + __v.__end_++; __swap_out_circular_buffer(__v); } Modified: head/contrib/libc++/src/chrono.cpp ============================================================================== --- head/contrib/libc++/src/chrono.cpp Thu Feb 7 15:37:51 2013 (r246486) +++ head/contrib/libc++/src/chrono.cpp Thu Feb 7 15:45:28 2013 (r246487) @@ -24,6 +24,8 @@ namespace chrono // system_clock +const bool system_clock::is_steady; + system_clock::time_point system_clock::now() _NOEXCEPT { @@ -46,6 +48,8 @@ system_clock::from_time_t(time_t t) _NOE // steady_clock +const bool steady_clock::is_steady; + #if __APPLE__ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 19:00:55 2013 Return-Path: Delivered-To: svn-src-all@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 0BBE5368; Thu, 7 Feb 2013 19:00:55 +0000 (UTC) (envelope-from delphij@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 F1D1673C; Thu, 7 Feb 2013 19:00: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 r17J0sgM067525; Thu, 7 Feb 2013 19:00:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17J0sau067524; Thu, 7 Feb 2013 19:00:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302071900.r17J0sau067524@svn.freebsd.org> From: Xin LI Date: Thu, 7 Feb 2013 19:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246495 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 19:00:55 -0000 Author: delphij Date: Thu Feb 7 19:00:54 2013 New Revision: 246495 URL: http://svnweb.freebsd.org/changeset/base/246495 Log: Catch TRACE parameters up with r238888. This change is only needed when debugging is enabled. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Thu Feb 7 18:47:25 2013 (r246494) +++ head/bin/sh/jobs.c Thu Feb 7 19:00:54 2013 (r246495) @@ -1030,7 +1030,7 @@ dowait(int mode, struct job *job) int wflags; int restore_sigchld; - TRACE(("dowait(%d) called\n", block)); + TRACE(("dowait(%d, %p) called\n", mode, job)); restore_sigchld = 0; if ((mode & DOWAIT_SIG) != 0) { sigfillset(&mask); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 19:09:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7283668A; Thu, 7 Feb 2013 19:09:11 +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 4372B7A2; Thu, 7 Feb 2013 19:09: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 r17J9BcE069149; Thu, 7 Feb 2013 19:09:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17J9BRs069148; Thu, 7 Feb 2013 19:09:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201302071909.r17J9BRs069148@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 7 Feb 2013 19:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r246496 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 19:09:11 -0000 Author: marcel Date: Thu Feb 7 19:09:10 2013 New Revision: 246496 URL: http://svnweb.freebsd.org/changeset/base/246496 Log: Unleash sjg@. He's been an excellent mentee. Have fun Simon. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Feb 7 19:00:54 2013 (r246495) +++ svnadmin/conf/mentors Thu Feb 7 19:09:10 2013 (r246496) @@ -33,7 +33,6 @@ miwi rwatson monthadar adrian nork imp peterj jhb Co-mentor: grog -sjg marcel smh pjd Co-mentor: avg snb dwmalone versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 19:43:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE1C437B; Thu, 7 Feb 2013 19:43:35 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1.freebsd.org (Postfix) with ESMTP id B68F395C; Thu, 7 Feb 2013 19:43:34 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id ge1so2421134lbb.15 for ; Thu, 07 Feb 2013 11:43:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=/zeVNa5K/ciMT0EnHadbeqB6epYfvBZqCp1C95Lcvw4=; b=kPWG5KxHYtML8tTKBcNKDbfQX1QbP/V4HpqW6STx2iwyAqAcTcfuLSjVpd7gxVQ1kW cO5+I+xRKGS5V9iXrTRVhSZJP2eomry5oypK7Rr53bLlvnGFpmaKynaDwVwspPc0gCm0 5ehp4dh/fVqQDFnPlgYfb0zLHq53klD3Co7mGQTVwd1lyTOv1+5ICQ48TMweXmVJZw1S l1gBVSyJ57oylJXsrKVfP5ZRUNwB9mNS+W470JE4nntXsvFs5jTHkzKaUNgRUboL+mgg 0IPkpaCKa4Sz/vjxhNvXvcesepMOXG+05J3EYxAEeH6Fdx/jOwLEzFMXvbYNwyoJ1t+E 0wHw== X-Received: by 10.112.17.166 with SMTP id p6mr1259444lbd.41.1360266213066; Thu, 07 Feb 2013 11:43:33 -0800 (PST) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPS id b3sm9293101lbl.0.2013.02.07.11.43.30 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 11:43:31 -0800 (PST) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.6/8.14.6) with ESMTP id r17JhTue031386; Thu, 7 Feb 2013 23:43:29 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.6/8.14.6/Submit) id r17JhTl7031385; Thu, 7 Feb 2013 23:43:29 +0400 (MSK) (envelope-from dchagin) Date: Thu, 7 Feb 2013 23:43:28 +0400 From: Chagin Dmitry To: John Baldwin Subject: Re: svn commit: r246085 - in head/sys: amd64/linux32 compat/linprocfs compat/linux i386/linux Message-ID: <20130207194328.GA31364@dchagin.static.corbina.net> References: <201301291841.r0TIfUxs008927@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <201301291841.r0TIfUxs008927@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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 19:43:35 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 29, 2013 at 06:41:30PM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Jan 29 18:41:30 2013 > New Revision: 246085 > URL: http://svnweb.freebsd.org/changeset/base/246085 >=20 > Log: > Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h > by moving bits that are MI out into headers in compat/linux. > =20 > Reviewed by: Chagin Dmitry dmitry | gmail > MFC after: 2 weeks >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/amd64/linux32/linux.h Tue Jan 29 18:22:38 2013 (r246084) > +++ head/sys/amd64/linux32/linux.h Tue Jan 29 18:41:30 2013 (r246085) > @@ -107,11 +107,6 @@ typedef struct { > /* > * Miscellaneous > */ > -#define LINUX_NAME_MAX 255 > -#define LINUX_MAX_UTSNAME 65 > - > -#define LINUX_CTL_MAXNAME 10 > - > #define LINUX_AT_COUNT 16 /* Count of used aux entry types. > * Keep this synchronized with > * elf_linux_fixup() code. > @@ -127,11 +122,6 @@ struct l___sysctl_args > l_ulong __spare[4]; > } __packed; > =20 > -/* Scheduling policies */ > -#define LINUX_SCHED_OTHER 0 > -#define LINUX_SCHED_FIFO 1 > -#define LINUX_SCHED_RR 2 > - > /* Resource limits */ > #define LINUX_RLIMIT_CPU 0 > #define LINUX_RLIMIT_FSIZE 1 > @@ -265,15 +255,6 @@ struct l_statfs64 {=20 > l_int f_spare[6]; > } __packed; > =20 > -struct l_new_utsname { > - char sysname[LINUX_MAX_UTSNAME]; > - char nodename[LINUX_MAX_UTSNAME]; > - char release[LINUX_MAX_UTSNAME]; > - char version[LINUX_MAX_UTSNAME]; > - char machine[LINUX_MAX_UTSNAME]; > - char domainname[LINUX_MAX_UTSNAME]; > -} __packed; > - > /* > * Signalling > */ > @@ -535,27 +516,9 @@ struct l_rt_sigframe { > l_handler_t sf_handler; > } __packed; > =20 > -extern int bsd_to_linux_signal[]; > -extern int linux_to_bsd_signal[]; > extern struct sysentvec elf_linux_sysvec; > =20 > /* > - * Pluggable ioctl handlers > - */ > -struct linux_ioctl_args; > -struct thread; > - > -typedef int linux_ioctl_function_t(struct thread *, struct linux_ioctl_a= rgs *); > - > -struct linux_ioctl_handler { > - linux_ioctl_function_t *func; > - int low, high; > -}; > - > -int linux_ioctl_register_handler(struct linux_ioctl_handler *h); > -int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); > - > -/* > * open/fcntl flags > */ > #define LINUX_O_RDONLY 00000000 > @@ -597,65 +560,6 @@ int linux_ioctl_unregister_handler(struc > #define LINUX_F_WRLCK 1 > #define LINUX_F_UNLCK 2 > =20 > -/* > - * posix_fadvise advice > - */ > -#define LINUX_POSIX_FADV_NORMAL 0 > -#define LINUX_POSIX_FADV_RANDOM 1 > -#define LINUX_POSIX_FADV_SEQUENTIAL 2 > -#define LINUX_POSIX_FADV_WILLNEED 3 > -#define LINUX_POSIX_FADV_DONTNEED 4 > -#define LINUX_POSIX_FADV_NOREUSE 5 > - > -/* > - * mount flags > - */ > -#define LINUX_MS_RDONLY 0x0001 > -#define LINUX_MS_NOSUID 0x0002 > -#define LINUX_MS_NODEV 0x0004 > -#define LINUX_MS_NOEXEC 0x0008 > -#define LINUX_MS_REMOUNT 0x0020 > - > -/* > - * SystemV IPC defines > - */ > -#define LINUX_SEMOP 1 > -#define LINUX_SEMGET 2 > -#define LINUX_SEMCTL 3 > -#define LINUX_MSGSND 11 > -#define LINUX_MSGRCV 12 > -#define LINUX_MSGGET 13 > -#define LINUX_MSGCTL 14 > -#define LINUX_SHMAT 21 > -#define LINUX_SHMDT 22 > -#define LINUX_SHMGET 23 > -#define LINUX_SHMCTL 24 > - > -#define LINUX_IPC_RMID 0 > -#define LINUX_IPC_SET 1 > -#define LINUX_IPC_STAT 2 > -#define LINUX_IPC_INFO 3 > - > -#define LINUX_SHM_LOCK 11 > -#define LINUX_SHM_UNLOCK 12 > -#define LINUX_SHM_STAT 13 > -#define LINUX_SHM_INFO 14 > - > -#define LINUX_SHM_RDONLY 0x1000 > -#define LINUX_SHM_RND 0x2000 > -#define LINUX_SHM_REMAP 0x4000 > - > -/* semctl commands */ > -#define LINUX_GETPID 11 > -#define LINUX_GETVAL 12 > -#define LINUX_GETALL 13 > -#define LINUX_GETNCNT 14 > -#define LINUX_GETZCNT 15 > -#define LINUX_SETVAL 16 > -#define LINUX_SETALL 17 > -#define LINUX_SEM_STAT 18 > -#define LINUX_SEM_INFO 19 > - > union l_semun { > l_int val; > l_uintptr_t buf; > @@ -667,25 +571,6 @@ union l_semun { > /* > * Socket defines > */ > -#define LINUX_SOCKET 1 > -#define LINUX_BIND 2 > -#define LINUX_CONNECT 3 > -#define LINUX_LISTEN 4 > -#define LINUX_ACCEPT 5 > -#define LINUX_GETSOCKNAME 6 > -#define LINUX_GETPEERNAME 7 > -#define LINUX_SOCKETPAIR 8 > -#define LINUX_SEND 9 > -#define LINUX_RECV 10 > -#define LINUX_SENDTO 11 > -#define LINUX_RECVFROM 12 > -#define LINUX_SHUTDOWN 13 > -#define LINUX_SETSOCKOPT 14 > -#define LINUX_GETSOCKOPT 15 > -#define LINUX_SENDMSG 16 > -#define LINUX_RECVMSG 17 > -#define LINUX_ACCEPT4 18 > - > #define LINUX_SOL_SOCKET 1 > #define LINUX_SOL_IP 0 > #define LINUX_SOL_IPX 256 > @@ -714,24 +599,6 @@ union l_semun { > #define LINUX_SO_TIMESTAMP 29 > #define LINUX_SO_ACCEPTCONN 30 > =20 > -#define LINUX_IP_TOS 1 > -#define LINUX_IP_TTL 2 > -#define LINUX_IP_HDRINCL 3 > -#define LINUX_IP_OPTIONS 4 > - > -#define LINUX_IP_MULTICAST_IF 32 > -#define LINUX_IP_MULTICAST_TTL 33 > -#define LINUX_IP_MULTICAST_LOOP 34 > -#define LINUX_IP_ADD_MEMBERSHIP 35 > -#define LINUX_IP_DROP_MEMBERSHIP 36 > - > -#define LINUX_TCP_NODELAY 1 > -#define LINUX_TCP_MAXSEG 2 > -#define LINUX_TCP_KEEPIDLE 4 > -#define LINUX_TCP_KEEPINTVL 5 > -#define LINUX_TCP_KEEPCNT 6 > -#define LINUX_TCP_MD5SIG 14 > - > struct l_sockaddr { > l_ushort sa_family; > char sa_data[14]; > @@ -897,30 +764,6 @@ struct l_user_desc { > #define LINUX_GET_USEABLE(desc) \ > (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) > =20 > -#define LINUX_CLOCK_REALTIME 0 > -#define LINUX_CLOCK_MONOTONIC 1 > -#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 > -#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 > -#define LINUX_CLOCK_REALTIME_HR 4 > -#define LINUX_CLOCK_MONOTONIC_HR 5 > - > -#define LINUX_CLONE_VM 0x00000100 > -#define LINUX_CLONE_FS 0x00000200 > -#define LINUX_CLONE_FILES 0x00000400 > -#define LINUX_CLONE_SIGHAND 0x00000800 > -#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */ > -#define LINUX_CLONE_VFORK 0x00004000 > -#define LINUX_CLONE_PARENT 0x00008000 > -#define LINUX_CLONE_THREAD 0x00010000 > -#define LINUX_CLONE_SETTLS 0x00080000 > -#define LINUX_CLONE_PARENT_SETTID 0x00100000 > -#define LINUX_CLONE_CHILD_CLEARTID 0x00200000 > -#define LINUX_CLONE_CHILD_SETTID 0x01000000 > - > -#define LINUX_THREADING_FLAGS \ > - (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ > - LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) > - > struct iovec; > =20 > struct l_iovec32 { > @@ -942,7 +785,4 @@ struct linux_robust_list_head { > l_uintptr_t pending_list; > }; > =20 > -int linux_set_upcall_kse(struct thread *td, register_t stack); > -int linux_set_cloned_tls(struct thread *td, void *desc); > - > #endif /* !_AMD64_LINUX_H_ */ >=20 > Modified: head/sys/amd64/linux32/linux32_sysvec.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/amd64/linux32/linux32_sysvec.c Tue Jan 29 18:22:38 2013 (r24= 6084) > +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Jan 29 18:41:30 2013 (r24= 6085) > @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include ugh.., moving linux_ioctl_register_handler definition under compat/linux/linux_ioctl.h breaks x11/nvidia-driver build. so, don't merge while port not patched. chd, Have fun! --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlEUA+AACgkQ0t2Tb3OO/O0oaACgxURH/0j7u4ZWESQqYjRV3HFX ezkAnjcW+r3SxNrESLbt05UDiTBjtQDb =xPja -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:12:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8B39919; Thu, 7 Feb 2013 21:12:56 +0000 (UTC) (envelope-from monthadar@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 BAA4BE16; Thu, 7 Feb 2013 21:12: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 r17LCuqL007623; Thu, 7 Feb 2013 21:12:56 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LCuaY007621; Thu, 7 Feb 2013 21:12:56 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072112.r17LCuaY007621@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246497 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:12:56 -0000 Author: monthadar Date: Thu Feb 7 21:12:55 2013 New Revision: 246497 URL: http://svnweb.freebsd.org/changeset/base/246497 Log: Stop a mesh STA from flooding with peer frames. This problem happens when using ACL policy to filter mesh STA but two nodes have different policy. Then one of them will try to peer all the time. This can also help if for any reason one of the peering mesh STA have problems sending/receiving peer frames. * Modified struct ieee80211_node to include two new fields: + struct callout ni_mlhtimer /* link mesh backoff timer */ + uint8_t ni_mlhcnt /* link mesh holding counter */ * Added two new sysctl (check sysctl -d for more info): + net.wlan.mesh.backofftimeout=5000 + net.wlan.mesh.maxholding=2; * When receiving a beacon and we are in IEEE80211_NODE_MESH_IDLE check if ni_mlhcnt >= ieee80211_mesh_maxholding, if so do not do anything; * In mesh_peer_timeout_cb when transitioning from IEEE80211_NODE_MESH_HOLDING to IEEE80211_NODE_MESH_IDLE increment ni_mlhcnt, and eventually start ieee80211_mesh_backofftimeout; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_node.h Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 19:09:10 2013 (r246496) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:12:55 2013 (r246497) @@ -111,10 +111,20 @@ static int ieee80211_mesh_confirmtimeout SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, confirmtimeout, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_confirmtimeout, 0, ieee80211_sysctl_msecs_ticks, "I", "Confirm state timeout (msec)"); +static int ieee80211_mesh_backofftimeout = -1; +SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, backofftimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_backofftimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "Backoff timeout (msec). This is to throutles peering forever when " + "not receving answer or is rejected by a neighbor"); static int ieee80211_mesh_maxretries = 2; SYSCTL_INT(_net_wlan_mesh, OID_AUTO, maxretries, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_maxretries, 0, "Maximum retries during peer link establishment"); +static int ieee80211_mesh_maxholding = 2; +SYSCTL_INT(_net_wlan_mesh, OID_AUTO, maxholding, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_maxholding, 0, + "Maximum times we are allowed to transition to HOLDING state before " + "backinoff during peer link establishment"); static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -500,6 +510,7 @@ ieee80211_mesh_init(void) ieee80211_mesh_retrytimeout = msecs_to_ticks(40); ieee80211_mesh_holdingtimeout = msecs_to_ticks(40); ieee80211_mesh_confirmtimeout = msecs_to_ticks(40); + ieee80211_mesh_backofftimeout = msecs_to_ticks(5000); /* * Register action frame handlers. @@ -1696,7 +1707,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni } /* * Automatically peer with discovered nodes if possible. - * XXX backoff on repeated failure */ if (ni != vap->iv_bss && (ms->ms_flags & IEEE80211_MESHFLAGS_AP)) { @@ -1705,6 +1715,10 @@ mesh_recv_mgmt(struct ieee80211_node *ni { uint16_t args[1]; + /* Wait for backoff callout to reset counter */ + if (ni->ni_mlhcnt >= ieee80211_mesh_maxholding) + return; + ni->ni_mlpid = mesh_generateid(vap); if (ni->ni_mlpid == 0) return; @@ -2578,6 +2592,15 @@ mesh_peer_timeout_stop(struct ieee80211_ callout_drain(&ni->ni_mltimer); } +static void +mesh_peer_backoff_cb(void *arg) +{ + struct ieee80211_node *ni = (struct ieee80211_node *)arg; + + /* After backoff timeout, try to peer automatically again. */ + ni->ni_mlhcnt = 0; +} + /* * Mesh Peer Link Management FSM timeout handling. */ @@ -2625,6 +2648,11 @@ mesh_peer_timeout_cb(void *arg) mesh_peer_timeout_setup(ni); break; case IEEE80211_NODE_MESH_HOLDING: + ni->ni_mlhcnt++; + if (ni->ni_mlhcnt >= ieee80211_mesh_maxholding) + callout_reset(&ni->ni_mlhtimer, + ieee80211_mesh_backofftimeout, + mesh_peer_backoff_cb, ni); mesh_linkchange(ni, IEEE80211_NODE_MESH_IDLE); break; } @@ -2889,6 +2917,7 @@ ieee80211_mesh_node_init(struct ieee8021 { ni->ni_flags |= IEEE80211_NODE_QOS; callout_init(&ni->ni_mltimer, CALLOUT_MPSAFE); + callout_init(&ni->ni_mlhtimer, CALLOUT_MPSAFE); } /* @@ -2901,6 +2930,7 @@ ieee80211_mesh_node_cleanup(struct ieee8 struct ieee80211_mesh_state *ms = vap->iv_mesh; callout_drain(&ni->ni_mltimer); + callout_drain(&ni->ni_mlhtimer); /* NB: short-circuit callbacks after mesh_vdetach */ if (vap->iv_mesh != NULL) ms->ms_ppath->mpp_peerdown(ni); Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Thu Feb 7 19:09:10 2013 (r246496) +++ head/sys/net80211/ieee80211_node.h Thu Feb 7 21:12:55 2013 (r246497) @@ -204,6 +204,8 @@ struct ieee80211_node { struct callout ni_mltimer; /* link mesh timer */ uint8_t ni_mlrcnt; /* link mesh retry counter */ uint8_t ni_mltval; /* link mesh timer value */ + struct callout ni_mlhtimer; /* link mesh backoff timer */ + uint8_t ni_mlhcnt; /* link mesh holding counter */ /* 11n state */ uint16_t ni_htcap; /* HT capabilities */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:17:35 2013 Return-Path: Delivered-To: svn-src-all@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 B1864C92; Thu, 7 Feb 2013 21:17:35 +0000 (UTC) (envelope-from monthadar@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 A1D01E63; Thu, 7 Feb 2013 21:17: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 r17LHZfj008389; Thu, 7 Feb 2013 21:17:35 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LHZ7Z008388; Thu, 7 Feb 2013 21:17:35 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072117.r17LHZ7Z008388@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246498 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:17:35 -0000 Author: monthadar Date: Thu Feb 7 21:17:35 2013 New Revision: 246498 URL: http://svnweb.freebsd.org/changeset/base/246498 Log: Fix mesh path flag. * A bug occurs while in discovery mode which leaves a path marked with both Discover and Valid flag. This happens when receiving/sending PREQ and PREP in a particular order. Solution is to assign the Valid bit instead of oring it; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:12:55 2013 (r246497) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:17:35 2013 (r246498) @@ -995,8 +995,11 @@ hwmp_recv_preq(struct ieee80211vap *vap, rtorig->rt_metric = metric; rtorig->rt_nhops = preq->preq_hopcount + 1; ieee80211_mesh_rt_update(rtorig, preq->preq_lifetime); - /* path to orig is valid now */ - rtorig->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; + /* Path to orig is valid now. + * NB: we know it can't be Proxy, and if it is GATE + * it will be marked below. + */ + rtorig->rt_flags = IEEE80211_MESHRT_FLAGS_VALID; }else if ((hrtarg != NULL && HWMP_SEQ_EQ(hrtarg->hr_seq, PREQ_TSEQ(0)) && ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0)) || From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:18:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4EB3E0C; Thu, 7 Feb 2013 21:18:22 +0000 (UTC) (envelope-from monthadar@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 C5414E6E; Thu, 7 Feb 2013 21:18: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 r17LIMMI008538; Thu, 7 Feb 2013 21:18:22 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LIMjM008535; Thu, 7 Feb 2013 21:18:22 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072118.r17LIMjM008535@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246499 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:18:22 -0000 Author: monthadar Date: Thu Feb 7 21:18:22 2013 New Revision: 246499 URL: http://svnweb.freebsd.org/changeset/base/246499 Log: Add mesh debug for interarction between DS & MBSS. * Add mesh debug information when frames enter or leave the MBSS; * Set IEEE80211_MSG_OUTPUT bit to enable output; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:17:35 2013 (r246498) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:18:22 2013 (r246499) @@ -1246,6 +1246,9 @@ mesh_recv_indiv_data_to_me(struct ieee80 * All other cases: forward of MSDUs from the MBSS to DS indiv. * addressed according to 13.11.3.2. */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, qwh->i_addr2, + "forward frame to DS, SA(%6D) DA(%6D)", + mc10->mc_addr6, ":", mc10->mc_addr5, ":"); } return (0); /* process locally */ } Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Feb 7 21:17:35 2013 (r246498) +++ head/sys/net80211/ieee80211_output.c Thu Feb 7 21:18:22 2013 (r246499) @@ -262,6 +262,10 @@ ieee80211_start(struct ifnet *ifp) m_freem(m); continue; } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + "forward frame from DS SA(%6D), DA(%6D)\n", + eh->ether_dhost, ":", + eh->ether_shost, ":"); ieee80211_mesh_proxy_check(vap, eh->ether_shost); } ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:19:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A120FB9; Thu, 7 Feb 2013 21:19:45 +0000 (UTC) (envelope-from monthadar@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 3A350E89; Thu, 7 Feb 2013 21:19: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 r17LJjZi008749; Thu, 7 Feb 2013 21:19:45 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LJj4n008748; Thu, 7 Feb 2013 21:19:45 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072119.r17LJj4n008748@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246500 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:19:45 -0000 Author: monthadar Date: Thu Feb 7 21:19:44 2013 New Revision: 246500 URL: http://svnweb.freebsd.org/changeset/base/246500 Log: HWMP: Accept a PERR even if path is valid. * An HWMP PERR should be accepted even if path is valid. Because we check if we recevied it from a neighbour that we use as a next hop; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:18:22 2013 (r246499) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:19:44 2013 (r246500) @@ -1528,7 +1528,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, */ for (i = 0; i < perr->perr_ndests; i++) { rt = ieee80211_mesh_rt_find(vap, PERR_DADDR(i)); - if (rt == NULL || rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) + if (rt == NULL) continue; if (!IEEE80211_ADDR_EQ(rt->rt_nexthop, wh->i_addr2)) continue; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:20:29 2013 Return-Path: Delivered-To: svn-src-all@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 B5140231; Thu, 7 Feb 2013 21:20:29 +0000 (UTC) (envelope-from monthadar@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 8D2D2EA3; Thu, 7 Feb 2013 21:20: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 r17LKT3t009058; Thu, 7 Feb 2013 21:20:29 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LKTL9009056; Thu, 7 Feb 2013 21:20:29 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072120.r17LKTL9009056@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246501 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:20:29 -0000 Author: monthadar Date: Thu Feb 7 21:20:28 2013 New Revision: 246501 URL: http://svnweb.freebsd.org/changeset/base/246501 Log: Update net80211 mesh struct ieee80211_meshgann_ie. * Change all field prefix from pann_ to gann_; * Added IEEE80211_MESHGANN_BASE_SZ macro to be used in the length field of a GANN frame according to 802.11 standard; * Changed gann_seq field type to uint32_t; * Added a Gate Announcement interval field according to IEEE802.11 2012 standard; * Added IEEE80211_MESHRT_FLAGS_GATE as flag bit to ieee80211_mesh_route; * Added IEEE80211_MESHRT_FLAGS_GATE as flag bit to ieee80211req_mesh_route; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Thu Feb 7 21:19:44 2013 (r246500) +++ head/sys/net80211/ieee80211_ioctl.h Thu Feb 7 21:20:28 2013 (r246501) @@ -342,6 +342,7 @@ struct ieee80211req_mesh_route { #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01 #define IEEE80211_MESHRT_FLAGS_VALID 0x02 #define IEEE80211_MESHRT_FLAGS_PROXY 0x04 +#define IEEE80211_MESHRT_FLAGS_GATE 0x08 uint8_t imr_dest[IEEE80211_ADDR_LEN]; uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; uint16_t imr_nhops; Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:19:44 2013 (r246500) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:20:28 2013 (r246501) @@ -194,14 +194,20 @@ struct ieee80211_meshbeacont_ie { #endif /* Gate (GANN) Annoucement */ +/* + * NB: these macros used for the length in the IEs does not include 2 bytes + * for _ie and _len fields as is defined by the standard. + */ +#define IEEE80211_MESHGANN_BASE_SZ (15) struct ieee80211_meshgann_ie { - uint8_t pann_ie; /* IEEE80211_ELEMID_MESHGANN */ - uint8_t pann_len; - uint8_t pann_flags; - uint8_t pann_hopcount; - uint8_t pann_ttl; - uint8_t pann_addr[IEEE80211_ADDR_LEN]; - uint8_t pann_seq; /* PANN Sequence Number */ + uint8_t gann_ie; /* IEEE80211_ELEMID_MESHGANN */ + uint8_t gann_len; + uint8_t gann_flags; + uint8_t gann_hopcount; + uint8_t gann_ttl; + uint8_t gann_addr[IEEE80211_ADDR_LEN]; + uint32_t gann_seq; /* GANN Sequence Number */ + uint16_t gann_interval; /* GANN Interval */ } __packed; /* Root (MP) Annoucement */ @@ -423,6 +429,7 @@ struct ieee80211_mesh_route { #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01 /* path discovery */ #define IEEE80211_MESHRT_FLAGS_VALID 0x02 /* path discovery complete */ #define IEEE80211_MESHRT_FLAGS_PROXY 0x04 /* proxy entry */ +#define IEEE80211_MESHRT_FLAGS_GATE 0x08 /* mesh gate entry */ uint32_t rt_lifetime; /* route timeout */ uint32_t rt_lastmseq; /* last seq# seen dest */ uint32_t rt_ext_seq; /* proxy seq number */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:21:05 2013 Return-Path: Delivered-To: svn-src-all@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 E80B33AD; Thu, 7 Feb 2013 21:21:05 +0000 (UTC) (envelope-from monthadar@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 CE917EAE; Thu, 7 Feb 2013 21:21: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 r17LL5LK010595; Thu, 7 Feb 2013 21:21:05 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LL5Sk010594; Thu, 7 Feb 2013 21:21:05 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072121.r17LL5Sk010594@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246502 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:21:06 -0000 Author: monthadar Date: Thu Feb 7 21:21:05 2013 New Revision: 246502 URL: http://svnweb.freebsd.org/changeset/base/246502 Log: Update in ieee80211_action.c for mesh code handlers. * Removed meshlm_send_action and hwmp_send_action. Introduced one common for all Mesh Action frames meshaction_send_action. According to 802.11 standard Link Metric and HWMP are all under Mesh Action category; * Did similar changes to recv_action part; * The size of meshaction_*_action is set to 12. This is to make room for the rest of Mesh Action category subtypes; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_action.c Modified: head/sys/net80211/ieee80211_action.c ============================================================================== --- head/sys/net80211/ieee80211_action.c Thu Feb 7 21:20:28 2013 (r246501) +++ head/sys/net80211/ieee80211_action.c Thu Feb 7 21:21:05 2013 (r246502) @@ -67,10 +67,8 @@ static ieee80211_send_action_func *meshp send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, }; -static ieee80211_send_action_func *meshlm_send_action[4] = { +static ieee80211_send_action_func *meshaction_send_action[12] = { send_inval, send_inval, send_inval, send_inval, -}; -static ieee80211_send_action_func *hwmp_send_action[8] = { send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, }; @@ -100,18 +98,10 @@ ieee80211_send_action_register(int cat, meshpl_send_action[act] = f; return 0; case IEEE80211_ACTION_CAT_MESH: - switch (act) { - case IEEE80211_ACTION_MESH_LMETRIC: - if (act >= N(meshlm_send_action)) - break; - meshlm_send_action[act] = f; - return 0; - case IEEE80211_ACTION_MESH_HWMP: - if (act >= N(hwmp_send_action)) - break; - hwmp_send_action[act] = f; - return 0; - } + if (act >= N(meshaction_send_action)) + break; + meshaction_send_action[act] = f; + return 0; break; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_send_action)) @@ -149,16 +139,8 @@ ieee80211_send_action(struct ieee80211_n f = meshpl_send_action[act]; break; case IEEE80211_ACTION_CAT_MESH: - switch (act) { - case IEEE80211_ACTION_MESH_LMETRIC: - if (act < N(meshlm_send_action)) - f = meshlm_send_action[act]; - break; - case IEEE80211_ACTION_MESH_HWMP: - if (act < N(hwmp_send_action)) - f = hwmp_send_action[act]; - break; - } + if (act < N(meshaction_send_action)) + f = meshaction_send_action[act]; break; case IEEE80211_ACTION_CAT_VENDOR: if (act < N(vendor_send_action)) @@ -188,10 +170,8 @@ static ieee80211_recv_action_func *meshp recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, }; -static ieee80211_recv_action_func *meshlm_recv_action[4] = { +static ieee80211_recv_action_func *meshaction_recv_action[12] = { recv_inval, recv_inval, recv_inval, recv_inval, -}; -static ieee80211_recv_action_func *hwmp_recv_action[8] = { recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, }; @@ -221,19 +201,10 @@ ieee80211_recv_action_register(int cat, meshpl_recv_action[act] = f; return 0; case IEEE80211_ACTION_CAT_MESH: - switch (act) { - case IEEE80211_ACTION_MESH_LMETRIC: - if (act >= N(meshlm_recv_action)) - break; - meshlm_recv_action[act] = f; - return 0; - case IEEE80211_ACTION_MESH_HWMP: - if (act >= N(hwmp_recv_action)) - break; - hwmp_recv_action[act] = f; - return 0; - } - break; + if (act >= N(meshaction_recv_action)) + break; + meshaction_recv_action[act] = f; + return 0; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_recv_action)) break; @@ -274,16 +245,8 @@ ieee80211_recv_action(struct ieee80211_n f = meshpl_recv_action[ia->ia_action]; break; case IEEE80211_ACTION_CAT_MESH: - switch (ia->ia_action) { - case IEEE80211_ACTION_MESH_LMETRIC: - if (ia->ia_action < N(meshlm_recv_action)) - f = meshlm_recv_action[ia->ia_action]; - break; - case IEEE80211_ACTION_MESH_HWMP: - if (ia->ia_action < N(hwmp_recv_action)) - f = hwmp_recv_action[ia->ia_action]; - break; - } + if (ia->ia_action < N(meshaction_recv_action)) + f = meshaction_recv_action[ia->ia_action]; break; case IEEE80211_ACTION_CAT_VENDOR: if (ia->ia_action < N(vendor_recv_action)) From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:21:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B909B52E; Thu, 7 Feb 2013 21:21:41 +0000 (UTC) (envelope-from monthadar@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 920BEEBA; Thu, 7 Feb 2013 21:21: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 r17LLfp7010705; Thu, 7 Feb 2013 21:21:41 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LLfOk010703; Thu, 7 Feb 2013 21:21:41 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072121.r17LLfOk010703@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246503 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:21:41 -0000 Author: monthadar Date: Thu Feb 7 21:21:40 2013 New Revision: 246503 URL: http://svnweb.freebsd.org/changeset/base/246503 Log: Mesh: management mesh action frames are to be discarded when not peered. * Modified ieee80211_recv_action to check if neighbour is peered for IEEE80211_ACTION_CAT_MESH frames, if not frame is discarded. This is according to IEEE802.11 2012 standard; * Removed duplicate checks in each hwmp_recv_* handlers because HWMP is a subtype of mesh action; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_action.c head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_action.c ============================================================================== --- head/sys/net80211/ieee80211_action.c Thu Feb 7 21:21:05 2013 (r246502) +++ head/sys/net80211/ieee80211_action.c Thu Feb 7 21:21:40 2013 (r246503) @@ -228,6 +228,7 @@ ieee80211_recv_action(struct ieee80211_n { #define N(a) (sizeof(a) / sizeof(a[0])) ieee80211_recv_action_func *f = recv_inval; + struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_action *ia = (const struct ieee80211_action *) frm; @@ -245,6 +246,15 @@ ieee80211_recv_action(struct ieee80211_n f = meshpl_recv_action[ia->ia_action]; break; case IEEE80211_ACTION_CAT_MESH: + if (ni == vap->iv_bss || + ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, + ni->ni_macaddr, NULL, + "peer link not yet established (%d), cat %s act %u", + ni->ni_mlstate, "mesh action", ia->ia_action); + vap->iv_stats.is_mesh_nolink++; + break; + } if (ia->ia_action < N(meshaction_recv_action)) f = meshaction_recv_action[ia->ia_action]; break; Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:21:05 2013 (r246502) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:21:40 2013 (r246503) @@ -914,9 +914,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, ieee80211_hwmp_seq preqid; /* last seen preqid for orig */ uint32_t metric = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; /* * Ignore PREQs from us. Could happen because someone forward it * back to us. @@ -1233,10 +1230,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, int is_encap; struct ieee80211_node *ni_encap; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", prep->prep_targetaddr, ":"); @@ -1505,10 +1498,6 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_meshperr_ie *pperr = NULL; int i, j = 0, forward = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) - return; - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PERR from %6D", wh->i_addr2, ":"); @@ -1712,9 +1701,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_meshrann_ie prann; uint32_t metric = 0; - if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED || - IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) + if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) return; rt = ieee80211_mesh_rt_find(vap, rann->rann_addr); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:22:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9B146AA; Thu, 7 Feb 2013 21:22:14 +0000 (UTC) (envelope-from monthadar@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 D5F91EC7; Thu, 7 Feb 2013 21:22: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 r17LMELq010854; Thu, 7 Feb 2013 21:22:14 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LMEkb010853; Thu, 7 Feb 2013 21:22:14 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072122.r17LMEkb010853@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246504 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:22:15 -0000 Author: monthadar Date: Thu Feb 7 21:22:14 2013 New Revision: 246504 URL: http://svnweb.freebsd.org/changeset/base/246504 Log: Start accepting IEEE80211_ACTION_MESH_GANN frames; * Add IEEE80211_ACTION_MESH_GANN Action frame verification in ieee80211_parse_action; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Feb 7 21:21:40 2013 (r246503) +++ head/sys/net80211/ieee80211_input.c Thu Feb 7 21:22:14 2013 (r246504) @@ -776,6 +776,10 @@ ieee80211_parse_action(struct ieee80211_ /* verify something */ break; case IEEE80211_ACTION_MESH_GANN: + IEEE80211_VERIFY_LENGTH(efrm - frm, + sizeof(struct ieee80211_meshgann_ie), + return EINVAL); + break; case IEEE80211_ACTION_MESH_CC: case IEEE80211_ACTION_MESH_MCCA_SREQ: case IEEE80211_ACTION_MESH_MCCA_SREP: From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:23:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB62C83B; Thu, 7 Feb 2013 21:23:03 +0000 (UTC) (envelope-from monthadar@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 C6D21EDE; Thu, 7 Feb 2013 21:23:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17LN3A8010992; Thu, 7 Feb 2013 21:23:03 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LN3Uu010991; Thu, 7 Feb 2013 21:23:03 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072123.r17LN3Uu010991@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246505 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:23:03 -0000 Author: monthadar Date: Thu Feb 7 21:23:03 2013 New Revision: 246505 URL: http://svnweb.freebsd.org/changeset/base/246505 Log: Mark a mesh path to a mesh gate with a 'G'. Approved by: adrian (mentor) Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Feb 7 21:22:14 2013 (r246504) +++ head/sbin/ifconfig/ifieee80211.c Thu Feb 7 21:23:03 2013 (r246505) @@ -4025,7 +4025,9 @@ list_mesh(int s) (rt->imr_flags & IEEE80211_MESHRT_FLAGS_VALID) ? 'V' : '!', (rt->imr_flags & IEEE80211_MESHRT_FLAGS_PROXY) ? - 'P' : ' '); + 'P' : + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_GATE) ? + 'G' :' '); } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:23:44 2013 Return-Path: Delivered-To: svn-src-all@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 8EFBA9C0; Thu, 7 Feb 2013 21:23:44 +0000 (UTC) (envelope-from monthadar@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 705CBEED; Thu, 7 Feb 2013 21:23: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 r17LNiU5011121; Thu, 7 Feb 2013 21:23:44 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LNiJI011118; Thu, 7 Feb 2013 21:23:44 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072123.r17LNiJI011118@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246506 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:23:44 -0000 Author: monthadar Date: Thu Feb 7 21:23:43 2013 New Revision: 246506 URL: http://svnweb.freebsd.org/changeset/base/246506 Log: Mesh update: add base Mesh Gate functionality. A Mesh Gate should transmit a Mesh Action frame containing ieee80211_meshgann_ie as its only information element periodically every ieee80211_mesh_gateint ms. Unless the mesh gate is also configure as a ROOT, then these frames should not be send. This is according to 802.11 2012 standard; * Introduce new SYSCTL net.wlan.mesh.gateint, with 10s default; * Add two new functions mesh_gatemode_setup and mesh_gatemode_cb. This is similar to how HWMP setups up a callout; * Add two new action handlers mesh_recv_action_meshgate and mesh_send_action_meshgate; * Added ieee80211_add_meshgate to ieee80211_mesh.h; * Modified mesh_send_action to look similar to hwmp_send_action. This is because we need to send out broadcast management frames. * Introduced a new flag for mesh state IEEE80211_MESHFLAGS_ROOT. This flag is now set by HWMP code when a mesh STA is configured as a ROOT. This is then checked by mesh_gatemode_cb before scheduling a new callout; * Added to new field to ieee80211_mesh_state: + struct callout ms_gatetimer + ieee80211_mesh_seq ms_gateseq; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:23:03 2013 (r246505) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:23:43 2013 (r246506) @@ -805,19 +805,23 @@ static void hwmp_rootmode_setup(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; + struct ieee80211_mesh_state *ms = vap->iv_mesh; switch (hs->hs_rootmode) { case IEEE80211_HWMP_ROOTMODE_DISABLED: callout_drain(&hs->hs_roottimer); + ms->ms_flags &= ~IEEE80211_MESHFLAGS_ROOT; break; case IEEE80211_HWMP_ROOTMODE_NORMAL: case IEEE80211_HWMP_ROOTMODE_PROACTIVE: callout_reset(&hs->hs_roottimer, ieee80211_hwmp_rootint, hwmp_rootmode_cb, vap); + ms->ms_flags |= IEEE80211_MESHFLAGS_ROOT; break; case IEEE80211_HWMP_ROOTMODE_RANN: callout_reset(&hs->hs_roottimer, ieee80211_hwmp_rannint, hwmp_rootmode_rann_cb, vap); + ms->ms_flags |= IEEE80211_MESHFLAGS_ROOT; break; } } Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:23:03 2013 (r246505) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:23:43 2013 (r246506) @@ -68,6 +68,8 @@ static int mesh_select_proto_metric(stru static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void mesh_rt_cleanup_cb(void *); +static void mesh_gatemode_setup(struct ieee80211vap *); +static void mesh_gatemode_cb(void *); static void mesh_linkchange(struct ieee80211_node *, enum ieee80211_mesh_mlstate); static void mesh_checkid(void *, struct ieee80211_node *); @@ -99,6 +101,10 @@ uint32_t mesh_airtime_calc(struct ieee80 */ static SYSCTL_NODE(_net_wlan, OID_AUTO, mesh, CTLFLAG_RD, 0, "IEEE 802.11s parameters"); +static int ieee80211_mesh_gateint = -1; +SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, gateint, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_gateint, 0, ieee80211_sysctl_msecs_ticks, "I", + "mesh gate interval (ms)"); static int ieee80211_mesh_retrytimeout = -1; SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, retrytimeout, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_retrytimeout, 0, ieee80211_sysctl_msecs_ticks, "I", @@ -133,11 +139,13 @@ static ieee80211_recv_action_func mesh_r static ieee80211_recv_action_func mesh_recv_action_meshpeering_confirm; static ieee80211_recv_action_func mesh_recv_action_meshpeering_close; static ieee80211_recv_action_func mesh_recv_action_meshlmetric; +static ieee80211_recv_action_func mesh_recv_action_meshgate; static ieee80211_send_action_func mesh_send_action_meshpeering_open; static ieee80211_send_action_func mesh_send_action_meshpeering_confirm; static ieee80211_send_action_func mesh_send_action_meshpeering_close; static ieee80211_send_action_func mesh_send_action_meshlmetric; +static ieee80211_send_action_func mesh_send_action_meshgate; static const struct ieee80211_mesh_proto_metric mesh_metric_airtime = { .mpm_descr = "AIRTIME", @@ -498,6 +506,48 @@ mesh_select_proto_metric(struct ieee8021 #undef N static void +mesh_gatemode_setup(struct ieee80211vap *vap) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + + /* + * NB: When a mesh gate is running as a ROOT it shall + * not send out periodic GANNs but instead mark the + * mesh gate flag for the corresponding proactive PREQ + * and RANN frames. + */ + if (ms->ms_flags & IEEE80211_MESHFLAGS_ROOT || + (ms->ms_flags & IEEE80211_MESHFLAGS_GATE) == 0) { + callout_drain(&ms->ms_gatetimer); + return ; + } + callout_reset(&ms->ms_gatetimer, ieee80211_mesh_gateint, + mesh_gatemode_cb, vap); +} + +static void +mesh_gatemode_cb(void *arg) +{ + struct ieee80211vap *vap = (struct ieee80211vap *)arg; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_meshgann_ie gann; + + IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, vap->iv_bss, + "%s", "send broadcast GANN"); + + gann.gann_flags = 0; /* Reserved */ + gann.gann_hopcount = 0; + gann.gann_ttl = ms->ms_ttl; + IEEE80211_ADDR_COPY(gann.gann_addr, vap->iv_myaddr); + gann.gann_seq = ms->ms_gateseq++; + gann.gann_interval = ieee80211_mesh_gateint; + + ieee80211_send_action(vap->iv_bss, IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_GANN, &gann); + mesh_gatemode_setup(vap); +} + +static void ieee80211_mesh_init(void) { @@ -507,6 +557,7 @@ ieee80211_mesh_init(void) /* * Setup mesh parameters that depends on the clock frequency. */ + ieee80211_mesh_gateint = msecs_to_ticks(10000); ieee80211_mesh_retrytimeout = msecs_to_ticks(40); ieee80211_mesh_holdingtimeout = msecs_to_ticks(40); ieee80211_mesh_confirmtimeout = msecs_to_ticks(40); @@ -526,6 +577,8 @@ ieee80211_mesh_init(void) mesh_recv_action_meshpeering_close); ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESH, IEEE80211_ACTION_MESH_LMETRIC, mesh_recv_action_meshlmetric); + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_GANN, mesh_recv_action_meshgate); ieee80211_send_action_register(IEEE80211_ACTION_CAT_SELF_PROT, IEEE80211_ACTION_MESHPEERING_OPEN, @@ -539,6 +592,9 @@ ieee80211_mesh_init(void) ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESH, IEEE80211_ACTION_MESH_LMETRIC, mesh_send_action_meshlmetric); + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_GANN, + mesh_send_action_meshgate); /* * Register Airtime Link Metric. @@ -617,6 +673,8 @@ mesh_vattach(struct ieee80211vap *vap) TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); callout_init(&ms->ms_cleantimer, CALLOUT_MPSAFE); + callout_init(&ms->ms_gatetimer, CALLOUT_MPSAFE); + ms->ms_gateseq = 0; mesh_select_proto_metric(vap, "AIRTIME"); KASSERT(ms->ms_pmetric, ("ms_pmetric == NULL")); mesh_select_proto_path(vap, "HWMP"); @@ -645,8 +703,10 @@ mesh_newstate(struct ieee80211vap *vap, if (ostate != IEEE80211_S_SCAN) ieee80211_cancel_scan(vap); /* background scan */ ni = vap->iv_bss; /* NB: no reference held */ - if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) + if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) { callout_drain(&ms->ms_cleantimer); + callout_drain(&ms->ms_gatetimer); + } switch (nstate) { case IEEE80211_S_INIT: switch (ostate) { @@ -771,6 +831,7 @@ mesh_newstate(struct ieee80211vap *vap, ieee80211_node_authorize(vap->iv_bss); callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact, mesh_rt_cleanup_cb, vap); + mesh_gatemode_setup(vap); break; default: break; @@ -2300,19 +2361,77 @@ mesh_recv_action_meshlmetric(struct ieee return 0; } +/* + * Mesh Gate Announcement handling. + */ +static int +mesh_recv_action_meshgate(struct ieee80211_node *ni, + const struct ieee80211_frame *wh, + const uint8_t *frm, const uint8_t *efrm) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_mesh_route *rt_gate; + const struct ieee80211_meshgann_ie *ie = + (const struct ieee80211_meshgann_ie *) + (frm+2); /* action + code */ + + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, + "%s", "received GANN from meshgate"); + + rt_gate = ieee80211_mesh_rt_find(vap, ie->gann_addr); + if (rt_gate != NULL && + rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) + rt_gate->rt_flags |= IEEE80211_MESHRT_FLAGS_GATE; + + return 0; +} + static int -mesh_send_action(struct ieee80211_node *ni, struct mbuf *m) +mesh_send_action(struct ieee80211_node *ni, + const uint8_t sa[IEEE80211_ADDR_LEN], + const uint8_t da[IEEE80211_ADDR_LEN], + struct mbuf *m) { + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; struct ieee80211_bpf_params params; + struct ieee80211_frame *wh; + + KASSERT(ni != NULL, ("null node")); + + if (vap->iv_state == IEEE80211_S_CAC) { + IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT, ni, + "block %s frame in CAC state", "Mesh action"); + vap->iv_stats.is_tx_badstate++; + ieee80211_free_node(ni); + m_freem(m); + return EIO; /* XXX */ + } + + M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + if (m == NULL) { + ieee80211_free_node(ni); + return ENOMEM; + } + + wh = mtod(m, struct ieee80211_frame *); + ieee80211_send_setup(ni, m, + IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, + IEEE80211_NONQOS_TID, sa, da, sa); + m->m_flags |= M_ENCAP; /* mark encapsulated */ memset(¶ms, 0, sizeof(params)); params.ibp_pri = WME_AC_VO; params.ibp_rate0 = ni->ni_txparms->mgmtrate; - /* XXX ucast/mcast */ - params.ibp_try0 = ni->ni_txparms->maxretry; + if (IEEE80211_IS_MULTICAST(da)) + params.ibp_try0 = 1; + else + params.ibp_try0 = ni->ni_txparms->maxretry; params.ibp_power = ni->ni_txpower; - return ieee80211_mgmt_output(ni, m, IEEE80211_FC0_SUBTYPE_ACTION, - ¶ms); + + IEEE80211_NODE_STAT(ni, tx_mgmt); + + return ic->ic_raw_xmit(ni, m, ¶ms); } #define ADDSHORT(frm, v) do { \ @@ -2380,7 +2499,7 @@ mesh_send_action_meshpeering_open(struct frm = ieee80211_add_meshpeer(frm, IEEE80211_ACTION_MESHPEERING_OPEN, args[0], 0, 0); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - return mesh_send_action(ni, m); + return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); } else { vap->iv_stats.is_tx_nobuf++; ieee80211_free_node(ni); @@ -2448,7 +2567,7 @@ mesh_send_action_meshpeering_confirm(str IEEE80211_ACTION_MESHPEERING_CONFIRM, args[0], args[1], 0); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - return mesh_send_action(ni, m); + return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); } else { vap->iv_stats.is_tx_nobuf++; ieee80211_free_node(ni); @@ -2497,7 +2616,7 @@ mesh_send_action_meshpeering_close(struc IEEE80211_ACTION_MESHPEERING_CLOSE, args[0], args[1], args[2]); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - return mesh_send_action(ni, m); + return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); } else { vap->iv_stats.is_tx_nobuf++; ieee80211_free_node(ni); @@ -2545,7 +2664,46 @@ mesh_send_action_meshlmetric(struct ieee frm = ieee80211_add_meshlmetric(frm, ie->lm_flags, ie->lm_metric); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - return mesh_send_action(ni, m); + return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); + } else { + vap->iv_stats.is_tx_nobuf++; + ieee80211_free_node(ni); + return ENOMEM; + } +} + +static int +mesh_send_action_meshgate(struct ieee80211_node *ni, + int category, int action, void *arg0) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_meshgann_ie *ie = arg0; + struct mbuf *m; + uint8_t *frm; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, + "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__, + ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); + ieee80211_ref_node(ni); + + m = ieee80211_getmgtframe(&frm, + ic->ic_headroom + sizeof(struct ieee80211_frame), + sizeof(uint16_t) + /* action+category */ + IEEE80211_MESHGANN_BASE_SZ + ); + if (m != NULL) { + /* + * mesh link metric + * [1] category + * [1] action + * [tlv] mesh gate annoucement + */ + *frm++ = category; + *frm++ = action; + frm = ieee80211_add_meshgate(frm, ie); + m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); + return mesh_send_action(ni, vap->iv_myaddr, broadcastaddr, m); } else { vap->iv_stats.is_tx_nobuf++; ieee80211_free_node(ni); @@ -2909,6 +3067,24 @@ ieee80211_add_meshlmetric(uint8_t *frm, ADDWORD(frm, metric); return frm; } + +/* + * Add a Mesh Gate Announcement IE to a frame. + */ +uint8_t * +ieee80211_add_meshgate(uint8_t *frm, struct ieee80211_meshgann_ie *ie) +{ + *frm++ = IEEE80211_ELEMID_MESHGANN; /* ie */ + *frm++ = IEEE80211_MESHGANN_BASE_SZ; /* len */ + *frm++ = ie->gann_flags; + *frm++ = ie->gann_hopcount; + *frm++ = ie->gann_ttl; + IEEE80211_ADDR_COPY(frm, ie->gann_addr); + frm += 6; + ADDWORD(frm, ie->gann_seq); + ADDSHORT(frm, ie->gann_interval); + return frm; +} #undef ADDSHORT #undef ADDWORD @@ -3113,6 +3289,7 @@ mesh_ioctl_set80211(struct ieee80211vap ms->ms_flags |= IEEE80211_MESHFLAGS_FWD; else ms->ms_flags &= ~IEEE80211_MESHFLAGS_FWD; + mesh_gatemode_setup(vap); break; case IEEE80211_IOC_MESH_GATE: if (ireq->i_val) Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:23:03 2013 (r246505) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:23:43 2013 (r246506) @@ -502,9 +502,12 @@ struct ieee80211_mesh_state { #define IEEE80211_MESHFLAGS_AP 0x01 /* accept peers */ #define IEEE80211_MESHFLAGS_GATE 0x02 /* mesh gate role */ #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */ +#define IEEE80211_MESHFLAGS_ROOT 0x08 /* configured as root */ uint8_t ms_flags; struct mtx ms_rt_lock; struct callout ms_cleantimer; + struct callout ms_gatetimer; + ieee80211_mesh_seq ms_gateseq; TAILQ_HEAD(, ieee80211_mesh_route) ms_routes; struct ieee80211_mesh_proto_metric *ms_pmetric; struct ieee80211_mesh_proto_path *ms_ppath; @@ -537,6 +540,8 @@ uint8_t * ieee80211_add_meshconf(uint8_t uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t, uint16_t); uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint8_t, uint32_t); +uint8_t * ieee80211_add_meshgate(uint8_t *, + struct ieee80211_meshgann_ie *); void ieee80211_mesh_node_init(struct ieee80211vap *, struct ieee80211_node *); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:24:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AD508B33; Thu, 7 Feb 2013 21:24:10 +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 9CD7BEF5; Thu, 7 Feb 2013 21:24: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 r17LOAvG011228; Thu, 7 Feb 2013 21:24:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LOAc3011227; Thu, 7 Feb 2013 21:24:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302072124.r17LOAc3011227@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 7 Feb 2013 21:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246507 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:24:10 -0000 Author: jilles Date: Thu Feb 7 21:24:10 2013 New Revision: 246507 URL: http://svnweb.freebsd.org/changeset/base/246507 Log: sh: Fix a comment. Modified: head/bin/sh/parser.h Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Thu Feb 7 21:23:43 2013 (r246506) +++ head/bin/sh/parser.h Thu Feb 7 21:24:10 2013 (r246507) @@ -39,7 +39,7 @@ #define CTLENDVAR '\371' #define CTLBACKQ '\372' #define CTLQUOTE 01 /* ored with CTLBACKQ code if in quotes */ -/* CTLBACKQ | CTLQUOTE == '\205' */ +/* CTLBACKQ | CTLQUOTE == '\373' */ #define CTLARI '\374' #define CTLENDARI '\375' #define CTLQUOTEMARK '\376' From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:24:20 2013 Return-Path: Delivered-To: svn-src-all@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 E3FE8C8A; Thu, 7 Feb 2013 21:24:20 +0000 (UTC) (envelope-from monthadar@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 C639CEFB; Thu, 7 Feb 2013 21:24: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 r17LOKPP011295; Thu, 7 Feb 2013 21:24:20 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LOKgb011293; Thu, 7 Feb 2013 21:24:20 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072124.r17LOKgb011293@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246508 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:24:21 -0000 Author: monthadar Date: Thu Feb 7 21:24:20 2013 New Revision: 246508 URL: http://svnweb.freebsd.org/changeset/base/246508 Log: Propagate GANN frames, and store know gate info. * Modified mesh_recv_action_meshgate to do following: + if mesh STA already knows the mesh gate of the recevied GANN frame + if mesh gate is know, check seq number according to 802.11 standard + if mesh gate is not know, add it to the list of known mesh gates + if forwarding is enabled and ttl >= 1 then propagate the GANN frame; * Declare a new malloc type M_80211_MESH_GT_RT; * Declare a struct to store GANN information, ieee80211_mesh_gate_route. And add it as a TAILQ list to ieee80211_mesh_state; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:24:10 2013 (r246507) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:24:20 2013 (r246508) @@ -171,7 +171,8 @@ MALLOC_DEFINE(M_80211_MESH_PERR, "80211p /* The longer one of the lifetime should be stored as new lifetime */ #define MESH_ROUTE_LIFETIME_MAX(a, b) (a > b ? a : b) -MALLOC_DEFINE(M_80211_MESH_RT, "80211mesh", "802.11s routing table"); +MALLOC_DEFINE(M_80211_MESH_RT, "80211mesh_rt", "802.11s routing table"); +MALLOC_DEFINE(M_80211_MESH_GT_RT, "80211mesh_gt", "802.11s known gates table"); /* * Helper functions to manipulate the Mesh routing table. @@ -670,6 +671,7 @@ mesh_vattach(struct ieee80211vap *vap) ms->ms_seq = 0; ms->ms_flags = (IEEE80211_MESHFLAGS_AP | IEEE80211_MESHFLAGS_FWD); ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL; + TAILQ_INIT(&ms->ms_known_gates); TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); callout_init(&ms->ms_cleantimer, CALLOUT_MPSAFE); @@ -2370,18 +2372,78 @@ mesh_recv_action_meshgate(struct ieee802 const uint8_t *frm, const uint8_t *efrm) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_gate_route *gr, *next; struct ieee80211_mesh_route *rt_gate; + struct ieee80211_meshgann_ie pgann; + int found = 0; const struct ieee80211_meshgann_ie *ie = (const struct ieee80211_meshgann_ie *) (frm+2); /* action + code */ - IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, - "%s", "received GANN from meshgate"); + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ie->gann_addr)) + return 0; + + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ni->ni_macaddr, + "received GANN, meshgate: %6D (seq %u)", ie->gann_addr, ":", + ie->gann_seq); + + if (ms == NULL) + return (0); + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(gr, &ms->ms_known_gates, gr_next, next) { + if (!IEEE80211_ADDR_EQ(gr->gr_addr, ie->gann_addr)) + continue; + if (ie->gann_seq <= gr->gr_lastseq) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, + ni->ni_macaddr, NULL, + "GANN old seqno %u <= %u", + ie->gann_seq, gr->gr_lastseq); + MESH_RT_UNLOCK(ms); + return (0); + } + /* corresponding mesh gate found & GANN accepted */ + found = 1; + break; + + } + if (found == 0) { + /* this GANN is from a new mesh Gate add it to known table. */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, + "stored new GANN information, seq %u.", ie->gann_seq); + gr = malloc(ALIGN(sizeof(struct ieee80211_mesh_gate_route)), + M_80211_MESH_GT_RT, M_NOWAIT | M_ZERO); + IEEE80211_ADDR_COPY(gr->gr_addr, ie->gann_addr); + TAILQ_INSERT_TAIL(&ms->ms_known_gates, gr, gr_next); + } + gr->gr_lastseq = ie->gann_seq; - rt_gate = ieee80211_mesh_rt_find(vap, ie->gann_addr); + /* check if we have a path to this gate */ + rt_gate = mesh_rt_find_locked(ms, gr->gr_addr); if (rt_gate != NULL && - rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) + rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) { + gr->gr_route = rt_gate; rt_gate->rt_flags |= IEEE80211_MESHRT_FLAGS_GATE; + } + + MESH_RT_UNLOCK(ms); + + /* popagate only if decremented ttl >= 1 && forwarding is enabled */ + if ((ie->gann_ttl - 1) < 1 && + !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) + return 0; + pgann.gann_flags = ie->gann_flags; /* Reserved */ + pgann.gann_hopcount = ie->gann_hopcount + 1; + pgann.gann_ttl = ie->gann_ttl - 1; + IEEE80211_ADDR_COPY(pgann.gann_addr, ie->gann_addr); + pgann.gann_seq = ie->gann_seq; + pgann.gann_interval = ie->gann_interval; + + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, + "%s", "propagate GANN"); + + ieee80211_send_action(vap->iv_bss, IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_GANN, &pgann); return 0; } Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:24:10 2013 (r246507) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:24:20 2013 (r246508) @@ -405,6 +405,7 @@ MALLOC_DECLARE(M_80211_MESH_PREP); MALLOC_DECLARE(M_80211_MESH_PERR); MALLOC_DECLARE(M_80211_MESH_RT); +MALLOC_DECLARE(M_80211_MESH_GT_RT); /* * Basic forwarding information: * o Destination MAC @@ -437,6 +438,16 @@ struct ieee80211_mesh_route { }; #define IEEE80211_MESH_ROUTE_PRIV(rt, cast) ((cast *)rt->rt_priv) +/* + * Stored information about known mesh gates. + */ +struct ieee80211_mesh_gate_route { + TAILQ_ENTRY(ieee80211_mesh_gate_route) gr_next; + uint8_t gr_addr[IEEE80211_ADDR_LEN]; + uint32_t gr_lastseq; + struct ieee80211_mesh_route *gr_route; +}; + #define IEEE80211_MESH_PROTO_DSZ 12 /* description size */ /* * Mesh Path Selection Protocol. @@ -508,6 +519,7 @@ struct ieee80211_mesh_state { struct callout ms_cleantimer; struct callout ms_gatetimer; ieee80211_mesh_seq ms_gateseq; + TAILQ_HEAD(, ieee80211_mesh_gate_route) ms_known_gates; TAILQ_HEAD(, ieee80211_mesh_route) ms_routes; struct ieee80211_mesh_proto_metric *ms_pmetric; struct ieee80211_mesh_proto_path *ms_ppath; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:24:53 2013 Return-Path: Delivered-To: svn-src-all@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 63705E24; Thu, 7 Feb 2013 21:24:53 +0000 (UTC) (envelope-from monthadar@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 538CBF09; Thu, 7 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 r17LOrS4011409; Thu, 7 Feb 2013 21:24:53 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LOqp1011406; Thu, 7 Feb 2013 21:24:52 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072124.r17LOqp1011406@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 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: r246509 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:24:53 -0000 Author: monthadar Date: Thu Feb 7 21:24:52 2013 New Revision: 246509 URL: http://svnweb.freebsd.org/changeset/base/246509 Log: Mark root mesh as gate when mesh gate flag set. * Add function ieee80211_mesh_mark_gate in ieee80211_mesh.h; * When received a proactive PREQ or RANN with corresponding mesh gate flag set, create a new entry in the known mesh gate list; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:24:20 2013 (r246508) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:24:52 2013 (r246509) @@ -1092,6 +1092,16 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "root mesh station @ %6D", preq->preq_origaddr, ":"); + /* Check if root is a mesh gate, mark it */ + if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_GATE) { + struct ieee80211_mesh_gate_route *gr; + + rtorig->rt_flags |= IEEE80211_MESHRT_FLAGS_GATE; + gr = ieee80211_mesh_mark_gate(vap, preq->preq_origaddr, + rtorig); + gr->gr_lastseq = 0; /* NOT GANN */ + } + /* * Reply with a PREP if we don't have a path to the root * or if the root sent us a proactive PREQ. @@ -1745,6 +1755,15 @@ hwmp_recv_rann(struct ieee80211vap *vap, } } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + /* Check if root is a mesh gate, mark it */ + if (rann->rann_flags & IEEE80211_MESHRANN_FLAGS_GATE) { + struct ieee80211_mesh_gate_route *gr; + + rt->rt_flags |= IEEE80211_MESHRT_FLAGS_GATE; + gr = ieee80211_mesh_mark_gate(vap, rann->rann_addr, + rt); + gr->gr_lastseq = 0; /* NOT GANN */ + } /* discovery timeout */ ieee80211_mesh_rt_update(rt, ticks_to_msecs(ieee80211_hwmp_roottimeout)); Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:24:20 2013 (r246508) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:24:52 2013 (r246509) @@ -854,6 +854,43 @@ mesh_rt_cleanup_cb(void *arg) mesh_rt_cleanup_cb, vap); } +/* + * Mark a mesh STA as gate and return a pointer to it. + * If this is first time, we create a new gate route. + * Always update the path route to this mesh gate. + */ +struct ieee80211_mesh_gate_route * +ieee80211_mesh_mark_gate(struct ieee80211vap *vap, const uint8_t *addr, + struct ieee80211_mesh_route *rt) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_gate_route *gr = NULL, *next; + int found = 0; + + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(gr, &ms->ms_known_gates, gr_next, next) { + if (IEEE80211_ADDR_EQ(gr->gr_addr, addr)) { + found = 1; + break; + } + } + + if (!found) { + /* New mesh gate add it to known table. */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, addr, + "%s", "stored new gate information from pro-PREQ."); + gr = malloc(ALIGN(sizeof(struct ieee80211_mesh_gate_route)), + M_80211_MESH_GT_RT, M_NOWAIT | M_ZERO); + IEEE80211_ADDR_COPY(gr->gr_addr, addr); + TAILQ_INSERT_TAIL(&ms->ms_known_gates, gr, gr_next); + } + gr->gr_route = rt; + /* TODO: link from path route to gate route */ + MESH_RT_UNLOCK(ms); + + return gr; +} + /* * Helper function to note the Mesh Peer Link FSM change. Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:24:20 2013 (r246508) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:24:52 2013 (r246509) @@ -566,6 +566,9 @@ void ieee80211_mesh_init_neighbor(struc const struct ieee80211_scanparams *); void ieee80211_mesh_update_beacon(struct ieee80211vap *, struct ieee80211_beacon_offsets *); +struct ieee80211_mesh_gate_route * + ieee80211_mesh_mark_gate(struct ieee80211vap *, + const uint8_t *, struct ieee80211_mesh_route *); /* * Return non-zero if proxy operation is enabled. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:25:34 2013 Return-Path: Delivered-To: svn-src-all@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 071A5FE0; Thu, 7 Feb 2013 21:25:34 +0000 (UTC) (envelope-from monthadar@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 DD3ECF24; Thu, 7 Feb 2013 21:25: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 r17LPXHo011552; Thu, 7 Feb 2013 21:25:33 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LPXku011546; Thu, 7 Feb 2013 21:25:33 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072125.r17LPXku011546@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246510 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:25:34 -0000 Author: monthadar Date: Thu Feb 7 21:25:32 2013 New Revision: 246510 URL: http://svnweb.freebsd.org/changeset/base/246510 Log: Send frames to mesh gate if 11s discovery fails. * Send frames that have no path to a known valid Mesh Gate; * Added the function ieee80211_mesh_forward_to_gates that sends the frame to the first found Mesh Gate in the forwarding information; * If we try to discover again while we are discovering queue frame, the discovery callout will send the frames either to mesh gates or discards them silently; * Queue frame also if we try to discover to frequently; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:24:52 2013 (r246509) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:25:32 2013 (r246510) @@ -1839,12 +1839,11 @@ hwmp_rediscover_cb(void *arg) hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if (hr->hr_preqretries >= ieee80211_hwmp_maxpreq_retries) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - rt->rt_dest, NULL, "%s", - "no valid path , max number of discovery, send GATE"); - /* TODO: send to known gates */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_ANY, + rt->rt_dest, "%s", + "max number of discovery, send queued frames to GATE"); + ieee80211_mesh_forward_to_gates(vap, rt); vap->iv_stats.is_mesh_fwd_nopath++; - rt->rt_flags = 0; /* Mark invalid */ return ; /* XXX: flush queue? */ } @@ -1914,6 +1913,12 @@ hwmp_discover(struct ieee80211vap *vap, } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_DISCOVER) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, + "%s", "already discovering queue frame until path found"); + sendpreq = 1; + goto done; + } if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { if (hr->hr_lastdiscovery != 0 && (ticks - hr->hr_lastdiscovery < @@ -1921,7 +1926,7 @@ hwmp_discover(struct ieee80211vap *vap, IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, dest, NULL, "%s", "too frequent discovery requeust"); - /* XXX: stats? */ + sendpreq = 1; goto done; } hr->hr_lastdiscovery = ticks; Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:24:52 2013 (r246509) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:25:32 2013 (r246510) @@ -1022,6 +1022,71 @@ mesh_find_txnode(struct ieee80211vap *va } /* + * Forward the queued frames to known valid mesh gates. + * Assume destination to be outside the MBSS (i.e. proxy entry), + * If no valid mesh gates are known silently discard queued frames. + * If there is no 802.2 path route will be timedout. + */ +void +ieee80211_mesh_forward_to_gates(struct ieee80211vap *vap, + struct ieee80211_mesh_route *rt_dest) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ifnet *ifp = vap->iv_ifp; + struct ieee80211_mesh_route *rt_gate; + struct ieee80211_mesh_gate_route *gr = NULL, *gr_next; + struct mbuf *m, *next; + int gates_found = 0; + + KASSERT( rt_dest->rt_flags == IEEE80211_MESHRT_FLAGS_DISCOVER, + ("Route is not marked with IEEE80211_MESHRT_FLAGS_DISCOVER")); + + /* XXX: send to more than one valid mash gate */ + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(gr, &ms->ms_known_gates, gr_next, gr_next) { + rt_gate = gr->gr_route; + if (rt_gate == NULL) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, + rt_dest->rt_dest, + "mesh gate with no path %6D", + gr->gr_addr, ":"); + continue; + } + gates_found = 1; + /* convert route to a proxy route */ + rt_dest->rt_flags = IEEE80211_MESHRT_FLAGS_PROXY | + IEEE80211_MESHRT_FLAGS_VALID; + rt_dest->rt_ext_seq = 1; /* random value */ + IEEE80211_ADDR_COPY(rt_dest->rt_mesh_gate, rt_gate->rt_dest); + IEEE80211_ADDR_COPY(rt_dest->rt_nexthop, rt_gate->rt_nexthop); + rt_dest->rt_metric = rt_gate->rt_metric; + rt_dest->rt_nhops = rt_gate->rt_nhops; + ieee80211_mesh_rt_update(rt_dest, ms->ms_ppath->mpp_inact); + MESH_RT_UNLOCK(ms); + m = ieee80211_ageq_remove(&ic->ic_stageq, + (struct ieee80211_node *)(uintptr_t) + ieee80211_mac_hash(ic, rt_dest->rt_dest)); + for (; m != NULL; m = next) { + next = m->m_nextpkt; + m->m_nextpkt = NULL; + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, rt_dest->rt_dest, + "flush queued frame %p len %d", m, m->m_pkthdr.len); + ifp->if_transmit(ifp, m); + } + MESH_RT_LOCK(ms); + } + + if (gates_found == 0) { + rt_dest->rt_flags = 0; /* Mark invalid */ + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, rt_dest->rt_dest, + "%s", "no mesh gate found, or no path setup for mesh gate yet"); + } + MESH_RT_UNLOCK(ms); + +} + +/* * Forward the specified frame. * Decrement the TTL and set TA to our MAC address. */ Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:24:52 2013 (r246509) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:25:32 2013 (r246510) @@ -569,6 +569,8 @@ void ieee80211_mesh_update_beacon(struc struct ieee80211_mesh_gate_route * ieee80211_mesh_mark_gate(struct ieee80211vap *, const uint8_t *, struct ieee80211_mesh_route *); +void ieee80211_mesh_forward_to_gates(struct ieee80211vap *, + struct ieee80211_mesh_route *); /* * Return non-zero if proxy operation is enabled. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:26:06 2013 Return-Path: Delivered-To: svn-src-all@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 CC5951F6; Thu, 7 Feb 2013 21:26:06 +0000 (UTC) (envelope-from monthadar@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 BC1A0F37; Thu, 7 Feb 2013 21:26: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 r17LQ6fX011676; Thu, 7 Feb 2013 21:26:06 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LQ6Ri011675; Thu, 7 Feb 2013 21:26:06 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072126.r17LQ6Ri011675@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246511 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:26:06 -0000 Author: monthadar Date: Thu Feb 7 21:26:06 2013 New Revision: 246511 URL: http://svnweb.freebsd.org/changeset/base/246511 Log: Mesh gate code to transmit to all mesh gates. * Modified mesh_find_txnode to be able to handle proxy marked entries by recursively calling itself to find the txnode towards the active mesh gate; * Mesh Gate: Added a new function that transmits data frames similar to ieee80211_start; * Modified ieee80211_mesh_forward_to_gates so that: + Frames are duplicated and sent to each valid Mesh Gate; + Route is marked invalid before return of function, this is because we dont know yet which Mesh Gate is we will use; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:25:32 2013 (r246510) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:26:06 2013 (r246511) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -79,6 +80,8 @@ static int mesh_checkpseq(struct ieee802 static struct ieee80211_node * mesh_find_txnode(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); +static void mesh_transmit_to_gate(struct ieee80211vap *, struct mbuf *, + struct ieee80211_mesh_route *); static void mesh_forward(struct ieee80211vap *, struct mbuf *, const struct ieee80211_meshcntl *); static int mesh_input(struct ieee80211_node *, struct mbuf *, int, int); @@ -1011,21 +1014,151 @@ mesh_find_txnode(struct ieee80211vap *va rt = ieee80211_mesh_rt_find(vap, dest); if (rt == NULL) return NULL; - if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || - (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY)) { + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, - "%s: !valid or proxy, flags 0x%x", __func__, rt->rt_flags); + "%s: !valid, flags 0x%x", __func__, rt->rt_flags); /* XXX stat */ return NULL; } + if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) { + rt = ieee80211_mesh_rt_find(vap, rt->rt_mesh_gate); + if (rt == NULL) return NULL; + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, + "%s: meshgate !valid, flags 0x%x", __func__, + rt->rt_flags); + /* XXX stat */ + return NULL; + } + } return ieee80211_find_txnode(vap, rt->rt_nexthop); } +static void +mesh_transmit_to_gate(struct ieee80211vap *vap, struct mbuf *m, + struct ieee80211_mesh_route *rt_gate) +{ + struct ifnet *ifp = vap->iv_ifp; + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *parent = ic->ic_ifp; + struct ieee80211_node *ni; + struct ether_header *eh; + int error; + + eh = mtod(m, struct ether_header *); + ni = mesh_find_txnode(vap, rt_gate->rt_dest); + if (ni == NULL) { + ifp->if_oerrors++; + m_freem(m); + return; + } + + if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && + (m->m_flags & M_PWR_SAV) == 0) { + /* + * Station in power save mode; pass the frame + * to the 802.11 layer and continue. We'll get + * the frame back when the time is right. + * XXX lose WDS vap linkage? + */ + (void) ieee80211_pwrsave(ni, m); + ieee80211_free_node(ni); + return; + } + + /* calculate priority so drivers can find the tx queue */ + if (ieee80211_classify(ni, m)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + eh->ether_dhost, NULL, + "%s", "classification failure"); + vap->iv_stats.is_tx_classify++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + return; + } + /* + * Stash the node pointer. Note that we do this after + * any call to ieee80211_dwds_mcast because that code + * uses any existing value for rcvif to identify the + * interface it (might have been) received on. + */ + m->m_pkthdr.rcvif = (void *)ni; + + BPF_MTAP(ifp, m); /* 802.3 tx */ + + /* + * Check if A-MPDU tx aggregation is setup or if we + * should try to enable it. The sta must be associated + * with HT and A-MPDU enabled for use. When the policy + * routine decides we should enable A-MPDU we issue an + * ADDBA request and wait for a reply. The frame being + * encapsulated will go out w/o using A-MPDU, or possibly + * it might be collected by the driver and held/retransmit. + * The default ic_ampdu_enable routine handles staggering + * ADDBA requests in case the receiver NAK's us or we are + * otherwise unable to establish a BA stream. + */ + if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && + (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && + (m->m_flags & M_EAPOL) == 0) { + int tid = WME_AC_TO_TID(M_WME_GETAC(m)); + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; + + ieee80211_txampdu_count_packet(tap); + if (IEEE80211_AMPDU_RUNNING(tap)) { + /* + * Operational, mark frame for aggregation. + * + * XXX do tx aggregation here + */ + m->m_flags |= M_AMPDU_MPDU; + } else if (!IEEE80211_AMPDU_REQUESTED(tap) && + ic->ic_ampdu_enable(ni, tap)) { + /* + * Not negotiated yet, request service. + */ + ieee80211_ampdu_request(ni, tap); + /* XXX hold frame for reply? */ + } + } +#ifdef IEEE80211_SUPPORT_SUPERG + else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { + m = ieee80211_ff_check(ni, m); + if (m == NULL) { + /* NB: any ni ref held on stageq */ + return; + } + } +#endif /* IEEE80211_SUPPORT_SUPERG */ + if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { + /* + * Encapsulate the packet in prep for transmission. + */ + m = ieee80211_encap(vap, ni, m); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + ieee80211_free_node(ni); + return; + } + } + error = parent->if_transmit(parent, m); + if (error != 0) { + m_freem(m); + ieee80211_free_node(ni); + } else { + ifp->if_opackets++; + } + ic->ic_lastdata = ticks; +} + /* * Forward the queued frames to known valid mesh gates. * Assume destination to be outside the MBSS (i.e. proxy entry), * If no valid mesh gates are known silently discard queued frames. - * If there is no 802.2 path route will be timedout. + * After transmitting frames to all known valid mesh gates, this route + * will be marked invalid, and a new path discovery will happen in the hopes + * that (at least) one of the mesh gates have a new proxy entry for us to use. */ void ieee80211_mesh_forward_to_gates(struct ieee80211vap *vap, @@ -1033,17 +1166,20 @@ ieee80211_mesh_forward_to_gates(struct i { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ifnet *ifp = vap->iv_ifp; struct ieee80211_mesh_route *rt_gate; struct ieee80211_mesh_gate_route *gr = NULL, *gr_next; - struct mbuf *m, *next; - int gates_found = 0; + struct mbuf *m, *mcopy, *next; KASSERT( rt_dest->rt_flags == IEEE80211_MESHRT_FLAGS_DISCOVER, ("Route is not marked with IEEE80211_MESHRT_FLAGS_DISCOVER")); /* XXX: send to more than one valid mash gate */ MESH_RT_LOCK(ms); + + m = ieee80211_ageq_remove(&ic->ic_stageq, + (struct ieee80211_node *)(uintptr_t) + ieee80211_mac_hash(ic, rt_dest->rt_dest)); + TAILQ_FOREACH_SAFE(gr, &ms->ms_known_gates, gr_next, gr_next) { rt_gate = gr->gr_route; if (rt_gate == NULL) { @@ -1053,8 +1189,18 @@ ieee80211_mesh_forward_to_gates(struct i gr->gr_addr, ":"); continue; } - gates_found = 1; - /* convert route to a proxy route */ + if ((rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) + continue; + KASSERT(rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_GATE, + ("route not marked as a mesh gate")); + KASSERT((rt_gate->rt_flags & + IEEE80211_MESHRT_FLAGS_PROXY) == 0, + ("found mesh gate that is also marked porxy")); + /* + * convert route to a proxy route gated by the current + * mesh gate, this is needed so encap can built data + * frame with correct address. + */ rt_dest->rt_flags = IEEE80211_MESHRT_FLAGS_PROXY | IEEE80211_MESHRT_FLAGS_VALID; rt_dest->rt_ext_seq = 1; /* random value */ @@ -1064,26 +1210,22 @@ ieee80211_mesh_forward_to_gates(struct i rt_dest->rt_nhops = rt_gate->rt_nhops; ieee80211_mesh_rt_update(rt_dest, ms->ms_ppath->mpp_inact); MESH_RT_UNLOCK(ms); - m = ieee80211_ageq_remove(&ic->ic_stageq, - (struct ieee80211_node *)(uintptr_t) - ieee80211_mac_hash(ic, rt_dest->rt_dest)); - for (; m != NULL; m = next) { - next = m->m_nextpkt; - m->m_nextpkt = NULL; - IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, rt_dest->rt_dest, - "flush queued frame %p len %d", m, m->m_pkthdr.len); - ifp->if_transmit(ifp, m); + /* XXX: lock?? */ + mcopy = m_dup(m, M_NOWAIT); + for (; mcopy != NULL; mcopy = next) { + next = mcopy->m_nextpkt; + mcopy->m_nextpkt = NULL; + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, + rt_dest->rt_dest, + "flush queued frame %p len %d", mcopy, + mcopy->m_pkthdr.len); + mesh_transmit_to_gate(vap, mcopy, rt_gate); } MESH_RT_LOCK(ms); } - - if (gates_found == 0) { - rt_dest->rt_flags = 0; /* Mark invalid */ - IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, rt_dest->rt_dest, - "%s", "no mesh gate found, or no path setup for mesh gate yet"); - } + rt_dest->rt_flags = 0; /* Mark invalid */ + m_freem(m); MESH_RT_UNLOCK(ms); - } /* From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:26:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35A6537C; Thu, 7 Feb 2013 21:26:41 +0000 (UTC) (envelope-from monthadar@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 1AE25F44; Thu, 7 Feb 2013 21:26: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 r17LQfsd011791; Thu, 7 Feb 2013 21:26:41 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LQeQL011788; Thu, 7 Feb 2013 21:26:40 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072126.r17LQeQL011788@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246512 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:26:41 -0000 Author: monthadar Date: Thu Feb 7 21:26:40 2013 New Revision: 246512 URL: http://svnweb.freebsd.org/changeset/base/246512 Log: HWMP: ic->raw_xmit didn't always point to correct ni. This is a code re-write. ic->raw_xmit need a pointer to ieee80211_node for the destination node (da). I have reorganized the code so that a pointer to the da node is searched for in the end & in one place. * Make mesh_find_txnode public to be used by HWMP, renamed to ieee80211_mesh_finx_txnode; * changed the argument from ieee80211_node to ieee80211vap for all hwmp_send_* functions; * removed the 'sa' argument from hwmp_send_* functions as all HWMP frames have the source address equal to vap->iv_myaddr; * Modified hwmp_send_action so that if da is MULTCAST ni=vap->iv_bss otherwise we called ieee80211_mesh_find_txnode. Also no need to hold a reference in this functions if da is not MULTICAST as by finding the node it became referenced in ieee80211_find_txnode; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:26:06 2013 (r246511) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:26:40 2013 (r246512) @@ -68,8 +68,7 @@ static void hwmp_vattach(struct ieee8021 static void hwmp_vdetach(struct ieee80211vap *); static int hwmp_newstate(struct ieee80211vap *, enum ieee80211_state, int); -static int hwmp_send_action(struct ieee80211_node *, - const uint8_t [IEEE80211_ADDR_LEN], +static int hwmp_send_action(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], uint8_t *, size_t); static uint8_t * hwmp_add_meshpreq(uint8_t *, @@ -86,23 +85,20 @@ static void hwmp_rootmode_rann_cb(void * static void hwmp_recv_preq(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshpreq_ie *); -static int hwmp_send_preq(struct ieee80211_node *, - const uint8_t [IEEE80211_ADDR_LEN], +static int hwmp_send_preq(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshpreq_ie *, struct timeval *, struct timeval *); static void hwmp_recv_prep(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshprep_ie *); -static int hwmp_send_prep(struct ieee80211_node *, - const uint8_t [IEEE80211_ADDR_LEN], +static int hwmp_send_prep(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshprep_ie *); static void hwmp_recv_perr(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshperr_ie *); -static int hwmp_send_perr(struct ieee80211_node *, - const uint8_t [IEEE80211_ADDR_LEN], +static int hwmp_send_perr(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshperr_ie *); static void hwmp_senderror(struct ieee80211vap *, @@ -111,8 +107,7 @@ static void hwmp_senderror(struct ieee80 static void hwmp_recv_rann(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshrann_ie *); -static int hwmp_send_rann(struct ieee80211_node *, - const uint8_t [IEEE80211_ADDR_LEN], +static int hwmp_send_rann(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *); static struct ieee80211_node * @@ -588,17 +583,30 @@ hwmp_recv_action_meshpath(struct ieee802 } static int -hwmp_send_action(struct ieee80211_node *ni, - const uint8_t sa[IEEE80211_ADDR_LEN], +hwmp_send_action(struct ieee80211vap *vap, const uint8_t da[IEEE80211_ADDR_LEN], uint8_t *ie, size_t len) { - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_node *ni; + struct ieee80211com *ic; struct ieee80211_bpf_params params; struct mbuf *m; uint8_t *frm; + if (IEEE80211_IS_MULTICAST(da)) { + ni = ieee80211_ref_node(vap->iv_bss); +#ifdef IEEE80211_DEBUG_REFCNT + IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, + "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", + __func__, __LINE__, + ni, ether_sprintf(ni->ni_macaddr), + ieee80211_node_refcnt(ni)+1); +#endif + ieee80211_ref_node(ni); + } + else + ni = ieee80211_mesh_find_txnode(vap, da); + if (vap->iv_state == IEEE80211_S_CAC) { IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT, ni, "block %s frame in CAC state", "HWMP action"); @@ -607,19 +615,7 @@ hwmp_send_action(struct ieee80211_node * } KASSERT(ni != NULL, ("null node")); - /* - * Hold a reference on the node so it doesn't go away until after - * the xmit is complete all the way in the driver. On error we - * will remove our reference. - */ -#ifdef IEEE80211_DEBUG_REFCNT - IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, - "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", - __func__, __LINE__, - ni, ether_sprintf(ni->ni_macaddr), - ieee80211_node_refcnt(ni)+1); -#endif - ieee80211_ref_node(ni); + ic = ni->ni_ic; m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), @@ -660,7 +656,7 @@ hwmp_send_action(struct ieee80211_node * } ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, - IEEE80211_NONQOS_TID, sa, da, sa); + IEEE80211_NONQOS_TID, vap->iv_myaddr, da, vap->iv_myaddr); m->m_flags |= M_ENCAP; /* mark encapsulated */ IEEE80211_NODE_STAT(ni, tx_mgmt); @@ -862,8 +858,8 @@ hwmp_rootmode_cb(void *arg) IEEE80211_MESHPREQ_TFLAGS_USN; PREQ_TSEQ(0) = 0; vap->iv_stats.is_hwmp_rootreqs++; - hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &preq, - NULL, NULL); /* NB: we enforce rate check ourself */ + /* NB: we enforce rate check ourself */ + hwmp_send_preq(vap, broadcastaddr, &preq, NULL, NULL); hwmp_rootmode_setup(vap); } #undef PREQ_TFLAGS @@ -896,7 +892,7 @@ hwmp_rootmode_rann_cb(void *arg) rann.rann_metric = IEEE80211_MESHLMETRIC_INITIALVAL; vap->iv_stats.is_hwmp_rootrann++; - hwmp_send_rann(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &rann); + hwmp_send_rann(vap, broadcastaddr, &rann); hwmp_rootmode_setup(vap); } @@ -1060,7 +1056,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "reply to %6D", preq->preq_origaddr, ":"); - hwmp_send_prep(ni, vap->iv_myaddr, wh->i_addr2, &prep); + hwmp_send_prep(vap, wh->i_addr2, &prep); return; } /* we may update our proxy information for the orig external */ @@ -1119,8 +1115,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); prep.prep_targetseq = ++hs->hs_seq; - hwmp_send_prep(vap->iv_bss, vap->iv_myaddr, - rtorig->rt_nexthop, &prep); + hwmp_send_prep(vap, rtorig->rt_nexthop, &prep); } } @@ -1161,8 +1156,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_ADDR_COPY(&prep.prep_origaddr, preq->preq_origaddr); prep.prep_origseq = hrorig->hr_seq; - hwmp_send_prep(ni, vap->iv_myaddr, - rtorig->rt_nexthop, &prep); + hwmp_send_prep(vap, rtorig->rt_nexthop, &prep); /* * Set TO and unset RF bits because we have @@ -1181,8 +1175,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, ppreq.preq_metric += ms->ms_pmetric->mpm_metric(ni); /* don't do PREQ ratecheck when we propagate */ - hwmp_send_preq(ni, vap->iv_myaddr, broadcastaddr, - &ppreq, NULL, NULL); + hwmp_send_preq(vap, broadcastaddr, &ppreq, NULL, NULL); } } #undef PREQ_TFLAGS @@ -1190,8 +1183,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, #undef PREQ_TSEQ static int -hwmp_send_preq(struct ieee80211_node *ni, - const uint8_t sa[IEEE80211_ADDR_LEN], +hwmp_send_preq(struct ieee80211vap *vap, const uint8_t da[IEEE80211_ADDR_LEN], struct ieee80211_meshpreq_ie *preq, struct timeval *last, struct timeval *minint) @@ -1220,7 +1212,7 @@ hwmp_send_preq(struct ieee80211_node *ni preq->preq_len = (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE ? IEEE80211_MESHPREQ_BASE_SZ_AE : IEEE80211_MESHPREQ_BASE_SZ) + preq->preq_tcount * IEEE80211_MESHPREQ_TRGT_SZ; - return hwmp_send_action(ni, sa, da, (uint8_t *)preq, preq->preq_len+2); + return hwmp_send_action(vap, da, (uint8_t *)preq, preq->preq_len+2); } static void @@ -1354,7 +1346,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, pprep.prep_hopcount += 1; pprep.prep_ttl -= 1; pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); - hwmp_send_prep(ni, vap->iv_myaddr, rtorig->rt_nexthop, &pprep); + hwmp_send_prep(vap, rtorig->rt_nexthop, &pprep); /* precursor list for the Target Mesh STA Address is updated */ } @@ -1436,8 +1428,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, } static int -hwmp_send_prep(struct ieee80211_node *ni, - const uint8_t sa[IEEE80211_ADDR_LEN], +hwmp_send_prep(struct ieee80211vap *vap, const uint8_t da[IEEE80211_ADDR_LEN], struct ieee80211_meshprep_ie *prep) { @@ -1455,8 +1446,7 @@ hwmp_send_prep(struct ieee80211_node *ni prep->prep_ie = IEEE80211_ELEMID_MESHPREP; prep->prep_len = prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE ? IEEE80211_MESHPREP_BASE_SZ_AE : IEEE80211_MESHPREP_BASE_SZ; - return hwmp_send_action(ni, sa, da, (uint8_t *)prep, - prep->prep_len + 2); + return hwmp_send_action(vap, da, (uint8_t *)prep, prep->prep_len + 2); } #define PERR_DFLAGS(n) perr.perr_dests[n].dest_flags @@ -1489,7 +1479,7 @@ hwmp_peerdown(struct ieee80211_node *ni) PERR_DRCODE(0) = IEEE80211_REASON_MESH_PERR_DEST_UNREACH; /* NB: flush everything passing through peer */ ieee80211_mesh_rt_flush_peer(vap, ni->ni_macaddr); - hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr); + hwmp_send_perr(vap, broadcastaddr, &perr); } #undef PERR_DFLAGS #undef PERR_DADDR @@ -1592,8 +1582,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, "propagate PERR from %6D", wh->i_addr2, ":"); pperr->perr_ndests = j; pperr->perr_ttl--; - hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, - pperr); + hwmp_send_perr(vap, broadcastaddr, pperr); } done: if (pperr != NULL) @@ -1606,12 +1595,11 @@ done: #undef PERR_DRCODE static int -hwmp_send_perr(struct ieee80211_node *ni, - const uint8_t sa[IEEE80211_ADDR_LEN], +hwmp_send_perr(struct ieee80211vap *vap, const uint8_t da[IEEE80211_ADDR_LEN], struct ieee80211_meshperr_ie *perr) { - struct ieee80211_hwmp_state *hs = ni->ni_vap->iv_hwmp; + struct ieee80211_hwmp_state *hs = vap->iv_hwmp; int i; uint8_t length = 0; @@ -1642,7 +1630,7 @@ hwmp_send_perr(struct ieee80211_node *ni length += IEEE80211_MESHPERR_DEST_SZ; } perr->perr_len =length; - return hwmp_send_action(ni, sa, da, (uint8_t *)perr, perr->perr_len+2); + return hwmp_send_action(vap, da, (uint8_t *)perr, perr->perr_len+2); } /* @@ -1695,7 +1683,7 @@ hwmp_senderror(struct ieee80211vap *vap, default: KASSERT(0, ("unknown reason code for HWMP PERR (%u)", rcode)); } - hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr); + hwmp_send_perr(vap, broadcastaddr, &perr); } #undef PERR_DFLAGS #undef PEER_DADDR @@ -1782,8 +1770,8 @@ hwmp_recv_rann(struct ieee80211vap *vap, IEEE80211_ADDR_COPY(preq.preq_targets[0].target_addr, rann->rann_addr); preq.preq_targets[0].target_seq = rann->rann_seq; /* XXX: if rootconfint have not passed, we built this preq in vain */ - hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, wh->i_addr2, &preq, - &hr->hr_lastrootconf, &ieee80211_hwmp_rootconfint); + hwmp_send_preq(vap, wh->i_addr2, &preq, &hr->hr_lastrootconf, + &ieee80211_hwmp_rootconfint); /* propagate a RANN */ if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID && @@ -1794,14 +1782,12 @@ hwmp_recv_rann(struct ieee80211vap *vap, prann.rann_hopcount += 1; prann.rann_ttl -= 1; prann.rann_metric += ms->ms_pmetric->mpm_metric(ni); - hwmp_send_rann(vap->iv_bss, vap->iv_myaddr, - broadcastaddr, &prann); + hwmp_send_rann(vap, broadcastaddr, &prann); } } static int -hwmp_send_rann(struct ieee80211_node *ni, - const uint8_t sa[IEEE80211_ADDR_LEN], +hwmp_send_rann(struct ieee80211vap *vap, const uint8_t da[IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *rann) { @@ -1816,8 +1802,7 @@ hwmp_send_rann(struct ieee80211_node *ni */ rann->rann_ie = IEEE80211_ELEMID_MESHRANN; rann->rann_len = IEEE80211_MESHRANN_BASE_SZ; - return hwmp_send_action(ni, sa, da, (uint8_t *)rann, - rann->rann_len + 2); + return hwmp_send_action(vap, da, (uint8_t *)rann, rann->rann_len + 2); } #define PREQ_TFLAGS(n) preq.preq_targets[n].target_flags @@ -1872,9 +1857,8 @@ hwmp_rediscover_cb(void *arg) PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_USN; PREQ_TSEQ(0) = 0; /* RESERVED when USN flag is set */ /* XXX check return value */ - hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, - broadcastaddr, &preq, &hr->hr_lastpreq, - &ieee80211_hwmp_preqminint); + hwmp_send_preq(vap, broadcastaddr, &preq, &hr->hr_lastpreq, + &ieee80211_hwmp_preqminint); callout_reset(&rt->rt_discovery, ieee80211_hwmp_net_diameter_traversaltime * 2, hwmp_rediscover_cb, rt); @@ -1970,9 +1954,8 @@ hwmp_discover(struct ieee80211vap *vap, PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_USN; PREQ_TSEQ(0) = 0; /* RESERVED when USN flag is set */ /* XXX check return value */ - hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, - broadcastaddr, &preq, &hr->hr_lastpreq, - &ieee80211_hwmp_preqminint); + hwmp_send_preq(vap, broadcastaddr, &preq, + &hr->hr_lastpreq, &ieee80211_hwmp_preqminint); callout_reset(&rt->rt_discovery, ieee80211_hwmp_net_diameter_traversaltime * 2, hwmp_rediscover_cb, rt); Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:26:06 2013 (r246511) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:26:40 2013 (r246512) @@ -77,9 +77,6 @@ static void mesh_checkid(void *, struct static uint32_t mesh_generateid(struct ieee80211vap *); static int mesh_checkpseq(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], uint32_t); -static struct ieee80211_node * - mesh_find_txnode(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN]); static void mesh_transmit_to_gate(struct ieee80211vap *, struct mbuf *, struct ieee80211_mesh_route *); static void mesh_forward(struct ieee80211vap *, struct mbuf *, @@ -1005,8 +1002,8 @@ mesh_checkpseq(struct ieee80211vap *vap, /* * Iterate the routing table and locate the next hop. */ -static struct ieee80211_node * -mesh_find_txnode(struct ieee80211vap *vap, +struct ieee80211_node * +ieee80211_mesh_find_txnode(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) { struct ieee80211_mesh_route *rt; @@ -1046,7 +1043,7 @@ mesh_transmit_to_gate(struct ieee80211va int error; eh = mtod(m, struct ether_header *); - ni = mesh_find_txnode(vap, rt_gate->rt_dest); + ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { ifp->if_oerrors++; m_freem(m); @@ -1293,7 +1290,7 @@ mesh_forward(struct ieee80211vap *vap, s ni = ieee80211_ref_node(vap->iv_bss); mcopy->m_flags |= M_MCAST; } else { - ni = mesh_find_txnode(vap, whcopy->i_addr3); + ni = ieee80211_mesh_find_txnode(vap, whcopy->i_addr3); if (ni == NULL) { /* * [Optional] any of the following three actions: Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:26:06 2013 (r246511) +++ head/sys/net80211/ieee80211_mesh.h Thu Feb 7 21:26:40 2013 (r246512) @@ -571,6 +571,9 @@ struct ieee80211_mesh_gate_route * const uint8_t *, struct ieee80211_mesh_route *); void ieee80211_mesh_forward_to_gates(struct ieee80211vap *, struct ieee80211_mesh_route *); +struct ieee80211_node * + ieee80211_mesh_find_txnode(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); /* * Return non-zero if proxy operation is enabled. From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:27:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9785151C; Thu, 7 Feb 2013 21:27:41 +0000 (UTC) (envelope-from monthadar@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 6F046F63; Thu, 7 Feb 2013 21:27: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 r17LRfXP011964; Thu, 7 Feb 2013 21:27:41 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LRfVw011963; Thu, 7 Feb 2013 21:27:41 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072127.r17LRfVw011963@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246513 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:27:41 -0000 Author: monthadar Date: Thu Feb 7 21:27:40 2013 New Revision: 246513 URL: http://svnweb.freebsd.org/changeset/base/246513 Log: Mesh HWMP PREQ update: proxy reply only if mesh STA is a meshgate. * Original PREP frame is transmitted only by the target mesh STA or the mesh STA that is the proxy target; * Fixed so that metric value is not over written incorrectly in hwmp_recv_preq for when replying back with a PREP; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:26:40 2013 (r246512) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:27:40 2013 (r246513) @@ -1017,10 +1017,12 @@ hwmp_recv_preq(struct ieee80211vap *vap, /* * Check if the PREQ is addressed to us. - * or a Proxy currently supplied by us. + * or a Proxy currently gated by us. */ if (IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0)) || - (rttarg != NULL && + (ms->ms_flags & IEEE80211_MESHFLAGS_GATE && + rttarg != NULL && + IEEE80211_ADDR_EQ(vap->iv_myaddr, rttarg->rt_mesh_gate) && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY && rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { /* @@ -1031,6 +1033,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_flags = 0; prep.prep_hopcount = 0; + prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); if (rttarg != NULL && /* if NULL it means we are the target */ rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) { @@ -1042,6 +1045,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, /* update proxy seqno to HWMP seqno */ rttarg->rt_ext_seq = hs->hs_seq; prep.prep_hopcount = rttarg->rt_nhops; + prep.prep_metric = rttarg->rt_metric; IEEE80211_ADDR_COPY(prep.prep_targetaddr, rttarg->rt_mesh_gate); } /* @@ -1050,7 +1054,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_ttl = ms->ms_ttl; prep.prep_targetseq = hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; - prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; IEEE80211_ADDR_COPY(prep.prep_origaddr, preq->preq_origaddr); prep.prep_origseq = preq->preq_origseq; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:28:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 78B3768F; Thu, 7 Feb 2013 21:28:26 +0000 (UTC) (envelope-from monthadar@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 68EC5F6C; Thu, 7 Feb 2013 21: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 r17LSQ9l012105; Thu, 7 Feb 2013 21:28:26 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LSQY1012104; Thu, 7 Feb 2013 21:28:26 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072128.r17LSQY1012104@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246514 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:28:26 -0000 Author: monthadar Date: Thu Feb 7 21:28:25 2013 New Revision: 246514 URL: http://svnweb.freebsd.org/changeset/base/246514 Log: Mesh HWMP: don't send an intermediate PREP for proxy entries. * The standard is unclear about what should happen in case a mesh STA (not marked as a mesh gate) recevies a PREQ for a destination that is marked as proxy. Solution for now is not to do intermediate reply at all, and let the PREQ reach the mesh gate; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:27:40 2013 (r246513) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:28:25 2013 (r246514) @@ -1133,9 +1133,11 @@ hwmp_recv_preq(struct ieee80211vap *vap, /* * We have a valid route to this node. + * NB: if target is proxy dont reply. */ if (rttarg != NULL && - (rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { + rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID && + !(rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY)) { /* * Check if we can send an intermediate Path Reply, * i.e., Target Only bit is not set and target is not From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:29:15 2013 Return-Path: Delivered-To: svn-src-all@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 1DE5D819; Thu, 7 Feb 2013 21:29:15 +0000 (UTC) (envelope-from monthadar@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 041E6F7C; Thu, 7 Feb 2013 21:29: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 r17LTEjD012251; Thu, 7 Feb 2013 21:29:14 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LTEBk012250; Thu, 7 Feb 2013 21:29:14 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072129.r17LTEBk012250@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246515 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:29:15 -0000 Author: monthadar Date: Thu Feb 7 21:29:14 2013 New Revision: 246515 URL: http://svnweb.freebsd.org/changeset/base/246515 Log: Mesh HWMP PREQ: fixed conditions for discarding elements. Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:28:25 2013 (r246514) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:29:14 2013 (r246515) @@ -997,10 +997,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, * it will be marked below. */ rtorig->rt_flags = IEEE80211_MESHRT_FLAGS_VALID; - }else if ((hrtarg != NULL && - HWMP_SEQ_EQ(hrtarg->hr_seq, PREQ_TSEQ(0)) && - ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0)) || - preqid >= preq->preq_id) { + } else if ((hrtarg != NULL && + !HWMP_SEQ_EQ(hrtarg->hr_seq, PREQ_TSEQ(0))) || + (rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID && + preqid >= preq->preq_id)) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "discard PREQ from %6D, old seqno %u <= %u," " or old preqid %u < %u", From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:29:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E8D59A2; Thu, 7 Feb 2013 21:29:49 +0000 (UTC) (envelope-from monthadar@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 643F6F88; Thu, 7 Feb 2013 21:29: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 r17LTnBd012354; Thu, 7 Feb 2013 21:29:49 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LTnFl012353; Thu, 7 Feb 2013 21:29:49 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072129.r17LTnFl012353@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246516 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:29:49 -0000 Author: monthadar Date: Thu Feb 7 21:29:48 2013 New Revision: 246516 URL: http://svnweb.freebsd.org/changeset/base/246516 Log: Update ddb to print mesh routing table. * Modified _db_show_vap and _db_show_com to print mesh routing table if the 'm' modifier is specified; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_ddb.c Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Thu Feb 7 21:29:14 2013 (r246515) +++ head/sys/net80211/ieee80211_ddb.c Thu Feb 7 21:29:48 2013 (r246516) @@ -63,9 +63,9 @@ __FBSDID("$FreeBSD$"); } while (0) static void _db_show_sta(const struct ieee80211_node *); -static void _db_show_vap(const struct ieee80211vap *, int); +static void _db_show_vap(const struct ieee80211vap *, int, int); static void _db_show_com(const struct ieee80211com *, - int showvaps, int showsta, int showprocs); + int showvaps, int showsta, int showmesh, int showprocs); static void _db_show_node_table(const char *tag, const struct ieee80211_node_table *); @@ -103,7 +103,7 @@ DB_SHOW_COMMAND(statab, db_show_statab) DB_SHOW_COMMAND(vap, db_show_vap) { - int i, showprocs = 0; + int i, showmesh = 0, showprocs = 0; if (!have_addr) { db_printf("usage: show vap \n"); @@ -113,18 +113,22 @@ DB_SHOW_COMMAND(vap, db_show_vap) switch (modif[i]) { case 'a': showprocs = 1; + showmesh = 1; + break; + case 'm': + showmesh = 1; break; case 'p': showprocs = 1; break; } - _db_show_vap((const struct ieee80211vap *) addr, showprocs); + _db_show_vap((const struct ieee80211vap *) addr, showmesh, showprocs); } DB_SHOW_COMMAND(com, db_show_com) { const struct ieee80211com *ic; - int i, showprocs = 0, showvaps = 0, showsta = 0; + int i, showprocs = 0, showvaps = 0, showsta = 0, showmesh = 0; if (!have_addr) { db_printf("usage: show com \n"); @@ -133,11 +137,14 @@ DB_SHOW_COMMAND(com, db_show_com) for (i = 0; modif[i] != '\0'; i++) switch (modif[i]) { case 'a': - showsta = showvaps = showprocs = 1; + showsta = showmesh = showvaps = showprocs = 1; break; case 's': showsta = 1; break; + case 'm': + showmesh = 1; + break; case 'v': showvaps = 1; break; @@ -147,7 +154,7 @@ DB_SHOW_COMMAND(com, db_show_com) } ic = (const struct ieee80211com *) addr; - _db_show_com(ic, showvaps, showsta, showprocs); + _db_show_com(ic, showvaps, showsta, showmesh, showprocs); } DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps) @@ -178,7 +185,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va vap->iv_ifp->if_xname, vap); db_printf("\n"); } else - _db_show_com(ic, 1, 1, 1); + _db_show_com(ic, 1, 1, 1, 1); } } } @@ -330,7 +337,7 @@ _db_show_tdma(const char *sep, const str #endif /* IEEE80211_SUPPORT_TDMA */ static void -_db_show_vap(const struct ieee80211vap *vap, int showprocs) +_db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs) { const struct ieee80211com *ic = vap->iv_ic; int i; @@ -341,6 +348,10 @@ _db_show_vap(const struct ieee80211vap * db_printf("\n"); db_printf("\topmode %s", ieee80211_opmode_name[vap->iv_opmode]); +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode == IEEE80211_M_MBSS) + db_printf("(%p)", vap->iv_mesh); +#endif db_printf(" state %s", ieee80211_state_name[vap->iv_state]); db_printf(" ifp %p(%s)", vap->iv_ifp, vap->iv_ifp->if_xname); db_printf("\n"); @@ -472,6 +483,10 @@ _db_show_vap(const struct ieee80211vap * db_printf(" acl %p", vap->iv_acl); db_printf(" as %p", vap->iv_as); db_printf("\n"); +#ifdef IEEE80211_SUPPORT_MESH + if (showmesh && vap->iv_mesh != NULL) + _db_show_mesh(vap->iv_mesh); +#endif #ifdef IEEE80211_SUPPORT_TDMA if (vap->iv_tdma != NULL) _db_show_tdma("\t", vap->iv_tdma, showprocs); @@ -495,7 +510,8 @@ _db_show_vap(const struct ieee80211vap * } static void -_db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showprocs) +_db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, + int showmesh, int showprocs) { struct ieee80211vap *vap; @@ -651,7 +667,7 @@ _db_show_com(const struct ieee80211com * if (showvaps && !TAILQ_EMPTY(&ic->ic_vaps)) { db_printf("\n"); TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - _db_show_vap(vap, showprocs); + _db_show_vap(vap, showmesh, showprocs); } if (showsta && !TAILQ_EMPTY(&ic->ic_sta.nt_node)) { const struct ieee80211_node_table *nt = &ic->ic_sta; From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:30:29 2013 Return-Path: Delivered-To: svn-src-all@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 ECF9FB72; Thu, 7 Feb 2013 21:30:29 +0000 (UTC) (envelope-from monthadar@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 D8C74F99; Thu, 7 Feb 2013 21:30: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 r17LUTOL012561; Thu, 7 Feb 2013 21:30:29 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LUTtN012560; Thu, 7 Feb 2013 21:30:29 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072130.r17LUTtN012560@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246517 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:30:30 -0000 Author: monthadar Date: Thu Feb 7 21:30:29 2013 New Revision: 246517 URL: http://svnweb.freebsd.org/changeset/base/246517 Log: Mesh bug: debug infomartion showing swapped SA and DA address. * Fix bug for "forward frame from SA(%6D), DA(%6D)" where addresses where swapped between SA and DA; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Feb 7 21:29:48 2013 (r246516) +++ head/sys/net80211/ieee80211_output.c Thu Feb 7 21:30:29 2013 (r246517) @@ -264,8 +264,8 @@ ieee80211_start(struct ifnet *ifp) } IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "forward frame from DS SA(%6D), DA(%6D)\n", - eh->ether_dhost, ":", - eh->ether_shost, ":"); + eh->ether_shost, ":", + eh->ether_dhost, ":"); ieee80211_mesh_proxy_check(vap, eh->ether_shost); } ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:30:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48069CF9; Thu, 7 Feb 2013 21:30:59 +0000 (UTC) (envelope-from monthadar@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 3859FFA8; Thu, 7 Feb 2013 21:30: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 r17LUx8M014205; Thu, 7 Feb 2013 21:30:59 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LUxeR014204; Thu, 7 Feb 2013 21:30:59 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072130.r17LUxeR014204@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246518 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:30:59 -0000 Author: monthadar Date: Thu Feb 7 21:30:58 2013 New Revision: 246518 URL: http://svnweb.freebsd.org/changeset/base/246518 Log: Mesh HWMP PERR bug fixes. * When calling ieee80211_mesh_rt_flush_peer, the rt->rt_dest argument should not be passed because it can get freed before invalidating the other routes that depends on it to compare with next_hop. Use PERR_DADDR(i) instead; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:30:29 2013 (r246517) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:30:58 2013 (r246518) @@ -1570,7 +1570,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, "PERR, unknown reason code %u\n", PERR_DFLAGS(i)); goto done; /* XXX: stats?? */ } - ieee80211_mesh_rt_flush_peer(vap, rt->rt_dest); + ieee80211_mesh_rt_flush_peer(vap, PERR_DADDR(i)); KASSERT(j < 32, ("PERR, error ndest >= 32 (%u)", j)); } if (j == 0) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:31:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C445E7C; Thu, 7 Feb 2013 21:31:38 +0000 (UTC) (envelope-from monthadar@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 6C401FB9; Thu, 7 Feb 2013 21:31: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 r17LVcao014349; Thu, 7 Feb 2013 21:31:38 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LVcHu014348; Thu, 7 Feb 2013 21:31:38 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072131.r17LVcHu014348@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246519 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:31:38 -0000 Author: monthadar Date: Thu Feb 7 21:31:37 2013 New Revision: 246519 URL: http://svnweb.freebsd.org/changeset/base/246519 Log: Mesh HWMP forwarding information: updating FI for transmitter. * Added hwmp_update_transmitter function that checks if the metric to the transmitter have improved. If old FI is invalid or metric is larger the FI to the transmitter is updated occurdingly. This is a recommendation from the 802.11 2012 standard, table 13-9; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:30:58 2013 (r246518) +++ head/sys/net80211/ieee80211_hwmp.c Thu Feb 7 21:31:37 2013 (r246519) @@ -896,6 +896,45 @@ hwmp_rootmode_rann_cb(void *arg) hwmp_rootmode_setup(vap); } +/* + * Update forwarding information to TA if metric improves. + */ +static void +hwmp_update_transmitter(struct ieee80211vap *vap, struct ieee80211_node *ni, + const char *hwmp_frame) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rttran = NULL; /* Transmitter */ + int metric = 0; + + rttran = ieee80211_mesh_rt_find(vap, ni->ni_macaddr); + if (rttran == NULL) { + rttran = ieee80211_mesh_rt_add(vap, ni->ni_macaddr); + if (rttran == NULL) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "unable to add path to transmitter %6D of %s", + ni->ni_macaddr, ":", hwmp_frame); + vap->iv_stats.is_mesh_rtaddfailed++; + return; + } + } + metric = ms->ms_pmetric->mpm_metric(ni); + if (!(rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) || + rttran->rt_metric > metric) + { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "%s path to transmiter %6D of %s, metric %d:%d", + rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? + "prefer" : "update", ni->ni_macaddr, ":", hwmp_frame, + rttran->rt_metric, metric); + IEEE80211_ADDR_COPY(rttran->rt_nexthop, ni->ni_macaddr); + rttran->rt_metric = metric; + rttran->rt_nhops = 1; + ieee80211_mesh_rt_update(rttran, ms->ms_ppath->mpp_inact); + rttran->rt_flags = IEEE80211_MESHRT_FLAGS_VALID; + } +} + #define PREQ_TFLAGS(n) preq->preq_targets[n].target_flags #define PREQ_TADDR(n) preq->preq_targets[n].target_addr #define PREQ_TSEQ(n) preq->preq_targets[n].target_seq @@ -1010,10 +1049,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, return; } - /* - * Forwarding information for transmitter mesh STA - * [OPTIONAL: if metric improved] - */ + /* Update forwarding information to TA if metric improves. */ + hwmp_update_transmitter(vap, ni, "PREQ"); /* * Check if the PREQ is addressed to us. @@ -1268,7 +1305,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, * rules defined in 13.10.8.4). If the conditions for creating or * updating the forwarding information have not been met in those * rules, no further steps are applied to the PREP. - * [OPTIONAL]: update forwarding information to TA if metric improves. */ rt = ieee80211_mesh_rt_find(vap, prep->prep_targetaddr); if (rt == NULL) { @@ -1323,6 +1359,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, } rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; /* mark valid */ + /* Update forwarding information to TA if metric improves */ + hwmp_update_transmitter(vap, ni, "PREP"); + /* * If it's NOT for us, propagate the PREP */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 21:32:10 2013 Return-Path: Delivered-To: svn-src-all@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 F3F6EFEE; Thu, 7 Feb 2013 21:32:09 +0000 (UTC) (envelope-from monthadar@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 D4F4FFC5; Thu, 7 Feb 2013 21:32: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 r17LW9OG014466; Thu, 7 Feb 2013 21:32:09 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17LW9uQ014465; Thu, 7 Feb 2013 21:32:09 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201302072132.r17LW9uQ014465@svn.freebsd.org> From: Monthadar Al Jaberi Date: Thu, 7 Feb 2013 21:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246520 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:32:10 -0000 Author: monthadar Date: Thu Feb 7 21:32:09 2013 New Revision: 246520 URL: http://svnweb.freebsd.org/changeset/base/246520 Log: Mesh: recevied GANN frames where not parsed correctly. * Added mesh_parse_meshgate_action that parse all values to host endian; * Add more detailed debug output; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:31:37 2013 (r246519) +++ head/sys/net80211/ieee80211_mesh.c Thu Feb 7 21:32:09 2013 (r246520) @@ -533,9 +533,6 @@ mesh_gatemode_cb(void *arg) struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_meshgann_ie gann; - IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, vap->iv_bss, - "%s", "send broadcast GANN"); - gann.gann_flags = 0; /* Reserved */ gann.gann_hopcount = 0; gann.gann_ttl = ms->ms_ttl; @@ -543,6 +540,9 @@ mesh_gatemode_cb(void *arg) gann.gann_seq = ms->ms_gateseq++; gann.gann_interval = ieee80211_mesh_gateint; + IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, vap->iv_bss, + "send broadcast GANN (seq %u)", gann.gann_seq); + ieee80211_send_action(vap->iv_bss, IEEE80211_ACTION_CAT_MESH, IEEE80211_ACTION_MESH_GANN, &gann); mesh_gatemode_setup(vap); @@ -2605,6 +2605,40 @@ mesh_recv_action_meshlmetric(struct ieee } /* + * Parse meshgate action ie's for GANN frames. + * Returns -1 if parsing fails, otherwise 0. + */ +static int +mesh_parse_meshgate_action(struct ieee80211_node *ni, + const struct ieee80211_frame *wh, /* XXX for VERIFY_LENGTH */ + struct ieee80211_meshgann_ie *ie, const uint8_t *frm, const uint8_t *efrm) +{ + struct ieee80211vap *vap = ni->ni_vap; + const struct ieee80211_meshgann_ie *gannie; + + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return -1); + switch (*frm) { + case IEEE80211_ELEMID_MESHGANN: + gannie = (const struct ieee80211_meshgann_ie *) frm; + memset(ie, 0, sizeof(ie)); + ie->gann_ie = gannie->gann_ie; + ie->gann_len = gannie->gann_len; + ie->gann_flags = gannie->gann_flags; + ie->gann_hopcount = gannie->gann_hopcount; + ie->gann_ttl = gannie->gann_ttl; + IEEE80211_ADDR_COPY(ie->gann_addr, gannie->gann_addr); + ie->gann_seq = LE_READ_4(&gannie->gann_seq); + ie->gann_interval = LE_READ_2(&gannie->gann_interval); + break; + } + frm += frm[1] + 2; + } + + return 0; +} + +/* * Mesh Gate Announcement handling. */ static int @@ -2617,29 +2651,36 @@ mesh_recv_action_meshgate(struct ieee802 struct ieee80211_mesh_gate_route *gr, *next; struct ieee80211_mesh_route *rt_gate; struct ieee80211_meshgann_ie pgann; + struct ieee80211_meshgann_ie ie; int found = 0; - const struct ieee80211_meshgann_ie *ie = - (const struct ieee80211_meshgann_ie *) - (frm+2); /* action + code */ - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ie->gann_addr)) + /* +2 for action + code */ + if (mesh_parse_meshgate_action(ni, wh, &ie, frm+2, efrm) != 0) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, + ni->ni_macaddr, NULL, "%s", + "GANN parsing failed"); + vap->iv_stats.is_rx_mgtdiscard++; + return (0); + } + + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ie.gann_addr)) return 0; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ni->ni_macaddr, - "received GANN, meshgate: %6D (seq %u)", ie->gann_addr, ":", - ie->gann_seq); + "received GANN, meshgate: %6D (seq %u)", ie.gann_addr, ":", + ie.gann_seq); if (ms == NULL) return (0); MESH_RT_LOCK(ms); TAILQ_FOREACH_SAFE(gr, &ms->ms_known_gates, gr_next, next) { - if (!IEEE80211_ADDR_EQ(gr->gr_addr, ie->gann_addr)) + if (!IEEE80211_ADDR_EQ(gr->gr_addr, ie.gann_addr)) continue; - if (ie->gann_seq <= gr->gr_lastseq) { + if (ie.gann_seq <= gr->gr_lastseq) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, ni->ni_macaddr, NULL, "GANN old seqno %u <= %u", - ie->gann_seq, gr->gr_lastseq); + ie.gann_seq, gr->gr_lastseq); MESH_RT_UNLOCK(ms); return (0); } @@ -2650,14 +2691,14 @@ mesh_recv_action_meshgate(struct ieee802 } if (found == 0) { /* this GANN is from a new mesh Gate add it to known table. */ - IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, - "stored new GANN information, seq %u.", ie->gann_seq); + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie.gann_addr, + "stored new GANN information, seq %u.", ie.gann_seq); gr = malloc(ALIGN(sizeof(struct ieee80211_mesh_gate_route)), M_80211_MESH_GT_RT, M_NOWAIT | M_ZERO); - IEEE80211_ADDR_COPY(gr->gr_addr, ie->gann_addr); + IEEE80211_ADDR_COPY(gr->gr_addr, ie.gann_addr); TAILQ_INSERT_TAIL(&ms->ms_known_gates, gr, gr_next); } - gr->gr_lastseq = ie->gann_seq; + gr->gr_lastseq = ie.gann_seq; /* check if we have a path to this gate */ rt_gate = mesh_rt_find_locked(ms, gr->gr_addr); @@ -2670,17 +2711,16 @@ mesh_recv_action_meshgate(struct ieee802 MESH_RT_UNLOCK(ms); /* popagate only if decremented ttl >= 1 && forwarding is enabled */ - if ((ie->gann_ttl - 1) < 1 && - !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) + if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return 0; - pgann.gann_flags = ie->gann_flags; /* Reserved */ - pgann.gann_hopcount = ie->gann_hopcount + 1; - pgann.gann_ttl = ie->gann_ttl - 1; - IEEE80211_ADDR_COPY(pgann.gann_addr, ie->gann_addr); - pgann.gann_seq = ie->gann_seq; - pgann.gann_interval = ie->gann_interval; + pgann.gann_flags = ie.gann_flags; /* Reserved */ + pgann.gann_hopcount = ie.gann_hopcount + 1; + pgann.gann_ttl = ie.gann_ttl - 1; + IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr); + pgann.gann_seq = ie.gann_seq; + pgann.gann_interval = ie.gann_interval; - IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie->gann_addr, + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie.gann_addr, "%s", "propagate GANN"); ieee80211_send_action(vap->iv_bss, IEEE80211_ACTION_CAT_MESH, From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 22:40:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADAB5ED9; Thu, 7 Feb 2013 22:40:27 +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 87B632CE; Thu, 7 Feb 2013 22: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 r17MeRNS033434; Thu, 7 Feb 2013 22:40:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17MeR7B033433; Thu, 7 Feb 2013 22:40:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302072240.r17MeR7B033433@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 22:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r246521 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 22:40:27 -0000 Author: kib Date: Thu Feb 7 22:40:26 2013 New Revision: 246521 URL: http://svnweb.freebsd.org/changeset/base/246521 Log: Free Jeremie Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Feb 7 21:32:09 2013 (r246520) +++ svnadmin/conf/mentors Thu Feb 7 22:40:26 2013 (r246521) @@ -24,7 +24,6 @@ erwin delphij ian cognet jceel wkoszek Co-mentor: cognet jinmei gnn -jlh kib jonathan rwatson jwd rmacklem kargl das From owner-svn-src-all@FreeBSD.ORG Thu Feb 7 22:42:34 2013 Return-Path: Delivered-To: svn-src-all@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 A898EEA; Thu, 7 Feb 2013 22:42:34 +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 8BF402E7; Thu, 7 Feb 2013 22:42: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 r17MgY6N035139; Thu, 7 Feb 2013 22:42:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17MgYE1035138; Thu, 7 Feb 2013 22:42:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302072242.r17MgYE1035138@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 7 Feb 2013 22:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246522 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 22:42:34 -0000 Author: jilles Date: Thu Feb 7 22:42:33 2013 New Revision: 246522 URL: http://svnweb.freebsd.org/changeset/base/246522 Log: sh: Simplify mksyntax and make it fit for cross-compiling. Now it outputs fixed files, which use constants provided by the C standard library to determine appropriate values for the target machine. Before, mksyntax inspected the host machine which resulted in subtle breakage if e.g. char is signed on the host and unsigned on the target such as when cross-compiling on x86 for ARM. Tested using -funsigned-char on amd64. Compiling build-tools without it and sh itself with it causes various tests to fail without this change but not with this change. With consistent -funsigned-char, tests pass with or without this change. The mksyntax program could be removed and syntax.c and syntax.h committed to the repository. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/bin/sh/mksyntax.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Thu Feb 7 22:40:26 2013 (r246521) +++ head/bin/sh/mksyntax.c Thu Feb 7 22:42:33 2013 (r246522) @@ -103,23 +103,16 @@ static char writer[] = "\ static FILE *cfile; static FILE *hfile; -static const char *syntax[513]; -static int base; -static int size; /* number of values which a char variable can have */ -static int nbits; /* number of bits in a character */ -static void filltable(const char *); -static void init(void); +static void add_default(void); +static void finish(void); +static void init(const char *); static void add(const char *, const char *); -static void print(const char *); static void output_type_macros(void); int main(int argc __unused, char **argv __unused) { - char c; - char d; - int sign; int i; char buf[80]; int pos; @@ -136,27 +129,8 @@ main(int argc __unused, char **argv __un fputs(writer, hfile); fputs(writer, cfile); - /* Determine the characteristics of chars. */ - c = -1; - sign = (c > 0) ? 0 : 1; - for (nbits = 1 ; ; nbits++) { - d = (1 << nbits) - 1; - if (d == c) - break; - } -#if 0 - printf("%s %d bit chars\n", sign? "signed" : "unsigned", nbits); -#endif - if (nbits > 9) { - fputs("Characters can't have more than 9 bits\n", stderr); - exit(2); - } - size = (1 << nbits) + 1; - base = 1; - if (sign) - base += 1 << (nbits - 1); - fputs("#include \n", hfile); + fputs("#include \n\n", hfile); /* Generate the #define statements in the header file */ fputs("/* Syntax classes */\n", hfile); @@ -177,8 +151,8 @@ main(int argc __unused, char **argv __un fprintf(hfile, "/* %s */\n", is_entry[i].comment); } putc('\n', hfile); - fprintf(hfile, "#define SYNBASE %d\n", base); - fprintf(hfile, "#define PEOF %d\n\n", -base); + fputs("#define SYNBASE (1 - CHAR_MIN)\n", hfile); + fputs("#define PEOF -SYNBASE\n\n", hfile); putc('\n', hfile); fputs("#define BASESYNTAX (basesyntax + SYNBASE)\n", hfile); fputs("#define DQSYNTAX (dqsyntax + SYNBASE)\n", hfile); @@ -189,10 +163,13 @@ main(int argc __unused, char **argv __un putc('\n', hfile); /* Generate the syntax tables. */ + fputs("#include \"parser.h\"\n", cfile); fputs("#include \"shell.h\"\n", cfile); fputs("#include \"syntax.h\"\n\n", cfile); - init(); + fputs("/* syntax table used when not in quotes */\n", cfile); + init("basesyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("'", "CSQUOTE"); @@ -201,9 +178,11 @@ main(int argc __unused, char **argv __un add("$", "CVAR"); add("}", "CENDVAR"); add("<>();&| \t", "CSPCL"); - print("basesyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in double quotes */\n", cfile); + init("dqsyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("\"", "CENDQUOTE"); @@ -212,17 +191,21 @@ main(int argc __unused, char **argv __un add("}", "CENDVAR"); /* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */ add("!*?[]=~:/-^", "CCTL"); - print("dqsyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in single quotes */\n", cfile); + init("sqsyntax"); + add_default(); add("\n", "CNL"); add("\\", "CSBACK"); add("'", "CENDQUOTE"); /* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */ add("!*?[]=~:/-^", "CCTL"); - print("sqsyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in arithmetic */\n", cfile); + init("arisyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); @@ -231,100 +214,95 @@ main(int argc __unused, char **argv __un add("}", "CENDVAR"); add("(", "CLP"); add(")", "CRP"); - print("arisyntax"); - filltable("0"); + finish(); + fputs("\n/* character classification table */\n", cfile); + init("is_type"); add("0123456789", "ISDIGIT"); add("abcdefghijklmnopqrstuvwxyz", "ISLOWER"); add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER"); add("_", "ISUNDER"); add("#?$!-*@", "ISSPECL"); - print("is_type"); + finish(); + exit(0); } - /* - * Clear the syntax table. + * Output the header and declaration of a syntax table. */ static void -filltable(const char *dftval) +init(const char *name) { - int i; + fprintf(hfile, "extern const char %s[];\n", name); + fprintf(cfile, "const char %s[SYNBASE + CHAR_MAX + 1] = {\n", name); +} + - for (i = 0 ; i < size ; i++) - syntax[i] = dftval; +static void +add_one(const char *key, const char *type) +{ + fprintf(cfile, "\t[SYNBASE + %s] = %s,\n", key, type); } /* - * Initialize the syntax table with default values. + * Add default values to the syntax table. */ static void -init(void) +add_default(void) { - filltable("CWORD"); - syntax[0] = "CEOF"; - syntax[base + CTLESC] = "CCTL"; - syntax[base + CTLVAR] = "CCTL"; - syntax[base + CTLENDVAR] = "CCTL"; - syntax[base + CTLBACKQ] = "CCTL"; - syntax[base + CTLBACKQ + CTLQUOTE] = "CCTL"; - syntax[base + CTLARI] = "CCTL"; - syntax[base + CTLENDARI] = "CCTL"; - syntax[base + CTLQUOTEMARK] = "CCTL"; - syntax[base + CTLQUOTEEND] = "CCTL"; + add_one("PEOF", "CEOF"); + add_one("CTLESC", "CCTL"); + add_one("CTLVAR", "CCTL"); + add_one("CTLENDVAR", "CCTL"); + add_one("CTLBACKQ", "CCTL"); + add_one("CTLBACKQ + CTLQUOTE", "CCTL"); + add_one("CTLARI", "CCTL"); + add_one("CTLENDARI", "CCTL"); + add_one("CTLQUOTEMARK", "CCTL"); + add_one("CTLQUOTEEND", "CCTL"); } /* - * Add entries to the syntax table. + * Output the footer of a syntax table. */ static void -add(const char *p, const char *type) +finish(void) { - while (*p) - syntax[*p++ + base] = type; + fputs("};\n", cfile); } - /* - * Output the syntax table. + * Add entries to the syntax table. */ static void -print(const char *name) +add(const char *p, const char *type) { - int i; - int col; - - fprintf(hfile, "extern const char %s[];\n", name); - fprintf(cfile, "const char %s[%d] = {\n", name, size); - col = 0; - for (i = 0 ; i < size ; i++) { - if (i == 0) { - fputs(" ", cfile); - } else if ((i & 03) == 0) { - fputs(",\n ", cfile); - col = 0; - } else { - putc(',', cfile); - while (++col < 9 * (i & 03)) - putc(' ', cfile); + for (; *p; ++p) { + char c = *p; + switch (c) { + case '\t': c = 't'; break; + case '\n': c = 'n'; break; + case '\'': c = '\''; break; + case '\\': c = '\\'; break; + + default: + fprintf(cfile, "\t[SYNBASE + '%c'] = %s,\n", c, type); + continue; } - fputs(syntax[i], cfile); - col += strlen(syntax[i]); + fprintf(cfile, "\t[SYNBASE + '\\%c'] = %s,\n", c, type); } - fputs("\n};\n", cfile); } - /* * Output character classification macros (e.g. is_digit). If digits are * contiguous, we can test for them quickly. From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 07:29:08 2013 Return-Path: Delivered-To: svn-src-all@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 6EB6CE91; Fri, 8 Feb 2013 07:29:08 +0000 (UTC) (envelope-from avg@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 4DEA4920; Fri, 8 Feb 2013 07:29: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 r187T8xk093150; Fri, 8 Feb 2013 07:29:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r187T82h093149; Fri, 8 Feb 2013 07:29:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080729.r187T82h093149@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 07:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246530 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 07:29:08 -0000 Author: avg Date: Fri Feb 8 07:29:07 2013 New Revision: 246530 URL: http://svnweb.freebsd.org/changeset/base/246530 Log: ktr: correctly handle possible wrap-around in the boot buffer Older entries should be 'before' newer entries in the new buffer too and there should be no zero-filled gap between them. Pointed out by: jhb MFC after: 3 days X-MFC with: r246282 Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Fri Feb 8 03:54:06 2013 (r246529) +++ head/sys/kern/kern_ktr.c Fri Feb 8 07:29:07 2013 (r246530) @@ -213,7 +213,11 @@ ktr_entries_initializer(void *dummy __un ktr_mask = 0; ktr_buf = malloc(sizeof(*ktr_buf) * KTR_ENTRIES, M_KTR, M_WAITOK | M_ZERO); - memcpy(ktr_buf, ktr_buf_init, sizeof(ktr_buf_init)); + memcpy(ktr_buf, ktr_buf_init + ktr_idx, + (KTR_BOOT_ENTRIES - ktr_idx) * sizeof(*ktr_buf)); + if (ktr_idx != 0) + memcpy(ktr_buf + KTR_BOOT_ENTRIES - ktr_idx, ktr_buf_init, + ktr_idx * sizeof(*ktr_buf)); ktr_entries = KTR_ENTRIES; ktr_mask = mask; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 07:44:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5705243A; Fri, 8 Feb 2013 07:44:16 +0000 (UTC) (envelope-from avg@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 475039C6; Fri, 8 Feb 2013 07:44: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 r187iGSp098649; Fri, 8 Feb 2013 07:44:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r187iGlM098648; Fri, 8 Feb 2013 07:44:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080744.r187iGlM098648@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 07:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246531 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 07:44:16 -0000 Author: avg Date: Fri Feb 8 07:44:15 2013 New Revision: 246531 URL: http://svnweb.freebsd.org/changeset/base/246531 Log: zfs: update comments about zfid_long_t to match the FreeBSD definitions MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Feb 8 07:29:07 2013 (r246530) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Feb 8 07:44:15 2013 (r246531) @@ -110,7 +110,7 @@ typedef struct zfid_short { } zfid_short_t; /* - * Filesystems under .zfs/snapshot have a total file ID size of 22 bytes + * Filesystems under .zfs/snapshot have a total file ID size of 22[*] bytes * (including the length field). This makes files under .zfs/snapshot * accessible by NFSv3 and NFSv4, but not NFSv2. * @@ -120,10 +120,13 @@ typedef struct zfid_short { * 6 bytes object number (48 bits) * 4 bytes generation number (32 bits) * 6 bytes objset id (48 bits) - * 4 bytes currently just zero (32 bits) + * 4 bytes[**] currently just zero (32 bits) * * We reserve only 48 bits for the object number and objset id, as these are * the limits currently defined and imposed by the DMU. + * + * [*] 20 bytes on FreeBSD to fit into the size of struct fid. + * [**] 2 bytes on FreeBSD for the above reason. */ typedef struct zfid_long { zfid_short_t z_fid; From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 07:49:55 2013 Return-Path: Delivered-To: svn-src-all@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 AD4D56AC; Fri, 8 Feb 2013 07:49:55 +0000 (UTC) (envelope-from avg@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 861CCA10; Fri, 8 Feb 2013 07:49: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 r187ntht099403; Fri, 8 Feb 2013 07:49:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r187ntIK099402; Fri, 8 Feb 2013 07:49:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080749.r187ntIK099402@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 07:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246532 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 07:49:55 -0000 Author: avg Date: Fri Feb 8 07:49:54 2013 New Revision: 246532 URL: http://svnweb.freebsd.org/changeset/base/246532 Log: zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object A special gfs vnode corresponds to that object. A regular zfs vnode must not be returned. This should be upstreamed. Reported by: pluknet Submitted by: rmacklem Tested by: pluknet MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c 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 Fri Feb 8 07:44:15 2013 (r246531) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Feb 8 07:49:54 2013 (r246532) @@ -2009,7 +2009,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. * This will make NFS to switch to LOOKUP instead of using VGET. */ - if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR || + (zfsvfs->z_shares_dir != 0 && ino == zfsvfs->z_shares_dir)) return (EOPNOTSUPP); ZFS_ENTER(zfsvfs); @@ -2101,14 +2102,22 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int return (EINVAL); } - /* A zero fid_gen means we are in the .zfs control directories */ - if (fid_gen == 0 && - (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) { + /* + * A zero fid_gen means we are in .zfs or the .zfs/snapshot + * directory tree. If the object == zfsvfs->z_shares_dir, then + * we are in the .zfs/shares directory tree. + */ + if ((fid_gen == 0 && + (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) || + (zfsvfs->z_shares_dir != 0 && object == zfsvfs->z_shares_dir)) { *vpp = zfsvfs->z_ctldir; ASSERT(*vpp != NULL); if (object == ZFSCTL_INO_SNAPDIR) { VERIFY(zfsctl_root_lookup(*vpp, "snapshot", vpp, NULL, 0, NULL, NULL, NULL, NULL, NULL) == 0); + } else if (object == zfsvfs->z_shares_dir) { + VERIFY(zfsctl_root_lookup(*vpp, "shares", vpp, NULL, + 0, NULL, NULL, NULL, NULL, NULL) == 0); } else { VN_HOLD(*vpp); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 07:59:14 2013 Return-Path: Delivered-To: svn-src-all@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 7609BBB1; Fri, 8 Feb 2013 07:59:14 +0000 (UTC) (envelope-from avg@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 5E302AA1; Fri, 8 Feb 2013 07:59: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 r187xEn2002577; Fri, 8 Feb 2013 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r187xE8f002576; Fri, 8 Feb 2013 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080759.r187xE8f002576@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 07:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246533 - stable/9/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 07:59:14 -0000 Author: avg Date: Fri Feb 8 07:59:13 2013 New Revision: 246533 URL: http://svnweb.freebsd.org/changeset/base/246533 Log: MFC r246244: solaris compat: remove KM_ZERO Modified: stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Fri Feb 8 07:49:54 2013 (r246532) +++ stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Fri Feb 8 07:59:13 2013 (r246533) @@ -45,7 +45,6 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_SLEEP M_WAITOK #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT -#define KM_ZERO M_ZERO #define KM_NODEBUG M_NODUMP #define KMC_NOTOUCH 0 #define KMC_NODEBUG UMA_ZONE_NODUMP From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 08:03:03 2013 Return-Path: Delivered-To: svn-src-all@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 E2A24E83; Fri, 8 Feb 2013 08:03:03 +0000 (UTC) (envelope-from avg@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 D4E30AD1; Fri, 8 Feb 2013 08:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18833PI004971; Fri, 8 Feb 2013 08:03:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r188337Z004970; Fri, 8 Feb 2013 08:03:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080803.r188337Z004970@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 08:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246534 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 08:03:04 -0000 Author: avg Date: Fri Feb 8 08:03:03 2013 New Revision: 246534 URL: http://svnweb.freebsd.org/changeset/base/246534 Log: MFC r246242: zfs: add MODULE_VERSION for zfsctrl Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 07:59:13 2013 (r246533) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:03 2013 (r246534) @@ -5517,5 +5517,6 @@ static moduledata_t zfs_mod = { 0 }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(zfsctrl, 1); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 08:03:19 2013 Return-Path: Delivered-To: svn-src-all@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 6A698FB3; Fri, 8 Feb 2013 08:03:19 +0000 (UTC) (envelope-from avg@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 5D783AD7; Fri, 8 Feb 2013 08:03: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 r1883JdJ005052; Fri, 8 Feb 2013 08:03:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1883J69005051; Fri, 8 Feb 2013 08:03:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080803.r1883J69005051@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 08:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246535 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 08:03:19 -0000 Author: avg Date: Fri Feb 8 08:03:18 2013 New Revision: 246535 URL: http://svnweb.freebsd.org/changeset/base/246535 Log: MFC r246242: zfs: add MODULE_VERSION for zfsctr Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:03 2013 (r246534) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:18 2013 (r246535) @@ -5517,5 +5517,6 @@ static moduledata_t zfs_mod = { 0 }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(zfsctrl, 1); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 09:07:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9815C8F; Fri, 8 Feb 2013 09:07: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 8C3E1688; Fri, 8 Feb 2013 09:07: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 r18974gO024345; Fri, 8 Feb 2013 09:07:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18974XN024343; Fri, 8 Feb 2013 09:07:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302080907.r18974XN024343@svn.freebsd.org> From: Adrian Chadd Date: Fri, 8 Feb 2013 09:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246536 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 09:07:04 -0000 Author: adrian Date: Fri Feb 8 09:07:03 2013 New Revision: 246536 URL: http://svnweb.freebsd.org/changeset/base/246536 Log: Fix a corner case that I noticed with the AR5416 (and it's currently crappy 802.11n performance, sigh.) With the AR5416, aggregates need to be limited to 8KiB if RTS/CTS is enabled. However, larger aggregates were going out with RTSCTS enabled. The following was going on: * The first buffer in the list would have RTS/CTS enabled in bf->bf_state.txflags; * The aggregate would be formed; * The "copy over the txflags from the first buffer" logic that I added blanked the RTS/CTS TX flags fields, and then copied the bf_first RTS/CTS flags over; * .. but that'd cause bf_first to be blanked out! And thus the flag was cleared; * So the rest of the aggregate formation would run with those flags cleared, and thus > 8KiB aggregates were formed. The driver is now (again) correctly limiting aggregate formation for the AR5416 but there are still other pending issues to resolve. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Fri Feb 8 08:03:18 2013 (r246535) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Feb 8 09:07:03 2013 (r246536) @@ -688,11 +688,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s bf->bf_next = NULL; /* - * Don't unlock the tid lock until we're sure we are going - * to queue this frame. - */ - - /* * If the frame doesn't have a sequence number that we're * tracking in the BAW (eg NULL QOS data frame), we can't * aggregate it. Stop the aggregation process; the sender @@ -749,11 +744,13 @@ ath_tx_form_aggr(struct ath_softc *sc, s * that differs from the first frame, override the * subsequent frame with this config. */ - bf->bf_state.bfs_txflags &= - ~ (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); - bf->bf_state.bfs_txflags |= - bf_first->bf_state.bfs_txflags & - (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + if (bf != bf_first) { + bf->bf_state.bfs_txflags &= + ~ (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + bf->bf_state.bfs_txflags |= + bf_first->bf_state.bfs_txflags & + (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + } /* * If the packet has a sequence number, do not From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 09:11:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BCA962D7; Fri, 8 Feb 2013 09:11:55 +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 A5C806D7; Fri, 8 Feb 2013 09:11: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 r189BtBl027255; Fri, 8 Feb 2013 09:11:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r189Btpw027254; Fri, 8 Feb 2013 09:11:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302080911.r189Btpw027254@svn.freebsd.org> From: Adrian Chadd Date: Fri, 8 Feb 2013 09:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246537 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 09:11:55 -0000 Author: adrian Date: Fri Feb 8 09:11:55 2013 New Revision: 246537 URL: http://svnweb.freebsd.org/changeset/base/246537 Log: Fix ieee80211_mesh.c compilation. * Add the superg.h header to allow ieee80211_check_ff() to work * Since the assert stuff creates assertions based on line numbers and there was a conflict, just nudge things down a bit. Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Feb 8 09:07:03 2013 (r246536) +++ head/sys/net80211/ieee80211_mesh.c Fri Feb 8 09:11:55 2013 (r246537) @@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif #include #include @@ -110,6 +113,7 @@ SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, re &ieee80211_mesh_retrytimeout, 0, ieee80211_sysctl_msecs_ticks, "I", "Retry timeout (msec)"); static int ieee80211_mesh_holdingtimeout = -1; + SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, holdingtimeout, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_holdingtimeout, 0, ieee80211_sysctl_msecs_ticks, "I", "Holding state timeout (msec)"); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 09:54:53 2013 Return-Path: Delivered-To: svn-src-all@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 BBBB77C5; Fri, 8 Feb 2013 09:54:53 +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 AF3AC8EE; Fri, 8 Feb 2013 09:54: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 r189srcC040637; Fri, 8 Feb 2013 09:54:53 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r189src4040636; Fri, 8 Feb 2013 09:54:53 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302080954.r189src4040636@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 8 Feb 2013 09:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246538 - head/sys/cddl/dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 09:54:53 -0000 Author: pluknet Date: Fri Feb 8 09:54:53 2013 New Revision: 246538 URL: http://svnweb.freebsd.org/changeset/base/246538 Log: Fix warning: comparison of unsigned expression < 0 is always false. Reported by: clang Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Feb 8 09:11:55 2013 (r246537) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Feb 8 09:54:53 2013 (r246538) @@ -215,7 +215,7 @@ dtrace_ioctl(struct cdev *dev, u_long cm "DTRACEIOC_AGGSNAP":"DTRACEIOC_BUFSNAP", curcpu, desc.dtbd_cpu); - if (desc.dtbd_cpu < 0 || desc.dtbd_cpu >= NCPU) + if (desc.dtbd_cpu >= NCPU) return (ENOENT); if (pcpu_find(desc.dtbd_cpu) == NULL) return (ENOENT); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:20:01 2013 Return-Path: Delivered-To: svn-src-all@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 9737DECF; Fri, 8 Feb 2013 10:20:01 +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 8A6259E9; Fri, 8 Feb 2013 10:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18AK1OE047761; Fri, 8 Feb 2013 10:20:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AK1Tm047760; Fri, 8 Feb 2013 10:20:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081020.r18AK1Tm047760@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246539 - stable/9/sys/fs/nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:20:01 -0000 Author: kib Date: Fri Feb 8 10:20:00 2013 New Revision: 246539 URL: http://svnweb.freebsd.org/changeset/base/246539 Log: MFC r246213: Assert that the mbuf in the chain has sane length. Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonsubs.c Fri Feb 8 09:54:53 2013 (r246538) +++ stable/9/sys/fs/nfs/nfs_commonsubs.c Fri Feb 8 10:20:00 2013 (r246539) @@ -199,6 +199,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); + KASSERT(len > 0, ("len %d", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:25:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0EF31A0; Fri, 8 Feb 2013 10:25:24 +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 CF607A1C; Fri, 8 Feb 2013 10:25: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 r18APO73050145; Fri, 8 Feb 2013 10:25:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18APOnU050144; Fri, 8 Feb 2013 10:25:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081025.r18APOnU050144@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246540 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:25:25 -0000 Author: kib Date: Fri Feb 8 10:25:24 2013 New Revision: 246540 URL: http://svnweb.freebsd.org/changeset/base/246540 Log: MFC r246215: Fix a backwards comment in markvoldirty(). Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:20:00 2013 (r246539) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:25:24 2013 (r246540) @@ -1114,7 +1114,7 @@ extendfile(dep, count, bpp, ncp, flags) * Routine to mark a FAT16 or FAT32 volume as "clean" or "dirty" by * manipulating the upper bit of the FAT entry for cluster 1. Note that * this bit is not defined for FAT12 volumes, which are always assumed to - * be dirty. + * be clean. * * The fatentry() routine only works on cluster numbers that a file could * occupy, so it won't manipulate the entry for cluster 1. So we have to do From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:30:05 2013 Return-Path: Delivered-To: svn-src-all@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 553CA51E; Fri, 8 Feb 2013 10:30:05 +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 48506A60; Fri, 8 Feb 2013 10:30: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 r18AU5s1050826; Fri, 8 Feb 2013 10:30:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AU5An050824; Fri, 8 Feb 2013 10:30:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081030.r18AU5An050824@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246541 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:30:05 -0000 Author: kib Date: Fri Feb 8 10:30:04 2013 New Revision: 246541 URL: http://svnweb.freebsd.org/changeset/base/246541 Log: MFC r246216: The mountmsdosfs() function had an insane sanity test, remove it. Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 10:25:24 2013 (r246540) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 10:30:04 2013 (r246541) @@ -553,8 +553,7 @@ mountmsdosfs(struct vnode *devvp, struct } if (pmp->pm_RootDirEnts == 0) { - if (pmp->pm_Sectors - || pmp->pm_FATsecs + if (pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; #ifdef MSDOSFS_DEBUG From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:34:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDACA6F7; Fri, 8 Feb 2013 10:34:07 +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 B032EA8F; Fri, 8 Feb 2013 10:34: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 r18AY7DA053007; Fri, 8 Feb 2013 10:34:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AY7gB053006; Fri, 8 Feb 2013 10:34:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081034.r18AY7gB053006@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246542 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:34:08 -0000 Author: kib Date: Fri Feb 8 10:34:07 2013 New Revision: 246542 URL: http://svnweb.freebsd.org/changeset/base/246542 Log: MFC r246217: Fix the corruption of the ".." entry for the directory moved to a subdirectory of the root on FAT32. Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 10:30:04 2013 (r246541) +++ stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 10:34:07 2013 (r246542) @@ -973,7 +973,7 @@ msdosfs_rename(ap) u_char to_count; int doingdirectory = 0, newparent = 0; int error; - u_long cn; + u_long cn, pcl; daddr_t bn; struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; @@ -1246,9 +1246,12 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data + 1; - putushort(dotdotp->deStartCluster, dp->de_StartCluster); + pcl = dp->de_StartCluster; + if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) + pcl = MSDOSFSROOT; + putushort(dotdotp->deStartCluster, pcl); if (FAT32(pmp)) - putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); + putushort(dotdotp->deHighClust, pcl >> 16); if (DOINGASYNC(fvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { @@ -1369,8 +1372,13 @@ msdosfs_mkdir(ap) putushort(denp[0].deMDate, ndirent.de_MDate); putushort(denp[0].deMTime, ndirent.de_MTime); pcl = pdep->de_StartCluster; + /* + * Although the root directory has a non-magic starting cluster + * number for FAT32, chkdsk and fsck_msdosfs still require + * references to it in dotdot entries to be magic. + */ if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) - pcl = 0; + pcl = MSDOSFSROOT; putushort(denp[1].deStartCluster, pcl); putushort(denp[1].deCDate, ndirent.de_CDate); putushort(denp[1].deCTime, ndirent.de_CTime); @@ -1380,7 +1388,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deMTime, ndirent.de_MTime); if (FAT32(pmp)) { putushort(denp[0].deHighClust, newcluster >> 16); - putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); + putushort(denp[1].deHighClust, pcl >> 16); } if (DOINGASYNC(ap->a_dvp)) From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:38:13 2013 Return-Path: Delivered-To: svn-src-all@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 02C8DABF; Fri, 8 Feb 2013 10:38:13 +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 E961AAB8; Fri, 8 Feb 2013 10:38: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 r18AcCfw053576; Fri, 8 Feb 2013 10:38:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AcCcK053575; Fri, 8 Feb 2013 10:38:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081038.r18AcCcK053575@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246543 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:38:13 -0000 Author: kib Date: Fri Feb 8 10:38:12 2013 New Revision: 246543 URL: http://svnweb.freebsd.org/changeset/base/246543 Log: MFC r246218: Backup FATs were sometimes marked dirty by copying their first block from the primary FAT, and then they were not marked clean on unmount. Force marking them clean when appropriate. Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:34:07 2013 (r246542) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:38:12 2013 (r246543) @@ -321,8 +321,8 @@ updatefats(pmp, bp, fatbn) struct buf *bp; u_long fatbn; { - int i; struct buf *bpn; + int cleanfat, i; #ifdef MSDOSFS_DEBUG printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); @@ -362,12 +362,23 @@ updatefats(pmp, bp, fatbn) * filesystem was mounted. If synch is asked for then use * bwrite()'s and really slow things down. */ + if (fatbn != pmp->pm_fatblk || FAT12(pmp)) + cleanfat = 0; + else if (FAT16(pmp)) + cleanfat = 16; + else + cleanfat = 32; for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + /* Force the clean bit on in the other copies. */ + if (cleanfat == 16) + ((u_int8_t *)bpn->b_data)[3] |= 0x80; + else if (cleanfat == 32) + ((u_int8_t *)bpn->b_data)[7] |= 0x08; if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); else From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 10:41:51 2013 Return-Path: Delivered-To: svn-src-all@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 CD368C45; Fri, 8 Feb 2013 10:41:51 +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 A7ABAADD; Fri, 8 Feb 2013 10:41: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 r18Afpsq055657; Fri, 8 Feb 2013 10:41:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AfpT0055656; Fri, 8 Feb 2013 10:41:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081041.r18AfpT0055656@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246544 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:41:51 -0000 Author: kib Date: Fri Feb 8 10:41:51 2013 New Revision: 246544 URL: http://svnweb.freebsd.org/changeset/base/246544 Log: MFC r246219: Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously. Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:38:12 2013 (r246543) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:41:51 2013 (r246544) @@ -379,7 +379,7 @@ updatefats(pmp, bp, fatbn) ((u_int8_t *)bpn->b_data)[3] |= 0x80; else if (cleanfat == 32) ((u_int8_t *)bpn->b_data)[7] |= 0x08; - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bpn); else bdwrite(bpn); @@ -389,7 +389,7 @@ updatefats(pmp, bp, fatbn) /* * Write out the first (or current) fat last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bp); else bdwrite(bp); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:10:27 2013 Return-Path: Delivered-To: svn-src-all@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 326729B8; Fri, 8 Feb 2013 11:10:27 +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 24E54D0F; Fri, 8 Feb 2013 11:10: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 r18BARcT063323; Fri, 8 Feb 2013 11:10:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BAQju063321; Fri, 8 Feb 2013 11:10:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081110.r18BAQju063321@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246545 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:10:27 -0000 Author: kib Date: Fri Feb 8 11:10:26 2013 New Revision: 246545 URL: http://svnweb.freebsd.org/changeset/base/246545 Log: MFC r246215: Fix a backwards comment in markvoldirty(). Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:41:51 2013 (r246544) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:10:26 2013 (r246545) @@ -1114,7 +1114,7 @@ extendfile(dep, count, bpp, ncp, flags) * Routine to mark a FAT16 or FAT32 volume as "clean" or "dirty" by * manipulating the upper bit of the FAT entry for cluster 1. Note that * this bit is not defined for FAT12 volumes, which are always assumed to - * be dirty. + * be clean. * * The fatentry() routine only works on cluster numbers that a file could * occupy, so it won't manipulate the entry for cluster 1. So we have to do From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:14:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E933B66; Fri, 8 Feb 2013 11:14:02 +0000 (UTC) (envelope-from dteske@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 7A2A7D46; Fri, 8 Feb 2013 11:14: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 r18BE2LH065293; Fri, 8 Feb 2013 11:14:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BE2gg065291; Fri, 8 Feb 2013 11:14:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302081114.r18BE2gg065291@svn.freebsd.org> From: Devin Teske Date: Fri, 8 Feb 2013 11:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246546 - in head/usr.sbin: bsdconfig sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:14:02 -0000 Author: dteske Date: Fri Feb 8 11:14:01 2013 New Revision: 246546 URL: http://svnweb.freebsd.org/changeset/base/246546 Log: Remove NO_OBJ from Makefiles that generate manuals because this causes the GZIP compressed manuals to appear in ./src instead of the appropriate obj dir. PR: conf/175844 Submitted by: Dominique Goncalves Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/sysrc/Makefile Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Fri Feb 8 11:10:26 2013 (r246545) +++ head/usr.sbin/bsdconfig/Makefile Fri Feb 8 11:14:01 2013 (r246546) @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SUBDIR= console \ diskmgmt \ docsinstall \ Modified: head/usr.sbin/sysrc/Makefile ============================================================================== --- head/usr.sbin/sysrc/Makefile Fri Feb 8 11:10:26 2013 (r246545) +++ head/usr.sbin/sysrc/Makefile Fri Feb 8 11:14:01 2013 (r246546) @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ= - SCRIPTS= sysrc MAN= sysrc.8 From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:14:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C8A0CDB; Fri, 8 Feb 2013 11:14:24 +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 3DEDCD4E; Fri, 8 Feb 2013 11:14: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 r18BEO9t065375; Fri, 8 Feb 2013 11:14:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BEOYu065374; Fri, 8 Feb 2013 11:14:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081114.r18BEOYu065374@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246547 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:14:24 -0000 Author: kib Date: Fri Feb 8 11:14:23 2013 New Revision: 246547 URL: http://svnweb.freebsd.org/changeset/base/246547 Log: MFC r246216: The mountmsdosfs() function had an insane sanity test, remove it. Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 11:14:01 2013 (r246546) +++ stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 11:14:23 2013 (r246547) @@ -551,8 +551,7 @@ mountmsdosfs(struct vnode *devvp, struct } if (pmp->pm_RootDirEnts == 0) { - if (pmp->pm_Sectors - || pmp->pm_FATsecs + if (pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; #ifdef MSDOSFS_DEBUG From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:15:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2B62E6F; Fri, 8 Feb 2013 11:15:57 +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 9A820D6C; Fri, 8 Feb 2013 11:15:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BFvlN065655; Fri, 8 Feb 2013 11:15:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BFvSW065654; Fri, 8 Feb 2013 11:15:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081115.r18BFvSW065654@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246548 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:15:57 -0000 Author: kib Date: Fri Feb 8 11:15:57 2013 New Revision: 246548 URL: http://svnweb.freebsd.org/changeset/base/246548 Log: MFC r246217: Fix the corruption of the ".." entry for the directory moved to a subdirectory of the root on FAT32. Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 11:14:23 2013 (r246547) +++ stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 11:15:57 2013 (r246548) @@ -974,7 +974,7 @@ msdosfs_rename(ap) u_char to_count; int doingdirectory = 0, newparent = 0; int error; - u_long cn; + u_long cn, pcl; daddr_t bn; struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; @@ -1247,9 +1247,12 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data + 1; - putushort(dotdotp->deStartCluster, dp->de_StartCluster); + pcl = dp->de_StartCluster; + if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) + pcl = MSDOSFSROOT; + putushort(dotdotp->deStartCluster, pcl); if (FAT32(pmp)) - putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); + putushort(dotdotp->deHighClust, pcl >> 16); if (fvp->v_mount->mnt_flag & MNT_ASYNC) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { @@ -1370,8 +1373,13 @@ msdosfs_mkdir(ap) putushort(denp[0].deMDate, ndirent.de_MDate); putushort(denp[0].deMTime, ndirent.de_MTime); pcl = pdep->de_StartCluster; + /* + * Although the root directory has a non-magic starting cluster + * number for FAT32, chkdsk and fsck_msdosfs still require + * references to it in dotdot entries to be magic. + */ if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) - pcl = 0; + pcl = MSDOSFSROOT; putushort(denp[1].deStartCluster, pcl); putushort(denp[1].deCDate, ndirent.de_CDate); putushort(denp[1].deCTime, ndirent.de_CTime); @@ -1381,7 +1389,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deMTime, ndirent.de_MTime); if (FAT32(pmp)) { putushort(denp[0].deHighClust, newcluster >> 16); - putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); + putushort(denp[1].deHighClust, pcl >> 16); } if (ap->a_dvp->v_mount->mnt_flag & MNT_ASYNC) From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:17:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39AC26C; Fri, 8 Feb 2013 11:17:48 +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 2AADFD88; Fri, 8 Feb 2013 11:17: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 r18BHmof065941; Fri, 8 Feb 2013 11:17:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BHms8065940; Fri, 8 Feb 2013 11:17:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081117.r18BHms8065940@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246549 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:17:48 -0000 Author: kib Date: Fri Feb 8 11:17:47 2013 New Revision: 246549 URL: http://svnweb.freebsd.org/changeset/base/246549 Log: MFC r246218: Backup FATs were sometimes marked dirty by copying their first block from the primary FAT, and then they were not marked clean on unmount. Force marking them clean when appropriate. Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:15:57 2013 (r246548) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:17:47 2013 (r246549) @@ -321,8 +321,8 @@ updatefats(pmp, bp, fatbn) struct buf *bp; u_long fatbn; { - int i; struct buf *bpn; + int cleanfat, i; #ifdef MSDOSFS_DEBUG printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); @@ -362,12 +362,23 @@ updatefats(pmp, bp, fatbn) * filesystem was mounted. If synch is asked for then use * bwrite()'s and really slow things down. */ + if (fatbn != pmp->pm_fatblk || FAT12(pmp)) + cleanfat = 0; + else if (FAT16(pmp)) + cleanfat = 16; + else + cleanfat = 32; for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + /* Force the clean bit on in the other copies. */ + if (cleanfat == 16) + ((u_int8_t *)bpn->b_data)[3] |= 0x80; + else if (cleanfat == 32) + ((u_int8_t *)bpn->b_data)[7] |= 0x08; if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); else From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 11:19:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4487C21A; Fri, 8 Feb 2013 11:19:44 +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 36FDBDA2; Fri, 8 Feb 2013 11:19: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 r18BJiSj066232; Fri, 8 Feb 2013 11:19:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BJiJr066231; Fri, 8 Feb 2013 11:19:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081119.r18BJiJr066231@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246550 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:19:44 -0000 Author: kib Date: Fri Feb 8 11:19:43 2013 New Revision: 246550 URL: http://svnweb.freebsd.org/changeset/base/246550 Log: MFC r246219: Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously. Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:17:47 2013 (r246549) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:19:43 2013 (r246550) @@ -379,7 +379,7 @@ updatefats(pmp, bp, fatbn) ((u_int8_t *)bpn->b_data)[3] |= 0x80; else if (cleanfat == 32) ((u_int8_t *)bpn->b_data)[7] |= 0x08; - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bpn); else bdwrite(bpn); @@ -389,7 +389,7 @@ updatefats(pmp, bp, fatbn) /* * Write out the first (or current) fat last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bp); else bdwrite(bp); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 14:11:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A51723C2; Fri, 8 Feb 2013 14:11:13 +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 97DD5854; Fri, 8 Feb 2013 14:11: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 r18EBDHR018935; Fri, 8 Feb 2013 14:11:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18EBD1v018933; Fri, 8 Feb 2013 14:11:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302081411.r18EBD1v018933@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 8 Feb 2013 14:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246552 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 14:11:13 -0000 Author: des Date: Fri Feb 8 14:11:12 2013 New Revision: 246552 URL: http://svnweb.freebsd.org/changeset/base/246552 Log: Cross-reference newgrp(1), and document the use of pw(8) to set the group password. PR: docs/167741 MFC after: 3 weeks Modified: head/share/man/man5/group.5 Modified: head/share/man/man5/group.5 ============================================================================== --- head/share/man/man5/group.5 Fri Feb 8 12:53:29 2013 (r246551) +++ head/share/man/man5/group.5 Fri Feb 8 14:11:12 2013 (r246552) @@ -32,7 +32,7 @@ .\" From: @(#)group.5 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd September 29, 1994 +.Dd February 8, 2013 .Dt GROUP 5 .Os .Sh NAME @@ -139,6 +139,7 @@ may still have this limit. .It Pa /etc/group .El .Sh SEE ALSO +.Xr newgrp 1 , .Xr passwd 1 , .Xr setgroups 2 , .Xr crypt 3 , @@ -156,9 +157,14 @@ file format appeared in .At v6 . Support for comments first appeared in .Fx 3.0 . -.Sh BUGS +.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-all@FreeBSD.ORG Fri Feb 8 14:14:01 2013 Return-Path: Delivered-To: svn-src-all@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 2ABA3566; Fri, 8 Feb 2013 14:14:01 +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 131DC88A; Fri, 8 Feb 2013 14:14:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18EE0a6019344; Fri, 8 Feb 2013 14:14:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18EE0ud019339; Fri, 8 Feb 2013 14:14:00 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302081414.r18EE0ud019339@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 8 Feb 2013 14:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246553 - head/usr.bin/newgrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 14:14:01 -0000 Author: des Date: Fri Feb 8 14:14:00 2013 New Revision: 246553 URL: http://svnweb.freebsd.org/changeset/base/246553 Log: Print a warning if not setuid root. Document the need for the setuid bit and how to set it. Explain why it isn't set by default, and suggest simply adding users to groups instead. PR: docs/167741 MFC after: 3 weeks Modified: head/usr.bin/newgrp/newgrp.1 head/usr.bin/newgrp/newgrp.c Modified: head/usr.bin/newgrp/newgrp.1 ============================================================================== --- head/usr.bin/newgrp/newgrp.1 Fri Feb 8 14:11:12 2013 (r246552) +++ head/usr.bin/newgrp/newgrp.1 Fri Feb 8 14:14:00 2013 (r246553) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2002 +.Dd February 8, 2013 .Dt NEWGRP 1 .Os .Sh NAME @@ -90,6 +90,15 @@ A utility appeared in .At v6 . .Sh BUGS +For security reasons, the +.Nm +utility is normally installed without the setuid bit. +To enable it, run the following command: +.Bd -literal -offset indent +chmod u+s /usr/bin/newgrp +.Ed +.Pp Group passwords are inherently insecure as there is no way to stop -users obtaining the crypted passwords from the group database. +users obtaining the password hash from the group database. Their use is discouraged. +Instead, users should simply be added to the necessary groups. Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Fri Feb 8 14:11:12 2013 (r246552) +++ head/usr.bin/newgrp/newgrp.c Fri Feb 8 14:14:00 2013 (r246553) @@ -73,7 +73,8 @@ main(int argc, char *argv[]) { int ch, login; - euid = geteuid(); + if ((euid = geteuid()) != 0) + warnx("need root permissions to function properly, check setuid bit"); if (seteuid(getuid()) < 0) err(1, "seteuid"); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 15:52:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA1C62FC; Fri, 8 Feb 2013 15:52:21 +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 105D0DCF; Fri, 8 Feb 2013 15:52: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 r18FqKYb048697; Fri, 8 Feb 2013 15:52:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18FqK7r048696; Fri, 8 Feb 2013 15:52:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081552.r18FqK7r048696@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 15:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246554 - head/sys/sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 15:52:21 -0000 Author: kib Date: Fri Feb 8 15:52:20 2013 New Revision: 246554 URL: http://svnweb.freebsd.org/changeset/base/246554 Log: The 'end' word was missed in the comment. MFC after: 3 days Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Fri Feb 8 14:14:00 2013 (r246553) +++ head/sys/sparc64/include/vmparam.h Fri Feb 8 15:52:20 2013 (r246554) @@ -149,8 +149,8 @@ * * We define some interesting address constants: * - * VM_MIN_ADDRESS and VM_MAX_ADDRESS define the start and of the entire 64 bit - * address space, mostly just for convenience. + * VM_MIN_ADDRESS and VM_MAX_ADDRESS define the start and end of the entire + * 64 bit address space, mostly just for convenience. * * VM_MIN_DIRECT_ADDRESS and VM_MAX_DIRECT_ADDRESS define the start and end * of the direct mapped region. This maps virtual addresses to physical From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 17:44:45 2013 Return-Path: Delivered-To: svn-src-all@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 4CAB3C9F; Fri, 8 Feb 2013 17:44:45 +0000 (UTC) (envelope-from nwhitehorn@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 39F43315; Fri, 8 Feb 2013 17:44: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 r18Hijle081705; Fri, 8 Feb 2013 17:44:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18HijkL081704; Fri, 8 Feb 2013 17:44:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201302081744.r18HijkL081704@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 8 Feb 2013 17:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246556 - head/libexec/rtld-elf/powerpc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 17:44:45 -0000 Author: nwhitehorn Date: Fri Feb 8 17:44:44 2013 New Revision: 246556 URL: http://svnweb.freebsd.org/changeset/base/246556 Log: Avoid use of register variables, which some compilers (e.g. clang) don't like. It makes the code a little clearer as well. MFC after: 1 week Modified: head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Fri Feb 8 16:10:16 2013 (r246555) +++ head/libexec/rtld-elf/powerpc64/reloc.c Fri Feb 8 17:44:44 2013 (r246556) @@ -486,8 +486,7 @@ init_pltgot(Obj_Entry *obj) void allocate_initial_tls(Obj_Entry *list) { - register Elf_Addr **tp __asm__("r13"); - Elf_Addr **_tp; + Elf_Addr **tp; /* * Fix the size of the static TLS block by using the maximum @@ -497,22 +496,19 @@ allocate_initial_tls(Obj_Entry *list) tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - _tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16) + tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16) + TLS_TP_OFFSET + TLS_TCB_SIZE); - /* - * XXX gcc seems to ignore 'tp = _tp;' - */ - - __asm __volatile("mr %0,%1" : "=r"(tp) : "r"(_tp)); + __asm __volatile("mr 13,%0" :: "r"(tp)); } void* __tls_get_addr(tls_index* ti) { - register Elf_Addr **tp __asm__("r13"); + Elf_Addr **tp; char *p; + __asm __volatile("mr %0,13" : "=r"(tp)); p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tp - TLS_TP_OFFSET - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 18:02:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E64BE34A; Fri, 8 Feb 2013 18:02:29 +0000 (UTC) (envelope-from trasz@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 CD61561D; Fri, 8 Feb 2013 18:02: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 r18I2TpG087336; Fri, 8 Feb 2013 18:02:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18I2TQi087335; Fri, 8 Feb 2013 18:02:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302081802.r18I2TQi087335@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Feb 2013 18:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246557 - head/bin/setfacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 18:02:30 -0000 Author: trasz Date: Fri Feb 8 18:02:28 2013 New Revision: 246557 URL: http://svnweb.freebsd.org/changeset/base/246557 Log: In the setfacl(1) manual page, make it clear that for NFSv4 ACLs, one should really use -a and -x instead of -m. MFC after: 1 week Modified: head/bin/setfacl/setfacl.1 Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Fri Feb 8 17:44:44 2013 (r246556) +++ head/bin/setfacl/setfacl.1 Fri Feb 8 18:02:28 2013 (r246557) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2012 +.Dd February 8, 2013 .Dt SETFACL 1 .Os .Sh NAME @@ -95,6 +95,11 @@ Modify the ACL entries on the specified entries and modifying existing ACL entries with the ACL entries specified in .Ar entries . +For NFSv4 ACLs, it is recommended to use the +.Fl a +and +.Fl x +instead. .It Fl M Ar file Modify the ACL entries on the specified files by adding new ACL entries and modifying existing ACL entries with the ACL From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 18:12:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 14665791; Fri, 8 Feb 2013 18:12:17 +0000 (UTC) (envelope-from trasz@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 F0C2D6C0; Fri, 8 Feb 2013 18:12: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 r18ICGCP090638; Fri, 8 Feb 2013 18:12:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18ICGtc090637; Fri, 8 Feb 2013 18:12:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302081812.r18ICGtc090637@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Feb 2013 18:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246558 - head/bin/setfacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 18:12:17 -0000 Author: trasz Date: Fri Feb 8 18:12:16 2013 New Revision: 246558 URL: http://svnweb.freebsd.org/changeset/base/246558 Log: Improve description of the "-m" option to setfacl(1). Submitted by: scottl MFC after: 1 week Modified: head/bin/setfacl/setfacl.1 Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Fri Feb 8 18:02:28 2013 (r246557) +++ head/bin/setfacl/setfacl.1 Fri Feb 8 18:12:16 2013 (r246558) @@ -91,15 +91,16 @@ An error will be reported if any of the specified files cannot have a default entry (i.e.\& non-directories). This option is not applicable to NFSv4 ACLs. .It Fl m Ar entries -Modify the ACL entries on the specified files by adding new -entries and modifying existing ACL entries with the ACL entries -specified in -.Ar entries . +Modify the ACL on the specified file. +New entries will be added, and existing entries will be modified +according to the +.Ar entries +argument. For NFSv4 ACLs, it is recommended to use the .Fl a and .Fl x -instead. +options instead. .It Fl M Ar file Modify the ACL entries on the specified files by adding new ACL entries and modifying existing ACL entries with the ACL From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 18:43:47 2013 Return-Path: Delivered-To: svn-src-all@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 DF2B4874; Fri, 8 Feb 2013 18:43:47 +0000 (UTC) (envelope-from trasz@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 D136F883; Fri, 8 Feb 2013 18:43: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 r18Ihl6Q099611; Fri, 8 Feb 2013 18:43:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18Ihl0Y099609; Fri, 8 Feb 2013 18:43:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302081843.r18Ihl0Y099609@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Feb 2013 18:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246559 - head/bin/setfacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 18:43:47 -0000 Author: trasz Date: Fri Feb 8 18:43:47 2013 New Revision: 246559 URL: http://svnweb.freebsd.org/changeset/base/246559 Log: Fix NFSv4 permission description in setfacl(1) manual page: the 'D' means delete_child, not delete. MFC after: 1 week Modified: head/bin/setfacl/setfacl.1 Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Fri Feb 8 18:12:16 2013 (r246558) +++ head/bin/setfacl/setfacl.1 Fri Feb 8 18:43:47 2013 (r246559) @@ -325,9 +325,9 @@ write_data execute .It p append_data -.It d -delete_child .It D +delete_child +.It d delete .It a read_attributes From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 19:39:17 2013 Return-Path: Delivered-To: svn-src-all@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 38D9882E; Fri, 8 Feb 2013 19:39:17 +0000 (UTC) (envelope-from pfg@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 722F7AEB; Fri, 8 Feb 2013 19:39: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 r18JdGgw015668; Fri, 8 Feb 2013 19:39:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18JdGBC015666; Fri, 8 Feb 2013 19:39:16 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302081939.r18JdGBC015666@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 8 Feb 2013 19:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246560 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 19:39:17 -0000 Author: pfg Date: Fri Feb 8 19:39:15 2013 New Revision: 246560 URL: http://svnweb.freebsd.org/changeset/base/246560 Log: patch: Follow original versioning convention. According to the README file [1] the 12u variant, unlike the 12g variant, contains no copyleft code. It is therefore convenient to keep using the original versioning scheme to prevent confusions. [1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/patch/README Modified: head/usr.bin/patch/util.c Modified: head/usr.bin/patch/util.c ============================================================================== --- head/usr.bin/patch/util.c Fri Feb 8 18:43:47 2013 (r246559) +++ head/usr.bin/patch/util.c Fri Feb 8 19:39:15 2013 (r246560) @@ -412,7 +412,7 @@ checked_in(char *file) void version(void) { - fprintf(stderr, "patch (BSD patch) 2.0-FreeBSD\n"); + fprintf(stderr, "patch 2.0-12u8 FreeBSD\n"); my_exit(EXIT_SUCCESS); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 20:13:29 2013 Return-Path: Delivered-To: svn-src-all@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 05A21F88; Fri, 8 Feb 2013 20:13:29 +0000 (UTC) (envelope-from alfred@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 E7508D10; Fri, 8 Feb 2013 20:13: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 r18KDS4U026961; Fri, 8 Feb 2013 20:13:28 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18KDS8c026960; Fri, 8 Feb 2013 20:13:28 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201302082013.r18KDS8c026960@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 8 Feb 2013 20:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246561 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 20:13:29 -0000 Author: alfred Date: Fri Feb 8 20:13:28 2013 New Revision: 246561 URL: http://svnweb.freebsd.org/changeset/base/246561 Log: add semicolon to end of CALLOUT_HANDLE_INITIALIZER example. Modified: head/share/man/man9/timeout.9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Fri Feb 8 19:39:15 2013 (r246560) +++ head/share/man/man9/timeout.9 Fri Feb 8 20:13:28 2013 (r246561) @@ -62,7 +62,7 @@ typedef void timeout_t (void *); .Ft void .Fn callout_handle_init "struct callout_handle *handle" .Bd -literal -struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle) +struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); .Ed .Ft void .Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 20:30:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B1776E5; Fri, 8 Feb 2013 20:30:20 +0000 (UTC) (envelope-from pfg@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 5E16DE1A; Fri, 8 Feb 2013 20:30: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 r18KUKBh032104; Fri, 8 Feb 2013 20:30:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18KUKG3032042; Fri, 8 Feb 2013 20:30:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302082030.r18KUKG3032042@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 8 Feb 2013 20:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246562 - in head/sys: fs/ext2fs ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 20:30:20 -0000 Author: pfg Date: Fri Feb 8 20:30:19 2013 New Revision: 246562 URL: http://svnweb.freebsd.org/changeset/base/246562 Log: Remove unused MAXSYMLINKLEN macro. Reviewed by: mckusick PR: kern/175794 MFC after: 1 week Modified: head/sys/fs/ext2fs/inode.h head/sys/ufs/ufs/inode.h Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Fri Feb 8 20:13:28 2013 (r246561) +++ head/sys/fs/ext2fs/inode.h Fri Feb 8 20:30:19 2013 (r246562) @@ -108,7 +108,6 @@ struct inode { */ #define i_shortlink i_db #define i_rdev i_db[0] -#define MAXSYMLINKLEN ((NDADDR + NIADDR) * sizeof(int32_t)) /* File permissions. */ #define IEXEC 0000100 /* Executable. */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Fri Feb 8 20:13:28 2013 (r246561) +++ head/sys/ufs/ufs/inode.h Fri Feb 8 20:30:19 2013 (r246562) @@ -151,10 +151,6 @@ struct inode { (ip)->i_din2->d##field = (val); \ } while (0) -#define MAXSYMLINKLEN(ip) \ - ((ip)->i_ump->um_fstype == UFS1) ? \ - ((NDADDR + NIADDR) * sizeof(ufs1_daddr_t)) : \ - ((NDADDR + NIADDR) * sizeof(ufs2_daddr_t)) #define SHORTLINK(ip) \ (((ip)->i_ump->um_fstype == UFS1) ? \ (caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db) From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 20:58:01 2013 Return-Path: Delivered-To: svn-src-all@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 404D993D; Fri, 8 Feb 2013 20:58:01 +0000 (UTC) (envelope-from pfg@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 18BE9FAE; Fri, 8 Feb 2013 20:58:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18Kw0hX039178; Fri, 8 Feb 2013 20:58:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18Kw0C9039175; Fri, 8 Feb 2013 20:58:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302082058.r18Kw0C9039175@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 8 Feb 2013 20:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246563 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 20:58:01 -0000 Author: pfg Date: Fri Feb 8 20:58:00 2013 New Revision: 246563 URL: http://svnweb.freebsd.org/changeset/base/246563 Log: ext2fs: make e2fs_maxcontig local and remove tautological check. e2fs_maxcontig was modelled after UFS when bringing the "Orlov allocator" to ext2. On UFS fs_maxcontig is kept in the superblock and is used by userland tools (fsck and growfs), In ext2 this information is volatile so it is not available for userland tools, so in this case it doesn't have sense to carry it in the in-memory superblock. Also remove a pointless check for MAX(1, x) > 0. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 8 20:30:19 2013 (r246562) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 8 20:58:00 2013 (r246563) @@ -527,6 +527,7 @@ ext2_mountfs(struct vnode *devvp, struct int ronly; int i, size; int32_t *lp; + int32_t e2fs_maxcontig; ronly = vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0); /* XXX: use VOP_ACESS to check FS perms */ @@ -601,12 +602,8 @@ ext2_mountfs(struct vnode *devvp, struct * in ext2fs doesn't have these variables, so we can calculate * them here. */ - ump->um_e2fs->e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize); - if (ump->um_e2fs->e2fs_maxcontig > 0) - ump->um_e2fs->e2fs_contigsumsize = - MIN(ump->um_e2fs->e2fs_maxcontig, EXT2_MAXCONTIG); - else - ump->um_e2fs->e2fs_contigsumsize = 0; + e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize); + ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG); if (ump->um_e2fs->e2fs_contigsumsize > 0) { size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t); ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK); Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Feb 8 20:30:19 2013 (r246562) +++ head/sys/fs/ext2fs/ext2fs.h Fri Feb 8 20:58:00 2013 (r246563) @@ -170,7 +170,6 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 21:09:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D0AB9254; Fri, 8 Feb 2013 21:09:45 +0000 (UTC) (envelope-from pfg@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 ABE6BCE; Fri, 8 Feb 2013 21:09: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 r18L9jv4042701; Fri, 8 Feb 2013 21:09:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18L9jf8042699; Fri, 8 Feb 2013 21:09:45 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302082109.r18L9jf8042699@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 8 Feb 2013 21:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246564 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 21:09:45 -0000 Author: pfg Date: Fri Feb 8 21:09:44 2013 New Revision: 246564 URL: http://svnweb.freebsd.org/changeset/base/246564 Log: ext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 8 20:58:00 2013 (r246563) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 8 21:09:44 2013 (r246564) @@ -320,8 +320,8 @@ compute_sb_data(struct vnode *devvp, str struct buf *bp; uint32_t e2fs_descpb; - fs->e2fs_bsize = EXT2_MIN_BLOCK_SIZE << es->e2fs_log_bsize; fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->e2fs_log_bsize; + fs->e2fs_bsize = 1U << fs->e2fs_bshift; fs->e2fs_fsbtodb = es->e2fs_log_bsize + 1; fs->e2fs_qbmask = fs->e2fs_bsize - 1; fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Feb 8 20:58:00 2013 (r246563) +++ head/sys/fs/ext2fs/ext2fs.h Fri Feb 8 21:09:44 2013 (r246564) @@ -303,7 +303,6 @@ struct csum { /* * Macro-instructions used to manage several block sizes */ -#define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 #define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 21:15:48 2013 Return-Path: Delivered-To: svn-src-all@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 9CC0888F; Fri, 8 Feb 2013 21:15:48 +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 847AF127; Fri, 8 Feb 2013 21:15: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 r18LFmaU045312; Fri, 8 Feb 2013 21:15:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18LFlFS045310; Fri, 8 Feb 2013 21:15:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302082115.r18LFlFS045310@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 8 Feb 2013 21:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246565 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 21:15:48 -0000 Author: hselasky Date: Fri Feb 8 21:15:47 2013 New Revision: 246565 URL: http://svnweb.freebsd.org/changeset/base/246565 Log: Fix regression issue after r244503: Correct init order to fix a NULL pointer access. MFC after: 1 week Reported by: Ian FREISLICH Modified: head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Feb 8 21:09:44 2013 (r246564) +++ head/sys/dev/usb/wlan/if_uath.c Fri Feb 8 21:15:47 2013 (r246565) @@ -358,22 +358,12 @@ uath_attach(device_t dev) callout_init(&sc->stat_ch, 0); callout_init_mtx(&sc->watchdog_ch, &sc->sc_mtx, 0); - /* - * Allocate xfers for firmware commands. - */ - error = uath_alloc_cmd_list(sc, sc->sc_cmd); - if (error != 0) { - device_printf(sc->sc_dev, - "could not allocate Tx command list\n"); - goto fail; - } - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, uath_usbconfig, UATH_N_XFERS, sc, &sc->sc_mtx); if (error) { device_printf(dev, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); - goto fail1; + goto fail; } sc->sc_cmd_dma_buf = @@ -382,6 +372,16 @@ uath_attach(device_t dev) usbd_xfer_get_frame_buffer(sc->sc_xfer[UATH_BULK_TX], 0); /* + * Setup buffers for firmware commands. + */ + error = uath_alloc_cmd_list(sc, sc->sc_cmd); + if (error != 0) { + device_printf(sc->sc_dev, + "could not allocate Tx command list\n"); + goto fail1; + } + + /* * We're now ready to send+receive firmware commands. */ UATH_LOCK(sc); @@ -492,8 +492,8 @@ uath_attach(device_t dev) fail4: if_free(ifp); fail3: UATH_UNLOCK(sc); -fail2: usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); -fail1: uath_free_cmd_list(sc, sc->sc_cmd); +fail2: uath_free_cmd_list(sc, sc->sc_cmd); +fail1: usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); fail: return (error); } Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Fri Feb 8 21:09:44 2013 (r246564) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Feb 8 21:15:47 2013 (r246565) @@ -259,20 +259,12 @@ upgt_attach(device_t dev) callout_init(&sc->sc_led_ch, 0); callout_init(&sc->sc_watchdog_ch, 0); - /* Allocate TX and RX xfers. */ - error = upgt_alloc_tx(sc); - if (error) - goto fail1; - error = upgt_alloc_rx(sc); - if (error) - goto fail2; - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, upgt_config, UPGT_N_XFERS, sc, &sc->sc_mtx); if (error) { device_printf(dev, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); - goto fail3; + goto fail1; } sc->sc_rx_dma_buf = usbd_xfer_get_frame_buffer( @@ -280,6 +272,14 @@ upgt_attach(device_t dev) sc->sc_tx_dma_buf = usbd_xfer_get_frame_buffer( sc->sc_xfer[UPGT_BULK_TX], 0); + /* Setup TX and RX buffers */ + error = upgt_alloc_tx(sc); + if (error) + goto fail2; + error = upgt_alloc_rx(sc); + if (error) + goto fail3; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -382,9 +382,9 @@ upgt_attach(device_t dev) return (0); fail5: if_free(ifp); -fail4: usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); -fail3: upgt_free_rx(sc); -fail2: upgt_free_tx(sc); +fail4: upgt_free_rx(sc); +fail3: upgt_free_tx(sc); +fail2: usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); fail1: mtx_destroy(&sc->sc_mtx); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 22:13:20 2013 Return-Path: Delivered-To: svn-src-all@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 C98A4CB2; Fri, 8 Feb 2013 22:13:20 +0000 (UTC) (envelope-from jlh@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 B8F833F7; Fri, 8 Feb 2013 22: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 r18MDK0H062796; Fri, 8 Feb 2013 22:13:20 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MDK4d062795; Fri, 8 Feb 2013 22:13:20 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201302082213.r18MDK4d062795@svn.freebsd.org> From: Jeremie Le Hen Date: Fri, 8 Feb 2013 22:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246566 - stable/9/usr.bin/stdbuf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:13:20 -0000 Author: jlh Date: Fri Feb 8 22:13:20 2013 New Revision: 246566 URL: http://svnweb.freebsd.org/changeset/base/246566 Log: MFC r245418: Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC r245419: Remove stray tabs. Submitted by: kib Modified: stable/9/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/9/usr.bin/stdbuf/ (props changed) Modified: stable/9/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/9/usr.bin/stdbuf/stdbuf.c Fri Feb 8 21:15:47 2013 (r246565) +++ stable/9/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:13:20 2013 (r246566) @@ -39,7 +39,7 @@ extern char *__progname; static void usage(int s) { - + fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " " [args ...]\n", __progname); exit(s); @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s", @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (i < 0 || putenv(preload1) == -1) warn("Failed to set environment variable: LD_PRELOAD"); - + preload0 = getenv("LD_32_PRELOAD"); if (preload0 == NULL) i = asprintf(&preload1, "LD_32_PRELOAD=" LIBSTDBUF32); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 22:23:23 2013 Return-Path: Delivered-To: svn-src-all@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 3E8331B0; Fri, 8 Feb 2013 22:23:23 +0000 (UTC) (envelope-from jlh@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 30FBF677; Fri, 8 Feb 2013 22:23:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18MNNYd065933; Fri, 8 Feb 2013 22:23:23 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MNNbe065932; Fri, 8 Feb 2013 22:23:23 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201302082223.r18MNNbe065932@svn.freebsd.org> From: Jeremie Le Hen Date: Fri, 8 Feb 2013 22:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246567 - stable/8/usr.bin/stdbuf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:23:23 -0000 Author: jlh Date: Fri Feb 8 22:23:22 2013 New Revision: 246567 URL: http://svnweb.freebsd.org/changeset/base/246567 Log: MFC r245418: Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC r245419: Remove stray tabs. Submitted by: kib Modified: stable/8/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/8/usr.bin/stdbuf/ (props changed) Modified: stable/8/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/8/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:13:20 2013 (r246566) +++ stable/8/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:23:22 2013 (r246567) @@ -39,7 +39,7 @@ extern char *__progname; static void usage(int s) { - + fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " " [args ...]\n", __progname); exit(s); @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s", @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (i < 0 || putenv(preload1) == -1) warn("Failed to set environment variable: LD_PRELOAD"); - + preload0 = getenv("LD_32_PRELOAD"); if (preload0 == NULL) i = asprintf(&preload1, "LD_32_PRELOAD=" LIBSTDBUF32); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 22:41:49 2013 Return-Path: Delivered-To: svn-src-all@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 96CD474E; Fri, 8 Feb 2013 22:41:49 +0000 (UTC) (envelope-from delphij@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 74A9073C; Fri, 8 Feb 2013 22:41: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 r18Mfn2w071436; Fri, 8 Feb 2013 22:41:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MfnWI071435; Fri, 8 Feb 2013 22:41:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302082241.r18MfnWI071435@svn.freebsd.org> From: Xin LI Date: Fri, 8 Feb 2013 22:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246568 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:41:49 -0000 Author: delphij Date: Fri Feb 8 22:41:48 2013 New Revision: 246568 URL: http://svnweb.freebsd.org/changeset/base/246568 Log: In r246282 the KTR_ENTRIES was specified with syntax error, fix it so 'make universe' would work. MFC after: 12 days X-MFC-with: r246282 Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 8 22:23:22 2013 (r246567) +++ head/sys/conf/NOTES Fri Feb 8 22:41:48 2013 (r246568) @@ -462,7 +462,7 @@ options KTRACE_REQUEST_POOL=101 # options KTR options KTR_BOOT_ENTRIES=1024 -options KTR_ENTRIES=(128 * 1024) +options KTR_ENTRIES=(128*1024) options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR options KTR_CPUMASK=0x3 From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 22:51:10 2013 Return-Path: Delivered-To: svn-src-all@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 6A7C9CB9; Fri, 8 Feb 2013 22:51:10 +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 589757AC; Fri, 8 Feb 2013 22:51: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 r18MpA9H074322; Fri, 8 Feb 2013 22:51:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MpA6v074321; Fri, 8 Feb 2013 22:51:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302082251.r18MpA6v074321@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 8 Feb 2013 22:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246570 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:51:10 -0000 Author: hselasky Date: Fri Feb 8 22:51:09 2013 New Revision: 246570 URL: http://svnweb.freebsd.org/changeset/base/246570 Log: Make sure we don't leak command buffers when a USB command transfer fails. MFC after: 1 week Reported by: Ian FREISLICH Modified: head/sys/dev/usb/wlan/if_uath.c Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Feb 8 22:45:47 2013 (r246569) +++ head/sys/dev/usb/wlan/if_uath.c Fri Feb 8 22:51:09 2013 (r246570) @@ -2436,11 +2436,8 @@ uath_intr_tx_callback(struct usb_xfer *x UATH_ASSERT_LOCKED(sc); - switch (USB_GET_STATE(xfer)) { - case USB_ST_TRANSFERRED: - cmd = STAILQ_FIRST(&sc->sc_cmd_active); - if (cmd == NULL) - goto setup; + cmd = STAILQ_FIRST(&sc->sc_cmd_active); + if (cmd != NULL && USB_GET_STATE(xfer) != USB_ST_SETUP) { STAILQ_REMOVE_HEAD(&sc->sc_cmd_active, next); UATH_STAT_DEC(sc, st_cmd_active); STAILQ_INSERT_TAIL((cmd->flags & UATH_CMD_FLAG_READ) ? @@ -2449,7 +2446,10 @@ uath_intr_tx_callback(struct usb_xfer *x UATH_STAT_INC(sc, st_cmd_waiting); else UATH_STAT_INC(sc, st_cmd_inactive); - /* FALLTHROUGH */ + } + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: case USB_ST_SETUP: setup: cmd = STAILQ_FIRST(&sc->sc_cmd_pending); From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 23:13:47 2013 Return-Path: Delivered-To: svn-src-all@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 8A11B8B3; Fri, 8 Feb 2013 23:13:47 +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 722D78C8; Fri, 8 Feb 2013 23:13: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 r18NDl1e080982; Fri, 8 Feb 2013 23:13:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18NDli1080979; Fri, 8 Feb 2013 23:13:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302082313.r18NDli1080979@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 8 Feb 2013 23:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246571 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 23:13:47 -0000 Author: hselasky Date: Fri Feb 8 23:13:46 2013 New Revision: 246571 URL: http://svnweb.freebsd.org/changeset/base/246571 Log: Correctly list the usbloader dependencies. Modified: head/sys/boot/usb/Makefile.test Modified: head/sys/boot/usb/Makefile.test ============================================================================== --- head/sys/boot/usb/Makefile.test Fri Feb 8 22:51:09 2013 (r246570) +++ head/sys/boot/usb/Makefile.test Fri Feb 8 23:13:46 2013 (r246571) @@ -53,9 +53,9 @@ SRCS+= bsd_usbloader_test.c LDADD+= libusbboot.a DPADD+= libusbboot.a -all: libusbboot.a - .include +${PROG}: libusbboot.a + libusbboot.a: make -f Makefile From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 23:31:04 2013 Return-Path: Delivered-To: svn-src-all@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 AABB8C46; Fri, 8 Feb 2013 23:31:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE0F960; Fri, 8 Feb 2013 23:31:04 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r18NV3X1019579; Fri, 8 Feb 2013 16:31:04 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r18NV1GY036382; Fri, 8 Feb 2013 16:31:01 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: svn commit: r246361 - head/sbin/devd From: Ian Lepore To: Niclas Zeising In-Reply-To: <201302051429.r15ETb7n008263@svn.freebsd.org> References: <201302051429.r15ETb7n008263@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 08 Feb 2013 16:31:01 -0700 Message-ID: <1360366261.4545.44.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 23:31:04 -0000 On Tue, 2013-02-05 at 14:29 +0000, Niclas Zeising wrote: > Author: zeising (doc,ports committer) > Date: Tue Feb 5 14:29:37 2013 > New Revision: 246361 > URL: http://svnweb.freebsd.org/changeset/base/246361 > > Log: > Bump .Dd for the change in r246121. > > Approved by: joel (mentor) > > Modified: > head/sbin/devd/devd.8 > > Modified: head/sbin/devd/devd.8 > ============================================================================== > --- head/sbin/devd/devd.8 Tue Feb 5 13:30:07 2013 (r246360) > +++ head/sbin/devd/devd.8 Tue Feb 5 14:29:37 2013 (r246361) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 24, 2005 > +.Dd January 30, 2013 > .Dt DEVD 8 > .Os > .Sh NAME Does this imply that I should update the .Dd line whenever I touch a manpage? -- Ian From owner-svn-src-all@FreeBSD.ORG Fri Feb 8 23:49:37 2013 Return-Path: Delivered-To: svn-src-all@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 2B2E0138 for ; Fri, 8 Feb 2013 23:49:37 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1.freebsd.org (Postfix) with ESMTP id EB4E1A0C for ; Fri, 8 Feb 2013 23:49:36 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id kl14so2316491pab.4 for ; Fri, 08 Feb 2013 15:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=S0xKHDlvMcpClQiG2Tkjb6b1PvAfngVp1naCjrtaRXg=; b=t3aCnkg1XLRySahGxmrq7+J5VqXKpLFJwUWUlVlGlky+EdVBHAHU3h4EdzMHyKAp1m LcSGArZyKgJgbwkUJjF1KLueOUTBvkXXAnyS7ePVQScWavVq74+fLRd68bMOftMXiAjq d3jzKM4csmhlhvLaPq8Z1IM+MiTupRh7xuw38= 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 :x-gm-message-state; bh=S0xKHDlvMcpClQiG2Tkjb6b1PvAfngVp1naCjrtaRXg=; b=jcF43MpWztxrVxFleO8i5UiFv25yOeuQPMqcSDpnj26CY60GMLxfi1bk65Y8FZSCzV SR6KmCF3BCj2d2Hva55ZmJ6sD1VxFpke9uMHJ2IJXtkfS1oDUWWuTOcyjCxKZ1lUMJAs j5XpK0RAxLkLqd5cG0VPk7WAg7C3TYDS3/JkTvzzLwSGI6L1NPe1qJM0TsiSl+OCx+9n WcIC/ng45PqcXc8DgmZJ6/h1xs+ZC2p9IRH8U08oBI91uOzq7Xk3BEnsb8GMDa8ND3j6 hYS2WK4tEQ4oPajcIIFc3BYJFx7584AxSXjpR6mPQJdKD4i/VhMLgkq8wRnjYJ7LskJX 1PYw== X-Received: by 10.66.222.35 with SMTP id qj3mr2485989pac.69.1360367376296; Fri, 08 Feb 2013 15:49:36 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.148.10 with HTTP; Fri, 8 Feb 2013 15:49:06 -0800 (PST) In-Reply-To: <1360366261.4545.44.camel@revolution.hippie.lan> References: <201302051429.r15ETb7n008263@svn.freebsd.org> <1360366261.4545.44.camel@revolution.hippie.lan> From: Eitan Adler Date: Fri, 8 Feb 2013 18:49:06 -0500 X-Google-Sender-Auth: 5iKoSj-R8wPlIwbJj-1TLgsamho Message-ID: Subject: Re: svn commit: r246361 - head/sbin/devd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlxtDyn3sLH6ptni5BjOM96AFNYh3GQFKajeUbvSF+jc/9tyz6wgukP/6LcztepvGA8nfmV Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Niclas Zeising X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 23:49:37 -0000 On 8 February 2013 18:31, Ian Lepore wrote: > Does this imply that I should update the .Dd line whenever I touch a > manpage? For content changes, yes. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 00:29:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F762BA2; Sat, 9 Feb 2013 00:29:38 +0000 (UTC) (envelope-from delphij@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 23811C11; Sat, 9 Feb 2013 00:29: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 r190Tc3x002550; Sat, 9 Feb 2013 00:29:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r190TbeQ002546; Sat, 9 Feb 2013 00:29:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090029.r190TbeQ002546@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 00:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246574 - in stable/9: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 00:29:38 -0000 Author: delphij Date: Sat Feb 9 00:29:36 2013 New Revision: 246574 URL: http://svnweb.freebsd.org/changeset/base/246574 Log: MFC r245264: The current ZFS code expects ddt_zap_count to always succeed by asserting the underlying zap_count() to return no errors. However, it is possible that the pool reaches to such a state where zap_count would return error, leading to panics when a pool is imported. This commit changes the ddt_zap_count to return error returned from zap_count and handle the error appropriately. With this change, it's now possible to let zpool rollback damaged transaction groups and import the pool. Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 00:29:36 2013 (r246574) @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 00:29:36 2013 (r246574) @@ -89,12 +89,13 @@ ddt_object_destroy(ddt_t *ddt, enum ddt_ spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); ASSERT(*objectp != 0); - ASSERT(ddt_object_count(ddt, type, class) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0 && count == 0); ASSERT(ddt_histogram_empty(&ddt->ddt_histogram[type][class])); VERIFY(zap_remove(os, DMU_POOL_DIRECTORY_OBJECT, name, tx) == 0); VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); @@ -109,6 +110,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; int error; @@ -129,7 +131,11 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + error = ddt_object_count(ddt, type, class, &count); + if (error) + return error; + + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; @@ -143,6 +149,7 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); @@ -155,8 +162,9 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ * Cache DDT statistics; this is the only time they'll change. */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; } @@ -213,13 +221,13 @@ ddt_object_walk(ddt_t *ddt, enum ddt_typ ddt->ddt_object[type][class], dde, walk)); } -uint64_t -ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +int +ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class, uint64_t *count) { ASSERT(ddt_object_exists(ddt, type, class)); return (ddt_ops[type]->ddt_op_count(ddt->ddt_os, - ddt->ddt_object[type][class])); + ddt->ddt_object[type][class], count)); } int @@ -1079,11 +1087,13 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, } for (enum ddt_type type = 0; type < DDT_TYPES; type++) { - uint64_t count = 0; + uint64_t add, count = 0; for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { if (ddt_object_exists(ddt, type, class)) { ddt_object_sync(ddt, type, class, tx); - count += ddt_object_count(ddt, type, class); + VERIFY(ddt_object_count(ddt, type, class, + &add) == 0); + count += add; } } for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 00:29:36 2013 (r246574) @@ -133,14 +133,11 @@ ddt_zap_walk(objset_t *os, uint64_t obje return (error); } -static uint64_t -ddt_zap_count(objset_t *os, uint64_t object) +static int +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count) { - uint64_t count = 0; - VERIFY(zap_count(os, object, &count) == 0); - - return (count); + return (zap_count(os, object, count)); } const ddt_ops_t ddt_zap_ops = { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 00:29:36 2013 (r246574) @@ -163,7 +163,7 @@ typedef struct ddt_ops { dmu_tx_t *tx); int (*ddt_op_walk)(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk); - uint64_t (*ddt_op_count)(objset_t *os, uint64_t object); + int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; #define DDT_NAMELEN 80 @@ -172,8 +172,8 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); -extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class cls); +extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, + enum ddt_class class, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 00:35:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 304DADF0; Sat, 9 Feb 2013 00:35:29 +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 224DBC41; Sat, 9 Feb 2013 00:35: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 r190ZS1Q005014; Sat, 9 Feb 2013 00:35:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r190ZS1X005013; Sat, 9 Feb 2013 00:35:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302090035.r190ZS1X005013@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 9 Feb 2013 00:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246575 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 00:35:29 -0000 Author: np Date: Sat Feb 9 00:35:28 2013 New Revision: 246575 URL: http://svnweb.freebsd.org/changeset/base/246575 Log: Do not hold locks around hardware context reads. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Feb 9 00:29:36 2013 (r246574) +++ head/sys/dev/cxgbe/t4_main.c Sat Feb 9 00:35:28 2013 (r246575) @@ -5161,23 +5161,24 @@ get_sge_context(struct adapter *sc, stru cntxt->mem_id != CTXT_FLM && cntxt->mem_id != CTXT_CNM) return (EINVAL); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ctxt"); + if (rc) + return (rc); + if (sc->flags & FW_OK) { - rc = begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4ctxt"); - if (rc == 0) { - rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, - cntxt->mem_id, &cntxt->data[0]); - end_synchronized_op(sc, LOCK_HELD); - if (rc == 0) - return (0); - } + rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, cntxt->mem_id, + &cntxt->data[0]); + if (rc == 0) + goto done; } /* * Read via firmware failed or wasn't even attempted. Read directly via * the backdoor. */ - rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id, - &cntxt->data[0]); + rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id, &cntxt->data[0]); +done: + end_synchronized_op(sc, 0); return (rc); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 01:08:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E96D7DD; Sat, 9 Feb 2013 01:08:51 +0000 (UTC) (envelope-from pfg@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 3F9E5E51; Sat, 9 Feb 2013 01:08: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 r1918pf1014623; Sat, 9 Feb 2013 01:08:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1918okl014615; Sat, 9 Feb 2013 01:08:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302090108.r1918okl014615@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 9 Feb 2013 01:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246576 - in stable/9/usr.sbin/crunch: crunchgen crunchide examples X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:08:51 -0000 Author: pfg Date: Sat Feb 9 01:08:49 2013 New Revision: 246576 URL: http://svnweb.freebsd.org/changeset/base/246576 Log: MFC r237574, r237625, r246256; crunch: Sync some NetBSD changes. crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated In order to merge this I also had to merge some previous changes: - Ensure crunchen uses the same make binary as the rest of the build. - Some amount of style(9): function definitions, header ordering, and $FreeBSD$. Modified: stable/9/usr.sbin/crunch/crunchgen/crunched_main.c stable/9/usr.sbin/crunch/crunchgen/crunchgen.c stable/9/usr.sbin/crunch/crunchide/crunchide.c stable/9/usr.sbin/crunch/crunchide/exec_elf32.c stable/9/usr.sbin/crunch/examples/really-big.conf Directory Properties: stable/9/usr.sbin/crunch/ (props changed) Modified: stable/9/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchgen/crunched_main.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchgen/crunched_main.c Sat Feb 9 01:08:49 2013 (r246576) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * crunched_main.c - main program for crunched binaries, it branches to a @@ -33,6 +31,10 @@ * or calls one of them based on argv[1]. This allows the testing of * the crunched binary without creating all the links. */ + +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -45,7 +47,8 @@ struct stub { extern char *__progname; extern struct stub entry_points[]; -int main(int argc, char **argv, char **envp) +int +main(int argc, char **argv, char **envp) { char *slash, *basename; struct stub *ep; @@ -68,7 +71,8 @@ int main(int argc, char **argv, char **e } -int crunched_here(char *path) +int +crunched_here(char *path) { char *slash, *basename; struct stub *ep; @@ -83,7 +87,8 @@ int crunched_here(char *path) } -int crunched_main(int argc, char **argv, char **envp) +int +crunched_main(int argc, char **argv, char **envp) { char *slash; struct stub *ep; @@ -99,7 +104,8 @@ int crunched_main(int argc, char **argv, } -int crunched_usage() +int +crunched_usage() { int columns, len; struct stub *ep; @@ -122,4 +128,3 @@ int crunched_usage() } /* end of crunched_main.c */ - Modified: stable/9/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 9 01:08:49 2013 (r246576) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * ======================================================================== @@ -32,9 +30,12 @@ * Generates a Makefile and main C file for a crunched executable, * from specs given in a .conf file. */ -#include -#include + +#include +__FBSDID("$FreeBSD$"); + #include +#include #include #include @@ -92,6 +93,7 @@ char outmkname[MAXPATHLEN], outcfname[MA char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ char *objprefix; /* where are the objects ? */ +char *path_make; int linenum = -1; int goterror = 0; @@ -103,22 +105,24 @@ int list_mode; /* general library routines */ -void status(char *str); +void status(const char *str); void out_of_memory(void); void add_string(strlst_t **listp, char *str); -int is_dir(char *pathname); -int is_nonempty_file(char *pathname); +int is_dir(const char *pathname); +int is_nonempty_file(const char *pathname); int subtract_strlst(strlst_t **lista, strlst_t **listb); int in_list(strlst_t **listp, char *str); -/* helper routines for main() */ + +extern char *crunched_skel[]; void usage(void); void parse_conf_file(void); void gen_outputs(void); -int main(int argc, char **argv) +int +main(int argc, char **argv) { char *p; int optc; @@ -127,6 +131,10 @@ int main(int argc, char **argv) readcache = 1; *outmkname = *outcfname = *execfname = '\0'; + path_make = getenv("MAKE"); + if (path_make == NULL || *path_make == '\0') + path_make = "make"; + p = getenv("MAKEOBJDIRPREFIX"); if (p == NULL || *p == '\0') objprefix = "/usr/obj"; /* default */ @@ -218,7 +226,8 @@ int main(int argc, char **argv) } -void usage(void) +void +usage(void) { fprintf(stderr, "%s%s\n\t%s%s\n", "usage: crunchgen [-foq] ", "[-h ] [-m ]", @@ -237,7 +246,7 @@ void usage(void) /* helper routines for parse_conf_file */ void parse_one_file(char *filename); -void parse_line(char *line, int *fc, char **fv, int nf); +void parse_line(char *pline, int *fc, char **fv, int nf); void add_srcdirs(int argc, char **argv); void add_progs(int argc, char **argv); void add_link(int argc, char **argv); @@ -250,7 +259,8 @@ prog_t *find_prog(char *str); void add_prog(char *progname); -void parse_conf_file(void) +void +parse_conf_file(void) { if (!is_nonempty_file(infilename)) errx(1, "fatal: input file \"%s\" not found", infilename); @@ -263,7 +273,8 @@ void parse_conf_file(void) } -void parse_one_file(char *filename) +void +parse_one_file(char *filename) { char *fieldv[MAXFIELDS]; int fieldc; @@ -329,15 +340,16 @@ void parse_one_file(char *filename) } -void parse_line(char *line, int *fc, char **fv, int nf) +void +parse_line(char *pline, int *fc, char **fv, int nf) { char *p; - p = line; + p = pline; *fc = 0; while (1) { - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if (*p == '\0' || *p == '#') @@ -346,7 +358,7 @@ void parse_line(char *line, int *fc, cha if (*fc < nf) fv[(*fc)++] = p; - while (*p && !isspace(*p) && *p != '#') + while (*p && !isspace((unsigned char)*p) && *p != '#') p++; if (*p == '\0' || *p == '#') @@ -360,7 +372,8 @@ void parse_line(char *line, int *fc, cha } -void add_srcdirs(int argc, char **argv) +void +add_srcdirs(int argc, char **argv) { int i; @@ -376,7 +389,8 @@ void add_srcdirs(int argc, char **argv) } -void add_progs(int argc, char **argv) +void +add_progs(int argc, char **argv) { int i; @@ -385,7 +399,8 @@ void add_progs(int argc, char **argv) } -void add_prog(char *progname) +void +add_prog(char *progname) { prog_t *p1, *p2; @@ -426,7 +441,8 @@ void add_prog(char *progname) } -void add_link(int argc, char **argv) +void +add_link(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -447,7 +463,8 @@ void add_link(int argc, char **argv) } -void add_libs(int argc, char **argv) +void +add_libs(int argc, char **argv) { int i; @@ -461,7 +478,8 @@ void add_libs(int argc, char **argv) } -void add_libs_so(int argc, char **argv) +void +add_libs_so(int argc, char **argv) { int i; @@ -475,7 +493,8 @@ void add_libs_so(int argc, char **argv) } -void add_buildopts(int argc, char **argv) +void +add_buildopts(int argc, char **argv) { int i; @@ -484,7 +503,8 @@ void add_buildopts(int argc, char **argv } -void add_special(int argc, char **argv) +void +add_special(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -586,7 +606,8 @@ char *genident(char *str); char *dir_search(char *progname); -void gen_outputs(void) +void +gen_outputs(void) { prog_t *p; @@ -599,13 +620,15 @@ void gen_outputs(void) gen_output_makefile(); status(""); fprintf(stderr, - "Run \"make -f %s\" to build crunched binary.\n", outmkname); + "Run \"%s -f %s\" to build crunched binary.\n", + path_make, outmkname); } /* * run the makefile for the program to find which objects are necessary */ -void fillin_program(prog_t *p) +void +fillin_program(prog_t *p) { char path[MAXPATHLEN]; char line[MAXLINELEN]; @@ -680,7 +703,8 @@ void fillin_program(prog_t *p) p->goterror = 1; } -void fillin_program_objs(prog_t *p, char *path) +void +fillin_program_objs(prog_t *p, char *path) { char *obj, *cp; int fd, rc; @@ -720,16 +744,16 @@ void fillin_program_objs(prog_t *p, char fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar); fprintf(f, "crunchgen_objs:\n" - "\t@cd %s && make -f %s $(BUILDOPTS) $(%s_OPTS)", - p->srcdir, tempfname, p->ident); + "\t@cd %s && %s -f %s $(BUILDOPTS) $(%s_OPTS)", + p->srcdir, path_make, tempfname, p->ident); for (s = p->buildopts; s != NULL; s = s->next) fprintf(f, " %s", s->str); fprintf(f, " loop\n"); fclose(f); - snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs", - p->srcdir, tempfname); + snprintf(line, MAXLINELEN, "cd %s && %s -f %s -B crunchgen_objs", + p->srcdir, path_make, tempfname); if ((f = popen(line, "r")) == NULL) { warn("submake pipe"); goterror = 1; @@ -744,17 +768,17 @@ void fillin_program_objs(prog_t *p, char } cp = line + 6; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; while(*cp) { obj = cp; - while (*cp && !isspace(*cp)) + while (*cp && !isspace((unsigned char)*cp)) cp++; if (*cp) *cp++ = '\0'; add_string(&p->objs, obj); - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; } } @@ -767,7 +791,8 @@ void fillin_program_objs(prog_t *p, char unlink(tempfname); } -void remove_error_progs(void) +void +remove_error_progs(void) { prog_t *p1, *p2; @@ -788,7 +813,8 @@ void remove_error_progs(void) } } -void gen_specials_cache(void) +void +gen_specials_cache(void) { FILE *cachef; prog_t *p; @@ -828,7 +854,8 @@ void gen_specials_cache(void) } -void gen_output_makefile(void) +void +gen_output_makefile(void) { prog_t *p; FILE *outmk; @@ -858,9 +885,9 @@ void gen_output_makefile(void) } -void gen_output_cfile(void) +void +gen_output_cfile(void) { - extern char *crunched_skel[]; char **cp; FILE *outcf; prog_t *p; @@ -918,7 +945,7 @@ char *genident(char *str) for (d = s = n; *s != '\0'; s++) { if (*s == '-') *d++ = '_'; - else if (*s == '_' || isalnum(*s)) + else if (*s == '_' || isalnum((unsigned char)*s)) *d++ = *s; } *d = '\0'; @@ -946,7 +973,8 @@ char *dir_search(char *progname) } -void top_makefile_rules(FILE *outmk) +void +top_makefile_rules(FILE *outmk) { prog_t *p; @@ -1004,7 +1032,8 @@ void top_makefile_rules(FILE *outmk) } -void prog_makefile_rules(FILE *outmk, prog_t *p) +void +prog_makefile_rules(FILE *outmk, prog_t *p) { strlst_t *lst; @@ -1089,7 +1118,8 @@ void prog_makefile_rules(FILE *outmk, pr fprintf(outmk, "%s.lo\n", p->name); } -void output_strlst(FILE *outf, strlst_t *lst) +void +output_strlst(FILE *outf, strlst_t *lst) { for (; lst != NULL; lst = lst->next) if ( strlen(lst->str) ) @@ -1104,7 +1134,8 @@ void output_strlst(FILE *outf, strlst_t * */ -void status(char *str) +void +status(const char *str) { static int lastlen = 0; int len, spaces; @@ -1123,13 +1154,15 @@ void status(char *str) } -void out_of_memory(void) +void +out_of_memory(void) { err(1, "%s: %d: out of memory, stopping", infilename, linenum); } -void add_string(strlst_t **listp, char *str) +void +add_string(strlst_t **listp, char *str) { strlst_t *p1, *p2; @@ -1153,7 +1186,8 @@ void add_string(strlst_t **listp, char * p1->next = p2; } -int subtract_strlst(strlst_t **lista, strlst_t **listb) +int +subtract_strlst(strlst_t **lista, strlst_t **listb) { int subtract_count = 0; strlst_t *p1; @@ -1166,7 +1200,8 @@ int subtract_strlst(strlst_t **lista, st return subtract_count; } -int in_list(strlst_t **listp, char *str) +int +in_list(strlst_t **listp, char *str) { strlst_t *p1; for (p1 = *listp; p1 != NULL; p1 = p1->next) @@ -1175,7 +1210,8 @@ int in_list(strlst_t **listp, char *str) return 0; } -int is_dir(char *pathname) +int +is_dir(const char *pathname) { struct stat buf; @@ -1185,7 +1221,8 @@ int is_dir(char *pathname) return S_ISDIR(buf.st_mode); } -int is_nonempty_file(char *pathname) +int +is_nonempty_file(const char *pathname) { struct stat buf; Modified: stable/9/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/crunchide.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchide/crunchide.c Sat Feb 9 01:08:49 2013 (r246576) @@ -1,5 +1,4 @@ /* $NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved. * Copyright (c) 1994 University of Maryland @@ -59,20 +58,22 @@ * that the final crunched binary BSS size is the max of all the * component programs' BSS sizes, rather than their sum. */ + #include #ifndef lint __RCSID("$NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $"); #endif +__FBSDID("$FreeBSD$"); +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include #include "extern.h" @@ -89,9 +90,8 @@ int verbose; int main(int, char *[]); -int main(argc, argv) -int argc; -char **argv; +int +main(int argc, char **argv) { int ch, errors; @@ -127,7 +127,8 @@ char **argv; return errors; } -void usage(void) +void +usage(void) { fprintf(stderr, "usage: %s [-k ] [-f ] ...\n", @@ -142,7 +143,8 @@ struct keep { char *sym; } *keep_list; -void add_to_keep_list(char *symbol) +void +add_to_keep_list(char *symbol) { struct keep *newp, *prevp, *curp; int cmp; @@ -167,7 +169,8 @@ void add_to_keep_list(char *symbol) else keep_list = newp; } -int in_keep_list(const char *symbol) +int +in_keep_list(const char *symbol) { struct keep *curp; int cmp; @@ -180,7 +183,8 @@ int in_keep_list(const char *symbol) return curp && cmp == 0; } -void add_file_to_keep_list(char *filename) +void +add_file_to_keep_list(char *filename) { FILE *keepf; char symbol[1024]; @@ -222,7 +226,8 @@ struct { #endif }; -int hide_syms(const char *filename) +int +hide_syms(const char *filename) { int fd, i, n, rv; Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 01:08:49 2013 (r246576) @@ -31,7 +31,7 @@ #include #ifndef lint #if 0 -__RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $"); +__RCSID("$NetBSD: exec_elf32.c,v 1.6 1999/09/20 04:12:16 christos Exp $"); #endif #endif __FBSDID("$FreeBSD$"); @@ -98,7 +98,7 @@ xreadatoff(int fd, void *buf, off_t off, perror(fn); return -1; } - if ((rv = read(fd, buf, size)) != size) { + if ((size_t)(rv = read(fd, buf, size)) != size) { fprintf(stderr, "%s: read error: %s\n", fn, rv == -1 ? strerror(errno) : "short read"); return -1; @@ -115,7 +115,7 @@ xwriteatoff(int fd, void *buf, off_t off perror(fn); return -1; } - if ((rv = write(fd, buf, size)) != size) { + if ((size_t)(rv = write(fd, buf, size)) != size) { fprintf(stderr, "%s: write error: %s\n", fn, rv == -1 ? strerror(errno) : "short write"); return -1; @@ -162,7 +162,7 @@ ELFNAMEEND(check)(int fd, const char *fn */ if (fstat(fd, &sb) == -1) return 0; - if (sb.st_size < sizeof eh) + if (sb.st_size < (off_t)(sizeof eh)) return 0; if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; @@ -305,7 +305,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((symtabp = xmalloc(xewtoh(symtabshdr->sh_size), fn, "symbol table")) == NULL) goto bad; - if (xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; @@ -313,7 +313,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((strtabp = xmalloc(xewtoh(strtabshdr->sh_size), fn, "string table")) == NULL) goto bad; - if (xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size)) goto bad; @@ -370,7 +370,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if (xwriteatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != shdrsize) goto bad; - if (xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; /* write new symbol table strings */ @@ -384,7 +384,7 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) - free(strtabp); + free(nstrtabp); return (rv); bad: Modified: stable/9/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- stable/9/usr.sbin/crunch/examples/really-big.conf Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/examples/really-big.conf Sat Feb 9 01:08:49 2013 (r246576) @@ -72,7 +72,7 @@ progs dev_mkdb diskpart edquota flcopy g progs iostat iteconfig kvm_mkdb mtree named portmap pppd progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd progs rwhod sa spray sysctl syslogd tcpdump -progs traceroute trpt trsp update vipw vnconfig ypbind yppoll ypset +progs traceroute trpt update vipw vnconfig ypbind yppoll ypset special amd srcdir /usr/src/usr.sbin/amd/amd special amd objs vers.amd.o afs_ops.o am_ops.o clock.o util.o xutil.o efs_ops.o mapc.o info_file.o info_hes.o info_ndbm.o info_passwd.o info_nis.o info_union.o map.o srvr_afs.o srvr_nfs.o mntfs.o misc_rpc.o mount_fs.o mtab.o mtab_bsd.o nfs_ops.o nfs_prot_svc.o nfs_start.o nfs_subr.o opts.o pfs_ops.o rpc_fwd.o sched.o sfs_ops.o amq_svc.o amq_subr.o umount_fs.o host_ops.o nfsx_ops.o ufs_ops.o ifs_ops.o amd.o get_args.o restart.o wire.o From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 01:38:45 2013 Return-Path: Delivered-To: svn-src-all@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 17EE8C7E; Sat, 9 Feb 2013 01:38:45 +0000 (UTC) (envelope-from delphij@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 EF39CF4F; Sat, 9 Feb 2013 01:38: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 r191ci8g023478; Sat, 9 Feb 2013 01:38:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r191ch7I023470; Sat, 9 Feb 2013 01:38:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090138.r191ch7I023470@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 01:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246577 - in stable/8: cddl/compat/opensolaris/include sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:38:45 -0000 Author: delphij Date: Sat Feb 9 01:38:43 2013 New Revision: 246577 URL: http://svnweb.freebsd.org/changeset/base/246577 Log: MFC r222950 (gibbs): Remove C constructs that are incompatible with C++ from various OpenSolaris and ZFS header files. These changes are sufficient to allow a C++ program to use the libzfs library. Note: The majority of these files already included 'extern "C"' declarations, so the intention of providing C++ compatibility already existed even if it wasn't provided. cddl/compat/opensolaris/include/assert.h: Wrap our compatibility assert implementation in 'extern "C"'. Since this is a compatibility header I matched the Solaris style of doing this explicitly rather than rely on FreeBSD's __BEGIN/END_DECLS macro. sys/cddl/compat/opensolaris/sys/kstat.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: Rename parameters in function declarations that conflict with C++ keywords. This was the solution preferred by members of the Illumos community. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: In C, nested structures are visible in the global namespace, but in C++, they take on the namespace of the structure in which they are contained. Flatten nested structure definitions within struct zfs_cmd so these structures are visible in the global namespace when compiled in both languages. Sponsored by: Spectra Logic Corporation Modified: stable/8/cddl/compat/opensolaris/include/assert.h stable/8/sys/cddl/compat/opensolaris/sys/kstat.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/compat/opensolaris/include/assert.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/assert.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/cddl/compat/opensolaris/include/assert.h Sat Feb 9 01:38:43 2013 (r246577) @@ -43,6 +43,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + static __inline void __assert(const char *expr, const char *file, int line) { @@ -52,4 +56,9 @@ __assert(const char *expr, const char *f abort(); /* NOTREACHED */ } + +#ifdef __cplusplus +} +#endif + #endif /* !_ASSERT_H_ */ Modified: stable/8/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/kstat.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/compat/opensolaris/sys/kstat.h Sat Feb 9 01:38:43 2013 (r246577) @@ -58,7 +58,7 @@ typedef struct kstat_named { } value; } kstat_named_t; -kstat_t *kstat_create(char *module, int instance, char *name, char *class, +kstat_t *kstat_create(char *module, int instance, char *name, char *cls, uchar_t type, ulong_t ndata, uchar_t flags); void kstat_install(kstat_t *ksp); void kstat_delete(kstat_t *ksp); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Feb 9 01:38:43 2013 (r246577) @@ -38,8 +38,8 @@ extern "C" { typedef struct arc_buf_hdr arc_buf_hdr_t; typedef struct arc_buf arc_buf_t; -typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *private); -typedef int arc_evict_func_t(void *private); +typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv); +typedef int arc_evict_func_t(void *priv); /* generic arc_done_func_t's which you can use */ arc_done_func_t arc_bcopy_func; @@ -104,17 +104,17 @@ int arc_referenced(arc_buf_t *buf); #endif int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, - arc_done_func_t *done, void *private, int priority, int flags, + arc_done_func_t *done, void *priv, int priority, int flags, uint32_t *arc_flags, const zbookmark_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp, - arc_done_func_t *ready, arc_done_func_t *done, void *private, + arc_done_func_t *ready, arc_done_func_t *done, void *priv, int priority, int zio_flags, const zbookmark_t *zb); -void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private); +void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); int arc_buf_evict(arc_buf_t *buf); void arc_flush(spa_t *spa); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:38:43 2013 (r246577) @@ -169,15 +169,15 @@ typedef struct ddt_ops { #define DDT_NAMELEN 80 extern void ddt_object_name(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, char *name); + enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, uint64_t *walk, ddt_entry_t *dde); + enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class class); + enum ddt_class cls); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, dmu_object_info_t *); + enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, - enum ddt_class class); + enum ddt_class cls); extern void ddt_bp_fill(const ddt_phys_t *ddp, blkptr_t *bp, uint64_t txg); @@ -235,7 +235,7 @@ extern void ddt_unload(spa_t *spa); extern void ddt_sync(spa_t *spa, uint64_t txg); extern int ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde); extern int ddt_object_update(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, ddt_entry_t *dde, dmu_tx_t *tx); + enum ddt_class cls, ddt_entry_t *dde, dmu_tx_t *tx); extern const ddt_ops_t ddt_zap_ops; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Sat Feb 9 01:38:43 2013 (r246577) @@ -135,10 +135,10 @@ void dsl_free(dsl_pool_t *dp, uint64_t t void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Feb 9 01:38:43 2013 (r246577) @@ -658,7 +658,7 @@ extern void spa_history_log_version(spa_ /* error handling */ struct zbookmark; extern void spa_log_error(spa_t *spa, zio_t *zio); -extern void zfs_ereport_post(const char *class, spa_t *spa, vdev_t *vd, +extern void zfs_ereport_post(const char *cls, spa_t *spa, vdev_t *vd, zio_t *zio, uint64_t stateoroffset, uint64_t length); extern void zfs_post_remove(spa_t *spa, vdev_t *vd); extern void zfs_post_state_change(spa_t *spa, vdev_t *vd); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Feb 9 01:38:43 2013 (r246577) @@ -115,6 +115,87 @@ typedef enum drr_headertype { /* * zfs ioctl command structure */ +struct drr_begin { + uint64_t drr_magic; + uint64_t drr_versioninfo; /* was drr_version */ + uint64_t drr_creation_time; + dmu_objset_type_t drr_type; + uint32_t drr_flags; + uint64_t drr_toguid; + uint64_t drr_fromguid; + char drr_toname[MAXNAMELEN]; +}; + +struct drr_end { + zio_cksum_t drr_checksum; + uint64_t drr_toguid; +}; + +struct drr_object { + uint64_t drr_object; + dmu_object_type_t drr_type; + dmu_object_type_t drr_bonustype; + uint32_t drr_blksz; + uint32_t drr_bonuslen; + uint8_t drr_checksumtype; + uint8_t drr_compress; + uint8_t drr_pad[6]; + uint64_t drr_toguid; + /* bonus content follows */ +}; + +struct drr_freeobjects { + uint64_t drr_firstobj; + uint64_t drr_numobjs; + uint64_t drr_toguid; +}; + +struct drr_write { + uint64_t drr_object; + dmu_object_type_t drr_type; + uint32_t drr_pad; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; + uint8_t drr_checksumtype; + uint8_t drr_checksumflags; + uint8_t drr_pad2[6]; + ddt_key_t drr_key; /* deduplication key */ + /* content follows */ +}; + +struct drr_free { + uint64_t drr_object; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; +}; + +struct drr_write_byref { + /* where to put the data */ + uint64_t drr_object; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; + /* where to find the prior copy of the data */ + uint64_t drr_refguid; + uint64_t drr_refobject; + uint64_t drr_refoffset; + /* properties of the data */ + uint8_t drr_checksumtype; + uint8_t drr_checksumflags; + uint8_t drr_pad2[6]; + ddt_key_t drr_key; /* deduplication key */ +}; + +struct drr_spill { + uint64_t drr_object; + uint64_t drr_length; + uint64_t drr_toguid; + uint64_t drr_pad[4]; /* needed for crypto */ + /* spill data follows */ +}; + typedef struct dmu_replay_record { enum { DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS, @@ -123,79 +204,14 @@ typedef struct dmu_replay_record { } drr_type; uint32_t drr_payloadlen; union { - struct drr_begin { - uint64_t drr_magic; - uint64_t drr_versioninfo; /* was drr_version */ - uint64_t drr_creation_time; - dmu_objset_type_t drr_type; - uint32_t drr_flags; - uint64_t drr_toguid; - uint64_t drr_fromguid; - char drr_toname[MAXNAMELEN]; - } drr_begin; - struct drr_end { - zio_cksum_t drr_checksum; - uint64_t drr_toguid; - } drr_end; - struct drr_object { - uint64_t drr_object; - dmu_object_type_t drr_type; - dmu_object_type_t drr_bonustype; - uint32_t drr_blksz; - uint32_t drr_bonuslen; - uint8_t drr_checksumtype; - uint8_t drr_compress; - uint8_t drr_pad[6]; - uint64_t drr_toguid; - /* bonus content follows */ - } drr_object; - struct drr_freeobjects { - uint64_t drr_firstobj; - uint64_t drr_numobjs; - uint64_t drr_toguid; - } drr_freeobjects; - struct drr_write { - uint64_t drr_object; - dmu_object_type_t drr_type; - uint32_t drr_pad; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - uint8_t drr_checksumtype; - uint8_t drr_checksumflags; - uint8_t drr_pad2[6]; - ddt_key_t drr_key; /* deduplication key */ - /* content follows */ - } drr_write; - struct drr_free { - uint64_t drr_object; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - } drr_free; - struct drr_write_byref { - /* where to put the data */ - uint64_t drr_object; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - /* where to find the prior copy of the data */ - uint64_t drr_refguid; - uint64_t drr_refobject; - uint64_t drr_refoffset; - /* properties of the data */ - uint8_t drr_checksumtype; - uint8_t drr_checksumflags; - uint8_t drr_pad2[6]; - ddt_key_t drr_key; /* deduplication key */ - } drr_write_byref; - struct drr_spill { - uint64_t drr_object; - uint64_t drr_length; - uint64_t drr_toguid; - uint64_t drr_pad[4]; /* needed for crypto */ - /* spill data follows */ - } drr_spill; + struct drr_begin drr_begin; + struct drr_end drr_end; + struct drr_object drr_object; + struct drr_freeobjects drr_freeobjects; + struct drr_write drr_write; + struct drr_free drr_free; + struct drr_write_byref drr_write_byref; + struct drr_spill drr_spill; } drr_u; } dmu_replay_record_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 01:38:43 2013 (r246577) @@ -439,22 +439,22 @@ struct zio { }; extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_root(spa_t *spa, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, - uint64_t size, zio_done_func_t *done, void *private, + uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, const zbookmark_t *zb); extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *done, void *private, + zio_done_func_t *ready, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, const zbookmark_t *zb); extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, - void *data, uint64_t size, zio_done_func_t *done, void *private, + void *data, uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, zbookmark_t *zb); extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, @@ -464,19 +464,20 @@ extern void zio_free(spa_t *spa, uint64_ extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags); + zio_done_func_t *done, void *priv, int priority, + enum zio_flag flags); extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags, + zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, boolean_t labels); extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags, + zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, boolean_t labels); extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, @@ -507,11 +508,11 @@ extern void zio_resubmit_stage_async(voi extern zio_t *zio_vdev_child_io(zio_t *zio, blkptr_t *bp, vdev_t *vd, uint64_t offset, void *data, uint64_t size, int type, int priority, - enum zio_flag flags, zio_done_func_t *done, void *private); + enum zio_flag flags, zio_done_func_t *done, void *priv); extern zio_t *zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size, int type, int priority, - enum zio_flag flags, zio_done_func_t *done, void *private); + enum zio_flag flags, zio_done_func_t *done, void *priv); extern void zio_vdev_io_bypass(zio_t *zio); extern void zio_vdev_io_reissue(zio_t *zio); From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 01:41:23 2013 Return-Path: Delivered-To: svn-src-all@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 8ADD9FC1; Sat, 9 Feb 2013 01:41:23 +0000 (UTC) (envelope-from delphij@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 F17C9F65; Sat, 9 Feb 2013 01:41: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 r191fMJc025457; Sat, 9 Feb 2013 01:41:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r191fMfi025453; Sat, 9 Feb 2013 01:41:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090141.r191fMfi025453@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 01:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246578 - in stable/8: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:41:23 -0000 Author: delphij Date: Sat Feb 9 01:41:21 2013 New Revision: 246578 URL: http://svnweb.freebsd.org/changeset/base/246578 Log: MFC r245264: The current ZFS code expects ddt_zap_count to always succeed by asserting the underlying zap_count() to return no errors. However, it is possible that the pool reaches to such a state where zap_count would return error, leading to panics when a pool is imported. This commit changes the ddt_zap_count to return error returned from zap_count and handle the error appropriately. With this change, it's now possible to let zpool rollback damaged transaction groups and import the pool. Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 01:41:21 2013 (r246578) @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 01:41:21 2013 (r246578) @@ -89,12 +89,13 @@ ddt_object_destroy(ddt_t *ddt, enum ddt_ spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); ASSERT(*objectp != 0); - ASSERT(ddt_object_count(ddt, type, class) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0 && count == 0); ASSERT(ddt_histogram_empty(&ddt->ddt_histogram[type][class])); VERIFY(zap_remove(os, DMU_POOL_DIRECTORY_OBJECT, name, tx) == 0); VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); @@ -109,6 +110,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; int error; @@ -129,7 +131,11 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + error = ddt_object_count(ddt, type, class, &count); + if (error) + return error; + + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; @@ -143,6 +149,7 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); @@ -155,8 +162,9 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ * Cache DDT statistics; this is the only time they'll change. */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; } @@ -213,13 +221,13 @@ ddt_object_walk(ddt_t *ddt, enum ddt_typ ddt->ddt_object[type][class], dde, walk)); } -uint64_t -ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +int +ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class, uint64_t *count) { ASSERT(ddt_object_exists(ddt, type, class)); return (ddt_ops[type]->ddt_op_count(ddt->ddt_os, - ddt->ddt_object[type][class])); + ddt->ddt_object[type][class], count)); } int @@ -1079,11 +1087,13 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, } for (enum ddt_type type = 0; type < DDT_TYPES; type++) { - uint64_t count = 0; + uint64_t add, count = 0; for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { if (ddt_object_exists(ddt, type, class)) { ddt_object_sync(ddt, type, class, tx); - count += ddt_object_count(ddt, type, class); + VERIFY(ddt_object_count(ddt, type, class, + &add) == 0); + count += add; } } for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 01:41:21 2013 (r246578) @@ -133,14 +133,11 @@ ddt_zap_walk(objset_t *os, uint64_t obje return (error); } -static uint64_t -ddt_zap_count(objset_t *os, uint64_t object) +static int +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count) { - uint64_t count = 0; - VERIFY(zap_count(os, object, &count) == 0); - - return (count); + return (zap_count(os, object, count)); } const ddt_ops_t ddt_zap_ops = { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:41:21 2013 (r246578) @@ -163,7 +163,7 @@ typedef struct ddt_ops { dmu_tx_t *tx); int (*ddt_op_walk)(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk); - uint64_t (*ddt_op_count)(objset_t *os, uint64_t object); + int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; #define DDT_NAMELEN 80 @@ -172,8 +172,8 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); -extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class cls); +extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, + enum ddt_class class, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 02:42:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A633467F; Sat, 9 Feb 2013 02:42:02 +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 818AA185; Sat, 9 Feb 2013 02:42: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 r192g2Nv043597; Sat, 9 Feb 2013 02:42:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r192g2aV043596; Sat, 9 Feb 2013 02:42:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302090242.r192g2aV043596@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Feb 2013 02:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246579 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 02:42:02 -0000 Author: adrian Date: Sat Feb 9 02:42:01 2013 New Revision: 246579 URL: http://svnweb.freebsd.org/changeset/base/246579 Log: The encryption type field needs to be preserved for each descriptor making up a frame, in both a sub-frame and for all frames in an aggregate. Tested: * AR5416, STA mode 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 Sat Feb 9 01:41:21 2013 (r246578) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Feb 9 02:42:01 2013 (r246579) @@ -306,10 +306,14 @@ ar5416FillTxDesc(struct ath_hal *ah, str & AR_TxIntrReq; ads->ds_ctl2 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl2); ads->ds_ctl3 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl3); + /* ctl6 - we only need encrtype; the rest are blank */ + ads->ds_ctl6 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl6 & AR_EncrType); #else ads->ds_ctl0 = AR5416DESC_CONST(ds0)->ds_ctl0 & AR_TxIntrReq; ads->ds_ctl2 = AR5416DESC_CONST(ds0)->ds_ctl2; ads->ds_ctl3 = AR5416DESC_CONST(ds0)->ds_ctl3; + /* ctl6 - we only need encrtype; the rest are blank */ + ads->ds_ctl6 = AR5416DESC_CONST(ds0)->ds_ctl6 & AR_EncrType; #endif } else { /* !firstSeg && !lastSeg */ /* @@ -318,8 +322,10 @@ ar5416FillTxDesc(struct ath_hal *ah, str #ifdef AH_NEED_DESC_SWAP ads->ds_ctl0 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl0) & AR_TxIntrReq; + ads->ds_ctl6 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl6 & AR_EncrType); #else ads->ds_ctl0 = AR5416DESC_CONST(ds0)->ds_ctl0 & AR_TxIntrReq; + ads->ds_ctl6 = AR5416DESC_CONST(ds0)->ds_ctl6 & AR_EncrType; #endif ads->ds_ctl1 = segLen | AR_TxMore; ads->ds_ctl2 = 0; From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 02:57:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 69AEE995; Sat, 9 Feb 2013 02:57:38 +0000 (UTC) (envelope-from pfg@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 501151F8; Sat, 9 Feb 2013 02:57: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 r192vcaj047413; Sat, 9 Feb 2013 02:57:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r192vcUt047412; Sat, 9 Feb 2013 02:57:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302090257.r192vcUt047412@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 9 Feb 2013 02:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246580 - stable/9/usr.sbin/crunch/crunchide X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 02:57:38 -0000 Author: pfg Date: Sat Feb 9 02:57:37 2013 New Revision: 246580 URL: http://svnweb.freebsd.org/changeset/base/246580 Log: MFC r246278; crunch: some more NetBSD syncing. Obtained from: NetBSD Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/9/usr.sbin/crunch/ (props changed) Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 02:42:01 2013 (r246579) +++ stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 02:57:37 2013 (r246580) @@ -384,6 +384,8 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) + free(strtabp); + if (nstrtabp != NULL) free(nstrtabp); return (rv); From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 04:13:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F8B315F; Sat, 9 Feb 2013 04:13:46 +0000 (UTC) (envelope-from delphij@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 381C26C6; Sat, 9 Feb 2013 04:13: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 r194DjLF071574; Sat, 9 Feb 2013 04:13:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r194DjI0071573; Sat, 9 Feb 2013 04:13:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090413.r194DjI0071573@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 04:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246581 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 04:13:46 -0000 Author: delphij Date: Sat Feb 9 04:13:45 2013 New Revision: 246581 URL: http://svnweb.freebsd.org/changeset/base/246581 Log: Fix LINT build on amd64. Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Sat Feb 9 02:57:37 2013 (r246580) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Sat Feb 9 04:13:45 2013 (r246581) @@ -936,16 +936,16 @@ mlx4_en_transmit_locked(struct ifnet *de return (err); } /* Process the queue */ - while ((next = drbr_peek(ifp, ring->br)) != NULL) { + while ((next = drbr_peek(dev, ring->br)) != NULL) { if ((err = mlx4_en_xmit(dev, tx_ind, &next)) != 0) { if (next == NULL) { - drbr_advance(ifp, ring->br); + drbr_advance(dev, ring->br); } else { - drbr_putback(ifp, ring->br, next); + drbr_putback(dev, ring->br, next); } break; } - drbr_advance(ifp, ring->br); + drbr_advance(dev, ring->br); enqueued++; dev->if_obytes += next->m_pkthdr.len; if (next->m_flags & M_MCAST) From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 06:11:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C123D2D; Sat, 9 Feb 2013 06:11:47 +0000 (UTC) (envelope-from bryanv@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 664AA9E3; Sat, 9 Feb 2013 06:11: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 r196BlAe006905; Sat, 9 Feb 2013 06:11:47 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196BkPt006896; Sat, 9 Feb 2013 06:11:46 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090611.r196BkPt006896@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246582 - in stable/9/sys/dev/virtio: . balloon block network pci scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:11:47 -0000 Author: bryanv Date: Sat Feb 9 06:11:45 2013 New Revision: 246582 URL: http://svnweb.freebsd.org/changeset/base/246582 Log: MFC r238072,r238360,r240430,r241469,r241470,r241495,r244136,r244200 Sync VirtIO with HEAD. - r238072: Do not include in the local headers. - r238360: Various VirtIO improvements - r240430: No need to leak these into the includer's namespace. - r241469: virtqueue: Fix non-indirect virtqueues - r241470: Add Virtio SCSI driver - r241495: Fix build with PAE enabled - r244136: Remove duplicated lines - r244200: Start taskqueues threads after attach cannot fail Approved by: grehan (mentor) Added: stable/9/sys/dev/virtio/scsi/ - copied from r241470, head/sys/dev/virtio/scsi/ Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c stable/9/sys/dev/virtio/balloon/virtio_balloon.h stable/9/sys/dev/virtio/block/virtio_blk.c stable/9/sys/dev/virtio/block/virtio_blk.h stable/9/sys/dev/virtio/network/if_vtnet.c stable/9/sys/dev/virtio/network/virtio_net.h stable/9/sys/dev/virtio/pci/virtio_pci.c stable/9/sys/dev/virtio/pci/virtio_pci.h stable/9/sys/dev/virtio/scsi/virtio_scsi.c stable/9/sys/dev/virtio/virtio.c stable/9/sys/dev/virtio/virtio.h stable/9/sys/dev/virtio/virtio_ring.h stable/9/sys/dev/virtio/virtqueue.c stable/9/sys/dev/virtio/virtqueue.h Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- stable/9/sys/dev/virtio/balloon/virtio_balloon.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.c Sat Feb 9 06:11:45 2013 (r246582) @@ -412,7 +412,6 @@ vtballoon_send_page_frames(struct vtball * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); VTBALLOON_UNLOCK(sc); Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- stable/9/sys/dev/virtio/balloon/virtio_balloon.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BALLOON_H #define _VIRTIO_BALLOON_H -#include - /* Feature bits. */ #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0x1 /* Tell before reclaiming pages */ #define VIRTIO_BALLOON_F_STATS_VQ 0x2 /* Memory stats virtqueue */ Modified: stable/9/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/9/sys/dev/virtio/block/virtio_blk.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/block/virtio_blk.c Sat Feb 9 06:11:45 2013 (r246582) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -119,7 +118,7 @@ static int vtblk_shutdown(device_t); static int vtblk_open(struct disk *); static int vtblk_close(struct disk *); static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); + struct thread *); static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); static void vtblk_strategy(struct bio *); @@ -193,7 +192,7 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) #define VTBLK_DISK_NAME "vtbd" -#define VTBLK_QUIESCE_TIMEOUT (30 * hz) +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -201,8 +200,6 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ */ #define VTBLK_MIN_SEGMENTS 2 -static uma_zone_t vtblk_req_zone; - static device_method_t vtblk_methods[] = { /* Device methods. */ DEVMETHOD(device_probe, vtblk_probe), @@ -236,19 +233,8 @@ vtblk_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: - vtblk_req_zone = uma_zcreate("vtblk_request", - sizeof(struct vtblk_request), - NULL, NULL, NULL, NULL, 0, 0); - break; case MOD_QUIESCE: case MOD_UNLOAD: - if (uma_zone_get_cur(vtblk_req_zone) > 0) - error = EBUSY; - else if (type == MOD_UNLOAD) { - uma_zdestroy(vtblk_req_zone); - vtblk_req_zone = NULL; - } - break; case MOD_SHUTDOWN: break; default: @@ -316,7 +302,7 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); - if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { error = EINVAL; device_printf(dev, "fewer than minimum number of segments " "allowed: %d\n", sc->vtblk_max_nsegs); @@ -352,8 +338,6 @@ vtblk_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { @@ -361,6 +345,9 @@ vtblk_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); @@ -493,7 +480,6 @@ vtblk_dump(void *arg, void *virtual, vm_ int error; dp = arg; - error = 0; if ((sc = dp->d_drv1) == NULL) return (ENXIO); @@ -539,7 +525,7 @@ vtblk_strategy(struct bio *bp) return; } -#ifdef INVARIANTS +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize @@ -547,13 +533,13 @@ vtblk_strategy(struct bio *bp) */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { int nsegs, max_nsegs; - + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; KASSERT(nsegs <= max_nsegs, - ("bio spanned too many segments: %d, max: %d", - nsegs, max_nsegs)); + ("bio %p spanned too many segments: %d, max: %d", + bp, nsegs, max_nsegs)); } #endif @@ -800,27 +786,22 @@ vtblk_execute_request(struct vtblk_softc VTBLK_LOCK_ASSERT(sc); sglist_reset(sg); - error = sglist_append(sg, &req->vbr_hdr, - sizeof(struct virtio_blk_outhdr)); - KASSERT(error == 0, ("error adding header to sglist")); - KASSERT(sg->sg_nseg == 1, - ("header spanned multiple segments: %d", sg->sg_nseg)); + + sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append(sg, bp->bio_data, bp->bio_bcount); - KASSERT(error == 0, ("error adding buffer to sglist")); + if (error || sg->sg_nseg == sg->sg_maxseg) + panic("%s: data buffer too big bio:%p error:%d", + __FUNCTION__, bp, error); /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) - writable += sg->sg_nseg - 1; + writable = sg->sg_nseg - 1; } - error = sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - KASSERT(error == 0, ("error adding ack to sglist")); writable++; - - KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, - ("fewer than min segments: %d", sg->sg_nseg)); + sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); readable = sg->sg_nseg - writable; @@ -995,12 +976,10 @@ vtblk_flush_dump(struct vtblk_softc *sc) static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { - device_t dev; struct virtqueue *vq; struct vtblk_request *r; int error; - dev = sc->vtblk_dev; vq = sc->vtblk_vq; if (!virtqueue_empty(vq)) @@ -1013,12 +992,12 @@ vtblk_poll_request(struct vtblk_softc *s virtqueue_notify(vq); r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response")); + KASSERT(r == req, ("unexpected request response: %p/%p", r, req)); error = vtblk_request_error(req); if (error && bootverbose) { - device_printf(dev, "vtblk_poll_request: IO error: %d\n", - error); + device_printf(sc->vtblk_dev, + "%s: IO error: %d\n", __FUNCTION__, error); } return (error); @@ -1090,6 +1069,20 @@ vtblk_drain(struct vtblk_softc *sc) vtblk_free_requests(sc); } +#ifdef INVARIANTS +static void +vtblk_request_invariants(struct vtblk_request *req) +{ + int hdr_nsegs, ack_nsegs; + + hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); + ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); + + KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); + KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); +} +#endif + static int vtblk_alloc_requests(struct vtblk_softc *sc) { @@ -1107,10 +1100,14 @@ vtblk_alloc_requests(struct vtblk_softc nreqs /= VTBLK_MIN_SEGMENTS; for (i = 0; i < nreqs; i++) { - req = uma_zalloc(vtblk_req_zone, M_NOWAIT); + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); if (req == NULL) return (ENOMEM); +#ifdef INVARIANTS + vtblk_request_invariants(req); +#endif + sc->vtblk_request_count++; vtblk_enqueue_request(sc, req); } @@ -1128,10 +1125,11 @@ vtblk_free_requests(struct vtblk_softc * while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; - uma_zfree(vtblk_req_zone, req); + free(req, M_DEVBUF); } - KASSERT(sc->vtblk_request_count == 0, ("leaked requests")); + KASSERT(sc->vtblk_request_count == 0, + ("leaked requests: %d", sc->vtblk_request_count)); } static struct vtblk_request * Modified: stable/9/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- stable/9/sys/dev/virtio/block/virtio_blk.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/block/virtio_blk.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H -#include - /* Feature bits */ #define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ #define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ Modified: stable/9/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/9/sys/dev/virtio/network/if_vtnet.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/network/if_vtnet.c Sat Feb 9 06:11:45 2013 (r246582) @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) ether_ifdetach(ifp); goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; ether_ifdetach(ifp); goto fail; } + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); + /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. @@ -748,11 +747,9 @@ vtnet_is_link_up(struct vtnet_softc *sc) static void vtnet_update_link_status(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int link; - dev = sc->vtnet_dev; ifp = sc->vtnet_ifp; link = vtnet_is_link_up(sc); Modified: stable/9/sys/dev/virtio/network/virtio_net.h ============================================================================== --- stable/9/sys/dev/virtio/network/virtio_net.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/network/virtio_net.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_NET_H #define _VIRTIO_NET_H -#include - /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0x00001 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 0x00002 /* Guest handles pkts w/ partial csum*/ Modified: stable/9/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- stable/9/sys/dev/virtio/pci/virtio_pci.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/pci/virtio_pci.c Sat Feb 9 06:11:45 2013 (r246582) @@ -57,12 +57,15 @@ struct vtpci_softc { struct resource *vtpci_msix_res; uint64_t vtpci_features; uint32_t vtpci_flags; -#define VIRTIO_PCI_FLAG_NO_MSI 0x0001 -#define VIRTIO_PCI_FLAG_MSI 0x0002 -#define VIRTIO_PCI_FLAG_NO_MSIX 0x0010 -#define VIRTIO_PCI_FLAG_MSIX 0x0020 -#define VIRTIO_PCI_FLAG_SHARED_MSIX 0x0040 +#define VTPCI_FLAG_NO_MSI 0x0001 +#define VTPCI_FLAG_NO_MSIX 0x0002 +#define VTPCI_FLAG_LEGACY 0x1000 +#define VTPCI_FLAG_MSI 0x2000 +#define VTPCI_FLAG_MSIX 0x4000 +#define VTPCI_FLAG_SHARED_MSIX 0x8000 +#define VTPCI_FLAG_ITYPE_MASK 0xF000 + /* This "bus" will only ever have one child. */ device_t vtpci_child_dev; struct virtio_feature_desc *vtpci_child_feat_desc; @@ -80,7 +83,8 @@ struct vtpci_softc { int vtpci_nvqs; struct vtpci_virtqueue { struct virtqueue *vq; - + /* Device did not provide a callback for this virtqueue. */ + int no_intr; /* Index into vtpci_intr_res[] below. Unused, then -1. */ int ires_idx; } vtpci_vqx[VIRTIO_MAX_VIRTQUEUES]; @@ -130,24 +134,39 @@ static void vtpci_describe_features(stru uint64_t); static void vtpci_probe_and_attach_child(struct vtpci_softc *); -static int vtpci_alloc_interrupts(struct vtpci_softc *, int, int, - struct vq_alloc_info *); -static int vtpci_alloc_intr_resources(struct vtpci_softc *, int, - struct vq_alloc_info *); -static int vtpci_alloc_msi(struct vtpci_softc *); -static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); +static int vtpci_alloc_intr_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_intr_resources(struct vtpci_softc *); + +static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_msix_interrupts(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); + static int vtpci_register_msix_vector(struct vtpci_softc *, int, int); +static int vtpci_set_host_msix_vectors(struct vtpci_softc *); +static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); static void vtpci_free_interrupts(struct vtpci_softc *); static void vtpci_free_virtqueues(struct vtpci_softc *); +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_release_child_resources(struct vtpci_softc *); static void vtpci_reset(struct vtpci_softc *); +static void vtpci_select_virtqueue(struct vtpci_softc *, int); + static int vtpci_legacy_intr(void *); static int vtpci_vq_shared_intr(void *); static int vtpci_vq_intr(void *); static int vtpci_config_intr(void *); +#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt + /* * I/O port read/write wrappers. */ @@ -252,7 +271,7 @@ vtpci_attach(device_t dev) } if (pci_find_extcap(dev, PCIY_MSI, NULL) != 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSI; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; if (pci_find_extcap(dev, PCIY_MSIX, NULL) == 0) { rid = PCIR_BAR(1); @@ -261,7 +280,7 @@ vtpci_attach(device_t dev) } if (sc->vtpci_msix_res == NULL) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSIX; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; vtpci_reset(sc); @@ -372,6 +391,16 @@ vtpci_read_ivar(device_t dev, device_t c switch (index) { case VIRTIO_IVAR_DEVTYPE: + case VIRTIO_IVAR_SUBDEVICE: + *result = pci_get_subdevice(dev); + break; + case VIRTIO_IVAR_VENDOR: + *result = pci_get_vendor(dev); + break; + case VIRTIO_IVAR_DEVICE: + *result = pci_get_device(dev); + break; + case VIRTIO_IVAR_SUBVENDOR: *result = pci_get_subdevice(dev); break; default: @@ -442,102 +471,97 @@ vtpci_alloc_virtqueues(device_t dev, int struct vq_alloc_info *vq_info) { struct vtpci_softc *sc; + struct virtqueue *vq; struct vtpci_virtqueue *vqx; struct vq_alloc_info *info; - int queue, error; - uint16_t vq_size; + int idx, error; + uint16_t size; sc = device_get_softc(dev); + error = 0; - if (sc->vtpci_nvqs != 0 || nvqs <= 0 || - nvqs > VIRTIO_MAX_VIRTQUEUES) + if (sc->vtpci_nvqs != 0) + return (EALREADY); + if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - error = vtpci_alloc_interrupts(sc, flags, nvqs, vq_info); - if (error) { - device_printf(dev, "cannot allocate interrupts\n"); - return (error); - } - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); - if (error) - return (error); - } + if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (queue = 0; queue < nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - info = &vq_info[queue]; - - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_alloc(dev, queue, vq_size, - VIRTIO_PCI_VRING_ALIGN, 0xFFFFFFFFUL, info, &vqx->vq); - if (error) - return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); + for (idx = 0; idx < nvqs; idx++) { + vqx = &sc->vtpci_vqx[idx]; + info = &vq_info[idx]; + + vtpci_select_virtqueue(sc, idx); + size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + + error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, + 0xFFFFFFFFUL, info, &vq); + if (error) { + device_printf(dev, + "cannot allocate virtqueue %d: %d\n", idx, error); + break; } vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + + vqx->vq = *info->vqai_vq = vq; + vqx->no_intr = info->vqai_intr == NULL; - *info->vqai_vq = vqx->vq; sc->vtpci_nvqs++; } - return (0); + return (error); } static int vtpci_setup_intr(device_t dev, enum intr_type type) { struct vtpci_softc *sc; - struct vtpci_intr_resource *ires; - struct vtpci_virtqueue *vqx; - int i, flags, error; + int attempt, error; sc = device_get_softc(dev); - flags = type | INTR_MPSAFE; - ires = &sc->vtpci_intr_res[0]; - - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) == 0) { - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_legacy_intr, NULL, sc, &ires->intrhand); - return (error); - } - - error = bus_setup_intr(dev, ires->irq, flags, vtpci_config_intr, - NULL, sc, &ires->intrhand); - if (error) - return (error); + for (attempt = 0; attempt < 5; attempt++) { + /* + * Start with the most desirable interrupt configuration and + * fallback towards less desirable ones. + */ + switch (attempt) { + case 0: + error = vtpci_alloc_intr_msix_pervq(sc); + break; + case 1: + error = vtpci_alloc_intr_msix_shared(sc); + break; + case 2: + error = vtpci_alloc_intr_msi(sc); + break; + case 3: + error = vtpci_alloc_intr_legacy(sc); + break; + default: + device_printf(dev, + "exhausted all interrupt allocation attempts\n"); + return (ENXIO); + } - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) { - ires = &sc->vtpci_intr_res[1]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error == 0 && vtpci_setup_interrupts(sc, type) == 0) + break; - return (error); + vtpci_cleanup_setup_intr_attempt(sc); } - /* Setup an interrupt handler for each virtqueue. */ - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; - if (vqx->ires_idx < 1) - continue; - - ires = &sc->vtpci_intr_res[vqx->ires_idx]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); - if (error) - return (error); + if (bootverbose) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + device_printf(dev, "using legacy interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + device_printf(dev, "using MSI interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) + device_printf(dev, "using shared MSIX interrupts\n"); + else + device_printf(dev, "using per VQ MSIX interrupts\n"); } return (0); @@ -554,20 +578,19 @@ static int vtpci_reinit(device_t dev, uint64_t features) { struct vtpci_softc *sc; - struct vtpci_virtqueue *vqx; - struct virtqueue *vq; - int queue, error; - uint16_t vq_size; + int idx, error; sc = device_get_softc(dev); /* - * Redrive the device initialization. This is a bit of an abuse - * of the specification, but both VirtualBox and QEMU/KVM seem - * to play nice. We do not allow the host device to change from - * what was originally negotiated beyond what the guest driver - * changed (MSIX state should not change, number of virtqueues - * and their size remain the same, etc). + * Redrive the device initialization. This is a bit of an abuse of + * the specification, but VirtualBox, QEMU/KVM, and BHyVe seem to + * play nice. + * + * We do not allow the host device to change from what was originally + * negotiated beyond what the guest driver changed. MSIX state should + * not change, number of virtqueues and their size remain the same, etc. + * This will need to be rethought when we want to support migration. */ if (vtpci_get_status(dev) != VIRTIO_CONFIG_STATUS_RESET) @@ -582,34 +605,16 @@ vtpci_reinit(device_t dev, uint64_t feat vtpci_negotiate_features(dev, features); - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + error = vtpci_reinit_virtqueue(sc, idx); if (error) return (error); } - for (queue = 0; queue < sc->vtpci_nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - vq = vqx->vq; - - KASSERT(vq != NULL, ("vq %d not allocated", queue)); - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_reinit(vq, vq_size); + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + error = vtpci_set_host_msix_vectors(sc); if (error) return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); - } - - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); } return (0); @@ -744,7 +749,6 @@ vtpci_probe_and_attach_child(struct vtpc vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); vtpci_reset(sc); vtpci_release_child_resources(sc); - /* Reset status for future attempt. */ vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); } else @@ -752,42 +756,126 @@ vtpci_probe_and_attach_child(struct vtpc } static int -vtpci_alloc_interrupts(struct vtpci_softc *sc, int flags, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +{ + device_t dev; + int nmsix, cnt, required; + + dev = sc->vtpci_dev; + + /* Allocate an additional vector for the config changes. */ + required = nvectors + 1; + + nmsix = pci_msix_count(dev); + if (nmsix < required) + return (1); + + cnt = required; + if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_msi(struct vtpci_softc *sc) +{ + device_t dev; + int nmsi, cnt, required; + + dev = sc->vtpci_dev; + required = 1; + + nmsi = pci_msi_count(dev); + if (nmsi < required) + return (1); + + cnt = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_intr_msix_pervq(struct vtpci_softc *sc) { int i, nvectors, error; - /* - * Only allocate a vector for virtqueues that are actually - * expecting an interrupt. - */ - for (nvectors = 0, i = 0; i < nvqs; i++) - if (vq_info[i].vqai_intr != NULL) + if (vtpci_disable_msix != 0 || + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); + + for (nvectors = 0, i = 0; i < sc->vtpci_nvqs; i++) { + if (sc->vtpci_vqx[i].no_intr == 0) nvectors++; + } + + error = vtpci_alloc_msix(sc, nvectors); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSIX; + + return (0); +} + +static int +vtpci_alloc_intr_msix_shared(struct vtpci_softc *sc) +{ + int error; if (vtpci_disable_msix != 0 || - sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSIX || - flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX || - vtpci_alloc_msix(sc, nvectors) != 0) { - /* - * Use MSI interrupts if available. Otherwise, we fallback - * to legacy interrupts. - */ - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSI) == 0 && - vtpci_alloc_msi(sc) == 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSI; + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); - sc->vtpci_nintr_res = 1; - } + error = vtpci_alloc_msix(sc, 1); + if (error) + return (error); - error = vtpci_alloc_intr_resources(sc, nvqs, vq_info); + sc->vtpci_flags |= VTPCI_FLAG_MSIX | VTPCI_FLAG_SHARED_MSIX; - return (error); + return (0); } static int -vtpci_alloc_intr_resources(struct vtpci_softc *sc, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_intr_msi(struct vtpci_softc *sc) +{ + int error; + + /* Only BHyVe supports MSI. */ + if (sc->vtpci_flags & VTPCI_FLAG_NO_MSI) + return (ENOTSUP); + + error = vtpci_alloc_msi(sc); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSI; + + return (0); +} + +static int +vtpci_alloc_intr_legacy(struct vtpci_softc *sc) +{ + + sc->vtpci_flags |= VTPCI_FLAG_LEGACY; + sc->vtpci_nintr_res = 1; + + return (0); +} + +static int +vtpci_alloc_intr_resources(struct vtpci_softc *sc) { device_t dev; struct resource *irq; @@ -795,14 +883,14 @@ vtpci_alloc_intr_resources(struct vtpci_ int i, rid, flags, res_idx; dev = sc->vtpci_dev; - flags = RF_ACTIVE; - if ((sc->vtpci_flags & - (VIRTIO_PCI_FLAG_MSI | VIRTIO_PCI_FLAG_MSIX)) == 0) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) { rid = 0; - flags |= RF_SHAREABLE; - } else + flags = RF_ACTIVE | RF_SHAREABLE; + } else { rid = 1; + flags = RF_ACTIVE; + } for (i = 0; i < sc->vtpci_nintr_res; i++) { irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); @@ -814,16 +902,16 @@ vtpci_alloc_intr_resources(struct vtpci_ } /* - * Map the virtqueue into the correct index in vq_intr_res[]. Note the - * first index is reserved for configuration changes notifications. + * Map the virtqueue into the correct index in vq_intr_res[]. The + * first index is reserved for configuration changed notifications. */ - for (i = 0, res_idx = 1; i < nvqs; i++) { + for (i = 0, res_idx = 1; i < sc->vtpci_nvqs; i++) { vqx = &sc->vtpci_vqx[i]; - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - if (vq_info[i].vqai_intr == NULL) + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + if (vqx->no_intr != 0) vqx->ires_idx = -1; - else if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) vqx->ires_idx = res_idx; else vqx->ires_idx = res_idx++; @@ -835,110 +923,180 @@ vtpci_alloc_intr_resources(struct vtpci_ } static int -vtpci_alloc_msi(struct vtpci_softc *sc) +vtpci_setup_legacy_interrupt(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsi, cnt; + struct vtpci_intr_resource *ires; + int error; dev = sc->vtpci_dev; - nmsi = pci_msi_count(dev); - - if (nmsi < 1) - return (1); - cnt = 1; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt == 1) - return (0); + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_legacy_intr, NULL, + sc, &ires->intrhand); - return (1); + return (error); } static int -vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsix, cnt, required; + struct vtpci_intr_resource *ires; + struct vtpci_virtqueue *vqx; + int i, error; dev = sc->vtpci_dev; - nmsix = pci_msix_count(dev); - if (nmsix < 1) - return (1); + /* + * The first resource is used for configuration changed interrupts. + */ + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_config_intr, + NULL, sc, &ires->intrhand); + if (error) + return (error); - /* An additional vector is needed for the config changes. */ - required = nvectors + 1; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) - goto out; + if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) { + ires = &sc->vtpci_intr_res[1]; - pci_release_msi(dev); + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error) + return (error); + } else { + /* + * Each remaining resource is assigned to a specific virtqueue. + */ + for (i = 0; i < sc->vtpci_nvqs; i++) { + vqx = &sc->vtpci_vqx[i]; + if (vqx->ires_idx < 1) + continue; + + ires = &sc->vtpci_intr_res[vqx->ires_idx]; + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); + if (error) + return (error); + } } - /* Attempt shared MSIX configuration. */ - required = 2; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_flags |= VIRTIO_PCI_FLAG_SHARED_MSIX; - goto out; - } + error = vtpci_set_host_msix_vectors(sc); + if (error) + return (error); - pci_release_msi(dev); - } + return (0); +} - return (1); +static int +vtpci_setup_interrupts(struct vtpci_softc *sc, enum intr_type type) +{ + int error; -out: - sc->vtpci_nintr_res = required; - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSIX; + type |= INTR_MPSAFE; + KASSERT(sc->vtpci_flags & VTPCI_FLAG_ITYPE_MASK, + ("no interrupt type selected: %#x", sc->vtpci_flags)); - if (bootverbose) { - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) - device_printf(dev, "using shared virtqueue MSIX\n"); - else - device_printf(dev, "using per virtqueue MSIX\n"); - } + error = vtpci_alloc_intr_resources(sc); + if (error) + return (error); - return (0); + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + error = vtpci_setup_legacy_interrupt(sc, type); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + error = vtpci_setup_msi_interrupt(sc, type); + else + error = vtpci_setup_msix_interrupts(sc, type); + + return (error); } static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 06:29:16 2013 Return-Path: Delivered-To: svn-src-all@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 65E0FF41; Sat, 9 Feb 2013 06:29:16 +0000 (UTC) (envelope-from bryanv@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 3FB73A3E; Sat, 9 Feb 2013 06:29: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 r196TG4C010792; Sat, 9 Feb 2013 06:29:16 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196TGKg010791; Sat, 9 Feb 2013 06:29:16 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090629.r196TGKg010791@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246583 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:29:16 -0000 Author: bryanv Date: Sat Feb 9 06:29:15 2013 New Revision: 246583 URL: http://svnweb.freebsd.org/changeset/base/246583 Log: MFC r230461 Connect VirtIO-related manpages to the build. Approved by: grehan (mentor) Modified: stable/9/share/man/man4/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sat Feb 9 06:11:45 2013 (r246582) +++ stable/9/share/man/man4/Makefile Sat Feb 9 06:29:15 2013 (r246583) @@ -509,11 +509,15 @@ MAN= aac.4 \ viapm.4 \ ${_viawd.4} \ vinum.4 \ + ${_virtio.4} \ + ${_virtio_balloon.4} \ + ${_virtio_blk.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ vte.4 \ + ${_vtnet.4} \ ${_vxge.4} \ watchdog.4 \ wb.4 \ @@ -676,6 +680,7 @@ MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 +MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 @@ -722,6 +727,7 @@ _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_urtw.4= if_urtw.4 +_if_vtnet.4= if_vtnet.4 _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 @@ -734,6 +740,10 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_virtio.4= virtio.4 +_virtio_balloon.4=virtio_balloon.4 +_virtio_blk.4= virtio_blk.4 +_vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 06:31:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AAF9E151; Sat, 9 Feb 2013 06:31:14 +0000 (UTC) (envelope-from bryanv@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 8F14EA52; Sat, 9 Feb 2013 06:31: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 r196VECv012709; Sat, 9 Feb 2013 06:31:14 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196VEnx012703; Sat, 9 Feb 2013 06:31:14 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090631.r196VEnx012703@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246584 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:31:14 -0000 Author: bryanv Date: Sat Feb 9 06:31:13 2013 New Revision: 246584 URL: http://svnweb.freebsd.org/changeset/base/246584 Log: MFC r241470 Add VirtIO SCSI driver man page Approved by: grehan (mentor) Added: stable/9/share/man/man4/virtio_scsi.4 - copied unchanged from r241470, head/share/man/man4/virtio_scsi.4 Modified: stable/9/share/man/man4/Makefile stable/9/share/man/man4/virtio.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sat Feb 9 06:29:15 2013 (r246583) +++ stable/9/share/man/man4/Makefile Sat Feb 9 06:31:13 2013 (r246584) @@ -512,6 +512,7 @@ MAN= aac.4 \ ${_virtio.4} \ ${_virtio_balloon.4} \ ${_virtio_blk.4} \ + ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ @@ -743,6 +744,7 @@ _nxge.4= nxge.4 _virtio.4= virtio.4 _virtio_balloon.4=virtio_balloon.4 _virtio_blk.4= virtio_blk.4 +_virtio_scsi.4= virtio_scsi.4 _vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 Modified: stable/9/share/man/man4/virtio.4 ============================================================================== --- stable/9/share/man/man4/virtio.4 Sat Feb 9 06:29:15 2013 (r246583) +++ stable/9/share/man/man4/virtio.4 Sat Feb 9 06:31:13 2013 (r246584) @@ -72,6 +72,10 @@ device driver. An emulated disk controller is provided by the .Xr virtio_blk 4 device driver. +.It Nm SCSI +An emulated SCSI HBA is provided by the +.Xr virtio_scsi 4 +device driver. .It Nm Balloon A pseudo-device to allow the VM to release memory back to the hypervisor is provided by the @@ -81,6 +85,7 @@ device driver. .Sh SEE ALSO .Xr virtio_balloon 4 , .Xr virtio_blk 4 , +.Xr virtio_scsi 4 , .Xr vtnet 4 .Sh HISTORY Support for VirtIO first appeared in Copied: stable/9/share/man/man4/virtio_scsi.4 (from r241470, head/share/man/man4/virtio_scsi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/virtio_scsi.4 Sat Feb 9 06:31:13 2013 (r246584, copy of r241470, head/share/man/man4/virtio_scsi.4) @@ -0,0 +1,92 @@ +.\" Copyright (c) 2012 Bryan Venteicher +.\" 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$ +.\" +.Dd June 24, 2012 +.Dt VIRTIO_SCSI 4 +.Os +.Sh NAME +.Nm virtio_scsi +.Nd VirtIO SCSI driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_scsi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_scsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO SCSI devices. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vtscsi.bus_reset_disable +In the initial QEMU release with VirtIO SCSI support, in-flight +operations were not aborted when stopping the device, rendering +bus reset ineffective. This tunable disables attempts to issue +reset bus commands. The default value is 1. +.El +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.vtscsi.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -width 6n -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable prints for driver errors. +.It 0x04 +Enable tracing prints. +.El +.Sh SEE ALSO +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 10.0 . From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 06:31:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8273264; Sat, 9 Feb 2013 06:31:22 +0000 (UTC) (envelope-from delphij@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 CB4F7A53; Sat, 9 Feb 2013 06:31: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 r196VME2012764; Sat, 9 Feb 2013 06:31:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196VMw0012763; Sat, 9 Feb 2013 06:31:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090631.r196VMw0012763@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 06:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246585 - head/sys/modules/usb/smsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:31:22 -0000 Author: delphij Date: Sat Feb 9 06:31:22 2013 New Revision: 246585 URL: http://svnweb.freebsd.org/changeset/base/246585 Log: Fix LINT build for ARM. Modified: head/sys/modules/usb/smsc/Makefile Modified: head/sys/modules/usb/smsc/Makefile ============================================================================== --- head/sys/modules/usb/smsc/Makefile Sat Feb 9 06:31:13 2013 (r246584) +++ head/sys/modules/usb/smsc/Makefile Sat Feb 9 06:31:22 2013 (r246585) @@ -33,5 +33,6 @@ KMOD= if_smsc SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ miibus_if.h opt_inet.h opt_platform.h \ if_smsc.c +SRCS+= ofw_bus_if.h .include From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 06:39:31 2013 Return-Path: Delivered-To: svn-src-all@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 E5BDD4C7; Sat, 9 Feb 2013 06:39:31 +0000 (UTC) (envelope-from delphij@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 CF7A5A99; Sat, 9 Feb 2013 06:39: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 r196dVWY013864; Sat, 9 Feb 2013 06:39:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196dSR0013840; Sat, 9 Feb 2013 06:39:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090639.r196dSR0013840@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 06:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246586 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs sys/cddl... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:39:32 -0000 Author: delphij Date: Sat Feb 9 06:39:28 2013 New Revision: 246586 URL: http://svnweb.freebsd.org/changeset/base/246586 Log: MFV r245512: * Illumos zfs issue #3035 [1] LZ4 compression support in ZFS. LZ4 is a new high-speed BSD-licensed compression algorithm created by Yann Collet that delivers very high compression and decompression performance compared to lzjb (>50% faster on compression, >80% faster on decompression and around 3x faster on compression of incompressible data), while giving better compression ratio [1]. This version of LZ4 corresponds to upstream's [2] revision 85. Please note that for obvious reasons this is not backward read compatible. This means once a pool have LZ4 compressed data, these data can no longer be read by older ZFS implementations. Local changes: - On-stack hash table disabled and using kernel slab allocator instead, at this time. This requires larger kernel thread stack for zio workers. This may change in the future should we adjusted the zio workers' thread stack size. - likely and unlikely will be undefined if they are already defined, this is required for i386 XEN build. - Removed De Bruijn sequence based __builtin_ctz family of builtins in favor of the latter. Both GCC and clang supports these builtins. - Changed the way the LZ4 code detects endianness. - Manual pages modifications to mention the feature based on Illumos counterpart. - Boot loader changes to make it support LZ4 decompression. [1] https://www.illumos.org/issues/3035 [2] http://code.google.com/p/lz4/source/list Obtained from: Illumos (13921:9d721847e469) Tested on: FreeBSD/amd64 MFC after: 1 month Added: head/sys/cddl/boot/zfs/lz4.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 - copied unchanged from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip - copied unchanged from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c - copied, changed from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/sys/cddl/boot/zfs/README head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c head/sys/cddl/compat/opensolaris/sys/byteorder.h head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c head/sys/conf/files Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Feb 9 06:31:22 2013 (r246585) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Feb 9 06:39:28 2013 (r246586) @@ -24,10 +24,11 @@ .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2012 +.Dd February 8, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -866,7 +867,7 @@ but this may change in future releases). disables integrity checking on user data. Disabling checksums is .Em NOT a recommended practice. -.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle +.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Controls the compression algorithm used for this dataset. The .Cm lzjb compression algorithm is optimized for performance while providing decent data @@ -894,6 +895,26 @@ The .Cm zle compression algorithm compresses runs of zeros. .Pp +The +.Sy lz4 +compression algorithm is a high-performance replacement +for the +.Sy lzjb +algorithm. It features significantly faster +compression and decompression, as well as a moderately higher +compression ratio than +.Sy lzjb , +but can only be used on pools with +the +.Sy lz4_compress +feature set to +.Sy enabled . +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy lz4_compress +feature. +.Pp This property can also be referred to by its shortened column name .Cm compress . Changing this property affects only newly-written data. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 9 06:31:22 2013 (r246585) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 9 06:39:28 2013 (r246586) @@ -18,10 +18,11 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd Aug 28, 2012 +.Dd February 8, 2012 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -185,6 +186,49 @@ This feature is .Sy active while there are any filesystems, volumes, or snapshots which were created after enabling this feature. +.It Sy lz4_compress +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress" +.It GUID Ta org.illumos:lz4_compress +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +.Sy lz4 +is a high-performance real-time compression algorithm that +features significantly faster compression and decompression as well as a +higher compression ratio than the older +.Sy lzjb +compression. +Typically, +.Sy lz4 +compression is approximately 50% faster on +compressible data and 200% faster on incompressible data than +.Sy lzjb . +It is also approximately 80% faster on decompression, while +giving approximately 10% better compression ratio. +.Pp +When the +.Sy lz4_compress +feature is set to +.Sy enabled , +the +administrator can turn on +.Sy lz4 +compression on any dataset on the +pool using the +.Xr zfs 8 +command. Please note that doing so will +immediately activate the +.Sy lz4_compress +feature on the underlying +pool (even before any data is written). Since this feature is not +read-only compatible, this operation will render the pool unimportable +on systems without support for the +.Sy lz4_compress +feature. At the +moment, this operation cannot be reversed. Booting off of +.Sy lz4 +-compressed root pools is supported. .El .Sh SEE ALSO .Xr zpool 8 Modified: head/sys/cddl/boot/zfs/README ============================================================================== --- head/sys/cddl/boot/zfs/README Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/boot/zfs/README Sat Feb 9 06:39:28 2013 (r246586) @@ -5,6 +5,7 @@ are used by the ZFS bootstrap: fletcher.c checksum support sha256.c checksum support + lz4.c compression support lzjb.c compression support zfssubr.c checksum, compression and raidz support zfsimpl.h mostly describing the physical layout Added: head/sys/cddl/boot/zfs/lz4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/boot/zfs/lz4.c Sat Feb 9 06:39:28 2013 (r246586) @@ -0,0 +1,308 @@ +/* + * LZ4 - Fast LZ compression algorithm + * Header File + * Copyright (C) 2011-2013, Yann Collet. + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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. + * + * You can contact the author at : + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html + * - LZ4 source repository : http://code.google.com/p/lz4/ + * + * $FreeBSD$ + */ + +static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, + int isize, int maxOutputSize); + +/* ARGSUSED */ +static int +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dummy __unused) +{ + const uint8_t *src = s_start; + uint32_t bufsiz = htonl(*(uint32_t *)src); + + /* invalid compressed buffer size encoded at start */ + if (bufsiz + 4 > s_len) + return (1); + + /* + * Returns 0 on success (decompression function returned non-negative) + * and non-zero on failure (decompression function returned negative). + */ + return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz, + d_len) < 0); +} + +/* + * CPU Feature Detection + */ + +/* 32 or 64 bits ? */ +#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || \ + defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \ + defined(__LP64__) || defined(_LP64)) +#define LZ4_ARCH64 1 +#else +#define LZ4_ARCH64 0 +#endif + +/* + * Little Endian or Big Endian? + * Note: overwrite the below #define if you know your architecture endianess. + */ +#if BYTE_ORDER == BIG_ENDIAN +#define LZ4_BIG_ENDIAN 1 +#else + /* + * Little Endian assumed. PDP Endian and other very rare endian format + * are unsupported. + */ +#endif + +/* + * Compiler Options + */ +#if __STDC_VERSION__ >= 199901L /* C99 */ +/* "restrict" is a known keyword */ +#else +/* Disable restrict */ +#define restrict +#endif + +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +#define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) \ + | (((x) & 0xffu) << 8))) + +#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) +#define expect(expr, value) (__builtin_expect((expr), (value))) +#else +#define expect(expr, value) (expr) +#endif + +#define likely(expr) expect((expr) != 0, 1) +#define unlikely(expr) expect((expr) != 0, 0) + +/* Basic types */ +#define BYTE uint8_t +#define U16 uint16_t +#define U32 uint32_t +#define S32 int32_t +#define U64 uint64_t + +typedef struct _U16_S { + U16 v; +} U16_S; +typedef struct _U32_S { + U32 v; +} U32_S; +typedef struct _U64_S { + U64 v; +} U64_S; + +#define A64(x) (((U64_S *)(x))->v) +#define A32(x) (((U32_S *)(x))->v) +#define A16(x) (((U16_S *)(x))->v) + +/* + * Constants + */ +#define MINMATCH 4 + +#define COPYLENGTH 8 +#define LASTLITERALS 5 + +#define ML_BITS 4 +#define ML_MASK ((1U<> ML_BITS)) == RUN_MASK) { + int s = 255; + while ((ip < iend) && (s == 255)) { + s = *ip++; + length += s; + } + } + /* copy literals */ + cpy = op + length; + if ((cpy > oend - COPYLENGTH) || + (ip + length > iend - COPYLENGTH)) { + if (cpy > oend) + /* + * Error: request to write beyond destination + * buffer. + */ + goto _output_error; + if (ip + length > iend) + /* + * Error : request to read beyond source + * buffer. + */ + goto _output_error; + memcpy(op, ip, length); + op += length; + ip += length; + if (ip < iend) + /* Error : LZ4 format violation */ + goto _output_error; + /* Necessarily EOF, due to parsing restrictions. */ + break; + } + LZ4_WILDCOPY(ip, op, cpy); + ip -= (op - cpy); + op = cpy; + + /* get offset */ + LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip); + ip += 2; + if (ref < (BYTE * const) dest) + /* + * Error: offset creates reference outside of + * destination buffer. + */ + goto _output_error; + + /* get matchlength */ + if ((length = (token & ML_MASK)) == ML_MASK) { + while (ip < iend) { + int s = *ip++; + length += s; + if (s == 255) + continue; + break; + } + } + /* copy repeated sequence */ + if unlikely(op - ref < STEPSIZE) { +#if LZ4_ARCH64 + size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 }; + size_t dec2 = dec2table[op - ref]; +#else + const int dec2 = 0; +#endif + *op++ = *ref++; + *op++ = *ref++; + *op++ = *ref++; + *op++ = *ref++; + ref -= dec[op - ref]; + A32(op) = A32(ref); + op += STEPSIZE - 4; + ref -= dec2; + } else { + LZ4_COPYSTEP(ref, op); + } + cpy = op + length - (STEPSIZE - 4); + if (cpy > oend - COPYLENGTH) { + if (cpy > oend) + /* + * Error: request to write outside of + * destination buffer. + */ + goto _output_error; + LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH)); + while (op < cpy) + *op++ = *ref++; + op = cpy; + if (op == oend) + /* + * Check EOF (should never happen, since last + * 5 bytes are supposed to be literals). + */ + break; + continue; + } + LZ4_SECURECOPY(ref, op, cpy); + op = cpy; /* correction */ + } + + /* end of decoding */ + return (int)(((char *)op) - dest); + + /* write overflow error detected */ + _output_error: + return (int)(-(((char *)ip) - source)); +} Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sat Feb 9 06:39:28 2013 (r246586) @@ -52,6 +52,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 by Saso Kiselkov. All rights reserved. + */ #define MAXNAMELEN 256 @@ -439,6 +442,7 @@ enum zio_compress { ZIO_COMPRESS_GZIP_8, ZIO_COMPRESS_GZIP_9, ZIO_COMPRESS_ZLE, + ZIO_COMPRESS_LZ4, ZIO_COMPRESS_FUNCTIONS }; Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/boot/zfs/zfssubr.c Sat Feb 9 06:39:28 2013 (r246586) @@ -119,6 +119,7 @@ typedef struct zio_compress_info { #include "lzjb.c" #include "zle.c" +#include "lz4.c" /* * Compression vectors. @@ -139,6 +140,7 @@ static zio_compress_info_t zio_compress_ {NULL, NULL, 8, "gzip-8"}, {NULL, NULL, 9, "gzip-9"}, {NULL, zle_decompress, 64, "zle"}, + {NULL, lz4_decompress, 0, "lz4"}, }; static void Modified: head/sys/cddl/compat/opensolaris/sys/byteorder.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/byteorder.h Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/compat/opensolaris/sys/byteorder.h Sat Feb 9 06:39:28 2013 (r246586) @@ -42,6 +42,11 @@ #ifndef _OPENSOLARIS_SYS_BYTEORDER_H_ #define _OPENSOLARIS_SYS_BYTEORDER_H_ +/* for htonl() */ +#ifndef _KERNEL +#include +#endif + /* * Macros to reverse byte order */ @@ -86,4 +91,6 @@ #define ntohll(x) BSWAP_64(x) #endif +#define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa))) + #endif /* _OPENSOLARIS_SYS_BYTEORDER_H_ */ Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Sat Feb 9 06:39:28 2013 (r246586) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #ifdef _KERNEL @@ -155,4 +156,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, "com.delphix:empty_bpobj", "empty_bpobj", "Snapshots use less space.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_LZ4_COMPRESS, + "org.illumos:lz4_compress", "lz4_compress", + "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Sat Feb 9 06:39:28 2013 (r246586) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #ifndef _ZFEATURE_COMMON_H @@ -51,6 +52,7 @@ typedef int (zfeature_func_t)(zfeature_i static enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, SPA_FEATURE_EMPTY_BPOBJ, + SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURES } spa_feature_t; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Feb 9 06:39:28 2013 (r246586) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -96,6 +97,7 @@ zfs_prop_init(void) { "gzip-8", ZIO_COMPRESS_GZIP_8 }, { "gzip-9", ZIO_COMPRESS_GZIP_9 }, { "zle", ZIO_COMPRESS_ZLE }, + { "lz4", ZIO_COMPRESS_LZ4 }, { NULL } }; @@ -211,8 +213,8 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_COMPRESSION, "compression", ZIO_COMPRESS_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "on | off | lzjb | gzip | gzip-[1-9] | zle", "COMPRESS", - compress_table); + "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4", + "COMPRESS", compress_table); zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "hidden | visible", "SNAPDIR", snapdir_table); Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Feb 9 06:39:28 2013 (r246586) @@ -22,6 +22,7 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # # This Makefile defines all file modules for the directory uts/common @@ -56,6 +57,7 @@ ZFS_COMMON_OBJS += \ dsl_scan.o \ zfeature.o \ gzip.o \ + lz4.o \ lzjb.o \ metaslab.o \ refcount.o \ Copied: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 (from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 Sat Feb 9 06:39:28 2013 (r246586, copy of r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4) @@ -0,0 +1,30 @@ +LZ4 - Fast LZ compression algorithm +Copyright (C) 2011-2013, Yann Collet. +BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER +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. + +You can contact the author at : +- LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html +- LZ4 source repository : http://code.google.com/p/lz4/ Copied: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip (from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip Sat Feb 9 06:39:28 2013 (r246586, copy of r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip) @@ -0,0 +1 @@ +LZ4 COMPRESSION FUNCTIONALITY IN ZFS Copied and modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c (from r245512, vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c) ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c Wed Jan 16 23:11:13 2013 (r245512, copy source) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sat Feb 9 06:39:28 2013 (r246586) @@ -201,7 +201,8 @@ lz4_decompress(void *s_start, void *d_st * Illumos: On amd64 we have 20k of stack and 24k on sun4u and sun4v, so we * can spend 16k on the algorithm */ -#define STACKLIMIT 12 +/* FreeBSD: Use heap for all platforms for now */ +#define STACKLIMIT 0 #else #define LZ4_ARCH64 0 /* @@ -209,18 +210,14 @@ lz4_decompress(void *s_start, void *d_st * same COMPRESSIONLEVEL we have to use heap allocation. Performance will * suck, but alas, it's ZFS on 32-bit we're talking about, so... */ -#define STACKLIMIT 11 +#define STACKLIMIT 0 #endif /* * Little Endian or Big Endian? * Note: overwrite the below #define if you know your architecture endianess. */ -#if (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || \ - defined(_BIG_ENDIAN) || defined(_ARCH_PPC) || defined(__PPC__) || \ - defined(__PPC) || defined(PPC) || defined(__powerpc__) || \ - defined(__powerpc) || defined(powerpc) || \ - ((defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)))) +#if BYTE_ORDER == BIG_ENDIAN #define LZ4_BIG_ENDIAN 1 #else /* @@ -241,12 +238,6 @@ lz4_decompress(void *s_start, void *d_st #endif /* - * Illumos: we can't use GCC's __builtin_ctz family of builtins in the - * kernel - */ -#define LZ4_FORCE_SW_BITCOUNT - -/* * Compiler Options */ #if __STDC_VERSION__ >= 199901L /* C99 */ @@ -256,54 +247,27 @@ lz4_decompress(void *s_start, void *d_st #define restrict #endif -#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) - -#ifdef _MSC_VER -/* Visual Studio */ -/* Visual is not C99, but supports some kind of inline */ -#define inline __forceinline -#if LZ4_ARCH64 -/* For Visual 2005 */ -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) -#else /* !LZ4_ARCH64 */ -/* For Visual 2005 */ -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#endif /* !LZ4_ARCH64 */ -#endif /* _MSC_VER */ - -#ifdef _MSC_VER -#define lz4_bswap16(x) _byteswap_ushort(x) -#else /* !_MSC_VER */ #define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | \ (((x) & 0xffu) << 8))) -#endif /* !_MSC_VER */ -#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) #define expect(expr, value) (__builtin_expect((expr), (value))) -#else -#define expect(expr, value) (expr) + +#if defined(likely) +#undef likely +#endif +#if defined(unlikely) +#undef unlikely #endif #define likely(expr) expect((expr) != 0, 1) #define unlikely(expr) expect((expr) != 0, 0) /* Basic types */ -#if defined(_MSC_VER) -/* Visual Studio does not support 'stdint' natively */ -#define BYTE unsigned __int8 -#define U16 unsigned __int16 -#define U32 unsigned __int32 -#define S32 __int32 -#define U64 unsigned __int64 -#else /* !defined(_MSC_VER) */ #define BYTE uint8_t #define U16 uint16_t #define U32 uint32_t #define S32 int32_t #define U64 uint64_t -#endif /* !defined(_MSC_VER) */ #ifndef LZ4_FORCE_UNALIGNED_ACCESS #pragma pack(1) @@ -414,48 +378,9 @@ static inline int LZ4_NbCommonBytes(register U64 val) { #if defined(LZ4_BIG_ENDIAN) -#if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r = 0; - _BitScanReverse64(&r, val); - return (int)(r >> 3); -#elif defined(__GNUC__) && (GCC_VERSION >= 304) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_clzll(val) >> 3); #else - int r; - if (!(val >> 32)) { - r = 4; - } else { - r = 0; - val >>= 32; - } - if (!(val >> 16)) { - r += 2; - val >>= 8; - } else { - val >>= 24; - } - r += (!val); - return (r); -#endif -#else -#if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r = 0; - _BitScanForward64(&r, val); - return (int)(r >> 3); -#elif defined(__GNUC__) && (GCC_VERSION >= 304) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_ctzll(val) >> 3); -#else - static const int DeBruijnBytePos[64] = - { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, - 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, - 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, - 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 - }; - return DeBruijnBytePos[((U64) ((val & -val) * 0x0218A392CDABBD3F)) >> - 58]; -#endif #endif } @@ -465,43 +390,9 @@ static inline int LZ4_NbCommonBytes(register U32 val) { #if defined(LZ4_BIG_ENDIAN) -#if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r = 0; - _BitScanReverse(&r, val); - return (int)(r >> 3); -#elif defined(__GNUC__) && (GCC_VERSION >= 304) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_clz(val) >> 3); #else - int r; - if (!(val >> 16)) { - r = 2; - val >>= 8; - } else { - r = 0; - val >>= 24; - } - r += (!val); - return (r); -#endif -#else -#if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r = 0; - _BitScanForward(&r, val); - return (int)(r >> 3); -#elif defined(__GNUC__) && (GCC_VERSION >= 304) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_ctz(val) >> 3); -#else - static const int DeBruijnBytePos[32] = { - 0, 0, 3, 0, 3, 1, 3, 0, - 3, 2, 2, 1, 3, 2, 0, 1, - 3, 3, 1, 2, 2, 2, 2, 0, - 3, 1, 2, 0, 1, 0, 1, 1 - }; - return DeBruijnBytePos[((U32) ((val & -(S32) val) * 0x077CB531U)) >> - 27]; -#endif #endif } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 06:39:28 2013 (r246586) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #ifndef _ZIO_H @@ -106,14 +107,17 @@ enum zio_compress { ZIO_COMPRESS_GZIP_8, ZIO_COMPRESS_GZIP_9, ZIO_COMPRESS_ZLE, + ZIO_COMPRESS_LZ4, ZIO_COMPRESS_FUNCTIONS }; +/* N.B. when altering this value, also change BOOTFS_COMPRESS_VALID below */ #define ZIO_COMPRESS_ON_VALUE ZIO_COMPRESS_LZJB #define ZIO_COMPRESS_DEFAULT ZIO_COMPRESS_OFF #define BOOTFS_COMPRESS_VALID(compress) \ ((compress) == ZIO_COMPRESS_LZJB || \ + (compress) == ZIO_COMPRESS_LZ4 || \ ((compress) == ZIO_COMPRESS_ON && \ ZIO_COMPRESS_ON_VALUE == ZIO_COMPRESS_LZJB) || \ (compress) == ZIO_COMPRESS_OFF) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Sat Feb 9 06:39:28 2013 (r246586) @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + */ #ifndef _SYS_ZIO_COMPRESS_H #define _SYS_ZIO_COMPRESS_H @@ -68,6 +71,10 @@ extern size_t zle_compress(void *src, vo int level); extern int zle_decompress(void *src, void *dst, size_t s_len, size_t d_len, int level); +extern size_t lz4_compress(void *src, void *dst, size_t s_len, size_t d_len, + int level); +extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len, + int level); /* * Compress and decompress data if necessary. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Feb 9 06:31:22 2013 (r246585) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Feb 9 06:39:28 2013 (r246586) @@ -27,6 +27,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #include @@ -75,6 +76,7 @@ #include #include #include +#include #include "zfs_namecheck.h" #include "zfs_prop.h" @@ -131,6 +133,12 @@ int zfs_set_prop_nvlist(const char *, zp static void zfsdev_close(void *data); +static int zfs_prop_activate_feature(dsl_pool_t *dp, zfeature_info_t *feature); +static int zfs_prop_activate_feature_check(void *arg1, void *arg2, + dmu_tx_t *tx); +static void zfs_prop_activate_feature_sync(void *arg1, void *arg2, + dmu_tx_t *tx); + /* _NOTE(PRINTFLIKE(4)) - this is printf-like, but lint is too whiney */ void __dprintf(const char *file, const char *func, int line, const char *fmt, ...) @@ -2264,6 +2272,40 @@ zfs_prop_set_special(const char *dsname, } break; } + case ZFS_PROP_COMPRESSION: + { + if (intval == ZIO_COMPRESS_LZ4) { + zfeature_info_t *feature = + &spa_feature_table[SPA_FEATURE_LZ4_COMPRESS]; + spa_t *spa; + dsl_pool_t *dp; + + if ((err = spa_open(dsname, &spa, FTAG)) != 0) + return (err); + + dp = spa->spa_dsl_pool; + + /* + * Setting the LZ4 compression algorithm activates + * the feature. + */ + if (!spa_feature_is_active(spa, feature)) { + if ((err = zfs_prop_activate_feature(dp, + feature)) != 0) { + spa_close(spa, FTAG); + return (err); + } + } + + spa_close(spa, FTAG); + } + /* + * We still want the default set action to be performed in the + * caller, we only performed zfeature settings here. + */ + err = -1; + break; + } default: err = -1; @@ -3481,6 +3523,22 @@ zfs_check_settable(const char *dsname, n SPA_VERSION_ZLE_COMPRESSION)) return (ENOTSUP); + if (intval == ZIO_COMPRESS_LZ4) { + zfeature_info_t *feature = + &spa_feature_table[ + SPA_FEATURE_LZ4_COMPRESS]; + spa_t *spa; + + if ((err = spa_open(dsname, &spa, FTAG)) != 0) + return (err); + + if (!spa_feature_is_enabled(spa, feature)) { + spa_close(spa, FTAG); + return (ENOTSUP); + } + spa_close(spa, FTAG); + } + /* * If this is a bootable dataset then * verify that the compression algorithm @@ -3525,6 +3583,56 @@ zfs_check_settable(const char *dsname, n } /* + * Activates a feature on a pool in response to a property setting. This + * creates a new sync task which modifies the pool to reflect the feature + * as being active. + */ +static int +zfs_prop_activate_feature(dsl_pool_t *dp, zfeature_info_t *feature) +{ + int err; + + /* EBUSY here indicates that the feature is already active */ + err = dsl_sync_task_do(dp, zfs_prop_activate_feature_check, + zfs_prop_activate_feature_sync, dp->dp_spa, feature, 2); + + if (err != 0 && err != EBUSY) + return (err); + else + return (0); +} + +/* + * Checks for a race condition to make sure we don't increment a feature flag + * multiple times. + */ +/*ARGSUSED*/ +static int +zfs_prop_activate_feature_check(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + zfeature_info_t *feature = arg2; + + if (!spa_feature_is_active(spa, feature)) + return (0); + else + return (EBUSY); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 07:01:06 2013 Return-Path: Delivered-To: svn-src-all@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 62826919; Sat, 9 Feb 2013 07:01:06 +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 539B9B6C; Sat, 9 Feb 2013 07:01: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 r197166a021683; Sat, 9 Feb 2013 07:01:06 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19716dY021681; Sat, 9 Feb 2013 07:01:06 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201302090701.r19716dY021681@svn.freebsd.org> From: Joel Dahl Date: Sat, 9 Feb 2013 07:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246587 - in head: cddl/contrib/opensolaris/cmd/zpool 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 07:01:06 -0000 Author: joel (doc committer) Date: Sat Feb 9 07:01:05 2013 New Revision: 246587 URL: http://svnweb.freebsd.org/changeset/base/246587 Log: mdoc: Remove EOL whitespace. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/lib/libc/stdio/fopen.3 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 9 06:39:28 2013 (r246586) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Sat Feb 9 07:01:05 2013 (r246587) @@ -199,7 +199,7 @@ features significantly faster compressio higher compression ratio than the older .Sy lzjb compression. -Typically, +Typically, .Sy lz4 compression is approximately 50% faster on compressible data and 200% faster on incompressible data than @@ -207,12 +207,12 @@ compressible data and 200% faster on inc It is also approximately 80% faster on decompression, while giving approximately 10% better compression ratio. .Pp -When the +When the .Sy lz4_compress feature is set to .Sy enabled , the -administrator can turn on +administrator can turn on .Sy lz4 compression on any dataset on the pool using the Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Sat Feb 9 06:39:28 2013 (r246586) +++ head/lib/libc/stdio/fopen.3 Sat Feb 9 07:01:05 2013 (r246587) @@ -332,7 +332,7 @@ but is also supported by glibc. The .Fn fmemopen function -conforms to +conforms to .St -p1003.1-2008 . The ``b'' mode does not conform to any standard but is also supported by glibc. From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 08:27:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C5FE575; Sat, 9 Feb 2013 08:27:10 +0000 (UTC) (envelope-from tuexen@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 269A1E37; Sat, 9 Feb 2013 08:27: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 r198R9b3046186; Sat, 9 Feb 2013 08:27:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r198R8Xg046180; Sat, 9 Feb 2013 08:27:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201302090827.r198R8Xg046180@svn.freebsd.org> From: Michael Tuexen Date: Sat, 9 Feb 2013 08:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246588 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 08:27:10 -0000 Author: tuexen Date: Sat Feb 9 08:27:08 2013 New Revision: 246588 URL: http://svnweb.freebsd.org/changeset/base/246588 Log: Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or SHUTDOWN_ACK_SENT state. While there, make the corresponding code consistent. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_indata.c Sat Feb 9 08:27:08 2013 (r246588) @@ -4262,19 +4262,19 @@ again: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); } @@ -4973,11 +4973,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4985,6 +4980,11 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); @@ -4996,19 +4996,19 @@ sctp_handle_sack(struct mbuf *m, int off (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); return; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_input.c Sat Feb 9 08:27:08 2013 (r246588) @@ -956,7 +956,6 @@ sctp_handle_shutdown(struct sctp_shutdow } else { /* no outstanding data to send, so move on... */ /* send SHUTDOWN-ACK */ - sctp_send_shutdown_ack(stcb, net); /* move to SHUTDOWN-ACK-SENT state */ if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { @@ -965,6 +964,7 @@ sctp_handle_shutdown(struct sctp_shutdow SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown_ack(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_output.c Sat Feb 9 08:27:08 2013 (r246588) @@ -6574,12 +6574,13 @@ sctp_sendall_iterator(struct sctp_inpcb * only send SHUTDOWN the first time * through */ - sctp_send_shutdown(stcb, net); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, @@ -13092,18 +13093,19 @@ dataless_eof: (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } /* only send SHUTDOWN the first time through */ - sctp_send_shutdown(stcb, netp); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_pcb.c Sat Feb 9 08:27:08 2013 (r246588) @@ -3332,22 +3332,23 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (asoc->asoc.alternate) { - netp = asoc->asoc.alternate; - } else { - netp = asoc->asoc.primary_destination; - } /* * there is nothing queued to send, * so I send shutdown */ - sctp_send_shutdown(asoc, netp); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(asoc); + if (asoc->asoc.alternate) { + netp = asoc->asoc.alternate; + } else { + netp = asoc->asoc.primary_destination; + } + sctp_send_shutdown(asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, asoc->sctp_ep, asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_timer.c Sat Feb 9 08:27:08 2013 (r246588) @@ -1560,18 +1560,19 @@ sctp_autoclose_timer(struct sctp_inpcb * /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_send_shutdown(stcb, netp); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Feb 9 07:01:05 2013 (r246587) +++ head/sys/netinet/sctp_usrreq.c Sat Feb 9 08:27:08 2013 (r246588) @@ -794,25 +794,24 @@ sctp_disconnect(struct socket *so) /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* @@ -1014,24 +1013,24 @@ sctp_shutdown(struct socket *so) /* only send SHUTDOWN the first time through */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 13:28:50 2013 Return-Path: Delivered-To: svn-src-all@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 7B428E16; Sat, 9 Feb 2013 13:28:50 +0000 (UTC) (envelope-from antoine@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 6E33CA40; Sat, 9 Feb 2013 13:28: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 r19DSohW036211; Sat, 9 Feb 2013 13:28:50 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19DSoR3036210; Sat, 9 Feb 2013 13:28:50 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201302091328.r19DSoR3036210@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Feb 2013 13:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246591 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 13:28:50 -0000 Author: antoine Date: Sat Feb 9 13:28:49 2013 New Revision: 246591 URL: http://svnweb.freebsd.org/changeset/base/246591 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Feb 9 10:49:31 2013 (r246590) +++ head/ObsoleteFiles.inc Sat Feb 9 13:28:49 2013 (r246591) @@ -45,6 +45,10 @@ OLD_DIRS+=usr/share/man/man1aout OLD_DIRS+=usr/share/man/cat1aout OLD_DIRS+=usr/share/man/en.ISO8859-1/cat1aout OLD_DIRS+=usr/share/man/en.UTF-8/cat1aout +# 20130110: bsd.compat.mk removed +OLD_FILES+=usr/share/mk/bsd.compat.mk +# 20130103: gnats-supfile removed +OLD_FILES+=usr/share/examples/cvsup/gnats-supfile # 20121230: libdisk removed OLD_FILES+=usr/share/man/man3/libdisk.3.gz usr/include/libdisk.h OLD_FILES+=usr/lib/libdisk.a usr/lib32/libdisk.a From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 13:31:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9BD5FA7; Sat, 9 Feb 2013 13:31:59 +0000 (UTC) (envelope-from antoine@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 BC165A57; Sat, 9 Feb 2013 13:31: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 r19DVxwM038261; Sat, 9 Feb 2013 13:31:59 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19DVx8e038260; Sat, 9 Feb 2013 13:31:59 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201302091331.r19DVx8e038260@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Feb 2013 13:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246592 - head/usr.bin/ee X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 13:31:59 -0000 Author: antoine Date: Sat Feb 9 13:31:59 2013 New Revision: 246592 URL: http://svnweb.freebsd.org/changeset/base/246592 Log: Fix some NLS catalogs broken after r245888. Modified: head/usr.bin/ee/Makefile Modified: head/usr.bin/ee/Makefile ============================================================================== --- head/usr.bin/ee/Makefile Sat Feb 9 13:28:49 2013 (r246591) +++ head/usr.bin/ee/Makefile Sat Feb 9 13:31:59 2013 (r246592) @@ -16,7 +16,7 @@ WARNS?= 2 NLS= C fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \ uk_UA.KOI8-U pt_BR.ISO8859-1 ru_RU.KOI8-R hu_HU.ISO8859-2 -NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15 +NLSLINKS_C= en_US.ISO8859-1 en_US.ISO8859-15 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \ fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 fr_CH.ISO8859-15 \ fr_FR.ISO8859-15 From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 16:52:57 2013 Return-Path: Delivered-To: svn-src-all@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 95801220 for ; Sat, 9 Feb 2013 16:52:57 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-x234.google.com (la-in-x0234.1e100.net [IPv6:2a00:1450:4010:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 1E555243 for ; Sat, 9 Feb 2013 16:52:56 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fs12so4650806lab.39 for ; Sat, 09 Feb 2013 08:52:56 -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=iOCjVlkxu+ICmR2zeI4AD5dMu3D/x1v0hwFHhEb8eI4=; b=YRZgiUvhGwA/EEhNTQOpWNcSQHyNc/p3c/5c1TSsr8xd7QGWyQVKNZNyjMNSHcu7iG 9Uk3WJdepri09e8mJJqiNIKtrdPbD/U8nklMNACh+Dh6cdgMCme6b3g8LwjktiI5Ozsx FTSz6W97ndXQ1opMA3ROvWY9/FgQxAAJs9bleug2N1NNdnRKeTkO9KoPZxFnnzMupJrR NATqoeRm7P5FN+kEdF4EaO4BWOMezEuKvI94tI3JA3L8ThAVTE8gq9azq5rjeu4HOG+q s4b5WRtLOxyE6ELfqjMw5EThUKXkmIy2wJ9sqvet2uPdlOC673uB3vZT3p4rioiE9z0n UbAw== X-Received: by 10.152.145.37 with SMTP id sr5mr8212327lab.33.1360428776018; Sat, 09 Feb 2013 08:52:56 -0800 (PST) Received: from zont-osx.local (ppp95-165-158-215.pppoe.spdop.ru. [95.165.158.215]) by mx.google.com with ESMTPS id gm20sm3012080lab.7.2013.02.09.08.52.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Feb 2013 08:52:54 -0800 (PST) Sender: Andrey Zonov Message-ID: <51167EDF.5010808@FreeBSD.org> Date: Sat, 09 Feb 2013 20:52:47 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r246402 - stable/9/usr.sbin/inetd References: <201302061316.r16DGh6m024337@svn.freebsd.org> <1360159920.93359.594.camel@revolution.hippie.lan> In-Reply-To: <1360159920.93359.594.camel@revolution.hippie.lan> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OANEGRQWNNVVETRRIOCV" X-Gm-Message-State: ALoCoQnwi07B1AZ5qCT3A5GTQCASsphSLdJceBQMcdezWXuSDAYfiSp7vUC0Zf8FBAgfU9cM6oMn Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 16:52:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OANEGRQWNNVVETRRIOCV Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2/6/13 6:12 PM, Ian Lepore wrote: > On Wed, 2013-02-06 at 13:16 +0000, Andrey Zonov wrote: >> Author: zont >> Date: Wed Feb 6 13:16:43 2013 >> New Revision: 246402 >> URL: http://svnweb.freebsd.org/changeset/base/246402 >> >> Log: >> MFC r245696: >> - Force inetd to have listen queue size to be set to the value of >> kern.ipc.somaxconn instead of hardcoded value 64. >> >> Modified: >> stable/9/usr.sbin/inetd/inetd.c >> Directory Properties: >> stable/9/usr.sbin/inetd/ (props changed) >> >> Modified: stable/9/usr.sbin/inetd/inetd.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 >> --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401)= >> +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402)= >> @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) >> } >> } >> if (sep->se_socktype =3D=3D SOCK_STREAM) >> - listen(sep->se_fd, 64); >> + listen(sep->se_fd, -1); >> enable(sep); >> if (debug) { >> warnx("registered %s on %d", >=20 > I recently discovered that the posix documentation for listen(2) states= > that a queue depth less than zero is to be treated as if zero were > specified, and the behavior for zero is to minimize the length of the > queue to the smallest value the implementation supports (with words tha= t > imply the desired (but not required) effect is to stop listening if > possible). >=20 Hm, I could not imagine that POSIX creates new shiny bike for that. > Given that, perhaps it's unwise to expand the amount of code we've got > that relies on this freebsd-specific non-conformance? >=20 I think it is BSD-specific and I like -1 more than INT_MAX here. Note that Linux is going crazy when you set backlog more than system limi= t. --=20 Andrey Zonov ------enig2OANEGRQWNNVVETRRIOCV 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 iQEcBAEBAgAGBQJRFn7iAAoJEBWLemxX/CvTczYH/jQn5WpJ6xWG6gTuUp0/HtLy qtoFeEb4D4G+cqx1SXYSgo6WinFdqx71daBCT18u1a0fPs4SBgMfMirLYW1Q1AeS FoPPaTsuoXo9I8ObmdJXyc1JLHUF0eDKp1So9qFUc6KWa+nDwrbnMRlp9B9rYzSo +kub1Hg8WmRpLsauNorfHsxEhsvq2NLIRwO6tEaeMy/YF0lX71nM7dY/esCFdeDU 0OajrNmmXA7tjrkyWGP95K2tMumQI3QRXGuBhjwgCRcGnEK8aXFY7zXs0EPpuxqd ANoIFOTAwQwjWtwOJVCfvkEIM+Bt6gGT4kPoB1DMT2o0P/0xyyRjLnP4LYcJLUw= =hmBk -----END PGP SIGNATURE----- ------enig2OANEGRQWNNVVETRRIOCV-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 17:13:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1862992; Sat, 9 Feb 2013 17:13:52 +0000 (UTC) (envelope-from eadler@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 9405F378; Sat, 9 Feb 2013 17:13: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 r19HDqiG006149; Sat, 9 Feb 2013 17:13:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19HDqv6006148; Sat, 9 Feb 2013 17:13:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302091713.r19HDqv6006148@svn.freebsd.org> From: Eitan Adler Date: Sat, 9 Feb 2013 17:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246593 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 17:13:52 -0000 Author: eadler Date: Sat Feb 9 17:13:51 2013 New Revision: 246593 URL: http://svnweb.freebsd.org/changeset/base/246593 Log: Fix logic inversion. PR: docs/174966 Submitted by: Christian Ullrich Approved by: bcr (mentor) Modified: head/lib/libc/sys/chflags.2 Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Sat Feb 9 13:31:59 2013 (r246592) +++ head/lib/libc/sys/chflags.2 Sat Feb 9 17:13:51 2013 (r246593) @@ -98,7 +98,7 @@ If one of or .Dv SF_NOUNLINK is set a non-super-user cannot change any flags and even the super-user -can change flags only if securelevel is greater than 0. +can change flags only if securelevel is 0. (See .Xr init 8 for details.) From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 17:13:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1770A993; Sat, 9 Feb 2013 17:13:55 +0000 (UTC) (envelope-from eadler@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 0A105379; Sat, 9 Feb 2013 17:13: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 r19HDsRN006187; Sat, 9 Feb 2013 17:13:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19HDsMP006186; Sat, 9 Feb 2013 17:13:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302091713.r19HDsMP006186@svn.freebsd.org> From: Eitan Adler Date: Sat, 9 Feb 2013 17:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246594 - head/usr.bin/csup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 17:13:55 -0000 Author: eadler Date: Sat Feb 9 17:13:54 2013 New Revision: 246594 URL: http://svnweb.freebsd.org/changeset/base/246594 Log: Reference something which exists instead of the non-existent runsocks program. PR: docs/173664 Submitted by: wkoszek Approved by: bcr (mentor) Modified: head/usr.bin/csup/csup.1 Modified: head/usr.bin/csup/csup.1 ============================================================================== --- head/usr.bin/csup/csup.1 Sat Feb 9 17:13:51 2013 (r246593) +++ head/usr.bin/csup/csup.1 Sat Feb 9 17:13:54 2013 (r246594) @@ -24,7 +24,7 @@ .\" $Id: cvsup.1,v 1.70 2003/03/04 18:23:46 jdp Exp $ .\" $FreeBSD$ .\" -.Dd February 1, 2006 +.Dd Feburary 8, 2013 .Dt CSUP 1 .Os FreeBSD .Sh NAME @@ -902,14 +902,14 @@ will work through any firewall which per port 5999 of the server host. .Sh USING csup WITH SOCKS .Nm -can be used through a SOCKS proxy server with the standard -.Nm runsocks +can be used through a SOCKS proxy server with the +.Nm tsocks command. -Your +The .Nm executable needs to be dynamically-linked with the system libraries for -.Nm runsocks +.Nm tsocks to work properly. .Sh USING ssh PORT FORWARDING As an alternative to SOCKS, a user behind a firewall can penetrate it From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 17:20:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2761DEA2 for ; Sat, 9 Feb 2013 17:20:32 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx1.freebsd.org (Postfix) with ESMTP id 005F83F1 for ; Sat, 9 Feb 2013 17:20:31 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id kp1so2597261pab.17 for ; Sat, 09 Feb 2013 09:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=4S6hkVpM9FXrVbNUoByJ79aWGusmA5JXAeEhRutfky8=; b=tN5AuiNRgl8cndOAUK+YeszLPGdVpyniYZ7w9bTP0ZBLzcK0iUGkPpzVqtxczGJFp8 DO8EUiT8a8SxMFdCV2kPv85jhj4tX5JYpE6OVR5cq1rHApFe+WifFxggp0j5eVVV9CwY AP8LGf41JOF5NM68CSjC7HrU9+63gcZt2jUnc= 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:content-type :x-gm-message-state; bh=4S6hkVpM9FXrVbNUoByJ79aWGusmA5JXAeEhRutfky8=; b=IVM5VKlV6z/LWq/bd+rWQav37qbfuNfLgfUZmdhH8Z23h0/y8zOkJ7XOC5RkSHtlne vruk14nz0KnXPDBUvr5BiPmEODbaji+gdhoBTewm7a/RANAK4EcQj53I5g2Ud3tJKHgx dAevsvUaC7MZUWNZX7WBopLo4KKZwTTCQPD8Ilu5WrxlFV20KEjA3yCyZz945RNG+Fxd AS/nEzOV+NMFzpmF59Csiv0Gem+EKsGUOwrU0RomRziehPkR/TwnZSPWETJJ15egvIkO dc9QO1KljeUeCZsUoXdUr+Omk1Srlivw4uqLKwWX5BclvCKH5ppLYnCRx8PM2PE1eIjn GLzg== X-Received: by 10.66.76.42 with SMTP id h10mr28254711paw.59.1360430431487; Sat, 09 Feb 2013 09:20:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.148.10 with HTTP; Sat, 9 Feb 2013 09:20:00 -0800 (PST) In-Reply-To: <201302091713.r19HDqv6006148@svn.freebsd.org> References: <201302091713.r19HDqv6006148@svn.freebsd.org> From: Eitan Adler Date: Sat, 9 Feb 2013 12:20:00 -0500 X-Google-Sender-Auth: Noj758CFXtVzgdnSqwGFE0HIieM Message-ID: Subject: Re: svn commit: r246593 - head/lib/libc/sys To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQke1ClDJTZQa5uGQ4OOrTrHTDox4CQ+GNpopfpaDU7WRjuNIr2UYR7s66QyCWbHjNHMck0u X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 17:20:32 -0000 On 9 February 2013 12:13, Eitan Adler wrote: > Author: eadler > Date: Sat Feb 9 17:13:51 2013 > New Revision: 246593 > URL: http://svnweb.freebsd.org/changeset/base/246593 > > Log: > Fix logic inversion. > > PR: docs/174966 http://www.FreeBSD.org/cgi/query-pr.cgi?pr=174966 > Submitted by: Christian Ullrich > Approved by: bcr (mentor) > > Modified: > head/lib/libc/sys/chflags.2 > > Modified: head/lib/libc/sys/chflags.2 > ============================================================================== > --- head/lib/libc/sys/chflags.2 Sat Feb 9 13:31:59 2013 (r246592) > +++ head/lib/libc/sys/chflags.2 Sat Feb 9 17:13:51 2013 (r246593) > @@ -98,7 +98,7 @@ If one of > or > .Dv SF_NOUNLINK > is set a non-super-user cannot change any flags and even the super-user > -can change flags only if securelevel is greater than 0. > +can change flags only if securelevel is 0. I was reminded the default -1, not 0. I'll fix this shortly. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 17:26:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD6E9ED; Sat, 9 Feb 2013 17:26:16 +0000 (UTC) (envelope-from tuexen@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 CF6E3636; Sat, 9 Feb 2013 17:26: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 r19HQGrw009498; Sat, 9 Feb 2013 17:26:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19HQEZZ009488; Sat, 9 Feb 2013 17:26:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201302091726.r19HQEZZ009488@svn.freebsd.org> From: Michael Tuexen Date: Sat, 9 Feb 2013 17:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246595 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 17:26:16 -0000 Author: tuexen Date: Sat Feb 9 17:26:14 2013 New Revision: 246595 URL: http://svnweb.freebsd.org/changeset/base/246595 Log: Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK only the supported address types. While there, do some whitespace cleanups. MFC after: 1 week Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp.h Sat Feb 9 17:26:14 2013 (r246595) @@ -500,12 +500,12 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_SOCKET_GONE 0x10000000 #define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x20000000 #define SCTP_PCB_FLAGS_SOCKET_CANT_READ 0x40000000 + /* flags to copy to new PCB */ #define SCTP_PCB_COPY_FLAGS (SCTP_PCB_FLAGS_BOUNDALL|\ SCTP_PCB_FLAGS_WAKEINPUT|\ SCTP_PCB_FLAGS_BOUND_V6) - /* * PCB Features (in sctp_features bitmask) */ Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_asconf.c Sat Feb 9 17:26:14 2013 (r246595) @@ -1916,7 +1916,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { return; } /* is it the right link local scope? */ @@ -1924,7 +1924,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } } - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { return; } @@ -1948,7 +1948,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * /* we skip unspecifed addresses */ return; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { return; } @@ -2106,7 +2106,7 @@ sctp_asconf_iterator_stcb(struct sctp_in continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { continue; } /* is it the right link local scope? */ @@ -2135,7 +2135,7 @@ sctp_asconf_iterator_stcb(struct sctp_in /* we skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { continue; } @@ -2198,13 +2198,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } } else { /* Need to check scopes for this guy */ - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } } @@ -2437,7 +2431,7 @@ sctp_find_valid_localaddr(struct sctp_tc return (NULL); } LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { - if (stcb->asoc.loopback_scope == 0 && + if (stcb->asoc.scope.loopback_scope == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* Skip if loopback_scope not set */ continue; @@ -2446,7 +2440,7 @@ sctp_find_valid_localaddr(struct sctp_tc switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&sctp_ifa->address.sa; @@ -2454,7 +2448,7 @@ sctp_find_valid_localaddr(struct sctp_tc /* skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) continue; @@ -2473,7 +2467,7 @@ sctp_find_valid_localaddr(struct sctp_tc #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { struct sockaddr_in6 *sin6; if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { @@ -2487,10 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tc */ continue; } - if (stcb->asoc.local_scope == 0 && + if (stcb->asoc.scope.local_scope == 0 && IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) continue; - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) continue; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_input.c Sat Feb 9 17:26:14 2013 (r246595) @@ -2130,13 +2130,13 @@ sctp_process_cookie_new(struct mbuf *m, asoc = &stcb->asoc; /* get scope variables out of cookie */ - asoc->ipv4_local_scope = cookie->ipv4_scope; - asoc->site_scope = cookie->site_scope; - asoc->local_scope = cookie->local_scope; - asoc->loopback_scope = cookie->loopback_scope; + asoc->scope.ipv4_local_scope = cookie->ipv4_scope; + asoc->scope.site_scope = cookie->site_scope; + asoc->scope.local_scope = cookie->local_scope; + asoc->scope.loopback_scope = cookie->loopback_scope; - if ((asoc->ipv4_addr_legal != cookie->ipv4_addr_legal) || - (asoc->ipv6_addr_legal != cookie->ipv6_addr_legal)) { + if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) || + (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal)) { struct mbuf *op_err; /* Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_output.c Sat Feb 9 17:26:14 2013 (r246595) @@ -1863,15 +1863,10 @@ struct sack_track sack_array[256] = { int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope SCTP_UNUSED,/* XXX */ - int site_scope, + struct sctp_scoping *scope, int do_update) { - if ((loopback_scope == 0) && + if ((scope->loopback_scope == 0) && (ifa->ifn_p) && SCTP_IFN_IS_IFT_LOOP(ifa->ifn_p)) { /* * skip loopback if not in scope * @@ -1881,7 +1876,7 @@ sctp_is_address_in_scope(struct sctp_ifa switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (ipv4_addr_legal) { + if (scope->ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&ifa->address.sin; @@ -1889,7 +1884,7 @@ sctp_is_address_in_scope(struct sctp_ifa /* not in scope , unspecified */ return (0); } - if ((ipv4_local_scope == 0) && + if ((scope->ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { /* private address not in scope */ return (0); @@ -1901,7 +1896,7 @@ sctp_is_address_in_scope(struct sctp_ifa #endif #ifdef INET6 case AF_INET6: - if (ipv6_addr_legal) { + if (scope->ipv6_addr_legal) { struct sockaddr_in6 *sin6; /* @@ -1924,7 +1919,7 @@ sctp_is_address_in_scope(struct sctp_ifa (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { return (0); } - if ((site_scope == 0) && + if ((scope->site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { return (0); } @@ -2063,13 +2058,7 @@ sctp_add_addresses_to_i_ia(struct sctp_i if (sctp_is_addr_restricted(stcb, sctp_ifap)) { continue; } - if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + if (sctp_is_address_in_scope(sctp_ifap, scope, 1) == 0) { continue; } cnt++; @@ -2099,12 +2088,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2157,12 +2141,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + scope, 1) == 0) { continue; } cnt++; @@ -2182,12 +2161,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2801,13 +2775,7 @@ sctp_select_nth_preferred_addr_from_ifn_ } #endif if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -2853,13 +2821,7 @@ sctp_count_num_preferred_boundall(struct continue; } if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -3055,13 +3017,7 @@ again_with_private_addresses_allowed: continue; } if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); sifa = NULL; continue; @@ -3108,13 +3064,7 @@ plan_d: if (sifa == NULL) continue; if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { sifa = NULL; continue; } @@ -3135,12 +3085,12 @@ plan_d: } } #ifdef INET - if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { - stcb->asoc.ipv4_local_scope = 1; + if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { + stcb->asoc.scope.ipv4_local_scope = 1; retried = 1; goto again_with_private_addresses_allowed; } else if (retried == 1) { - stcb->asoc.ipv4_local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 0; } #endif out: @@ -3169,12 +3119,7 @@ out: } if (stcb) { if (sctp_is_address_in_scope(tmp_sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -4595,7 +4540,6 @@ sctp_send_initiate(struct sctp_inpcb *in #endif ) { - struct sctp_scoping scp; struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; @@ -4675,37 +4619,29 @@ sctp_send_initiate(struct sctp_inpcb *in init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); -#if defined(INET) || defined(INET6) - /* now the address restriction */ - /* XXX Should we take the address family of the socket into account? */ - sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); - sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); -#ifdef INET6 -#ifdef INET - /* we support 2 types: IPv4/IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); - padding_len = 0; -#else - /* we support 1 type: IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif -#else - /* we support 1 type: IPv4 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif - chunk_len += parameter_len; -#endif + if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { + uint8_t i; + + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + if (stcb->asoc.scope.ipv4_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); + sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); + sup_addr->ph.param_length = htons(parameter_len); + i = 0; + if (stcb->asoc.scope.ipv4_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV4_ADDRESS); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV6_ADDRESS); + } + padding_len = 4 - 2 * i; + chunk_len += parameter_len; + } /* Adaptation layer indication parameter */ /* XXX: Should we include this always? */ if (padding_len > 0) { @@ -4860,13 +4796,7 @@ sctp_send_initiate(struct sctp_inpcb *in * we could just sifa in the address within the stcb. But for now * this is a quick hack to get the address stuff teased apart. */ - scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; - scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; - scp.loopback_scope = stcb->asoc.loopback_scope; - scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; - scp.local_scope = stcb->asoc.local_scope; - scp.site_scope = stcb->asoc.site_scope; - sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to, &padding_len, &chunk_len); + sctp_add_addresses_to_i_ia(inp, stcb, &stcb->asoc.scope, m, cnt_inits_to, &padding_len, &chunk_len); init->ch.chunk_length = htons(chunk_len); if (padding_len > 0) { @@ -5507,24 +5437,16 @@ do_a_abort: */ stc.site_scope = stc.local_scope = stc.loopback_scope = 0; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - struct inpcb *in_inp; - - /* Its a V6 socket */ - in_inp = (struct inpcb *)inp; stc.ipv6_addr_legal = 1; - /* Now look at the binding flag to see if V4 will be legal */ - if (SCTP_IPV6_V6ONLY(in_inp) == 0) { - stc.ipv4_addr_legal = 1; - } else { - /* V4 addresses are NOT legal on the association */ + if (SCTP_IPV6_V6ONLY(inp)) { stc.ipv4_addr_legal = 0; + } else { + stc.ipv4_addr_legal = 1; } } else { - /* Its a V4 socket, no - V6 */ - stc.ipv4_addr_legal = 1; stc.ipv6_addr_legal = 0; + stc.ipv4_addr_legal = 1; } - #ifdef SCTP_DONT_DO_PRIVADDR_SCOPE stc.ipv4_scope = 1; #else @@ -5629,10 +5551,10 @@ do_a_abort: #endif - stc.loopback_scope = asoc->loopback_scope; - stc.ipv4_scope = asoc->ipv4_local_scope; - stc.site_scope = asoc->site_scope; - stc.local_scope = asoc->local_scope; + stc.loopback_scope = asoc->scope.loopback_scope; + stc.ipv4_scope = asoc->scope.ipv4_local_scope; + stc.site_scope = asoc->scope.site_scope; + stc.local_scope = asoc->scope.local_scope; #ifdef INET6 /* Why do we not consider IPv4 LL addresses? */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_output.h Sat Feb 9 17:26:14 2013 (r246595) @@ -55,13 +55,9 @@ int sctp_is_addr_restricted(struct sctp_ int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope, - int site_scope, + struct sctp_scoping *scope, int do_update); + int sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_pcb.c Sat Feb 9 17:26:14 2013 (r246595) @@ -94,11 +94,10 @@ sctp_fill_pcbinfo(struct sctp_pcbinfo *s spcb->readq_count = SCTP_BASE_INFO(ipi_count_readq); spcb->stream_oque = SCTP_BASE_INFO(ipi_count_strmoq); spcb->free_chunks = SCTP_BASE_INFO(ipi_free_chunks); - SCTP_INP_INFO_RUNLOCK(); } -/* +/*- * Addresses are added to VRF's (Virtual Router's). For BSD we * have only the default VRF 0. We maintain a hash list of * VRF's. Each VRF has its own list of sctp_ifn's. Each of @@ -214,7 +213,6 @@ sctp_find_ifn(void *ifn, uint32_t ifn_in } - struct sctp_vrf * sctp_find_vrf(uint32_t vrf_id) { @@ -230,6 +228,7 @@ sctp_find_vrf(uint32_t vrf_id) return (NULL); } + void sctp_free_vrf(struct sctp_vrf *vrf) { @@ -245,6 +244,7 @@ sctp_free_vrf(struct sctp_vrf *vrf) } } + void sctp_free_ifn(struct sctp_ifn *sctp_ifnp) { @@ -258,6 +258,7 @@ sctp_free_ifn(struct sctp_ifn *sctp_ifnp } } + void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu) { @@ -283,6 +284,7 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap } } + static void sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) { @@ -305,12 +307,13 @@ sctp_delete_ifn(struct sctp_ifn *sctp_if sctp_free_ifn(sctp_ifnp); } + void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -348,12 +351,13 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -391,6 +395,7 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + /*- * Add an ifa to an ifn. * Register the interface as necessary. @@ -428,6 +433,7 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sct } } + /*- * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register @@ -479,6 +485,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa } } + struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, uint32_t ifn_type, const char *if_name, void *ifa, @@ -1027,6 +1034,7 @@ sctp_tcb_special_locate(struct sctp_inpc return (NULL); } + static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { @@ -1036,19 +1044,12 @@ sctp_does_stcb_own_this_addr(struct sctp struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; - ipv4_addr_legal = ipv6_addr_legal = 0; - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(stcb->sctp_ep) == 0) { - ipv4_addr_legal = 1; - } - } else { - ipv4_addr_legal = 1; - } + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); @@ -1183,6 +1184,7 @@ sctp_does_stcb_own_this_addr(struct sctp return (0); } + /* * rules for use * @@ -1471,11 +1473,11 @@ null_return: return (NULL); } + /* * Find an association for a specific endpoint using the association id given * out in the COMM_UP notification */ - struct sctp_tcb * sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock) { @@ -1536,6 +1538,9 @@ sctp_findassociation_ep_asocid(struct sc } +/* + * Endpoint probe expects that the INP_INFO is locked. + */ static struct sctp_inpcb * sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, uint16_t lport, uint32_t vrf_id) @@ -1552,12 +1557,8 @@ sctp_endpoint_probe(struct sockaddr *nam struct sockaddr_in6 *intf_addr6; #endif - int fnd; - /* - * Endpoint probe expects that the INP_INFO is locked. - */ #ifdef INET sin = NULL; #endif @@ -1893,6 +1894,7 @@ sctp_pcb_findep(struct sockaddr *nam, in return (inp); } + /* * Find an association for an endpoint with the pointer to whom you want to * send to and the endpoint pointer. The address can be IPv4 or IPv6. We may @@ -2144,6 +2146,7 @@ sctp_findassoc_by_vtag(struct sockaddr * return (NULL); } + /* * Find an association with the pointer to the inbound IP packet. This can be * a IPv4 or IPv6 packet. @@ -3743,13 +3746,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->ipv4_local_scope = 1; #else if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - stcb->asoc.ipv4_local_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; } #endif /* SCTP_DONT_DO_PRIVADDR_SCOPE */ } else { /* Validate the address is in scope */ if ((IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) && - (stcb->asoc.ipv4_local_scope == 0)) { + (stcb->asoc.scope.ipv4_local_scope == 0)) { addr_inscope = 0; } } @@ -3770,10 +3773,10 @@ sctp_add_remote_addr(struct sctp_tcb *st sin6->sin6_len = sizeof(struct sockaddr_in6); if (set_scope) { if (sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id)) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { /* * If the new destination is a @@ -3785,26 +3788,26 @@ sctp_add_remote_addr(struct sctp_tcb *st * also be on our private network * for v4 too. */ - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { /* * If the new destination is * SITE_LOCAL then we must have site * scope in common. */ - stcb->asoc.site_scope = 1; + stcb->asoc.scope.site_scope = 1; } } else { /* Validate the address is in scope */ if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) && - (stcb->asoc.loopback_scope == 0)) { + (stcb->asoc.scope.loopback_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) && - (stcb->asoc.local_scope == 0)) { + (stcb->asoc.scope.local_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && - (stcb->asoc.site_scope == 0)) { + (stcb->asoc.scope.site_scope == 0)) { addr_inscope = 0; } } @@ -3839,10 +3842,10 @@ sctp_add_remote_addr(struct sctp_tcb *st } net->addr_is_local = sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id); if (net->addr_is_local && ((set_scope || (from == SCTP_ADDR_IS_CONFIRMED)))) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.site_scope = 1; addr_inscope = 1; } net->failure_threshold = stcb->asoc.def_net_failure; @@ -6071,7 +6074,7 @@ sctp_load_addresses_from_init(struct sct switch (sa->sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { return (-1); } @@ -6080,7 +6083,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { return (-2); } @@ -6127,7 +6130,7 @@ sctp_load_addresses_from_init(struct sct } #ifdef INET if (ptype == SCTP_IPV4_ADDRESS) { - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sctp_ipv4addr_param *p4, p4_buf; /* ok get the v4 address and check/add */ @@ -6213,7 +6216,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 if (ptype == SCTP_IPV6_ADDRESS) { - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { /* ok get the v6 address and check/add */ struct sctp_ipv6addr_param *p6, p6_buf; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_structs.h Sat Feb 9 17:26:14 2013 (r246595) @@ -1177,17 +1177,7 @@ struct sctp_association { */ uint8_t peer_supports_pktdrop; - /* Do we allow V6/V4? */ - uint8_t ipv4_addr_legal; - uint8_t ipv6_addr_legal; - /* Address scoping flags */ - /* scope value for IPv4 */ - uint8_t ipv4_local_scope; - /* scope values for IPv6 */ - uint8_t local_scope; - uint8_t site_scope; - /* loopback scope */ - uint8_t loopback_scope; + struct sctp_scoping scope; /* flags to handle send alternate net tracking */ uint8_t used_alt_onsack; uint8_t used_alt_asconfack; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_sysctl.c Sat Feb 9 17:26:14 2013 (r246595) @@ -197,29 +197,29 @@ copy_out_local_addresses(struct sctp_inp /* Turn on all the appropriate scope */ if (stcb) { /* use association specific values */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* use generic values for endpoints */ + /* Use generic values for endpoints. */ loopback_scope = 1; ipv4_local_scope = 1; local_scope = 1; site_scope = 1; - } - - /* use only address families of interest */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp)) { - ipv4_addr_legal = 0; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; - ipv6_addr_legal = 0; } /* neither Mac OS X nor FreeBSD support mulitple routing functions */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctp_usrreq.c Sat Feb 9 17:26:14 2013 (r246595) @@ -1143,23 +1143,29 @@ sctp_fill_up_addresses_vrf(struct sctp_i if (stcb) { /* Turn on all the appropriate scope */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* Turn on ALL scope, since we look at the EP */ - loopback_scope = ipv4_local_scope = local_scope = - site_scope = 1; - } - ipv4_addr_legal = ipv6_addr_legal = 0; - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp) == 0) { + /* Use generic values for endpoints. */ + loopback_scope = 1; + ipv4_local_scope = 1; + local_scope = 1; + site_scope = 1; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } + } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; } vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { @@ -1298,8 +1304,21 @@ sctp_fill_up_addresses_vrf(struct sctp_i } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; - - ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + switch (laddr->ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; + break; +#endif +#ifdef INET6 + case AF_INET6: + ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + break; +#endif + default: + /* TSNH */ + break; + } sas = (struct sockaddr_storage *)((caddr_t)sas + laddr->ifa->address.sa.sa_len); actual += laddr->ifa->address.sa.sa_len; @@ -5948,7 +5967,7 @@ sctp_connect(struct socket *so, struct s error = EINVAL; goto out_now; } -#endif /* INET6 */ +#endif if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) == SCTP_PCB_FLAGS_UNBOUND) { /* Bind a ephemeral port */ @@ -6242,8 +6261,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); - sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; - sin->sin_addr = ((struct sockaddr_in *)&store)->sin_addr; + sin->sin_port = store.sin.sin_port; + sin->sin_addr = store.sin.sin_addr; *addr = (struct sockaddr *)sin; break; } @@ -6258,9 +6277,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); - sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; - - sin6->sin6_addr = ((struct sockaddr_in6 *)&store)->sin6_addr; + sin6->sin6_port = store.sin6.sin6_port; + sin6->sin6_addr = store.sin6.sin6_addr; if ((error = sa6_recoverscope(sin6)) != 0) { SCTP_FREE_SONAME(sin6); return (error); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Feb 9 17:13:54 2013 (r246594) +++ head/sys/netinet/sctputil.c Sat Feb 9 17:26:14 2013 (r246595) @@ -878,7 +878,7 @@ sctp_select_a_tag(struct sctp_inpcb *inp } int -sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb, +sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t vrf_id) { struct sctp_association *asoc; @@ -899,23 +899,23 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc = &stcb->asoc; /* init all variables to a known value. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 20:13:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B5E8AEC; Sat, 9 Feb 2013 20:13:30 +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 5614E107; Sat, 9 Feb 2013 20:13: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 r19IEQTe024759; Sat, 9 Feb 2013 18:14:26 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19IEQEu024758; Sat, 9 Feb 2013 18:14:26 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302091814.r19IEQEu024758@svn.freebsd.org> From: Tim Kientzle Date: Sat, 9 Feb 2013 18:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246600 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 20:13:30 -0000 Author: kientzle Date: Sat Feb 9 18:14:26 2013 New Revision: 246600 URL: http://svnweb.freebsd.org/changeset/base/246600 Log: Add dtc to the build. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Feb 9 18:00:29 2013 (r246599) +++ head/usr.bin/Makefile Sat Feb 9 18:14:26 2013 (r246600) @@ -37,6 +37,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ + dtc \ du \ ee \ elf2aout \ From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 20:13:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0006AEE; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) (envelope-from ume@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 928F8109; Sat, 9 Feb 2013 20:13: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 r19I0TEq019361; Sat, 9 Feb 2013 18:00:29 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19I0T1u019360; Sat, 9 Feb 2013 18:00:29 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201302091800.r19I0T1u019360@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 9 Feb 2013 18:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246599 - stable/8/etc/rc.d X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 20:13:30 -0000 Author: ume Date: Sat Feb 9 18:00:29 2013 New Revision: 246599 URL: http://svnweb.freebsd.org/changeset/base/246599 Log: MFC r246255: Use the default policy table of RFC 6724. Modified: stable/8/etc/rc.d/ip6addrctl Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/ip6addrctl ============================================================================== --- stable/8/etc/rc.d/ip6addrctl Sat Feb 9 17:56:57 2013 (r246598) +++ stable/8/etc/rc.d/ip6addrctl Sat Feb 9 18:00:29 2013 (r246599) @@ -22,22 +22,30 @@ prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" ip6addrctl_prefer_ipv6() { ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add ::/96 20 3 - ip6addrctl add ::ffff:0:0/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 35 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } ip6addrctl_prefer_ipv4() { ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::ffff:0:0/96 50 0 - ip6addrctl add ::1/128 40 1 - ip6addrctl add ::/0 30 2 - ip6addrctl add 2002::/16 20 3 - ip6addrctl add ::/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 100 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 20:13:30 2013 Return-Path: Delivered-To: svn-src-all@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 AB152AEF; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) (envelope-from ume@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 9DA9110A; Sat, 9 Feb 2013 20:13: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 r19HuvTp018614; Sat, 9 Feb 2013 17:56:57 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19Huva2018613; Sat, 9 Feb 2013 17:56:57 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201302091756.r19Huva2018613@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 9 Feb 2013 17:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246598 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 20:13:30 -0000 Author: ume Date: Sat Feb 9 17:56:57 2013 New Revision: 246598 URL: http://svnweb.freebsd.org/changeset/base/246598 Log: MFC r246255: Use the default policy table of RFC 6724. Modified: stable/9/etc/rc.d/ip6addrctl Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/ip6addrctl ============================================================================== --- stable/9/etc/rc.d/ip6addrctl Sat Feb 9 17:34:48 2013 (r246597) +++ stable/9/etc/rc.d/ip6addrctl Sat Feb 9 17:56:57 2013 (r246598) @@ -29,11 +29,15 @@ ip6addrctl_prefer_ipv6() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add ::/96 20 3 - ip6addrctl add ::ffff:0:0/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 35 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } @@ -42,11 +46,15 @@ ip6addrctl_prefer_ipv4() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::ffff:0:0/96 50 0 - ip6addrctl add ::1/128 40 1 - ip6addrctl add ::/0 30 2 - ip6addrctl add 2002::/16 20 3 - ip6addrctl add ::/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 100 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 21:35:55 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1BC81DD; Sat, 9 Feb 2013 21:35:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id E7533942; Sat, 9 Feb 2013 21:35:54 +0000 (UTC) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r19JZsRF020687; Sun, 10 Feb 2013 06:35:54 +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 mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r19JZoi4025212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 10 Feb 2013 06:35:51 +1100 Date: Sun, 10 Feb 2013 06:35:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r246593 - head/lib/libc/sys In-Reply-To: Message-ID: <20130210051121.L3760@besplex.bde.org> References: <201302091713.r19HDqv6006148@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=Uug7rJMB c=1 sm=1 a=cAXCqpZEShQA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=uiiGxAOqq18A:10 a=6I5d2MoRAAAA:8 a=ZFVg263UAAAA:8 a=NV3LF1PM_9Jh4ooLTqgA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=o-NGsO4tlvUA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 21:35:55 -0000 On Sat, 9 Feb 2013, Eitan Adler wrote: > On 9 February 2013 12:13, Eitan Adler wrote: >> Author: eadler >> Date: Sat Feb 9 17:13:51 2013 >> New Revision: 246593 >> URL: http://svnweb.freebsd.org/changeset/base/246593 >> >> Log: >> Fix logic inversion. >> >> PR: docs/174966 http://www.FreeBSD.org/cgi/query-pr.cgi?pr=174966 >> Submitted by: Christian Ullrich >> Approved by: bcr (mentor) >> >> Modified: >> head/lib/libc/sys/chflags.2 >> >> Modified: head/lib/libc/sys/chflags.2 >> ============================================================================== >> --- head/lib/libc/sys/chflags.2 Sat Feb 9 13:31:59 2013 (r246592) >> +++ head/lib/libc/sys/chflags.2 Sat Feb 9 17:13:51 2013 (r246593) >> @@ -98,7 +98,7 @@ If one of >> or >> .Dv SF_NOUNLINK >> is set a non-super-user cannot change any flags and even the super-user >> -can change flags only if securelevel is greater than 0. >> +can change flags only if securelevel is 0. > > I was reminded the default -1, not 0. I'll fix this shortly. Also, this seems to be wrong about changing flags. Old versions say that only clearing flags is prevented by securelevel > 0, and the code still seems to do this: Old man page: @ The ``SF_IMMUTABLE'', ``SF_APPEND'', ``SF_NOUNLINK'', and ``SF_ARCHIVED'' @ flags may only be set or unset by the super-user. Attempts by the non- @ super-user to set the super-user only flags are silently ignored. These @ ^^^^^ @ flags may be set at any time, but normally may only be unset when the @ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @ system is in single-user mode. (See init(8) for details.) Current ffs code: @ /* @ * Unprivileged processes are not permitted to unset system @ * flags, or modify flags if any system flags are set. @ ^^^^^^^^^^^^^^^^ @ * Privileged non-jail processes may not modify system flags @ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @ * if securelevel > 0 and any existing system flags are set. @ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^. @ ||| ||| @ * Privileged jail processes behave like privileged non-jail @ * processes if the security.jail.chflags_allowed sysctl is @ * is non-zero; otherwise, they behave like unprivileged @ * processes. @ */ "any" is also wrong here. Only 3 flags system flags prevent unprivileged processes from modifying (user) flags. Only the same 3 system flags prevent privileged processes from modifying flags if securelevel > 0. These 3 flags are listed correctly in the man page, except they are listed 3 times (in the part that you changed, and in the [EPERM] description for each of chflags(2) and chflags(3)). Triplicating this is a good source of errors. There is no logic inversion or off-by-1 error in the [EPERM] parts. @ if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) { The man page still uses the old term "super-user", while the code uses "privileged" (in comments too). We get here if we have privilege. The logic for the test is obfuscated uses boolean '!' for a non-boolean. @ if (ip->i_flags & @ (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) { @ error = securelevel_gt(cred, 0); @ if (error) @ return (error); @ } This checks for flags already set (in the inode). Not ones that we are trying to set. When none is set, we don't even look at securelevel. We get here even if securelevel > 0 if none of the 3 flags is already set. Same as in 4.4BSD-Lite1. The old man page is correct. @ /* The snapshot flag cannot be toggled. */ @ if ((vap->va_flags ^ ip->i_flags) & SF_SNAPSHOT) @ return (EPERM); After this, all changes to the flags are permitted. When securelevel > 0, the toggling that they do must actually be setting for the 3 special flags. A final toggling of the other flags is possible in the same step as setting one of the 3 special flags. @ } else { 3 special flags is 1 or 2 too many. In my version, SF_NOUNLINK doesn't give immutability for flags. It just prevents unlink(), rename() and rmdir(). In all versions, it doesn't prevent chown(), chmod(), utimes(), link() or truncating the file, so why should it prevent chflags()? If you want immutability then you should use SF_IMMUTABLE. Perhaps similarly for SF_APPEND, but since it is a positive logic flag its semantics can be read as append *only*, and that is in fact what it does. It prevents chown(), chmod(), utimes(), link() and truncating the file (at least for [f]truncate(2) on regular files). The man page doesn't give many details of what append and nounlink flags do. It says that *F_APPEND means that the file may only be appended to. This covers all of the above preventions, but also literally says that the file may not be read, or cntled, or even opened... It says that *F_NOUNLINK means that the file may not be renamed or deleted, then (mis)describes how it it also gives immutability of the flags. This seems to cover all the things that it prevents. Nearby I noticed bad wording for SF_ARCHIVED. It says "may". For all the other descriptions, "may" means permission. Here it means that no one knows what it means, but it might mean that an old version of the file might have been archived. msdosfs clears this flag when the file is changed (at least for write()), but ffs doesn't, so you can never trust it for ffs. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 21:36:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D79E9350; Sat, 9 Feb 2013 21:36:15 +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 CA64394B; Sat, 9 Feb 2013 21:36: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 r19LaFS2084600; Sat, 9 Feb 2013 21:36:15 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19LaFlv084599; Sat, 9 Feb 2013 21:36:15 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302092136.r19LaFlv084599@svn.freebsd.org> From: Tim Kientzle Date: Sat, 9 Feb 2013 21:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246601 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 21:36:15 -0000 Author: kientzle Date: Sat Feb 9 21:36:14 2013 New Revision: 246601 URL: http://svnweb.freebsd.org/changeset/base/246601 Log: Fix breakage introduced in r246318. Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sat Feb 9 18:14:26 2013 (r246600) +++ head/sys/arm/arm/vm_machdep.c Sat Feb 9 21:36:14 2013 (r246601) @@ -402,7 +402,8 @@ cpu_thread_alloc(struct thread *td) * the ARM EABI. */ td->td_frame = (struct trapframe *)STACKALIGN((u_int)td->td_kstack + - USPACE_SVC_STACK_TOP - sizeof(struct pcb) - 1); + USPACE_SVC_STACK_TOP - sizeof(struct pcb) - + sizeof(struct trapframe)); #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE); From owner-svn-src-all@FreeBSD.ORG Sat Feb 9 23:17:29 2013 Return-Path: Delivered-To: svn-src-all@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 242765CA; Sat, 9 Feb 2013 23:17:29 +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 004B2D2B; Sat, 9 Feb 2013 23:17: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 r19NHSIf015040; Sat, 9 Feb 2013 23:17:28 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19NHSPO015039; Sat, 9 Feb 2013 23:17:28 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201302092317.r19NHSPO015039@svn.freebsd.org> From: Brooks Davis Date: Sat, 9 Feb 2013 23:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246602 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 23:17:29 -0000 Author: brooks Date: Sat Feb 9 23:17:28 2013 New Revision: 246602 URL: http://svnweb.freebsd.org/changeset/base/246602 Log: Add nmtree to ITOOLS if it is installed on the host instead of keying off the BOOTSTRAPPING variable. The previous test was wrong because BOOTSTRAPPING is 0 in most cases. Tested by: db Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 9 21:36:14 2013 (r246601) +++ head/Makefile.inc1 Sat Feb 9 23:17:28 2013 (r246602) @@ -673,6 +673,10 @@ _install-info= install-info _zoneinfo= zic tzsetup .endif +.if exists(/usr/sbin/nmtree) +_nmtree_itools= nmtree +.endif + ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \ @@ -1134,8 +1138,6 @@ _yacc= usr.bin/yacc .if ${BOOTSTRAPPING} < 1000026 _nmtree= lib/libnetbsd \ usr.sbin/nmtree -.else -_nmtree_itools= nmtree .endif .if ${BOOTSTRAPPING} < 1000027