From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 01:07:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A321AB; Sun, 17 Nov 2013 01:07:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2292A2EC0; Sun, 17 Nov 2013 01:07:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH17lEm051527; Sun, 17 Nov 2013 01:07:47 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH17kDe051526; Sun, 17 Nov 2013 01:07:46 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201311170107.rAH17kDe051526@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 17 Nov 2013 01:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258242 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 01:07:47 -0000 Author: alfred Date: Sun Nov 17 01:07:46 2013 New Revision: 258242 URL: http://svnweb.freebsd.org/changeset/base/258242 Log: MFC: 257542 Fix API mismatch exposed by lagg. When destroying a lagg the driver tries to restore the old mac and fails due to API mismatch. Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 00:49:55 2013 (r258241) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 01:07:46 2013 (r258242) @@ -604,8 +604,8 @@ int mlx4_en_start_port(struct net_device en_dbg(DRV, priv, "Setting mac for port %d\n", priv->port); err = mlx4_register_mac(mdev->dev, priv->port, mlx4_en_mac_to_u64(IF_LLADDR(dev))); - if (err) { - en_err(priv, "Failed setting port mac\n"); + if (err < 0) { + en_err(priv, "Failed setting port mac err=%d\n", err); goto tx_err; } mdev->mac_removed[priv->port] = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 01:59: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F25F5C5; Sun, 17 Nov 2013 01:59:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7B32092; Sun, 17 Nov 2013 01:59:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH1xh0H067887; Sun, 17 Nov 2013 01:59:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH1xh1m067886; Sun, 17 Nov 2013 01:59:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311170159.rAH1xh1m067886@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 01:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258243 - head/sys/powerpc/booke 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 01:59:43 -0000 Author: nwhitehorn Date: Sun Nov 17 01:59:42 2013 New Revision: 258243 URL: http://svnweb.freebsd.org/changeset/base/258243 Log: Make sure that TLB1 mappings are aligned correctly. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Nov 17 01:07:46 2013 (r258242) +++ head/sys/powerpc/booke/pmap.c Sun Nov 17 01:59:42 2013 (r258243) @@ -3175,6 +3175,7 @@ pmap_early_io_map(vm_paddr_t pa, vm_size pa_base = trunc_page(pa); size = roundup(size + (pa - pa_base), PAGE_SIZE); + tlb1_map_base = roundup2(tlb1_map_base, 1 << (ilog2(size) & ~1)); va = tlb1_map_base + (pa - pa_base); do { From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 02:03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83DC27F6; Sun, 17 Nov 2013 02:03:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72F5E20CD; Sun, 17 Nov 2013 02:03:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH23blh070907; Sun, 17 Nov 2013 02:03:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH23aZI070904; Sun, 17 Nov 2013 02:03:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311170203.rAH23aZI070904@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 02:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258244 - in head/sys/powerpc: booke mpc85xx 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 02:03:37 -0000 Author: nwhitehorn Date: Sun Nov 17 02:03:36 2013 New Revision: 258244 URL: http://svnweb.freebsd.org/changeset/base/258244 Log: Move CCSR discovery into the platform module, while simultaneously making it more flexible about how the CCSR range is found. With this change, the stock MPC85XX will boot on a Routerboard 800. Hardware donated by: Benjamin Perrault Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/mpc85xx/mpc85xx.h head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun Nov 17 01:59:42 2013 (r258243) +++ head/sys/powerpc/booke/machdep.c Sun Nov 17 02:03:36 2013 (r258244) @@ -387,14 +387,6 @@ booke_init(uint32_t arg1, uint32_t arg2) /* Reset TLB1 to get rid of temporary mappings */ tlb1_init(); - /* Set up IMMR */ - if (fdt_immr_addr(0) == 0) { - fdt_immr_va = pmap_early_io_map(fdt_immr_pa, fdt_immr_size); - } else { - printf("Warning: SOC base registers could not be found!\n"); - fdt_immr_va = 0; - } - /* Reset Time Base */ mttb(0); Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Sun Nov 17 01:59:42 2013 (r258243) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Sun Nov 17 02:03:36 2013 (r258244) @@ -33,7 +33,8 @@ /* * Configuration control and status registers */ -#define CCSRBAR_VA fdt_immr_va +extern vm_offset_t ccsrbar_va; +#define CCSRBAR_VA ccsrbar_va #define OCP85XX_CCSRBAR (CCSRBAR_VA + 0x0) #define OCP85XX_BPTR (CCSRBAR_VA + 0x20) Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Nov 17 01:59:42 2013 (r258243) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Nov 17 02:03:36 2013 (r258244) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include "platform_if.h" @@ -63,6 +66,7 @@ extern uint32_t bp_tlb1_end[]; #endif extern uint32_t *bootinfo; +vm_offset_t ccsrbar_va; static int cpu, maxcpu; @@ -116,8 +120,12 @@ mpc85xx_probe(platform_t plat) static int mpc85xx_attach(platform_t plat) { - phandle_t cpus, child; + phandle_t cpus, child, ccsr; + const char *soc_name_guesses[] = {"/soc", "soc", NULL}; + const char **name; + pcell_t ranges[6], acells, pacells, scells; uint32_t sr; + uint64_t ccsrbar, ccsrsize; int i, law_max, tgt; if ((cpus = OF_finddevice("/cpus")) != -1) { @@ -128,6 +136,51 @@ mpc85xx_attach(platform_t plat) maxcpu = 1; /* + * Locate CCSR region. Irritatingly, there is no way to find it + * unless you already know where it is. Try to infer its location + * from the device tree. + */ + + ccsr = -1; + for (name = soc_name_guesses; *name != NULL && ccsr == -1; name++) + ccsr = OF_finddevice(*name); + if (ccsr == -1) { + char type[64]; + + /* That didn't work. Search for devices of type "soc" */ + child = OF_child(OF_peer(0)); + for (OF_child(child); child != 0; child = OF_peer(child)) { + if (OF_getprop(child, "device_type", type, sizeof(type)) + <= 0) + continue; + + if (strcmp(type, "soc") == 0) { + ccsr = child; + break; + } + } + } + + if (ccsr == -1) + panic("Could not locate CCSR window!"); + + OF_getprop(ccsr, "#size-cells", &scells, sizeof(scells)); + OF_getprop(ccsr, "#address-cells", &acells, sizeof(acells)); + OF_searchprop(OF_parent(ccsr), "#address-cells", &pacells, + sizeof(pacells)); + OF_getprop(ccsr, "ranges", ranges, sizeof(ranges)); + ccsrbar = ccsrsize = 0; + for (i = acells; i < acells + pacells; i++) { + ccsrbar <<= 32; + ccsrbar |= ranges[i]; + } + for (i = acells + pacells; i < acells + pacells + scells; i++) { + ccsrsize <<= 32; + ccsrsize |= ranges[i]; + } + ccsrbar_va = pmap_early_io_map(ccsrbar, ccsrsize); + + /* * Clear local access windows. Skip DRAM entries, so we don't shoot * ourselves in the foot. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 02:03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C1F929; Sun, 17 Nov 2013 02:03:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70F7320CF; Sun, 17 Nov 2013 02:03:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH23kL8070966; Sun, 17 Nov 2013 02:03:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH23kZo070962; Sun, 17 Nov 2013 02:03:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201311170203.rAH23kZo070962@svn.freebsd.org> From: Eitan Adler Date: Sun, 17 Nov 2013 02:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258245 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 02:03:46 -0000 Author: eadler Date: Sun Nov 17 02:03:45 2013 New Revision: 258245 URL: http://svnweb.freebsd.org/changeset/base/258245 Log: Add missing include files for the printf_l and scanf_l man pages. Reported by: swildner@dragonflybsd.org Modified: head/lib/libc/stdio/printf_l.3 head/lib/libc/stdio/scanf_l.3 Modified: head/lib/libc/stdio/printf_l.3 ============================================================================== --- head/lib/libc/stdio/printf_l.3 Sun Nov 17 02:03:36 2013 (r258244) +++ head/lib/libc/stdio/printf_l.3 Sun Nov 17 02:03:45 2013 (r258245) @@ -43,6 +43,7 @@ .Lb libc .Sh SYNOPSIS .In stdio.h +.In xlocale.h .Ft int .Fn printf_l "locale_t loc" "const char * restrict format" "..." .Ft int Modified: head/lib/libc/stdio/scanf_l.3 ============================================================================== --- head/lib/libc/stdio/scanf_l.3 Sun Nov 17 02:03:36 2013 (r258244) +++ head/lib/libc/stdio/scanf_l.3 Sun Nov 17 02:03:45 2013 (r258245) @@ -39,6 +39,7 @@ .Lb libc .Sh SYNOPSIS .In stdio.h +.In xlocale.h .Ft int .Fn scanf_l "locale_t loc" "const char * restrict format" "..." .Ft int From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 02:05: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC8F9A7A; Sun, 17 Nov 2013 02:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B357B20D9; Sun, 17 Nov 2013 02:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH25Lgn071300; Sun, 17 Nov 2013 02:05:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH25Ljf071296; Sun, 17 Nov 2013 02:05:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311170205.rAH25Ljf071296@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 02:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258246 - in head/sys/powerpc: include 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 02:05:21 -0000 Author: nwhitehorn Date: Sun Nov 17 02:05:20 2013 New Revision: 258246 URL: http://svnweb.freebsd.org/changeset/base/258246 Log: There is no reason Book-E needs to save XER and CTR on context switches. They aren't Book-E specific registers to begin with and, even if they were, are defined volatile by the ABI. Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/swtch32.S Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sun Nov 17 02:03:45 2013 (r258245) +++ head/sys/powerpc/include/pcb.h Sun Nov 17 02:05:20 2013 (r258246) @@ -70,8 +70,6 @@ struct pcb { register_t usr_vsid; /* USER_SR segment */ } aim; struct { - register_t ctr; - register_t xer; register_t dbcr0; } booke; } pcb_cpu; Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sun Nov 17 02:03:45 2013 (r258245) +++ head/sys/powerpc/powerpc/genassym.c Sun Nov 17 02:05:20 2013 (r258246) @@ -192,8 +192,6 @@ ASSYM(PCB_FPU, PCB_FPU); ASSYM(PCB_VEC, PCB_VEC); ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.aim.usr_vsid)); -ASSYM(PCB_BOOKE_CTR, offsetof(struct pcb, pcb_cpu.booke.ctr)); -ASSYM(PCB_BOOKE_XER, offsetof(struct pcb, pcb_cpu.booke.xer)); ASSYM(PCB_BOOKE_DBCR0, offsetof(struct pcb, pcb_cpu.booke.dbcr0)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Sun Nov 17 02:03:45 2013 (r258245) +++ head/sys/powerpc/powerpc/swtch32.S Sun Nov 17 02:05:20 2013 (r258246) @@ -90,10 +90,6 @@ ENTRY(cpu_switch) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) #ifdef BOOKE - mfctr %r16 - stw %r16,PCB_BOOKE_CTR(%r6) - mfxer %r16 - stw %r16,PCB_BOOKE_XER(%r6) mfspr %r16,SPR_DBCR0 stw %r16,PCB_BOOKE_DBCR0(%r6) #endif @@ -179,10 +175,6 @@ blocked_loop: isync #endif #ifdef BOOKE - lwz %r5,PCB_BOOKE_CTR(%r3) - mtctr %r5 - lwz %r5,PCB_BOOKE_XER(%r3) - mtctr %r5 lwz %r5,PCB_BOOKE_DBCR0(%r3) mtspr SPR_DBCR0,%r5 #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 02:26:09 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B25EBFDB; Sun, 17 Nov 2013 02:26:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A27D62198; Sun, 17 Nov 2013 02:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH2Q9lB079011; Sun, 17 Nov 2013 02:26:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH2Q95c079010; Sun, 17 Nov 2013 02:26:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311170226.rAH2Q95c079010@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 02:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258247 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 02:26:09 -0000 Author: nwhitehorn Date: Sun Nov 17 02:26:09 2013 New Revision: 258247 URL: http://svnweb.freebsd.org/changeset/base/258247 Log: Remove a pointless #ifdef AIM. This is just PPC64 specific, including 64-bit Book-E. Modified: head/sys/powerpc/include/counter.h Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Sun Nov 17 02:05:20 2013 (r258246) +++ head/sys/powerpc/include/counter.h Sun Nov 17 02:26:09 2013 (r258247) @@ -34,7 +34,7 @@ #include #endif -#if defined(AIM) && defined(__powerpc64__) +#ifdef __powerpc64__ #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) @@ -98,7 +98,7 @@ counter_u64_add(counter_u64_t c, int64_t : "cc", "memory"); } -#else /* !AIM || !64bit */ +#else /* !64bit */ #define counter_enter() critical_enter() #define counter_exit() critical_exit() @@ -157,6 +157,6 @@ counter_u64_add(counter_u64_t c, int64_t counter_exit(); } -#endif /* AIM 64bit */ +#endif /* 64bit */ #endif /* ! __MACHINE_COUNTER_H__ */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 05:03:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B4CD985; Sun, 17 Nov 2013 05:03:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2234E2888; Sun, 17 Nov 2013 05:03:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH53FR6033589; Sun, 17 Nov 2013 05:03:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH53F27033585; Sun, 17 Nov 2013 05:03:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311170503.rAH53F27033585@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 05:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258250 - head/sys/powerpc/fpu 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 05:03:16 -0000 Author: nwhitehorn Date: Sun Nov 17 05:03:15 2013 New Revision: 258250 URL: http://svnweb.freebsd.org/changeset/base/258250 Log: Make single precision floating point arithmetic actually work -- I think it never did -- and fix an obvious missing line. Floating point emulation on Book-E still needs some work but this gets it basically functional on soft-FPU systems (hard FPU for Book-E is not yet implemented). MFC after: 1 week Modified: head/sys/powerpc/fpu/fpu_emu.c head/sys/powerpc/fpu/fpu_explode.c Modified: head/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- head/sys/powerpc/fpu/fpu_emu.c Sun Nov 17 03:11:36 2013 (r258249) +++ head/sys/powerpc/fpu/fpu_emu.c Sun Nov 17 05:03:15 2013 (r258250) @@ -606,9 +606,11 @@ fpu_execute(struct trapframe *tf, struct rb = instr.i_a.i_frb; rc = instr.i_a.i_frc; - type = FTYPE_SNG; - if (instr.i_any.i_opcd & 0x4) - type = FTYPE_DBL; + /* + * All arithmetic operations work on registers, which + * are stored as doubles. + */ + type = FTYPE_DBL; switch ((unsigned int)instr.i_a.i_xo) { case OPC59_FDIVS: FPU_EMU_EVCNT_INCR(fdiv); @@ -725,6 +727,13 @@ fpu_execute(struct trapframe *tf, struct return (NOTFPU); break; } + + /* If the instruction was single precision, round */ + if (!(instr.i_any.i_opcd & 0x4)) { + fpu_implode(fe, fp, FTYPE_SNG, + (u_int *)&fs->fpreg[rt]); + fpu_explode(fe, fp = &fe->fe_f1, FTYPE_SNG, rt); + } } } else { return (NOTFPU); Modified: head/sys/powerpc/fpu/fpu_explode.c ============================================================================== --- head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 03:11:36 2013 (r258249) +++ head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 05:03:15 2013 (r258250) @@ -235,6 +235,7 @@ fpu_explode(struct fpemu *fe, struct fpn s = fpu_dtof(fp, s, space[1]); break; + default: panic("fpu_explode"); panic("fpu_explode: invalid type %d", type); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 05:38: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82766CF9; Sun, 17 Nov 2013 05:38:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6439529BF; Sun, 17 Nov 2013 05:38:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH5ct73044172; Sun, 17 Nov 2013 05:38:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH5ctxZ044171; Sun, 17 Nov 2013 05:38:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311170538.rAH5ctxZ044171@svn.freebsd.org> From: Alexander Motin Date: Sun, 17 Nov 2013 05:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258251 - head/sys/geom/multipath 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 05:38:55 -0000 Author: mav Date: Sun Nov 17 05:38:54 2013 New Revision: 258251 URL: http://svnweb.freebsd.org/changeset/base/258251 Log: In addition to r258220 allow shrinking in "automatic" mode if there is already valid metadata found at the new location. This should allow easy transparent recovery if first resize was done by mistake. While there, unify metadata write code and fix minor memory leak. MFC after: 1 month Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sun Nov 17 05:03:15 2013 (r258250) +++ head/sys/geom/multipath/g_multipath.c Sun Nov 17 05:38:54 2013 (r258251) @@ -67,6 +67,11 @@ static enum { static struct bio_queue_head gmtbq; static struct mtx gmtbq_mtx; +static int g_multipath_read_metadata(struct g_consumer *cp, + struct g_multipath_metadata *md); +static int g_multipath_write_metadata(struct g_consumer *cp, + struct g_multipath_metadata *md); + static void g_multipath_orphan(struct g_consumer *); static void g_multipath_resize(struct g_consumer *); static void g_multipath_start(struct bio *); @@ -243,11 +248,11 @@ g_multipath_resize(struct g_consumer *cp { struct g_multipath_softc *sc; struct g_geom *gp; + struct g_consumer *cp1; struct g_provider *pp; struct g_multipath_metadata md; off_t size, psize, ssize; int error; - void *buf; g_topology_assert(); @@ -264,8 +269,8 @@ g_multipath_resize(struct g_consumer *cp } else { size = ssize = OFF_MAX; mtx_lock(&sc->sc_mtx); - LIST_FOREACH(cp, &gp->consumer, consumer) { - pp = cp->provider; + LIST_FOREACH(cp1, &gp->consumer, consumer) { + pp = cp1->provider; if (pp == NULL) continue; if (pp->mediasize < size) { @@ -280,36 +285,31 @@ g_multipath_resize(struct g_consumer *cp psize = size - ((sc->sc_uuid[0] != 0) ? ssize : 0); printf("GEOM_MULTIPATH: %s size changed from %jd to %jd\n", sc->sc_name, sc->sc_pp->mediasize, psize); - if (sc->sc_uuid[0] != 0 && psize < sc->sc_pp->mediasize) { - g_multipath_destroy(gp); - return; + if (sc->sc_uuid[0] != 0 && size < sc->sc_size) { + error = g_multipath_read_metadata(cp, &md); + if (error || + (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) || + (memcmp(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)) != 0) || + (strcmp(md.md_name, sc->sc_name) != 0) || + (md.md_size != 0 && md.md_size != size) || + (md.md_sectorsize != 0 && md.md_sectorsize != ssize)) { + g_multipath_destroy(gp); + return; + } } sc->sc_size = size; g_resize_provider(sc->sc_pp, psize); - if (sc->sc_uuid[0] != 0 && sc->sc_active != NULL) { - cp = sc->sc_active; + if (sc->sc_uuid[0] != 0) { pp = cp->provider; - error = g_access(cp, 1, 1, 1); - if (error != 0) { - printf("GEOM_MULTIPATH: Can't open %s (%d)\n", - pp->name, error); - return; - } - g_topology_unlock(); - buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name)); md.md_version = G_MULTIPATH_VERSION; md.md_size = size; - md.md_sectorsize = pp->sectorsize; + md.md_sectorsize = ssize; md.md_active_active = sc->sc_active_active; - multipath_metadata_encode(&md, buf); - error = g_write_data(cp, pp->mediasize - pp->sectorsize, - buf, pp->sectorsize); - g_topology_lock(); - g_access(cp, -1, -1, -1); + error = g_multipath_write_metadata(cp, &md); if (error != 0) printf("GEOM_MULTIPATH: Can't update metadata on %s " "(%d)\n", pp->name, error); @@ -747,6 +747,30 @@ g_multipath_read_metadata(struct g_consu return (0); } +static int +g_multipath_write_metadata(struct g_consumer *cp, + struct g_multipath_metadata *md) +{ + struct g_provider *pp; + u_char *buf; + int error; + + g_topology_assert(); + error = g_access(cp, 1, 1, 1); + if (error != 0) + return (error); + pp = cp->provider; + g_topology_unlock(); + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + multipath_metadata_encode(md, buf); + error = g_write_data(cp, pp->mediasize - pp->sectorsize, + buf, pp->sectorsize); + g_topology_lock(); + g_access(cp, -1, -1, -1); + g_free(buf); + return (error); +} + static struct g_geom * g_multipath_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { @@ -1109,7 +1133,6 @@ g_multipath_ctl_configure(struct gctl_re struct g_multipath_metadata md; const char *name; int error, *val; - void *buf; g_topology_assert(); @@ -1136,13 +1159,6 @@ g_multipath_ctl_configure(struct gctl_re if (sc->sc_uuid[0] != 0 && sc->sc_active != NULL) { cp = sc->sc_active; pp = cp->provider; - error = g_access(cp, 1, 1, 1); - if (error != 0) { - gctl_error(req, "Can't open %s (%d)", pp->name, error); - return; - } - g_topology_unlock(); - buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid)); strlcpy(md.md_name, name, sizeof(md.md_name)); @@ -1150,11 +1166,7 @@ g_multipath_ctl_configure(struct gctl_re md.md_size = pp->mediasize; md.md_sectorsize = pp->sectorsize; md.md_active_active = sc->sc_active_active; - multipath_metadata_encode(&md, buf); - error = g_write_data(cp, pp->mediasize - pp->sectorsize, - buf, pp->sectorsize); - g_topology_lock(); - g_access(cp, -1, -1, -1); + error = g_multipath_write_metadata(cp, &md); if (error != 0) gctl_error(req, "Can't update metadata on %s (%d)", pp->name, error); From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 06:50:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C442C5CF; Sun, 17 Nov 2013 06:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B486B2C2E; Sun, 17 Nov 2013 06:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAH6ofsF069624; Sun, 17 Nov 2013 06:50:41 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAH6offi069623; Sun, 17 Nov 2013 06:50:41 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311170650.rAH6offi069623@svn.freebsd.org> From: Peter Wemm Date: Sun, 17 Nov 2013 06:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258254 - head/share/i18n/esdb/UTF 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 06:50:41 -0000 Author: peter Date: Sun Nov 17 06:50:41 2013 New Revision: 258254 URL: http://svnweb.freebsd.org/changeset/base/258254 Log: Alias WCHAR_T to UCS-4-INTERNAL. WCHAR_T is the internal encoding of a wchar_t type - which is 32 bit on FreeBSD. This matches observed behavior on a libiconv machine. Modified: head/share/i18n/esdb/UTF/UTF.alias Modified: head/share/i18n/esdb/UTF/UTF.alias ============================================================================== --- head/share/i18n/esdb/UTF/UTF.alias Sun Nov 17 06:33:08 2013 (r258253) +++ head/share/i18n/esdb/UTF/UTF.alias Sun Nov 17 06:50:41 2013 (r258254) @@ -28,6 +28,7 @@ 16LE utf16le 32-INTERNAL ucs-4-internal +32-INTERNAL wchar_t 32-SWAPPED ucs-4-swapped From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 14:07: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73786529; Sun, 17 Nov 2013 14:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48DAF2FB6; Sun, 17 Nov 2013 14:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHE711N014819; Sun, 17 Nov 2013 14:07:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHE71XZ014817; Sun, 17 Nov 2013 14:07:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311171407.rAHE71XZ014817@svn.freebsd.org> From: Alexander Motin Date: Sun, 17 Nov 2013 14:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258256 - head/tools/tools/umastat 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 14:07:01 -0000 Author: mav Date: Sun Nov 17 14:07:00 2013 New Revision: 258256 URL: http://svnweb.freebsd.org/changeset/base/258256 Log: Fix umastat build on present kernel. Modified: head/tools/tools/umastat/umastat.c Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Sun Nov 17 10:16:56 2013 (r258255) +++ head/tools/tools/umastat/umastat.c Sun Nov 17 14:07:00 2013 (r258256) @@ -117,7 +117,6 @@ static const struct flaginfo { u_int32_t fi_flag; const char *fi_name; } flaginfo[] = { - { UMA_ZFLAG_PRIVALLOC, "privalloc" }, { UMA_ZFLAG_INTERNAL, "internal" }, { UMA_ZFLAG_FULL, "full" }, { UMA_ZFLAG_CACHEONLY, "cacheonly" }, @@ -364,14 +363,15 @@ main(int argc, char *argv[]) } printf("Keg {\n"); - printf(" uk_recurse = %d\n", kz.uk_recurse); uma_print_keg_align(&kz, " "); printf(" uk_pages = %d\n", kz.uk_pages); printf(" uk_free = %d\n", kz.uk_free); + printf(" uk_reserve = %d\n", kz.uk_reserve); printf(" uk_size = %d\n", kz.uk_size); printf(" uk_rsize = %d\n", kz.uk_rsize); printf(" uk_maxpages = %d\n", kz.uk_maxpages); + printf(" uk_slabsize = %d\n", kz.uk_slabsize); printf(" uk_pgoff = %d\n", kz.uk_pgoff); printf(" uk_ppera = %d\n", kz.uk_ppera); printf(" uk_ipers = %d\n", kz.uk_ipers); @@ -414,21 +414,18 @@ main(int argc, char *argv[]) } printf(" Zone {\n"); printf(" uz_name = \"%s\";\n", name); - printf(" uz_allocs = %ju;\n", + printf(" uz_allocs = %lu;\n", uzp_userspace->uz_allocs); - printf(" uz_frees = %ju;\n", + printf(" uz_frees = %lu;\n", uzp_userspace->uz_frees); - printf(" uz_fails = %ju;\n", + printf(" uz_fails = %lu;\n", uzp_userspace->uz_fails); - printf(" uz_fills = %u;\n", - uzp_userspace->uz_fills); + printf(" uz_sleeps = %ju;\n", + uzp_userspace->uz_sleeps); printf(" uz_count = %u;\n", uzp_userspace->uz_count); uma_print_bucketlist(kvm, (void *) - &uzp_userspace->uz_full_bucket, "uz_full_bucket", - " "); - uma_print_bucketlist(kvm, (void *) - &uzp_userspace->uz_free_bucket, "uz_free_bucket", + &uzp_userspace->uz_buckets, "uz_buckets", " "); if (!(kz.uk_flags & UMA_ZFLAG_INTERNAL)) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 14:44: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8085DBF4; Sun, 17 Nov 2013 14:44:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61533214B; Sun, 17 Nov 2013 14:44:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHEiOfU027914; Sun, 17 Nov 2013 14:44:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHEiN6B027907; Sun, 17 Nov 2013 14:44:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171444.rAHEiN6B027907@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 14:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258257 - in head/sys: conf powerpc/booke powerpc/include powerpc/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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 14:44:24 -0000 Author: nwhitehorn Date: Sun Nov 17 14:44:22 2013 New Revision: 258257 URL: http://svnweb.freebsd.org/changeset/base/258257 Log: Split the function of the PCB_FPU flags into two: PCB_FPU now indicates that the actual FPU is enabled, while PCB_FPREGS indicates that the FPU state structure in the PCB is valid. This separation reflects the situation on FPU-less systems in which the FP state is used by the emulator but we don't actually want to try to turn on the non-existant FPU. Use this flag to save and restore FP regs properly on both AIM and Book-E. As a side effect, this sets up hard-FP and Altivec on Book-E CPUs with such abilities except for a trap handler to call enable_fpu()/enable_altivec(). Modified: head/sys/conf/files.powerpc head/sys/powerpc/booke/trap.c head/sys/powerpc/include/pcb.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/fpu.c head/sys/powerpc/powerpc/swtch32.S Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/conf/files.powerpc Sun Nov 17 14:44:22 2013 (r258257) @@ -165,7 +165,7 @@ powerpc/powermac/uninorth.c optional pow powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac powerpc/powermac/windtunnel.c optional powermac windtunnel -powerpc/powerpc/altivec.c optional aim +powerpc/powerpc/altivec.c standard powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard @@ -182,7 +182,7 @@ powerpc/powerpc/dump_machdep.c standard powerpc/powerpc/elf32_machdep.c optional powerpc | compat_freebsd32 powerpc/powerpc/elf64_machdep.c optional powerpc64 powerpc/powerpc/exec_machdep.c standard -powerpc/powerpc/fpu.c optional aim +powerpc/powerpc/fpu.c standard powerpc/powerpc/fuswintr.c standard powerpc/powerpc/gdb_machdep.c optional gdb powerpc/powerpc/in_cksum.c optional inet | inet6 Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/powerpc/booke/trap.c Sun Nov 17 14:44:22 2013 (r258257) @@ -194,6 +194,11 @@ trap(struct trapframe *frame) case EXC_PGM: /* Program exception */ #ifdef FPU_EMU + if (!(td->td_pcb->pcb_flags & PCB_FPREGS)) { + bzero(&td->td_pcb->pcb_fpu, + sizeof(td->td_pcb->pcb_fpu)); + td->td_pcb->pcb_flags |= PCB_FPREGS; + } sig = fpu_emulate(frame, (struct fpreg *)&td->td_pcb->pcb_fpu); #else Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/powerpc/include/pcb.h Sun Nov 17 14:44:22 2013 (r258257) @@ -47,8 +47,9 @@ struct pcb { faultbuf *pcb_onfault; /* For use during copyin/copyout */ int pcb_flags; -#define PCB_FPU 1 /* Process had FPU initialized */ -#define PCB_VEC 2 /* Process had Altivec initialized */ +#define PCB_FPU 1 /* Process uses FPU */ +#define PCB_FPREGS 2 /* Process had FPU registers initialized */ +#define PCB_VEC 4 /* Process had Altivec initialized */ struct fpu { double fpr[32]; double fpscr; /* FPSCR stored as double for easier access */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/powerpc/powerpc/exec_machdep.c Sun Nov 17 14:44:22 2013 (r258257) @@ -381,19 +381,20 @@ grab_mcontext(struct thread *td, mcontex mcp->mc_gpr[4] = 0; } -#ifdef AIM /* * This assumes that floating-point context is *not* lazy, * so if the thread has used FP there would have been a * FP-unavailable exception that would have set things up * correctly. */ - if (pcb->pcb_flags & PCB_FPU) { - KASSERT(td == curthread, - ("get_mcontext: fp save not curthread")); - critical_enter(); - save_fpu(td); - critical_exit(); + if (pcb->pcb_flags & PCB_FPREGS) { + if (pcb->pcb_flags & PCB_FPU) { + KASSERT(td == curthread, + ("get_mcontext: fp save not curthread")); + critical_enter(); + save_fpu(td); + critical_exit(); + } mcp->mc_flags |= _MC_FP_VALID; memcpy(&mcp->mc_fpscr, &pcb->pcb_fpu.fpscr, sizeof(double)); memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); @@ -414,7 +415,6 @@ grab_mcontext(struct thread *td, mcontex mcp->mc_vrsave = pcb->pcb_vec.vrsave; memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); } -#endif mcp->mc_len = sizeof(*mcp); @@ -467,13 +467,9 @@ set_mcontext(struct thread *td, const mc else tf->fixreg[2] = tls; -#ifdef AIM if (mcp->mc_flags & _MC_FP_VALID) { - if ((pcb->pcb_flags & PCB_FPU) != PCB_FPU) { - critical_enter(); - enable_fpu(td); - critical_exit(); - } + /* enable_fpu() will happen lazily on a fault */ + pcb->pcb_flags |= PCB_FPREGS; memcpy(&pcb->pcb_fpu.fpscr, &mcp->mc_fpscr, sizeof(double)); memcpy(pcb->pcb_fpu.fpr, mcp->mc_fpreg, 32*sizeof(double)); } @@ -488,7 +484,6 @@ set_mcontext(struct thread *td, const mc pcb->pcb_vec.vrsave = mcp->mc_vrsave; memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); } -#endif return (0); } @@ -625,7 +620,7 @@ fill_fpregs(struct thread *td, struct fp pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPU) == 0) + if ((pcb->pcb_flags & PCB_FPREGS) == 0) memset(fpregs, 0, sizeof(struct fpreg)); else memcpy(fpregs, &pcb->pcb_fpu, sizeof(struct fpreg)); @@ -654,14 +649,11 @@ set_dbregs(struct thread *td, struct dbr int set_fpregs(struct thread *td, struct fpreg *fpregs) { -#ifdef AIM struct pcb *pcb; pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPU) == 0) - enable_fpu(td); + pcb->pcb_flags |= PCB_FPREGS; memcpy(&pcb->pcb_fpu, fpregs, sizeof(struct fpreg)); -#endif return (0); } @@ -1021,14 +1013,10 @@ cpu_set_upcall_kse(struct thread *td, vo tf->fixreg[3] = (register_t)arg; if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { tf->srr0 = (register_t)entry; - #ifdef AIM tf->srr1 = PSL_USERSET | PSL_FE_DFLT; #ifdef __powerpc64__ tf->srr1 &= ~PSL_SF; #endif - #else - tf->srr1 = PSL_USERSET; - #endif } else { #ifdef __powerpc64__ register_t entry_desc[3]; Modified: head/sys/powerpc/powerpc/fpu.c ============================================================================== --- head/sys/powerpc/powerpc/fpu.c Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/powerpc/powerpc/fpu.c Sun Nov 17 14:44:22 2013 (r258257) @@ -66,10 +66,11 @@ enable_fpu(struct thread *td) * initialise the FPU registers and FPSCR to 0, and set the flag * to indicate that the FPU is in use. */ + pcb->pcb_flags |= PCB_FPU; tf->srr1 |= PSL_FP; - if (!(pcb->pcb_flags & PCB_FPU)) { + if (!(pcb->pcb_flags & PCB_FPREGS)) { memset(&pcb->pcb_fpu, 0, sizeof pcb->pcb_fpu); - pcb->pcb_flags |= PCB_FPU; + pcb->pcb_flags |= PCB_FPREGS; } /* Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Sun Nov 17 14:07:00 2013 (r258256) +++ head/sys/powerpc/powerpc/swtch32.S Sun Nov 17 14:44:22 2013 (r258257) @@ -100,7 +100,6 @@ ENTRY(cpu_switch) mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ -#ifdef AIM lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ andi. %r7, %r7, PCB_FPU @@ -116,7 +115,6 @@ ENTRY(cpu_switch) bl save_vec .L2: -#endif mr %r3,%r14 /* restore old thread ptr */ bl pmap_deactivate /* Deactivate the current pmap */ @@ -143,7 +141,6 @@ blocked_loop: mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ -#ifdef AIM lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU @@ -160,7 +157,6 @@ blocked_loop: bl enable_vec .L4: -#endif /* thread to restore is in r3 */ mr %r3,%r17 /* Recover PCB ptr */ lmw %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 15:09:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB0A29E; Sun, 17 Nov 2013 15:09:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB55223F; Sun, 17 Nov 2013 15:09:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHF9els035722; Sun, 17 Nov 2013 15:09:40 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHF9eot035721; Sun, 17 Nov 2013 15:09:40 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201311171509.rAHF9eot035721@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 17 Nov 2013 15:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258258 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 15:09:40 -0000 Author: trociny Date: Sun Nov 17 15:09:39 2013 New Revision: 258258 URL: http://svnweb.freebsd.org/changeset/base/258258 Log: Deregister helper hooks on vnet destroy. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Nov 17 14:44:22 2013 (r258257) +++ head/sys/netinet/tcp_subr.c Sun Nov 17 15:09:39 2013 (r258258) @@ -432,6 +432,7 @@ tcp_init(void) void tcp_destroy(void) { + int error; tcp_reass_destroy(); tcp_hc_destroy(); @@ -440,6 +441,19 @@ tcp_destroy(void) in_pcbinfo_destroy(&V_tcbinfo); uma_zdestroy(V_sack_hole_zone); uma_zdestroy(V_tcpcb_zone); + + error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); + if (error != 0) { + printf("%s: WARNING: unable to deregister helper hook " + "type=%d, id=%d: error %d returned\n", __func__, + HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, error); + } + error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_OUT]); + if (error != 0) { + printf("%s: WARNING: unable to deregister helper hook " + "type=%d, id=%d: error %d returned\n", __func__, + HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, error); + } } #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 15:12:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E2603F9; Sun, 17 Nov 2013 15:12:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E917227E; Sun, 17 Nov 2013 15:12:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHFC4cD038191; Sun, 17 Nov 2013 15:12:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHFC4XJ038187; Sun, 17 Nov 2013 15:12:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171512.rAHFC4XJ038187@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 15:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258259 - in head/sys/powerpc: aim booke include 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 15:12:05 -0000 Author: nwhitehorn Date: Sun Nov 17 15:12:03 2013 New Revision: 258259 URL: http://svnweb.freebsd.org/changeset/base/258259 Log: Unify handling of illegal instruction faults between AIM and Book-E. This allows FPU emulation on AIM as well as providing support for the mfpvr and lwsync instructions from userland on e500 cores. lwsync, in particular, is required for many C++ programs to work correctly. MFC after: 1 week Modified: head/sys/powerpc/aim/trap.c head/sys/powerpc/booke/trap.c head/sys/powerpc/include/trap.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sun Nov 17 15:09:39 2013 (r258258) +++ head/sys/powerpc/aim/trap.c Sun Nov 17 15:12:03 2013 (r258259) @@ -80,7 +80,6 @@ static void printtrap(u_int vector, stru int user); static int trap_pfault(struct trapframe *frame, int user); static int fix_unaligned(struct thread *td, struct trapframe *frame); -static int ppc_instr_emulate(struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -292,10 +291,9 @@ trap(struct trapframe *frame) } #endif sig = SIGTRAP; - } else if (ppc_instr_emulate(frame) == 0) - frame->srr0 += 4; - else - sig = SIGILL; + } else { + sig = ppc_instr_emulate(frame, td->td_pcb); + } break; default: @@ -800,20 +798,3 @@ fix_unaligned(struct thread *td, struct return -1; } -static int -ppc_instr_emulate(struct trapframe *frame) -{ - uint32_t instr; - int reg; - - instr = fuword32((void *)frame->srr0); - - if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ - reg = (instr & ~0xfc1fffff) >> 21; - frame->fixreg[reg] = mfpvr(); - return (0); - } - - return (-1); -} - Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Sun Nov 17 15:09:39 2013 (r258258) +++ head/sys/powerpc/booke/trap.c Sun Nov 17 15:12:03 2013 (r258259) @@ -71,10 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FPU_EMU -#include -#endif - #define FAULTBUF_LR 0 #define FAULTBUF_R1 1 #define FAULTBUF_R2 2 @@ -193,18 +189,7 @@ trap(struct trapframe *frame) break; case EXC_PGM: /* Program exception */ -#ifdef FPU_EMU - if (!(td->td_pcb->pcb_flags & PCB_FPREGS)) { - bzero(&td->td_pcb->pcb_fpu, - sizeof(td->td_pcb->pcb_fpu)); - td->td_pcb->pcb_flags |= PCB_FPREGS; - } - sig = fpu_emulate(frame, - (struct fpreg *)&td->td_pcb->pcb_fpu); -#else - /* XXX SIGILL for non-trap instructions. */ - sig = SIGTRAP; -#endif + sig = ppc_instr_emulate(frame, td->td_pcb); break; default: Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sun Nov 17 15:09:39 2013 (r258258) +++ head/sys/powerpc/include/trap.h Sun Nov 17 15:12:03 2013 (r258259) @@ -122,7 +122,9 @@ #ifndef LOCORE struct trapframe; +struct pcb; void trap(struct trapframe *); +int ppc_instr_emulate(struct trapframe *, struct pcb *); #endif #endif /* _POWERPC_TRAP_H_ */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sun Nov 17 15:09:39 2013 (r258258) +++ head/sys/powerpc/powerpc/exec_machdep.c Sun Nov 17 15:12:03 2013 (r258259) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_fpu_emu.h" #include #include @@ -92,6 +93,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FPU_EMU +#include +#endif + #ifdef COMPAT_FREEBSD32 #include #include @@ -1038,3 +1043,36 @@ cpu_set_upcall_kse(struct thread *td, vo td->td_retval[1] = 0; } +int +ppc_instr_emulate(struct trapframe *frame, struct pcb *pcb) +{ + uint32_t instr; + int reg, sig; + + instr = fuword32((void *)frame->srr0); + sig = SIGILL; + + if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ + reg = (instr & ~0xfc1fffff) >> 21; + frame->fixreg[reg] = mfpvr(); + frame->srr0 += 4; + return (0); + } + + if ((instr & 0xfc000ffe) == 0x7c0004ac) { /* various sync */ + powerpc_sync(); /* Do a heavy-weight sync */ + frame->srr0 += 4; + return (0); + } + +#ifdef FPU_EMU + if (!(pcb->pcb_flags & PCB_FPREGS)) { + bzero(&pcb->pcb_fpu, sizeof(pcb->pcb_fpu)); + pcb->pcb_flags |= PCB_FPREGS; + } + sig = fpu_emulate(frame, (struct fpreg *)&pcb->pcb_fpu); +#endif + + return (sig); +} + From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 15:14:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E2DE552; Sun, 17 Nov 2013 15:14:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E3492292; Sun, 17 Nov 2013 15:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHFE74R038443; Sun, 17 Nov 2013 15:14:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHFE7KD038442; Sun, 17 Nov 2013 15:14:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311171514.rAHFE7KD038442@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 17 Nov 2013 15:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258260 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 15:14:07 -0000 Author: glebius Date: Sun Nov 17 15:14:07 2013 New Revision: 258260 URL: http://svnweb.freebsd.org/changeset/base/258260 Log: In r257692 I intentionally deleted code that handled P2P interfaces with equal addresses on both sides. It appeared that OpenVPN uses such configutations. Submitted by: trociny Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Nov 17 15:12:03 2013 (r258259) +++ head/sys/netinet/in.c Sun Nov 17 15:14:07 2013 (r258260) @@ -449,7 +449,9 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat * Add a loopback route to self. */ if (vhid == 0 && (ifp->if_flags & IFF_LOOPBACK) == 0 && - ia->ia_addr.sin_addr.s_addr != INADDR_ANY) { + ia->ia_addr.sin_addr.s_addr != INADDR_ANY && + !((ifp->if_flags & IFF_POINTOPOINT) && + ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr)) { struct in_ifaddr *eia; eia = in_localip_more(ia); From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 15:58: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FCFF60C; Sun, 17 Nov 2013 15:58:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F37324B2; Sun, 17 Nov 2013 15:58:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHFwEVw053802; Sun, 17 Nov 2013 15:58:14 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHFwE3c053801; Sun, 17 Nov 2013 15:58:14 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311171558.rAHFwE3c053801@svn.freebsd.org> From: Glen Barber Date: Sun, 17 Nov 2013 15:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258261 - stable/10/release X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 15:58:14 -0000 Author: gjb Date: Sun Nov 17 15:58:13 2013 New Revision: 258261 URL: http://svnweb.freebsd.org/changeset/base/258261 Log: MFC r258101: Since the doc/ toolchain conversion to docbook 5.0, JADETEX is no longer a valid option, so remove 'WITHOUT_JADETEX=yes' from PBUILD_FLAGS. While here, also remove 'WITHOUT_X11=yes', since it will cause a dependency conflict by requiring both print/ghostscript9 and print/ghostscript9-nox11. Switch to OPTIONSNG format (WITHOUT_* -> OPTIONS_UNSET='FOO'), and unset the FOP option, which requires Java (although it is disabled by default). Also unset the 'IGOR' option, since textproc/igor is a validation tool, not necessarily a dependency of the doc/ build itself. While here, reduce the line length of PBUILD_FLAGS. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/release.sh Directory Properties: stable/10/release/ (props changed) Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Sun Nov 17 15:14:07 2013 (r258260) +++ stable/10/release/release.sh Sun Nov 17 15:58:13 2013 (r258261) @@ -174,7 +174,8 @@ build_doc_ports() { ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes WITHOUT_X11=yes BATCH=yes" + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} OPTIONS_UNSET='FOP IGOR'" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ ${PBUILD_FLAGS} install clean distclean fi From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 16:07:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15601AEF; Sun, 17 Nov 2013 16:07:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DEDB72536; Sun, 17 Nov 2013 16:07:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHG7r1S057356; Sun, 17 Nov 2013 16:07:53 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHG7rY7057352; Sun, 17 Nov 2013 16:07:53 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201311171607.rAHG7rY7057352@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 17 Nov 2013 16:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258262 - head/sys/dev/drm2 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 16:07:54 -0000 Author: dumbbell Date: Sun Nov 17 16:07:52 2013 New Revision: 258262 URL: http://svnweb.freebsd.org/changeset/base/258262 Log: drm: Support DRM_CAP_TIMESTAMP_MONOTONIC capability This fixes DPMS with KDE and radeonkms. Without this, the display would freeze when the monitor is put into sleep state, and only resumes after several dozens of minutes once the monitor is powered on again. Tested by: Mathias Picker Modified: head/sys/dev/drm2/drm.h head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_drv.c head/sys/dev/drm2/drm_ioctl.c Modified: head/sys/dev/drm2/drm.h ============================================================================== --- head/sys/dev/drm2/drm.h Sun Nov 17 15:58:13 2013 (r258261) +++ head/sys/dev/drm2/drm.h Sun Nov 17 16:07:52 2013 (r258262) @@ -1015,6 +1015,8 @@ struct drm_event_vblank { #define DRM_CAP_VBLANK_HIGH_CRTC 0x2 #define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 #define DRM_CAP_DUMB_PREFER_SHADOW 0x4 +#define DRM_CAP_PRIME 0x5 +#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 #include "drm_mode.h" Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Sun Nov 17 15:58:13 2013 (r258261) +++ head/sys/dev/drm2/drmP.h Sun Nov 17 16:07:52 2013 (r258262) @@ -1067,6 +1067,7 @@ extern int drm_debug_flag; extern int drm_notyet_flag; extern unsigned int drm_vblank_offdelay; extern unsigned int drm_timestamp_precision; +extern unsigned int drm_timestamp_monotonic; /* Device setup support (drm_drv.c) */ int drm_probe(device_t kdev, drm_pci_id_list_t *idlist); Modified: head/sys/dev/drm2/drm_drv.c ============================================================================== --- head/sys/dev/drm2/drm_drv.c Sun Nov 17 15:58:13 2013 (r258261) +++ head/sys/dev/drm2/drm_drv.c Sun Nov 17 16:07:52 2013 (r258262) @@ -56,6 +56,12 @@ int drm_notyet_flag = 0; unsigned int drm_vblank_offdelay = 5000; /* Default to 5000 msecs. */ unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ +/* + * Default to use monotonic timestamps for wait-for-vblank and page-flip + * complete events. + */ +unsigned int drm_timestamp_monotonic = 1; + static int drm_load(struct drm_device *dev); static void drm_unload(struct drm_device *dev); static drm_pci_id_list_t *drm_find_description(int vendor, int device, Modified: head/sys/dev/drm2/drm_ioctl.c ============================================================================== --- head/sys/dev/drm2/drm_ioctl.c Sun Nov 17 15:58:13 2013 (r258261) +++ head/sys/dev/drm2/drm_ioctl.c Sun Nov 17 16:07:52 2013 (r258262) @@ -250,6 +250,9 @@ int drm_getcap(struct drm_device *dev, v case DRM_CAP_DUMB_PREFER_SHADOW: req->value = dev->mode_config.prefer_shadow; break; + case DRM_CAP_TIMESTAMP_MONOTONIC: + req->value = drm_timestamp_monotonic; + break; default: return EINVAL; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:31:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E505DFB7; Sun, 17 Nov 2013 17:31:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6268295B; Sun, 17 Nov 2013 17:31:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHV7gI088408; Sun, 17 Nov 2013 17:31:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHV7rZ088407; Sun, 17 Nov 2013 17:31:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171731.rAHHV7rZ088407@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258263 - head/usr.sbin/bsdconfig/share/packages 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:31:08 -0000 Author: dteske Date: Sun Nov 17 17:31:07 2013 New Revision: 258263 URL: http://svnweb.freebsd.org/changeset/base/258263 Log: Move function name declaration to top of function (where it is closest to the value it needs to be), s/fname/funcname/g, and move function name usage to within printf format string. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 16:07:52 2013 (r258262) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:31:07 2013 (r258263) @@ -571,12 +571,12 @@ f_package_menu_deselect() # f_package_review() { + local funcname=f_package_review local prompt # Calculated below local menu_list # Calculated below local hline="$hline_alnum_arrows_punc_tab_enter" - local fname=f_package_review - f_dprintf "%s: SELECTED_PACKAGES=[%s]" $fname "$SELECTED_PACKAGES" + f_dprintf "$funcname: SELECTED_PACKAGES=[%s]" "$SELECTED_PACKAGES" prompt=$( printf "$msg_reviewing_selected_packages" "$_All_nselected" ) @@ -628,7 +628,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue - f_dprintf "%s: Installing %s package" $fname "$package" + f_dprintf "$funcname: Installing %s package" "$package" f_package_add "$package" done for package in $SELECTED_PACKAGES; do @@ -636,7 +636,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "R" ] || continue - f_dprintf "%s: Reinstalling %s package" $fname "$package" + f_dprintf "$funcname: Reinstalling %s package" "$package" f_package_reinstall "$package" done for package in $SELECTED_PACKAGES; do @@ -644,7 +644,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "U" ] || continue - f_dprintf "%s: Uninstalling %s package" $fname "$package" + f_dprintf "$funcname: Uninstalling %s package" "$package" f_package_delete "$package" || continue f_package_deselect "$package" done @@ -943,11 +943,11 @@ f_package_add() # f_package_extract() { + local funcname=f_package_extract local device="$1" name="$2" depended="$3" - local fname=f_package_extract - f_dprintf "%s: device=[%s] name=[%s] depended=[%s]" \ - $fname "$device" "$name" "$depended" + f_dprintf "$funcname: device=[%s] name=[%s] depended=[%s]" \ + "$device" "$name" "$depended" # Check to make sure it's not already there local varpkg mark= @@ -982,8 +982,8 @@ f_package_extract() for pkg_ext in "" $PACKAGE_EXTENSIONS; do if f_device_get $device "$path$pkg_ext" $PROBE_EXIST; then path="$path$pkg_ext" - f_dprintf "%s: found path=[%s] dev=[%s]" \ - $fname "$path" "$device" + f_dprintf "$funcname: found path=[%s] dev=[%s]" \ + "$path" "$device" found=1 break fi @@ -994,8 +994,8 @@ f_package_extract() [ "$no_confirm" ] && alert=f_show_info if [ ! "$found" ]; then - f_dprintf "%s: No such %s file on %s device" \ - $fname "$path" "$device" + f_dprintf "$funcname: No such %s file on %s device" \ + "$path" "$device" $alert "$msg_unable_to_fetch_package_from_selected_media" \ "$name" [ "$no_confirm" ] && sleep 2 @@ -1035,8 +1035,8 @@ f_package_extract() # f_package_delete() { + local funcname=f_package_delete local name="$1" - local fname=f_package_delete if ! { [ "$name" ] || { f_getvar $VAR_PACKAGE name && [ "$name" ]; }; } then @@ -1045,7 +1045,7 @@ f_package_delete() return $FAILURE fi - f_dprintf "%s: name=[%s]" $fname "$name" + f_dprintf "$funcname: name=[%s]" "$name" [ "$name" ] || return $FAILURE @@ -1082,7 +1082,7 @@ f_package_delete() # detected the installed packages -- something we should do only once. # if [ ! "$PACKAGES_DETECTED" ]; then - f_dprintf "%s: Detecting installed packages" $fname + f_dprintf "$funcname: Detecting installed packages" f_package_detect_installed export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] fi @@ -1134,8 +1134,8 @@ f_package_delete() # Chase dependencies that are marked for uninstallation # for pkgsel in $udeps; do - f_dprintf "%s: Uninstalling dependency %s (%s)" \ - $fname "$pkgsel" "marked for delete" + f_dprintf "$funcname: Uninstalling dependency %s (%s)" \ + "$pkgsel" "marked for delete" f_package_delete "$pkgsel" done @@ -1152,7 +1152,7 @@ f_package_delete() f_show_msg "$msg_pkg_delete_failed" "$name" return $FAILURE else - f_dprintf "%s: pkg-delete(8) of %s successful" $fname "$name" + f_dprintf "$funcname: pkg-delete(8) of %s successful" "$name" f_str2varname "$name" varpkg setvar _mark_$varpkg "" fi From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:35:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71395285; Sun, 17 Nov 2013 17:35:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60D292974; Sun, 17 Nov 2013 17:35:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHZq7c090293; Sun, 17 Nov 2013 17:35:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHZqt0090292; Sun, 17 Nov 2013 17:35:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171735.rAHHZqt0090292@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258264 - head/usr.sbin/bsdconfig/share/packages 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:35:52 -0000 Author: dteske Date: Sun Nov 17 17:35:51 2013 New Revision: 258264 URL: http://svnweb.freebsd.org/changeset/base/258264 Log: Kick an unused orphan to the curb ;) Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:31:07 2013 (r258263) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:35:51 2013 (r258264) @@ -1002,7 +1002,7 @@ f_package_extract() return $FAILURE fi - local orphan devname= + local devname= f_struct device_$device get name devname if [ "$depended" ]; then f_show_info "$msg_adding_package_as_a_dependency_from_media" \ @@ -1013,7 +1013,7 @@ f_package_extract() # Request the package be added via pkg-install(8) if f_debugging; then - pkg -d install -y $orphan "$name" + pkg -d install -y "$name" else f_quietly pkg install -y "$name" fi From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:42: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE06F60F; Sun, 17 Nov 2013 17:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3FA129D0; Sun, 17 Nov 2013 17:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHgFfO094458; Sun, 17 Nov 2013 17:42:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHgFjN094456; Sun, 17 Nov 2013 17:42:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171742.rAHHgFjN094456@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258265 - head/usr.sbin/bsdconfig/share/packages 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:42:15 -0000 Author: dteske Date: Sun Nov 17 17:42:15 2013 New Revision: 258265 URL: http://svnweb.freebsd.org/changeset/base/258265 Log: Improve debugging with f_eval_catch() introduced by SVN r257784 and also fix a bug where "pkg update" was not getting the value of PACKAGESITE. NB: PACKAGESITE needs to be explicitly exported in support of children. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:35:51 2013 (r258264) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:42:15 2013 (r258265) @@ -86,6 +86,7 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc # f_index_initialize() { + local __funcname=f_index_initialize local __var_to_set="${2:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS @@ -117,7 +118,9 @@ f_index_initialize() $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;; esac - if ! PACKAGESITE="$__site" f_quietly pkg update; then + export PACKAGESITE="$__site" + f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" + if ! f_eval_catch $__funcname pkg "pkg update"; then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown media return $FAILURE Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:35:51 2013 (r258264) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:42:15 2013 (r258265) @@ -1013,9 +1013,9 @@ f_package_extract() # Request the package be added via pkg-install(8) if f_debugging; then - pkg -d install -y "$name" + f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name" else - f_quietly pkg install -y "$name" + f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then $alert "$msg_pkg_install_apparently_did_not_like_the_package" \ @@ -1144,9 +1144,9 @@ f_package_delete() # f_show_info "$msg_uninstalling_package_waiting_for_pkg_delete" "$name" if f_debugging; then - pkg -d delete -y "$name" + f_eval_catch $funcname pkg 'pkg -d delete -y "%s"' "$name" else - f_quietly pkg delete -y "$name" + f_eval_catch $funcname pkg 'pkg delete -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then f_show_msg "$msg_pkg_delete_failed" "$name" From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:46: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28DCD780; Sun, 17 Nov 2013 17:46:08 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4835C29E6; Sun, 17 Nov 2013 17:46:07 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rAHHk0Q3048088; Sun, 17 Nov 2013 19:46:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rAHHk0Q3048088 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rAHHk0Q1048087; Sun, 17 Nov 2013 19:46:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 17 Nov 2013 19:46:00 +0200 From: Konstantin Belousov To: Jean-Sebastien Pedron Subject: Re: svn commit: r258262 - head/sys/dev/drm2 Message-ID: <20131117174600.GN59496@kib.kiev.ua> References: <201311171607.rAHG7rY7057352@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zh8cApnN4lZdodaB" Content-Disposition: inline In-Reply-To: <201311171607.rAHG7rY7057352@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:46:08 -0000 --Zh8cApnN4lZdodaB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 17, 2013 at 04:07:53PM +0000, Jean-Sebastien Pedron wrote: > Author: dumbbell > Date: Sun Nov 17 16:07:52 2013 > New Revision: 258262 > URL: http://svnweb.freebsd.org/changeset/base/258262 >=20 > Log: > drm: Support DRM_CAP_TIMESTAMP_MONOTONIC capability > =20 > This fixes DPMS with KDE and radeonkms. Without this, the display would > freeze when the monitor is put into sleep state, and only resumes after > several dozens of minutes once the monitor is powered on again. > =20 > Tested by: Mathias Picker >=20 > Modified: > head/sys/dev/drm2/drm.h > head/sys/dev/drm2/drmP.h > head/sys/dev/drm2/drm_drv.c > head/sys/dev/drm2/drm_ioctl.c >=20 > Modified: head/sys/dev/drm2/drm.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/drm2/drm.h Sun Nov 17 15:58:13 2013 (r258261) > +++ head/sys/dev/drm2/drm.h Sun Nov 17 16:07:52 2013 (r258262) > @@ -1015,6 +1015,8 @@ struct drm_event_vblank { > #define DRM_CAP_VBLANK_HIGH_CRTC 0x2 > #define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 > #define DRM_CAP_DUMB_PREFER_SHADOW 0x4 > +#define DRM_CAP_PRIME 0x5 > +#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 > =20 > #include "drm_mode.h" > =20 >=20 > Modified: head/sys/dev/drm2/drmP.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/drm2/drmP.h Sun Nov 17 15:58:13 2013 (r258261) > +++ head/sys/dev/drm2/drmP.h Sun Nov 17 16:07:52 2013 (r258262) > @@ -1067,6 +1067,7 @@ extern int drm_debug_flag; > extern int drm_notyet_flag; > extern unsigned int drm_vblank_offdelay; > extern unsigned int drm_timestamp_precision; > +extern unsigned int drm_timestamp_monotonic; > =20 > /* Device setup support (drm_drv.c) */ > int drm_probe(device_t kdev, drm_pci_id_list_t *idlist); >=20 > Modified: head/sys/dev/drm2/drm_drv.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/drm2/drm_drv.c Sun Nov 17 15:58:13 2013 (r258261) > +++ head/sys/dev/drm2/drm_drv.c Sun Nov 17 16:07:52 2013 (r258262) > @@ -56,6 +56,12 @@ int drm_notyet_flag =3D 0; > unsigned int drm_vblank_offdelay =3D 5000; /* Default to 5000 msecs. = */ > unsigned int drm_timestamp_precision =3D 20; /* Default to 20 usecs. */ > =20 > +/* > + * Default to use monotonic timestamps for wait-for-vblank and page-flip > + * complete events. > + */ > +unsigned int drm_timestamp_monotonic =3D 1; > + Why do you need a variable there, instead of simply returning true =66rom the drm_getcap ? I do not see any way to change the value of the drm_timestamp_monotonic. > static int drm_load(struct drm_device *dev); > static void drm_unload(struct drm_device *dev); > static drm_pci_id_list_t *drm_find_description(int vendor, int device, >=20 > Modified: head/sys/dev/drm2/drm_ioctl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/drm2/drm_ioctl.c Sun Nov 17 15:58:13 2013 (r258261) > +++ head/sys/dev/drm2/drm_ioctl.c Sun Nov 17 16:07:52 2013 (r258262) > @@ -250,6 +250,9 @@ int drm_getcap(struct drm_device *dev, v > case DRM_CAP_DUMB_PREFER_SHADOW: > req->value =3D dev->mode_config.prefer_shadow; > break; > + case DRM_CAP_TIMESTAMP_MONOTONIC: > + req->value =3D drm_timestamp_monotonic; > + break; > default: > return EINVAL; > } --Zh8cApnN4lZdodaB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSiQDXAAoJEJDCuSvBvK1BSGEQAIkumrRLhZaYfCV/gCoO3Tie dNPHFdNq/wNHQf5HqxIkovIviorz7gUF+mEwlulJe1mvMhPIrM1QHAgtRIo783Ia Q0Hyya1dz935Ejg/k7ENmmWaxTEsmV2OhpZD7TaqCH6zI0C2h5NcmfnLUglE01O9 IlY7zMYMvFMFfkl/aZlOOwsfquqVKYp7edB8N/N0LyLWFBIFtLNgZ1Zlt+03LAen YTt2quSMrMES1gPT7I2mg2PaOsAZ3p09yNrdJz7C5avmenEX2e3a0+CQgJ+Yvv0M xUOhzOeM/xCqM1lhYKx4kKZHHrK32FR67PqRG3hk+r0P4L3ZFTNx1uyAdnVHKSX8 mPNVliEOnzOWpT0QCou0cHTFb93KBOnTocgH7haZCauVXrnThfuZTz/gbT8Q/bkY c9ZmGXzo8acUj9Z4l9bQ6xv1M0TyWPg0Y3Mob0OkXuyllEKjKyEu0cGmToyq1aE3 zkD9eR1zGCsma9wSM0zAIFWTyXkGYn4v47A0kb/A8ApyQzoBa1qx4J8QK6Db0bb9 0agcy4qTLHlpg3Vo56KoMYbVpZxRNa6xWetRNjDWynLbLFAa2yE7hSFtSyRiykq7 5nHWTN1UO6gBbV14nx+R2j+La3dQJGYnaO4INONqL0SWssgxzbc8VYZj1sFFqH5P fbj1Et6j0DPttwKv6pBI =jV7/ -----END PGP SIGNATURE----- --Zh8cApnN4lZdodaB-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:48:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02CA591A; Sun, 17 Nov 2013 17:48:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC4832A1C; Sun, 17 Nov 2013 17:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHmtTW095982; Sun, 17 Nov 2013 17:48:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHmtvw095980; Sun, 17 Nov 2013 17:48:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171748.rAHHmtvw095980@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258266 - in head/usr.sbin/bsdconfig: packages share/media 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:48:56 -0000 Author: dteske Date: Sun Nov 17 17:48:55 2013 New Revision: 258266 URL: http://svnweb.freebsd.org/changeset/base/258266 Log: Always shutdown the media when we're exiting the packages module (prevents errors on re-entry for physical media). Also, while we're here, stop ejecting the CDROM when we're done with it (but leave the functions for later use so that we could perhaps -- from the installer standpoint -- use it to eject the media after an install). MFC after: 3 days Modified: head/usr.sbin/bsdconfig/packages/packages head/usr.sbin/bsdconfig/share/media/cdrom.subr Modified: head/usr.sbin/bsdconfig/packages/packages ============================================================================== --- head/usr.sbin/bsdconfig/packages/packages Sun Nov 17 17:42:15 2013 (r258265) +++ head/usr.sbin/bsdconfig/packages/packages Sun Nov 17 17:48:55 2013 (r258266) @@ -38,6 +38,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/packages/packages.subr @@ -73,6 +74,7 @@ f_device_get_all # # Display the package configuration menu and exit # +trap 'f_media_close' EXIT f_package_config ################################################################################ Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Nov 17 17:42:15 2013 (r258265) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Nov 17 17:48:55 2013 (r258266) @@ -163,8 +163,7 @@ f_media_get_cdrom() # f_media_shutdown_cdrom $device # -# Shuts down the CDROM device and ejects the media using f_media_eject_cdrom(), -# below. Return status should be ignored. +# Shuts down the CDROM device. Return status should be ignored. # f_media_shutdown_cdrom() { @@ -184,8 +183,6 @@ f_media_shutdown_cdrom() else CDROM_MOUNTED= fi - - f_media_eject_cdrom "$dev" } # f_media_eject_cdrom $device From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 17:53: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09624BAC; Sun, 17 Nov 2013 17:53:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECDA72A5F; Sun, 17 Nov 2013 17:53:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHrt3m098682; Sun, 17 Nov 2013 17:53:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHrtQC098679; Sun, 17 Nov 2013 17:53:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171753.rAHHrtQC098679@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258267 - in head/usr.sbin/bsdconfig/share: media packages 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 17:53:56 -0000 Author: dteske Date: Sun Nov 17 17:53:55 2013 New Revision: 258267 URL: http://svnweb.freebsd.org/changeset/base/258267 Log: Fix package installation from physical media such as DVD. Discussed with: re (gjb) MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Sun Nov 17 17:48:55 2013 (r258266) +++ head/usr.sbin/bsdconfig/share/media/http.subr Sun Nov 17 17:53:55 2013 (r258267) @@ -502,6 +502,7 @@ f_media_init_http() setvar $VAR_HTTP_PATH "$hp/$PKG_ABI/latest" if [ "$PKG_ABI" ] && f_http_check_access; then http_found=$SUCCESS + setvar $VAR_HTTP_PATH "$hp" else for fdir in $HTTP_DIRS; do setvar $VAR_HTTP_PATH "$hp/$fdir/$rel" Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:48:55 2013 (r258266) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:53:55 2013 (r258267) @@ -106,16 +106,21 @@ f_index_initialize() device_media get type __type device_media get private __data case "$__type" in - $DEVICE_TYPE_UFS|$DEVICE_TYPE_DISK) __site="file://$MOUNTPOINT" ;; - $DEVICE_TYPE_DIRECTORY) __site="file://$__data" ;; - $DEVICE_TYPE_FLOPPY) __site="file://${__data:-$MOUNTPOINT}" ;; - $DEVICE_TYPE_FTP) f_getvar $VAR_FTP_PATH __site ;; - $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site ;; - $DEVICE_TYPE_HTTP) f_getvar $VAR_HTTP_PATH __site ;; - $DEVICE_TYPE_CDROM) __site="file://$MOUNTPOINT" ;; - $DEVICE_TYPE_USB) __site="file://$MOUNTPOINT" ;; - $DEVICE_TYPE_DOS) __site="file://$MOUNTPOINT" ;; - $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;; + $DEVICE_TYPE_DIRECTORY) + __site="file://$__data/packages/$PKG_ABI" ;; + $DEVICE_TYPE_FLOPPY) + __site="file://${__data:-$MOUNTPOINT}/packages/$PKG_ABI" ;; + $DEVICE_TYPE_FTP) + f_getvar $VAR_FTP_PATH __site + __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_HTTP) + f_getvar $VAR_HTTP_PATH __site + __site="$__site/$PKG_ABI/latest" ;; + $DEVICE_TYPE_HTTP_PROXY) + f_getvar $VAR_HTTP_PROXY_PATH __site + __site="$__site/packages/$PKG_ABI" ;; + *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. + __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac export PACKAGESITE="$__site" Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:48:55 2013 (r258266) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:53:55 2013 (r258267) @@ -971,10 +971,16 @@ f_package_extract() f_getvar $VAR_PKG_TMPDIR:-/var/tmp tmpdir f_quietly mkdir -p -m 1777 "$tmpdir" - local path + local path device_type + device_$device get type device_type case "$name" in */*) path="$name" ;; - *) path="All/$name" ;; + *) + if [ "$device_type" = "$DEVICE_TYPE_HTTP" ]; then + path="$PKG_ABI/latest/All/$name" + else + path="packages/$PKG_ABI/All/$name" + fi esac # We have a path, call the device strategy routine to check the file @@ -982,12 +988,20 @@ f_package_extract() for pkg_ext in "" $PACKAGE_EXTENSIONS; do if f_device_get $device "$path$pkg_ext" $PROBE_EXIST; then path="$path$pkg_ext" - f_dprintf "$funcname: found path=[%s] dev=[%s]" \ - "$path" "$device" + found=1 + break + elif [ "$device_type" = "$DEVICE_TYPE_HTTP" ] && + f_device_get $device \ + "packages/$PKG_ABI/All/$name$pkg_ext" $PROBE_EXIST + then + # Mirroring physical media over HTTP + path="packages/$PKG_ABI/All/$name$pkg_ext" found=1 break fi done + [ "$found" ] && f_dprintf "$funcname: found path=[%s] dev=[%s]" \ + "$path" "$device" local alert=f_show_msg no_confirm= f_getvar $VAR_NO_CONFIRM no_confirm From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D5A3F3A; Sun, 17 Nov 2013 18:03:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42E712AE1; Sun, 17 Nov 2013 18:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHI34RV002866; Sun, 17 Nov 2013 18:03:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHI34KF002865; Sun, 17 Nov 2013 18:03:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171803.rAHI34KF002865@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 18:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258268 - head/sys/powerpc/aim 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:03:04 -0000 Author: nwhitehorn Date: Sun Nov 17 18:03:03 2013 New Revision: 258268 URL: http://svnweb.freebsd.org/changeset/base/258268 Log: Do not assume a value for #address-cells when parsing the OF translations map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Nov 17 17:53:55 2013 (r258267) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Nov 17 18:03:03 2013 (r258268) @@ -187,8 +187,7 @@ uintptr_t moea64_get_unique_vsid(void); struct ofw_map { cell_t om_va; cell_t om_len; - cell_t om_pa_hi; - cell_t om_pa_lo; + uint64_t om_pa; cell_t om_mode; }; @@ -478,13 +477,9 @@ om_cmp(const void *a, const void *b) mapa = a; mapb = b; - if (mapa->om_pa_hi < mapb->om_pa_hi) + if (mapa->om_pa < mapb->om_pa) return (-1); - else if (mapa->om_pa_hi > mapb->om_pa_hi) - return (1); - else if (mapa->om_pa_lo < mapb->om_pa_lo) - return (-1); - else if (mapa->om_pa_lo > mapb->om_pa_lo) + else if (mapa->om_pa > mapb->om_pa) return (1); else return (0); @@ -493,26 +488,41 @@ om_cmp(const void *a, const void *b) static void moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz) { - struct ofw_map translations[sz/sizeof(struct ofw_map)]; + struct ofw_map translations[sz/(4*sizeof(cell_t))]; /*>= 4 cells per */ + pcell_t acells, trans_cells[sz/sizeof(cell_t)]; register_t msr; vm_offset_t off; vm_paddr_t pa_base; - int i; + int i, j; bzero(translations, sz); - if (OF_getprop(mmu, "translations", translations, sz) == -1) + OF_getprop(OF_finddevice("/"), "#address-cells", &acells, + sizeof(acells)); + if (OF_getprop(mmu, "translations", trans_cells, sz) == -1) panic("moea64_bootstrap: can't get ofw translations"); CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations"); - sz /= sizeof(*translations); + sz /= sizeof(cell_t); + for (i = 0, j = 0; i < sz; j++) { + translations[j].om_va = trans_cells[i++]; + translations[j].om_len = trans_cells[i++]; + translations[j].om_pa = trans_cells[i++]; + if (acells == 2) { + translations[j].om_pa <<= 32; + translations[j].om_pa |= trans_cells[i++]; + } + translations[j].om_mode = trans_cells[i++]; + } + KASSERT(i == sz, ("Translations map has incorrect cell count (%d/%zd)", + i, sz)); + + sz = j; qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { - pa_base = translations[i].om_pa_lo; - #ifdef __powerpc64__ - pa_base += (vm_offset_t)translations[i].om_pa_hi << 32; - #else - if (translations[i].om_pa_hi) + pa_base = translations[i].om_pa; + #ifndef __powerpc64__ + if ((translations[i].om_pa >> 32) != 0) panic("OFW translations above 32-bit boundary!"); #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:07:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AD1410F; Sun, 17 Nov 2013 18:07:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4EA32AF7; Sun, 17 Nov 2013 18:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHI7AJ0003540; Sun, 17 Nov 2013 18:07:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHI7AZ4003539; Sun, 17 Nov 2013 18:07:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171807.rAHI7AZ4003539@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 18:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258269 - head/sys/boot/forth 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:07:11 -0000 Author: dteske Date: Sun Nov 17 18:07:10 2013 New Revision: 258269 URL: http://svnweb.freebsd.org/changeset/base/258269 Log: Refactor draw-beastie function. Discussed on: -hackers Modified: head/sys/boot/forth/beastie.4th Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Sun Nov 17 18:03:03 2013 (r258268) +++ head/sys/boot/forth/beastie.4th Sun Nov 17 18:07:10 2013 (r258269) @@ -202,56 +202,26 @@ variable logoY drop then - s" loader_logo" getenv dup -1 = if - logoX @ logoY @ - loader_color? if - orb-logo - else - orbbw-logo - then - drop exit - then - - 2dup s" beastie" compare-insensitive 0= if - logoX @ logoY @ beastie-logo - 2drop exit - then - 2dup s" beastiebw" compare-insensitive 0= if - logoX @ logoY @ beastiebw-logo - 2drop exit - then - 2dup s" fbsdbw" compare-insensitive 0= if - logoX @ logoY @ fbsdbw-logo - 2drop exit - then - 2dup s" orb" compare-insensitive 0= if - logoX @ logoY @ orb-logo - 2drop exit - then - 2dup s" orbbw" compare-insensitive 0= if - logoX @ logoY @ orbbw-logo - 2drop exit - then - 2dup s" tribute" compare-insensitive 0= if - logoX @ logoY @ - s" tribute-logo" sfind if - execute - else - drop orb-logo - then - 2drop exit + s" loader_logo" getenv dup -1 <> if + dup 5 + allocate if ENOMEM throw then + 0 2swap strcat s" -logo" strcat + over -rot ( a-addr/u -- a-addr a-addr/u ) + sfind ( a-addr a-addr/u -- a-addr xt bool ) + rot ( a-addr xt bool -- xt bool a-addr ) + free ( xt bool a-addr -- xt bool ior ) + if EFREE throw then + else + 0 ( cruft -- cruft bool ) \ load the default below then - 2dup s" tributebw" compare-insensitive 0= if - logoX @ logoY @ - s" tributebw-logo" sfind if - execute + 0= if + drop ( cruft -- ) + loader_color? if + ['] orb-logo else - drop orbbw-logo + ['] orbbw-logo then - 2drop exit then - - 2drop + logoX @ logoY @ rot execute ; : clear-beastie ( -- ) \ clears beastie from the screen From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:12: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19CBB3DE; Sun, 17 Nov 2013 18:12:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08C7E2B71; Sun, 17 Nov 2013 18:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHICIma006454; Sun, 17 Nov 2013 18:12:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHICISb006449; Sun, 17 Nov 2013 18:12:18 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171812.rAHICISb006449@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 18:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258270 - in head/sys/boot: forth i386/loader 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:12:19 -0000 Author: dteske Date: Sun Nov 17 18:12:17 2013 New Revision: 258270 URL: http://svnweb.freebsd.org/changeset/base/258270 Log: Add a try-include word (which acts the same as "include") and use it to conditionally include (but ignore failures) /boot/loader.rc.local and /boot/menu.rc.local -- to make customizing the menu easier. Reviewed by: alfred Discussed on: -hackers Modified: head/sys/boot/forth/loader.4th head/sys/boot/forth/loader.4th.8 head/sys/boot/forth/loader.rc head/sys/boot/forth/menu.rc head/sys/boot/i386/loader/loader.rc Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Sun Nov 17 18:07:10 2013 (r258269) +++ head/sys/boot/forth/loader.4th Sun Nov 17 18:12:17 2013 (r258270) @@ -233,7 +233,16 @@ include /boot/check-password.4th s" disable-module" s" disable loading of a module" .? s" toggle-module" s" toggle loading of a module" .? s" show-module" s" show module load data" .? + s" try-include" s" try to load/interpret files" .? ; +: try-include ( -- ) \ see loader.4th(8) + ['] include ( -- xt ) \ get the execution token of `include' + catch ( xt -- exception# | 0 ) if \ failed + LF parse ( c -- s-addr/u ) 2drop \ advance >in to EOL (drop data) + \ ... prevents words unused by `include' from being interpreted + then +; immediate \ interpret immediately for access to `source' (aka tib) + only forth also Modified: head/sys/boot/forth/loader.4th.8 ============================================================================== --- head/sys/boot/forth/loader.4th.8 Sun Nov 17 18:07:10 2013 (r258269) +++ head/sys/boot/forth/loader.4th.8 Sun Nov 17 18:12:17 2013 (r258270) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2013 +.Dd November 13, 2013 .Dt LOADER.4TH 8 .Os .Sh NAME @@ -158,6 +158,13 @@ files to specify the action after a modu Used inside .Xr loader.conf 5 files to specify the action after a module loading fails. +.It Ic try-include Ar file Op Ar +Process script files if they exist. +Each file, in turn, is completely read into memory, +and then each of its lines is passed to the command line interpreter. +If any error is returned by the interpreter, the try-include +command aborts immediately, without reading any other files, and +silently returns without error. .El .Sh FILES .Bl -tag -width /boot/loader.4th -compact Modified: head/sys/boot/forth/loader.rc ============================================================================== --- head/sys/boot/forth/loader.rc Sun Nov 17 18:07:10 2013 (r258269) +++ head/sys/boot/forth/loader.rc Sun Nov 17 18:12:17 2013 (r258270) @@ -3,6 +3,7 @@ \ \ Includes additional commands include /boot/loader.4th +try-include /boot/loader.rc.local \ Reads and processes loader.conf variables \ NOTE: Change to `initialize' if you enable the below boot menu Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Sun Nov 17 18:07:10 2013 (r258269) +++ head/sys/boot/forth/menu.rc Sun Nov 17 18:12:17 2013 (r258270) @@ -120,6 +120,10 @@ set optionstoggled_ansi[6]="Ver \ set menu_timeout_command="boot" +\ Include optional elements defined in a local file +\ +try-include /boot/menu.rc.local + \ Display the main menu (see `menu.4th') set menuset_initial=1 menuset-loadinitial Modified: head/sys/boot/i386/loader/loader.rc ============================================================================== --- head/sys/boot/i386/loader/loader.rc Sun Nov 17 18:07:10 2013 (r258269) +++ head/sys/boot/i386/loader/loader.rc Sun Nov 17 18:12:17 2013 (r258270) @@ -3,6 +3,7 @@ \ \ Includes additional commands include /boot/loader.4th +try-include /boot/loader.rc.local \ Reads and processes loader.conf variables initialize From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:15:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E98F546 for ; Sun, 17 Nov 2013 18:15:10 +0000 (UTC) Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com [IPv6:2607:f8b0:400d:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2752B85 for ; Sun, 17 Nov 2013 18:15:10 +0000 (UTC) Received: by mail-qe0-f50.google.com with SMTP id 1so3501181qee.37 for ; Sun, 17 Nov 2013 10:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=eSdvKQFUmShU2dixzwUpcWdE0laLhB7iyxs60ZeWIjM=; b=G4O1J0azTCPSgQWvrQqUEjvbChMsPPuLPOP8wqQbYSj91hqCSTy/5bPEF8fngr5IvD /AJSFK4g8r2g7d5jvLuyoQ8T+UrJaFTml4CX4iZ1vfpqTcBFiua6mN4PsUX8X3mA8CVM JwoZTVhYOn2m4ayk/BYtXLtttfl2hPOCwbBvQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=eSdvKQFUmShU2dixzwUpcWdE0laLhB7iyxs60ZeWIjM=; b=GigiPHzYFHew8fWkMlHZlucEpwAkt7qMseZyFSxwgc8eqOjvyT+hWxepqSMGMH9FqV 6v0vBOXiKNUDljRgzzQgwWj82vvWHR1pWKTbMXZUl+U8fJKpknJxp53sD3ovRoOgLJgj rMPmK3U6R3FL5VzZxgC5cyoekCfMpMokSjQup1AcdB4UaPtdWqWnPw3PoQkAUzUU8J0F lClKfdl/UtMPqfv1L5JvGRYeB9zjwnAIJsKOt7mo7sy5E1Gy/JRGKZAhK2wKFvIy20Eh P/cRRmJRnbjBrP9R9ttZtpLMUZmDLQ68l+yFSQRCix1E/M1YUohPxK1yLNA12uSnEmBz vfaA== X-Gm-Message-State: ALoCoQmJDsJD8gbIZ7waPKzcGOhiQsGwmZotQb9cX5lntI4vRu8aupEX6BhpXjOYDxo/DxcOxIYn X-Received: by 10.49.109.194 with SMTP id hu2mr28135962qeb.13.1384712109291; Sun, 17 Nov 2013 10:15:09 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.63.101 with HTTP; Sun, 17 Nov 2013 10:14:39 -0800 (PST) In-Reply-To: <201311170503.rAH53F27033585@svn.freebsd.org> References: <201311170503.rAH53F27033585@svn.freebsd.org> From: Eitan Adler Date: Sun, 17 Nov 2013 13:14:39 -0500 X-Google-Sender-Auth: Dlng_Xjqo2gYUN-BoyY1HDAKVxs Message-ID: Subject: Re: svn commit: r258250 - head/sys/powerpc/fpu To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:15:10 -0000 On Sun, Nov 17, 2013 at 12:03 AM, Nathan Whitehorn wrote: > Modified: head/sys/powerpc/fpu/fpu_explode.c > ============================================================================== > --- head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 03:11:36 2013 (r258249) > +++ head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 05:03:15 2013 (r258250) > @@ -235,6 +235,7 @@ fpu_explode(struct fpemu *fe, struct fpn > s = fpu_dtof(fp, s, space[1]); > break; > > + default: > panic("fpu_explode"); > panic("fpu_explode: invalid type %d", type); > } Why are there two panic calls here? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:16: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72C9D687; Sun, 17 Nov 2013 18:16:26 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) by mx1.freebsd.org (Postfix) with ESMTP id B6DCC2B8D; Sun, 17 Nov 2013 18:16:25 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MWF00K00604KF00@smtpauth3.wiscmail.wisc.edu>; Sun, 17 Nov 2013 12:16:09 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.11.17.180315, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MWF008LG6QOOP10@smtpauth3.wiscmail.wisc.edu>; Sun, 17 Nov 2013 12:16:06 -0600 (CST) Message-id: <528907DF.8040904@freebsd.org> Date: Sun, 17 Nov 2013 12:15:59 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Eitan Adler Subject: Re: svn commit: r258250 - head/sys/powerpc/fpu References: <201311170503.rAH53F27033585@svn.freebsd.org> In-reply-to: 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:16:26 -0000 On 11/17/13 12:14, Eitan Adler wrote: > On Sun, Nov 17, 2013 at 12:03 AM, Nathan Whitehorn > wrote: >> Modified: head/sys/powerpc/fpu/fpu_explode.c >> ============================================================================== >> --- head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 03:11:36 2013 (r258249) >> +++ head/sys/powerpc/fpu/fpu_explode.c Sun Nov 17 05:03:15 2013 (r258250) >> @@ -235,6 +235,7 @@ fpu_explode(struct fpemu *fe, struct fpn >> s = fpu_dtof(fp, s, space[1]); >> break; >> >> + default: >> panic("fpu_explode"); >> panic("fpu_explode: invalid type %d", type); >> } > Why are there two panic calls here? > > That's a fascinating question. This code was ... interesting. I'll get rid of the first useless one. Thanks! -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:27:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 063D1A01; Sun, 17 Nov 2013 18:27:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA09C2C03; Sun, 17 Nov 2013 18:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHIR7ao010349; Sun, 17 Nov 2013 18:27:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHIR7w8010348; Sun, 17 Nov 2013 18:27:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171827.rAHIR7w8010348@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 18:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258271 - head/sys/powerpc/powermac 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:27:08 -0000 Author: nwhitehorn Date: Sun Nov 17 18:27:07 2013 New Revision: 258271 URL: http://svnweb.freebsd.org/changeset/base/258271 Log: Actually look up #address-cells instead of assuming it is correlated with the Uninorth version number. MFC after: 2 weeks Modified: head/sys/powerpc/powermac/uninorthpci.c Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Sun Nov 17 18:12:17 2013 (r258270) +++ head/sys/powerpc/powermac/uninorthpci.c Sun Nov 17 18:27:07 2013 (r258271) @@ -134,7 +134,9 @@ uninorth_attach(device_t dev) struct uninorth_softc *sc; const char *compatible; phandle_t node; - u_int32_t reg[3]; + uint32_t reg[3]; + uint64_t regbase; + cell_t acells; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -149,14 +151,18 @@ uninorth_attach(device_t dev) if (strcmp(compatible, "u4-pcie") == 0) sc->sc_ver = 4; - if (sc->sc_ver >= 3) { - sc->sc_addr = (vm_offset_t)pmap_mapdev(reg[1] + 0x800000, PAGE_SIZE); - sc->sc_data = (vm_offset_t)pmap_mapdev(reg[1] + 0xc00000, PAGE_SIZE); - } else { - sc->sc_addr = (vm_offset_t)pmap_mapdev(reg[0] + 0x800000, PAGE_SIZE); - sc->sc_data = (vm_offset_t)pmap_mapdev(reg[0] + 0xc00000, PAGE_SIZE); + acells = 1; + OF_getprop(OF_parent(node), "#address-cells", &acells, sizeof(acells)); + + regbase = reg[0]; + if (acells == 2) { + regbase <<= 32; + regbase |= reg[1]; } + sc->sc_addr = (vm_offset_t)pmap_mapdev(regbase + 0x800000, PAGE_SIZE); + sc->sc_data = (vm_offset_t)pmap_mapdev(regbase + 0xc00000, PAGE_SIZE); + return (ofw_pci_attach(dev)); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 18:46:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A430D4C; Sun, 17 Nov 2013 18:46:39 +0000 (UTC) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5C8A2CE6; Sun, 17 Nov 2013 18:46:38 +0000 (UTC) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=[192.168.1.179]) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Vi7Mg-000DVR-Jn; Sun, 17 Nov 2013 19:46:35 +0100 Message-ID: <52890F0A.7050501@FreeBSD.org> Date: Sun, 17 Nov 2013 19:46:34 +0100 From: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r258262 - head/sys/dev/drm2 References: <201311171607.rAHG7rY7057352@svn.freebsd.org> <20131117174600.GN59496@kib.kiev.ua> In-Reply-To: <20131117174600.GN59496@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 18:46:39 -0000 Le 17/11/2013 18:46, Konstantin Belousov a écrit : >> +/* >> + * Default to use monotonic timestamps for wait-for-vblank and page-flip >> + * complete events. >> + */ >> +unsigned int drm_timestamp_monotonic = 1; >> + > Why do you need a variable there, instead of simply returning true > from the drm_getcap ? I do not see any way to change the value of the > drm_timestamp_monotonic. Just to remain close to Linux original code. In Linux, this is module parameter. We could make it a sysctl at some point too. -- Jean-Sébastien Pédron From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 19:01: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C42EB203; Sun, 17 Nov 2013 19:01:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 998F12DB1; Sun, 17 Nov 2013 19:01:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHJ1Esv022760; Sun, 17 Nov 2013 19:01:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHJ1Eja022757; Sun, 17 Nov 2013 19:01:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171901.rAHJ1Eja022757@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 19:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258272 - head/sys/powerpc/powermac 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 19:01:14 -0000 Author: nwhitehorn Date: Sun Nov 17 19:01:13 2013 New Revision: 258272 URL: http://svnweb.freebsd.org/changeset/base/258272 Log: Use #address-cells and #size-cells here too instead of guessing. There is some comment I wrote about these values "lying" in the negative diff, which referes to an earlier misunderstanding about which node to read them from. This gets at least the PPC64 kernel booting in the mac99 system model in QEMU after bypassing the MacIO ATA driver, which apparently still has problems. Modified: head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powermac/uninorthvar.h Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Sun Nov 17 18:27:07 2013 (r258271) +++ head/sys/powerpc/powermac/uninorth.c Sun Nov 17 19:01:13 2013 (r258272) @@ -264,6 +264,7 @@ unin_chip_attach(device_t dev) phandle_t child; phandle_t iparent; device_t cdev; + cell_t acells, scells; char compat[32]; char name[32]; u_int irq, reg[3]; @@ -275,12 +276,21 @@ unin_chip_attach(device_t dev) if (OF_getprop(root, "reg", reg, sizeof(reg)) < 8) return (ENXIO); - if (strcmp(ofw_bus_get_name(dev), "u3") == 0 - || strcmp(ofw_bus_get_name(dev), "u4") == 0) - i = 1; /* #address-cells lies */ - - sc->sc_physaddr = reg[i]; - sc->sc_size = reg[i+1]; + acells = scells = 1; + OF_getprop(OF_parent(root), "#address-cells", &acells, sizeof(acells)); + OF_getprop(OF_parent(root), "#size-cells", &scells, sizeof(scells)); + + i = 0; + sc->sc_physaddr = reg[i++]; + if (acells == 2) { + sc->sc_physaddr <<= 32; + sc->sc_physaddr |= reg[i++]; + } + sc->sc_size = reg[i++]; + if (scells == 2) { + sc->sc_size <<= 32; + sc->sc_size |= reg[i++]; + } sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "UniNorth Device Memory"; Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Sun Nov 17 18:27:07 2013 (r258271) +++ head/sys/powerpc/powermac/uninorthvar.h Sun Nov 17 19:01:13 2013 (r258272) @@ -38,9 +38,9 @@ struct uninorth_softc { }; struct unin_chip_softc { - u_int32_t sc_physaddr; + uint64_t sc_physaddr; + uint64_t sc_size; vm_offset_t sc_addr; - u_int32_t sc_size; struct rman sc_mem_rman; int sc_version; }; From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 19:37: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E70DCA7B; Sun, 17 Nov 2013 19:37:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D76CF2F0B; Sun, 17 Nov 2013 19:37:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHJbqxO033759; Sun, 17 Nov 2013 19:37:52 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHJbqFH033758; Sun, 17 Nov 2013 19:37:52 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201311171937.rAHJbqFH033758@svn.freebsd.org> From: Antoine Brodin Date: Sun, 17 Nov 2013 19:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258273 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 19:37:53 -0000 Author: antoine Date: Sun Nov 17 19:37:52 2013 New Revision: 258273 URL: http://svnweb.freebsd.org/changeset/base/258273 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 17 19:01:13 2013 (r258272) +++ head/ObsoleteFiles.inc Sun Nov 17 19:37:52 2013 (r258273) @@ -44,6 +44,9 @@ OLD_FILES+=usr/share/man/man2/extattr_ge # 20131107: example files removed OLD_FILES+=usr/share/examples/libusb20/aux.c OLD_FILES+=usr/share/examples/libusb20/aux.h +# 20131105: tzdata 2013h import +OLD_FILES+=usr/share/zoneinfo/America/Shiprock +OLD_FILES+=usr/share/zoneinfo/Antarctica/South_Pole # 20131103: WITH_LIBICONV_COMPAT removal OLD_FILES+=usr/include/_libiconv_compat.h OLD_FILES+=usr/lib/libiconv.a @@ -79,8 +82,14 @@ OLD_FILES+=etc/keys/pkg/trusted/pkg.free # 20131028: ng_fec(4) removed OLD_FILES+=usr/include/netgraph/ng_fec.h OLD_FILES+=usr/share/man/man4/ng_fec.4.gz +# 20131027: header moved +OLD_FILES+=usr/include/net/pf_mtag.h # 20131023: remove never used iscsi directory OLD_DIRS+=usr/share/examples/iscsi +# 20131021: isf(4) removed +OLD_FILES+=usr/sbin/isfctl +OLD_FILES+=usr/share/man/man4/isf.4.gz +OLD_FILES+=usr/share/man/man8/isfctl.8.gz # 20131014: libbsdyml becomes private OLD_FILES+=usr/lib/libbsdyml.a OLD_FILES+=usr/lib/libbsdyml.so From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 19:50: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 826CCE8D; Sun, 17 Nov 2013 19:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71E272FCC; Sun, 17 Nov 2013 19:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHJopOx038027; Sun, 17 Nov 2013 19:50:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHJop7P038026; Sun, 17 Nov 2013 19:50:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311171950.rAHJop7P038026@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 17 Nov 2013 19:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258274 - head/sys/powerpc/powermac 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 19:50:51 -0000 Author: nwhitehorn Date: Sun Nov 17 19:50:50 2013 New Revision: 258274 URL: http://svnweb.freebsd.org/changeset/base/258274 Log: #interrupt-cells belongs to the iparent, not the device parent. Modified: head/sys/powerpc/powermac/macio.c Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Sun Nov 17 19:37:52 2013 (r258273) +++ head/sys/powerpc/powermac/macio.c Sun Nov 17 19:50:50 2013 (r258274) @@ -201,10 +201,6 @@ macio_add_intr(phandle_t devnode, struct return; } - if (OF_searchprop(devnode, "#interrupt-cells", &icells, sizeof(icells)) - <= 0) - icells = 1; - nintr = OF_getprop_alloc(devnode, "interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) { @@ -221,6 +217,10 @@ macio_add_intr(phandle_t devnode, struct <= 0) panic("Interrupt but no interrupt parent!\n"); + if (OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, + sizeof(icells)) <= 0) + icells = 1; + for (i = 0; i < nintr; i+=icells) { u_int irq = MAP_IRQ(iparent, intr[i]); From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 20:29:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1600453B; Sun, 17 Nov 2013 20:29:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFBA1215F; Sun, 17 Nov 2013 20:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHKTX1M051270; Sun, 17 Nov 2013 20:29:33 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHKTXRu051269; Sun, 17 Nov 2013 20:29:33 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201311172029.rAHKTXRu051269@svn.freebsd.org> From: Justin Hibbits Date: Sun, 17 Nov 2013 20:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258275 - head/sys/powerpc/ofw 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 20:29:34 -0000 Author: jhibbits Date: Sun Nov 17 20:29:33 2013 New Revision: 258275 URL: http://svnweb.freebsd.org/changeset/base/258275 Log: Add a sysctl to allow disabling resetting the OF syscons. On some machines (G5 with lots of RAM), entering OF sometimes causes the machine to hang. Once the machine is booted, currently the only entry point into OF is through resetting the framebuffer on mode switch on these machines. Disabling this allows the machine to stay up at the expense of less usable consoles after X is started. MFC after: Never, this is only a hack Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Sun Nov 17 19:50:50 2013 (r258274) +++ head/sys/powerpc/ofw/ofw_syscons.c Sun Nov 17 20:29:33 2013 (r258275) @@ -57,9 +57,12 @@ __FBSDID("$FreeBSD$"); #include static int ofwfb_ignore_mmap_checks = 1; +static int ofwfb_reset_on_switch = 1; static SYSCTL_NODE(_hw, OID_AUTO, ofwfb, CTLFLAG_RD, 0, "ofwfb"); SYSCTL_INT(_hw_ofwfb, OID_AUTO, relax_mmap, CTLFLAG_RW, &ofwfb_ignore_mmap_checks, 0, "relaxed mmap bounds checking"); +SYSCTL_INT(_hw_ofwfb, OID_AUTO, reset_on_mode_switch, CTLFLAG_RW, + &ofwfb_reset_on_switch, 0, "reset the framebuffer driver on mode switch"); extern u_char dflt_font_16[]; extern u_char dflt_font_14[]; @@ -447,26 +450,28 @@ ofwfb_set_mode(video_adapter_t *adp, int sc = (struct ofwfb_softc *)adp; - /* - * Open the display device, which will initialize it. - */ - - memset(name, 0, sizeof(name)); - OF_package_to_path(sc->sc_node, name, sizeof(name)); - ih = OF_open(name); - - if (sc->sc_depth == 8) { + if (ofwfb_reset_on_switch) { /* - * Install the ISO6429 colormap - older OFW systems - * don't do this by default + * Open the display device, which will initialize it. */ - for (i = 0; i < 16; i++) { - OF_call_method("color!", ih, 4, 1, - ofwfb_cmap[i].red, - ofwfb_cmap[i].green, - ofwfb_cmap[i].blue, - i, - &retval); + + memset(name, 0, sizeof(name)); + OF_package_to_path(sc->sc_node, name, sizeof(name)); + ih = OF_open(name); + + if (sc->sc_depth == 8) { + /* + * Install the ISO6429 colormap - older OFW systems + * don't do this by default + */ + for (i = 0; i < 16; i++) { + OF_call_method("color!", ih, 4, 1, + ofwfb_cmap[i].red, + ofwfb_cmap[i].green, + ofwfb_cmap[i].blue, + i, + &retval); + } } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 20:58:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37EFF8BA; Sun, 17 Nov 2013 20:58:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 275FF22D3; Sun, 17 Nov 2013 20:58:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHKwWE4060731; Sun, 17 Nov 2013 20:58:32 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHKwWjr060730; Sun, 17 Nov 2013 20:58:32 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201311172058.rAHKwWjr060730@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 17 Nov 2013 20:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258276 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 20:58:32 -0000 Author: alfred Date: Sun Nov 17 20:58:31 2013 New Revision: 258276 URL: http://svnweb.freebsd.org/changeset/base/258276 Log: Fix creating a vlan over lagg over mlxen crash. PR: 181931 Submitted by: Shahar Klein (shahark mellanox.com) Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 20:29:33 2013 (r258275) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 20:58:31 2013 (r258276) @@ -52,6 +52,9 @@ static void mlx4_en_vlan_rx_add_vid(void int idx; u8 field; + if (arg != priv) + return; + if ((vid == 0) || (vid > 4095)) /* Invalid */ return; en_dbg(HW, priv, "adding VLAN:%d\n", vid); @@ -73,6 +76,9 @@ static void mlx4_en_vlan_rx_kill_vid(voi int idx; u8 field; + if (arg != priv) + return; + if ((vid == 0) || (vid > 4095)) /* Invalid */ return; en_dbg(HW, priv, "Killing VID:%d\n", vid); From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 22:24: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11E421A6; Sun, 17 Nov 2013 22:24:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 002DA2920; Sun, 17 Nov 2013 22:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHMOYq7092092; Sun, 17 Nov 2013 22:24:34 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHMOY4I092091; Sun, 17 Nov 2013 22:24:34 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201311172224.rAHMOY4I092091@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 17 Nov 2013 22:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258280 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 22:24:35 -0000 Author: alfred Date: Sun Nov 17 22:24:34 2013 New Revision: 258280 URL: http://svnweb.freebsd.org/changeset/base/258280 Log: MFC: 258276 Fix creating a vlan over lagg over mlxen crash. PR: 181931 Submitted by: Shahar Klein (shahark mellanox.com) Approved by: re Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 21:36:19 2013 (r258279) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 17 22:24:34 2013 (r258280) @@ -52,6 +52,9 @@ static void mlx4_en_vlan_rx_add_vid(void int idx; u8 field; + if (arg != priv) + return; + if ((vid == 0) || (vid > 4095)) /* Invalid */ return; en_dbg(HW, priv, "adding VLAN:%d\n", vid); @@ -73,6 +76,9 @@ static void mlx4_en_vlan_rx_kill_vid(voi int idx; u8 field; + if (arg != priv) + return; + if ((vid == 0) || (vid > 4095)) /* Invalid */ return; en_dbg(HW, priv, "Killing VID:%d\n", vid); From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 22:31: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 886763DA; Sun, 17 Nov 2013 22:31:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68AF62990; Sun, 17 Nov 2013 22:31:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHMVOev095236; Sun, 17 Nov 2013 22:31:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHMVOlW095234; Sun, 17 Nov 2013 22:31:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201311172231.rAHMVOlW095234@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 17 Nov 2013 22:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258281 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 22:31:24 -0000 Author: jilles Date: Sun Nov 17 22:31:23 2013 New Revision: 258281 URL: http://svnweb.freebsd.org/changeset/base/258281 Log: Fix siginfo_t.si_status for wait6/waitid/SIGCHLD. Per POSIX, si_status should contain the value passed to exit() for si_code==CLD_EXITED and the signal number for other si_code. This was incorrect for CLD_EXITED and CLD_DUMPED. This is still not fully POSIX-compliant (Austin group issue #594 says that the full value passed to exit() shall be returned via si_status, not just the low 8 bits) but is sufficient for a si_status-related test in libnih (upstart, Debian/kFreeBSD). PR: kern/184002 Reported by: Dmitrijs Ledkovs Tested by: Dmitrijs Ledkovs Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Nov 17 22:24:34 2013 (r258280) +++ head/sys/kern/kern_exit.c Sun Nov 17 22:31:23 2013 (r258281) @@ -974,16 +974,19 @@ proc_to_reap(struct thread *td, struct p * This is still a rough estimate. We will fix the * cases TRAPPED, STOPPED, and CONTINUED later. */ - if (WCOREDUMP(p->p_xstat)) + if (WCOREDUMP(p->p_xstat)) { siginfo->si_code = CLD_DUMPED; - else if (WIFSIGNALED(p->p_xstat)) + siginfo->si_status = WTERMSIG(p->p_xstat); + } else if (WIFSIGNALED(p->p_xstat)) { siginfo->si_code = CLD_KILLED; - else + siginfo->si_status = WTERMSIG(p->p_xstat); + } else { siginfo->si_code = CLD_EXITED; + siginfo->si_status = WEXITSTATUS(p->p_xstat); + } siginfo->si_pid = p->p_pid; siginfo->si_uid = p->p_ucred->cr_uid; - siginfo->si_status = p->p_xstat; /* * The si_addr field would be useful additional Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Nov 17 22:24:34 2013 (r258280) +++ head/sys/kern/kern_sig.c Sun Nov 17 22:31:23 2013 (r258281) @@ -2959,7 +2959,7 @@ sigparent(struct proc *p, int reason, in } static void -childproc_jobstate(struct proc *p, int reason, int status) +childproc_jobstate(struct proc *p, int reason, int sig) { struct sigacts *ps; @@ -2979,7 +2979,7 @@ childproc_jobstate(struct proc *p, int r mtx_lock(&ps->ps_mtx); if ((ps->ps_flag & PS_NOCLDSTOP) == 0) { mtx_unlock(&ps->ps_mtx); - sigparent(p, reason, status); + sigparent(p, reason, sig); } else mtx_unlock(&ps->ps_mtx); } @@ -2987,6 +2987,7 @@ childproc_jobstate(struct proc *p, int r void childproc_stopped(struct proc *p, int reason) { + /* p_xstat is a plain signal number, not a full wait() status here. */ childproc_jobstate(p, reason, p->p_xstat); } @@ -3000,13 +3001,15 @@ void childproc_exited(struct proc *p) { int reason; - int status = p->p_xstat; /* convert to int */ + int xstat = p->p_xstat; /* convert to int */ + int status; - reason = CLD_EXITED; - if (WCOREDUMP(status)) - reason = CLD_DUMPED; - else if (WIFSIGNALED(status)) - reason = CLD_KILLED; + if (WCOREDUMP(xstat)) + reason = CLD_DUMPED, status = WTERMSIG(xstat); + else if (WIFSIGNALED(xstat)) + reason = CLD_KILLED, status = WTERMSIG(xstat); + else + reason = CLD_EXITED, status = WEXITSTATUS(xstat); /* * XXX avoid calling wakeup(p->p_pptr), the work is * done in exit1(). From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 22:52:22 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 588B07F1; Sun, 17 Nov 2013 22:52:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4668E2A8F; Sun, 17 Nov 2013 22:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHMqMei002274; Sun, 17 Nov 2013 22:52:22 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHMqH2X002244; Sun, 17 Nov 2013 22:52:17 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311172252.rAHMqH2X002244@svn.freebsd.org> From: Peter Wemm Date: Sun, 17 Nov 2013 22:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258283 - in head: . include lib lib/libc lib/libc/iconv lib/libc_nonshared 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 22:52:22 -0000 Author: peter Date: Sun Nov 17 22:52:17 2013 New Revision: 258283 URL: http://svnweb.freebsd.org/changeset/base/258283 Log: Attempt to move the POSIX iconv* symbols out of runtime linker space. FreeBSD systems usually implemented this as a third party module and our implementation hasn't played as nicely with the old way as it could have. To that end: * Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix. * Provide .symver compatability with existing 10.x+ binaries that referenced the iconv symbols. All existing binaries should work. * Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript at /usr/lib/libc.so. * Move the "iconv*" wrapper symbols to libc_nonshared.a This should solve the runtime ambiguity about which symbols resolve to where. If you compile against the iconv in libc, your runtime dependencies will be unambiguous. Old 9.x libraries and binaries will always resolve against their libiconv.so.3 like they did on 9.x. They won't resolve against libc. Old 10.x binaries will be satisified by the .symver helpers. This should allow ports to selectively compile against the libiconv port if needed and it should behave without ambiguity now. Discussed with: kib Added: head/lib/libc/iconv/iconv-internal.h (contents, props changed) head/lib/libc/iconv/iconv_compat.c (contents, props changed) head/lib/libc_nonshared/ head/lib/libc_nonshared/Makefile (contents, props changed) head/lib/libc_nonshared/__iconv.c (contents, props changed) head/lib/libc_nonshared/__iconv_free_list.c (contents, props changed) head/lib/libc_nonshared/__iconv_get_list.c (contents, props changed) head/lib/libc_nonshared/__stub.c (contents, props changed) head/lib/libc_nonshared/iconv.c (contents, props changed) head/lib/libc_nonshared/iconv_canonicalize.c (contents, props changed) head/lib/libc_nonshared/iconv_close.c (contents, props changed) head/lib/libc_nonshared/iconv_open.c (contents, props changed) head/lib/libc_nonshared/iconv_open_into.c (contents, props changed) head/lib/libc_nonshared/iconv_set_relocation_prefix.c (contents, props changed) head/lib/libc_nonshared/iconvctl.c (contents, props changed) head/lib/libc_nonshared/iconvlist.c (contents, props changed) Modified: head/Makefile.inc1 head/include/iconv.h head/lib/Makefile head/lib/libc/iconv/Makefile.inc head/lib/libc/iconv/Symbol.map head/lib/libc/iconv/iconv.c head/lib/libc/libc.ldscript Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 17 22:44:52 2013 (r258282) +++ head/Makefile.inc1 Sun Nov 17 22:52:17 2013 (r258283) @@ -1475,11 +1475,13 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc +_startup_libs+= lib/libc_nonshared .if ${MK_LIBCPLUSPLUS} != "no" _startup_libs+= lib/libcxxrt .endif gnu/lib/libgcc__L: lib/libc__L +gnu/lib/libgcc__L: lib/libc_nonshared__L .if ${MK_LIBCPLUSPLUS} != "no" lib/libcxxrt__L: gnu/lib/libgcc__L .endif Modified: head/include/iconv.h ============================================================================== --- head/include/iconv.h Sun Nov 17 22:44:52 2013 (r258282) +++ head/include/iconv.h Sun Nov 17 22:52:17 2013 (r258283) @@ -69,17 +69,12 @@ size_t __iconv(iconv_t, const char **, s /* * GNU interfaces for iconv */ -/* We have iconvctl() */ -#define _ICONV_VERSION 0x0108 -extern int _iconv_version; - typedef struct { void *spaceholder[64]; } iconv_allocation_t; int iconv_open_into(const char *, const char *, iconv_allocation_t *); -void iconv_set_relocation_prefix(const char *orig_prefix, - const char *curr_prefix); +void iconv_set_relocation_prefix(const char *, const char *); /* * iconvctl() request macros Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sun Nov 17 22:44:52 2013 (r258282) +++ head/lib/Makefile Sun Nov 17 22:52:17 2013 (r258283) @@ -32,6 +32,7 @@ SUBDIR_ORDERED= ${_csu} \ libc \ + libc_nonshared \ libbsm \ libauditd \ libcompiler_rt \ Modified: head/lib/libc/iconv/Makefile.inc ============================================================================== --- head/lib/libc/iconv/Makefile.inc Sun Nov 17 22:44:52 2013 (r258282) +++ head/lib/libc/iconv/Makefile.inc Sun Nov 17 22:52:17 2013 (r258283) @@ -14,5 +14,5 @@ SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_esdb.c citrus_hash.c citrus_iconv.c citrus_lookup.c \ citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \ citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \ - citrus_prop.c citrus_stdenc.c iconv.c + citrus_prop.c citrus_stdenc.c iconv.c iconv_compat.c SYM_MAPS+= ${.CURDIR}/iconv/Symbol.map Modified: head/lib/libc/iconv/Symbol.map ============================================================================== --- head/lib/libc/iconv/Symbol.map Sun Nov 17 22:44:52 2013 (r258282) +++ head/lib/libc/iconv/Symbol.map Sun Nov 17 22:52:17 2013 (r258283) @@ -2,22 +2,18 @@ * $FreeBSD$ */ -FBSD_1.2 { - __iconv; - __iconv_free_list; - __iconv_get_list; - iconv_canonicalize; -}; - FBSD_1.3 { - _iconv_version; - iconv; - iconv_open; - iconv_close; - iconv_open_into; - iconv_set_relocation_prefix; - iconvctl; - iconvlist; + __bsd___iconv; + __bsd___iconv_free_list; + __bsd___iconv_get_list; + __bsd_iconv; + __bsd_iconv_canonicalize; + __bsd_iconv_close; + __bsd_iconv_open; + __bsd_iconv_open_into; + __bsd_iconv_set_relocation_prefix; + __bsd_iconvctl; + __bsd_iconvlist; }; FBSDprivate_1.0 { Added: head/lib/libc/iconv/iconv-internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/iconv/iconv-internal.h Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +/* + * Interal prototypes for our back-end functions. + */ +size_t __bsd___iconv(iconv_t, const char **, size_t *, char **, + size_t *, __uint32_t, size_t *); +void __bsd___iconv_free_list(char **, size_t); +int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool); +size_t __bsd_iconv(iconv_t, const char ** __restrict, + size_t * __restrict, char ** __restrict, + size_t * __restrict); +const char *__bsd_iconv_canonicalize(const char *); +int __bsd_iconv_close(iconv_t); +iconv_t __bsd_iconv_open(const char *, const char *); +int __bsd_iconv_open_into(const char *, const char *, iconv_allocation_t *); +void __bsd_iconv_set_relocation_prefix(const char *, const char *); +int __bsd_iconvctl(iconv_t, int, void *); +void __bsd_iconvlist(int (*) (unsigned int, const char * const *, void *), void *); Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Sun Nov 17 22:44:52 2013 (r258282) +++ head/lib/libc/iconv/iconv.c Sun Nov 17 22:52:17 2013 (r258283) @@ -47,15 +47,12 @@ #include "citrus_hash.h" #include "citrus_iconv.h" -#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) - -int _iconv_version = _ICONV_VERSION; +#include "iconv-internal.h" -iconv_t _iconv_open(const char *out, const char *in, - struct _citrus_iconv *prealloc); +#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) -iconv_t -_iconv_open(const char *out, const char *in, struct _citrus_iconv *handle) +static iconv_t +__bsd___iconv_open(const char *out, const char *in, struct _citrus_iconv *handle) { const char *out_slashes; char *out_noslashes; @@ -92,23 +89,23 @@ _iconv_open(const char *out, const char } iconv_t -iconv_open(const char *out, const char *in) +__bsd_iconv_open(const char *out, const char *in) { - return (_iconv_open(out, in, NULL)); + return (__bsd___iconv_open(out, in, NULL)); } int -iconv_open_into(const char *out, const char *in, iconv_allocation_t *ptr) +__bsd_iconv_open_into(const char *out, const char *in, iconv_allocation_t *ptr) { struct _citrus_iconv *handle; handle = (struct _citrus_iconv *)ptr; - return ((_iconv_open(out, in, handle) == (iconv_t)-1) ? -1 : 0); + return ((__bsd___iconv_open(out, in, handle) == (iconv_t)-1) ? -1 : 0); } int -iconv_close(iconv_t handle) +__bsd_iconv_close(iconv_t handle) { if (ISBADF(handle)) { @@ -122,7 +119,7 @@ iconv_close(iconv_t handle) } size_t -iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) +__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) { size_t ret; int err; @@ -143,7 +140,7 @@ iconv(iconv_t handle, const char **in, s } size_t -__iconv(iconv_t handle, const char **in, size_t *szin, char **out, +__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout, uint32_t flags, size_t *invalids) { size_t ret; @@ -167,7 +164,7 @@ __iconv(iconv_t handle, const char **in, } int -__iconv_get_list(char ***rlist, size_t *rsz, bool sorted) +__bsd___iconv_get_list(char ***rlist, size_t *rsz, bool sorted) { int ret; @@ -181,7 +178,7 @@ __iconv_get_list(char ***rlist, size_t * } void -__iconv_free_list(char **list, size_t sz) +__bsd___iconv_free_list(char **list, size_t sz) { _citrus_esdb_free_list(list, sz); @@ -202,7 +199,7 @@ qsort_helper(const void *first, const vo } void -iconvlist(int (*do_one) (unsigned int, const char * const *, +__bsd_iconvlist(int (*do_one) (unsigned int, const char * const *, void *), void *data) { char **list, **names; @@ -213,7 +210,7 @@ iconvlist(int (*do_one) (unsigned int, c i = 0; - if (__iconv_get_list(&list, &sz, true)) + if (__bsd___iconv_get_list(&list, &sz, true)) list = NULL; qsort((void *)list, sz, sizeof(char *), qsort_helper); while (i < sz) { @@ -222,7 +219,7 @@ iconvlist(int (*do_one) (unsigned int, c curkey = (char *)malloc(slashpos - list[i] + 2); names = (char **)malloc(sz * sizeof(char *)); if ((curkey == NULL) || (names == NULL)) { - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); return; } strlcpy(curkey, list[i], slashpos - list[i] + 1); @@ -231,7 +228,7 @@ iconvlist(int (*do_one) (unsigned int, c slashpos = strchr(list[i], '/'); curitem = (char *)malloc(strlen(slashpos) + 1); if (curitem == NULL) { - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); return; } strlcpy(curitem, &slashpos[1], strlen(slashpos) + 1); @@ -245,18 +242,18 @@ iconvlist(int (*do_one) (unsigned int, c free(names); } - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); } -__inline const char -*iconv_canonicalize(const char *name) +__inline const char * +__bsd_iconv_canonicalize(const char *name) { return (_citrus_iconv_canonicalize(name)); } int -iconvctl(iconv_t cd, int request, void *argument) +__bsd_iconvctl(iconv_t cd, int request, void *argument) { struct _citrus_iconv *cv; struct iconv_hooks *hooks; @@ -308,7 +305,7 @@ iconvctl(iconv_t cd, int request, void * } void -iconv_set_relocation_prefix(const char *orig_prefix __unused, +__bsd_iconv_set_relocation_prefix(const char *orig_prefix __unused, const char *curr_prefix __unused) { Added: head/lib/libc/iconv/iconv_compat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/iconv/iconv_compat.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +/* + * These are ABI implementations for when the raw iconv_* symbol + * space was exposed via libc.so.7 in its early life. This is + * a transition aide, these wrappers will not normally ever be + * executed except via __sym_compat() references. + */ +#include +#include +#include "iconv-internal.h" + +size_t +__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d, + size_t * e, __uint32_t f, size_t *g) +{ + return __bsd___iconv(a, b, c, d, e, f, g); +} + +void +__iconv_free_list_compat(char ** a, size_t b) +{ + __bsd___iconv_free_list(a, b); +} + +int +__iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c) +{ + return __bsd___iconv_get_list(a, b, c); +} + +size_t +iconv_compat(iconv_t a, const char ** __restrict b, + size_t * __restrict c, char ** __restrict d, + size_t * __restrict e) +{ + return __bsd_iconv(a, b, c, d, e); +} + +const char * +iconv_canonicalize_compat(const char *a) +{ + return __bsd_iconv_canonicalize(a); +} + +int +iconv_close_compat(iconv_t a) +{ + return __bsd_iconv_close(a); +} + +iconv_t +iconv_open_compat(const char *a, const char *b) +{ + return __bsd_iconv_open(a, b); +} + +int +iconv_open_into_compat(const char *a, const char *b, iconv_allocation_t *c) +{ + return __bsd_iconv_open_into(a, b, c); +} + +void +iconv_set_relocation_prefix_compat(const char *a, const char *b) +{ + return __bsd_iconv_set_relocation_prefix(a, b); +} + +int +iconvctl_compat(iconv_t a, int b, void *c) +{ + return __bsd_iconvctl(a, b, c); +} + +void +iconvlist_compat(int (*a) (unsigned int, const char * const *, void *), void *b) +{ + return __bsd_iconvlist(a, b); +} + +int _iconv_version_compat = 0x0108; /* Magic - not used */ + +__sym_compat(__iconv, __iconv_compat, FBSD_1.2); +__sym_compat(__iconv_free_list, __iconv_free_list_compat, FBSD_1.2); +__sym_compat(__iconv_get_list, __iconv_get_list_compat, FBSD_1.2); +__sym_compat(_iconv_version, _iconv_version_compat, FBSD_1.3); +__sym_compat(iconv, iconv_compat, FBSD_1.3); +__sym_compat(iconv_canonicalize, iconv_canonicalize_compat, FBSD_1.2); +__sym_compat(iconv_close, iconv_close_compat, FBSD_1.3); +__sym_compat(iconv_open, iconv_open_compat, FBSD_1.3); +__sym_compat(iconv_open_into, iconv_open_into_compat, FBSD_1.3); +__sym_compat(iconv_set_relocation_prefix, iconv_set_relocation_prefix_compat, FBSD_1.3); +__sym_compat(iconvctl, iconvctl_compat, FBSD_1.3); +__sym_compat(iconvlist, iconvlist_compat, FBSD_1.3); Modified: head/lib/libc/libc.ldscript ============================================================================== --- head/lib/libc/libc.ldscript Sun Nov 17 22:44:52 2013 (r258282) +++ head/lib/libc/libc.ldscript Sun Nov 17 22:52:17 2013 (r258283) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -GROUP ( @@SHLIB@@ @@LIBDIR@@/libssp_nonshared.a ) +GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a @@LIBDIR@@/libssp_nonshared.a ) Added: head/lib/libc_nonshared/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/Makefile Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +# We're actually creating a libc_noshared.a that is PIC along side libc.so.* +# It is used exclusively with libc.so.* - there is no need for any other +# compile modes. +# bsd.lib.mk doesn't have an easy way to express that. +NO_PROFILE?= +.include +NO_PIC= +# -fpic on some platforms, -fPIC on others. +CFLAGS+=${PICFLAG} -DPIC -fvisibility=hidden + +LIB= c_nonshared + +# So that an empty .a file doesn't cause errors. +SRCS= __stub.c + +.if ${MK_ICONV} == "yes" +SRCS+= __iconv.c __iconv_free_list.c __iconv_get_list.c \ + iconv.c iconv_canonicalize.c iconv_close.c \ + iconv_open.c iconv_open_into.c \ + iconv_set_relocation_prefix.c iconvctl.c iconvlist.c +CFLAGS+=-I${.CURDIR}/../libc/iconv +.endif + +.include + Added: head/lib/libc_nonshared/__iconv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/__iconv.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +size_t +__iconv(iconv_t a, const char **b, size_t *c, char **d, + size_t *e, __uint32_t f, size_t *g) +{ + return __bsd___iconv(a, b, c, d, e, f, g); +} Added: head/lib/libc_nonshared/__iconv_free_list.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/__iconv_free_list.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +void +__iconv_free_list(char **a, size_t b) +{ + __bsd___iconv_free_list(a, b); +} Added: head/lib/libc_nonshared/__iconv_get_list.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/__iconv_get_list.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +int +__iconv_get_list(char ***a, size_t *b, __iconv_bool c) +{ + return __bsd___iconv_get_list(a, b, c); +} Added: head/lib/libc_nonshared/__stub.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/__stub.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,31 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +extern int __stub_N8TwezWFyocUB; + +int __stub_N8TwezWFyocUB; /* 42 */ Added: head/lib/libc_nonshared/iconv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +size_t +iconv(iconv_t a, const char ** __restrict b, + size_t * __restrict c, char ** __restrict d, + size_t * __restrict e) +{ + return __bsd_iconv(a, b, c, d, e); +} Added: head/lib/libc_nonshared/iconv_canonicalize.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv_canonicalize.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +const char * +iconv_canonicalize(const char *a) +{ + return __bsd_iconv_canonicalize(a); +} Added: head/lib/libc_nonshared/iconv_close.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv_close.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +int +iconv_close(iconv_t a) +{ + return __bsd_iconv_close(a); +} Added: head/lib/libc_nonshared/iconv_open.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv_open.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +iconv_t +iconv_open(const char *a, const char *b) +{ + return __bsd_iconv_open(a, b); +} Added: head/lib/libc_nonshared/iconv_open_into.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv_open_into.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +int +iconv_open_into(const char *a, const char *b, iconv_allocation_t *c) +{ + return __bsd_iconv_open_into(a, b, c); +} Added: head/lib/libc_nonshared/iconv_set_relocation_prefix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconv_set_relocation_prefix.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +void +iconv_set_relocation_prefix(const char *a, const char *b) +{ + return __bsd_iconv_set_relocation_prefix(a, b); +} Added: head/lib/libc_nonshared/iconvctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconvctl.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +int +iconvctl(iconv_t a, int b, void *c) +{ + return __bsd_iconvctl(a, b, c); +} Added: head/lib/libc_nonshared/iconvlist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc_nonshared/iconvlist.c Sun Nov 17 22:52:17 2013 (r258283) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +#include +#include +#include "iconv-internal.h" + +void +iconvlist(int (*a) (unsigned int, const char * const *, void *), void *b) +{ + return __bsd_iconvlist(a, b); +} From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 22:59: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE0109B4; Sun, 17 Nov 2013 22:59:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD0B2AC5; Sun, 17 Nov 2013 22:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHMx66Z003155; Sun, 17 Nov 2013 22:59:06 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHMx6V7003154; Sun, 17 Nov 2013 22:59:06 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311172259.rAHMx6V7003154@svn.freebsd.org> From: Peter Wemm Date: Sun, 17 Nov 2013 22:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258284 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 22:59:06 -0000 Author: peter Date: Sun Nov 17 22:59:06 2013 New Revision: 258284 URL: http://svnweb.freebsd.org/changeset/base/258284 Log: Bump __FreeBSD_version for iconv changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Nov 17 22:52:17 2013 (r258283) +++ head/sys/sys/param.h Sun Nov 17 22:59:06 2013 (r258284) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100002 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100003 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 23:12:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBEFFBC; Sun, 17 Nov 2013 23:12:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E46F72BC8; Sun, 17 Nov 2013 23:12:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHNCt1W010189; Sun, 17 Nov 2013 23:12:55 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHNCtOY010186; Sun, 17 Nov 2013 23:12:55 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311172312.rAHNCtOY010186@svn.freebsd.org> From: Julio Merino Date: Sun, 17 Nov 2013 23:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258285 - in head/lib/atf: libatf-c++/tests libatf-c/tests tests/test-programs 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 23:12:56 -0000 Author: jmmv Date: Sun Nov 17 23:12:55 2013 New Revision: 258285 URL: http://svnweb.freebsd.org/changeset/base/258285 Log: Fix the build of some ATF tests. When building various programs from a single Makefile, program-specific variables are of the form ., not _. Fix this obvious typo to fix the build when WITH_TESTS=yes. I am not sure how this ever worked before given that manual inspection of bsd.progs.mk clearly shows that the expected character between the two components is a dot and not an underscore... but I suspect the changes in r258095 exposed this oddity. Approved by: rpaulo (mentor) Modified: head/lib/atf/libatf-c++/tests/Makefile head/lib/atf/libatf-c/tests/Makefile head/lib/atf/tests/test-programs/Makefile Modified: head/lib/atf/libatf-c++/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c++/tests/Makefile Sun Nov 17 22:59:06 2013 (r258284) +++ head/lib/atf/libatf-c++/tests/Makefile Sun Nov 17 23:12:55 2013 (r258285) @@ -23,7 +23,7 @@ FILES+= unused_test.cpp tests_test \ utils_test ATF_TESTS_CXX+= ${_T} -SRCS_${_T}= ${_T}.cpp test_helpers.cpp +SRCS.${_T}= ${_T}.cpp test_helpers.cpp .endfor ATF_TESTS_SH= pkg_config_test @@ -41,7 +41,7 @@ ATF_TESTS_SH= pkg_config_test text_test \ ui_test ATF_TESTS_CXX+= ${_T} -SRCS_${_T}= ${_T}.cpp test_helpers.cpp +SRCS.${_T}= ${_T}.cpp test_helpers.cpp .endfor .include Modified: head/lib/atf/libatf-c/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/Makefile Sun Nov 17 22:59:06 2013 (r258284) +++ head/lib/atf/libatf-c/tests/Makefile Sun Nov 17 23:12:55 2013 (r258285) @@ -33,7 +33,7 @@ FILES+= unused_test.c tp_test \ utils_test ATF_TESTS_C+= ${_T} -SRCS_${_T}= ${_T}.c test_helpers.c +SRCS.${_T}= ${_T}.c test_helpers.c .endfor ATF_TESTS_SH= pkg_config_test @@ -51,12 +51,12 @@ ATF_TESTS_SH= pkg_config_test text_test \ user_test ATF_TESTS_C+= ${_T} -SRCS_${_T}= ${_T}.c test_helpers.c +SRCS.${_T}= ${_T}.c test_helpers.c .endfor PROGS+= process_helpers -SRCS_process_helpers= process_helpers.c -MAN_process_helpers= # defined -BINDIR_process_helpers= ${TESTSDIR} +SRCS.process_helpers= process_helpers.c +MAN.process_helpers= # defined +BINDIR.process_helpers= ${TESTSDIR} .include Modified: head/lib/atf/tests/test-programs/Makefile ============================================================================== --- head/lib/atf/tests/test-programs/Makefile Sun Nov 17 22:59:06 2013 (r258284) +++ head/lib/atf/tests/test-programs/Makefile Sun Nov 17 23:12:55 2013 (r258285) @@ -13,7 +13,7 @@ CFLAGS+= -I${ATF} ATF_TESTS_C= c_helpers ATF_TESTS_CXX= cpp_helpers -SRCS_cpp_helpers= cpp_helpers.cpp +SRCS.cpp_helpers= cpp_helpers.cpp ATF_TESTS_SH= sh_helpers .for _T in config_test expect_test fork_test meta_data_test result_test srcdir_test From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 23:19: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 132F81E7; Sun, 17 Nov 2013 23:19:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02A3A2BFE; Sun, 17 Nov 2013 23:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHNJ6pd011098; Sun, 17 Nov 2013 23:19:06 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHNJ6AU011096; Sun, 17 Nov 2013 23:19:06 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311172319.rAHNJ6AU011096@svn.freebsd.org> From: Julio Merino Date: Sun, 17 Nov 2013 23:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258286 - head/contrib/atf 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 23:19:07 -0000 Author: jmmv Date: Sun Nov 17 23:19:06 2013 New Revision: 258286 URL: http://svnweb.freebsd.org/changeset/base/258286 Log: Update notes for imports of atf. This is because the atf vendor branch now includes a verbatim copy of the distfile sources. As a result, the list of files to-be-removed from the contrib/ directory is now more aggressive (and different) and the upgrade notes now only describe stuff that is specific to the atf import and is not documented in the Subversion Primer. Approved by: rpaulo (mentor) Modified: head/contrib/atf/FREEBSD-Xlist head/contrib/atf/FREEBSD-upgrade Modified: head/contrib/atf/FREEBSD-Xlist ============================================================================== --- head/contrib/atf/FREEBSD-Xlist Sun Nov 17 23:12:55 2013 (r258285) +++ head/contrib/atf/FREEBSD-Xlist Sun Nov 17 23:19:06 2013 (r258286) @@ -1,8 +1,12 @@ +*/*/Makefile* +*/Makefile* +INSTALL +Makefile* +aclocal.m4 +admin/ +atf-*/atf-*.m4 +atf-*/atf-*.pc.in +bconfig.h.in bootstrap/ -config.log -config.status -libtool -Makefile -stamp-h1 -*/*/.deps/ -*/.deps/ +configure* +m4/ Modified: head/contrib/atf/FREEBSD-upgrade ============================================================================== --- head/contrib/atf/FREEBSD-upgrade Sun Nov 17 23:12:55 2013 (r258285) +++ head/contrib/atf/FREEBSD-upgrade Sun Nov 17 23:19:06 2013 (r258286) @@ -1,28 +1,48 @@ $FreeBSD$ -atf +This document contains a collection of notes specific to the import +of atf into head. These notes are built on the instructions in +the FreeBSD Subversion Primer that detail how to deal with vendor +branches and you are supposed to follow those: -The source code is hosted on GoogleCode as a subcomponent of the Kyua project: + http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html - http://code.google.com/p/kyua/downloads/list - -For the contrib directory, the sources were initially prepared like so: - - ./configure --prefix=/ --exec-prefix=/usr --datarootdir=/usr/share +The ATF source code is hosted on Google Code as a subcomponent of the +Kyua project: -For the contrib directory, files and directories were pruned by: - -sh -c 'for F in `cat FREEBSD-Xlist`; do rm -rf ./$F ; done' + http://code.google.com/p/kyua/downloads/list -You may check if there are any new files that we don't need. +and is imported into the atf vendor branch (see base/vendor/atf/). -The instructions for importing new release and merging to HEAD can be found -at FreeBSD wiki: +To merge the vendor branch into head do something like this: - http://wiki.freebsd.org/SubversionPrimer/VendorImports + cd .../base/head/contrib/atf + svn merge --accept=postpone \ + svn+ssh://svn.freebsd.org/base/vendor/atf/dist . + svn remove --force $(cat FREEBSD-Xlist) + +and resolve any conflicts that may arise at this point. + +Once this is done, you must regenerate bconfig.h. The recommended way +of doing so is by using the release files already imported into the +vendor branch (which is a good justification for importing the verbatim +sources in the first place so that this step is reproducible). You can +use a set of commands similar to the following: + + mkdir /tmp/atf + cd /tmp/atf + .../vendor/atf/dist/configure \ + --prefix=/ \ + --exec-prefix=/usr \ + --datarootdir=/usr/share + cp bconfig.h .../base/head/contrib/atf/ + +Please do NOT run './configure' straight from the 'dist' directory of +the vendor branch as you easily risk committing build products into the +tree. -To make local changes to atf, simply patch and commit to the trunk -branch (aka HEAD). Never make local changes on the vendor branch. +Lastly, with the list of old and new files in this import, make sure +to udpate the reachover Makefiles accordingly. -gcooper@FreeBSD.org -5-August-2012 +Test the build (keeping in mind the WITH_TESTS/WITHOUT_TESTS knobs) and, +if all looks good, you are ready to commit all the changes in one go. From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 23:28:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE43272C; Sun, 17 Nov 2013 23:28:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DAE62C72; Sun, 17 Nov 2013 23:28:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHNSAfC014598; Sun, 17 Nov 2013 23:28:10 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHNSA6s014597; Sun, 17 Nov 2013 23:28:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201311172328.rAHNSA6s014597@svn.freebsd.org> From: Alan Cox Date: Sun, 17 Nov 2013 23:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258287 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 23:28:10 -0000 Author: alc Date: Sun Nov 17 23:28:10 2013 New Revision: 258287 URL: http://svnweb.freebsd.org/changeset/base/258287 Log: Implement pmap_align_superpage(). MFC after: 6 weeks Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Nov 17 23:19:06 2013 (r258286) +++ head/sys/arm/arm/pmap-v6.c Sun Nov 17 23:28:10 2013 (r258287) @@ -5021,6 +5021,20 @@ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + vm_offset_t superpage_offset; + + if (size < NBPDR) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & PDRMASK; + if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR || + (*addr & PDRMASK) == superpage_offset) + return; + if ((*addr & PDRMASK) < superpage_offset) + *addr = (*addr & ~PDRMASK) + superpage_offset; + else + *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 17 23:51: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FAABC48; Sun, 17 Nov 2013 23:51:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BBE02DAD; Sun, 17 Nov 2013 23:51:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHNpLVo023437; Sun, 17 Nov 2013 23:51:21 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHNpJsF023426; Sun, 17 Nov 2013 23:51:19 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311172351.rAHNpJsF023426@svn.freebsd.org> From: Julio Merino Date: Sun, 17 Nov 2013 23:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258289 - in head: contrib/atf contrib/atf/admin contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-c++/detail contrib/atf/atf-c/detail contrib/atf/atf-config contrib/atf/atf-report ... 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.16 Precedence: list List-Id: "SVN commit messages 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, 17 Nov 2013 23:51:21 -0000 Author: jmmv Date: Sun Nov 17 23:51:19 2013 New Revision: 258289 URL: http://svnweb.freebsd.org/changeset/base/258289 Log: MFV: Import atf-0.18. Approved by: rpaulo (mentor) Added: head/contrib/atf/atf-c++/detail/auto_array.hpp - copied unchanged from r258239, vendor/atf/dist/atf-c++/detail/auto_array.hpp head/contrib/atf/atf-c++/detail/auto_array_test.cpp - copied unchanged from r258239, vendor/atf/dist/atf-c++/detail/auto_array_test.cpp head/contrib/atf/atf-c++/noncopyable.hpp - copied unchanged from r258239, vendor/atf/dist/atf-c++/noncopyable.hpp head/contrib/atf/atf-c++/utils.cpp - copied unchanged from r258239, vendor/atf/dist/atf-c++/utils.cpp Deleted: head/contrib/atf/Makefile.am head/contrib/atf/Makefile.in head/contrib/atf/admin/ head/contrib/atf/atf-c++/Makefile.am.inc head/contrib/atf/atf-c++/detail/Makefile.am.inc head/contrib/atf/atf-c/Makefile.am.inc head/contrib/atf/atf-c/detail/Makefile.am.inc head/contrib/atf/atf-c/detail/test_helpers_test.c head/contrib/atf/atf-config/Makefile.am.inc head/contrib/atf/atf-report/Makefile.am.inc head/contrib/atf/atf-run/Makefile.am.inc head/contrib/atf/atf-sh/Makefile.am.inc head/contrib/atf/atf-version/Makefile.am.inc head/contrib/atf/bconfig.h.in head/contrib/atf/configure head/contrib/atf/configure.ac head/contrib/atf/doc/Makefile.am.inc head/contrib/atf/test-programs/Makefile.am.inc head/contrib/atf/test-programs/fork_test.sh Modified: head/contrib/atf/NEWS head/contrib/atf/atf-c++.hpp head/contrib/atf/atf-c++/atf-c++-api.3 head/contrib/atf/atf-c++/check.hpp head/contrib/atf/atf-c++/check_test.cpp head/contrib/atf/atf-c++/detail/Atffile head/contrib/atf/atf-c++/detail/Kyuafile head/contrib/atf/atf-c++/detail/parser.hpp head/contrib/atf/atf-c++/detail/process.cpp head/contrib/atf/atf-c++/detail/process.hpp head/contrib/atf/atf-c++/detail/test_helpers.cpp head/contrib/atf/atf-c++/detail/test_helpers.hpp head/contrib/atf/atf-c++/macros_test.cpp head/contrib/atf/atf-c++/pkg_config_test.sh head/contrib/atf/atf-c++/tests.cpp head/contrib/atf/atf-c++/tests.hpp head/contrib/atf/atf-c++/utils.hpp head/contrib/atf/atf-c++/utils_test.cpp head/contrib/atf/atf-c.h head/contrib/atf/atf-c/atf-c-api.3 head/contrib/atf/atf-c/check_test.c head/contrib/atf/atf-c/detail/Atffile head/contrib/atf/atf-c/detail/Kyuafile head/contrib/atf/atf-c/detail/process_test.c head/contrib/atf/atf-c/detail/sanity_test.c head/contrib/atf/atf-c/detail/test_helpers.c head/contrib/atf/atf-c/detail/test_helpers.h head/contrib/atf/atf-c/macros.h head/contrib/atf/atf-c/macros_test.c head/contrib/atf/atf-c/pkg_config_test.sh head/contrib/atf/atf-c/utils.c head/contrib/atf/atf-c/utils.h head/contrib/atf/atf-c/utils_test.c head/contrib/atf/atf-report/atf-report.cpp head/contrib/atf/atf-run/fs.cpp head/contrib/atf/atf-run/io.cpp head/contrib/atf/atf-run/io.hpp head/contrib/atf/atf-run/requirements.cpp head/contrib/atf/atf-run/timer.hpp head/contrib/atf/atf-sh/atf-check.cpp head/contrib/atf/atf-sh/atf-check_test.sh head/contrib/atf/atf-sh/atf-sh-api.3 head/contrib/atf/atf-sh/atf-sh.1 head/contrib/atf/atf-sh/atf_check_test.sh head/contrib/atf/atf-sh/misc_helpers.sh head/contrib/atf/bconfig.h head/contrib/atf/doc/atf.7.in head/contrib/atf/test-programs/Atffile head/contrib/atf/test-programs/Kyuafile head/contrib/atf/test-programs/c_helpers.c head/contrib/atf/test-programs/cpp_helpers.cpp head/contrib/atf/test-programs/sh_helpers.sh head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/tests/Makefile head/lib/atf/tests/test-programs/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/atf/ (props changed) Modified: head/contrib/atf/NEWS ============================================================================== --- head/contrib/atf/NEWS Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/NEWS Sun Nov 17 23:51:19 2013 (r258289) @@ -2,6 +2,58 @@ Major changes between releases =========================================================================== +Changes in version 0.18 +*********************** + +Experimental version released on November 16th, 2013. + +* Issue 45: Added require.memory support in atf-run for FreeBSD. + +* Fixed an issue with the handling of cin with libc++. + +* Issue 64: Fixed various mandoc formatting warnings. + +* NetBSD PR bin/48284: Made atf-check flush its progress message to + stdout so that an interrupted test case always shows the last message + being executed. + +* NetBSD PR bin/48285: Fixed atf_check examples in atf-sh-api(3). + + +Changes in version 0.17 +*********************** + +Experimental version released on February 14th, 2013. + +* Added the atf_utils_cat_file, atf_utils_compare_file, + atf_utils_copy_file, atf_utils_create_file, atf_utils_file_exists, + atf_utils_fork, atf_utils_grep_file, atf_utils_grep_string, + atf_utils_readline, atf_utils_redirect and atf_utils_wait utility + functions to atf-c-api. Documented the already-public + atf_utils_free_charpp function. + +* Added the cat_file, compare_file, copy_file, create_file, file_exists, + fork, grep_collection, grep_file, grep_string, redirect and wait + functions to the atf::utils namespace of atf-c++-api. These are + wrappers around the same functions added to the atf-c-api library. + +* Added the ATF_CHECK_MATCH, ATF_CHECK_MATCH_MSG, ATF_REQUIRE_MATCH and + ATF_REQUIRE_MATCH_MSG macros to atf-c to simplify the validation of a + string against a regular expression. + +* Miscellaneous fixes for manpage typos and compilation problems with + clang. + +* Added caching of the results of those configure tests that rely on + executing a test program. This should help crossbuild systems by + providing a mechanism to pre-specify what the results should be. + +* PR bin/45690: Make atf-report convert any non-printable characters to + a plain-text representation (matching their corresponding hexadecimal + entities) in XML output files. This is to prevent the output of test + cases from breaking xsltproc later. + + Changes in version 0.16 *********************** Modified: head/contrib/atf/atf-c++.hpp ============================================================================== --- head/contrib/atf/atf-c++.hpp Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++.hpp Sun Nov 17 23:51:19 2013 (r258289) @@ -31,5 +31,6 @@ #define _ATF_CXX_HPP_ #include +#include #endif // !defined(_ATF_CXX_HPP_) Modified: head/contrib/atf/atf-c++/atf-c++-api.3 ============================================================================== --- head/contrib/atf/atf-c++/atf-c++-api.3 Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/atf-c++-api.3 Sun Nov 17 23:51:19 2013 (r258289) @@ -26,10 +26,11 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 21, 2012 +.Dd November 15, 2013 .Dt ATF-C++-API 3 .Os .Sh NAME +.Nm atf-c++-api , .Nm ATF_ADD_TEST_CASE , .Nm ATF_CHECK_ERRNO , .Nm ATF_FAIL , @@ -52,6 +53,17 @@ .Nm ATF_TEST_CASE_USE , .Nm ATF_TEST_CASE_WITH_CLEANUP , .Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nm atf::utils::cat_file , +.Nm atf::utils::compare_file , +.Nm atf::utils::copy_file , +.Nm atf::utils::create_file , +.Nm atf::utils::file_exists , +.Nm atf::utils::fork , +.Nm atf::utils::grep_collection , +.Nm atf::utils::grep_file , +.Nm atf::utils::grep_string , +.Nm atf::utils::redirect , +.Nm atf::utils::wait .Nd C++ API to write ATF-based test programs .Sh SYNOPSIS .In atf-c++.hpp @@ -77,18 +89,64 @@ .Fn ATF_TEST_CASE_USE "name" .Fn ATF_TEST_CASE_WITH_CLEANUP "name" .Fn ATF_TEST_CASE_WITHOUT_HEAD "name" +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc .Sh DESCRIPTION -ATF provides a mostly-macro-based programming interface to implement test -programs in C or C++. -This interface is backed by a C++ implementation, but this fact is -hidden from the developer as much as possible through the use of -macros to simplify programming. -However, the use of C++ is not hidden everywhere and while you can -implement test cases without knowing anything at all about the object model -underneath the provided calls, you might need some minimum notions of the -language in very specific circumstances. -.Pp -C++-based test programs always follow this template: +ATF provides a C++ programming interface to implement test programs. +C++-based test programs follow this template: .Bd -literal -offset indent extern "C" { .Ns ... C-specific includes go here ... @@ -205,7 +263,7 @@ The first parameter of this macro matche former call. .Ss Header definitions The test case's header can define the meta-data by using the -.Fn set +.Fn set_md_var method, which takes two parameters: the first one specifies the meta-data variable to be set and the second one specifies its value. Both of them are strings. @@ -348,7 +406,7 @@ in the collection. .Fn ATF_REQUIRE_THROW takes the name of an exception and a statement and raises a failure if the statement does not throw the specified exception. -.Fn ATF_REQUIRE_THROW_EQ +.Fn ATF_REQUIRE_THROW_RE takes the name of an exception, a regular expresion and a statement and raises a failure if the statement does not throw the specified exception and if the message of the exception does not match the regular expression. @@ -362,6 +420,163 @@ variable and, second, a boolean expressi means that a call failed and .Va errno has to be checked against the first value. +.Ss Utility functions +The following functions are provided as part of the +.Nm +API to simplify the creation of a variety of tests. +In particular, these are useful to write tests for command-line interfaces. +.Pp +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Bd -ragged -offset indent +Prints the contents of +.Fa path +to the standard output, prefixing every line with the string in +.Fa prefix . +.Ed +.Pp +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Returns true if the given +.Fa path +matches exactly the expected inlined +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Bd -ragged -offset indent +Copies the file +.Fa source +to +.Fa destination . +The permissions of the file are preserved during the code. +.Ed +.Pp +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Creates +.Fa file +with the text given in +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Checks if +.Fa path +exists. +.Ed +.Pp +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Bd -ragged -offset indent +Forks a process and redirects the standard output and standard error of the +child to files for later validation with +.Fn atf::utils::wait . +Fails the test case if the fork fails, so this does not return an error. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in any of the strings contained in the +.Fa collection . +This is a template that accepts any one-dimensional container of strings. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the file +.Fa path . +The variable arguments are used to construct the regular expression. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& str" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the string +.Fa str . +.Ed +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Redirects the given file descriptor +.Fa fd +to the file +.Fa path . +This function exits the process in case of an error and does not properly mark +the test case as failed. +As a result, it should only be used in subprocesses of the test case; specially +those spawned by +.Fn atf::utils::fork . +.Ed +.Pp +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc +.Bd -ragged -offset indent +Waits and validates the result of a subprocess spawned with +.Fn atf::utils::wait . +The validation involves checking that the subprocess exited cleanly and returned +the code specified in +.Fa expected_exit_status +and that its standard output and standard error match the strings given in +.Fa expected_stdout +and +.Fa expected_stderr . +.Pp +If any of the +.Fa expected_stdout +or +.Fa expected_stderr +strings are prefixed with +.Sq save: , +then they specify the name of the file into which to store the stdout or stderr +of the subprocess, and no comparison is performed. +.Ed .Sh EXAMPLES The following shows a complete test program with a single test case that validates the addition operator: @@ -371,7 +586,7 @@ validates the addition operator: ATF_TEST_CASE(addition); ATF_TEST_CASE_HEAD(addition) { - set("descr", "Sample tests for the addition operator"); + set_md_var("descr", "Sample tests for the addition operator"); } ATF_TEST_CASE_BODY(addition) { @@ -387,7 +602,7 @@ ATF_TEST_CASE_BODY(addition) ATF_TEST_CASE(open_failure); ATF_TEST_CASE_HEAD(open_failure) { - set("descr", "Sample tests for the open function"); + set_md_var("descr", "Sample tests for the open function"); } ATF_TEST_CASE_BODY(open_failure) { @@ -397,7 +612,7 @@ ATF_TEST_CASE_BODY(open_failure) ATF_TEST_CASE(known_bug); ATF_TEST_CASE_HEAD(known_bug) { - set("descr", "Reproduces a known bug"); + set_md_var("descr", "Reproduces a known bug"); } ATF_TEST_CASE_BODY(known_bug) { Modified: head/contrib/atf/atf-c++/check.hpp ============================================================================== --- head/contrib/atf/atf-c++/check.hpp Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/check.hpp Sun Nov 17 23:51:19 2013 (r258289) @@ -39,7 +39,7 @@ extern "C" { #include #include -#include +#include namespace atf { @@ -60,7 +60,7 @@ namespace check { //! of executing arbitrary command and manages files containing //! its output. //! -class check_result : utils::noncopyable { +class check_result : noncopyable { //! //! \brief Internal representation of a result. //! Modified: head/contrib/atf/atf-c++/check_test.cpp ============================================================================== --- head/contrib/atf/atf-c++/check_test.cpp Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/check_test.cpp Sun Nov 17 23:51:19 2013 (r258289) @@ -193,15 +193,15 @@ ATF_TEST_CASE_BODY(build_c_o) { ATF_TEST_CASE_USE(h_build_c_o_ok); run_h_tc< ATF_TEST_CASE_NAME(h_build_c_o_ok) >(); - ATF_REQUIRE(grep_file("stdout", "-o test.o")); - ATF_REQUIRE(grep_file("stdout", "-c test.c")); + ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("-c test.c", "stdout")); ATF_TEST_CASE_USE(h_build_c_o_fail); run_h_tc< ATF_TEST_CASE_NAME(h_build_c_o_fail) >(); - ATF_REQUIRE(grep_file("stdout", "-o test.o")); - ATF_REQUIRE(grep_file("stdout", "-c test.c")); - ATF_REQUIRE(grep_file("stderr", "test.c")); - ATF_REQUIRE(grep_file("stderr", "UNDEFINED_SYMBOL")); + ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("-c test.c", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("test.c", "stderr")); + ATF_REQUIRE(atf::utils::grep_file("UNDEFINED_SYMBOL", "stderr")); } ATF_TEST_CASE(build_cpp); @@ -213,16 +213,16 @@ ATF_TEST_CASE_BODY(build_cpp) { ATF_TEST_CASE_USE(h_build_cpp_ok); run_h_tc< ATF_TEST_CASE_NAME(h_build_cpp_ok) >(); - ATF_REQUIRE(grep_file("stdout", "-o.*test.p")); - ATF_REQUIRE(grep_file("stdout", "test.c")); - ATF_REQUIRE(grep_file("test.p", "foo bar")); + ATF_REQUIRE(atf::utils::grep_file("-o.*test.p", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("test.c", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("foo bar", "test.p")); ATF_TEST_CASE_USE(h_build_cpp_fail); run_h_tc< ATF_TEST_CASE_NAME(h_build_cpp_fail) >(); - ATF_REQUIRE(grep_file("stdout", "-o test.p")); - ATF_REQUIRE(grep_file("stdout", "test.c")); - ATF_REQUIRE(grep_file("stderr", "test.c")); - ATF_REQUIRE(grep_file("stderr", "non-existent.h")); + ATF_REQUIRE(atf::utils::grep_file("-o test.p", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("test.c", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("test.c", "stderr")); + ATF_REQUIRE(atf::utils::grep_file("non-existent.h", "stderr")); } ATF_TEST_CASE(build_cxx_o); @@ -234,15 +234,15 @@ ATF_TEST_CASE_BODY(build_cxx_o) { ATF_TEST_CASE_USE(h_build_cxx_o_ok); run_h_tc< ATF_TEST_CASE_NAME(h_build_cxx_o_ok) >(); - ATF_REQUIRE(grep_file("stdout", "-o test.o")); - ATF_REQUIRE(grep_file("stdout", "-c test.cpp")); + ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("-c test.cpp", "stdout")); ATF_TEST_CASE_USE(h_build_cxx_o_fail); run_h_tc< ATF_TEST_CASE_NAME(h_build_cxx_o_fail) >(); - ATF_REQUIRE(grep_file("stdout", "-o test.o")); - ATF_REQUIRE(grep_file("stdout", "-c test.cpp")); - ATF_REQUIRE(grep_file("stderr", "test.cpp")); - ATF_REQUIRE(grep_file("stderr", "UNDEFINED_SYMBOL")); + ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("-c test.cpp", "stdout")); + ATF_REQUIRE(atf::utils::grep_file("test.cpp", "stderr")); + ATF_REQUIRE(atf::utils::grep_file("UNDEFINED_SYMBOL", "stderr")); } ATF_TEST_CASE(exec_cleanup); Modified: head/contrib/atf/atf-c++/detail/Atffile ============================================================================== --- head/contrib/atf/atf-c++/detail/Atffile Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/detail/Atffile Sun Nov 17 23:51:19 2013 (r258289) @@ -3,6 +3,7 @@ Content-Type: application/X-atf-atffile; prop: test-suite = atf tp: application_test +tp: auto_array_test tp: env_test tp: exceptions_test tp: expand_test Modified: head/contrib/atf/atf-c++/detail/Kyuafile ============================================================================== --- head/contrib/atf/atf-c++/detail/Kyuafile Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/detail/Kyuafile Sun Nov 17 23:51:19 2013 (r258289) @@ -3,6 +3,7 @@ syntax("kyuafile", 1) test_suite("atf") atf_test_program{name="application_test"} +atf_test_program{name="auto_array_test"} atf_test_program{name="env_test"} atf_test_program{name="exceptions_test"} atf_test_program{name="expand_test"} Copied: head/contrib/atf/atf-c++/detail/auto_array.hpp (from r258239, vendor/atf/dist/atf-c++/detail/auto_array.hpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c++/detail/auto_array.hpp Sun Nov 17 23:51:19 2013 (r258289, copy of r258239, vendor/atf/dist/atf-c++/detail/auto_array.hpp) @@ -0,0 +1,179 @@ +// +// Automated Testing Framework (atf) +// +// Copyright (c) 2007 The NetBSD Foundation, Inc. +// 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +// + +#if !defined(_ATF_CXX_AUTO_ARRAY_HPP_) +#define _ATF_CXX_AUTO_ARRAY_HPP_ + +#include + +namespace atf { + +// ------------------------------------------------------------------------ +// The "auto_array" class. +// ------------------------------------------------------------------------ + +template< class T > +struct auto_array_ref { + T* m_ptr; + + explicit auto_array_ref(T*); +}; + +template< class T > +auto_array_ref< T >::auto_array_ref(T* ptr) : + m_ptr(ptr) +{ +} + +template< class T > +class auto_array { + T* m_ptr; + +public: + auto_array(T* = NULL) throw(); + auto_array(auto_array< T >&) throw(); + auto_array(auto_array_ref< T >) throw(); + ~auto_array(void) throw(); + + T* get(void) throw(); + const T* get(void) const throw(); + T* release(void) throw(); + void reset(T* = NULL) throw(); + + auto_array< T >& operator=(auto_array< T >&) throw(); + auto_array< T >& operator=(auto_array_ref< T >) throw(); + + T& operator[](int) throw(); + operator auto_array_ref< T >(void) throw(); +}; + +template< class T > +auto_array< T >::auto_array(T* ptr) + throw() : + m_ptr(ptr) +{ +} + +template< class T > +auto_array< T >::auto_array(auto_array< T >& ptr) + throw() : + m_ptr(ptr.release()) +{ +} + +template< class T > +auto_array< T >::auto_array(auto_array_ref< T > ref) + throw() : + m_ptr(ref.m_ptr) +{ +} + +template< class T > +auto_array< T >::~auto_array(void) + throw() +{ + if (m_ptr != NULL) + delete [] m_ptr; +} + +template< class T > +T* +auto_array< T >::get(void) + throw() +{ + return m_ptr; +} + +template< class T > +const T* +auto_array< T >::get(void) + const throw() +{ + return m_ptr; +} + +template< class T > +T* +auto_array< T >::release(void) + throw() +{ + T* ptr = m_ptr; + m_ptr = NULL; + return ptr; +} + +template< class T > +void +auto_array< T >::reset(T* ptr) + throw() +{ + if (m_ptr != NULL) + delete [] m_ptr; + m_ptr = ptr; +} + +template< class T > +auto_array< T >& +auto_array< T >::operator=(auto_array< T >& ptr) + throw() +{ + reset(ptr.release()); + return *this; +} + +template< class T > +auto_array< T >& +auto_array< T >::operator=(auto_array_ref< T > ref) + throw() +{ + if (m_ptr != ref.m_ptr) { + delete [] m_ptr; + m_ptr = ref.m_ptr; + } + return *this; +} + +template< class T > +T& +auto_array< T >::operator[](int pos) + throw() +{ + return m_ptr[pos]; +} + +template< class T > +auto_array< T >::operator auto_array_ref< T >(void) + throw() +{ + return auto_array_ref< T >(release()); +} + +} // namespace atf + +#endif // !defined(_ATF_CXX_AUTO_ARRAY_HPP_) Copied: head/contrib/atf/atf-c++/detail/auto_array_test.cpp (from r258239, vendor/atf/dist/atf-c++/detail/auto_array_test.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c++/detail/auto_array_test.cpp Sun Nov 17 23:51:19 2013 (r258289, copy of r258239, vendor/atf/dist/atf-c++/detail/auto_array_test.cpp) @@ -0,0 +1,304 @@ +// +// Automated Testing Framework (atf) +// +// Copyright (c) 2007 The NetBSD Foundation, Inc. +// 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +// + +extern "C" { +#include +} + +#include + +#include "atf-c/defs.h" + +#include "../macros.hpp" + +#include "auto_array.hpp" + +// ------------------------------------------------------------------------ +// Tests for the "auto_array" class. +// ------------------------------------------------------------------------ + +class test_array { +public: + int m_value; + + static ssize_t m_nblocks; + + static + atf::auto_array< test_array > + do_copy(atf::auto_array< test_array >& ta) + { + return atf::auto_array< test_array >(ta); + } + + void* operator new(size_t size ATF_DEFS_ATTRIBUTE_UNUSED) + { + ATF_FAIL("New called but should have been new[]"); + return new int(5); + } + + void* operator new[](size_t size) + { + m_nblocks++; + void* mem = ::operator new(size); + std::cout << "Allocated 'test_array' object " << mem << "\n"; + return mem; + } + + void operator delete(void* mem ATF_DEFS_ATTRIBUTE_UNUSED) + { + ATF_FAIL("Delete called but should have been delete[]"); + } + + void operator delete[](void* mem) + { + std::cout << "Releasing 'test_array' object " << mem << "\n"; + if (m_nblocks == 0) + ATF_FAIL("Unbalanced delete[]"); + m_nblocks--; + ::operator delete(mem); + } +}; + +ssize_t test_array::m_nblocks = 0; + +ATF_TEST_CASE(auto_array_scope); +ATF_TEST_CASE_HEAD(auto_array_scope) +{ + set_md_var("descr", "Tests the automatic scope handling in the " + "auto_array smart pointer class"); +} +ATF_TEST_CASE_BODY(auto_array_scope) +{ + using atf::auto_array; + + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + { + auto_array< test_array > t(new test_array[10]); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_copy); +ATF_TEST_CASE_HEAD(auto_array_copy) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' copy " + "constructor"); +} +ATF_TEST_CASE_BODY(auto_array_copy) +{ + using atf::auto_array; + + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + { + auto_array< test_array > t1(new test_array[10]); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + + { + auto_array< test_array > t2(t1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_copy_ref); +ATF_TEST_CASE_HEAD(auto_array_copy_ref) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' copy " + "constructor through the auxiliary auto_array_ref object"); +} +ATF_TEST_CASE_BODY(auto_array_copy_ref) +{ + using atf::auto_array; + + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + { + auto_array< test_array > t1(new test_array[10]); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + + { + auto_array< test_array > t2 = test_array::do_copy(t1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_get); +ATF_TEST_CASE_HEAD(auto_array_get) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' get " + "method"); +} +ATF_TEST_CASE_BODY(auto_array_get) +{ + using atf::auto_array; + + test_array* ta = new test_array[10]; + auto_array< test_array > t(ta); + ATF_REQUIRE_EQ(t.get(), ta); +} + +ATF_TEST_CASE(auto_array_release); +ATF_TEST_CASE_HEAD(auto_array_release) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' release " + "method"); +} +ATF_TEST_CASE_BODY(auto_array_release) +{ + using atf::auto_array; + + test_array* ta1 = new test_array[10]; + { + auto_array< test_array > t(ta1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + test_array* ta2 = t.release(); + ATF_REQUIRE_EQ(ta2, ta1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + delete [] ta1; +} + +ATF_TEST_CASE(auto_array_reset); +ATF_TEST_CASE_HEAD(auto_array_reset) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' reset " + "method"); +} +ATF_TEST_CASE_BODY(auto_array_reset) +{ + using atf::auto_array; + + test_array* ta1 = new test_array[10]; + test_array* ta2 = new test_array[10]; + ATF_REQUIRE_EQ(test_array::m_nblocks, 2); + + { + auto_array< test_array > t(ta1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 2); + t.reset(ta2); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + t.reset(); + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_assign); +ATF_TEST_CASE_HEAD(auto_array_assign) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' " + "assignment operator"); +} +ATF_TEST_CASE_BODY(auto_array_assign) +{ + using atf::auto_array; + + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + { + auto_array< test_array > t1(new test_array[10]); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + + { + auto_array< test_array > t2; + t2 = t1; + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_assign_ref); +ATF_TEST_CASE_HEAD(auto_array_assign_ref) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' " + "assignment operator through the auxiliary auto_array_ref " + "object"); +} +ATF_TEST_CASE_BODY(auto_array_assign_ref) +{ + using atf::auto_array; + + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + { + auto_array< test_array > t1(new test_array[10]); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + + { + auto_array< test_array > t2; + t2 = test_array::do_copy(t1); + ATF_REQUIRE_EQ(test_array::m_nblocks, 1); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); + } + ATF_REQUIRE_EQ(test_array::m_nblocks, 0); +} + +ATF_TEST_CASE(auto_array_access); +ATF_TEST_CASE_HEAD(auto_array_access) +{ + set_md_var("descr", "Tests the auto_array smart pointer class' access " + "operator"); +} +ATF_TEST_CASE_BODY(auto_array_access) +{ + using atf::auto_array; + + auto_array< test_array > t(new test_array[10]); + + for (int i = 0; i < 10; i++) + t[i].m_value = i * 2; + + for (int i = 0; i < 10; i++) + ATF_REQUIRE_EQ(t[i].m_value, i * 2); +} + +// ------------------------------------------------------------------------ +// Main. +// ------------------------------------------------------------------------ + +ATF_INIT_TEST_CASES(tcs) +{ + // Add the test for the "auto_array" class. + ATF_ADD_TEST_CASE(tcs, auto_array_scope); + ATF_ADD_TEST_CASE(tcs, auto_array_copy); + ATF_ADD_TEST_CASE(tcs, auto_array_copy_ref); + ATF_ADD_TEST_CASE(tcs, auto_array_get); + ATF_ADD_TEST_CASE(tcs, auto_array_release); + ATF_ADD_TEST_CASE(tcs, auto_array_reset); + ATF_ADD_TEST_CASE(tcs, auto_array_assign); + ATF_ADD_TEST_CASE(tcs, auto_array_assign_ref); + ATF_ADD_TEST_CASE(tcs, auto_array_access); +} Modified: head/contrib/atf/atf-c++/detail/parser.hpp ============================================================================== --- head/contrib/atf/atf-c++/detail/parser.hpp Sun Nov 17 23:43:50 2013 (r258288) +++ head/contrib/atf/atf-c++/detail/parser.hpp Sun Nov 17 23:51:19 2013 (r258289) @@ -259,7 +259,7 @@ tokenizer< IS >::next(void) t = token(m_lineno, m_text_type, text); quoted = true; } else { - m_is.unget(); + m_is.putback(ch); done = true; } } else { @@ -271,13 +271,13 @@ tokenizer< IS >::next(void) t = token(m_lineno, (*idelim).second, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 01:28: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F02AB93; Mon, 18 Nov 2013 01:28:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0DF2389; Mon, 18 Nov 2013 01:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAI1SU2s055333; Mon, 18 Nov 2013 01:28:30 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAI1SU1i055332; Mon, 18 Nov 2013 01:28:30 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311180128.rAI1SU1i055332@svn.freebsd.org> From: Julio Merino Date: Mon, 18 Nov 2013 01:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258290 - in head/contrib/atf: . atf-c atf-c++ atf-c++/detail atf-c/detail atf-config atf-report atf-run atf-sh atf-version doc test-programs 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 01:28:30 -0000 Author: jmmv Date: Mon Nov 18 01:28:29 2013 New Revision: 258290 URL: http://svnweb.freebsd.org/changeset/base/258290 Log: Drop all ATF tools code. We stopped building the tools in r256365 so there is no need to ship their code any longer. Approved by: rpaulo (mentor) Deleted: head/contrib/atf/Atffile head/contrib/atf/atf-c++/Atffile head/contrib/atf/atf-c++/detail/Atffile head/contrib/atf/atf-c/Atffile head/contrib/atf/atf-c/detail/Atffile head/contrib/atf/atf-config/ head/contrib/atf/atf-report/ head/contrib/atf/atf-run/ head/contrib/atf/atf-sh/Atffile head/contrib/atf/atf-version/ head/contrib/atf/doc/atf-formats.5 head/contrib/atf/doc/atf.7.in head/contrib/atf/test-programs/Atffile Modified: head/contrib/atf/FREEBSD-Xlist Modified: head/contrib/atf/FREEBSD-Xlist ============================================================================== --- head/contrib/atf/FREEBSD-Xlist Sun Nov 17 23:51:19 2013 (r258289) +++ head/contrib/atf/FREEBSD-Xlist Mon Nov 18 01:28:29 2013 (r258290) @@ -1,12 +1,21 @@ +*/*/Atffile */*/Makefile* +*/Atffile */Makefile* +Atffile INSTALL Makefile* aclocal.m4 admin/ atf-*/atf-*.m4 atf-*/atf-*.pc.in +atf-config/ +atf-report/ +atf-run/ +atf-version/ bconfig.h.in bootstrap/ configure* +doc/atf-formats.5 +doc/atf.7.in m4/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 03:24: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0DF9B97; Mon, 18 Nov 2013 03:24:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 854A028E2; Mon, 18 Nov 2013 03:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAI3OpNZ095997; Mon, 18 Nov 2013 03:24:51 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAI3Op8i095995; Mon, 18 Nov 2013 03:24:51 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201311180324.rAI3Op8i095995@svn.freebsd.org> From: Mark Johnston Date: Mon, 18 Nov 2013 03:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258291 - in head/sys/cddl/contrib/opensolaris/uts/common: dtrace 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 03:24:51 -0000 Author: markj Date: Mon Nov 18 03:24:50 2013 New Revision: 258291 URL: http://svnweb.freebsd.org/changeset/base/258291 Log: The fasttrap ioctl used to create probes takes a variable-sized argument. It was not being correctly copied into the kernel on FreeBSD, and as a result, probes with multiple probe sites were not being created properly. To fix this, change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data. Submitted by: Prashanth Kumar MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Nov 18 01:28:29 2013 (r258290) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Nov 18 03:24:50 2013 (r258291) @@ -2064,20 +2064,16 @@ fasttrap_ioctl(struct cdev *dev, u_long return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2093,19 +2089,10 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Nov 18 01:28:29 2013 (r258290) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Nov 18 03:24:50 2013 (r258291) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type { From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 04:42:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 235194E4; Mon, 18 Nov 2013 04:42:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1201C2BD9; Mon, 18 Nov 2013 04:42:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAI4gxFR022129; Mon, 18 Nov 2013 04:42:59 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAI4gw4f022125; Mon, 18 Nov 2013 04:42:58 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201311180442.rAI4gw4f022125@svn.freebsd.org> From: Hiroki Sato Date: Mon, 18 Nov 2013 04:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258293 - in stable/10/share/i18n: csmapper/JIS esdb/EUC X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 04:42:59 -0000 Author: hrs Date: Mon Nov 18 04:42:58 2013 New Revision: 258293 URL: http://svnweb.freebsd.org/changeset/base/258293 Log: MFC 257636: Fix EUC ESDB and JIS CS-mapper. Approved by: re (delphij) Modified: stable/10/share/i18n/csmapper/JIS/JISX0201-KANA%UCS.src stable/10/share/i18n/csmapper/JIS/JISX0208@1990%UCS.src stable/10/share/i18n/csmapper/JIS/UCS%JISX0201-KANA.src stable/10/share/i18n/csmapper/JIS/UCS%JISX0208@1990.src stable/10/share/i18n/csmapper/JIS/charset.pivot.JIS.src stable/10/share/i18n/csmapper/JIS/mapper.dir.JIS.src stable/10/share/i18n/esdb/EUC/EUC-JP.src Directory Properties: stable/10/share/i18n/csmapper/JIS/ (props changed) stable/10/share/i18n/esdb/EUC/ (props changed) Modified: stable/10/share/i18n/csmapper/JIS/JISX0201-KANA%UCS.src ============================================================================== --- stable/10/share/i18n/csmapper/JIS/JISX0201-KANA%UCS.src Mon Nov 18 04:17:04 2013 (r258292) +++ stable/10/share/i18n/csmapper/JIS/JISX0201-KANA%UCS.src Mon Nov 18 04:42:58 2013 (r258293) @@ -3,7 +3,7 @@ TYPE ROWCOL NAME JISX0201-KANA/UCS -SRC_ZONE 0x00-0xDF +SRC_ZONE 0x21-0x5F OOB_MODE ILSEQ DST_ILSEQ 0xFFFE DST_UNIT_BITS 16 @@ -62,10 +62,67 @@ BEGIN_MAP # The entries are in JIS order # # -0x00 - 0x5B = 0x0000 - -0x5C = 0x00A5 -0x5D - 0x7D = 0x005D - -0x7E = 0x203E -0x7F = 0x007F -0xA1 - 0xDF = 0xFF61 - +0x21 = 0xFF61 +0x22 = 0xFF62 +0x23 = 0xFF63 +0x24 = 0xFF64 +0x25 = 0xFF65 +0x26 = 0xFF66 +0x27 = 0xFF67 +0x28 = 0xFF68 +0x29 = 0xFF69 +0x2A = 0xFF6A +0x2B = 0xFF6B +0x2C = 0xFF6C +0x2D = 0xFF6D +0x2E = 0xFF6E +0x2F = 0xFF6F +0x30 = 0xFF70 +0x31 = 0xFF71 +0x32 = 0xFF72 +0x33 = 0xFF73 +0x34 = 0xFF74 +0x35 = 0xFF75 +0x36 = 0xFF76 +0x37 = 0xFF77 +0x38 = 0xFF78 +0x39 = 0xFF79 +0x3A = 0xFF7A +0x3B = 0xFF7B +0x3C = 0xFF7C +0x3D = 0xFF7D +0x3E = 0xFF7E +0x3F = 0xFF7F +0x40 = 0xFF80 +0x41 = 0xFF81 +0x42 = 0xFF82 +0x43 = 0xFF83 +0x44 = 0xFF84 +0x45 = 0xFF85 +0x46 = 0xFF86 +0x47 = 0xFF87 +0x48 = 0xFF88 +0x49 = 0xFF89 +0x4A = 0xFF8A +0x4B = 0xFF8B +0x4C = 0xFF8C +0x4D = 0xFF8D +0x4E = 0xFF8E +0x4F = 0xFF8F +0x50 = 0xFF90 +0x51 = 0xFF91 +0x52 = 0xFF92 +0x53 = 0xFF93 +0x54 = 0xFF94 +0x55 = 0xFF95 +0x56 = 0xFF96 +0x57 = 0xFF97 +0x58 = 0xFF98 +0x59 = 0xFF99 +0x5A = 0xFF9A +0x5B = 0xFF9B +0x5C = 0xFF9C +0x5D = 0xFF9D +0x5E = 0xFF9E +0x5F = 0xFF9F END_MAP Modified: stable/10/share/i18n/csmapper/JIS/JISX0208@1990%UCS.src ============================================================================== --- stable/10/share/i18n/csmapper/JIS/JISX0208@1990%UCS.src Mon Nov 18 04:17:04 2013 (r258292) +++ stable/10/share/i18n/csmapper/JIS/JISX0208@1990%UCS.src Mon Nov 18 04:42:58 2013 (r258293) @@ -119,7 +119,7 @@ BEGIN_MAP 0x213A = 0x3006 0x213B = 0x3007 0x213C = 0x30FC -0x213D = 0x2015 +0x213D = 0x2014 0x213E = 0x2010 0x213F = 0xFF0F 0x2140 = 0xFF3C Modified: stable/10/share/i18n/csmapper/JIS/UCS%JISX0201-KANA.src ============================================================================== --- stable/10/share/i18n/csmapper/JIS/UCS%JISX0201-KANA.src Mon Nov 18 04:17:04 2013 (r258292) +++ stable/10/share/i18n/csmapper/JIS/UCS%JISX0201-KANA.src Mon Nov 18 04:42:58 2013 (r258293) @@ -3,10 +3,10 @@ TYPE ROWCOL NAME "UCS/JISX0201-KANA" -SRC_ZONE 0x0000 - 0xFFEC +SRC_ZONE 0xFF60 - 0xFF9F OOB_MODE INVALID DST_INVALID 0xFF -DST_UNIT_BITS 32 +DST_UNIT_BITS 8 BEGIN_MAP # @@ -62,1094 +62,67 @@ BEGIN_MAP # The entries are in JIS order # # - -0x0000 = 0x00 -0x0001 = 0x01 -0x0002 = 0x02 -0x0003 = 0x03 -0x0004 = 0x04 -0x0005 = 0x05 -0x0006 = 0x06 -0x0007 = 0x07 -0x0008 = 0x08 -0x0009 = 0x09 -0x000A = 0x0A -0x000B = 0x0B -0x000C = 0x0C -0x000D = 0x0D -0x000E = 0x0E -0x000F = 0x0F -0x0010 = 0x10 -0x0011 = 0x11 -0x0012 = 0x12 -0x0013 = 0x13 -0x0014 = 0x14 -0x0015 = 0x15 -0x0016 = 0x16 -0x0017 = 0x17 -0x0018 = 0x18 -0x0019 = 0x19 -0x001A = 0x1A -0x001B = 0x1B -0x001C = 0x1C -0x001D = 0x1D -0x001E = 0x1E -0x001F = 0x1F -0x0020 = 0x20 -0x0021 = 0x21 -0x0022 = 0x22 -0x0023 = 0x23 -0x0024 = 0x24 -0x0025 = 0x25 -0x0026 = 0x26 -0x0027 = 0x27 -0x0028 = 0x28 -0x0029 = 0x29 -0x002A = 0x2A -0x002B = 0x2B -0x002C = 0x2C -0x002D = 0x2D -0x002E = 0x2E -0x002F = 0x2F -0x0030 = 0x30 -0x0031 = 0x31 -0x0032 = 0x32 -0x0033 = 0x33 -0x0034 = 0x34 -0x0035 = 0x35 -0x0036 = 0x36 -0x0037 = 0x37 -0x0038 = 0x38 -0x0039 = 0x39 -0x003A = 0x3A -0x003B = 0x3B -0x003C = 0x3C -0x003D = 0x3D -0x003E = 0x3E -0x003F = 0x3F -0x0040 = 0x40 -0x0041 = 0x41 -0x0042 = 0x42 -0x0043 = 0x43 -0x0044 = 0x44 -0x0045 = 0x45 -0x0046 = 0x46 -0x0047 = 0x47 -0x0048 = 0x48 -0x0049 = 0x49 -0x004A = 0x4A -0x004B = 0x4B -0x004C = 0x4C -0x004D = 0x4D -0x004E = 0x4E -0x004F = 0x4F -0x0050 = 0x50 -0x0051 = 0x51 -0x0052 = 0x52 -0x0053 = 0x53 -0x0054 = 0x54 -0x0055 = 0x55 -0x0056 = 0x56 -0x0057 = 0x57 -0x0058 = 0x58 -0x0059 = 0x59 -0x005A = 0x5A -0x005B = 0x5B -0x005D = 0x5D -0x005E = 0x5E -0x005F = 0x5F -0x0060 = 0x60 -0x0061 = 0x61 -0x0062 = 0x62 -0x0063 = 0x63 -0x0064 = 0x64 -0x0065 = 0x65 -0x0066 = 0x66 -0x0067 = 0x67 -0x0068 = 0x68 -0x0069 = 0x69 -0x006A = 0x6A -0x006B = 0x6B -0x006C = 0x6C -0x006D = 0x6D -0x006E = 0x6E -0x006F = 0x6F -0x0070 = 0x70 -0x0071 = 0x71 -0x0072 = 0x72 -0x0073 = 0x73 -0x0074 = 0x74 -0x0075 = 0x75 -0x0076 = 0x76 -0x0077 = 0x77 -0x0078 = 0x78 -0x0079 = 0x79 -0x007A = 0x7A -0x007B = 0x7B -0x007C = 0x7C -0x007D = 0x7D -0x007F = 0x7F -0x00A0 = 0x20 -0x00A1 = 0x21 -0x00A2 = 0x63 -0x00A3 = 0x626C -0x00A5 = 0x5C -0x00A6 = 0x7C -0x00A7 = 0x5353 -0x00A8 = 0x22 -0x00A9 = 0x296328 -0x00AA = 0x61 -0x00AB = 0x3C3C -0x00AC = 0x746F6E -0x00AD = 0x2D -0x00AE = 0x295228 -0x00B0 = 0x305E -0x00B1 = 0x2D2F2B -0x00B2 = 0x325E -0x00B3 = 0x335E -0x00B4 = 0x27 -0x00B5 = 0x75 -0x00B6 = 0x50 -0x00B7 = 0x2E -0x00B8 = 0x2C -0x00B9 = 0x315E -0x00BA = 0x6F -0x00BB = 0x3E3E -0x00BF = 0x3F -0x00C0 = 0x4160 -0x00C1 = 0x4127 -0x00C2 = 0x415E -0x00C4 = 0x4122 -0x00C5 = 0x41 -0x00C6 = 0x4541 -0x00C7 = 0x43 -0x00C8 = 0x4560 -0x00C9 = 0x4527 -0x00CA = 0x455E -0x00CB = 0x4522 -0x00CC = 0x4960 -0x00CD = 0x4927 -0x00CE = 0x495E -0x00CF = 0x4922 -0x00D0 = 0x44 -0x00D2 = 0x4F60 -0x00D3 = 0x4F27 -0x00D4 = 0x4F5E -0x00D6 = 0x4F22 -0x00D7 = 0x78 -0x00D8 = 0x4F -0x00D9 = 0x5560 -0x00DA = 0x5527 -0x00DB = 0x555E -0x00DC = 0x5522 -0x00DD = 0x5927 -0x00DE = 0x6854 -0x00DF = 0x7373 -0x00E0 = 0x6160 -0x00E1 = 0x6127 -0x00E2 = 0x615E -0x00E4 = 0x6122 -0x00E5 = 0x61 -0x00E6 = 0x6561 -0x00E7 = 0x63 -0x00E8 = 0x6560 -0x00E9 = 0x6527 -0x00EA = 0x655E -0x00EB = 0x6522 -0x00EC = 0x6960 -0x00ED = 0x6927 -0x00EE = 0x695E -0x00EF = 0x6922 -0x00F0 = 0x64 -0x00F2 = 0x6F60 -0x00F3 = 0x6F27 -0x00F4 = 0x6F5E -0x00F6 = 0x6F22 -0x00F7 = 0x3A -0x00F8 = 0x6F -0x00F9 = 0x7560 -0x00FA = 0x7527 -0x00FB = 0x755E -0x00FC = 0x7522 -0x00FD = 0x7927 -0x00FE = 0x6874 -0x00FF = 0x7922 -0x0100 = 0x41 -0x0101 = 0x61 -0x0102 = 0x41 -0x0103 = 0x61 -0x0104 = 0x41 -0x0105 = 0x61 -0x0106 = 0x4327 -0x0107 = 0x6327 -0x0108 = 0x435E -0x0109 = 0x635E -0x010A = 0x43 -0x010B = 0x63 -0x010C = 0x43 -0x010D = 0x63 -0x010E = 0x44 -0x010F = 0x64 -0x0110 = 0x44 -0x0111 = 0x64 -0x0112 = 0x45 -0x0113 = 0x65 -0x0114 = 0x45 -0x0115 = 0x65 -0x0116 = 0x45 -0x0117 = 0x65 -0x0118 = 0x45 -0x0119 = 0x65 -0x011A = 0x45 -0x011B = 0x65 -0x011C = 0x475E -0x011D = 0x675E -0x011E = 0x47 -0x011F = 0x67 -0x0120 = 0x47 -0x0121 = 0x67 -0x0122 = 0x47 -0x0123 = 0x67 -0x0124 = 0x485E -0x0125 = 0x685E -0x0126 = 0x48 -0x0127 = 0x68 -0x012A = 0x49 -0x012B = 0x69 -0x012C = 0x49 -0x012D = 0x69 -0x012E = 0x49 -0x012F = 0x69 -0x0130 = 0x49 -0x0131 = 0x69 -0x0132 = 0x4A49 -0x0133 = 0x6A69 -0x0134 = 0x4A5E -0x0135 = 0x6A5E -0x0136 = 0x4B -0x0137 = 0x6B -0x0139 = 0x4C -0x013A = 0x6C -0x013B = 0x4C -0x013C = 0x6C -0x013D = 0x4C -0x013E = 0x6C -0x013F = 0x4C -0x0140 = 0x6C -0x0141 = 0x4C -0x0142 = 0x6C -0x0143 = 0x4E27 -0x0144 = 0x6E27 -0x0145 = 0x4E -0x0146 = 0x6E -0x0147 = 0x4E -0x0148 = 0x6E -0x0149 = 0x6E27 -0x014C = 0x4F -0x014D = 0x6F -0x014E = 0x4F -0x014F = 0x6F -0x0150 = 0x4F22 -0x0151 = 0x6F22 -0x0152 = 0x454F -0x0153 = 0x656F -0x0154 = 0x5227 -0x0155 = 0x7227 -0x0156 = 0x52 -0x0157 = 0x72 -0x0158 = 0x52 -0x0159 = 0x72 -0x015A = 0x5327 -0x015B = 0x7327 -0x015C = 0x535E -0x015D = 0x735E -0x015E = 0x53 -0x015F = 0x73 -0x0160 = 0x53 -0x0161 = 0x73 -0x0162 = 0x54 -0x0163 = 0x74 -0x0164 = 0x54 -0x0165 = 0x74 -0x0166 = 0x54 -0x0167 = 0x74 -0x016A = 0x55 -0x016B = 0x75 -0x016C = 0x55 -0x016D = 0x75 -0x016E = 0x55 -0x016F = 0x75 -0x0170 = 0x5522 -0x0171 = 0x7522 -0x0172 = 0x55 -0x0173 = 0x75 -0x0174 = 0x575E -0x0175 = 0x775E -0x0176 = 0x595E -0x0177 = 0x795E -0x0178 = 0x5922 -0x0179 = 0x5A27 -0x017A = 0x7A27 -0x017B = 0x5A -0x017C = 0x7A -0x017D = 0x5A -0x017E = 0x7A -0x017F = 0x73 -0x0192 = 0x66 -0x01C4 = 0x5A44 -0x01C5 = 0x7A44 -0x01C6 = 0x7A64 -0x01C7 = 0x4A4C -0x01C8 = 0x6A4C -0x01C9 = 0x6A6C -0x01CA = 0x4A4E -0x01CB = 0x6A4E -0x01CC = 0x6A6E -0x01F1 = 0x5A44 -0x01F2 = 0x7A44 -0x01F3 = 0x7A64 -0x0218 = 0x53 -0x0219 = 0x73 -0x021A = 0x54 -0x021B = 0x74 -0x02B9 = 0x27 -0x02BA = 0x2727 -0x02BB = 0x27 -0x02BC = 0x27 -0x02BD = 0x27 -0x02C6 = 0x5E -0x02C8 = 0x27 -0x02CA = 0x27 -0x02CB = 0x60 -0x02CD = 0x5F -0x02DD = 0x22 -0x1E02 = 0x42 -0x1E03 = 0x62 -0x1E0A = 0x44 -0x1E0B = 0x64 -0x1E1E = 0x46 -0x1E1F = 0x66 -0x1E40 = 0x4D -0x1E41 = 0x6D -0x1E56 = 0x50 -0x1E57 = 0x70 -0x1E60 = 0x53 -0x1E61 = 0x73 -0x1E6A = 0x54 -0x1E6B = 0x74 -0x1E80 = 0x5760 -0x1E81 = 0x7760 -0x1E82 = 0x5727 -0x1E83 = 0x7727 -0x1E84 = 0x5722 -0x1E85 = 0x7722 -0x1EF2 = 0x5960 -0x1EF3 = 0x7960 -0x2002 = 0x20 -0x2003 = 0x20 -0x2004 = 0x20 -0x2005 = 0x20 -0x2006 = 0x20 -0x2008 = 0x20 -0x2009 = 0x20 -0x200A = 0x20 -0x2010 = 0x2D -0x2011 = 0x2D -0x2012 = 0x2D -0x2013 = 0x2D -0x2014 = 0x2D -0x2015 = 0x2D -0x2018 = 0x27 -0x2019 = 0x27 -0x201A = 0x27 -0x201B = 0x27 -0x201C = 0x22 -0x201D = 0x22 -0x201E = 0x22 -0x201F = 0x22 -0x2020 = 0x2B -0x2022 = 0x6F -0x2024 = 0x2E -0x2025 = 0x2E2E -0x2026 = 0x2E2E2E -0x2030 = 0x6F6F2F6F -0x2032 = 0x27 -0x2033 = 0x2727 -0x2034 = 0x272727 -0x2039 = 0x3C -0x203A = 0x3E -0x203C = 0x2121 -0x203E = 0x7E -0x2044 = 0x2F -0x2047 = 0x3F3F -0x2048 = 0x213F -0x2049 = 0x3F21 -0x2057 = 0x27272727 -0x20A8 = 0x7352 -0x20AC = 0x525545 -0x2100 = 0x632F61 -0x2101 = 0x732F61 -0x2102 = 0x43 -0x2103 = 0x43305E -0x2105 = 0x6F2F63 -0x2106 = 0x752F63 -0x2109 = 0x46305E -0x210A = 0x67 -0x210B = 0x48 -0x210C = 0x48 -0x210D = 0x48 -0x210E = 0x68 -0x210F = 0x68 -0x2110 = 0x49 -0x2111 = 0x49 -0x2112 = 0x4C -0x2113 = 0x6C -0x2115 = 0x4E -0x2116 = 0x6F4E -0x2119 = 0x50 -0x211A = 0x51 -0x211B = 0x52 -0x211C = 0x52 -0x211D = 0x52 -0x2121 = 0x4C4554 -0x2122 = 0x4D54 -0x2124 = 0x5A -0x2126 = 0x6D684F -0x2128 = 0x5A -0x212C = 0x42 -0x212D = 0x43 -0x212E = 0x65 -0x212F = 0x65 -0x2130 = 0x45 -0x2131 = 0x46 -0x2133 = 0x4D -0x2134 = 0x6F -0x2139 = 0x69 -0x213B = 0x584146 -0x2145 = 0x44 -0x2146 = 0x64 -0x2147 = 0x65 -0x2148 = 0x69 -0x2149 = 0x6A -0x215F = 0x2F3120 -0x2160 = 0x49 -0x2161 = 0x4949 -0x2162 = 0x494949 -0x2163 = 0x5649 -0x2164 = 0x56 -0x2165 = 0x4956 -0x2166 = 0x494956 -0x2167 = 0x49494956 -0x2168 = 0x5849 -0x2169 = 0x58 -0x216A = 0x4958 -0x216B = 0x494958 -0x216C = 0x4C -0x216D = 0x43 -0x216E = 0x44 -0x216F = 0x4D -0x2170 = 0x69 -0x2171 = 0x6969 -0x2172 = 0x696969 -0x2173 = 0x7669 -0x2174 = 0x76 -0x2175 = 0x6976 -0x2176 = 0x696976 -0x2177 = 0x69696976 -0x2178 = 0x7869 -0x2179 = 0x78 -0x217A = 0x6978 -0x217B = 0x696978 -0x217C = 0x6C -0x217D = 0x63 -0x217E = 0x64 -0x217F = 0x6D -0x2190 = 0x2D3C -0x2191 = 0x5E -0x2192 = 0x3E2D -0x2193 = 0x56 -0x2194 = 0x3E2D3C -0x21D0 = 0x3D3C -0x21D2 = 0x3E3D -0x21D4 = 0x3E3D3C -0x2212 = 0x2D -0x2215 = 0x2F -0x2217 = 0x2A -0x2219 = 0x6F -0x2223 = 0x7C -0x2236 = 0x3A -0x2260 = 0x3D2F -0x2264 = 0x3D3C -0x2265 = 0x3D3E -0x226A = 0x3C3C -0x226B = 0x3E3E -0x22C5 = 0x2E -0x22D8 = 0x3C3C3C -0x22D9 = 0x3E3E3E -0x22EF = 0x2E2E2E -0x2408 = 0x5D53425B -0x2409 = 0x5D54485B -0x240A = 0x5D464C5B -0x240B = 0x5D54565B -0x240C = 0x5D46465B -0x240D = 0x5D52435B -0x240E = 0x5D4F535B -0x240F = 0x5D49535B -0x2419 = 0x5D4D455B -0x241C = 0x5D53465B -0x241D = 0x5D53475B -0x241E = 0x5D53525B -0x241F = 0x5D53555B -0x2420 = 0x5D50535B -0x2424 = 0x5D4C4E5B -0x2460 = 0x293128 -0x2461 = 0x293228 -0x2462 = 0x293328 -0x2463 = 0x293428 -0x2464 = 0x293528 -0x2465 = 0x293628 -0x2466 = 0x293728 -0x2467 = 0x293828 -0x2468 = 0x293928 -0x2469 = 0x29303128 -0x246A = 0x29313128 -0x246B = 0x29323128 -0x246C = 0x29333128 -0x246D = 0x29343128 -0x246E = 0x29353128 -0x246F = 0x29363128 -0x2470 = 0x29373128 -0x2471 = 0x29383128 -0x2472 = 0x29393128 -0x2473 = 0x29303228 -0x2474 = 0x293128 -0x2475 = 0x293228 -0x2476 = 0x293328 -0x2477 = 0x293428 -0x2478 = 0x293528 -0x2479 = 0x293628 -0x247A = 0x293728 -0x247B = 0x293828 -0x247C = 0x293928 -0x247D = 0x29303128 -0x247E = 0x29313128 -0x247F = 0x29323128 -0x2480 = 0x29333128 -0x2481 = 0x29343128 -0x2482 = 0x29353128 -0x2483 = 0x29363128 -0x2484 = 0x29373128 -0x2485 = 0x29383128 -0x2486 = 0x29393128 -0x2487 = 0x29303228 -0x2488 = 0x2E31 -0x2489 = 0x2E32 -0x248A = 0x2E33 -0x248B = 0x2E34 -0x248C = 0x2E35 -0x248D = 0x2E36 -0x248E = 0x2E37 -0x248F = 0x2E38 -0x2490 = 0x2E39 -0x2491 = 0x2E3031 -0x2492 = 0x2E3131 -0x2493 = 0x2E3231 -0x2494 = 0x2E3331 -0x2495 = 0x2E3431 -0x2496 = 0x2E3531 -0x2497 = 0x2E3631 -0x2498 = 0x2E3731 -0x2499 = 0x2E3831 -0x249A = 0x2E3931 -0x249B = 0x2E3032 -0x249C = 0x296128 -0x249D = 0x296228 -0x249E = 0x296328 -0x249F = 0x296428 -0x24A0 = 0x296528 -0x24A1 = 0x296628 -0x24A2 = 0x296728 -0x24A3 = 0x296828 -0x24A4 = 0x296928 -0x24A5 = 0x296A28 -0x24A6 = 0x296B28 -0x24A7 = 0x296C28 -0x24A8 = 0x296D28 -0x24A9 = 0x296E28 -0x24AA = 0x296F28 -0x24AB = 0x297028 -0x24AC = 0x297128 -0x24AD = 0x297228 -0x24AE = 0x297328 -0x24AF = 0x297428 -0x24B0 = 0x297528 -0x24B1 = 0x297628 -0x24B2 = 0x297728 -0x24B3 = 0x297828 -0x24B4 = 0x297928 -0x24B5 = 0x297A28 -0x24B6 = 0x294128 -0x24B7 = 0x294228 -0x24B8 = 0x294328 -0x24B9 = 0x294428 -0x24BA = 0x294528 -0x24BB = 0x294628 -0x24BC = 0x294728 -0x24BD = 0x294828 -0x24BE = 0x294928 -0x24BF = 0x294A28 -0x24C0 = 0x294B28 -0x24C1 = 0x294C28 -0x24C2 = 0x294D28 -0x24C3 = 0x294E28 -0x24C4 = 0x294F28 -0x24C5 = 0x295028 -0x24C6 = 0x295128 -0x24C7 = 0x295228 -0x24C8 = 0x295328 -0x24C9 = 0x295428 -0x24CA = 0x295528 -0x24CB = 0x295628 -0x24CC = 0x295728 -0x24CD = 0x295828 -0x24CE = 0x295928 -0x24CF = 0x295A28 -0x24D0 = 0x296128 -0x24D1 = 0x296228 -0x24D2 = 0x296328 -0x24D3 = 0x296428 -0x24D4 = 0x296528 -0x24D5 = 0x296628 -0x24D6 = 0x296728 -0x24D7 = 0x296828 -0x24D8 = 0x296928 -0x24D9 = 0x296A28 -0x24DA = 0x296B28 -0x24DB = 0x296C28 -0x24DC = 0x296D28 -0x24DD = 0x296E28 -0x24DE = 0x296F28 -0x24DF = 0x297028 -0x24E0 = 0x297128 -0x24E1 = 0x297228 -0x24E2 = 0x297328 -0x24E3 = 0x297428 -0x24E4 = 0x297528 -0x24E5 = 0x297628 -0x24E6 = 0x297728 -0x24E7 = 0x297828 -0x24E8 = 0x297928 -0x24E9 = 0x297A28 -0x24EA = 0x293028 -0x2500 = 0x2D -0x2502 = 0x7C -0x250C = 0x2B -0x2510 = 0x2B -0x2514 = 0x2B -0x2518 = 0x2B -0x251C = 0x2B -0x2524 = 0x2B -0x252C = 0x2B -0x2534 = 0x2B -0x253C = 0x2B -0x25E6 = 0x6F -0x2A74 = 0x3D3A3A -0x2A75 = 0x3D3D -0x2A76 = 0x3D3D3D -0x3000 = 0x20 -0x30A0 = 0x3D -0x3250 = 0x455450 -0x3251 = 0x29313228 -0x3252 = 0x29323228 -0x3253 = 0x29333228 -0x3254 = 0x29343228 -0x3255 = 0x29353228 -0x3256 = 0x29363228 -0x3257 = 0x29373228 -0x3258 = 0x29383228 -0x3259 = 0x29393228 -0x325A = 0x29303328 -0x325B = 0x29313328 -0x325C = 0x29323328 -0x325D = 0x29333328 -0x325E = 0x29343328 -0x325F = 0x29353328 -0x32B1 = 0x29363328 -0x32B2 = 0x29373328 -0x32B3 = 0x29383328 -0x32B4 = 0x29393328 -0x32B5 = 0x29303428 -0x32B6 = 0x29313428 -0x32B7 = 0x29323428 -0x32B8 = 0x29333428 -0x32B9 = 0x29343428 -0x32BA = 0x29353428 -0x32BB = 0x29363428 -0x32BC = 0x29373428 -0x32BD = 0x29383428 -0x32BE = 0x29393428 -0x32BF = 0x29303528 -0x32CC = 0x6748 -0x32CD = 0x677265 -0x32CE = 0x5665 -0x32CF = 0x44544C -0x3371 = 0x615068 -0x3372 = 0x6164 -0x3373 = 0x5541 -0x3374 = 0x726162 -0x3375 = 0x566F -0x3376 = 0x6370 -0x3377 = 0x6D64 -0x3378 = 0x325E6D64 -0x3379 = 0x335E6D64 -0x337A = 0x5549 -0x3380 = 0x4170 -0x3381 = 0x416E -0x3383 = 0x416D -0x3384 = 0x416B -0x3385 = 0x424B -0x3386 = 0x424D -0x3387 = 0x4247 -0x3388 = 0x6C6163 -0x3389 = 0x6C61636B -0x338A = 0x4670 -0x338B = 0x466E -0x338E = 0x676D -0x338F = 0x676B -0x3390 = 0x7A48 -0x3391 = 0x7A486B -0x3392 = 0x7A484D -0x3393 = 0x7A4847 -0x3394 = 0x7A4854 -0x3396 = 0x6C6D -0x3397 = 0x6C64 -0x3398 = 0x6C6B -0x3399 = 0x6D66 -0x339A = 0x6D6E -0x339C = 0x6D6D -0x339D = 0x6D63 -0x339E = 0x6D6B -0x339F = 0x325E6D6D -0x33A0 = 0x325E6D63 -0x33A1 = 0x325E6D -0x33A2 = 0x325E6D6B -0x33A3 = 0x335E6D6D -0x33A4 = 0x335E6D63 -0x33A5 = 0x335E6D -0x33A6 = 0x335E6D6B -0x33A7 = 0x732F6D -0x33A9 = 0x6150 -0x33AA = 0x61506B -0x33AB = 0x61504D -0x33AC = 0x615047 -0x33AD = 0x646172 -0x33B0 = 0x7370 -0x33B1 = 0x736E -0x33B3 = 0x736D -0x33B4 = 0x5670 -0x33B5 = 0x566E -0x33B7 = 0x566D -0x33B8 = 0x566B -0x33B9 = 0x564D -0x33BA = 0x5770 -0x33BB = 0x576E -0x33BD = 0x576D -0x33BE = 0x576B -0x33BF = 0x574D -0x33C2 = 0x2E6D2E61 -0x33C3 = 0x7142 -0x33C4 = 0x6363 -0x33C5 = 0x6463 -0x33C6 = 0x676B2F43 -0x33C7 = 0x2E6F43 -0x33C8 = 0x4264 -0x33C9 = 0x7947 -0x33CA = 0x6168 -0x33CB = 0x5048 -0x33CC = 0x6E69 -0x33CD = 0x4B4B -0x33CE = 0x4D4B -0x33CF = 0x746B -0x33D0 = 0x6D6C -0x33D1 = 0x6E6C -0x33D2 = 0x676F6C -0x33D3 = 0x786C -0x33D4 = 0x626D -0x33D5 = 0x6C696D -0x33D6 = 0x6C6F6D -0x33D7 = 0x4850 -0x33D8 = 0x2E6D2E70 -0x33D9 = 0x4D5050 -0x33DA = 0x5250 -0x33DB = 0x7273 -0x33DC = 0x7653 -0x33DD = 0x6257 -0x33DE = 0x6D2F56 -0x33DF = 0x6D2F41 -0x33FF = 0x6C6167 -0xFB00 = 0x6666 -0xFB01 = 0x6966 -0xFB02 = 0x6C66 -0xFB03 = 0x696666 -0xFB04 = 0x6C6666 -0xFB05 = 0x7473 -0xFB06 = 0x7473 -0xFB29 = 0x2B -0xFE49 = 0x7E -0xFE4A = 0x7E -0xFE4B = 0x7E -0xFE4C = 0x7E -0xFE4D = 0x5F -0xFE4E = 0x5F -0xFE4F = 0x5F -0xFE50 = 0x2C -0xFE52 = 0x2E -0xFE54 = 0x3B -0xFE55 = 0x3A -0xFE56 = 0x3F -0xFE57 = 0x21 -0xFE58 = 0x2D -0xFE59 = 0x28 -0xFE5A = 0x29 -0xFE5B = 0x7B -0xFE5C = 0x7D -0xFE5F = 0x23 -0xFE60 = 0x26 -0xFE61 = 0x2A -0xFE62 = 0x2B -0xFE63 = 0x2D -0xFE64 = 0x3C -0xFE65 = 0x3E -0xFE66 = 0x3D -0xFE69 = 0x24 -0xFE6A = 0x25 -0xFE6B = 0x40 -0xFF01 = 0x21 -0xFF02 = 0x22 -0xFF03 = 0x23 -0xFF04 = 0x24 -0xFF05 = 0x25 -0xFF06 = 0x26 -0xFF07 = 0x27 -0xFF08 = 0x28 -0xFF09 = 0x29 -0xFF0A = 0x2A -0xFF0B = 0x2B -0xFF0C = 0x2C -0xFF0D = 0x2D -0xFF0E = 0x2E -0xFF0F = 0x2F -0xFF10 = 0x30 -0xFF11 = 0x31 -0xFF12 = 0x32 -0xFF13 = 0x33 -0xFF14 = 0x34 -0xFF15 = 0x35 -0xFF16 = 0x36 -0xFF17 = 0x37 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 11:28:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D2575D7; Mon, 18 Nov 2013 11:28:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8D72329; Mon, 18 Nov 2013 11:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIBSJV2058899; Mon, 18 Nov 2013 11:28:19 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIBSJGj058898; Mon, 18 Nov 2013 11:28:19 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201311181128.rAIBSJGj058898@svn.freebsd.org> From: Steven Hartland Date: Mon, 18 Nov 2013 11:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258294 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 11:28:19 -0000 Author: smh Date: Mon Nov 18 11:28:19 2013 New Revision: 258294 URL: http://svnweb.freebsd.org/changeset/base/258294 Log: Fix ZFS deadlock when sending a snapshot which is mounted. MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Mon Nov 18 04:42:58 2013 (r258293) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Mon Nov 18 11:28:19 2013 (r258294) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 12:44: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A14DCD0; Mon, 18 Nov 2013 12:44:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 098E327B1; Mon, 18 Nov 2013 12:44:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAICi5CD087393; Mon, 18 Nov 2013 12:44:05 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAICi5dQ087390; Mon, 18 Nov 2013 12:44:05 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311181244.rAICi5dQ087390@svn.freebsd.org> From: Julio Merino Date: Mon, 18 Nov 2013 12:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258297 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 12:44:06 -0000 Author: jmmv Date: Mon Nov 18 12:44:05 2013 New Revision: 258297 URL: http://svnweb.freebsd.org/changeset/base/258297 Log: Remove registration of C++ test programs into PROGS. C++ programs need to be added to PROGS_CXX, not PROGS, and the code was actually doing both. Just keep the registration into PROGS_CXX to prevent possible obscure build problems. Approved by: rpaulo (mentor) Modified: head/share/mk/atf.test.mk head/share/mk/plain.test.mk Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Mon Nov 18 11:30:22 2013 (r258296) +++ head/share/mk/atf.test.mk Mon Nov 18 12:44:05 2013 (r258297) @@ -74,7 +74,6 @@ TEST_INTERFACE.${_T}= atf .if !empty(ATF_TESTS_CXX) PROGS_CXX+= ${ATF_TESTS_CXX} -PROGS+= ${ATF_TESTS_CXX} _TESTS+= ${ATF_TESTS_CXX} .for _T in ${ATF_TESTS_CXX} BINDIR.${_T}= ${TESTSDIR} Modified: head/share/mk/plain.test.mk ============================================================================== --- head/share/mk/plain.test.mk Mon Nov 18 11:30:22 2013 (r258296) +++ head/share/mk/plain.test.mk Mon Nov 18 12:44:05 2013 (r258297) @@ -30,7 +30,6 @@ TEST_INTERFACE.${_T}= plain .if !empty(PLAIN_TESTS_CXX) PROGS_CXX+= ${PLAIN_TESTS_CXX} -PROGS+= ${PLAIN_TESTS_CXX} _TESTS+= ${PLAIN_TESTS_CXX} .for _T in ${PLAIN_TESTS_CXX} BINDIR.${_T}= ${TESTSDIR} From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 12:47:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3478375; Mon, 18 Nov 2013 12:47:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2468327D9; Mon, 18 Nov 2013 12:47:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIClZ8f088231; Mon, 18 Nov 2013 12:47:36 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIClZ7W088230; Mon, 18 Nov 2013 12:47:35 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311181247.rAIClZ7W088230@svn.freebsd.org> From: Julio Merino Date: Mon, 18 Nov 2013 12:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258298 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 12:47:36 -0000 Author: jmmv Date: Mon Nov 18 12:47:35 2013 New Revision: 258298 URL: http://svnweb.freebsd.org/changeset/base/258298 Log: Fix the build of plain test programs. SRCS. must be explicitly defined when using the PROGS* functionality for each program to be built. As there are no plain test programs in the system yet, this was not detected. Approved by: rpaulo (mentor) Modified: head/share/mk/plain.test.mk Modified: head/share/mk/plain.test.mk ============================================================================== --- head/share/mk/plain.test.mk Mon Nov 18 12:44:05 2013 (r258297) +++ head/share/mk/plain.test.mk Mon Nov 18 12:47:35 2013 (r258298) @@ -24,6 +24,7 @@ _TESTS+= ${PLAIN_TESTS_C} .for _T in ${PLAIN_TESTS_C} BINDIR.${_T}= ${TESTSDIR} MAN.${_T}?= # empty +SRCS.${_T}?= ${_T}.c TEST_INTERFACE.${_T}= plain .endfor .endif @@ -34,6 +35,7 @@ _TESTS+= ${PLAIN_TESTS_CXX} .for _T in ${PLAIN_TESTS_CXX} BINDIR.${_T}= ${TESTSDIR} MAN.${_T}?= # empty +SRCS.${_T}?= ${_T}.cc TEST_INTERFACE.${_T}= plain .endfor .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 12:57: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2810D481; Mon, 18 Nov 2013 12:57:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14D8D286B; Mon, 18 Nov 2013 12:57:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAICvow5092456; Mon, 18 Nov 2013 12:57:50 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAICvlcI092433; Mon, 18 Nov 2013 12:57:47 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201311181257.rAICvlcI092433@svn.freebsd.org> From: Julio Merino Date: Mon, 18 Nov 2013 12:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258299 - in head: etc/mtree share share/examples share/examples/tests share/examples/tests/tests share/examples/tests/tests/atf share/examples/tests/tests/plain share/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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 12:57:50 -0000 Author: jmmv Date: Mon Nov 18 12:57:46 2013 New Revision: 258299 URL: http://svnweb.freebsd.org/changeset/base/258299 Log: Add some sample test programs. This change adds some sample test cases to share/examples/tests/ demonstrating the basic usage of the atf and plain interfaces. These test programs are fully-functional and are installed as part of the test suite, which guarantees that the sample code remains correct. However, they currently mostly serve as a placeholder for additional examples and may be incomplete (depending on how you look at them). I will see what else can be useful while working on documentation. As a bonus, the addition of these tests exercise the *.test.mk files, one of which (plain.test.mk) was not yet in use, and also demonstrates that it's possible to mix different kinds of test programs into the same test suite. Approved by: rpaulo (mentor) Added: head/share/examples/tests/ head/share/examples/tests/Makefile (contents, props changed) head/share/examples/tests/README (contents, props changed) head/share/examples/tests/tests/ head/share/examples/tests/tests/Makefile (contents, props changed) head/share/examples/tests/tests/atf/ head/share/examples/tests/tests/atf/Kyuafile (contents, props changed) head/share/examples/tests/tests/atf/Makefile (contents, props changed) head/share/examples/tests/tests/atf/cp_test.sh (contents, props changed) head/share/examples/tests/tests/atf/printf_test.c (contents, props changed) head/share/examples/tests/tests/plain/ head/share/examples/tests/tests/plain/Kyuafile (contents, props changed) head/share/examples/tests/tests/plain/Makefile (contents, props changed) head/share/examples/tests/tests/plain/cp_test (contents, props changed) head/share/examples/tests/tests/plain/printf_test.c (contents, props changed) head/share/tests/ head/share/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/share/Makefile head/share/examples/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 18 12:47:35 2013 (r258298) +++ head/etc/mtree/BSD.tests.dist Mon Nov 18 12:57:46 2013 (r258299) @@ -38,6 +38,16 @@ .. .. .. + share + examples + tests + atf + .. + plain + .. + .. + .. + .. usr.bin atf atf-sh Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Mon Nov 18 12:47:35 2013 (r258298) +++ head/share/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ ${_syscons} \ tabset \ termcap \ + ${_tests} \ ${_timedef} \ ${_zoneinfo} @@ -80,6 +81,10 @@ _doc= doc _syscons= syscons .endif +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_ZONEINFO} != "no" _zoneinfo= zoneinfo .endif Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Mon Nov 18 12:47:35 2013 (r258298) +++ head/share/examples/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -249,4 +249,8 @@ SUBDIR+=pf .endif .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Added: head/share/examples/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/share/examples + +SUBDIR= tests + +KYUAFILE= yes +.PATH: ${.CURDIR:H:H:H}/tests + +.include Added: head/share/examples/tests/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/README Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,37 @@ +$FreeBSD$ + +This directory contains sample test programs along the Makefile and +Kyuafile logic to get them build and installed. + +The goal of these test programs is to illustrate, via simple and +heaviliy-commented code, how to construct test programs using all the +supported interfaces in the system. + +If you use any files in here as templates for your own code, please +remove all comments while doing so and then write your own if necessary. + +The subdirectories here contain: + +* tests/: Regular directory containing the tests code. Note that the + apparently-redundant tests/tests/ path component here is expected for + consistency reasons and required to get the right layout under + /usr/tests/. + +* tests/atf/: Tests that use the ATF libraries, including atf-c, atf-c++ + and atf-sh. See kyua-atf-interface(1) for details. + +* tests/plain/: Tests that do not use any testing framework. See + kyua-plain-interface(1) for details. + +To inspect the available sample test cases from an installed system: + + $ kyua list -k /usr/tests/share/examples/tests/Kyuafile + +To run the full suite of sample test cases: + + $ kyua test -k /usr/tests/share/examples/tests/Kyuafile + +And to debug a specific failing test case, if any: + + $ kyua debug -k /usr/tests/share/examples/tests/Kyuafile \ + atf/cp_test:simple Added: head/share/examples/tests/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +.include + +# Directory into which the Kyuafile provided by this directory will be +# installed. +# +# This is always a subdirectory of ${TESTSBASE}/. The remainder of the +# path has to match the relative path within the source tree in which +# these files are found modulo the tests/ component at the end. +# +# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR +# would point at ${TESTSBASE}/bin/cp/. +TESTSDIR= ${TESTSBASE}/share/examples/tests + +# List of subdirectories into which we want to recurse during the build +# of the system. We use TESTS_SUBDIRS instead of SUBDIR because we want +# the auto-generated Kyuafile to recurse into these directories. +TESTS_SUBDIRS= atf plain + +# We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile +# for us based on the contents of the TESTS_SUBDIRS line above. The +# generated file will tell the tests run-time engine to recurse into the +# directories listed above. +#KYUAFILE= auto + +.include Added: head/share/examples/tests/tests/atf/Kyuafile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/atf/Kyuafile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,46 @@ +-- $FreeBSD$ +-- +-- Copyright 2013 Google Inc. +-- All rights reserved. +-- +-- 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. +-- * Neither the name of Google Inc. nor the names of its contributors +-- may be used to endorse or promote products derived from this software +-- without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE 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. + +syntax(2) + +-- All tests provided by the FreeBSD base system should set the test_suite +-- property to FreeBSD. This creates a namespace in the configuration file +-- in which specific run-time properties can be passed to the tests below. +test_suite('FreeBSD') + +-- Register the various test programs into the test suite defined in this +-- directory. +-- +-- Note that, while Kyua supports overriding the test case metadata +-- properties (e.g. their timeout) along the test program definition, you +-- should not do so for ATF test programs. The ATF test cases themselves +-- encode the right values. +atf_test_program{name='cp_test'} +atf_test_program{name='printf_test'} Added: head/share/examples/tests/tests/atf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/atf/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +# Directory into which the Kyuafile provided by this directory will be +# installed. +# +# This is always a subdirectory of ${TESTSBASE}/. The remainder of the +# path has to match the relative path within the source tree in which +# these files are found modulo the tests/ component at the end. +# +# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR +# would point at ${TESTSBASE}/bin/cp/. +TESTSDIR= ${TESTSBASE}/share/examples/tests/atf + +# List of test programs to build. Note that we can build more than one +# test from a single directory, and this is expected. +ATF_TESTS_C= printf_test +ATF_TESTS_SH= cp_test + +# Tell bsd.test.mk that we are providing a hand-crafted Kyuafile in this +# directory. We do so because the file in this directory exists for +# documentation purposes. +# +# In general, however, you should NOT define KYUAFILE at all to allow +# bsd.test.mk auto-generate one for you based on the ATF_TESTS_* +# definitions from above. +KYUAFILE= yes + +.include Added: head/share/examples/tests/tests/atf/cp_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/atf/cp_test.sh Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,119 @@ +# $FreeBSD$ +# +# Copyright 2013 Google Inc. +# All rights reserved. +# +# 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. +# * Neither the name of Google Inc. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE 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. + +# +# INTRODUCTION +# +# This sample test program implements various test cases for the cp(1) +# utility in order to demonstrate the usage of the ATF shell API (see +# atf-sh-api(3)). +# + +# +# Auxiliary function to compare two files for equality. +# +verify_copy() { + if ! cmp -s "${1}" "${2}"; then + echo "${1} and ${2} differ, but they should be equal" + diff -u "${1}" "${2}" + atf_fail "Original and copy do not match" + fi +} + +# +# This is the simplest form of a test case definition: a test case +# without a header. +# +# In most cases, this is the definition you will want to use. However, +# make absolutely sure that the test case name is descriptive enough. +# Multi-word test case names are encouraged. Keep in mind that these +# are exposed to the reader in the test reports, and the goal is for +# the combination of the test program plus the name of the test case to +# give a pretty clear idea of what specific condition the test is +# validating. +# +atf_test_case simple +simple_body() { + echo 'File 1' >file1 + + # The atf_check function is a very powerful function of atf-sh. + # It allows you to define checkers for the exit status, the + # stdout and the stderr of any command you execute. If the + # result of the command does not match the expectations defined + # in the checkers, the test fails and verbosely reports data + # behind the problem. + # + # See atf-check(1) for details. + atf_check -s exit:0 -o empty -e empty cp file1 file2 + + verify_copy file1 file2 + + # Of special note here is that we are NOT deleting the temporary + # files we created in this test. Kyua takes care of this + # cleanup automatically and tests can (and should) rely on this + # behavior. +} + +# +# This is a more complex form of a test case definition: a test case +# with a header and a body. You should always favor the simpler +# definition above unless you have to override specific metadata +# variables. +# +# See atf-test-case(4) and kyua-atf-interface(1) for details on all +# available properties. +# +atf_test_case force +force_head() { + # In this specific case, we define a textual description for + # the test case, which is later exported to the reports for + # documentation purposes. + # + # However, note again that you should favor highly descriptive + # test case names to textual descriptions. + atf_set "descr" "Tests that the -f flag causes cp to forcibly" \ + "override the destination file" +} +force_body() { + echo 'File 1' >file1 + echo 'File 2' >file2 + chmod 400 file2 + atf_check cp -f file1 file2 + verify_copy file1 file2 +} + +# +# Lastly, we tell ATF which test cases exist in this program. This +# function should not do anything other than this registration. +# +atf_init_test_cases() { + atf_add_test_case simple + atf_add_test_case force +} Added: head/share/examples/tests/tests/atf/printf_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/atf/printf_test.c Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,155 @@ +/* $FreeBSD$ + * + * Copyright 2013 Google Inc. + * All rights reserved. + * + * 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. + * * Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. */ + +/* + * INTRODUCTION + * + * This sample test program implements various test cases for the printf(3) + * family of functions in order to demonstrate the usage of the ATF C API + * (see atf-c-api(3)). + * + * Note that this test program is called printf_test because it is intended + * to validate various functions of the printf(3) family. For this reason, + * each test is prefixed with the name of the function under test followed + * by a description of the specific condition being validated. You should + * use a similar naming scheme for your own tests. + */ + +#include +#include +#include + +/* + * This is the simplest form of a test case definition: a test case + * without a header. + * + * In most cases, this is the definition you will want to use. However, + * make absolutely sure that the test case name is descriptive enough. + * Multi-word test case names are encouraged. Keep in mind that these + * are exposed to the reader in the test reports, and the goal is for + * the combination of the test program plus the name of the test case to + * give a pretty clear idea of what specific condition the test is + * validating. + */ +ATF_TC_WITHOUT_HEAD(snprintf__two_formatters); +ATF_TC_BODY(snprintf__two_formatters, tc) +{ + char buffer[128]; + + /* This first require-style check invokes the function we are + * interested in testing. This will cause the test to fail if + * the condition provided to ATF_REQUIRE is not met. */ + ATF_REQUIRE(snprintf(buffer, sizeof(buffer), "%s, %s!", + "Hello", "tests") > 0); + + /* This second check-style check compares that the result of the + * snprintf call we performed above is correct. We use a check + * instead of a require. */ + ATF_CHECK_STREQ("Hello, tests!", buffer); +} + +/* + * This is a more complex form of a test case definition: a test case + * with a header and a body. You should always favor the simpler + * definition above unless you have to override specific metadata + * variables. + * + * See atf-test-case(4) and kyua-atf-interface(1) for details on all + * available properties. + */ +ATF_TC(snprintf__overflow); +ATF_TC_HEAD(snprintf__overflow, tc) +{ + /* In this specific case, we define a textual description for + * the test case, which is later exported to the reports for + * documentation purposes. + * + * However, note again that you should favor highly descriptive + * test case names to textual descriptions. */ + atf_tc_set_md_var(tc, "descr", "This test case validates the proper " + "truncation of the output string from snprintf when it does not " + "fit the provided buffer."); +} +ATF_TC_BODY(snprintf__overflow, tc) +{ + char buffer[10]; + + /* This is a similar test to the above, but in this case we do the + * test ourselves and forego the ATF_* macros. Note that we use the + * atf_tc_fail() function instead of exit(2) or similar because we + * want Kyua to have access to the failure message. + * + * In general, prefer using the ATF_* macros wherever possible. Only + * resort to manual tests when the macros are unsuitable (and consider + * filing a feature request to get a new macro if you think your case + * is generic enough). */ + if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16) + atf_tc_fail("snprintf did not return the expected number " + "of characters"); + + ATF_CHECK(strcmp(buffer, "012345678") == 0); +} + +/* + * Another simple test case, but this time with side-effects. This + * particular test case modifies the contents of the current directory + * and does not clean up after itself, which is perfectly fine. + */ +ATF_TC_WITHOUT_HEAD(fprintf__simple_string); +ATF_TC_BODY(fprintf__simple_string, tc) +{ + const char *contents = "This is a message\n"; + + FILE *output = fopen("test.txt", "w"); + ATF_REQUIRE(fprintf(output, "%s", contents) > 0); + fclose(output); + + /* The ATF C library provides more than just macros to verify the + * outcome of expressions. It also includes various helper functions + * to work with files and processes. Here is just a simple + * example. */ + ATF_REQUIRE(atf_utils_compare_file("test.txt", contents)); + + /* Of special note here is that we are NOT deleting the + * temporary files we created in this test. Kyua takes care of + * this cleanup automatically and tests can (and should) rely on + * this behavior. */ +} + +/* + * Lastly, we tell ATF which test cases exist in this program. This + * function should not do anything other than this registration. + */ +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, snprintf__two_formatters); + ATF_TP_ADD_TC(tp, snprintf__overflow); + ATF_TP_ADD_TC(tp, fprintf__simple_string); +} Added: head/share/examples/tests/tests/plain/Kyuafile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/plain/Kyuafile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,47 @@ +-- $FreeBSD$ +-- +-- Copyright 2013 Google Inc. +-- All rights reserved. +-- +-- 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. +-- * Neither the name of Google Inc. nor the names of its contributors +-- may be used to endorse or promote products derived from this software +-- without specific prior written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE 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. + +syntax(2) + +-- All tests provided by the FreeBSD base system should set the test_suite +-- property to FreeBSD. This creates a namespace in the configuration file +-- in which specific run-time properties can be passed to the tests below. +test_suite('FreeBSD') + +-- Register the various test programs into the test suite defined in this +-- directory. +-- +-- Because plain test programs cannot define metadata in their code (they +-- have no mechanism to communicate that to Kyua), we can instead define +-- any metadata properties in here. These have the exact same meaning as +-- their ATF counterparts. These properties are often useful to define +-- prerequisites for the execution of the tests. +plain_test_program{name='cp_test', required_programs='/bin/cp'} +plain_test_program{name='printf_test'} Added: head/share/examples/tests/tests/plain/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/plain/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +# Directory into which the Kyuafile provided by this directory will be +# installed. +# +# This is always a subdirectory of ${TESTSBASE}/. The remainder of the +# path has to match the relative path within the source tree in which +# these files are found modulo the tests/ component at the end. +# +# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR +# would point at ${TESTSBASE}/bin/cp/. +TESTSDIR= ${TESTSBASE}/share/examples/tests/plain + +# List of test programs to build. Note that we can build more than one +# test from a single directory, and this is expected. +PLAIN_TESTS_C= printf_test +PLAIN_TESTS_SH= cp_test + +# Tell bsd.test.mk that we are providing a hand-crafted Kyuafile in this +# directory. We do so because the file in this directory exists for +# documentation purposes. +# +# In general, however, you should NOT define KYUAFILE at all to allow +# bsd.test.mk auto-generate one for you based on the PLAIN_TESTS_* +# definitions from above. +KYUAFILE= yes + +.include Added: head/share/examples/tests/tests/plain/cp_test ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/plain/cp_test Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,84 @@ +# $FreeBSD$ +# +# Copyright 2013 Google Inc. +# All rights reserved. +# +# 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. +# * Neither the name of Google Inc. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE 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. + +# +# INTRODUCTION +# +# This plain test program mimics the structure and contents of its +# ATF-based counterpart. It attempts to represent various test cases +# in different separate functions and just calls them all from main. +# +# In reality, plain test programs can be much simpler. All they have +# to do is return 0 on success and non-0 otherwise. +# + +set -e + +# Prints an error message and exits. +err() { + echo "${@}" 1>&2 + exit 1 +} + +# Auxiliary function to compare two files for equality. +verify_copy() { + if ! cmp -s "${1}" "${2}"; then + diff -u "${1}" "${2}" + err "${1} and ${2} differ, but they should be equal" + fi +} + +simple_test() { + echo 'File 1' >file1 + cp file1 file2 || err "cp failed" + verify_copy file1 file2 +} + +force_test() { + echo 'File 1' >file1 + echo 'File 2' >file2 + chmod 400 file2 + cp -f file1 file2 || err "cp failed" + verify_copy file1 file2 +} + +# If you have read the cp_test.sh counterpart in the atf/ directory, you +# may think that the sequencing of tests below and the exposed behavior +# to the user is very similar. But you'd be wrong. +# +# There are two major differences with this and the ATF version. The +# first is that the code below has no provisions to detect failures in +# one test and continue running the other tests: the first failure +# causes the whole test program to exit. The second is that this +# particular "main" has no arguments: without ATF, all test programs may +# expose a different command-line interface, and this is an issue for +# consistency purposes. +simple_test +force_test Added: head/share/examples/tests/tests/plain/printf_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/tests/tests/plain/printf_test.c Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,119 @@ +/* $FreeBSD$ + * + * Copyright 2013 Google Inc. + * All rights reserved. + * + * 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. + * * Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. */ + +/* + * INTRODUCTION + * + * This plain test program mimics the structure and contents of its + * ATF-based counterpart. It attempts to represent various test cases + * in different separate functions and just calls them all from main(). + * + * In reality, plain test programs can be much simpler. All they have + * to do is return 0 on success and non-0 otherwise. + */ + +#include +#include +#include +#include + +static void +snprintf__two_formatters(void) +{ + char buffer[128]; + + if (snprintf(buffer, sizeof(buffer), "%s, %s!", "Hello", + "tests") <= 0) + errx(EXIT_FAILURE, "snprintf with two formatters failed"); + + if (strcmp(buffer, "Hello, tests!") != 0) + errx(EXIT_FAILURE, "Bad formatting: got %s", buffer); +} + +static void +snprintf__overflow(void) +{ + char buffer[10]; + + if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16) + errx(EXIT_FAILURE, "snprintf did not return the expected " + "number of characters"); + + if (strcmp(buffer, "012345678") != 0) + errx(EXIT_FAILURE, "Bad formatting: got %s", buffer); +} + +static void +fprintf__simple_string(void) +{ + FILE *file; + char buffer[128]; + size_t length; + const char *contents = "This is a message\n"; + + file = fopen("test.txt", "w+"); + if (fprintf(file, "%s", contents) <= 0) + err(EXIT_FAILURE, "fprintf failed to write to file"); + rewind(file); + length = fread(buffer, 1, sizeof(buffer) - 1, file); + if (length != strlen(contents)) + err(EXIT_FAILURE, "fread failed"); + buffer[length] = '\0'; + fclose(file); + + if (strcmp(buffer, contents) != 0) + errx(EXIT_FAILURE, "Written and read data differ"); + + /* Of special note here is that we are NOT deleting the temporary + * files we created in this test. Kyua takes care of this cleanup + * automatically and tests can (and should) rely on this behavior. */ +} + +int +main(void) +{ + /* If you have read the printf_test.c counterpart in the atf/ + * directory, you may think that the sequencing of tests below and + * the exposed behavior to the user is very similar. But you'd be + * wrong. + * + * There are two major differences with this and the ATF version. + * The first is that the code below has no provisions to detect + * failures in one test and continue running the other tests: the + * first failure causes the whole test program to exit. The second + * is that this particular main() has no arguments: without ATF, + * all test programs may expose a different command-line interface, + * and this is an issue for consistency purposes. */ + snprintf__two_formatters(); + snprintf__overflow(); + fprintf__simple_string(); + + return EXIT_SUCCESS; +} Added: head/share/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/tests/Makefile Mon Nov 18 12:57:46 2013 (r258299) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/share + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 13:12:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95A50D87; Mon, 18 Nov 2013 13:12:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8525F2965; Mon, 18 Nov 2013 13:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIDCjYp099753; Mon, 18 Nov 2013 13:12:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIDCjE3099752; Mon, 18 Nov 2013 13:12:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311181312.rAIDCjE3099752@svn.freebsd.org> From: Alexander Motin Date: Mon, 18 Nov 2013 13:12: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: r258300 - stable/9/sys/vm 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 13:12:45 -0000 Author: mav Date: Mon Nov 18 13:12:45 2013 New Revision: 258300 URL: http://svnweb.freebsd.org/changeset/base/258300 Log: MFC r239710 (by glebius): Fix function name in keg_cachespread_init() assert. Modified: stable/9/sys/vm/uma_core.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/uma_core.c ============================================================================== --- stable/9/sys/vm/uma_core.c Mon Nov 18 12:57:46 2013 (r258299) +++ stable/9/sys/vm/uma_core.c Mon Nov 18 13:12:45 2013 (r258300) @@ -1233,7 +1233,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= uma_max_ipers, - ("keg_small_init: keg->uk_ipers too high(%d) increase max_ipers", + ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 13:17:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A19FF3A; Mon, 18 Nov 2013 13:17:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59A8D29A1; Mon, 18 Nov 2013 13:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIDHv4c000713; Mon, 18 Nov 2013 13:17:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIDHv2P000712; Mon, 18 Nov 2013 13:17:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311181317.rAIDHv2P000712@svn.freebsd.org> From: Alexander Motin Date: Mon, 18 Nov 2013 13:17: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: r258301 - stable/9/sys/vm 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 13:17:57 -0000 Author: mav Date: Mon Nov 18 13:17:56 2013 New Revision: 258301 URL: http://svnweb.freebsd.org/changeset/base/258301 Log: MFC r240676 (by glebius): If caller specifies UMA_ZONE_OFFPAGE explicitly, then do not waste memory in an allocation for a slab. Modified: stable/9/sys/vm/uma_core.c Modified: stable/9/sys/vm/uma_core.c ============================================================================== --- stable/9/sys/vm/uma_core.c Mon Nov 18 13:12:45 2013 (r258300) +++ stable/9/sys/vm/uma_core.c Mon Nov 18 13:17:56 2013 (r258301) @@ -1122,7 +1122,9 @@ keg_small_init(uma_keg_t keg) keg->uk_rsize = rsize; keg->uk_ppera = 1; - if (keg->uk_flags & UMA_ZONE_REFCNT) { + if (keg->uk_flags & UMA_ZONE_OFFPAGE) { + shsize = 0; + } else if (keg->uk_flags & UMA_ZONE_REFCNT) { rsize += UMA_FRITMREF_SZ; /* linkage & refcnt */ shsize = sizeof(struct uma_slab_refcnt); } else { From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 13:20: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 602E924D; Mon, 18 Nov 2013 13:20:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F97929C7; Mon, 18 Nov 2013 13:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIDKLTh003113; Mon, 18 Nov 2013 13:20:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIDKL7N003112; Mon, 18 Nov 2013 13:20:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311181320.rAIDKL7N003112@svn.freebsd.org> From: Alexander Motin Date: Mon, 18 Nov 2013 13:20:21 +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: r258302 - stable/9/sys/vm 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 13:20:21 -0000 Author: mav Date: Mon Nov 18 13:20:20 2013 New Revision: 258302 URL: http://svnweb.freebsd.org/changeset/base/258302 Log: MFC r246087 (by glebius): Fix typo in debug printf. Modified: stable/9/sys/vm/uma_core.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/uma_core.c ============================================================================== --- stable/9/sys/vm/uma_core.c Mon Nov 18 13:17:56 2013 (r258301) +++ stable/9/sys/vm/uma_core.c Mon Nov 18 13:20:20 2013 (r258302) @@ -1678,7 +1678,7 @@ uma_startup(void *bootmem, int boot_page #ifdef UMA_DEBUG printf("Calculated uma_max_ipers (for OFFPAGE) is %d\n", uma_max_ipers); - printf("Calculated uma_max_ipers_slab (for OFFPAGE) is %d\n", + printf("Calculated uma_max_ipers_ref (for OFFPAGE) is %d\n", uma_max_ipers_ref); #endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 14:22:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id A3356656; Mon, 18 Nov 2013 14:22:26 +0000 (UTC) Date: Mon, 18 Nov 2013 14:22:26 +0000 From: Alexey Dokuchaev To: David C Somayajulu Subject: Re: svn commit: r258155 - head/sys/dev/qlxgbe Message-ID: <20131118142226.GA52991@FreeBSD.org> References: <201311150126.rAF1QPZq077225@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311150126.rAF1QPZq077225@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 14:22:26 -0000 On Fri, Nov 15, 2013 at 01:26:25AM +0000, David C Somayajulu wrote: > New Revision: 258155 > URL: http://svnweb.freebsd.org/changeset/base/258155 > > Log: > ql_hw.[c,h]: set minimum thresholds on pkt size for lro path. > ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP > > Submitted by:David C Somayajulu "Submitted by" tag is redundant when submitter == committer. In these cases, it simply clutters the log rather than adds anything useful. ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 14:55:33 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C55FC242; Mon, 18 Nov 2013 14:55:33 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D43202FE7; Mon, 18 Nov 2013 14:55:32 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1ViQEY-000NKp-BN; Mon, 18 Nov 2013 14:55:26 +0000 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 rAIEtN3q078488; Mon, 18 Nov 2013 07:55:23 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+yz5OKJMrGzsy5fRkUEhUi Subject: Re: svn commit: r258155 - head/sys/dev/qlxgbe From: Ian Lepore To: Alexey Dokuchaev In-Reply-To: <20131118142226.GA52991@FreeBSD.org> References: <201311150126.rAF1QPZq077225@svn.freebsd.org> <20131118142226.GA52991@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 18 Nov 2013 07:55:23 -0700 Message-ID: <1384786523.31172.467.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, David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 14:55:33 -0000 On Mon, 2013-11-18 at 14:22 +0000, Alexey Dokuchaev wrote: > On Fri, Nov 15, 2013 at 01:26:25AM +0000, David C Somayajulu wrote: > > New Revision: 258155 > > URL: http://svnweb.freebsd.org/changeset/base/258155 > > > > Log: > > ql_hw.[c,h]: set minimum thresholds on pkt size for lro path. > > ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP > > > > Submitted by:David C Somayajulu > > "Submitted by" tag is redundant when submitter == committer. In these > cases, it simply clutters the log rather than adds anything useful. > > ./danfe Not always. I put myself in Submitted By when I'm committing a patch from a PR I filed years ago before I was a committer (sadly there are enough of these that it's not a thing that just happened once). -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 15:11:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56F4B870; Mon, 18 Nov 2013 15:11:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4711F2107; Mon, 18 Nov 2013 15:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIFBEQ1046379; Mon, 18 Nov 2013 15:11:14 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIFBELV046378; Mon, 18 Nov 2013 15:11:14 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181511.rAIFBELV046378@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 15:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258305 - head/release 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 15:11:14 -0000 Author: gjb Date: Mon Nov 18 15:11:13 2013 New Revision: 258305 URL: http://svnweb.freebsd.org/changeset/base/258305 Log: Use the IMAGES variable to determine which image files to remove as part of 'make -C /usr/src/release clean'. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Nov 18 14:33:44 2013 (r258304) +++ head/release/Makefile Mon Nov 18 15:11:13 2013 (r258305) @@ -200,7 +200,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f disc1.iso bootonly.iso memstick.img + rm -f ${IMAGES} install: .if defined(DESTDIR) && !empty(DESTDIR) From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 15:13:58 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92D18BA4; Mon, 18 Nov 2013 15:13:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 824592124; Mon, 18 Nov 2013 15:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIFDw2U047664; Mon, 18 Nov 2013 15:13:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIFDwgY047663; Mon, 18 Nov 2013 15:13:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201311181513.rAIFDwgY047663@svn.freebsd.org> From: Dimitry Andric Date: Mon, 18 Nov 2013 15:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258306 - stable/10/sys/i386/conf X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 15:13:58 -0000 Author: dim Date: Mon Nov 18 15:13:58 2013 New Revision: 258306 URL: http://svnweb.freebsd.org/changeset/base/258306 Log: MFC r258016: Disable building the ctl module for the i386 XEN kernel configuration for now, since it causes gcc warnings about casting 64 bit bus_addr_t's to 32 bit pointers, and vice versa. Reviewed by: ken Approved by: re (gjb) Modified: stable/10/sys/i386/conf/XEN Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Mon Nov 18 15:11:13 2013 (r258305) +++ stable/10/sys/i386/conf/XEN Mon Nov 18 15:13:58 2013 (r258306) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl nve rdma sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl nve rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 15:22: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCFD8D9D; Mon, 18 Nov 2013 15:22:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC03421A4; Mon, 18 Nov 2013 15:22:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIFMuJB051365; Mon, 18 Nov 2013 15:22:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIFMuC1051359; Mon, 18 Nov 2013 15:22:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181522.rAIFMuC1051359@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 15:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258307 - in head/release: amd64 i386 scripts 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 15:22:56 -0000 Author: gjb Date: Mon Nov 18 15:22:55 2013 New Revision: 258307 URL: http://svnweb.freebsd.org/changeset/base/258307 Log: Add a script and configuration files to fetch pre-built packages from pkg.FreeBSD.org for inclusion on release medium (dvd1.iso). The script sources ${.CURDIR}/${TARGET}/pkg-stage.conf, which sets several environment variables, such as the pkg(8) ABI, PACKAGESITE, PKG_DBDIR, and PKG_CACHEDIR. PKG_CACHEDIR is set to the directory on the release medium used by bsdconfig(8) (/packages/${ABI}). ABI is determined by output of 'make -C /usr/src/release -V REVISION'. See pkg.conf(5) for descripton on other variables set here. The list of packages to include are set within the configuration file. The script and configuration files are intended to be run by the 'make dvd' target within the release directory, and assume the release is built within a chroot environment (such as by using release.sh). Relevant updates to release/Makefile will follow. Sponsored by: The FreeBSD Foundation Added: head/release/amd64/pkg-stage.conf (contents, props changed) head/release/i386/pkg-stage.conf (contents, props changed) head/release/scripts/pkg-stage.sh (contents, props changed) Added: head/release/amd64/pkg-stage.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/amd64/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307) @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" +export ASSUME_ALWAYS_YES=1 +export __PKG_CONF="/etc/pkg/FreeBSD.conf" +export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" +export MIRROR_TYPE="SRV" +export REPO_AUTOUPDATE="NO" +export PKG_DBDIR="/tmp/pkg" +export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PERMISSIVE="YES" +export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" + +DVD_PACKAGES="archivers/unzip +devel/subversion +devel/subversion-static +emulators/linux_base-f10 +misc/freebsd-doc-all +net/mpd5 +net/rsync +ports-mgmt/pkg +ports-mgmt/portaudit +ports-mgmt/portmaster +shells/bash +shells/zsh +security/sudo +sysutils/screen +www/firefox +www/links +x11-drivers/xf86-video-vmware +x11/gnome2 +x11/kde4 +x11/xorg" Added: head/release/i386/pkg-stage.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/i386/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307) @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:32" +export ASSUME_ALWAYS_YES=1 +export __PKG_CONF="/etc/pkg/FreeBSD.conf" +export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" +export MIRROR_TYPE="SRV" +export REPO_AUTOUPDATE="NO" +export PKG_DBDIR="/tmp/pkg" +export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PERMISSIVE="YES" +export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" + +DVD_PACKAGES="archivers/unzip +devel/subversion +devel/subversion-static +emulators/linux_base-f10 +misc/freebsd-doc-all +net/mpd5 +net/rsync +ports-mgmt/pkg +ports-mgmt/portaudit +ports-mgmt/portmaster +shells/bash +shells/zsh +security/sudo +sysutils/screen +www/firefox +www/links +x11-drivers/xf86-video-vmware +x11/gnome2 +x11/kde4 +x11/xorg" Added: head/release/scripts/pkg-stage.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/pkg-stage.sh Mon Nov 18 15:22:55 2013 (r258307) @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +set -e + +usage() { + echo "$(basename ${0}) /path/to/pkg-stage.conf revision" + exit 1 +} + +if [ ! -e "${1}" ]; then + echo "Configuration file not specified." + echo + usage +fi + +if [ "$#" -lt 2 ]; then + usage +fi + +# Source config file for this architecture. +REVISION="${2}" +. "${1}" || exit 1 + +if [ ! -x /usr/local/sbin/pkg ]; then + /usr/sbin/pkg bootstrap +fi + +/bin/mkdir -p ${PKG_CACHEDIR} + +${PKGCMD} update -f +${PKGCMD} fetch -d ${DVD_PACKAGES} + +${PKGCMD} repo ${PKG_CACHEDIR} + +# Always exit '0', even if pkg(8) complains about conflicts. +exit 0 From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 16:04:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 381CFDCE; Mon, 18 Nov 2013 16:04:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2778023F8; Mon, 18 Nov 2013 16:04:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIG45FN069896; Mon, 18 Nov 2013 16:04:05 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIG45sF069895; Mon, 18 Nov 2013 16:04:05 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181604.rAIG45sF069895@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 16:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258308 - head/release 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 16:04:05 -0000 Author: gjb Date: Mon Nov 18 16:04:04 2013 New Revision: 258308 URL: http://svnweb.freebsd.org/changeset/base/258308 Log: Unconditionally copy the build host /etc/resolv.conf into the chroot directory, since hostname resolution may be needed in the case of building a dvd image (with packages) and also setting 'NOPORTS=1'. MFC after: 3 days X-MFC-With: r258305, r258307 Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Mon Nov 18 15:22:55 2013 (r258307) +++ head/release/release.sh Mon Nov 18 16:04:04 2013 (r258308) @@ -159,6 +159,7 @@ if [ "x${NOPORTS}" = "x" ]; then svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports fi +cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf cd ${CHROOTDIR}/usr/src make ${CHROOT_WMAKEFLAGS} buildworld make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} @@ -193,7 +194,6 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO fi if [ -d ${CHROOTDIR}/usr/ports ]; then - cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf build_doc_ports ${CHROOTDIR} fi From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 16:09:00 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B57C6A3; Mon, 18 Nov 2013 16:09:00 +0000 (UTC) Date: Mon, 18 Nov 2013 16:09:00 +0000 From: Alexey Dokuchaev To: Ian Lepore Subject: Re: svn commit: r258155 - head/sys/dev/qlxgbe Message-ID: <20131118160900.GB75555@FreeBSD.org> References: <201311150126.rAF1QPZq077225@svn.freebsd.org> <20131118142226.GA52991@FreeBSD.org> <1384786523.31172.467.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1384786523.31172.467.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 16:09:00 -0000 On Mon, Nov 18, 2013 at 07:55:23AM -0700, Ian Lepore wrote: > On Mon, 2013-11-18 at 14:22 +0000, Alexey Dokuchaev wrote: > > On Fri, Nov 15, 2013 at 01:26:25AM +0000, David C Somayajulu wrote: > > > Submitted by:David C Somayajulu > > > > "Submitted by" tag is redundant when submitter == committer. In these > > cases, it simply clutters the log rather than adds anything useful. > > Not always. I put myself in Submitted By when I'm committing a patch > from a PR I filed years ago before I was a committer (sadly there are > enough of these that it's not a thing that just happened once). Even in this case, reference to the PR alone already does the job. ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 16:11:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4605C266; Mon, 18 Nov 2013 16:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 360CE2466; Mon, 18 Nov 2013 16:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIGBKa5073661; Mon, 18 Nov 2013 16:11:20 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIGBJ4s073655; Mon, 18 Nov 2013 16:11:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181611.rAIGBJ4s073655@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 16:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258309 - in head/release: amd64 i386 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 16:11:20 -0000 Author: gjb Date: Mon Nov 18 16:11:19 2013 New Revision: 258309 URL: http://svnweb.freebsd.org/changeset/base/258309 Log: Set the PKG_CACHEDIR directory to 'dvd/' instead of 'release/' in preparation of adding a 'dvd1.iso' target. MFC after: 3 days X-MFC-With: r258305, r258307, r258308 Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/pkg-stage.conf head/release/i386/pkg-stage.conf Modified: head/release/amd64/pkg-stage.conf ============================================================================== --- head/release/amd64/pkg-stage.conf Mon Nov 18 16:04:04 2013 (r258308) +++ head/release/amd64/pkg-stage.conf Mon Nov 18 16:11:19 2013 (r258309) @@ -10,7 +10,7 @@ export PACKAGESITE="http://pkg.FreeBSD.o export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" Modified: head/release/i386/pkg-stage.conf ============================================================================== --- head/release/i386/pkg-stage.conf Mon Nov 18 16:04:04 2013 (r258308) +++ head/release/i386/pkg-stage.conf Mon Nov 18 16:11:19 2013 (r258309) @@ -10,7 +10,7 @@ export PACKAGESITE="http://pkg.FreeBSD.o export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 16:25: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30B1B93D; Mon, 18 Nov 2013 16:25:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0742D2523; Mon, 18 Nov 2013 16:25:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIGPukG078817; Mon, 18 Nov 2013 16:25:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIGPuRG078815; Mon, 18 Nov 2013 16:25:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181625.rAIGPuRG078815@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 16:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258310 - head/release 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 16:25:57 -0000 Author: gjb Date: Mon Nov 18 16:25:56 2013 New Revision: 258310 URL: http://svnweb.freebsd.org/changeset/base/258310 Log: Add the 'dvd1.iso' target. This mimics the 'release.iso' target, with the additional step of fetching packages for inclusion on the dvd image. The 'pkg-stage' target is used to run 'scripts/pkg-stage.sh' if the '${TARGET}/pkg-stage.conf' configuration file exists (currently only amd64 and i386). Allow dvd1.iso to be skipped if NODVD=1. MFC after: 3 days X-MFC-With: r258305, r258307, r258308, r258309 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Nov 18 16:11:19 2013 (r258309) +++ head/release/Makefile Mon Nov 18 16:25:56 2013 (r258310) @@ -72,6 +72,10 @@ IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom IMAGES+= disc1.iso bootonly.iso +. if(!defined(NODVD)) +RELEASE_TARGETS+= dvdrom +IMAGES+= dvd1.iso +. endif .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img @@ -164,10 +168,33 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc +dvd: +# Install system + mkdir -p ${.TARGET} + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ + WITHOUT_PROFILE=1 +# Copy distfiles + mkdir -p ${.TARGET}/usr/freebsd-dist + cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist +# Copy documentation, if generated +.if !defined(NODOC) + cp reldoc/* ${.TARGET} +.endif +# Set up installation environment + ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf + echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf + echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + cp ${.CURDIR}/rc.local ${.TARGET}/etc + touch ${.TARGET} + release.iso: disc1.iso disc1.iso: system sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release +dvd1.iso: dvd pkg-stage + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} dvd + bootonly.iso: bootonly sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly @@ -183,7 +210,14 @@ packagesystem: base.txz kernel.txz ${EXT sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} +pkg-stage: +.if(exists(${.CURDIR}/${TARGET}/pkg-stage.conf)) + sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ + ${REVISION} +.endif + cdrom: disc1.iso bootonly.iso +dvdrom: dvd1.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -199,7 +233,7 @@ clean: rm -f packagesystem rm -f *.txz MANIFEST rm -f system - rm -rf release bootonly + rm -rf release bootonly dvd rm -f ${IMAGES} install: From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 16:51:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB4174E; Mon, 18 Nov 2013 16:51:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E78C275E; Mon, 18 Nov 2013 16:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIGpusc088969; Mon, 18 Nov 2013 16:51:56 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIGpuu4088968; Mon, 18 Nov 2013 16:51:56 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201311181651.rAIGpuu4088968@svn.freebsd.org> From: Alan Somers Date: Mon, 18 Nov 2013 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258311 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 16:51:56 -0000 Author: asomers Date: Mon Nov 18 16:51:56 2013 New Revision: 258311 URL: http://svnweb.freebsd.org/changeset/base/258311 Log: opensolaris/uts/common/dtrace/fasttrap.c Fix several problems that can cause panics on kldload and kldunload. * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before fasttrap_provs.fth_table gets allocated. This can lead to a panic on module load, because fasttrap_pid_cleanup_cb references fasttrap_provs.fth_table. Move kproc_create down after the point that fasttrap_provs.fth_table gets allocated, and modify the error handling accordingly. * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until after fasttrap_provs.fth_table got freed. That caused panics on module unload because fasttrap_exec_exit calls fasttrap_provider_retire, which references fasttrap_provs.fth_table. NULL those function pointers earlier. * There wasn't any code to destroy the fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload, leading to a resource leak when WITNESS is enabled. Destroy those mutexes during fasttrap_unload(). Reviewed by: markj Approved by: ken (mentor) Sponsored by: Spectra Logic MFC after: 4 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Nov 18 16:25:56 2013 (r258310) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Nov 18 16:51:56 2013 (r258311) @@ -2271,13 +2271,6 @@ fasttrap_load(void) mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, NULL); - ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, - &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); - if (ret != 0) { - destroy_dev(fasttrap_cdev); - return (ret); - } - #if defined(sun) fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT); @@ -2331,6 +2324,24 @@ fasttrap_load(void) "providers bucket mtx", MUTEX_DEFAULT, NULL); #endif + ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, + &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); + if (ret != 0) { + destroy_dev(fasttrap_cdev); +#if !defined(sun) + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); +#endif + kmem_free(fasttrap_provs.fth_table, fasttrap_provs.fth_nent * + sizeof (fasttrap_bucket_t)); + mtx_destroy(&fasttrap_cleanup_mtx); + mutex_destroy(&fasttrap_count_mtx); + return (ret); + } + + /* * ... and the procs hash table. */ @@ -2423,6 +2434,20 @@ fasttrap_unload(void) return (-1); } + /* + * Stop new processes from entering these hooks now, before the + * fasttrap_cleanup thread runs. That way all processes will hopefully + * be out of these hooks before we free fasttrap_provs.fth_table + */ + ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); + dtrace_fasttrap_fork = NULL; + + ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); + dtrace_fasttrap_exec = NULL; + + ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); + dtrace_fasttrap_exit = NULL; + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_drain = 1; /* Wait for the cleanup thread to finish up and signal us. */ @@ -2438,6 +2463,14 @@ fasttrap_unload(void) mutex_exit(&fasttrap_count_mtx); #endif +#if !defined(sun) + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_procs.fth_nent; i++) + mutex_destroy(&fasttrap_procs.fth_table[i].ftb_mtx); +#endif kmem_free(fasttrap_tpoints.fth_table, fasttrap_tpoints.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_tpoints.fth_nent = 0; @@ -2450,22 +2483,6 @@ fasttrap_unload(void) fasttrap_procs.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_procs.fth_nent = 0; - /* - * We know there are no tracepoints in any process anywhere in - * the system so there is no process which has its p_dtrace_count - * greater than zero, therefore we know that no thread can actively - * be executing code in fasttrap_fork(). Similarly for p_dtrace_probes - * and fasttrap_exec() and fasttrap_exit(). - */ - ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); - dtrace_fasttrap_fork = NULL; - - ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); - dtrace_fasttrap_exec = NULL; - - ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); - dtrace_fasttrap_exit = NULL; - #if !defined(sun) destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 17:03:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3633BB90; Mon, 18 Nov 2013 17:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 164562820; Mon, 18 Nov 2013 17:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIH3Bs3092826; Mon, 18 Nov 2013 17:03:11 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIH3BwC092824; Mon, 18 Nov 2013 17:03:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181703.rAIH3BwC092824@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 17:03: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: r258312 - in stable/9: release share/man/man7 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 17:03:12 -0000 Author: gjb Date: Mon Nov 18 17:03:11 2013 New Revision: 258312 URL: http://svnweb.freebsd.org/changeset/base/258312 Log: MFC r257805, r257806, r257807: r257805: Add a 'mini-memstick.img' release target, which will use the 'bootonly.iso' components to create a smaller memory stick image. This is useful for system recovery, where a full memstick.img image is not necessarily needed (or wanted). In addition, it is possible to do bootonly-style installation, where the base.txz, kernel.txz, etc. are fetched from a remote source. Provide backwards-compatible target (mini-memstick), to keep in sync with the targets documented in release/Makefile. r257806: Remove extra target from 'memstick' in r257805. r257807: Update release(7) to include 'mini-memstick' target. Sponsored by: The FreeBSD Foundation Modified: stable/9/release/Makefile stable/9/share/man/man7/release.7 Directory Properties: stable/9/release/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Mon Nov 18 16:51:56 2013 (r258311) +++ stable/9/release/Makefile Mon Nov 18 17:03:11 2013 (r258312) @@ -5,6 +5,7 @@ # User-driven targets: # cdrom: Builds release CD-ROM media (disc1.iso) # memstick: Builds memory stick image (memstick.img) +# mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area # install: Copies all release media into ${DESTDIR} @@ -74,7 +75,9 @@ IMAGES+= disc1.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img +RELEASE_TARGETS+= mini-memstick.img IMAGES+= memstick.img +IMAGES+= mini-memstick.img .endif .include @@ -181,6 +184,10 @@ memstick: memstick.img memstick.img: system sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} +mini-memstick: mini-memstick.img +mini-memstick.img: system + sh ${.CURDIR}/${TARGET}/make-memstick.sh bootonly ${.TARGET} + packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Mon Nov 18 16:51:56 2013 (r258311) +++ stable/9/share/man/man7/release.7 Mon Nov 18 17:03:11 2013 (r258312) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2013 +.Dd November 7, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -175,6 +175,11 @@ Not applicable on all platforms. Require .Xr md 4 (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). +.It Cm mini-memstick +Similar to +.Cm memstick , +with the exception that the installation distribution sets +are not included. .It Cm ftp Creates a directory named .Pa ftp From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 17:06:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 992FFD52; Mon, 18 Nov 2013 17:06:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EDEB284B; Mon, 18 Nov 2013 17:06:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIH6YEG093391; Mon, 18 Nov 2013 17:06:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIH6YT6093390; Mon, 18 Nov 2013 17:06:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181706.rAIH6YT6093390@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 17:06:34 +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: r258313 - stable/9/release 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 17:06:34 -0000 Author: gjb Date: Mon Nov 18 17:06:33 2013 New Revision: 258313 URL: http://svnweb.freebsd.org/changeset/base/258313 Log: MFC r257942, r258101: r257942: Fix a few style nits. r258101: Since the doc/ toolchain conversion to docbook 5.0, JADETEX is no longer a valid option, so remove 'WITHOUT_JADETEX=yes' from PBUILD_FLAGS. While here, also remove 'WITHOUT_X11=yes', since it will cause a dependency conflict by requiring both print/ghostscript9 and print/ghostscript9-nox11. Switch to OPTIONSNG format (WITHOUT_* -> OPTIONS_UNSET='FOO'), and unset the FOP option, which requires Java (although it is disabled by default). Also unset the 'IGOR' option, since textproc/igor is a validation tool, not necessarily a dependency of the doc/ build itself. While here, reduce the line length of PBUILD_FLAGS. Sponsored by: The FreeBSD Foundation Modified: stable/9/release/release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/release.sh ============================================================================== --- stable/9/release/release.sh Mon Nov 18 17:03:11 2013 (r258312) +++ stable/9/release/release.sh Mon Nov 18 17:06:33 2013 (r258313) @@ -125,10 +125,10 @@ fi # instead of their values. DOCPORTS= if [ "x${NOPORTS}" != "x" ]; then - DOCPORTS="NOPORTS=yes " + DOCPORTS="NOPORTS=yes " fi if [ "x${NODOC}" != "x" ]; then - DOCPORTS="${DOCPORTS}NODOC=yes" + DOCPORTS="${DOCPORTS}NODOC=yes" fi # The aggregated build-time flags based upon variables defined within @@ -147,7 +147,7 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO # Force src checkout if configured FORCE_SRC_KEY= if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then - FORCE_SRC_KEY="--force" + FORCE_SRC_KEY="--force" fi if [ ! ${CHROOTDIR} ]; then @@ -189,7 +189,8 @@ build_doc_ports() { ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes WITHOUT_X11=yes BATCH=yes" + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} OPTIONS_UNSET='FOP IGOR'" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ ${PBUILD_FLAGS} install clean distclean fi From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 17:52: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A0DF381; Mon, 18 Nov 2013 17:52:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2102B24; Mon, 18 Nov 2013 17:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIHqIhQ009304; Mon, 18 Nov 2013 17:52:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIHqIQo009302; Mon, 18 Nov 2013 17:52:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181752.rAIHqIQo009302@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 17:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258314 - in head/release: amd64 i386 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 17:52:19 -0000 Author: gjb Date: Mon Nov 18 17:52:18 2013 New Revision: 258314 URL: http://svnweb.freebsd.org/changeset/base/258314 Log: Fix how ABI is evaluated so it matches more than a dot-zero case. MFC after: 3 days X-MFC-With: r258310 Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/pkg-stage.conf head/release/i386/pkg-stage.conf Modified: head/release/amd64/pkg-stage.conf ============================================================================== --- head/release/amd64/pkg-stage.conf Mon Nov 18 17:06:33 2013 (r258313) +++ head/release/amd64/pkg-stage.conf Mon Nov 18 17:52:18 2013 (r258314) @@ -3,7 +3,7 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" +export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:64" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" Modified: head/release/i386/pkg-stage.conf ============================================================================== --- head/release/i386/pkg-stage.conf Mon Nov 18 17:06:33 2013 (r258313) +++ head/release/i386/pkg-stage.conf Mon Nov 18 17:52:18 2013 (r258314) @@ -3,7 +3,7 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:32" +export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:32" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 18:14:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 095D0D60; Mon, 18 Nov 2013 18:14:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED56F2C8C; Mon, 18 Nov 2013 18:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIIENOj017173; Mon, 18 Nov 2013 18:14:23 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIIEN24017172; Mon, 18 Nov 2013 18:14:23 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201311181814.rAIIEN24017172@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 18 Nov 2013 18:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258316 - head/lib/libiconv_modules/UTF7 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 18:14:24 -0000 Author: tijl Date: Mon Nov 18 18:14:23 2013 New Revision: 258316 URL: http://svnweb.freebsd.org/changeset/base/258316 Log: Bug fixes in iconv(3) UTF-7 support. - Add ' to the list of directly encoded characters and * to the list of optionally directly encoded characters as per RFC 2152. - In _citrus_UTF7_mbtoutf16 on end of input when the next output character has only been partially decoded, save a copy of the buffer of input characters (not just its length). On the next call with more input characters this buffer is reprocessed together with the new input to form a fully decoded output character. - At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT) by decrementing psenc->chlen and i. This is needed to make room in psenc->ch (input buffer) in case the next input character starts a new base64 encoded sequence. And also, if this is the end of input and no output character can be returned, this brings the encoder in the initial state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which is used by the caller to distinguish between no output and partial output. - In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer) directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0). This way s is updated correctly in case of errors. - In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set (previous call did not have enough input), retrieve the previously decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of (psenc->cache >> 2). MFC after: 5 days Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c ============================================================================== --- head/lib/libiconv_modules/UTF7/citrus_utf7.c Mon Nov 18 18:03:52 2013 (r258315) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.c Mon Nov 18 18:14:23 2013 (r258316) @@ -113,9 +113,9 @@ static const char base64[] = static const char direct[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" - "0123456789(),-./:?"; + "0123456789'(),-./:?"; -static const char option[] = "!\"#$%&';<=>@[]^_`{|}"; +static const char option[] = "!\"#$%&*;<=>@[]^_`{|}"; static const char spaces[] = " \t\r\n"; #define BASE64_BIT 6 @@ -165,6 +165,7 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo *nresult = (size_t)-2; *s = s0; sv.chlen = psenc->chlen; + memcpy(sv.ch, psenc->ch, sizeof(sv.ch)); *psenc = sv; return (0); } @@ -202,6 +203,9 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo goto ilseq; *u16 = (uint16_t)psenc->ch[i]; done = 1; + } else { + psenc->chlen--; + i--; } } else { psenc->cache = @@ -241,7 +245,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { - const char *s0; uint32_t u32; uint16_t hi, lo; size_t nr, siz; @@ -252,14 +255,13 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT; return (0); } - s0 = *s; if (psenc->surrogate) { - hi = (psenc->cache >> 2) & UTF16_MAX; + hi = (psenc->cache >> psenc->bits) & UTF16_MAX; if (hi < HISRG_MIN || hi > HISRG_MAX) return (EINVAL); siz = 0; } else { - err = _citrus_UTF7_mbtoutf16(ei, &hi, &s0, n, psenc, &nr); + err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { *nresult = nr; return (err); @@ -274,7 +276,7 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI } psenc->surrogate = 1; } - err = _citrus_UTF7_mbtoutf16(ei, &lo, &s0, n, psenc, &nr); + err = _citrus_UTF7_mbtoutf16(ei, &lo, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { *nresult = nr; return (err); @@ -286,7 +288,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI u32 = (hi << 10 | lo) + SRG_BASE; siz += nr; done: - *s = s0; if (pwc != NULL) *pwc = (wchar_t)u32; if (u32 == (uint32_t)0) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 18:45: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7832C7AB; Mon, 18 Nov 2013 18:45:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6842E2E5B; Mon, 18 Nov 2013 18:45:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIIjSeH027212; Mon, 18 Nov 2013 18:45:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIIjSKb027211; Mon, 18 Nov 2013 18:45:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181845.rAIIjSKb027211@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 18:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258317 - head/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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 18:45:28 -0000 Author: gjb Date: Mon Nov 18 18:45:27 2013 New Revision: 258317 URL: http://svnweb.freebsd.org/changeset/base/258317 Log: Document the 'dvdrom' target. MFC after: 3 days X-MFC-With: r258310 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Mon Nov 18 18:14:23 2013 (r258316) +++ head/share/man/man7/release.7 Mon Nov 18 18:45:27 2013 (r258317) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2013 +.Dd November 18, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -230,6 +230,10 @@ When set, will prevent the .Fa doc.txz distribution package from being created. +.It Va NODVD +Set to a non-empty value to skip the +.Cm dvdrom +target. .It Va NOPORTS Set to a non-empty value to skip the .Li ports/ @@ -270,6 +274,15 @@ This target produces files called and .Pa bootonly.iso as its output. +.It Cm dvdrom +Builds installation DVD-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 the +.Pa dvd1.iso +file as its output. .It Cm memstick Builds an installation memory stick image named .Pa memstick.img . @@ -302,7 +315,8 @@ Builds a bootable installation system co packaged by the .Cm packagesystem target, and suitable for imaging by the -.Cm cdrom +.Cm cdrom , +.Cm dvdrom and .Cm memstick targets. From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 18:49:22 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B681297D; Mon, 18 Nov 2013 18:49:22 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1A52E99; Mon, 18 Nov 2013 18:49:21 +0000 (UTC) Received: from alph.d.allbsd.org (p4181-ipbf1307funabasi.chiba.ocn.ne.jp [123.225.173.181]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id rAIIn2r5038926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Nov 2013 03:49:13 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id rAIIn0DS080290; Tue, 19 Nov 2013 03:49:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 19 Nov 2013 03:48:52 +0900 (JST) Message-Id: <20131119.034852.1148136397426813684.hrs@allbsd.org> To: gjb@FreeBSD.org Subject: Re: svn commit: r258310 - head/release From: Hiroki Sato In-Reply-To: <201311181625.rAIGPuRG078815@svn.freebsd.org> <201311181752.rAIHqIQo009302@svn.freebsd.org> References: <201311181625.rAIGPuRG078815@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Nov_19_03_48_52_2013_088)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 19 Nov 2013 03:49:13 +0900 (JST) X-Spam-Status: No, score=-99.0 required=13.0 tests=CONTENT_TYPE_PRESENT, SPF_SOFTFAIL,USER_IN_WHITELIST,X_CHINESE_RELAY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 18:49:22 -0000 ----Security_Multipart(Tue_Nov_19_03_48_52_2013_088)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Glen Barber wrote in <201311181625.rAIGPuRG078815@svn.freebsd.org>: gj> Author: gjb gj> Date: Mon Nov 18 16:25:56 2013 gj> New Revision: 258310 gj> URL: http://svnweb.freebsd.org/changeset/base/258310 gj> gj> Log: gj> Add the 'dvd1.iso' target. This mimics the 'release.iso' target, gj> with the additional step of fetching packages for inclusion on the gj> dvd image. gj> gj> The 'pkg-stage' target is used to run 'scripts/pkg-stage.sh' if gj> the '${TARGET}/pkg-stage.conf' configuration file exists (currently gj> only amd64 and i386). gj> gj> Allow dvd1.iso to be skipped if NODVD=1. ... gj> +dvd: gj> +# Install system gj> + mkdir -p ${.TARGET} gj> + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ gj> + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ gj> + WITHOUT_PROFILE=1 Please remove WITHOUT_PROFILE=1 here. Glen Barber wrote in <201311181752.rAIHqIQo009302@svn.freebsd.org>: gj> Modified: head/release/amd64/pkg-stage.conf gj> ============================================================================== gj> --- head/release/amd64/pkg-stage.conf Mon Nov 18 17:06:33 2013 (r258313) gj> +++ head/release/amd64/pkg-stage.conf Mon Nov 18 17:52:18 2013 (r258314) gj> @@ -3,7 +3,7 @@ gj> # $FreeBSD$ gj> # gj> gj> -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" gj> +export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:64" PKG_ABI=freebsd:${REVISION%.[0-9]*}:x86:64 is simpler than invoking tr or sed. However, pkg-stage.sh should have a mapping rule from TARGET and TARGET_ARCH, not in arch specific config files, I think. Other than the package list, variables are not arch-specific. Does this guarantee that the packages downloaded by pkg(8) are for a specific release? And I think fetching packages can be done just after svn co stage in release.sh. Collecting up necessity of network access (including fetching distfiles for docproj) before entering the chroot environment makes redoing the release build easier. -- Hiroki ----Security_Multipart(Tue_Nov_19_03_48_52_2013_088)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEUEABECAAYFAlKKYRQACgkQTyzT2CeTzy3x4wCY9O9GcfWaF57VxCMpcyTMme3f KwCgokmS9lFwsO8iXqYDMSsgZ4C6CG4= =g1FS -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Nov_19_03_48_52_2013_088)---- From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 19:13:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CE804D0; Mon, 18 Nov 2013 19:13:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC2E2059; Mon, 18 Nov 2013 19:13:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIJDcRE038938; Mon, 18 Nov 2013 19:13:38 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIJDc4U038937; Mon, 18 Nov 2013 19:13:38 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201311181913.rAIJDc4U038937@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 18 Nov 2013 19:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258318 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 19:13:39 -0000 Author: tijl Date: Mon Nov 18 19:13:38 2013 New Revision: 258318 URL: http://svnweb.freebsd.org/changeset/base/258318 Log: Also delete lib32 libiconv. Reported by: Tomoaki AOKI MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Nov 18 18:45:27 2013 (r258317) +++ head/ObsoleteFiles.inc Mon Nov 18 19:13:38 2013 (r258318) @@ -53,6 +53,10 @@ OLD_FILES+=usr/lib/libiconv.a OLD_FILES+=usr/lib/libiconv.so OLD_FILES+=usr/lib/libiconv.so.3 OLD_FILES+=usr/lib/libiconv_p.a +OLD_FILES+=usr/lib32/libiconv.a +OLD_FILES+=usr/lib32/libiconv.so +OLD_FILES+=usr/lib32/libiconv.so.3 +OLD_FILES+=usr/lib32/libiconv_p.a # 20131103: removal of utxrm(8), use 'utx rm' instead. OLD_FILES+=usr/sbin/utxrm OLD_FILES+=usr/share/man/man8/utxrm.8.gz From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 19:55: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C543FBD; Mon, 18 Nov 2013 19:55:10 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 726A12363; Mon, 18 Nov 2013 19:55:10 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A0F0B140B6; Mon, 18 Nov 2013 19:55:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A0F0B140B6 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 18 Nov 2013 14:55:06 -0500 From: Glen Barber To: Hiroki Sato Subject: Re: svn commit: r258310 - head/release Message-ID: <20131118195506.GT1643@glenbarber.us> References: <201311181625.rAIGPuRG078815@svn.freebsd.org> <20131119.034852.1148136397426813684.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3pZQ0wszfDg7ZRO+" Content-Disposition: inline In-Reply-To: <20131119.034852.1148136397426813684.hrs@allbsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 19:55:10 -0000 --3pZQ0wszfDg7ZRO+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 19, 2013 at 03:48:52AM +0900, Hiroki Sato wrote: > gj> +dvd: > gj> +# Install system > gj> + mkdir -p ${.TARGET} > gj> + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ > gj> + DESTDIR=3D${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=3D1 WITHOUT_KERNEL_= SYMBOLS=3D1 \ > gj> + WITHOUT_PROFILE=3D1 >=20 > Please remove WITHOUT_PROFILE=3D1 here. >=20 Ok. > gj> -export PKG_ABI=3D"freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" > gj> +export PKG_ABI=3D"freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//')= :x86:64" >=20 > PKG_ABI=3Dfreebsd:${REVISION%.[0-9]*}:x86:64 is simpler than invoking > tr or sed. However, pkg-stage.sh should have a mapping rule from > TARGET and TARGET_ARCH, not in arch specific config files, I think. > Other than the package list, variables are not arch-specific. >=20 The pkg(8) ABI does not map directly to anything we use ('amd64' or 'i386') unfortunately. > Does this guarantee that the packages downloaded by pkg(8) are for a > specific release? And I think fetching packages can be done just > after svn co stage in release.sh. Collecting up necessity of network > access (including fetching distfiles for docproj) before entering the > chroot environment makes redoing the release build easier. >=20 I don't think it has been discussed yet where packages built for a specific release will exist. Anyway, I would like to avoid directory hierarchy pollution outside of the dvd/ directory, this is why I use it for PKG_CACHEDIR directly. Glen --3pZQ0wszfDg7ZRO+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSinCaAAoJELls3eqvi17QS/sP/R4uw45LEMK+6S7oCtfTFMNY kO0P4Ta8J2RUOEGnXuGC2ELyaqWKVC3zNJwqOJQGXIQFwGQ4nHkLU2CXeyOPE6C2 FT2R/H8ciXIB4WB1Lz7oHeTKNt19AafYDR/Iw7AzwJTbgrCoiwAkVSXB4E5XtB6Z SXWiv11euIwQhP0ZiUTbrRlm9bIezIZvBJkZIWt2fM2joMeGWCyUFO5fWSIQF8UM t9ruUDdreXVj1PVyZGIZAGFIEOF4e1Yddqu7owysiyNDW2gU7skTLqWj+h+6V4dy Nl/V3vNF9EgIc6CDZccKfqkEGGN9DHAt40ANfN2qAE+5SPRfXs+CGjHxz06o0pnM xzRMYzgQKKmnoGKZG0HpCEVNCmBqgqZ3m6C/690chnqn1N086i2bmnexsYps+aAA xNZrqwscb8c+54TQWD7AyK08b103o9y817ZqCAk7OnxbB30IOFCBII8qAc6iDlUO DAPosvwdzTEol2LPhPMqNxias+PUSSco9luWAa0INxhytf4CmMRjLMk6uUF+BBd1 9EJl1oTEfmYeowHkAGH9Irq3wM+iQccFSrHUB222NOrUwBRZc7O7mCvuBSIdhIWo upvw3v9z3M0pQbJPuOpb/VaOZz+gNlh8zExX0rMIoin6yMnQWtOXGqxa/sVh/2bF tUO6tqdgFmogrYboJQ9d =YIHL -----END PGP SIGNATURE----- --3pZQ0wszfDg7ZRO+-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 19:57:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27D5F3BB; Mon, 18 Nov 2013 19:57:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1769F238E; Mon, 18 Nov 2013 19:57:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIJvBGj061869; Mon, 18 Nov 2013 19:57:11 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIJvBjA061868; Mon, 18 Nov 2013 19:57:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311181957.rAIJvBjA061868@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 19:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258319 - head/release 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 19:57:13 -0000 Author: gjb Date: Mon Nov 18 19:57:11 2013 New Revision: 258319 URL: http://svnweb.freebsd.org/changeset/base/258319 Log: Remove WITHOUT_PROFILE=1 for the dvd1.iso medium. Requested by: hrs MFC after: 3 days X-MFC-With: r258310 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Nov 18 19:13:38 2013 (r258318) +++ head/release/Makefile Mon Nov 18 19:57:11 2013 (r258319) @@ -172,8 +172,7 @@ dvd: # Install system mkdir -p ${.TARGET} cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 20:01: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2042C712; Mon, 18 Nov 2013 20:01:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA2823F0; Mon, 18 Nov 2013 20:01:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIK1q6v040764; Mon, 18 Nov 2013 20:01:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIK1qNe040752; Mon, 18 Nov 2013 20:01:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311182001.rAIK1qNe040752@svn.freebsd.org> From: Glen Barber Date: Mon, 18 Nov 2013 20:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258320 - in head/release: amd64 i386 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 20:01:53 -0000 Author: gjb Date: Mon Nov 18 20:01:52 2013 New Revision: 258320 URL: http://svnweb.freebsd.org/changeset/base/258320 Log: Simplify PKG_ABI for pkg-stage.sh. Submitted by: hrs MFC after: 3 days X-MFC-With: r258310 Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/pkg-stage.conf head/release/i386/pkg-stage.conf Modified: head/release/amd64/pkg-stage.conf ============================================================================== --- head/release/amd64/pkg-stage.conf Mon Nov 18 19:57:11 2013 (r258319) +++ head/release/amd64/pkg-stage.conf Mon Nov 18 20:01:52 2013 (r258320) @@ -3,7 +3,7 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:64" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:64" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" Modified: head/release/i386/pkg-stage.conf ============================================================================== --- head/release/i386/pkg-stage.conf Mon Nov 18 19:57:11 2013 (r258319) +++ head/release/i386/pkg-stage.conf Mon Nov 18 20:01:52 2013 (r258320) @@ -3,7 +3,7 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:32" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:32" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 20:21:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3204DDDA; Mon, 18 Nov 2013 20:21:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 075F32519; Mon, 18 Nov 2013 20:21:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIKLiRN053926; Mon, 18 Nov 2013 20:21:44 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIKLilA053925; Mon, 18 Nov 2013 20:21:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201311182021.rAIKLilA053925@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 18 Nov 2013 20:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258321 - head/contrib/gcc 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 20:21:45 -0000 Author: pfg Date: Mon Nov 18 20:21:44 2013 New Revision: 258321 URL: http://svnweb.freebsd.org/changeset/base/258321 Log: gcc: Record some previous commits in the gcc43 ChangeLog. It is useful to update the ChangeLog with upstream references related to our local r189824 and r255095. MFC after: 3 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Mon Nov 18 20:01:52 2013 (r258320) +++ head/contrib/gcc/ChangeLog.gcc43 Mon Nov 18 20:21:44 2013 (r258321) @@ -1,3 +1,9 @@ +2007-08-08 Andrew Haley (r128087) + + * config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New. + * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New. + * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 @@ -365,6 +371,35 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-10-31 Geoffrey Keating (r118356) + + * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on + inline static functions in c99 mode. + + PR 16622 + * doc/extend.texi (Inline): Update. + * c-tree.h (struct language_function): Remove field 'extern_inline'. + * c-decl.c (current_extern_inline): Delete. + (pop_scope): Adjust test for an undefined nested function. + Add warning about undeclared inline function. + (diagnose_mismatched_decls): Update comments. Disallow overriding + of inline functions in a translation unit in C99. Allow inline + declarations in C99 at any time. + (merge_decls): Boolize variables. Handle C99 'extern inline' + semantics. + (grokdeclarator): Set DECL_EXTERNAL here for functions. Handle + C99 inline semantics. + (start_function): Don't clear current_extern_inline. Don't set + DECL_EXTERNAL. + (c_push_function_context): Don't push current_extern_inline. + (c_pop_function_context): Don't restore current_extern_inline. + + PR 11377 + * c-typeck.c (build_external_ref): Warn about static variables + used in extern inline functions. + * c-decl.c (start_decl): Warn about static variables declared + in extern inline functions. + 2006-10-27 Vladimir Makarov (r118090) * config/i386/i386.h (TARGET_GEODE): From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 20:36: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC62A296; Mon, 18 Nov 2013 20:36:05 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1256325E3; Mon, 18 Nov 2013 20:36:03 +0000 (UTC) Received: from alph.d.allbsd.org (p4181-ipbf1307funabasi.chiba.ocn.ne.jp [123.225.173.181]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id rAIKZks3051497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Nov 2013 05:35:56 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id rAIKZije081357; Tue, 19 Nov 2013 05:35:46 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 19 Nov 2013 05:29:24 +0900 (JST) Message-Id: <20131119.052924.2179352866091983302.hrs@allbsd.org> To: gjb@FreeBSD.org Subject: Re: svn commit: r258310 - head/release From: Hiroki Sato In-Reply-To: <20131118195506.GT1643@glenbarber.us> References: <201311181625.rAIGPuRG078815@svn.freebsd.org> <20131119.034852.1148136397426813684.hrs@allbsd.org> <20131118195506.GT1643@glenbarber.us> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Nov_19_05_29_24_2013_048)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 19 Nov 2013 05:35:56 +0900 (JST) X-Spam-Status: No, score=-99.1 required=13.0 tests=CONTENT_TYPE_PRESENT, SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 20:36:06 -0000 ----Security_Multipart(Tue_Nov_19_05_29_24_2013_048)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Glen Barber wrote in <20131118195506.GT1643@glenbarber.us>: gj> > gj> -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" gj> > gj> +export PKG_ABI="freebsd:$(echo ${REVISION} | sed -e 's/\.[0-9]//'):x86:64" gj> > gj> > PKG_ABI=freebsd:${REVISION%.[0-9]*}:x86:64 is simpler than invoking gj> > tr or sed. However, pkg-stage.sh should have a mapping rule from gj> > TARGET and TARGET_ARCH, not in arch specific config files, I think. gj> > Other than the package list, variables are not arch-specific. gj> > gj> The pkg(8) ABI does not map directly to anything we use ('amd64' or gj> 'i386') unfortunately. Yes, it is true that it does not map TARGET/TARGET_ARCH directly. What I mean is that it can be easily translated in pkg-stage.sh by adding a mapping rule there like this: case ${TARGET}:{TARGET_ARCH} in amd64:*) PKG_ABI=x86:64 ;; ... esac Depending files in arch-specific directory makes maintenance difficult when the number of archs and combinations of TARGET/TARGET_ARCH increase. It can happen when arm and mips are handled in make release and the package server. Eliminating/reducing manually-configured variables which can be derived from other ones is always a good practice. gj> > Does this guarantee that the packages downloaded by pkg(8) are for a gj> > specific release? And I think fetching packages can be done just gj> > after svn co stage in release.sh. Collecting up necessity of network gj> > access (including fetching distfiles for docproj) before entering the gj> > chroot environment makes redoing the release build easier. gj> > gj> gj> I don't think it has been discussed yet where packages built for gj> a specific release will exist. Anyway, I would like to avoid directory gj> hierarchy pollution outside of the dvd/ directory, this is why I use it gj> for PKG_CACHEDIR directly. So I think it should be discussed and we should make the script to consistently fetch the package set built from the release branch (or head for stable or snapshots) in the ports tree. While I guess the current one simply fetches the latest packages, the release iso images must have packages which correspond to ports.txz. -- Hiroki ----Security_Multipart(Tue_Nov_19_05_29_24_2013_048)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlKKeKQACgkQTyzT2CeTzy3gPgCgmdpEiKdLKONFFlVmHhTgdynD Q5kAniwclnQUjGn7b1Vx7NFbVhkmAd37 =dWpu -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Nov_19_05_29_24_2013_048)---- From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 20:40:42 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 814635DA; Mon, 18 Nov 2013 20:40:42 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC412639; Mon, 18 Nov 2013 20:40:42 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id B5604144F1; Mon, 18 Nov 2013 20:40:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us B5604144F1 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 18 Nov 2013 15:40:38 -0500 From: Glen Barber To: Hiroki Sato Subject: Re: svn commit: r258310 - head/release Message-ID: <20131118204038.GU1643@glenbarber.us> References: <201311181625.rAIGPuRG078815@svn.freebsd.org> <20131119.034852.1148136397426813684.hrs@allbsd.org> <20131118195506.GT1643@glenbarber.us> <20131119.052924.2179352866091983302.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EsfvRFssnM00t552" Content-Disposition: inline In-Reply-To: <20131119.052924.2179352866091983302.hrs@allbsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 20:40:42 -0000 --EsfvRFssnM00t552 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 19, 2013 at 05:29:24AM +0900, Hiroki Sato wrote: > Glen Barber wrote > in <20131118195506.GT1643@glenbarber.us>: >=20 > gj> > gj> -export PKG_ABI=3D"freebsd:$(echo ${REVISION} | tr -d '.0'):x86= :64" > gj> > gj> +export PKG_ABI=3D"freebsd:$(echo ${REVISION} | sed -e 's/\.[0-= 9]//'):x86:64" > gj> > > gj> > PKG_ABI=3Dfreebsd:${REVISION%.[0-9]*}:x86:64 is simpler than invok= ing > gj> > tr or sed. However, pkg-stage.sh should have a mapping rule from > gj> > TARGET and TARGET_ARCH, not in arch specific config files, I think. > gj> > Other than the package list, variables are not arch-specific. > gj> > > gj> The pkg(8) ABI does not map directly to anything we use ('amd64' or > gj> 'i386') unfortunately. >=20 > Yes, it is true that it does not map TARGET/TARGET_ARCH directly. > What I mean is that it can be easily translated in pkg-stage.sh by > adding a mapping rule there like this: >=20 > case ${TARGET}:{TARGET_ARCH} in > amd64:*) PKG_ABI=3Dx86:64 ;; > ... > esac >=20 That is kind of the problem though. The ABI for amd64 is not x86:64, it is: $(uname -s | tr '[:upper:]' '[:lower:]'):${REVISION%.[0-9]}:x86:64 I do plan to redo quite a bit of this script, but it is good enough for a solution to the "we have nothing at all right now" problem for 10.0-RELEASE. > Depending files in arch-specific directory makes maintenance > difficult when the number of archs and combinations of > TARGET/TARGET_ARCH increase. It can happen when arm and mips are > handled in make release and the package server. Eliminating/reducing > manually-configured variables which can be derived from other ones is > always a good practice. >=20 > gj> > Does this guarantee that the packages downloaded by pkg(8) are for= a > gj> > specific release? And I think fetching packages can be done just > gj> > after svn co stage in release.sh. Collecting up necessity of netw= ork > gj> > access (including fetching distfiles for docproj) before entering = the > gj> > chroot environment makes redoing the release build easier. > gj> > > gj> > gj> I don't think it has been discussed yet where packages built for > gj> a specific release will exist. Anyway, I would like to avoid directo= ry > gj> hierarchy pollution outside of the dvd/ directory, this is why I use = it > gj> for PKG_CACHEDIR directly. >=20 > So I think it should be discussed and we should make the script to > consistently fetch the package set built from the release branch (or > head for stable or snapshots) in the ports tree. While I guess the > current one simply fetches the latest packages, the release iso > images must have packages which correspond to ports.txz. >=20 Agreed. Glen --EsfvRFssnM00t552 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSintGAAoJELls3eqvi17QIs8P/j9HVljmUxS4Y8nTT5L9EpXK GoZUo+2TculNkvk7/vtxDZRlujkwc3Qr8V3UEf1T6A+18CTAX+fFFGcRdXExnQpc MJ4e5g4f444Tt2ihlErlaoTF7C3pfAFFa+0RANIhZPG7kslcWir385lT6xQHrilN pjiWPzkOFASOLOr+m9L2c2+HT4oqkgNAQC2wxtbkuuRIHDJIZoUkHkoiZmvzFaS7 +3KzxbP1zjAd2wb7VToehdadWswOSJYF+4O7d/6JlXUSumOg6/jISUTYYVfsNrDf klxjmwFndLx5rVfSvVwQ32jsv78zEwNYvcXL7GUCgvB8dE8w7w7wBjJ7HUzmJ38F cd6oBiwKSx+fkc6soMmvvbTfZQl9a1tKjM0we6v8xLFSP55yBQZ6kTWJPvv4QqmC v0X5TUGHzqU7vPZxDhpVhZnVamdTpj44xdSpcs4YrgeDLiH3zx+yJubAA32dl99M eChia5Cm4GOl6I/0i9o4J3SDdNgs5yqz6AeMvaCmWDjg+nlT/03V3FQvOUpkif+V LJ7IY2zn3Qlt9jGT9Czo9uw+Sl+rpSiBMHG+2v2MTwsZHQG2SB8QR8Nb4xPBkYCY V86ZZHAqjYJxW1ZR47hP5RNFEgSsJ56EAKC9aX6lM5c7GfQWmilgQvavepxmpsdr 0grYwRqBG5QevyevfULS =IYBz -----END PGP SIGNATURE----- --EsfvRFssnM00t552-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 22:37: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7C9ACBF; Mon, 18 Nov 2013 22:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B78002C12; Mon, 18 Nov 2013 22:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMb2ZT041819; Mon, 18 Nov 2013 22:37:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMb1om041807; Mon, 18 Nov 2013 22:37:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201311182237.rAIMb1om041807@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 18 Nov 2013 22:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258324 - in stable/10: share/man/man4 sys/kern sys/sys usr.bin/procstat X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 22:37:03 -0000 Author: pjd Date: Mon Nov 18 22:37:01 2013 New Revision: 258324 URL: http://svnweb.freebsd.org/changeset/base/258324 Log: MFC r258148,r258149,r258150,r258152,r258153,r258154,r258181,r258182: r258148: Add a note that this file is compiled as part of the kernel and libc. Requested by: kib r258149: Change cap_rights_merge(3) and cap_rights_remove(3) to return pointer to the destination cap_rights_t structure. This already matches manual page. r258150: Sync return value with actual implementation. r258151: Style. r258152: Precisely document capability rights here too (they are already documented in rights(4)). r258153: The CAP_LINKAT, CAP_MKDIRAT, CAP_MKFIFOAT, CAP_MKNODAT, CAP_RENAMEAT, CAP_SYMLINKAT and CAP_UNLINKAT capability rights make no sense without the CAP_LOOKUP right, so include this rights. r258154: - Move CAP_EXTATTR_* and CAP_ACL_* rights to index 1 to have more room in index 0 for the future. - Move CAP_BINDAT and CAP_CONNECTAT rights to index 0 so we can include CAP_LOOKUP right in them. - Shuffle the bits around so there are no gaps. This is last chance to do that as all moved rights are not used yet. r258181: Replace CAP_POLL_EVENT and CAP_POST_EVENT capability rights (which I had a very hard time to fully understand) with much more intuitive rights: CAP_EVENT - when set on descriptor, the descriptor can be monitored with syscalls like select(2), poll(2), kevent(2). CAP_KQUEUE_EVENT - When set on a kqueue descriptor, the kevent(2) syscall can be called on this kqueue to with the eventlist argument set to non-NULL value; in other words the given kqueue descriptor can be used to monitor other descriptors. CAP_KQUEUE_CHANGE - When set on a kqueue descriptor, the kevent(2) syscall can be called on this kqueue to with the changelist argument set to non-NULL value; in other words it allows to modify events monitored with the given kqueue descriptor. Add alias CAP_KQUEUE, which allows for both CAP_KQUEUE_EVENT and CAP_KQUEUE_CHANGE. Add backward compatibility define CAP_POLL_EVENT which is equal to CAP_EVENT. r258182: Correct right names. Sponsored by: The FreeBSD Foundation Approved by: re (kib) Modified: stable/10/share/man/man4/rights.4 stable/10/sys/kern/kern_event.c stable/10/sys/kern/subr_capability.c stable/10/sys/kern/sys_generic.c stable/10/sys/kern/uipc_mqueue.c stable/10/sys/sys/capability.h stable/10/usr.bin/procstat/procstat_files.c Directory Properties: stable/10/share/man/man4/ (props changed) stable/10/sys/ (props changed) stable/10/usr.bin/procstat/ (props changed) Modified: stable/10/share/man/man4/rights.4 ============================================================================== --- stable/10/share/man/man4/rights.4 Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/share/man/man4/rights.4 Mon Nov 18 22:37:01 2013 (r258324) @@ -306,7 +306,7 @@ An alias to .Dv CAP_KQUEUE_CHANGE and .Dv CAP_KQUEUE_EVENT . -.It Dv CAP_KEVENT_CHANGE +.It Dv CAP_KQUEUE_CHANGE Permit .Xr kevent 2 on a @@ -314,7 +314,7 @@ on a descriptor that modifies list of monitored events (the .Fa changelist argument is non-NULL). -.It Dv CAP_KEVENT_EVENT +.It Dv CAP_KQUEUE_EVENT Permit .Xr kevent 2 on a Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/sys/kern/kern_event.c Mon Nov 18 22:37:01 2013 (r258324) @@ -835,10 +835,17 @@ kern_kevent(struct thread *td, int fd, i cap_rights_t rights; int i, n, nerrors, error; - error = fget(td, fd, cap_rights_init(&rights, CAP_POST_EVENT), &fp); + cap_rights_init(&rights); + if (nchanges > 0) + cap_rights_set(&rights, CAP_KQUEUE_CHANGE); + if (nevents > 0) + cap_rights_set(&rights, CAP_KQUEUE_EVENT); + error = fget(td, fd, &rights, &fp); if (error != 0) return (error); - if ((error = kqueue_acquire(fp, &kq)) != 0) + + error = kqueue_acquire(fp, &kq); + if (error != 0) goto done_norel; nerrors = 0; @@ -995,7 +1002,7 @@ findkn: if (fops->f_isfd) { KASSERT(td != NULL, ("td is NULL")); error = fget(td, kev->ident, - cap_rights_init(&rights, CAP_POLL_EVENT), &fp); + cap_rights_init(&rights, CAP_EVENT), &fp); if (error) goto done; @@ -2279,7 +2286,7 @@ kqfd_register(int fd, struct kevent *kev cap_rights_t rights; int error; - error = fget(td, fd, cap_rights_init(&rights, CAP_POST_EVENT), &fp); + error = fget(td, fd, cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &fp); if (error != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) Modified: stable/10/sys/kern/subr_capability.c ============================================================================== --- stable/10/sys/kern/subr_capability.c Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/sys/kern/subr_capability.c Mon Nov 18 22:37:01 2013 (r258324) @@ -30,6 +30,10 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note that this file is compiled into the kernel and into libc. + */ + #ifdef _KERNEL #include #include @@ -164,7 +168,7 @@ __cap_rights_init(int version, cap_right return (rights); } -void +cap_rights_t * __cap_rights_set(cap_rights_t *rights, ...) { va_list ap; @@ -174,9 +178,11 @@ __cap_rights_set(cap_rights_t *rights, . va_start(ap, rights); cap_rights_vset(rights, ap); va_end(ap); + + return (rights); } -void +cap_rights_t * __cap_rights_clear(cap_rights_t *rights, ...) { va_list ap; @@ -186,6 +192,8 @@ __cap_rights_clear(cap_rights_t *rights, va_start(ap, rights); cap_rights_vclear(rights, ap); va_end(ap); + + return (rights); } bool @@ -231,7 +239,7 @@ cap_rights_is_valid(const cap_rights_t * return (true); } -void +cap_rights_t * cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src) { unsigned int i, n; @@ -250,9 +258,11 @@ cap_rights_merge(cap_rights_t *dst, cons assert(cap_rights_is_valid(src)); assert(cap_rights_is_valid(dst)); + + return (dst); } -void +cap_rights_t * cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src) { unsigned int i, n; @@ -273,6 +283,8 @@ cap_rights_remove(cap_rights_t *dst, con assert(cap_rights_is_valid(src)); assert(cap_rights_is_valid(dst)); + + return (dst); } bool Modified: stable/10/sys/kern/sys_generic.c ============================================================================== --- stable/10/sys/kern/sys_generic.c Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/sys/kern/sys_generic.c Mon Nov 18 22:37:01 2013 (r258324) @@ -1195,8 +1195,9 @@ getselfd_cap(struct filedesc *fdp, int f { cap_rights_t rights; - return (fget_unlocked(fdp, fd, cap_rights_init(&rights, CAP_POLL_EVENT), - 0, fpp, NULL)); + cap_rights_init(&rights, CAP_EVENT); + + return (fget_unlocked(fdp, fd, &rights, 0, fpp, NULL)); } /* @@ -1392,7 +1393,7 @@ pollrescan(struct thread *td) #ifdef CAPABILITIES if (fp == NULL || cap_check(cap_rights(fdp, fd->fd), - cap_rights_init(&rights, CAP_POLL_EVENT)) != 0) + cap_rights_init(&rights, CAP_EVENT)) != 0) #else if (fp == NULL) #endif @@ -1467,7 +1468,7 @@ pollscan(td, fds, nfd) #ifdef CAPABILITIES if (fp == NULL || cap_check(cap_rights(fdp, fds->fd), - cap_rights_init(&rights, CAP_POLL_EVENT)) != 0) + cap_rights_init(&rights, CAP_EVENT)) != 0) #else if (fp == NULL) #endif Modified: stable/10/sys/kern/uipc_mqueue.c ============================================================================== --- stable/10/sys/kern/uipc_mqueue.c Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/sys/kern/uipc_mqueue.c Mon Nov 18 22:37:01 2013 (r258324) @@ -2119,7 +2119,7 @@ getmq(struct thread *td, int fd, struct { cap_rights_t rights; - return _getmq(td, fd, cap_rights_init(&rights, CAP_POLL_EVENT), fget, + return _getmq(td, fd, cap_rights_init(&rights, CAP_EVENT), fget, fpp, ppn, pmq); } @@ -2282,7 +2282,7 @@ again: } #ifdef CAPABILITIES error = cap_check(cap_rights(fdp, mqd), - cap_rights_init(&rights, CAP_POLL_EVENT)); + cap_rights_init(&rights, CAP_EVENT)); if (error) { FILEDESC_SUNLOCK(fdp); goto out; Modified: stable/10/sys/sys/capability.h ============================================================================== --- stable/10/sys/sys/capability.h Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/sys/sys/capability.h Mon Nov 18 22:37:01 2013 (r258324) @@ -79,9 +79,12 @@ #define CAP_SEEK_TELL CAPRIGHT(0, 0x0000000000000004ULL) /* Allows for lseek(2). */ #define CAP_SEEK (CAP_SEEK_TELL | 0x0000000000000008ULL) -/* Allows for pread(2), preadv(2). */ +/* Allows for aio_read(2), pread(2), preadv(2). */ #define CAP_PREAD (CAP_SEEK | CAP_READ) -/* Allows for openat(O_WRONLY) (without O_APPEND), pwrite(2), pwritev(2). */ +/* + * Allows for aio_write(2), openat(O_WRONLY) (without O_APPEND), pwrite(2), + * pwritev(2). + */ #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) /* Allows for mmap(PROT_NONE). */ #define CAP_MMAP CAPRIGHT(0, 0x0000000000000010ULL) @@ -103,7 +106,7 @@ #define CAP_CREATE CAPRIGHT(0, 0x0000000000000040ULL) /* Allows for openat(O_EXEC) and fexecve(2) in turn. */ #define CAP_FEXECVE CAPRIGHT(0, 0x0000000000000080ULL) -/* Allows for openat(O_SYNC), openat(O_FSYNC), fsync(2). */ +/* Allows for openat(O_SYNC), openat(O_FSYNC), fsync(2), aio_fsync(2). */ #define CAP_FSYNC CAPRIGHT(0, 0x0000000000000100ULL) /* Allows for openat(O_TRUNC), ftruncate(2). */ #define CAP_FTRUNCATE CAPRIGHT(0, 0x0000000000000200ULL) @@ -112,55 +115,87 @@ #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) /* VFS methods. */ +/* Allows for fchdir(2). */ #define CAP_FCHDIR CAPRIGHT(0, 0x0000000000000800ULL) +/* Allows for fchflags(2). */ #define CAP_FCHFLAGS CAPRIGHT(0, 0x0000000000001000ULL) +/* Allows for fchflags(2) and chflagsat(2). */ #define CAP_CHFLAGSAT (CAP_FCHFLAGS | CAP_LOOKUP) +/* Allows for fchmod(2). */ #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) +/* Allows for fchmod(2) and fchmodat(2). */ #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) +/* Allows for fchown(2). */ #define CAP_FCHOWN CAPRIGHT(0, 0x0000000000004000ULL) +/* Allows for fchown(2) and fchownat(2). */ #define CAP_FCHOWNAT (CAP_FCHOWN | CAP_LOOKUP) +/* Allows for fcntl(2). */ #define CAP_FCNTL CAPRIGHT(0, 0x0000000000008000ULL) +/* + * Allows for flock(2), openat(O_SHLOCK), openat(O_EXLOCK), + * fcntl(F_SETLK_REMOTE), fcntl(F_SETLKW), fcntl(F_SETLK), fcntl(F_GETLK). + */ #define CAP_FLOCK CAPRIGHT(0, 0x0000000000010000ULL) +/* Allows for fpathconf(2). */ #define CAP_FPATHCONF CAPRIGHT(0, 0x0000000000020000ULL) +/* Allows for UFS background-fsck operations. */ #define CAP_FSCK CAPRIGHT(0, 0x0000000000040000ULL) +/* Allows for fstat(2). */ #define CAP_FSTAT CAPRIGHT(0, 0x0000000000080000ULL) +/* Allows for fstat(2), fstatat(2) and faccessat(2). */ #define CAP_FSTATAT (CAP_FSTAT | CAP_LOOKUP) +/* Allows for fstatfs(2). */ #define CAP_FSTATFS CAPRIGHT(0, 0x0000000000100000ULL) +/* Allows for futimes(2). */ #define CAP_FUTIMES CAPRIGHT(0, 0x0000000000200000ULL) +/* Allows for futimes(2) and futimesat(2). */ #define CAP_FUTIMESAT (CAP_FUTIMES | CAP_LOOKUP) -#define CAP_LINKAT CAPRIGHT(0, 0x0000000000400000ULL) -#define CAP_MKDIRAT CAPRIGHT(0, 0x0000000000800000ULL) -#define CAP_MKFIFOAT CAPRIGHT(0, 0x0000000001000000ULL) -#define CAP_MKNODAT CAPRIGHT(0, 0x0000000002000000ULL) -#define CAP_RENAMEAT CAPRIGHT(0, 0x0000000004000000ULL) -#define CAP_SYMLINKAT CAPRIGHT(0, 0x0000000008000000ULL) -#define CAP_UNLINKAT CAPRIGHT(0, 0x0000000010000000ULL) - -/* Extended attributes. */ -#define CAP_EXTATTR_DELETE CAPRIGHT(0, 0x0000000020000000ULL) -#define CAP_EXTATTR_GET CAPRIGHT(0, 0x0000000040000000ULL) -#define CAP_EXTATTR_LIST CAPRIGHT(0, 0x0000000080000000ULL) -#define CAP_EXTATTR_SET CAPRIGHT(0, 0x0000000100000000ULL) - -/* Access Control Lists. */ -#define CAP_ACL_CHECK CAPRIGHT(0, 0x0000000200000000ULL) -#define CAP_ACL_DELETE CAPRIGHT(0, 0x0000000400000000ULL) -#define CAP_ACL_GET CAPRIGHT(0, 0x0000000800000000ULL) -#define CAP_ACL_SET CAPRIGHT(0, 0x0000001000000000ULL) +/* Allows for linkat(2) and renameat(2) (destination directory descriptor). */ +#define CAP_LINKAT (CAP_LOOKUP | 0x0000000000400000ULL) +/* Allows for mkdirat(2). */ +#define CAP_MKDIRAT (CAP_LOOKUP | 0x0000000000800000ULL) +/* Allows for mkfifoat(2). */ +#define CAP_MKFIFOAT (CAP_LOOKUP | 0x0000000001000000ULL) +/* Allows for mknodat(2). */ +#define CAP_MKNODAT (CAP_LOOKUP | 0x0000000002000000ULL) +/* Allows for renameat(2). */ +#define CAP_RENAMEAT (CAP_LOOKUP | 0x0000000004000000ULL) +/* Allows for symlinkat(2). */ +#define CAP_SYMLINKAT (CAP_LOOKUP | 0x0000000008000000ULL) +/* + * Allows for unlinkat(2) and renameat(2) if destination object exists and + * will be removed. + */ +#define CAP_UNLINKAT (CAP_LOOKUP | 0x0000000010000000ULL) /* Socket operations. */ -#define CAP_ACCEPT CAPRIGHT(0, 0x0000002000000000ULL) -#define CAP_BIND CAPRIGHT(0, 0x0000004000000000ULL) -#define CAP_CONNECT CAPRIGHT(0, 0x0000008000000000ULL) -#define CAP_GETPEERNAME CAPRIGHT(0, 0x0000010000000000ULL) -#define CAP_GETSOCKNAME CAPRIGHT(0, 0x0000020000000000ULL) -#define CAP_GETSOCKOPT CAPRIGHT(0, 0x0000040000000000ULL) -#define CAP_LISTEN CAPRIGHT(0, 0x0000080000000000ULL) -#define CAP_PEELOFF CAPRIGHT(0, 0x0000100000000000ULL) +/* Allows for accept(2) and accept4(2). */ +#define CAP_ACCEPT CAPRIGHT(0, 0x0000000020000000ULL) +/* Allows for bind(2). */ +#define CAP_BIND CAPRIGHT(0, 0x0000000040000000ULL) +/* Allows for connect(2). */ +#define CAP_CONNECT CAPRIGHT(0, 0x0000000080000000ULL) +/* Allows for getpeername(2). */ +#define CAP_GETPEERNAME CAPRIGHT(0, 0x0000000100000000ULL) +/* Allows for getsockname(2). */ +#define CAP_GETSOCKNAME CAPRIGHT(0, 0x0000000200000000ULL) +/* Allows for getsockopt(2). */ +#define CAP_GETSOCKOPT CAPRIGHT(0, 0x0000000400000000ULL) +/* Allows for listen(2). */ +#define CAP_LISTEN CAPRIGHT(0, 0x0000000800000000ULL) +/* Allows for sctp_peeloff(2). */ +#define CAP_PEELOFF CAPRIGHT(0, 0x0000001000000000ULL) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE -#define CAP_SETSOCKOPT CAPRIGHT(0, 0x0000200000000000ULL) -#define CAP_SHUTDOWN CAPRIGHT(0, 0x0000400000000000ULL) +/* Allows for setsockopt(2). */ +#define CAP_SETSOCKOPT CAPRIGHT(0, 0x0000002000000000ULL) +/* Allows for shutdown(2). */ +#define CAP_SHUTDOWN CAPRIGHT(0, 0x0000004000000000ULL) + +/* Allows for bindat(2) on a directory descriptor. */ +#define CAP_BINDAT (CAP_LOOKUP | 0x0000008000000000ULL) +/* Allows for connectat(2) on a directory descriptor. */ +#define CAP_CONNECTAT (CAP_LOOKUP | 0x0000010000000000ULL) #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ @@ -171,17 +206,19 @@ CAP_SETSOCKOPT | CAP_SHUTDOWN) /* All used bits for index 0. */ -#define CAP_ALL0 CAPRIGHT(0, 0x00007FFFFFFFFFFFULL) +#define CAP_ALL0 CAPRIGHT(0, 0x0000007FFFFFFFFFULL) /* Available bits for index 0. */ -#define CAP_UNUSED0_48 CAPRIGHT(0, 0x0000800000000000ULL) +#define CAP_UNUSED0_40 CAPRIGHT(0, 0x0000008000000000ULL) /* ... */ #define CAP_UNUSED0_57 CAPRIGHT(0, 0x0100000000000000ULL) /* INDEX 1 */ /* Mandatory Access Control. */ +/* Allows for mac_get_fd(3). */ #define CAP_MAC_GET CAPRIGHT(1, 0x0000000000000001ULL) +/* Allows for mac_set_fd(3). */ #define CAP_MAC_SET CAPRIGHT(1, 0x0000000000000002ULL) /* Methods on semaphores. */ @@ -189,34 +226,60 @@ #define CAP_SEM_POST CAPRIGHT(1, 0x0000000000000008ULL) #define CAP_SEM_WAIT CAPRIGHT(1, 0x0000000000000010ULL) -/* kqueue events. */ -#define CAP_POLL_EVENT CAPRIGHT(1, 0x0000000000000020ULL) -#define CAP_POST_EVENT CAPRIGHT(1, 0x0000000000000040ULL) +/* Allows select(2) and poll(2) on descriptor. */ +#define CAP_EVENT CAPRIGHT(1, 0x0000000000000020ULL) +/* Allows for kevent(2) on kqueue descriptor with eventlist != NULL. */ +#define CAP_KQUEUE_EVENT CAPRIGHT(1, 0x0000000000000040ULL) /* Strange and powerful rights that should not be given lightly. */ +/* Allows for ioctl(2). */ #define CAP_IOCTL CAPRIGHT(1, 0x0000000000000080ULL) #define CAP_TTYHOOK CAPRIGHT(1, 0x0000000000000100ULL) /* Process management via process descriptors. */ +/* Allows for pdgetpid(2). */ #define CAP_PDGETPID CAPRIGHT(1, 0x0000000000000200ULL) +/* Allows for pdwait4(2). */ #define CAP_PDWAIT CAPRIGHT(1, 0x0000000000000400ULL) +/* Allows for pdkill(2). */ #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) -/* - * Rights that allow to use bindat(2) and connectat(2) syscalls on a - * directory descriptor. - */ -#define CAP_BINDAT CAPRIGHT(1, 0x0000000000001000ULL) -#define CAP_CONNECTAT CAPRIGHT(1, 0x0000000000002000ULL) +/* Extended attributes. */ +/* Allows for extattr_delete_fd(2). */ +#define CAP_EXTATTR_DELETE CAPRIGHT(1, 0x0000000000001000ULL) +/* Allows for extattr_get_fd(2). */ +#define CAP_EXTATTR_GET CAPRIGHT(1, 0x0000000000002000ULL) +/* Allows for extattr_list_fd(2). */ +#define CAP_EXTATTR_LIST CAPRIGHT(1, 0x0000000000004000ULL) +/* Allows for extattr_set_fd(2). */ +#define CAP_EXTATTR_SET CAPRIGHT(1, 0x0000000000008000ULL) + +/* Access Control Lists. */ +/* Allows for acl_valid_fd_np(3). */ +#define CAP_ACL_CHECK CAPRIGHT(1, 0x0000000000010000ULL) +/* Allows for acl_delete_fd_np(3). */ +#define CAP_ACL_DELETE CAPRIGHT(1, 0x0000000000020000ULL) +/* Allows for acl_get_fd(3) and acl_get_fd_np(3). */ +#define CAP_ACL_GET CAPRIGHT(1, 0x0000000000040000ULL) +/* Allows for acl_set_fd(3) and acl_set_fd_np(3). */ +#define CAP_ACL_SET CAPRIGHT(1, 0x0000000000080000ULL) + +/* Allows for kevent(2) on kqueue descriptor with changelist != NULL. */ +#define CAP_KQUEUE_CHANGE CAPRIGHT(1, 0x0000000000100000ULL) + +#define CAP_KQUEUE (CAP_KQUEUE_EVENT | CAP_KQUEUE_CHANGE) /* All used bits for index 1. */ -#define CAP_ALL1 CAPRIGHT(1, 0x0000000000003FFFULL) +#define CAP_ALL1 CAPRIGHT(1, 0x00000000001FFFFFULL) /* Available bits for index 1. */ -#define CAP_UNUSED1_15 CAPRIGHT(1, 0x0000000000004000ULL) +#define CAP_UNUSED1_22 CAPRIGHT(1, 0x0000000000200000ULL) /* ... */ #define CAP_UNUSED1_57 CAPRIGHT(1, 0x0100000000000000ULL) +/* Backward compatibility. */ +#define CAP_POLL_EVENT CAP_EVENT + #define CAP_ALL(rights) do { \ (rights)->cr_rights[0] = \ ((uint64_t)CAP_RIGHTS_VERSION << 62) | CAP_ALL0; \ @@ -258,19 +321,19 @@ cap_rights_t *__cap_rights_init(int vers #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) -void __cap_rights_set(cap_rights_t *rights, ...); +cap_rights_t *__cap_rights_set(cap_rights_t *rights, ...); #define cap_rights_clear(rights, ...) \ __cap_rights_clear((rights), __VA_ARGS__, 0ULL) -void __cap_rights_clear(cap_rights_t *rights, ...); +cap_rights_t *__cap_rights_clear(cap_rights_t *rights, ...); #define cap_rights_is_set(rights, ...) \ __cap_rights_is_set((rights), __VA_ARGS__, 0ULL) bool __cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); -void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); -void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); +cap_rights_t *cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); +cap_rights_t *cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); #ifdef _KERNEL Modified: stable/10/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_files.c Mon Nov 18 22:35:02 2013 (r258323) +++ stable/10/usr.bin/procstat/procstat_files.c Mon Nov 18 22:37:01 2013 (r258324) @@ -203,8 +203,9 @@ static struct cap_desc { { CAP_SEM_WAIT, "sw" }, /* Event monitoring and posting. */ - { CAP_POLL_EVENT, "po" }, - { CAP_POST_EVENT, "ev" }, + { CAP_EVENT, "ev" }, + { CAP_KQUEUE_EVENT, "ke" }, + { CAP_KQUEUE_CHANGE, "kc" }, /* Strange and powerful rights that should not be given lightly. */ { CAP_IOCTL, "io" }, From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 22:53:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7252C4CC; Mon, 18 Nov 2013 22:53:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 625242D63; Mon, 18 Nov 2013 22:53:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMrPZe048085; Mon, 18 Nov 2013 22:53:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMrPQt048084; Mon, 18 Nov 2013 22:53:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201311182253.rAIMrPQt048084@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Nov 2013 22:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258326 - head/usr.bin/cmp 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 22:53:25 -0000 Author: eadler Date: Mon Nov 18 22:53:24 2013 New Revision: 258326 URL: http://svnweb.freebsd.org/changeset/base/258326 Log: Indicate which options are extensions to POSIX. Inspired by: DragonFlyBSD Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 ============================================================================== --- head/usr.bin/cmp/cmp.1 Mon Nov 18 22:39:34 2013 (r258325) +++ head/usr.bin/cmp/cmp.1 Mon Nov 18 22:53:24 2013 (r258326) @@ -115,6 +115,12 @@ The utility is expected to be .St -p1003.2 compatible. +The +.Fl h , +.Fl x , +and +.Fl z +options are extensions to the standard. .Sh HISTORY A .Nm From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 23:11:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 543EE2FC; Mon, 18 Nov 2013 23:11:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAD6213E; Mon, 18 Nov 2013 23:11:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAIMwEWe048784; Mon, 18 Nov 2013 22:58:14 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAIMwEFd048783; Mon, 18 Nov 2013 22:58:14 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201311182258.rAIMwEFd048783@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 18 Nov 2013 22:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258328 - head/sys/net 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 23:11:32 -0000 Author: gnn Date: Mon Nov 18 22:58:14 2013 New Revision: 258328 URL: http://svnweb.freebsd.org/changeset/base/258328 Log: Allow ethernet drivers to pass in packets connected via the nextpkt pointer. Handling packets in this way allows drivers to amortize work during packet reception. Submitted by: Vijay Singh Sponsored by: NetApp Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) @@ -708,13 +708,25 @@ static void ether_input(struct ifnet *ifp, struct mbuf *m) { + struct mbuf *mn; + /* - * We will rely on rcvif being set properly in the deferred context, - * so assert it is correct here. + * The drivers are allowed to pass in a chain of packets linked with + * m_nextpkt. We split them up into separate packets here and pass + * them up. This allows the drivers to amortize the receive lock. */ - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + while (m) { + mn = m->m_nextpkt; + m->m_nextpkt = NULL; - netisr_dispatch(NETISR_ETHER, m); + /* + * We will rely on rcvif being set properly in the deferred context, + * so assert it is correct here. + */ + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + netisr_dispatch(NETISR_ETHER, m); + m = mn; + } } /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 18 23:11:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85A013EF; Mon, 18 Nov 2013 23:11:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC1D213F; Mon, 18 Nov 2013 23:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAINBhpQ002041; Mon, 18 Nov 2013 23:11:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAINBhp6002040; Mon, 18 Nov 2013 23:11:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201311182311.rAINBhp6002040@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Nov 2013 23:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258329 - head/usr.bin/cmp 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.16 Precedence: list List-Id: "SVN commit messages 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, 18 Nov 2013 23:11:43 -0000 Author: eadler Date: Mon Nov 18 23:11:42 2013 New Revision: 258329 URL: http://svnweb.freebsd.org/changeset/base/258329 Log: Bump .Dd for recent change Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 ============================================================================== --- head/usr.bin/cmp/cmp.1 Mon Nov 18 22:58:14 2013 (r258328) +++ head/usr.bin/cmp/cmp.1 Mon Nov 18 23:11:42 2013 (r258329) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 19, 2006 +.Dd November 18, 2013 .Dt CMP 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 00:33:20 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CF50735; Tue, 19 Nov 2013 00:33:20 +0000 (UTC) Received: from am1outboundpool.messaging.microsoft.com (am1ehsobe003.messaging.microsoft.com [213.199.154.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6C625A7; Tue, 19 Nov 2013 00:33:19 +0000 (UTC) Received: from mail2-am1-R.bigfish.com (10.3.201.242) by AM1EHSOBE005.bigfish.com (10.3.204.25) with Microsoft SMTP Server id 14.1.225.22; Tue, 19 Nov 2013 00:33:17 +0000 Received: from mail2-am1 (localhost [127.0.0.1]) by mail2-am1-R.bigfish.com (Postfix) with ESMTP id A9FCE26038A; Tue, 19 Nov 2013 00:33:17 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.239.16; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF02-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 8 X-BigFish: VPS8(zzzz1f42h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6h1082kzz1de097hz31h2a8h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1b88h224fh1fb3h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1fe8h1ff5h2218h2216h222dm1155h) Received-SPF: softfail (mail2-am1: transitioning domain of juniper.net does not designate 66.129.239.16 as permitted sender) client-ip=66.129.239.16; envelope-from=sjg@juniper.net; helo=P-EMF02-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail2-am1 (localhost.localdomain [127.0.0.1]) by mail2-am1 (MessageSwitch) id 1384821196514026_15030; Tue, 19 Nov 2013 00:33:16 +0000 (UTC) Received: from AM1EHSMHS012.bigfish.com (unknown [10.3.201.251]) by mail2-am1.bigfish.com (Postfix) with ESMTP id 6E9613A00EC; Tue, 19 Nov 2013 00:33:16 +0000 (UTC) Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by AM1EHSMHS012.bigfish.com (10.3.207.112) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 19 Nov 2013 00:33:10 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Mon, 18 Nov 2013 16:33:08 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id rAJ0X7L92920; Mon, 18 Nov 2013 16:33:07 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 9E25A5807E; Mon, 18 Nov 2013 16:33:07 -0800 (PST) To: Julio Merino Subject: Re: svn commit: r258285 - in head/lib/atf: libatf-c++/tests libatf-c/tests tests/test-programs In-Reply-To: <201311172312.rAHNCtOY010186@svn.freebsd.org> References: <201311172312.rAHNCtOY010186@svn.freebsd.org> Comments: In-reply-to: Julio Merino message dated "Sun, 17 Nov 2013 23:12:55 +0000." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 18 Nov 2013 16:33:07 -0800 Message-ID: <20131119003307.9E25A5807E@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 00:33:20 -0000 On Sun, 17 Nov 2013 23:12:55 +0000, Julio Merino writes: > I am not sure how this ever worked before given that manual inspection > of bsd.progs.mk clearly shows that the expected character between the > two components is a dot and not an underscore... but I suspect the Actually . or _ worked, until recently. Will fix. From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 00:34: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3C9C89C; Tue, 19 Nov 2013 00:34:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D405125C1; Tue, 19 Nov 2013 00:34:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ0YxVA036448; Tue, 19 Nov 2013 00:34:59 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ0YxgE036447; Tue, 19 Nov 2013 00:34:59 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201311190034.rAJ0YxgE036447@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 19 Nov 2013 00:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258330 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 00:35:00 -0000 Author: sjg Date: Tue Nov 19 00:34:59 2013 New Revision: 258330 URL: http://svnweb.freebsd.org/changeset/base/258330 Log: Need to also test for defined(${v}_${PROG}) Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Mon Nov 18 23:11:42 2013 (r258329) +++ head/share/mk/bsd.progs.mk Tue Nov 19 00:34:59 2013 (r258330) @@ -44,7 +44,7 @@ PROG ?= $t # just one of many PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS .for v in ${PROG_VARS:O:u} -.if defined(${v}.${PROG}) +.if defined(${v}.${PROG}) || defined(${v}_${PROG}) $v += ${${v}_${PROG}:U${${v}.${PROG}}} .else $v ?= From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 00:37: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFE47A09; Tue, 19 Nov 2013 00:37:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD94E25DD; Tue, 19 Nov 2013 00:37:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ0bsrT036811; Tue, 19 Nov 2013 00:37:54 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ0bsiR036805; Tue, 19 Nov 2013 00:37:54 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201311190037.rAJ0bsiR036805@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Nov 2013 00:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258331 - in head: share/man/man4 sys/conf sys/dev/usb/net sys/modules/usb sys/modules/usb/axge 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 00:37:55 -0000 Author: markj Date: Tue Nov 19 00:37:53 2013 New Revision: 258331 URL: http://svnweb.freebsd.org/changeset/base/258331 Log: Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. The driver was written by kevlo@ and lwhsu@, with a few bug fixes from me. MFC after: 2 months Added: head/share/man/man4/axge.4 (contents, props changed) head/sys/dev/usb/net/if_axge.c (contents, props changed) head/sys/dev/usb/net/if_axgereg.h (contents, props changed) head/sys/modules/usb/axge/ head/sys/modules/usb/axge/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Nov 19 00:34:59 2013 (r258330) +++ head/share/man/man4/Makefile Tue Nov 19 00:37:53 2013 (r258331) @@ -67,6 +67,7 @@ MAN= aac.4 \ auditpipe.4 \ aue.4 \ axe.4 \ + axge.4 \ bce.4 \ bfe.4 \ bge.4 \ Added: head/share/man/man4/axge.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/axge.4 Tue Nov 19 00:37:53 2013 (r258331) @@ -0,0 +1,149 @@ +.\" Copyright (c) 1997, 1998, 1999, 2000-2003 +.\" Bill Paul . All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Bill Paul. +.\" 4. Neither the name of the author nor the names of any co-contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD +.\" 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 November 12, 2013 +.Dt AXGE 4 +.Os +.Sh NAME +.Nm axge +.Nd "ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet 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 ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device miibus" +.Cd "device axge" +.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 +if_axge_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for USB Gigabit Ethernet adapters based on the ASIX +Electronics AX88179 USB 3.0 and AX88178A USB 2.0 chipsets. +.Pp +The AX88179 and AX88178A contain a 10/100/1000 Ethernet MAC with a GMII +interface for interfacing with the Gigabit Ethernet PHY. +.Pp +These devices will operate with both USB 1.x and USB 2.0 controllers, and the +AX88179 will operate with USB 3.0 controllers. +Packets are received and transmitted over separate USB bulk transfer endpoints. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation (AX88178 only). +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr rgephy 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.1 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Kevin Lo Aq kevlo@FreeBSD.org +and +.An Li-Wen Hsu Aq lwhsu@FreeBSD.org . +This manual page was adapted by +.An Mark Johnston Aq markj@FreeBSD.org +from the +.Xr axe 4 +manual page. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 19 00:34:59 2013 (r258330) +++ head/sys/conf/files Tue Nov 19 00:37:53 2013 (r258331) @@ -2311,6 +2311,7 @@ dev/usb/usb_util.c optional usb # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe +dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth @@ -2321,8 +2322,8 @@ dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | smsc | udav | ipheth +dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ + mos | rue | smsc | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Added: head/sys/dev/usb/net/if_axge.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_axge.c Tue Nov 19 00:37:53 2013 (r258331) @@ -0,0 +1,1023 @@ +/*- + * Copyright (c) 2013 Kevin Lo + * 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$"); + +/* + * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR axge_debug +#include +#include + +#include +#include + +/* + * Various supported device vendors/products. + */ + +static const STRUCT_USB_HOST_ID axge_devs[] = { +#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } + AXGE_DEV(ASIX, AX88178A), + AXGE_DEV(ASIX, AX88179), + /* AXGE_DEV(SITECOMEU, LN032), */ +#undef AXGE_DEV +}; + +static const struct { + unsigned char ctrl, timer_l, timer_h, size, ifg; +} AX88179_BULKIN_SIZE[] = { + {7, 0x4f, 0, 0x12, 0xff}, + {7, 0x20, 3, 0x16, 0xff}, + {7, 0xae, 7, 0x18, 0xff}, + {7, 0xcc, 0x4c, 0x18, 8}, +}; + +/* prototypes */ + +static device_probe_t axge_probe; +static device_attach_t axge_attach; +static device_detach_t axge_detach; + +static usb_callback_t axge_bulk_read_callback; +static usb_callback_t axge_bulk_write_callback; + +static miibus_readreg_t axge_miibus_readreg; +static miibus_writereg_t axge_miibus_writereg; +static miibus_statchg_t axge_miibus_statchg; + +static uether_fn_t axge_attach_post; +static uether_fn_t axge_init; +static uether_fn_t axge_stop; +static uether_fn_t axge_start; +static uether_fn_t axge_tick; +static uether_fn_t axge_setmulti; +static uether_fn_t axge_setpromisc; + +static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t); +static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint8_t); +static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint16_t); +static void axge_chip_init(struct axge_softc *); +static void axge_reset(struct axge_softc *); + +static int axge_attach_post_sub(struct usb_ether *); +static int axge_ifmedia_upd(struct ifnet *); +static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int axge_ioctl(struct ifnet *, u_long, caddr_t); +static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, + unsigned int, unsigned int, struct axge_csum_hdr *); +static void axge_csum_cfg(struct usb_ether *); + +#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +#ifdef USB_DEBUG +static int axge_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge"); +SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RW, &axge_debug, 0, + "Debug level"); +#endif + +static const struct usb_config axge_config[AXGE_N_TRANSFER] = { + [AXGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + [AXGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +}; + +static device_method_t axge_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, axge_probe), + DEVMETHOD(device_attach, axge_attach), + DEVMETHOD(device_detach, axge_detach), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, axge_miibus_readreg), + DEVMETHOD(miibus_writereg, axge_miibus_writereg), + DEVMETHOD(miibus_statchg, axge_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t axge_driver = { + .name = "axge", + .methods = axge_methods, + .size = sizeof(struct axge_softc), +}; + +static devclass_t axge_devclass; + +DRIVER_MODULE(axge, uhub, axge_driver, axge_devclass, NULL, NULL); +DRIVER_MODULE(miibus, axge, miibus_driver, miibus_devclass, NULL, NULL); +MODULE_DEPEND(axge, uether, 1, 1, 1); +MODULE_DEPEND(axge, usb, 1, 1, 1); +MODULE_DEPEND(axge, ether, 1, 1, 1); +MODULE_DEPEND(axge, miibus, 1, 1, 1); +MODULE_VERSION(axge, 1); + +static const struct usb_ether_methods axge_ue_methods = { + .ue_attach_post = axge_attach_post, + .ue_attach_post_sub = axge_attach_post_sub, + .ue_start = axge_start, + .ue_init = axge_init, + .ue_stop = axge_stop, + .ue_tick = axge_tick, + .ue_setmulti = axge_setmulti, + .ue_setpromisc = axge_setpromisc, + .ue_mii_upd = axge_ifmedia_upd, + .ue_mii_sts = axge_ifmedia_sts, +}; + +static int +axge_read_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + return (uether_do_request(&sc->sc_ue, &req, buf, 1000)); +} + +static void +axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + if (uether_do_request(&sc->sc_ue, &req, buf, 1000)) { + /* Error ignored. */ + } +} + +static uint16_t +axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val[2]; + + axge_read_mem(sc, cmd, index, reg, &val, 2); + return (UGETW(val)); +} + +static void +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint8_t val) +{ + axge_write_mem(sc, cmd, index, reg, &val, 1); +} + +static void +axge_write_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint16_t val) +{ + uint8_t temp[2]; + + USETW(temp, val); + axge_write_mem(sc, cmd, index, reg, &temp, 2); +} + +static int +axge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axge_softc *sc; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + val = axge_read_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy); + + if (!locked) + AXGE_UNLOCK(sc); + + return (val); +} + +static int +axge_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axge_softc *sc; + int locked; + + sc = device_get_softc(dev); + if (sc->sc_phyno != phy) + return (0); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + axge_write_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy, val); + + if (!locked) + AXGE_UNLOCK(sc); + + return (0); +} + +static void +axge_miibus_statchg(device_t dev) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + mii = GET_MII(sc); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: + sc->sc_flags |= AXGE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + val |= AXGE_MEDIUM_FULL_DUPLEX; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + } + val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXGE_MEDIUM_GIGAMODE; + case IFM_100_TX: + val |= AXGE_MEDIUM_PS; + case IFM_10_T: + /* Doesn't need to be handled. */ + break; + } + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + +done: + if (!locked) + AXGE_UNLOCK(sc); +} + +static void +axge_chip_init(struct axge_softc *sc) +{ + /* Power up ethernet PHY. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, + AXGE_PHYPWR_RSTCTL_IPRL); + uether_pause(&sc->sc_ue, hz / 4); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); + uether_pause(&sc->sc_ue, hz / 10); +} + +static void +axge_reset(struct axge_softc *sc) +{ + struct usb_config_descriptor *cd; + usb_error_t err; + + cd = usbd_get_config_descriptor(sc->sc_ue.ue_udev); + + err = usbd_req_set_config(sc->sc_ue.ue_udev, &sc->sc_mtx, + cd->bConfigurationValue); + if (err) + DPRINTF("reset failed (ignored)\n"); + + /* Wait a little while for the chip to get its brains in order. */ + uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + axge_chip_init(sc); +} + +static void +axge_attach_post(struct usb_ether *ue) +{ + struct axge_softc *sc; + uint8_t tmp[5]; + + sc = uether_getsc(ue); + sc->sc_phyno = 3; + + /* Initialize controller and get station address. */ + axge_chip_init(sc); + + memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + ue->ue_eaddr, ETHER_ADDR_LEN); +} + +static int +axge_attach_post_sub(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + int error; + + sc = uether_getsc(ue); + ifp = ue->ue_ifp; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = uether_start; + ifp->if_ioctl = axge_ioctl; + ifp->if_init = uether_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = AXGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + + mtx_lock(&Giant); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + mtx_unlock(&Giant); + + return (error); +} + +/* + * Set media options. + */ +static int +axge_ifmedia_upd(struct ifnet *ifp) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + + return (error); +} + +/* + * Report current media status. + */ +static void +axge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + AXGE_UNLOCK(sc); +} + +/* + * Probe for a AX88179 chip. + */ +static int +axge_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != AXGE_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != AXGE_IFACE_IDX) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(axge_devs, sizeof(axge_devs), uaa)); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +axge_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct axge_softc *sc; + struct usb_ether *ue; + uint8_t iface_index; + int error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + ue = &sc->sc_ue; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = AXGE_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &axge_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + axge_detach(dev); + return (ENXIO); /* failure */ +} + +static int +axge_detach(device_t dev) +{ + struct axge_softc *sc; + struct usb_ether *ue; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +axge_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct usb_ether *ue; + struct usb_page_cache *pc; + int actlen; + + sc = usbd_xfer_softc(xfer); + ue = &sc->sc_ue; + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 0); + axge_rx_frame(ue, pc, actlen); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + + default: + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct usb_page_cache *pc; + struct mbuf *m; + uint32_t txhdr; + uint32_t txhdr2; + int nframes; + int frm_len; + + sc = usbd_xfer_softc(xfer); + ifp = uether_getifp(&sc->sc_ue); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { + /* + * Don't send anything if there is no link or + * controller is busy. + */ + return; + } + + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + frm_len = 0; + pc = usbd_xfer_get_frame(xfer, nframes); + + txhdr = m->m_pkthdr.len; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); + frm_len += sizeof(txhdr); + + txhdr2 = 0; + if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % + usbd_xfer_max_framelen(xfer) == 0) { + txhdr2 |= 0x80008000; + } + txhdr2 = htole32(txhdr2); + usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); + frm_len += sizeof(txhdr2); + + /* Next copy in the actual packet. */ + usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); + frm_len += m->m_pkthdr.len; + + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, frm_len); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return; + /* NOTREACHED */ + default: + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_tick(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = uether_getsc(ue); + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + mii_tick(mii); + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { + axge_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) + axge_start(ue); + } +} + +static void +axge_setmulti(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h; + uint16_t rxmode; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + h = 0; + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + rxmode |= AXGE_RX_CTL_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + return; + } + rxmode &= ~AXGE_RX_CTL_AMALL; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, + (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); +} + +static void +axge_setpromisc(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + else + rxmode &= ~AXGE_RX_CTL_PRO; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_setmulti(ue); +} + +static void +axge_start(struct usb_ether *ue) +{ + struct axge_softc *sc; + + sc = uether_getsc(ue); + /* + * Start the USB transfers, if not already started. + */ + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_RD]); + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_WR]); +} + +static void +axge_init(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Cancel pending I/O and free all RX/TX buffers. + */ + axge_stop(ue); + + axge_reset(sc); + + /* Set MAC address. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 00:40:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B2D3B77; Tue, 19 Nov 2013 00:40:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0E7525FB; Tue, 19 Nov 2013 00:40:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ0ecIt055499; Tue, 19 Nov 2013 00:40:38 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ0ecdL055498; Tue, 19 Nov 2013 00:40:38 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201311190040.rAJ0ecdL055498@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Nov 2013 00:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258332 - head/etc/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 00:40:39 -0000 Author: markj Date: Tue Nov 19 00:40:38 2013 New Revision: 258332 URL: http://svnweb.freebsd.org/changeset/base/258332 Log: Regenerate usb.conf after r258331. Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Tue Nov 19 00:37:53 2013 (r258331) +++ head/etc/devd/usb.conf Tue Nov 19 00:40:38 2013 (r258332) @@ -833,7 +833,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; - match "product" "0x935a"; + match "product" "(0x935a|0x935b)"; action "kldload -n if_run"; }; @@ -1801,6 +1801,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; + match "product" "0x1100"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; match "product" "0x4240"; action "kldload -n if_upgt"; }; @@ -2185,7 +2193,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0af0"; - match "product" "(0x7601|0xc031|0xd013|0xd031)"; + match "product" "0x7601"; + action "kldload -n uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x9000"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0xc031|0xd013|0xd031)"; action "kldload -n uhso"; }; @@ -2289,7 +2313,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; - match "product" "0x17b5"; + match "product" "(0x17b5|0x17cb)"; action "kldload -n ng_ubt"; }; @@ -2361,7 +2385,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b95"; - match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b)"; + match "product" "(0x1720|0x1780)"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x178a|0x1790)"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x7720|0x772a|0x772b|0x7e2b)"; action "kldload -n if_axe"; }; @@ -2433,7 +2473,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)"; + match "product" "(0x8176|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)"; action "kldload -n if_urtwn"; }; @@ -3104,6 +3144,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0fde"; + match "product" "0xca05"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0fe6"; match "product" "(0x8101|0x9700)"; action "kldload -n if_udav"; @@ -3265,7 +3313,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x8664|0x8665|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; action "kldload -n uslcom"; }; @@ -3777,7 +3825,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x148f"; - match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x5370|0x8070)"; action "kldload -n if_run"; }; @@ -4376,6 +4424,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1adb"; + match "product" "0x0001"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1b3d"; match "product" "(0x0100|0x0101|0x0102|0x0103|0x0104|0x0105|0x0106|0x0107|0x0108|0x0109|0x010a|0x010b|0x010c|0x010d|0x010e|0x010f|0x0110|0x0111|0x0112|0x0113|0x0114|0x0115|0x0116|0x0117|0x0118|0x0119|0x011a|0x011b|0x011c|0x011d|0x011e|0x011f|0x0120|0x0121|0x0122|0x0123|0x0124|0x0125|0x0126|0x0128|0x0129|0x012a|0x012b|0x012d|0x012e|0x012f|0x0130|0x0131|0x0132|0x0133|0x0134|0x0135|0x0136|0x0137|0x0138|0x0139|0x013a|0x013b|0x013c|0x013d|0x013e|0x013f|0x0140|0x0141|0x0142|0x0143|0x0144|0x0145|0x0146|0x0147|0x0148|0x0149|0x014a|0x014b|0x014c|0x014d|0x014e|0x014f|0x0150|0x0151|0x0152|0x0153|0x0159|0x015a|0x015b|0x015c|0x015d|0x015e|0x015f|0x0160|0x0161|0x0162|0x0163|0x0164|0x0165|0x0166|0x0167|0x0168|0x0169|0x016a|0x016b|0x016c|0x016d|0x016e|0x016f|0x0170|0x0171|0x0172|0x0173|0x0174|0x0175|0x0176|0x0177|0x0178|0x0179|0x017a|0x017b|0x017c|0x017d|0x017e|0x017f|0x0180|0x0181|0x0182|0x0183|0x0184|0x0185|0x0186|0x0187|0x0188|0x0189|0x018a|0x018b|0x018c|0x018d|0x018e|0x018f|0x0190|0x0191|0x019 2|0x0193|0x0194|0x0195|0x0196|0x0197|0x0198|0x0199|0x019a|0x019b|0x019c|0x019d|0x019e|0x019f|0x01a0|0x01a1|0x01a2|0x01a3|0x01a4|0x01a5|0x01a6|0x01a7|0x01a8|0x01a9|0x01aa|0x01ab|0x01ac|0x01ad|0x01ae|0x01af|0x01b0|0x01b1|0x01b2|0x01b3|0x01b4|0x01b5|0x01b6|0x01b7|0x01b8|0x01b9|0x01ba|0x01bb|0x01bc|0x01bd|0x01be|0x01bf|0x01c0|0x01c1|0x01c2|0x01c3|0x01c4|0x01c5|0x01c6|0x01c7|0x01c8|0x01c9|0x01ca|0x01cb|0x01cc|0x01cd|0x01ce|0x01cf|0x01d0|0x01d1|0x01d2|0x01d3|0x01d4|0x01d5|0x01d6|0x01d7|0x01d8|0x01d9|0x01da|0x01db|0x01dc|0x01dd|0x01de|0x01df|0x01e0|0x01e1|0x01e2|0x01e3|0x01e4|0x01e5|0x01e6|0x01e7|0x01e8|0x01e9|0x01ea|0x01eb|0x01ec|0x01ed|0x01ee|0x01ef|0x01f0|0x01f1|0x01f2|0x01f3|0x01f4|0x01f5|0x01f6|0x01f7|0x01f8|0x01f9|0x01fa|0x01fb|0x01fc|0x01fd|0x01fe|0x01ff)"; action "kldload -n uftdi"; @@ -4512,6 +4568,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1fb9"; + match "product" "(0x0100|0x0200|0x0201|0x0202|0x0203|0x0300|0x0301|0x0302|0x0303|0x0400|0x0401|0x0402|0x0403|0x0404|0x0600|0x0601|0x0602|0x0700|0x0701)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2001"; match "product" "(0x1a00|0x1a02)"; action "kldload -n if_axe"; @@ -4561,7 +4625,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1b)"; action "kldload -n if_run"; }; @@ -4768,6 +4832,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2405"; + match "product" "0x0003"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2478"; match "product" "0x2008"; action "kldload -n uplcom"; @@ -5122,6 +5194,15 @@ nomatch 32 { match "mode" "host"; match "intclass" "0x02"; match "intsubclass" "0x02"; + match "intprotocol" "0x00"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; match "intprotocol" "0x01"; action "kldload -n umodem"; }; @@ -5260,5 +5341,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2537 USB entries processed +# 2573 USB entries processed From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 00:43: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FBDCCED; Tue, 19 Nov 2013 00:43:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2E2263F; Tue, 19 Nov 2013 00:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ0hrhr057502; Tue, 19 Nov 2013 00:43:53 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ0hrRH057501; Tue, 19 Nov 2013 00:43:53 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201311190043.rAJ0hrRH057501@svn.freebsd.org> From: Mark Johnston Date: Tue, 19 Nov 2013 00:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258333 - head/tools/tools/bus_autoconf 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 00:43:54 -0000 Author: markj Date: Tue Nov 19 00:43:53 2013 New Revision: 258333 URL: http://svnweb.freebsd.org/changeset/base/258333 Log: Provide the correct path to bus_autoconf.sh. Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh Modified: head/tools/tools/bus_autoconf/bus_autoconf.sh ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.sh Tue Nov 19 00:40:38 2013 (r258332) +++ head/tools/tools/bus_autoconf/bus_autoconf.sh Tue Nov 19 00:43:53 2013 (r258333) @@ -34,7 +34,7 @@ cat < Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id A18D3965; Tue, 19 Nov 2013 01:54:33 +0000 (UTC) Date: Tue, 19 Nov 2013 01:54:33 +0000 From: Alexey Dokuchaev To: Pedro Giffuni Subject: Re: svn commit: r258179 - head/contrib/gcc Message-ID: <20131119015433.GB41287@FreeBSD.org> References: <201311151844.rAFIiPq0031444@svn.freebsd.org> <52867279.3080203@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52867279.3080203@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 01:54:33 -0000 On Fri, Nov 15, 2013 at 02:14:01PM -0500, Pedro Giffuni wrote: > FWIW, I have a *bunch* of gcc fixes/updates from Google: > > https://android.googlesource.com/toolchain/gcc/+/honeycomb/gcc-4.2.1/README.google > > I will have to sort this out better :(. It would be very nice to bring some more life into our base GCC, thanks for doing this Pedro, I appreciate it. ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 09:35:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9EA6C8C; Tue, 19 Nov 2013 09:35:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B842D206D; Tue, 19 Nov 2013 09:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJ9ZKeg037826; Tue, 19 Nov 2013 09:35:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJ9ZKgJ037825; Tue, 19 Nov 2013 09:35:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201311190935.rAJ9ZKgJ037825@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 19 Nov 2013 09:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258335 - stable/10/crypto/openssh X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 09:35:20 -0000 Author: des Date: Tue Nov 19 09:35:20 2013 New Revision: 258335 URL: http://svnweb.freebsd.org/changeset/base/258335 Log: Pre-zero the MAC context. Security: CVE-2013-4548 Security: FreeBSD-SA-13:14.openssh Approved by: re (implicit) Modified: stable/10/crypto/openssh/monitor_wrap.c Modified: stable/10/crypto/openssh/monitor_wrap.c ============================================================================== --- stable/10/crypto/openssh/monitor_wrap.c Tue Nov 19 01:07:25 2013 (r258334) +++ stable/10/crypto/openssh/monitor_wrap.c Tue Nov 19 09:35:20 2013 (r258335) @@ -482,7 +482,7 @@ mm_newkeys_from_blob(u_char *blob, int b buffer_init(&b); buffer_append(&b, blob, blen); - newkey = xmalloc(sizeof(*newkey)); + newkey = xcalloc(1, sizeof(*newkey)); enc = &newkey->enc; mac = &newkey->mac; comp = &newkey->comp; From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:05: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81EB03F7; Tue, 19 Nov 2013 10:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 578B02216; Tue, 19 Nov 2013 10:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJA5s1D048106; Tue, 19 Nov 2013 10:05:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJA5snM048103; Tue, 19 Nov 2013 10:05:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191005.rAJA5snM048103@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 10:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258336 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:05:54 -0000 Author: mav Date: Tue Nov 19 10:05:53 2013 New Revision: 258336 URL: http://svnweb.freebsd.org/changeset/base/258336 Log: Implement soft pressure on UMA cache bucket sizes. Every time system detects low memory condition decrease bucket sizes for each zone by one item. As result, higher memory pressure will push to smaller bucket sizes and so smaller per-CPU caches and so more efficient memory use. Before this change there was no force to oppose buckets growth as result of practically inevitable zone lock conflicts, and after some run time per-CPU caches could consume enough RAM to kill the system. Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 19 09:35:20 2013 (r258335) +++ head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013 (r258336) @@ -701,6 +701,13 @@ bucket_cache_drain(uma_zone_t zone) bucket_free(zone, bucket, NULL); ZONE_LOCK(zone); } + + /* + * Shrink further bucket sizes. Price of single zone lock collision + * is probably lower then price of global cache drain. + */ + if (zone->uz_count > zone->uz_count_min) + zone->uz_count--; } static void @@ -1461,6 +1468,7 @@ zone_ctor(void *mem, int size, void *uda zone->uz_fails = 0; zone->uz_sleeps = 0; zone->uz_count = 0; + zone->uz_count_min = 0; zone->uz_flags = 0; zone->uz_warning = NULL; timevalclear(&zone->uz_ratecheck); @@ -1552,6 +1560,7 @@ out: zone->uz_count = bucket_select(zone->uz_size); else zone->uz_count = BUCKET_MAX; + zone->uz_count_min = zone->uz_count; return (0); } Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Nov 19 09:35:20 2013 (r258335) +++ head/sys/vm/uma_int.h Tue Nov 19 10:05:53 2013 (r258336) @@ -300,7 +300,8 @@ struct uma_zone { volatile u_long uz_fails; /* Total number of alloc failures */ volatile u_long uz_frees; /* Total number of frees */ uint64_t uz_sleeps; /* Total number of alloc sleeps */ - uint16_t uz_count; /* Highest amount of items in bucket */ + uint16_t uz_count; /* Amount of items in full bucket */ + uint16_t uz_count_min; /* Minimal amount of items there */ /* The next three fields are used to print a rate-limited warnings. */ const char *uz_warning; /* Warning to print on failure */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:10: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A6D5724; Tue, 19 Nov 2013 10:10:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89DD6229B; Tue, 19 Nov 2013 10:10:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJAAi1A051080; Tue, 19 Nov 2013 10:10:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJAAiwh051079; Tue, 19 Nov 2013 10:10:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191010.rAJAAiwh051079@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 10:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258337 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:10:44 -0000 Author: mav Date: Tue Nov 19 10:10:44 2013 New Revision: 258337 URL: http://svnweb.freebsd.org/changeset/base/258337 Log: Add two new UMA bucket zones to store 3 and 9 items per bucket. These new buckets make bucket size self-tuning more soft and precise. Without them there are buckets for 1, 5, 13, 29, ... items. While at bigger sizes difference about 2x is fine, at smallest ones it is 5x and 2.6x respectively. New buckets make that line look like 1, 3, 5, 9, 13, 29, reducing jumps between steps, making algorithm work softer, allocating and freeing memory in better fitting chunks. Otherwise there is quite a big gap between allocating 128K and 5x128K of RAM at once. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013 (r258336) +++ head/sys/vm/uma_core.c Tue Nov 19 10:10:44 2013 (r258337) @@ -207,7 +207,9 @@ struct uma_bucket_zone { struct uma_bucket_zone bucket_zones[] = { { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, + { NULL, "6 Bucket", BUCKET_SIZE(6), 3072 }, { NULL, "8 Bucket", BUCKET_SIZE(8), 2048 }, + { NULL, "12 Bucket", BUCKET_SIZE(12), 1536 }, { NULL, "16 Bucket", BUCKET_SIZE(16), 1024 }, { NULL, "32 Bucket", BUCKET_SIZE(32), 512 }, { NULL, "64 Bucket", BUCKET_SIZE(64), 256 }, From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:17: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D22B7BBD; Tue, 19 Nov 2013 10:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C17EA2303; Tue, 19 Nov 2013 10:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJAHAYf052383; Tue, 19 Nov 2013 10:17:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJAHArf052382; Tue, 19 Nov 2013 10:17:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191017.rAJAHArf052382@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 10:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258338 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:17:10 -0000 Author: mav Date: Tue Nov 19 10:17:10 2013 New Revision: 258338 URL: http://svnweb.freebsd.org/changeset/base/258338 Log: Grow UMA zone bucket size also on lock congestion during item free. Lock congestion is the same, whether it happens on alloc or free, so handle it equally. Now that we have back pressure, there is no problem to grow buckets a bit faster. Any way growth is much slower then in 9.x. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 19 10:10:44 2013 (r258337) +++ head/sys/vm/uma_core.c Tue Nov 19 10:17:10 2013 (r258338) @@ -2529,6 +2529,7 @@ uma_zfree_arg(uma_zone_t zone, void *ite { uma_cache_t cache; uma_bucket_t bucket; + int lockfail; int cpu; #ifdef UMA_DEBUG_ALLOC_1 @@ -2613,7 +2614,12 @@ zfree_start: if (zone->uz_count == 0 || bucketdisable) goto zfree_item; - ZONE_LOCK(zone); + lockfail = 0; + if (ZONE_TRYLOCK(zone) == 0) { + /* Record contention to size the buckets. */ + ZONE_LOCK(zone); + lockfail = 1; + } critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2647,7 +2653,12 @@ zfree_start: /* We are no longer associated with this CPU. */ critical_exit(); - /* And the zone.. */ + /* + * We bump the uz count when the cache size is insufficient to + * handle the working set. + */ + if (lockfail && zone->uz_count < BUCKET_MAX) + zone->uz_count++; ZONE_UNLOCK(zone); #ifdef UMA_DEBUG_ALLOC From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:39: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CABEA979; Tue, 19 Nov 2013 10:39:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8E2D2612; Tue, 19 Nov 2013 10:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJAdmdS059255; Tue, 19 Nov 2013 10:39:48 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJAdmEn059252; Tue, 19 Nov 2013 10:39:48 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311191039.rAJAdmEn059252@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 19 Nov 2013 10:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258339 - in stable/10: . lib/libc/sys X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:39:48 -0000 Author: pluknet Date: Tue Nov 19 10:39:48 2013 New Revision: 258339 URL: http://svnweb.freebsd.org/changeset/base/258339 Log: MFC r257874: Fix extattr(2) MLINKS. Approved by: re (kib) Modified: stable/10/ObsoleteFiles.inc (contents, props changed) stable/10/lib/libc/sys/Makefile.inc Directory Properties: stable/10/lib/libc/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Tue Nov 19 10:17:10 2013 (r258338) +++ stable/10/ObsoleteFiles.inc Tue Nov 19 10:39:48 2013 (r258339) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20131109: extattr(2) mlinks fixed +OLD_FILES+=usr/share/man/man2/extattr_delete_list.2.gz +OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz # 20131103: WITH_LIBICONV_COMPAT removal OLD_FILES+=usr/include/_libiconv_compat.h OLD_FILES+=usr/lib/libiconv.a Modified: stable/10/lib/libc/sys/Makefile.inc ============================================================================== --- stable/10/lib/libc/sys/Makefile.inc Tue Nov 19 10:17:10 2013 (r258338) +++ stable/10/lib/libc/sys/Makefile.inc Tue Nov 19 10:39:48 2013 (r258339) @@ -300,9 +300,9 @@ MLINKS+=execve.2 fexecve.2 MLINKS+=extattr_get_file.2 extattr.2 \ extattr_get_file.2 extattr_delete_fd.2 \ extattr_get_file.2 extattr_delete_file.2 \ - extattr_get_file.2 extattr_delete_list.2 \ + extattr_get_file.2 extattr_delete_link.2 \ extattr_get_file.2 extattr_get_fd.2 \ - extattr_get_file.2 extattr_get_list.2 \ + extattr_get_file.2 extattr_get_link.2 \ extattr_get_file.2 extattr_list_fd.2 \ extattr_get_file.2 extattr_list_file.2 \ extattr_get_file.2 extattr_list_link.2 \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:49: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE179C37; Tue, 19 Nov 2013 10:49:52 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92B5026A2; Tue, 19 Nov 2013 10:49:52 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=95.108.170.36.red-dhcp.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Vif4l-0004jw-CA; Tue, 19 Nov 2013 10:46:19 +0400 Message-ID: <528B420A.70105@FreeBSD.org> Date: Tue, 19 Nov 2013 14:48:42 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: <201311182258.rAIMwEFd048783@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:49:52 -0000 On 19.11.2013 02:58, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Nov 18 22:58:14 2013 > New Revision: 258328 > URL: http://svnweb.freebsd.org/changeset/base/258328 > > Log: > Allow ethernet drivers to pass in packets connected via the nextpkt pointer. > Handling packets in this way allows drivers to amortize work during packet reception. Great! First, but important step in kernel batching :) > > Submitted by: Vijay Singh > Sponsored by: NetApp > > Modified: > head/sys/net/if_ethersubr.c > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) > +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) > @@ -708,13 +708,25 @@ static void > ether_input(struct ifnet *ifp, struct mbuf *m) > { > > + struct mbuf *mn; > + > /* > - * We will rely on rcvif being set properly in the deferred context, > - * so assert it is correct here. > + * The drivers are allowed to pass in a chain of packets linked with > + * m_nextpkt. We split them up into separate packets here and pass > + * them up. This allows the drivers to amortize the receive lock. > */ > - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + while (m) { > + mn = m->m_nextpkt; > + m->m_nextpkt = NULL; > > - netisr_dispatch(NETISR_ETHER, m); > + /* > + * We will rely on rcvif being set properly in the deferred context, > + * so assert it is correct here. > + */ > + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + netisr_dispatch(NETISR_ETHER, m); > + m = mn; > + } > } > > /* > From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:51: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAD56DAC; Tue, 19 Nov 2013 10:51:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9EE326E4; Tue, 19 Nov 2013 10:51:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJApkSi064983; Tue, 19 Nov 2013 10:51:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJApkAU064982; Tue, 19 Nov 2013 10:51:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191051.rAJApkAU064982@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 10:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258340 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 10:51:47 -0000 Author: mav Date: Tue Nov 19 10:51:46 2013 New Revision: 258340 URL: http://svnweb.freebsd.org/changeset/base/258340 Log: Implement mechanism to safely but slowly purge UMA per-CPU caches. This is a last resort for very low memory condition in case other measures to free memory were ineffective. Sequentially cycle through all CPUs and extract per-CPU cache buckets into zone cache from where they can be freed. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 19 10:39:48 2013 (r258339) +++ head/sys/vm/uma_core.c Tue Nov 19 10:51:46 2013 (r258340) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -684,6 +685,78 @@ cache_drain(uma_zone_t zone) ZONE_UNLOCK(zone); } +static void +cache_shrink(uma_zone_t zone) +{ + + if (zone->uz_flags & UMA_ZFLAG_INTERNAL) + return; + + ZONE_LOCK(zone); + zone->uz_count = (zone->uz_count_min + zone->uz_count) / 2; + ZONE_UNLOCK(zone); +} + +static void +cache_drain_safe_cpu(uma_zone_t zone) +{ + uma_cache_t cache; + + if (zone->uz_flags & UMA_ZFLAG_INTERNAL) + return; + + ZONE_LOCK(zone); + critical_enter(); + cache = &zone->uz_cpu[curcpu]; + if (cache->uc_allocbucket) { + LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_allocbucket, + ub_link); + cache->uc_allocbucket = NULL; + } + if (cache->uc_freebucket) { + LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_freebucket, + ub_link); + cache->uc_freebucket = NULL; + } + critical_exit(); + ZONE_UNLOCK(zone); +} + +/* + * Safely drain per-CPU caches of a zone(s) to alloc bucket. + * This is an expensive call because it needs to bind to all CPUs + * one by one and enter a critical section on each of them in order + * to safely access their cache buckets. + * Zone lock must not be held on call this function. + */ +static void +cache_drain_safe(uma_zone_t zone) +{ + int cpu; + + /* + * Polite bucket sizes shrinking was not enouth, shrink aggressively. + */ + if (zone) + cache_shrink(zone); + else + zone_foreach(cache_shrink); + + CPU_FOREACH(cpu) { + thread_lock(curthread); + sched_bind(curthread, cpu); + thread_unlock(curthread); + + if (zone) + cache_drain_safe_cpu(zone); + else + zone_foreach(cache_drain_safe_cpu); + } + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); +} + /* * Drain the cached buckets from a zone. Expects a locked zone on entry. */ @@ -3068,6 +3141,10 @@ uma_reclaim(void) #endif bucket_enable(); zone_foreach(zone_drain); + if (vm_page_count_min()) { + cache_drain_safe(NULL); + zone_foreach(zone_drain); + } /* * Some slabs may have been freed but this zone will be visited early * we visit again so that we can free pages that are empty once other From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 11:04:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4314411F; Tue, 19 Nov 2013 11:04:59 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 209E2276D; Tue, 19 Nov 2013 11:04:59 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 21F6146B0C; Tue, 19 Nov 2013 06:04:58 -0500 (EST) Date: Tue, 19 Nov 2013 11:04:57 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: "George V. Neville-Neil" Subject: Re: svn commit: r258328 - head/sys/net In-Reply-To: <201311182258.rAIMwEFd048783@svn.freebsd.org> Message-ID: References: <201311182258.rAIMwEFd048783@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 11:04:59 -0000 On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > Allow ethernet drivers to pass in packets connected via the nextpkt pointer. > Handling packets in this way allows drivers to amortize work during packet reception. > > Submitted by: Vijay Singh > Sponsored by: NetApp Currently, it is quite easy to make mistakes regarding individual mbuf chains vs. lists of mbuf chains. This leads me to wonder whether a new type, perhaps simply constructed on the stack before passing in, should be used for KPIs that accept lists of packets. E.g., /* * This structure is almost always allocated on a caller stack, so * cannot itself be queued without memory allocation in most cases. */ struct mbuf_queue { struct mbuf *mq_head; }; int ether_input(struct ifnet *ifp, struct mbuf_queue *m) { ... } ... struct mbuf_queue mq = { m }; return (ether_input(ifp, &mq)); ... That way the compiler can help us figure out where we expect an individual packet but have accidentally leaked a queue. Functions that accept only a single packet could also more agressively assert that m->m_nextpkt is NULL: M_ASSERT_ONEPACKET(m); Robert > > Modified: > head/sys/net/if_ethersubr.c > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) > +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) > @@ -708,13 +708,25 @@ static void > ether_input(struct ifnet *ifp, struct mbuf *m) > { > > + struct mbuf *mn; > + > /* > - * We will rely on rcvif being set properly in the deferred context, > - * so assert it is correct here. > + * The drivers are allowed to pass in a chain of packets linked with > + * m_nextpkt. We split them up into separate packets here and pass > + * them up. This allows the drivers to amortize the receive lock. > */ > - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + while (m) { > + mn = m->m_nextpkt; > + m->m_nextpkt = NULL; > > - netisr_dispatch(NETISR_ETHER, m); > + /* > + * We will rely on rcvif being set properly in the deferred context, > + * so assert it is correct here. > + */ > + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + netisr_dispatch(NETISR_ETHER, m); > + m = mn; > + } > } > > /* > From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 11:11: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A12943E; Tue, 19 Nov 2013 11:11:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28D45280F; Tue, 19 Nov 2013 11:11:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJBBp8B072050; Tue, 19 Nov 2013 11:11:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJBBpRH072047; Tue, 19 Nov 2013 11:11:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311191111.rAJBBpRH072047@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 19 Nov 2013 11:11: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: r258341 - in stable/9: . lib/libc/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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 11:11:52 -0000 Author: pluknet Date: Tue Nov 19 11:11:51 2013 New Revision: 258341 URL: http://svnweb.freebsd.org/changeset/base/258341 Log: MFC r257874: Fix extattr(2) MLINKS. Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/lib/libc/sys/Makefile.inc Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Tue Nov 19 10:51:46 2013 (r258340) +++ stable/9/ObsoleteFiles.inc Tue Nov 19 11:11:51 2013 (r258341) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20131109: extattr(2) mlinks fixed +OLD_FILES+=usr/share/man/man2/extattr_delete_list.2.gz +OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz # 20130704: new clang import which bumps version from 3.2 to 3.3. OLD_FILES+=usr/include/clang/3.2/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.2/__wmmintrin_pclmul.h Modified: stable/9/lib/libc/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/sys/Makefile.inc Tue Nov 19 10:51:46 2013 (r258340) +++ stable/9/lib/libc/sys/Makefile.inc Tue Nov 19 11:11:51 2013 (r258341) @@ -137,9 +137,9 @@ MLINKS+=execve.2 fexecve.2 MLINKS+=extattr_get_file.2 extattr.2 \ extattr_get_file.2 extattr_delete_fd.2 \ extattr_get_file.2 extattr_delete_file.2 \ - extattr_get_file.2 extattr_delete_list.2 \ + extattr_get_file.2 extattr_delete_link.2 \ extattr_get_file.2 extattr_get_fd.2 \ - extattr_get_file.2 extattr_get_list.2 \ + extattr_get_file.2 extattr_get_link.2 \ extattr_get_file.2 extattr_list_fd.2 \ extattr_get_file.2 extattr_list_file.2 \ extattr_get_file.2 extattr_list_link.2 \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 11:19: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEA0097C; Tue, 19 Nov 2013 11:19:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD8D52859; Tue, 19 Nov 2013 11:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJBJ7Bc073825; Tue, 19 Nov 2013 11:19:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJBJ7Fj073824; Tue, 19 Nov 2013 11:19:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191119.rAJBJ7Fj073824@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 11:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258342 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 11:19:07 -0000 Author: mav Date: Tue Nov 19 11:19:07 2013 New Revision: 258342 URL: http://svnweb.freebsd.org/changeset/base/258342 Log: Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261. On machines with seveal CPUs and enough RAM this can easily twice improve ZFS performance or twice reduce CPU usage. It was disabled three years ago due to memory and KVA exhaustion reports, but our VM subsystem got improved a lot since that time, hopefully enough to make another try. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Nov 19 11:11:51 2013 (r258341) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Nov 19 11:19:07 2013 (r258342) @@ -39,7 +39,11 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO"); +#if defined(__amd64__) +static int zio_use_uma = 1; +#else static int zio_use_uma = 0; +#endif TUNABLE_INT("vfs.zfs.zio.use_uma", &zio_use_uma); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, "Use uma(9) for ZIO allocations"); From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 11:47:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D2ADF55; Tue, 19 Nov 2013 11:47:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EEDE12A1E; Tue, 19 Nov 2013 11:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJBlZFj083291; Tue, 19 Nov 2013 11:47:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJBlUZN083259; Tue, 19 Nov 2013 11:47:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201311191147.rAJBlUZN083259@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 19 Nov 2013 11:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258343 - in stable/10/crypto/openssh: . contrib/caldera contrib/redhat contrib/suse X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 11:47:36 -0000 Author: des Date: Tue Nov 19 11:47:30 2013 New Revision: 258343 URL: http://svnweb.freebsd.org/changeset/base/258343 Log: MFH (r257954): upgrade to OpenSSH 6.4p1 Approved by: re (kib) Modified: stable/10/crypto/openssh/ChangeLog stable/10/crypto/openssh/README stable/10/crypto/openssh/auth-options.c stable/10/crypto/openssh/auth2-chall.c stable/10/crypto/openssh/authfd.c stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/cipher-3des1.c stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/contrib/caldera/openssh.spec stable/10/crypto/openssh/contrib/redhat/openssh.spec stable/10/crypto/openssh/contrib/suse/openssh.spec stable/10/crypto/openssh/gss-genr.c stable/10/crypto/openssh/monitor_mm.c stable/10/crypto/openssh/monitor_wrap.c stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/schnorr.c stable/10/crypto/openssh/sftp-client.c stable/10/crypto/openssh/sftp-glob.c stable/10/crypto/openssh/sftp-server.0 stable/10/crypto/openssh/sftp.0 stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/umac.c stable/10/crypto/openssh/version.h Directory Properties: stable/10/crypto/openssh/ (props changed) Modified: stable/10/crypto/openssh/ChangeLog ============================================================================== --- stable/10/crypto/openssh/ChangeLog Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/ChangeLog Tue Nov 19 11:47:30 2013 (r258343) @@ -1,3 +1,20 @@ +20131108 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2013/11/06 16:52:11 + [monitor_wrap.c] + fix rekeying for AES-GCM modes; ok deraadt + - djm@cvs.openbsd.org 2013/11/08 00:39:15 + [auth-options.c auth2-chall.c authfd.c channels.c cipher-3des1.c] + [clientloop.c gss-genr.c monitor_mm.c packet.c schnorr.c umac.c] + [sftp-client.c sftp-glob.c] + use calloc for all structure allocations; from markus@ + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] update version numbers + - djm@cvs.openbsd.org 2013/11/08 01:38:11 + [version.h] + openssh-6.4 + - (djm) Release 6.4p1 + 20130913 - (djm) [channels.c] Fix unaligned access on sparc machines in SOCKS5 code; ok dtucker@ Modified: stable/10/crypto/openssh/README ============================================================================== --- stable/10/crypto/openssh/README Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/README Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.3 for the release notes. +See http://www.openssh.com/txt/release-6.4 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.83 2013/07/25 02:34:00 djm Exp $ +$Id: README,v 1.83.4.1 2013/11/08 01:36:17 djm Exp $ Modified: stable/10/crypto/openssh/auth-options.c ============================================================================== --- stable/10/crypto/openssh/auth-options.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/auth-options.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.59 2013/07/12 00:19:58 djm Exp $ */ +/* $OpenBSD: auth-options.c,v 1.61 2013/11/08 00:39:14 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -239,7 +239,7 @@ auth_parse_options(struct passwd *pw, ch auth_debug_add("Adding to environment: %.900s", s); debug("Adding to environment: %.900s", s); opts++; - new_envstring = xmalloc(sizeof(struct envstring)); + new_envstring = xcalloc(1, sizeof(struct envstring)); new_envstring->s = s; new_envstring->next = custom_environment; custom_environment = new_envstring; Modified: stable/10/crypto/openssh/auth2-chall.c ============================================================================== --- stable/10/crypto/openssh/auth2-chall.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/auth2-chall.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-chall.c,v 1.38 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: auth2-chall.c,v 1.39 2013/11/08 00:39:14 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Per Allansson. All rights reserved. @@ -111,7 +111,7 @@ kbdint_alloc(const char *devs) remove_kbdint_device("pam"); #endif - kbdintctxt = xmalloc(sizeof(KbdintAuthctxt)); + kbdintctxt = xcalloc(1, sizeof(KbdintAuthctxt)); if (strcmp(devs, "") == 0) { buffer_init(&b); for (i = 0; devices[i]; i++) { Modified: stable/10/crypto/openssh/authfd.c ============================================================================== --- stable/10/crypto/openssh/authfd.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/authfd.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.c,v 1.87 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: authfd.c,v 1.88 2013/11/08 00:39:14 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -206,7 +206,7 @@ ssh_get_authentication_connection(void) if (sock < 0) return NULL; - auth = xmalloc(sizeof(*auth)); + auth = xcalloc(1, sizeof(*auth)); auth->fd = sock; buffer_init(&auth->identities); auth->howmany = 0; Modified: stable/10/crypto/openssh/channels.c ============================================================================== --- stable/10/crypto/openssh/channels.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/channels.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.324 2013/07/12 00:19:58 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.327 2013/11/08 00:39:15 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -711,7 +711,7 @@ channel_register_status_confirm(int id, if ((c = channel_lookup(id)) == NULL) fatal("channel_register_expect: %d: bad id", id); - cc = xmalloc(sizeof(*cc)); + cc = xcalloc(1, sizeof(*cc)); cc->cb = cb; cc->abandon_cb = abandon_cb; cc->ctx = ctx; Modified: stable/10/crypto/openssh/cipher-3des1.c ============================================================================== --- stable/10/crypto/openssh/cipher-3des1.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/cipher-3des1.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-3des1.c,v 1.8 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: cipher-3des1.c,v 1.9 2013/11/08 00:39:15 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * @@ -67,7 +67,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, cons u_char *k1, *k2, *k3; if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) { - c = xmalloc(sizeof(*c)); + c = xcalloc(1, sizeof(*c)); EVP_CIPHER_CTX_set_app_data(ctx, c); } if (key == NULL) Modified: stable/10/crypto/openssh/clientloop.c ============================================================================== --- stable/10/crypto/openssh/clientloop.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/clientloop.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.253 2013/06/07 15:37:52 dtucker Exp $ */ +/* $OpenBSD: clientloop.c,v 1.255 2013/11/08 00:39:15 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -838,7 +838,7 @@ void client_expect_confirm(int id, const char *request, enum confirm_action action) { - struct channel_reply_ctx *cr = xmalloc(sizeof(*cr)); + struct channel_reply_ctx *cr = xcalloc(1, sizeof(*cr)); cr->request_type = request; cr->action = action; @@ -861,7 +861,7 @@ client_register_global_confirm(global_co return; } - gc = xmalloc(sizeof(*gc)); + gc = xcalloc(1, sizeof(*gc)); gc->cb = cb; gc->ctx = ctx; gc->ref_count = 1; @@ -1439,7 +1439,7 @@ client_new_escape_filter_ctx(int escape_ { struct escape_filter_ctx *ret; - ret = xmalloc(sizeof(*ret)); + ret = xcalloc(1, sizeof(*ret)); ret->escape_pending = 0; ret->escape_char = escape_char; return (void *)ret; Modified: stable/10/crypto/openssh/contrib/caldera/openssh.spec ============================================================================== --- stable/10/crypto/openssh/contrib/caldera/openssh.spec Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/contrib/caldera/openssh.spec Tue Nov 19 11:47:30 2013 (r258343) @@ -16,7 +16,7 @@ #old cvs stuff. please update before use. may be deprecated. %define use_stable 1 -%define version 6.3p1 +%define version 6.4p1 %if %{use_stable} %define cvs %{nil} %define release 1 @@ -363,4 +363,4 @@ fi * Mon Jan 01 1998 ... Template Version: 1.31 -$Id: openssh.spec,v 1.80 2013/07/25 02:34:00 djm Exp $ +$Id: openssh.spec,v 1.80.4.1 2013/11/08 01:36:19 djm Exp $ Modified: stable/10/crypto/openssh/contrib/redhat/openssh.spec ============================================================================== --- stable/10/crypto/openssh/contrib/redhat/openssh.spec Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/contrib/redhat/openssh.spec Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -%define ver 6.3p1 +%define ver 6.4p1 %define rel 1 # OpenSSH privilege separation requires a user & group ID Modified: stable/10/crypto/openssh/contrib/suse/openssh.spec ============================================================================== --- stable/10/crypto/openssh/contrib/suse/openssh.spec Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/contrib/suse/openssh.spec Tue Nov 19 11:47:30 2013 (r258343) @@ -13,7 +13,7 @@ Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation Name: openssh -Version: 6.3p1 +Version: 6.4p1 URL: http://www.openssh.com/ Release: 1 Source0: openssh-%{version}.tar.gz Modified: stable/10/crypto/openssh/gss-genr.c ============================================================================== --- stable/10/crypto/openssh/gss-genr.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/gss-genr.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: gss-genr.c,v 1.21 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: gss-genr.c,v 1.22 2013/11/08 00:39:15 djm Exp $ */ /* * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. @@ -62,7 +62,7 @@ ssh_gssapi_set_oid_data(Gssctxt *ctx, vo free(ctx->oid->elements); free(ctx->oid); } - ctx->oid = xmalloc(sizeof(gss_OID_desc)); + ctx->oid = xcalloc(1, sizeof(gss_OID_desc)); ctx->oid->length = len; ctx->oid->elements = xmalloc(len); memcpy(ctx->oid->elements, data, len); Modified: stable/10/crypto/openssh/monitor_mm.c ============================================================================== --- stable/10/crypto/openssh/monitor_mm.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/monitor_mm.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_mm.c,v 1.17 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: monitor_mm.c,v 1.18 2013/11/08 00:39:15 djm Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. @@ -65,7 +65,7 @@ mm_make_entry(struct mm_master *mm, stru struct mm_share *tmp, *tmp2; if (mm->mmalloc == NULL) - tmp = xmalloc(sizeof(struct mm_share)); + tmp = xcalloc(1, sizeof(struct mm_share)); else tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share)); tmp->address = address; @@ -88,7 +88,7 @@ mm_create(struct mm_master *mmalloc, siz struct mm_master *mm; if (mmalloc == NULL) - mm = xmalloc(sizeof(struct mm_master)); + mm = xcalloc(1, sizeof(struct mm_master)); else mm = mm_xmalloc(mmalloc, sizeof(struct mm_master)); @@ -161,6 +161,7 @@ mm_xmalloc(struct mm_master *mm, size_t address = mm_malloc(mm, size); if (address == NULL) fatal("%s: mm_malloc(%lu)", __func__, (u_long)size); + memset(address, 0, size); return (address); } Modified: stable/10/crypto/openssh/monitor_wrap.c ============================================================================== --- stable/10/crypto/openssh/monitor_wrap.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/monitor_wrap.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_wrap.c,v 1.76 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: monitor_wrap.c,v 1.77 2013/11/06 16:52:11 markus Exp $ */ /* * Copyright 2002 Niels Provos * Copyright 2002 Markus Friedl Modified: stable/10/crypto/openssh/packet.c ============================================================================== --- stable/10/crypto/openssh/packet.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/packet.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.188 2013/07/12 00:19:58 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.189 2013/11/08 00:39:15 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -999,7 +999,7 @@ packet_send2(void) (type == SSH2_MSG_SERVICE_REQUEST) || (type == SSH2_MSG_SERVICE_ACCEPT)) { debug("enqueue packet: %u", type); - p = xmalloc(sizeof(*p)); + p = xcalloc(1, sizeof(*p)); p->type = type; memcpy(&p->payload, &active_state->outgoing_packet, sizeof(Buffer)); Modified: stable/10/crypto/openssh/schnorr.c ============================================================================== --- stable/10/crypto/openssh/schnorr.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/schnorr.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: schnorr.c,v 1.7 2013/05/17 00:13:14 djm Exp $ */ +/* $OpenBSD: schnorr.c,v 1.8 2013/11/08 00:39:15 djm Exp $ */ /* $FreeBSD$ */ /* * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -552,7 +552,7 @@ modp_group_from_g_and_safe_p(const char { struct modp_group *ret; - ret = xmalloc(sizeof(*ret)); + ret = xcalloc(1, sizeof(*ret)); ret->p = ret->q = ret->g = NULL; if (BN_hex2bn(&ret->p, grp_p) == 0 || BN_hex2bn(&ret->g, grp_g) == 0) Modified: stable/10/crypto/openssh/sftp-client.c ============================================================================== --- stable/10/crypto/openssh/sftp-client.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sftp-client.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-client.c,v 1.101 2013/07/25 00:56:51 djm Exp $ */ +/* $OpenBSD: sftp-client.c,v 1.108 2013/11/08 00:39:15 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -471,7 +471,7 @@ do_lsreaddir(struct sftp_conn *conn, cha if (dir) { ents = 0; - *dir = xmalloc(sizeof(**dir)); + *dir = xcalloc(1, sizeof(**dir)); (*dir)[0] = NULL; } @@ -545,7 +545,7 @@ do_lsreaddir(struct sftp_conn *conn, cha if (dir) { *dir = xrealloc(*dir, ents + 2, sizeof(**dir)); - (*dir)[ents] = xmalloc(sizeof(***dir)); + (*dir)[ents] = xcalloc(1, sizeof(***dir)); (*dir)[ents]->filename = xstrdup(filename); (*dir)[ents]->longname = xstrdup(longname); memcpy(&(*dir)[ents]->a, a, sizeof(*a)); @@ -564,7 +564,7 @@ do_lsreaddir(struct sftp_conn *conn, cha /* Don't return partial matches on interrupt */ if (interrupted && dir != NULL && *dir != NULL) { free_sftp_dirents(*dir); - *dir = xmalloc(sizeof(**dir)); + *dir = xcalloc(1, sizeof(**dir)); **dir = NULL; } @@ -1105,7 +1105,7 @@ do_download(struct sftp_conn *conn, char (unsigned long long)offset, (unsigned long long)offset + buflen - 1, num_req, max_req); - req = xmalloc(sizeof(*req)); + req = xcalloc(1, sizeof(*req)); req->id = conn->msg_id++; req->len = buflen; req->offset = offset; @@ -1463,7 +1463,7 @@ do_upload(struct sftp_conn *conn, char * strerror(errno)); if (len != 0) { - ack = xmalloc(sizeof(*ack)); + ack = xcalloc(1, sizeof(*ack)); ack->id = ++id; ack->offset = offset; ack->len = len; Modified: stable/10/crypto/openssh/sftp-glob.c ============================================================================== --- stable/10/crypto/openssh/sftp-glob.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sftp-glob.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.c,v 1.24 2013/05/17 00:13:14 djm Exp $ */ +/* $OpenBSD: sftp-glob.c,v 1.25 2013/11/08 00:39:15 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -48,7 +48,7 @@ fudge_opendir(const char *path) { struct SFTP_OPENDIR *r; - r = xmalloc(sizeof(*r)); + r = xcalloc(1, sizeof(*r)); if (do_readdir(cur.conn, (char *)path, &r->dir)) { free(r); Modified: stable/10/crypto/openssh/sftp-server.0 ============================================================================== --- stable/10/crypto/openssh/sftp-server.0 Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sftp-server.0 Tue Nov 19 11:47:30 2013 (r258343) @@ -61,9 +61,8 @@ DESCRIPTION SEE ALSO sftp(1), ssh(1), sshd_config(5), sshd(8) - T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, - draft-ietf-secsh-filexfer-02.txt, October 2001, work in progress - material. + T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh- + filexfer-02.txt, October 2001, work in progress material. HISTORY sftp-server first appeared in OpenBSD 2.8. Modified: stable/10/crypto/openssh/sftp.0 ============================================================================== --- stable/10/crypto/openssh/sftp.0 Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sftp.0 Tue Nov 19 11:47:30 2013 (r258343) @@ -342,8 +342,7 @@ SEE ALSO ftp(1), ls(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), glob(3), ssh_config(5), sftp-server(8), sshd(8) - T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, - draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress - material. + T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh- + filexfer-00.txt, January 2001, work in progress material. OpenBSD 5.4 July 25, 2013 OpenBSD 5.4 Modified: stable/10/crypto/openssh/ssh_config ============================================================================== --- stable/10/crypto/openssh/ssh_config Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/ssh_config Tue Nov 19 11:47:30 2013 (r258343) @@ -48,4 +48,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20130918 +# VersionAddendum FreeBSD-20131111 Modified: stable/10/crypto/openssh/ssh_config.5 ============================================================================== --- stable/10/crypto/openssh/ssh_config.5 Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/ssh_config.5 Tue Nov 19 11:47:30 2013 (r258343) @@ -1259,7 +1259,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20130918 . +.Dq FreeBSD-20131111 . .It Cm VisualHostKey If this flag is set to .Dq yes , Modified: stable/10/crypto/openssh/sshd_config ============================================================================== --- stable/10/crypto/openssh/sshd_config Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sshd_config Tue Nov 19 11:47:30 2013 (r258343) @@ -118,7 +118,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20130918 +#VersionAddendum FreeBSD-20131111 # no default banner path #Banner none Modified: stable/10/crypto/openssh/sshd_config.5 ============================================================================== --- stable/10/crypto/openssh/sshd_config.5 Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/sshd_config.5 Tue Nov 19 11:47:30 2013 (r258343) @@ -1217,7 +1217,7 @@ restrictions. Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20130918 . +.Dq FreeBSD-20131111 . .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's Modified: stable/10/crypto/openssh/umac.c ============================================================================== --- stable/10/crypto/openssh/umac.c Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/umac.c Tue Nov 19 11:47:30 2013 (r258343) @@ -1,4 +1,4 @@ -/* $OpenBSD: umac.c,v 1.7 2013/07/22 05:00:17 djm Exp $ */ +/* $OpenBSD: umac.c,v 1.8 2013/11/08 00:39:15 djm Exp $ */ /* ----------------------------------------------------------------------- * * umac.c -- C Implementation UMAC Message Authentication @@ -1227,7 +1227,7 @@ struct umac_ctx *umac_new(const u_char k size_t bytes_to_add; aes_int_key prf_key; - octx = ctx = xmalloc(sizeof(*ctx) + ALLOC_BOUNDARY); + octx = ctx = xcalloc(1, sizeof(*ctx) + ALLOC_BOUNDARY); if (ctx) { if (ALLOC_BOUNDARY) { bytes_to_add = ALLOC_BOUNDARY - Modified: stable/10/crypto/openssh/version.h ============================================================================== --- stable/10/crypto/openssh/version.h Tue Nov 19 11:19:07 2013 (r258342) +++ stable/10/crypto/openssh/version.h Tue Nov 19 11:47:30 2013 (r258343) @@ -1,10 +1,10 @@ -/* $OpenBSD: version.h,v 1.67 2013/07/25 00:57:37 djm Exp $ */ +/* $OpenBSD: version.h,v 1.68 2013/11/08 01:38:11 djm Exp $ */ /* $FreeBSD$ */ -#define SSH_VERSION "OpenSSH_6.3" +#define SSH_VERSION "OpenSSH_6.4" #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20130918" +#define SSH_VERSION_FREEBSD "FreeBSD-20131111" #define SSH_VERSION_HPN "_hpn13v11" From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 12:11:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 594D7488; Tue, 19 Nov 2013 12:11:12 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B90C2B9E; Tue, 19 Nov 2013 12:11:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rAJCB9mo068241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Nov 2013 16:11:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rAJCB9ab068240; Tue, 19 Nov 2013 16:11:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 19 Nov 2013 16:11:09 +0400 From: Gleb Smirnoff To: Alexander Motin Subject: Re: svn commit: r258336 - head/sys/vm Message-ID: <20131119121109.GG7577@FreeBSD.org> References: <201311191005.rAJA5snM048103@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311191005.rAJA5snM048103@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 12:11:12 -0000 Alexander, On Tue, Nov 19, 2013 at 10:05:53AM +0000, Alexander Motin wrote: A> Author: mav A> Date: Tue Nov 19 10:05:53 2013 A> New Revision: 258336 A> URL: http://svnweb.freebsd.org/changeset/base/258336 A> A> Log: A> Implement soft pressure on UMA cache bucket sizes. A> A> Every time system detects low memory condition decrease bucket sizes for A> each zone by one item. As result, higher memory pressure will push to A> smaller bucket sizes and so smaller per-CPU caches and so more efficient A> memory use. A> A> Before this change there was no force to oppose buckets growth as result A> of practically inevitable zone lock conflicts, and after some run time A> per-CPU caches could consume enough RAM to kill the system. Brief review of patch tells me that system never recovers from this. uz_count it decremented only and never incremented. A> Modified: A> head/sys/vm/uma_core.c A> head/sys/vm/uma_int.h A> A> Modified: head/sys/vm/uma_core.c A> ============================================================================== A> --- head/sys/vm/uma_core.c Tue Nov 19 09:35:20 2013 (r258335) A> +++ head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013 (r258336) A> @@ -701,6 +701,13 @@ bucket_cache_drain(uma_zone_t zone) A> bucket_free(zone, bucket, NULL); A> ZONE_LOCK(zone); A> } A> + A> + /* A> + * Shrink further bucket sizes. Price of single zone lock collision A> + * is probably lower then price of global cache drain. A> + */ A> + if (zone->uz_count > zone->uz_count_min) A> + zone->uz_count--; A> } A> A> static void A> @@ -1461,6 +1468,7 @@ zone_ctor(void *mem, int size, void *uda A> zone->uz_fails = 0; A> zone->uz_sleeps = 0; A> zone->uz_count = 0; A> + zone->uz_count_min = 0; A> zone->uz_flags = 0; A> zone->uz_warning = NULL; A> timevalclear(&zone->uz_ratecheck); A> @@ -1552,6 +1560,7 @@ out: A> zone->uz_count = bucket_select(zone->uz_size); A> else A> zone->uz_count = BUCKET_MAX; A> + zone->uz_count_min = zone->uz_count; A> A> return (0); A> } A> A> Modified: head/sys/vm/uma_int.h A> ============================================================================== A> --- head/sys/vm/uma_int.h Tue Nov 19 09:35:20 2013 (r258335) A> +++ head/sys/vm/uma_int.h Tue Nov 19 10:05:53 2013 (r258336) A> @@ -300,7 +300,8 @@ struct uma_zone { A> volatile u_long uz_fails; /* Total number of alloc failures */ A> volatile u_long uz_frees; /* Total number of frees */ A> uint64_t uz_sleeps; /* Total number of alloc sleeps */ A> - uint16_t uz_count; /* Highest amount of items in bucket */ A> + uint16_t uz_count; /* Amount of items in full bucket */ A> + uint16_t uz_count_min; /* Minimal amount of items there */ A> A> /* The next three fields are used to print a rate-limited warnings. */ A> const char *uz_warning; /* Warning to print on failure */ -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 12:12:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B415A6B6; Tue, 19 Nov 2013 12:12:08 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1172BAD; Tue, 19 Nov 2013 12:12:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rAJCC63a068259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Nov 2013 16:12:06 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rAJCC6ME068258; Tue, 19 Nov 2013 16:12:06 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 19 Nov 2013 16:12:06 +0400 From: Gleb Smirnoff To: Alexander Motin Subject: Re: svn commit: r258336 - head/sys/vm Message-ID: <20131119121206.GH7577@FreeBSD.org> References: <201311191005.rAJA5snM048103@svn.freebsd.org> <20131119121109.GG7577@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131119121109.GG7577@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 12:12:08 -0000 On Tue, Nov 19, 2013 at 04:11:09PM +0400, Gleb Smirnoff wrote: T> Alexander, T> T> On Tue, Nov 19, 2013 at 10:05:53AM +0000, Alexander Motin wrote: T> A> Author: mav T> A> Date: Tue Nov 19 10:05:53 2013 T> A> New Revision: 258336 T> A> URL: http://svnweb.freebsd.org/changeset/base/258336 T> A> T> A> Log: T> A> Implement soft pressure on UMA cache bucket sizes. T> A> T> A> Every time system detects low memory condition decrease bucket sizes for T> A> each zone by one item. As result, higher memory pressure will push to T> A> smaller bucket sizes and so smaller per-CPU caches and so more efficient T> A> memory use. T> A> T> A> Before this change there was no force to oppose buckets growth as result T> A> of practically inevitable zone lock conflicts, and after some run time T> A> per-CPU caches could consume enough RAM to kill the system. T> T> Brief review of patch tells me that system never recovers from this. uz_count T> it decremented only and never incremented. Do I understand right that r258338 fixes that? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 13:32: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73FB1E75; Tue, 19 Nov 2013 13:32:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63FBF2097; Tue, 19 Nov 2013 13:32:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJDWPpB020189; Tue, 19 Nov 2013 13:32:25 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJDWPgF020188; Tue, 19 Nov 2013 13:32:25 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201311191332.rAJDWPgF020188@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 19 Nov 2013 13:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258345 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 13:32:25 -0000 Author: tijl Date: Tue Nov 19 13:32:24 2013 New Revision: 258345 URL: http://svnweb.freebsd.org/changeset/base/258345 Log: One more BIND remnant: /etc/mtree/BIND.chroot.dist Discussed with: des Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 19 12:21:47 2013 (r258344) +++ head/ObsoleteFiles.inc Tue Nov 19 13:32:24 2013 (r258345) @@ -132,6 +132,7 @@ OLD_FILES+=usr/bin/gnu-ranlib OLD_FILES+=usr/share/man/man1/gnu-ar.1.gz OLD_FILES+=usr/share/man/man1/gnu-ranlib.1.gz # 20130930: BIND removed from base +OLD_FILES+=etc/mtree/BIND.chroot.dist OLD_FILES+=etc/namedb OLD_FILES+=etc/periodic/daily/470.status-named OLD_FILES+=usr/bin/dig From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 14:24:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87ED0A7C; Tue, 19 Nov 2013 14:24:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68CAF2395; Tue, 19 Nov 2013 14:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJEOQZ8037411; Tue, 19 Nov 2013 14:24:26 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJEOQ8U037410; Tue, 19 Nov 2013 14:24:26 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201311191424.rAJEOQ8U037410@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 19 Nov 2013 14:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258346 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 14:24:26 -0000 Author: oleg Date: Tue Nov 19 14:24:25 2013 New Revision: 258346 URL: http://svnweb.freebsd.org/changeset/base/258346 Log: MFC: 257695 - Fix link loss on vlan reconfiguration. - Fix issues with 'vlanhwfilter'. Approved by: re (glebius) Modified: stable/10/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Tue Nov 19 13:32:24 2013 (r258345) +++ stable/10/sys/dev/ixgbe/ixgbe.c Tue Nov 19 14:24:25 2013 (r258346) @@ -1253,9 +1253,6 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); } - /* Set up VLAN support and filter */ - ixgbe_setup_vlan_hw_support(adapter); - /* Enable Receive engine */ rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); if (hw->mac.type == ixgbe_mac_82598EB) @@ -1339,6 +1336,9 @@ ixgbe_init_locked(struct adapter *adapte /* Initialize the FC settings */ ixgbe_start_hw(hw); + /* Set up VLAN support and filter */ + ixgbe_setup_vlan_hw_support(adapter); + /* And now turn on interrupts */ ixgbe_enable_intr(adapter); @@ -4691,7 +4691,7 @@ ixgbe_register_vlan(void *arg, struct if bit = vtag & 0x1F; adapter->shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; - ixgbe_init_locked(adapter); + ixgbe_setup_vlan_hw_support(adapter); IXGBE_CORE_UNLOCK(adapter); } @@ -4718,7 +4718,7 @@ ixgbe_unregister_vlan(void *arg, struct adapter->shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; /* Re-init to load the changes */ - ixgbe_init_locked(adapter); + ixgbe_setup_vlan_hw_support(adapter); IXGBE_CORE_UNLOCK(adapter); } @@ -4740,6 +4740,20 @@ ixgbe_setup_vlan_hw_support(struct adapt if (adapter->num_vlans == 0) return; + /* Setup the queues for vlans */ + for (int i = 0; i < adapter->num_queues; i++) { + rxr = &adapter->rx_rings[i]; + /* On 82599 the VLAN enable is per/queue in RXDCTL */ + if (hw->mac.type != ixgbe_mac_82598EB) { + ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + ctrl |= IXGBE_RXDCTL_VME; + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); + } + rxr->vtag_strip = TRUE; + } + + if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0) + return; /* ** A soft reset zero's out the VFTA, so ** we need to repopulate it now. @@ -4758,18 +4772,6 @@ ixgbe_setup_vlan_hw_support(struct adapt if (hw->mac.type == ixgbe_mac_82598EB) ctrl |= IXGBE_VLNCTRL_VME; IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl); - - /* Setup the queues for vlans */ - for (int i = 0; i < adapter->num_queues; i++) { - rxr = &adapter->rx_rings[i]; - /* On 82599 the VLAN enable is per/queue in RXDCTL */ - if (hw->mac.type != ixgbe_mac_82598EB) { - ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); - ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); - } - rxr->vtag_strip = TRUE; - } } static void From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 14:30: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A4E1C21; Tue, 19 Nov 2013 14:30:46 +0000 (UTC) Received: from mail-ea0-x236.google.com (mail-ea0-x236.google.com [IPv6:2a00:1450:4013:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2713523F8; Tue, 19 Nov 2013 14:30:45 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id o10so4011811eaj.27 for ; Tue, 19 Nov 2013 06:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=y5+dcKh0er1dwGro6JOoXvK2CTLnB2O/BqThTdT+KxU=; b=WsSiM4E4V7AmEXtlS+dBUMEWioDjYvwo/iRYBX+jP6aH++1achkIWVmVdqoUD3qw2z cBu7rpjxQJiZwqG/RvMWnrKL5kDQY2bXcUdrlvMOBoCTgl0+GZv3TaH9SSIVWejYGSCB 1wILrs0oCxCdbev6eSOcqPjJ0zEq0xGGAR/ijSqw4r4taWfIm58LaoSGze8wQCEH46N/ KjtZAyclKjStNDO7hLWRz40tNDRNef7Ig7Qx1oLM/64OatmHo+1UsxOjKYGrn1B2lSdQ y0zohq1oES4ltOSo13AYs/FuZrWFdbdjdoAJSJCvsF+oZB4XoBmSAAUY/31DAnzVbCD2 ZltA== X-Received: by 10.14.176.3 with SMTP id a3mr633258eem.109.1384871443544; Tue, 19 Nov 2013 06:30:43 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([178.137.150.35]) by mx.google.com with ESMTPSA id z1sm49364304eeo.14.2013.11.19.06.30.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 06:30:42 -0800 (PST) Sender: Alexander Motin Message-ID: <528B760F.3010001@FreeBSD.org> Date: Tue, 19 Nov 2013 16:30:39 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r258336 - head/sys/vm References: <201311191005.rAJA5snM048103@svn.freebsd.org> <20131119121109.GG7577@FreeBSD.org> <20131119121206.GH7577@FreeBSD.org> In-Reply-To: <20131119121206.GH7577@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 14:30:46 -0000 On 19.11.2013 14:12, Gleb Smirnoff wrote: > On Tue, Nov 19, 2013 at 04:11:09PM +0400, Gleb Smirnoff wrote: > T> Alexander, > T> > T> On Tue, Nov 19, 2013 at 10:05:53AM +0000, Alexander Motin wrote: > T> A> Author: mav > T> A> Date: Tue Nov 19 10:05:53 2013 > T> A> New Revision: 258336 > T> A> URL: http://svnweb.freebsd.org/changeset/base/258336 > T> A> > T> A> Log: > T> A> Implement soft pressure on UMA cache bucket sizes. > T> A> > T> A> Every time system detects low memory condition decrease bucket sizes for > T> A> each zone by one item. As result, higher memory pressure will push to > T> A> smaller bucket sizes and so smaller per-CPU caches and so more efficient > T> A> memory use. > T> A> > T> A> Before this change there was no force to oppose buckets growth as result > T> A> of practically inevitable zone lock conflicts, and after some run time > T> A> per-CPU caches could consume enough RAM to kill the system. > T> > T> Brief review of patch tells me that system never recovers from this. uz_count > T> it decremented only and never incremented. You are wrong. uz_count is incremented in uma_zalloc_arg() same as it was always before. Probably it was too brief review. :) > Do I understand right that r258338 fixes that? Not fixes (since there was no bug), but adds second increment point. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 15:35: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3C89FA0; Tue, 19 Nov 2013 15:35:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3187283C; Tue, 19 Nov 2013 15:35:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJFZQfC062671; Tue, 19 Nov 2013 15:35:26 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJFZQvW062670; Tue, 19 Nov 2013 15:35:26 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201311191535.rAJFZQvW062670@svn.freebsd.org> From: Bryan Drewery Date: Tue, 19 Nov 2013 15:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258347 - head/lib/libfetch 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 15:35:27 -0000 Author: bdrewery (ports committer) Date: Tue Nov 19 15:35:26 2013 New Revision: 258347 URL: http://svnweb.freebsd.org/changeset/base/258347 Log: Support SNI in libfetch SNI is Server Name Indentification which is a protocol for TLS that indicates the host that is being connected to at the start of the handshake. It allows to use Virtual Hosts on HTTPS. Submitted by: sbz Submitted by: Michael Gmelin [1] PR: kern/183583 [1] Reviewed by: des Approved by: bapt MFC after: 1 week Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Tue Nov 19 14:24:25 2013 (r258346) +++ head/lib/libfetch/common.c Tue Nov 19 15:35:26 2013 (r258347) @@ -829,6 +829,15 @@ fetch_ssl(conn_t *conn, const struct url return (-1); } SSL_set_fd(conn->ssl, conn->sd); + +#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) + if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) { + fprintf(stderr, + "TLS server name indication extension failed for host %s\n", + URL->host); + return (-1); + } +#endif while ((ret = SSL_connect(conn->ssl)) == -1) { ssl_err = SSL_get_error(conn->ssl, ret); if (ssl_err != SSL_ERROR_WANT_READ && From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 15:43: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A0DB2A2; Tue, 19 Nov 2013 15:43:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89E7828CA; Tue, 19 Nov 2013 15:43:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJFhRVE065601; Tue, 19 Nov 2013 15:43:27 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJFhRbq065600; Tue, 19 Nov 2013 15:43:27 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201311191543.rAJFhRbq065600@svn.freebsd.org> From: Bryan Drewery Date: Tue, 19 Nov 2013 15:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258348 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 15:43:27 -0000 Author: bdrewery (ports committer) Date: Tue Nov 19 15:43:27 2013 New Revision: 258348 URL: http://svnweb.freebsd.org/changeset/base/258348 Log: Follow-up to r258227 and document 'enabled' as a boolean instead of a string. Approved by: bapt MFC after: 2 days X-MFC-With: r258227 Modified: head/usr.sbin/pkg/pkg.7 Modified: head/usr.sbin/pkg/pkg.7 ============================================================================== --- head/usr.sbin/pkg/pkg.7 Tue Nov 19 15:35:26 2013 (r258347) +++ head/usr.sbin/pkg/pkg.7 Tue Nov 19 15:43:27 2013 (r258348) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2013 +.Dd November 19, 2013 .Dt PKG 7 .Os .Sh NAME @@ -108,7 +108,7 @@ FreeBSD: { mirror_type: "srv", signature_type: "none", fingerprints: "/usr/share/keys/pkg", - enabled: "yes" + enabled: yes } .Ed .Bl -tag -width signature_type -compact From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 16:11: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0F5B933; Tue, 19 Nov 2013 16:11:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B116E2A72; Tue, 19 Nov 2013 16:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJGB3BK075542; Tue, 19 Nov 2013 16:11:03 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJGB34C075541; Tue, 19 Nov 2013 16:11:03 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201311191611.rAJGB34C075541@svn.freebsd.org> From: Bryan Drewery Date: Tue, 19 Nov 2013 16:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258349 - head/lib/libfetch 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 16:11:03 -0000 Author: bdrewery (ports committer) Date: Tue Nov 19 16:11:03 2013 New Revision: 258349 URL: http://svnweb.freebsd.org/changeset/base/258349 Log: Fix build with GCC SSL_set_tlsext_host_name(3) internally does not modify the host buffer pased to it. So it is safe to DECONST the struct url* here. Reported by: gjb Approved by: bapt (implicit) MFC after: 1 week X-MFC-With: r258347 Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Tue Nov 19 15:43:27 2013 (r258348) +++ head/lib/libfetch/common.c Tue Nov 19 16:11:03 2013 (r258349) @@ -831,7 +831,8 @@ fetch_ssl(conn_t *conn, const struct url SSL_set_fd(conn->ssl, conn->sd); #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) - if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) { + if (!SSL_set_tlsext_host_name(conn->ssl, + __DECONST(struct url *, URL)->host)) { fprintf(stderr, "TLS server name indication extension failed for host %s\n", URL->host); From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 17:53:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10236605; Tue, 19 Nov 2013 17:53:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F40072066; Tue, 19 Nov 2013 17:53:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJHrJJx009586; Tue, 19 Nov 2013 17:53:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJHrJB6009585; Tue, 19 Nov 2013 17:53:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201311191753.rAJHrJB6009585@svn.freebsd.org> From: Dimitry Andric Date: Tue, 19 Nov 2013 17:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258350 - head/contrib/llvm/lib/Analysis 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 17:53:20 -0000 Author: dim Date: Tue Nov 19 17:53:19 2013 New Revision: 258350 URL: http://svnweb.freebsd.org/changeset/base/258350 Log: Pull in r191896 from upstream llvm trunk: CaptureTracking: Plug a loophole in the "too many uses" heuristic. The heuristic was added to avoid spending too much compile time in a specially crafted test case (PR17461, PR16474) with many uses on a select or bitcast instruction can still trigger the slow case. Add a check for that case. This only affects compile time, don't have a good way to test it. This fixes the excessive compile time spent on a specific file of the graphics/rawtherapee port. Reported by: mandree MFC after: 3 days Modified: head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Modified: head/contrib/llvm/lib/Analysis/CaptureTracking.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Tue Nov 19 16:11:03 2013 (r258349) +++ head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Tue Nov 19 17:53:19 2013 (r258350) @@ -146,8 +146,14 @@ void llvm::PointerMayBeCaptured(const Va case Instruction::PHI: case Instruction::Select: // The original value is not captured via this if the new value isn't. + Count = 0; for (Instruction::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; ++UI) { + // If there are lots of uses, conservatively say that the value + // is captured to avoid taking too much compile time. + if (Count++ >= Threshold) + return Tracker->tooManyUses(); + Use *U = &UI.getUse(); if (Visited.insert(U)) if (Tracker->shouldExplore(U)) From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 18:04:27 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D72BD37; Tue, 19 Nov 2013 18:04:27 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43337211F; Tue, 19 Nov 2013 18:04:27 +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 rAJI4QZ0065948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Nov 2013 10:04:26 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rAJI4QjH065947; Tue, 19 Nov 2013 10:04:26 -0800 (PST) (envelope-from jmg) Date: Tue, 19 Nov 2013 10:04:26 -0800 From: John-Mark Gurney To: Robert Watson Subject: Re: svn commit: r258328 - head/sys/net Message-ID: <20131119180426.GC2279@funkthat.com> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 19 Nov 2013 10:04:26 -0800 (PST) Cc: svn-src-head@FreeBSD.org, "George V. Neville-Neil" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 18:04:27 -0000 Robert Watson wrote this message on Tue, Nov 19, 2013 at 11:04 +0000: > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > > > Allow ethernet drivers to pass in packets connected via the nextpkt > > pointer. > > Handling packets in this way allows drivers to amortize work during > > packet reception. > > > > Submitted by: Vijay Singh > > Sponsored by: NetApp > > Currently, it is quite easy to make mistakes regarding individual mbuf > chains vs. lists of mbuf chains. This leads me to wonder whether a new > type, perhaps simply constructed on the stack before passing in, should be > used for KPIs that accept lists of packets. E.g., > > /* > * This structure is almost always allocated on a caller stack, so > * cannot itself be queued without memory allocation in most cases. > */ > struct mbuf_queue { > struct mbuf *mq_head; > }; > > int > ether_input(struct ifnet *ifp, struct mbuf_queue *m) Why not pass in the structure (not a pointer to the struct) if the struct really is the above? It would even be able to save the stack allocation (not that it's that expensive)... so instead: int ether_input(struct ifnet *ifp, struct mbuf_queue m) You can also create the struct via a macro like: #define MAKE_MQ(mbuf) ((struct mbuf_queue){ (mbuf) }) so below would become: return (ether_input(ifp, MAKE_MQ(m))); Just a thought... But I do like using the compiler for this... The above makes the compiler do the work, and it be transparent from the code side... > { > > ... > } > > ... > struct mbuf_queue mq = { m }; > > return (ether_input(ifp, &mq)); > ... > > That way the compiler can help us figure out where we expect an individual > packet but have accidentally leaked a queue. Functions that accept only a > single packet could also more agressively assert that m->m_nextpkt is NULL: > > M_ASSERT_ONEPACKET(m); -- 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 Nov 19 18:35:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 143D0635; Tue, 19 Nov 2013 18:35:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE13622FC; Tue, 19 Nov 2013 18:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJIZ1K9023906; Tue, 19 Nov 2013 18:35:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJIZ1Z8023905; Tue, 19 Nov 2013 18:35:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311191835.rAJIZ1Z8023905@svn.freebsd.org> From: Andriy Gapon Date: Tue, 19 Nov 2013 18:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258351 - head/tools/regression/fsx 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 18:35:02 -0000 Author: avg Date: Tue Nov 19 18:35:01 2013 New Revision: 258351 URL: http://svnweb.freebsd.org/changeset/base/258351 Log: fsx: new option to disable msync(MS_SYNC) after each write via mmaped region This option should be useful for testing if a filesystem uses the unified buffer / page cache. Or, if filesystem's emulation of the unified cache works as expected. This should be the case for e.g. ZFS. MFC after: 1 week Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c ============================================================================== --- head/tools/regression/fsx/fsx.c Tue Nov 19 17:53:19 2013 (r258350) +++ head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:01 2013 (r258351) @@ -126,6 +126,7 @@ int randomoplen = 1; /* -O flag disable int seed = 1; /* -S flag */ int mapped_writes = 1; /* -W flag disables */ int mapped_reads = 1; /* -R flag disables it */ +int mapped_msync = 1; /* -U flag disables */ int fsxgoodfd = 0; FILE * fsxlogf = NULL; int badoff = -1; @@ -679,12 +680,12 @@ domapwrite(unsigned offset, unsigned siz if ((p = (char *)mmap(0, map_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, - (off_t)(offset - pg_offset))) == (char *)-1) { + (off_t)(offset - pg_offset))) == MAP_FAILED) { prterr("domapwrite: mmap"); report_failure(202); } memcpy(p + pg_offset, good_buf + offset, size); - if (msync(p, map_size, 0) != 0) { + if (mapped_msync && msync(p, map_size, MS_SYNC) != 0) { prterr("domapwrite: msync"); report_failure(203); } @@ -886,6 +887,7 @@ usage(void) -S seed: for random # generator (default 1) 0 gets timestamp\n\ -W: mapped write operations DISabled\n\ -R: mapped read operations DISabled)\n\ + -U: msync after mapped write operations DISabled\n\ fname: this filename is REQUIRED (no default)\n"); exit(90); } @@ -941,8 +943,8 @@ main(int argc, char **argv) setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */ - while ((ch = getopt(argc, argv, "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:W")) - != -1) + while ((ch = getopt(argc, argv, + "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1) switch (ch) { case 'b': simulatedopcount = getnum(optarg, &endp); @@ -1057,6 +1059,11 @@ main(int argc, char **argv) if (!quiet) fprintf(stdout, "mapped writes DISABLED\n"); break; + case 'U': + mapped_msync = 0; + if (!quiet) + fprintf(stdout, "mapped msync DISABLED\n"); + break; default: usage(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 18:35:39 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 741DC779; Tue, 19 Nov 2013 18:35:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54F1F2303; Tue, 19 Nov 2013 18:35:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJIZdUp024001; Tue, 19 Nov 2013 18:35:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJIZdQo024000; Tue, 19 Nov 2013 18:35:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311191835.rAJIZdQo024000@svn.freebsd.org> From: Andriy Gapon Date: Tue, 19 Nov 2013 18:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258352 - head/tools/regression/fsx 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 18:35:39 -0000 Author: avg Date: Tue Nov 19 18:35:38 2013 New Revision: 258352 URL: http://svnweb.freebsd.org/changeset/base/258352 Log: fsx: add an option to randomly call msync(MS_INVALIDATE) This call should be a sufficiently close approximation of what happens when a filesystem is unmounted and remounted. To be more specific, it should test that the data that was in the page cache is the same data that ends up on a stable storage or in a filesystem's internal cache, if any. This will catch the cases where a page with modified data is marked as a clean page for whatever reason. While there, make logging of the special events (open+close before plus invalidation now) more generic and slightly better than the previous hack. MFC after: 10 days Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c ============================================================================== --- head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:01 2013 (r258351) +++ head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:38 2013 (r258352) @@ -90,6 +90,7 @@ int logcount = 0; /* total ops */ #define OP_MAPREAD 5 #define OP_MAPWRITE 6 #define OP_SKIPPED 7 +#define OP_INVALIDATE 8 int page_size; int page_mask; @@ -107,6 +108,7 @@ unsigned long testcalls = 0; /* calls t unsigned long simulatedopcount = 0; /* -b flag */ int closeprob = 0; /* -c flag */ +int invlprob = 0; /* -i flag */ int debug = 0; /* -d flag */ unsigned long debugstart = 0; /* -D flag */ unsigned long maxfilelen = 256 * 1024; /* -l flag */ @@ -131,6 +133,7 @@ int fsxgoodfd = 0; FILE * fsxlogf = NULL; int badoff = -1; int closeopen = 0; +int invl = 0; void @@ -182,14 +185,12 @@ prterr(char *prefix) void -log4(int operation, int arg0, int arg1, int arg2) +do_log4(int operation, int arg0, int arg1, int arg2) { struct log_entry *le; le = &oplog[logptr]; le->operation = operation; - if (closeopen) - le->operation = ~ le->operation; le->args[0] = arg0; le->args[1] = arg1; le->args[2] = arg2; @@ -201,10 +202,21 @@ log4(int operation, int arg0, int arg1, void +log4(int operation, int arg0, int arg1, int arg2) +{ + do_log4(operation, arg0, arg1, arg2); + if (closeopen) + do_log4(OP_CLOSEOPEN, 0, 0, 0); + if (invl) + do_log4(OP_INVALIDATE, 0, 0, 0); +} + + +void logdump(void) { - int i, count, down; struct log_entry *lp; + int i, count, down, opnum; prt("LOG DUMP (%d total operations):\n", logcount); if (logcount < LOGSIZE) { @@ -214,15 +226,28 @@ logdump(void) i = logptr; count = LOGSIZE; } + + opnum = i + 1 + (logcount/LOGSIZE)*LOGSIZE; for ( ; count > 0; count--) { - int opnum; + lp = &oplog[i]; + + if (lp->operation == OP_CLOSEOPEN || + lp->operation == OP_INVALIDATE) { + switch (lp->operation) { + case OP_CLOSEOPEN: + prt("\t\tCLOSE/OPEN\n"); + break; + case OP_INVALIDATE: + prt("\t\tMS_INVALIDATE\n"); + break; + } + i++; + if (i == LOGSIZE) + i = 0; + continue; + } - opnum = i+1 + (logcount/LOGSIZE)*LOGSIZE; prt("%d(%d mod 256): ", opnum, opnum%256); - lp = &oplog[i]; - if ((closeopen = lp->operation < 0)) - lp->operation = ~ lp->operation; - switch (lp->operation) { case OP_MAPREAD: prt("MAPREAD\t0x%x thru 0x%x\t(0x%x bytes)", @@ -275,9 +300,8 @@ logdump(void) prt("BOGUS LOG ENTRY (operation code = %d)!", lp->operation); } - if (closeopen) - prt("\n\t\tCLOSE/OPEN"); prt("\n"); + opnum++; i++; if (i == LOGSIZE) i = 0; @@ -779,6 +803,36 @@ docloseopen(void) void +doinvl(void) +{ + char *p; + + if (file_size == 0) + return; + if (testcalls <= simulatedopcount) + return; + if (debug) + prt("%lu msync(MS_INVALIDATE)\n", testcalls); + + if ((p = (char *)mmap(0, file_size, PROT_READ | PROT_WRITE, + MAP_FILE | MAP_SHARED, fd, 0)) == MAP_FAILED) { + prterr("doinvl: mmap"); + report_failure(205); + } + + if (msync(p, 0, MS_SYNC | MS_INVALIDATE) != 0) { + prterr("doinvl: msync"); + report_failure(206); + } + + if (munmap(p, file_size) != 0) { + prterr("doinvl: munmap"); + report_failure(207); + } +} + + +void test(void) { unsigned long offset; @@ -798,6 +852,8 @@ test(void) if (closeprob) closeopen = (rv >> 3) < (1 << 28) / closeprob; + if (invlprob) + invl = (rv >> 3) < (1 << 28) / invlprob; if (debugstart > 0 && testcalls >= debugstart) debug = 1; @@ -845,6 +901,8 @@ test(void) } if (sizechecks && testcalls > simulatedopcount) check_size(); + if (invl) + doinvl(); if (closeopen) docloseopen(); } @@ -869,6 +927,7 @@ usage(void) -b opnum: beginning operation number (default 1)\n\ -c P: 1 in P chance of file close+open at each op (default infinity)\n\ -d: debug output for all operations\n\ + -i P: 1 in P chance of calling msync(MS_INVALIDATE) (default infinity)\n\ -l flen: the upper bound on file size (default 262144)\n\ -m startop:endop: monitor (print debug output) specified byte range (default 0:infinity)\n\ -n: no verifications of file size\n\ @@ -944,7 +1003,7 @@ main(int argc, char **argv) setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */ while ((ch = getopt(argc, argv, - "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1) + "b:c:di:l:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1) switch (ch) { case 'b': simulatedopcount = getnum(optarg, &endp); @@ -967,6 +1026,15 @@ main(int argc, char **argv) case 'd': debug = 1; break; + case 'i': + invlprob = getnum(optarg, &endp); + if (!quiet) + fprintf(stdout, + "Chance of MS_INVALIDATE is 1 in %d\n", + invlprob); + if (invlprob <= 0) + usage(); + break; case 'l': maxfilelen = getnum(optarg, &endp); if (maxfilelen <= 0) From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 18:43: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A4B979; Tue, 19 Nov 2013 18:43:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F30342380; Tue, 19 Nov 2013 18:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJIhlZU026955; Tue, 19 Nov 2013 18:43:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJIhlSF026954; Tue, 19 Nov 2013 18:43:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311191843.rAJIhlSF026954@svn.freebsd.org> From: Andriy Gapon Date: Tue, 19 Nov 2013 18:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258353 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 18:43:48 -0000 Author: avg Date: Tue Nov 19 18:43:47 2013 New Revision: 258353 URL: http://svnweb.freebsd.org/changeset/base/258353 Log: zfs page_busy: fix the boundaries of the cleared range This is a fix for a regression introduced in r246293. vm_page_clear_dirty expects the range to have DEV_BSIZE aligned boundaries, otherwise it extends them. Thus it can happen that the whole page is marked clean while actually having some small dirty region(s). This commit makes the range properly aligned and ensures that only the clean data is marked as such. It would interesting to evaluate how much benefit clearing with DEV_BSIZE granularity produces. Perhaps instead we should clear the whole page when it is completely overwritten and don't bother clearing any bits if only a portion a page is written. Reported by: George Hartzell , Richard Todd Tested by: George Hartzell , Reviewed by: kib MFC after: 5 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 Tue Nov 19 18:35:38 2013 (r258352) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 19 18:43:47 2013 (r258353) @@ -329,6 +329,20 @@ page_busy(vnode_t *vp, int64_t start, in { vm_object_t obj; vm_page_t pp; + int64_t end; + + /* + * At present vm_page_clear_dirty extends the cleared range to DEV_BSIZE + * aligned boundaries, if the range is not aligned. As a result a + * DEV_BSIZE subrange with partially dirty data may get marked as clean. + * It may happen that all DEV_BSIZE subranges are marked clean and thus + * the whole page would be considred clean despite have some dirty data. + * For this reason we should shrink the range to DEV_BSIZE aligned + * boundaries before calling vm_page_clear_dirty. + */ + end = rounddown2(off + nbytes, DEV_BSIZE); + off = roundup2(off, DEV_BSIZE); + nbytes = end - off; obj = vp->v_object; zfs_vmobject_assert_wlocked(obj); @@ -363,7 +377,8 @@ page_busy(vnode_t *vp, int64_t start, in ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); vm_object_pip_add(obj, 1); pmap_remove_write(pp); - vm_page_clear_dirty(pp, off, nbytes); + if (nbytes != 0) + vm_page_clear_dirty(pp, off, nbytes); } break; } From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 18:45:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54347AF3; Tue, 19 Nov 2013 18:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43A04239C; Tue, 19 Nov 2013 18:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJIjUHj027263; Tue, 19 Nov 2013 18:45:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJIjUSw027262; Tue, 19 Nov 2013 18:45:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311191845.rAJIjUSw027262@svn.freebsd.org> From: Andriy Gapon Date: Tue, 19 Nov 2013 18:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258354 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 18:45:30 -0000 Author: avg Date: Tue Nov 19 18:45:29 2013 New Revision: 258354 URL: http://svnweb.freebsd.org/changeset/base/258354 Log: taskqueue_cancel: garbage collect a write-only variable MFC after: 3 days Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Nov 19 18:43:47 2013 (r258353) +++ head/sys/kern/subr_taskqueue.c Tue Nov 19 18:45:29 2013 (r258354) @@ -390,11 +390,9 @@ taskqueue_cancel_locked(struct taskqueue int taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp) { - u_int pending; int error; TQ_LOCK(queue); - pending = task->ta_pending; error = taskqueue_cancel_locked(queue, task, pendp); TQ_UNLOCK(queue); From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 19:55:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4F2EE3B; Tue, 19 Nov 2013 19:55:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B437327CD; Tue, 19 Nov 2013 19:55:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJJtfBJ049851; Tue, 19 Nov 2013 19:55:41 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJJtfAs049850; Tue, 19 Nov 2013 19:55:41 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <201311191955.rAJJtfAs049850@svn.freebsd.org> From: Tom Rhodes Date: Tue, 19 Nov 2013 19:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258355 - head/usr.sbin/bsdconfig/networking/share 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 19:55:41 -0000 Author: trhodes Date: Tue Nov 19 19:55:41 2013 New Revision: 258355 URL: http://svnweb.freebsd.org/changeset/base/258355 Log: "Tim trailing" -> "Trim trailing" Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Tue Nov 19 18:45:29 2013 (r258354) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Tue Nov 19 19:55:41 2013 (r258355) @@ -62,7 +62,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_dialog_menu_netdev() { - local defaultitem="${1%\*}" # Tim trailing asterisk if present + local defaultitem="${1%\*}" # Trim trailing asterisk if present # # Display a message to let the user know we're working... From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 21:06: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFE8B408; Tue, 19 Nov 2013 21:06:12 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id A44302C72; Tue, 19 Nov 2013 21:06:11 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 44E277300A; Tue, 19 Nov 2013 22:08:21 +0100 (CET) Date: Tue, 19 Nov 2013 22:08:21 +0100 From: Luigi Rizzo To: "George V. Neville-Neil" Subject: Re: svn commit: r258328 - head/sys/net Message-ID: <20131119210821.GA13961@onelab2.iet.unipi.it> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311182258.rAIMwEFd048783@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 21:06:13 -0000 On Mon, Nov 18, 2013 at 10:58:14PM +0000, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Nov 18 22:58:14 2013 > New Revision: 258328 > URL: http://svnweb.freebsd.org/changeset/base/258328 > > Log: > Allow ethernet drivers to pass in packets connected via the nextpkt pointer. > Handling packets in this way allows drivers to amortize work during packet reception. yes. This is only a first step and eventually we should pass the entire batch to the netisr handler to further reduce overhead. Some of the followup emails suggested to change the argument from struct mbuf * to something else. I do think we should change it, but what we need is a struct with head and tail pointers _and_ a counter, because sometimes the code downstream may have to append the mbuf/batch to a queue, and these extra fields would save iterating through the chain. Related to this: at some point we should also address batching in the transmit path, and for that we will eventually need to introduce a 'more packets to come' flag to the API/mbuf so that intermediate functions in the path will build batches before passing them down. cheers luigi From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 22:14:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F1229F7; Tue, 19 Nov 2013 22:14:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D788213F; Tue, 19 Nov 2013 22:14:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJMEZ0K097446; Tue, 19 Nov 2013 22:14:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJMEZtE097445; Tue, 19 Nov 2013 22:14:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311192214.rAJMEZtE097445@svn.freebsd.org> From: Ian Lepore Date: Tue, 19 Nov 2013 22:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258356 - head/sys/arm/ti 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 22:14:35 -0000 Author: ian Date: Tue Nov 19 22:14:35 2013 New Revision: 258356 URL: http://svnweb.freebsd.org/changeset/base/258356 Log: Bugfixes... the host capabilties from FDT data are stored in host.caps, not host.host_ocr, examine the correct field when setting up the hardware. Also, the offset for the capabilties register should be 0x140, not 0x240. Submitted by: Ilya Bakulin Pointy hat to: me Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Tue Nov 19 19:55:41 2013 (r258355) +++ head/sys/arm/ti/ti_sdhci.c Tue Nov 19 22:14:35 2013 (r258356) @@ -108,7 +108,7 @@ static struct ofw_compat_data compat_dat #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) -#define MMCHS_SD_CAPA 0x240 +#define MMCHS_SD_CAPA 0x140 #define MMCHS_SD_CAPA_VS18 (1 << 26) #define MMCHS_SD_CAPA_VS30 (1 << 25) #define MMCHS_SD_CAPA_VS33 (1 << 24) @@ -432,9 +432,9 @@ ti_sdhci_attach(device_t dev) * that it can set the right values in the CAPA register, which can only * be done once and never reset. */ - sc->slot.host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE; if (sc->mmchs_device_id == 0 || OF_hasprop(node, "ti,dual-volt")) { - sc->slot.host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + sc->slot.host.caps |= MMC_OCR_290_300 | MMC_OCR_300_310; } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 22:55:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6923D536; Tue, 19 Nov 2013 22:55:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 495B423DE; Tue, 19 Nov 2013 22:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJMtIZK011333; Tue, 19 Nov 2013 22:55:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJMtHvb011329; Tue, 19 Nov 2013 22:55:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201311192255.rAJMtHvb011329@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 19 Nov 2013 22:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258357 - in head: sbin/geom/class/mirror sys/geom/mirror 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 22:55:18 -0000 Author: ae Date: Tue Nov 19 22:55:17 2013 New Revision: 258357 URL: http://svnweb.freebsd.org/changeset/base/258357 Log: Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4). Now it is easy to expand the size of the mirror when all its components are replaced. Also add g_resize method to geom_mirror class. It will write updated metadata to new last sector, when parent provider is resized. Silence from: geom@ MFC after: 1 month Modified: head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mirror/gmirror.8 head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Tue Nov 19 22:14:35 2013 (r258356) +++ head/sbin/geom/class/mirror/geom_mirror.c Tue Nov 19 22:55:17 2013 (r258357) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -53,6 +54,7 @@ static void mirror_activate(struct gctl_ static void mirror_clear(struct gctl_req *req); static void mirror_dump(struct gctl_req *req); static void mirror_label(struct gctl_req *req); +static void mirror_resize(struct gctl_req *req, unsigned flags); struct g_command class_commands[] = { { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, @@ -112,6 +114,13 @@ struct g_command class_commands[] = { { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, + { "resize", G_FLAG_VERBOSE, mirror_resize, + { + { 's', "size", "*", G_TYPE_STRING }, + G_OPT_SENTINEL + }, + "[-s size] [-v] name" + }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, @@ -376,3 +385,96 @@ mirror_activate(struct gctl_req *req) printf("Provider %s activated.\n", path); } } + +static struct gclass * +find_class(struct gmesh *mesh, const char *name) +{ + struct gclass *classp; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) { + if (strcmp(classp->lg_name, name) == 0) + return (classp); + } + return (NULL); +} + +static struct ggeom * +find_geom(struct gclass *classp, const char *name) +{ + struct ggeom *gp; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (strcmp(gp->lg_name, name) == 0) + return (gp); + } + return (NULL); +} + +static void +mirror_resize(struct gctl_req *req, unsigned flags __unused) +{ + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; + struct gprovider *pp; + struct gconsumer *cp; + off_t size; + int error, nargs; + const char *name; + char ssize[30]; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 1) { + gctl_error(req, "Too few arguments."); + return; + } + error = geom_gettree(&mesh); + if (error) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + name = gctl_get_ascii(req, "class"); + if (name == NULL) + abort(); + classp = find_class(&mesh, name); + if (classp == NULL) + errx(EXIT_FAILURE, "Class %s not found.", name); + name = gctl_get_ascii(req, "arg0"); + if (name == NULL) + abort(); + gp = find_geom(classp, name); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", name); + pp = LIST_FIRST(&gp->lg_provider); + if (pp == NULL) + errx(EXIT_FAILURE, "Provider of geom %s not found.", name); + size = pp->lg_mediasize; + name = gctl_get_ascii(req, "size"); + if (name == NULL) + errx(EXIT_FAILURE, "The size is not specified."); + if (*name == '*') { +#define CSZ(c) ((c)->lg_provider->lg_mediasize - \ + (c)->lg_provider->lg_sectorsize) + /* Find the maximum possible size */ + LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + if (CSZ(cp) > size) + size = CSZ(cp); + } + LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + if (CSZ(cp) < size) + size = CSZ(cp); + } +#undef CSZ + if (size == pp->lg_mediasize) + errx(EXIT_FAILURE, + "Cannot expand provider %s\n", + pp->lg_name); + } else { + error = g_parse_lba(name, pp->lg_sectorsize, &size); + if (error) + errc(EXIT_FAILURE, error, "Invalid size param"); + size *= pp->lg_sectorsize; + } + snprintf(ssize, sizeof(ssize), "%ju", (uintmax_t)size); + gctl_change_param(req, "size", -1, ssize); + geom_deletetree(&mesh); + gctl_issue(req); +} Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Tue Nov 19 22:14:35 2013 (r258356) +++ head/sbin/geom/class/mirror/gmirror.8 Tue Nov 19 22:55:17 2013 (r258357) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2009 +.Dd November 20, 2013 .Dt GMIRROR 8 .Os .Sh NAME @@ -60,6 +60,11 @@ .Ar name .Ar prov ... .Nm +.Cm resize +.Op Fl v +.Op Fl s Ar size +.Ar name +.Nm .Cm insert .Op Fl hiv .Op Fl p Ar priority @@ -193,6 +198,16 @@ balance algorithm. Rebuild the given mirror components forcibly. If autosynchronization was not turned off for the given device, this command should be unnecessary. +.It Cm resize +Change the size of the given mirror. +.Pp +Additional options include: +.Bl -tag -width ".Fl s Ar size" +.It Fl s Ar size +New size of the mirror is expressed in logical block numbers. +This option can be omitted, then it will be automatically calculated to +maximum available size. +.El .It Cm insert Add the given component(s) to the existing mirror. .Pp Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Nov 19 22:14:35 2013 (r258356) +++ head/sys/geom/mirror/g_mirror.c Tue Nov 19 22:55:17 2013 (r258357) @@ -87,6 +87,7 @@ static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); static g_taste_t g_mirror_taste; +static g_resize_t g_mirror_resize; static void g_mirror_init(struct g_class *mp); static void g_mirror_fini(struct g_class *mp); @@ -97,7 +98,8 @@ struct g_class g_mirror_class = { .taste = g_mirror_taste, .destroy_geom = g_mirror_destroy_geom, .init = g_mirror_init, - .fini = g_mirror_fini + .fini = g_mirror_fini, + .resize = g_mirror_resize }; @@ -640,9 +642,17 @@ g_mirror_write_metadata(struct g_mirror_ length = cp->provider->sectorsize; offset = cp->provider->mediasize - length; sector = malloc((size_t)length, M_MIRROR, M_WAITOK | M_ZERO); - if (md != NULL) - mirror_metadata_encode(md, sector); - error = g_write_data(cp, offset, sector, length); + if (md != NULL) { + /* + * Handle the case, when the size of parent provider reduced. + */ + if (offset < md->md_mediasize) + error = ENOSPC; + else + mirror_metadata_encode(md, sector); + } + if (error == 0) + error = g_write_data(cp, offset, sector, length); free(sector, M_MIRROR); if (error != 0) { if ((disk->d_flags & G_MIRROR_DISK_FLAG_BROKEN) == 0) { @@ -1323,7 +1333,7 @@ g_mirror_sync_request(struct bio *bp) } G_MIRROR_LOGREQ(3, bp, "Synchronization request finished."); sync = &disk->d_sync; - if (sync->ds_offset == sc->sc_mediasize || + if (sync->ds_offset >= sc->sc_mediasize || sync->ds_consumer == NULL || (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { /* Don't send more synchronization requests. */ @@ -2717,12 +2727,14 @@ g_mirror_check_metadata(struct g_mirror_ "md_balance", pp->name, sc->sc_name); return (EINVAL); } +#if 0 if (md->md_mediasize != sc->sc_mediasize) { G_MIRROR_DEBUG(1, "Invalid '%s' field on disk %s (device %s), skipping.", "md_mediasize", pp->name, sc->sc_name); return (EINVAL); } +#endif if (sc->sc_mediasize > pp->mediasize) { G_MIRROR_DEBUG(1, "Invalid size of disk %s (device %s), skipping.", pp->name, @@ -3115,6 +3127,22 @@ g_mirror_taste(struct g_class *mp, struc return (gp); } +static void +g_mirror_resize(struct g_consumer *cp) +{ + struct g_mirror_disk *disk; + + g_topology_assert(); + g_trace(G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name); + + disk = cp->private; + if (disk == NULL) + return; + g_topology_unlock(); + g_mirror_update_metadata(disk); + g_topology_lock(); +} + static int g_mirror_destroy_geom(struct gctl_req *req __unused, struct g_class *mp __unused, struct g_geom *gp) Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Tue Nov 19 22:14:35 2013 (r258356) +++ head/sys/geom/mirror/g_mirror_ctl.c Tue Nov 19 22:55:17 2013 (r258357) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -617,6 +619,75 @@ g_mirror_ctl_remove(struct gctl_req *req } static void +g_mirror_ctl_resize(struct gctl_req *req, struct g_class *mp) +{ + struct g_mirror_softc *sc; + struct g_mirror_disk *disk; + uint64_t mediasize; + const char *name, *s; + char *x; + int *nargs; + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument.", "nargs"); + return; + } + if (*nargs != 1) { + gctl_error(req, "Missing device."); + return; + } + name = gctl_get_asciiparam(req, "arg0"); + if (name == NULL) { + gctl_error(req, "No 'arg%u' argument.", 0); + return; + } + s = gctl_get_asciiparam(req, "size"); + if (s == NULL) { + gctl_error(req, "No '%s' argument.", "size"); + return; + } + mediasize = strtouq(s, &x, 0); + if (*x != '\0' || mediasize == 0) { + gctl_error(req, "Invalid '%s' argument.", "size"); + return; + } + sc = g_mirror_find_device(mp, name); + if (sc == NULL) { + gctl_error(req, "No such device: %s.", name); + return; + } + /* Deny shrinking of an opened provider */ + if ((g_debugflags & 16) == 0 && (sc->sc_provider->acr > 0 || + sc->sc_provider->acw > 0 || sc->sc_provider->ace > 0)) { + if (sc->sc_mediasize > mediasize) { + gctl_error(req, "Device %s is busy.", + sc->sc_provider->name); + sx_xunlock(&sc->sc_lock); + return; + } + } + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + if (mediasize > disk->d_consumer->provider->mediasize - + disk->d_consumer->provider->sectorsize) { + gctl_error(req, "Provider %s is too small.", + disk->d_name); + sx_xunlock(&sc->sc_lock); + return; + } + } + /* Update the size. */ + sc->sc_mediasize = mediasize; + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + g_mirror_update_metadata(disk); + } + g_topology_lock(); + g_resize_provider(sc->sc_provider, mediasize); + g_topology_unlock(); + sx_xunlock(&sc->sc_lock); +} + +static void g_mirror_ctl_deactivate(struct gctl_req *req, struct g_class *mp) { struct g_mirror_softc *sc; @@ -793,6 +864,8 @@ g_mirror_config(struct gctl_req *req, st g_mirror_ctl_insert(req, mp); else if (strcmp(verb, "remove") == 0) g_mirror_ctl_remove(req, mp); + else if (strcmp(verb, "resize") == 0) + g_mirror_ctl_resize(req, mp); else if (strcmp(verb, "deactivate") == 0) g_mirror_ctl_deactivate(req, mp); else if (strcmp(verb, "forget") == 0) From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 23:31:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82C8C36D; Tue, 19 Nov 2013 23:31:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71F3F262B; Tue, 19 Nov 2013 23:31:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJNVem9025225; Tue, 19 Nov 2013 23:31:40 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJNVeJO025224; Tue, 19 Nov 2013 23:31:40 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201311192331.rAJNVeJO025224@svn.freebsd.org> From: Zbigniew Bodek Date: Tue, 19 Nov 2013 23:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258358 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 23:31:40 -0000 Author: zbb Date: Tue Nov 19 23:31:39 2013 New Revision: 258358 URL: http://svnweb.freebsd.org/changeset/base/258358 Log: Avoid clearing EXEC permission bit when setting the page RW on ARMv6/v7 When emulating modified bit the executable attribute was cleared by mistake when calling pmap_set_prot(). This was not a problem before changes to ref/mod emulation since all the pages were created RW basing on the "prot" argument in pmap_enter(). Now however not all pages are RW and the RW permission can be cleared in the process. Added proper KTRs accordingly. Spotted by: cognet Reviewed by: gber Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Nov 19 22:55:17 2013 (r258357) +++ head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:31:39 2013 (r258358) @@ -1519,10 +1519,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ vm_page_dirty(m); /* Re-enable write permissions for the page */ - pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U); - CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", pte); + *ptep = (pte & ~L2_APX); PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } else if (!L2_S_REFERENCED(pte)) { /* * This looks like a good candidate for "page referenced" @@ -1545,6 +1545,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ *ptep = pte | L2_S_REF; PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 23:37:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 294C1511; Tue, 19 Nov 2013 23:37:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2CCE265E; Tue, 19 Nov 2013 23:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJNboDj025943; Tue, 19 Nov 2013 23:37:50 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJNbo4A025942; Tue, 19 Nov 2013 23:37:50 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201311192337.rAJNbo4A025942@svn.freebsd.org> From: Zbigniew Bodek Date: Tue, 19 Nov 2013 23:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258359 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 19 Nov 2013 23:37:51 -0000 Author: zbb Date: Tue Nov 19 23:37:50 2013 New Revision: 258359 URL: http://svnweb.freebsd.org/changeset/base/258359 Log: Apply access flags for managed and unmanaged pages properly on ARMv6/v7 When entering a mapping via pmap_enter() unmanaged pages ought to be naturally excluded from the "modified" and "referenced" emulation. RW permission should be granted implicitly when requested, otherwise unmanaged page will not recover from the permission fault since there will be no PV entry to indicate that the page can be written. In addition, only managed pages that participate in "modified" emulation need to be marked as "dirty" and "writeable" when entered with RW permissions. Likewise with "referenced" flag for managed pages. Unmanaged ones however should not be marked as such. Reviewed by: cognet, gber Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:31:39 2013 (r258358) +++ head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:37:50 2013 (r258359) @@ -3079,36 +3079,38 @@ validate: * then continue setting mapping parameters */ if (m != NULL) { - if (prot & (VM_PROT_ALL)) { - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { + if (prot & (VM_PROT_ALL)) { vm_page_aflag_set(m, PGA_REFERENCED); - } else { - /* - * Need to do page referenced emulation. - */ - npte &= ~L2_S_REF; + } else { + /* + * Need to do page referenced emulation. + */ + npte &= ~L2_S_REF; + } } if (prot & VM_PROT_WRITE) { - /* - * Enable write permission if the access type - * indicates write intention. Emulate modified - * bit otherwise. - */ - if ((access & VM_PROT_WRITE) != 0) - npte &= ~(L2_APX); - if ((m->oflags & VPO_UNMANAGED) == 0) { - vm_page_aflag_set(m, PGA_WRITEABLE); /* - * The access type and permissions indicate - * that the page will be written as soon as - * returned from fault service. - * Mark it dirty from the outset. + * Enable write permission if the access type + * indicates write intention. Emulate modified + * bit otherwise. */ - if ((access & VM_PROT_WRITE) != 0) + if ((access & VM_PROT_WRITE) != 0) { + npte &= ~(L2_APX); + vm_page_aflag_set(m, PGA_WRITEABLE); + /* + * The access type and permissions + * indicate that the page will be + * written as soon as returned from + * fault service. + * Mark it dirty from the outset. + */ vm_page_dirty(m); - } + } + } else + npte &= ~(L2_APX); } if (!(prot & VM_PROT_EXECUTE)) npte |= L2_XN; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 00:17:58 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 320F5D78; Wed, 20 Nov 2013 00:17:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 125AB287D; Wed, 20 Nov 2013 00:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK0HvLO040322; Wed, 20 Nov 2013 00:17:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK0Hvm6040321; Wed, 20 Nov 2013 00:17:57 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311200017.rAK0Hvm6040321@svn.freebsd.org> From: Devin Teske Date: Wed, 20 Nov 2013 00:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258360 - head/usr.sbin/bsdconfig/networking/share 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 00:17:58 -0000 Author: dteske Date: Wed Nov 20 00:17:57 2013 New Revision: 258360 URL: http://svnweb.freebsd.org/changeset/base/258360 Log: Whitespace, style, sub-shells, and standardize variable name (s/interfaces/menu_list/). Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Tue Nov 19 23:37:50 2013 (r258359) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Wed Nov 20 00:17:57 2013 (r258360) @@ -62,6 +62,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_dialog_menu_netdev() { + local menu_list # Calculated below local defaultitem="${1%\*}" # Trim trailing asterisk if present # @@ -74,19 +75,15 @@ f_dialog_menu_netdev() # Get list of usable network interfaces # local d='[[:digit:]]+:' - local iflist="`echo "$(ifconfig -l):" | sed -E -e " - # Convert all spaces to colons - y/ /:/ - - # Prune unsavory interfaces - s/lo$d//g - s/ppp$d//g - s/sl$d//g - s/faith$d//g - - # Convert all colons back into spaces - y/:/ / - "`" + local if iflist= # Calculated below + for if in $( ifconfig -l ); do + # Skip unsavory interfaces + case "$if" in + lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;; + esac + iflist="$iflist $if" + done + iflist="${iflist# }" # # Optionally kick interfaces in the head to get them to accurately @@ -110,20 +107,17 @@ f_dialog_menu_netdev() # Mark any "active" interfaces with an asterisk (*) # to the right of the device name. # - interfaces=$( + menu_list=$( for ifn in $iflist; do - active=$( ifconfig $ifn | awk \ - ' - ( $1 == "status:" ) \ - { - if ( $2 == "active" ) { print 1; exit } - } - ' ) + active=$( ifconfig $ifn 2> /dev/null | awk ' + ($1 == "status:") { + if ($2 == "active") { print 1; exit } + }' ) printf "'%s%s' '%s'\n" \ $ifn "${active:+*}" "$( f_device_desc $ifn )" done ) - if [ ! "$interfaces" ]; then + if [ ! "$menu_list" ]; then f_show_msg "$msg_no_network_interfaces" return $DIALOG_CANCEL fi @@ -132,8 +126,8 @@ f_dialog_menu_netdev() # Maybe the default item was marked as active # if [ "$defaultitem" ]; then - ifconfig "$defaultitem" 2> /dev/null | awk \ - '( $1 == "status:" && $2 != "active" ) { exit 0 }' || + ifconfig "$defaultitem" 2> /dev/null | + awk '($1 == "status:" && $2 == "active"){exit 1}' || defaultitem="$defaultitem*" fi @@ -149,7 +143,7 @@ f_dialog_menu_netdev() \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \ \"\$hline\" \ - $interfaces + $menu_list local menu_choice menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -160,7 +154,7 @@ f_dialog_menu_netdev() --default-item \"\$defaultitem\" \ --menu \"\$prompt\" \ $height $width $rows \ - $interfaces \ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 01:33:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50A5B8CE; Wed, 20 Nov 2013 01:33:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40A742C10; Wed, 20 Nov 2013 01:33:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK1XEAv065980; Wed, 20 Nov 2013 01:33:14 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK1XEni065979; Wed, 20 Nov 2013 01:33:14 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201311200133.rAK1XEni065979@svn.freebsd.org> From: Justin Hibbits Date: Wed, 20 Nov 2013 01:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258361 - head/sys/cddl/dev/fbt 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 01:33:14 -0000 Author: jhibbits Date: Wed Nov 20 01:33:13 2013 New Revision: 258361 URL: http://svnweb.freebsd.org/changeset/base/258361 Log: Fix the function search space. Submitted by: Howard Su Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt_powerpc.c Wed Nov 20 00:17:57 2013 (r258360) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Wed Nov 20 01:33:13 2013 (r258361) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) symval->value + symval->size; + limit = (u_int32_t *) (symval->value + symval->size); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 01:42:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC630B44; Wed, 20 Nov 2013 01:42:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B8222C8C; Wed, 20 Nov 2013 01:42:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK1gUka069101; Wed, 20 Nov 2013 01:42:30 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK1gU83069098; Wed, 20 Nov 2013 01:42:30 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201311200142.rAK1gU83069098@svn.freebsd.org> From: Justin Hibbits Date: Wed, 20 Nov 2013 01:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258362 - in head/cddl/contrib/opensolaris/cmd: plockstat 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 01:42:30 -0000 Author: jhibbits Date: Wed Nov 20 01:42:29 2013 New Revision: 258362 URL: http://svnweb.freebsd.org/changeset/base/258362 Log: Use 'int' to store the return value of getopt(), rather than char. On some architectures (powerpc), char is unsigned by default, which means comparisons against -1 always fail, so the programs get stuck in an infinite loop. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:33:13 2013 (r258361) +++ head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:42:29 2013 (r258362) @@ -778,7 +778,8 @@ main(int argc, char **argv) #endif int err; int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0; - char c, *p, *end; + int c; + char *p, *end; struct sigaction act; int done = 0; Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 20 01:33:13 2013 (r258361) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 20 01:42:29 2013 (r258362) @@ -2011,7 +2011,7 @@ zfs_do_upgrade(int argc, char **argv) boolean_t showversions = B_FALSE; int ret = 0; upgrade_cbdata_t cb = { 0 }; - char c; + int c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ @@ -3561,7 +3561,7 @@ static int zfs_do_snapshot(int argc, char **argv) { int ret = 0; - char c; + int c; nvlist_t *props; snap_cbdata_t sd = { 0 }; boolean_t multiple_snaps = B_FALSE; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 02:16: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C01ED496; Wed, 20 Nov 2013 02:16:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B016A2E1F; Wed, 20 Nov 2013 02:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK2Gmhm080089; Wed, 20 Nov 2013 02:16:48 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK2GmL6080087; Wed, 20 Nov 2013 02:16:48 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201311200216.rAK2GmL6080087@svn.freebsd.org> From: Don Lewis Date: Wed, 20 Nov 2013 02:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258363 - in head/sys/dev/usb: . serial 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 02:16:48 -0000 Author: truckman Date: Wed Nov 20 02:16:47 2013 New Revision: 258363 URL: http://svnweb.freebsd.org/changeset/base/258363 Log: Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my Virgin Mobile branded device. It needs the U3GINIT_SCSIEJECT quirk. Reviewed by: hselasky MFC after: 1 month Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Nov 20 01:42:29 2013 (r258362) +++ head/sys/dev/usb/serial/u3g.c Wed Nov 20 02:16:47 2013 (r258363) @@ -345,6 +345,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 20 01:42:29 2013 (r258362) +++ head/sys/dev/usb/usbdevs Wed Nov 20 02:16:47 2013 (r258363) @@ -3174,6 +3174,7 @@ product NOVATEL EU870D 0x2420 Expedite product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD product NOVATEL MIFI2200 0x5041 Novatel MiFi 2200 CDMA product NOVATEL U727_2 0x5100 Merlin U727 CDMA From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 02:20: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C025864A; Wed, 20 Nov 2013 02:20:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B00DE2E5A; Wed, 20 Nov 2013 02:20:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK2KR6J082482; Wed, 20 Nov 2013 02:20:27 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK2KR9Y082481; Wed, 20 Nov 2013 02:20:27 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201311200220.rAK2KR9Y082481@svn.freebsd.org> From: Don Lewis Date: Wed, 20 Nov 2013 02:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258364 - head/etc/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 02:20:27 -0000 Author: truckman Date: Wed Nov 20 02:20:27 2013 New Revision: 258364 URL: http://svnweb.freebsd.org/changeset/base/258364 Log: Regenerate after r258363 (alternate ID for Novatel MiFi 2200) and r258333 (bus_autoconf.sh tweak). Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Wed Nov 20 02:16:47 2013 (r258363) +++ head/etc/devd/usb.conf Wed Nov 20 02:20:27 2013 (r258364) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# This file was automatically generated by "tools/bus_autoconf.sh". +# This file was automatically generated by "tools/tools/bus_autoconf/bus_autoconf.sh". # Please do not edit! # @@ -3713,7 +3713,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1410"; - match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5041|0x5100|0x6000|0x6002|0x7042)"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)"; action "kldload -n u3g"; }; @@ -5341,5 +5341,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2573 USB entries processed +# 2574 USB entries processed From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 08:27:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A02F3F9; Wed, 20 Nov 2013 08:27:18 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE2F9262F; Wed, 20 Nov 2013 08:27:17 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Vj37y-0002pM-BR; Wed, 20 Nov 2013 09:27:14 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "George V. Neville-Neil" , "Luigi Rizzo" Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <20131119210821.GA13961@onelab2.iet.unipi.it> Date: Wed, 20 Nov 2013 09:27:12 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <20131119210821.GA13961@onelab2.iet.unipi.it> User-Agent: Opera Mail/12.16 (Win32) X-Authenticated-As-Hash: 5a5bc696c05b24d66fef48d694aeed0652e57d03 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 X-Scan-Signature: e462de357cb394d64966911c06262bc8 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 08:27:18 -0000 On Tue, 19 Nov 2013 22:08:21 +0100, Luigi Rizzo wrote: > On Mon, Nov 18, 2013 at 10:58:14PM +0000, George V. Neville-Neil wrote: >> Author: gnn >> Date: Mon Nov 18 22:58:14 2013 >> New Revision: 258328 >> URL: http://svnweb.freebsd.org/changeset/base/258328 >> >> Log: >> Allow ethernet drivers to pass in packets connected via the nextpkt >> pointer. >> Handling packets in this way allows drivers to amortize work during >> packet reception. > > yes. > > This is only a first step and eventually we should pass the entire > batch to the netisr handler to further reduce overhead. > > Some of the followup emails suggested to change the argument from > struct mbuf * to something else. > I do think we should change it, but what we need is a struct with > head and tail pointers _and_ a counter, because sometimes the code > downstream may have to append the mbuf/batch to a queue, > and these extra fields would save iterating through the chain. > > Related to this: at some point we should also address batching > in the transmit path, and for that we will eventually need to > introduce a 'more packets to come' flag to the API/mbuf so that > intermediate functions in the path will build batches before passing > them down. > > cheers > luigi The Apache webserver works like this also. It has a 'bucket'-list which chains all data of a request and can also contain flush-commands in between. Probably nice to look what they do and in what ways. Ronald. From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 08:45:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A07A7F; Wed, 20 Nov 2013 08:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21E6D2763; Wed, 20 Nov 2013 08:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK8jRHH012603; Wed, 20 Nov 2013 08:45:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK8jQRv012600; Wed, 20 Nov 2013 08:45:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311200845.rAK8jQRv012600@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 20 Nov 2013 08:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258365 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 08:45:27 -0000 Author: kib Date: Wed Nov 20 08:45:26 2013 New Revision: 258365 URL: http://svnweb.freebsd.org/changeset/base/258365 Log: Revert back to use int for the page counts. In vn_io_fault(), the i/o is chunked to pieces limited by integer io_hold_cnt tunable, while vm_fault_quick_hold_pages() takes integer max_count as the upper bound. Rearrange the checks to correctly handle overflowing address arithmetic. Submitted by: bde Tested by: pho Discussed with: alc MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c head/sys/vm/vm_fault.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Nov 20 02:20:27 2013 (r258364) +++ head/sys/kern/vfs_vnops.c Wed Nov 20 08:45:26 2013 (r258365) @@ -933,9 +933,8 @@ vn_io_fault(struct file *fp, struct uio void *rl_cookie; struct mount *mp; vm_page_t *prev_td_ma; - int error, save, saveheld, prev_td_ma_cnt; + int error, cnt, save, saveheld, prev_td_ma_cnt; vm_offset_t addr, end; - vm_size_t cnt; vm_prot_t prot; size_t len, resid; ssize_t adv; @@ -1008,21 +1007,20 @@ vn_io_fault(struct file *fp, struct uio uio_clone->uio_iovcnt--; continue; } - - addr = (vm_offset_t)uio_clone->uio_iov->iov_base; + if (len > io_hold_cnt * PAGE_SIZE) + len = io_hold_cnt * PAGE_SIZE; + addr = (uintptr_t)uio_clone->uio_iov->iov_base; end = round_page(addr + len); - cnt = howmany(end - trunc_page(addr), PAGE_SIZE); + if (end < addr) { + error = EFAULT; + break; + } + cnt = atop(end - trunc_page(addr)); /* * A perfectly misaligned address and length could cause * both the start and the end of the chunk to use partial * page. +2 accounts for such a situation. */ - if (cnt > io_hold_cnt + 2) { - len = io_hold_cnt * PAGE_SIZE; - KASSERT(howmany(round_page(addr + len) - - trunc_page(addr), PAGE_SIZE) <= io_hold_cnt + 2, - ("cnt overflow")); - } cnt = vm_fault_quick_hold_pages(&td->td_proc->p_vmspace->vm_map, addr, len, prot, ma, io_hold_cnt + 2); if (cnt == -1) { Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Nov 20 02:20:27 2013 (r258364) +++ head/sys/vm/vm_fault.c Wed Nov 20 08:45:26 2013 (r258365) @@ -1074,12 +1074,12 @@ vm_fault_quick_hold_pages(vm_map_t map, { vm_offset_t end, va; vm_page_t *mp; - vm_size_t count; + int count; boolean_t pmap_failed; if (len == 0) return (0); - end = round_page(addr + len); + end = round_page(addr + len); addr = trunc_page(addr); /* @@ -1088,9 +1088,9 @@ vm_fault_quick_hold_pages(vm_map_t map, if (addr < vm_map_min(map) || addr > end || end > vm_map_max(map)) return (-1); - count = howmany(end - addr, PAGE_SIZE); - if (count > max_count) + if (atop(end - addr) > max_count) panic("vm_fault_quick_hold_pages: count > max_count"); + count = atop(end - addr); /* * Most likely, the physical pages are resident in the pmap, so it is From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 08:47: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 368CAC0A; Wed, 20 Nov 2013 08:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 261B92784; Wed, 20 Nov 2013 08:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK8ltpM012899; Wed, 20 Nov 2013 08:47:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK8ltbg012898; Wed, 20 Nov 2013 08:47:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311200847.rAK8ltbg012898@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 20 Nov 2013 08:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258366 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 08:47:55 -0000 Author: kib Date: Wed Nov 20 08:47:54 2013 New Revision: 258366 URL: http://svnweb.freebsd.org/changeset/base/258366 Log: Add assertions to cover all places in the wiring and unwiring code where MAP_ENTRY_IN_TRANSITION is set or cleared. Tested by: pho Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 20 08:45:26 2013 (r258365) +++ head/sys/vm/vm_map.c Wed Nov 20 08:47:54 2013 (r258366) @@ -2288,6 +2288,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; /* @@ -2356,7 +2359,9 @@ done: } } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, - ("vm_map_unwire: in-transition flag missing")); + ("vm_map_unwire: in-transition flag missing %p", entry)); + KASSERT(entry->wiring_thread == curthread, + ("vm_map_unwire: alien wire %p", entry)); entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = NULL; if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) { @@ -2456,6 +2461,9 @@ vm_map_wire(vm_map_t map, vm_offset_t st * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 09:03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78AEA290; Wed, 20 Nov 2013 09:03:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E91028BC; Wed, 20 Nov 2013 09:03:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAK93n5Y019151; Wed, 20 Nov 2013 09:03:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAK93nEa019150; Wed, 20 Nov 2013 09:03:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311200903.rAK93nEa019150@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 20 Nov 2013 09:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258367 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 09:03:49 -0000 Author: kib Date: Wed Nov 20 09:03:48 2013 New Revision: 258367 URL: http://svnweb.freebsd.org/changeset/base/258367 Log: Vm map code performs clipping when map entry covers region which is larger than the operational region. If the op region size is zero, clipping would create a zero-sized map entry. The result is that vm map splay starts behaving inconsistently, sometimes returning zero-sized entry, sometimes the next (or previous) entry. One step further, it could result in e.g. vm_map_wire() setting MAP_ENTRY_IN_TRANSITION on the zero-sized entry, but failing to clear it in the done part. The vm_map_delete() than hangs forever waiting for the flag removal. Verify for zero-length requests and act as if it is always successfull without performing any action on the address space. Diagnosed by: pho Tested by: pho (previous version) Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 20 08:47:54 2013 (r258366) +++ head/sys/vm/vm_map.c Wed Nov 20 09:03:48 2013 (r258367) @@ -1876,6 +1876,9 @@ vm_map_protect(vm_map_t map, vm_offset_t struct ucred *cred; vm_prot_t old_prot; + if (start == end) + return (KERN_SUCCESS); + vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2030,12 +2033,16 @@ vm_map_madvise( case MADV_AUTOSYNC: case MADV_NOCORE: case MADV_CORE: + if (start == end) + return (KERN_SUCCESS); modify_map = 1; vm_map_lock(map); break; case MADV_WILLNEED: case MADV_DONTNEED: case MADV_FREE: + if (start == end) + return (KERN_SUCCESS); vm_map_lock_read(map); break; default: @@ -2190,6 +2197,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t default: return (KERN_INVALID_ARGUMENT); } + if (start == end) + return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (vm_map_lookup_entry(map, start, &temp_entry)) { @@ -2222,6 +2231,8 @@ vm_map_unwire(vm_map_t map, vm_offset_t int rv; boolean_t need_wakeup, result, user_unwire; + if (start == end) + return (KERN_SUCCESS); user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2392,6 +2403,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st boolean_t fictitious, need_wakeup, result, user_wire; vm_prot_t prot; + if (start == end) + return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; @@ -2833,6 +2846,8 @@ vm_map_delete(vm_map_t map, vm_offset_t vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); + if (start == end) + return (KERN_SUCCESS); /* * Find the start of the region, and clip it From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:12: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 446FDA6A; Wed, 20 Nov 2013 10:12:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 196142DD4; Wed, 20 Nov 2013 10:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAClnm042705; Wed, 20 Nov 2013 10:12:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAClVD042704; Wed, 20 Nov 2013 10:12:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201012.rAKAClVD042704@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258368 - vendor-sys/illumos/dist/uts/common vendor/illumos/dist/lib/libdtrace/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:12:48 -0000 Author: avg Date: Wed Nov 20 10:12:47 2013 New Revision: 258368 URL: http://svnweb.freebsd.org/changeset/base/258368 Log: 3933 contract adoption can race illumos/illumos-gate@a81df0a5d715363cc1841810a87818dfa95675c0 Note we now reference illumos commits in the github repository as the mercurial mirror seems to be neglected. For connectivity: r255255 referenced 14164:dceb17481b99 which is illumos/illumos-gate@69962b5647e4a8b9b14998733b765925381b727e r255258 referenced 14176:15e9457c12ec which is illumos/illumos-gate@cf746768a898264fa491791a8252865e5338dc67 Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libdtrace/common/dt_print.c Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 09:03:48 2013 (r258367) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:12:47 2013 (r258368) @@ -146,7 +146,7 @@ GENUNIX_OBJS += \ ddi_intr_impl.o \ ddi_intr_irm.o \ ddi_nodeid.o \ - ddi_timer.o \ + ddi_periodic.o \ devcfg.o \ devcache.o \ device.o \ @@ -1467,6 +1467,23 @@ RPCMOD_OBJS += rpcmod.o clnt_cots.o clnt rpcsys.o xdr_sizeof.o clnt_rdma.o svc_rdma.o \ xdr_rdma.o rdma_subr.o xdrrdma_sizeof.o +KLMMOD_OBJS += klmmod.o \ + nlm_impl.o \ + nlm_rpc_handle.o \ + nlm_dispatch.o \ + nlm_rpc_svc.o \ + nlm_client.o \ + nlm_service.o \ + nlm_prot_clnt.o \ + nlm_prot_xdr.o \ + nlm_rpc_clnt.o \ + nsm_addr_clnt.o \ + nsm_addr_xdr.o \ + sm_inter_clnt.o \ + sm_inter_xdr.o + +KLMOPS_OBJS += klmops.o + TLIMOD_OBJS += tlimod.o t_kalloc.o t_kbind.o t_kclose.o \ t_kconnect.o t_kfree.o t_kgtstate.o t_kopen.o \ t_krcvudat.o t_ksndudat.o t_kspoll.o t_kunbind.o \ @@ -1646,10 +1663,7 @@ K5_KRB= kfree.o copy_key.o \ K5_OS= timeofday.o toffset.o \ init_os_ctx.o c_ustime.o -SEAL= -# EXPORT DELETE START SEAL= seal.o unseal.o -# EXPORT DELETE END MECH= delete_sec_context.o \ import_sec_context.o \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:12:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EEAFA6B; Wed, 20 Nov 2013 10:12:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB332DD5; Wed, 20 Nov 2013 10:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKACm9e042711; Wed, 20 Nov 2013 10:12:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKACmts042710; Wed, 20 Nov 2013 10:12:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201012.rAKACmts042710@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258368 - vendor-sys/illumos/dist/uts/common vendor/illumos/dist/lib/libdtrace/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:12:48 -0000 Author: avg Date: Wed Nov 20 10:12:47 2013 New Revision: 258368 URL: http://svnweb.freebsd.org/changeset/base/258368 Log: 3933 contract adoption can race illumos/illumos-gate@a81df0a5d715363cc1841810a87818dfa95675c0 Note we now reference illumos commits in the github repository as the mercurial mirror seems to be neglected. For connectivity: r255255 referenced 14164:dceb17481b99 which is illumos/illumos-gate@69962b5647e4a8b9b14998733b765925381b727e r255258 referenced 14176:15e9457c12ec which is illumos/illumos-gate@cf746768a898264fa491791a8252865e5338dc67 Modified: vendor/illumos/dist/lib/libdtrace/common/dt_print.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor/illumos/dist/lib/libdtrace/common/dt_print.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_print.c Wed Nov 20 09:03:48 2013 (r258367) +++ vendor/illumos/dist/lib/libdtrace/common/dt_print.c Wed Nov 20 10:12:47 2013 (r258368) @@ -493,9 +493,11 @@ dt_print_enum(ctf_id_t base, ulong_t off value = *(uint8_t *)addr; break; case sizeof (uint16_t): + /* LINTED - alignment */ value = *(uint16_t *)addr; break; case sizeof (int32_t): + /* LINTED - alignment */ value = *(int32_t *)addr; break; default: From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:35:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAEB7230; Wed, 20 Nov 2013 10:35:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA5072F37; Wed, 20 Nov 2013 10:35:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAZqN4049577; Wed, 20 Nov 2013 10:35:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAZqoL049576; Wed, 20 Nov 2013 10:35:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201035.rAKAZqoL049576@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258369 - vendor-sys/illumos/dist/uts/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:35:52 -0000 Author: avg Date: Wed Nov 20 10:35:52 2013 New Revision: 258369 URL: http://svnweb.freebsd.org/changeset/base/258369 Log: 3881 want device driver for HP SmartArray RAID controllers illumos/illumos-gate@80c94ecd7a524eb933a4bb221a9618b9dc490e76 Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:12:47 2013 (r258368) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:35:52 2013 (r258369) @@ -2029,6 +2029,14 @@ MEGA_SAS_OBJS = megaraid_sas.o MR_SAS_OBJS = ld_pd_map.o mr_sas.o mr_sas_tbolt.o mr_sas_list.o # +# CPQARY3 module +# +CPQARY3_OBJS = cpqary3.o cpqary3_noe.o cpqary3_talk2ctlr.o \ + cpqary3_isr.o cpqary3_transport.o cpqary3_mem.o \ + cpqary3_scsi.o cpqary3_util.o cpqary3_ioctl.o \ + cpqary3_bd.o + +# # ISCSI_INITIATOR module # ISCSI_INITIATOR_OBJS = chap.o iscsi_io.o iscsi_thread.o \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:38:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 709FA468; Wed, 20 Nov 2013 10:38:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4638A2F5E; Wed, 20 Nov 2013 10:38:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAccX3049980; Wed, 20 Nov 2013 10:38:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAccwm049979; Wed, 20 Nov 2013 10:38:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201038.rAKAccwm049979@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258370 - vendor-sys/illumos/dist/uts/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:38:38 -0000 Author: avg Date: Wed Nov 20 10:38:37 2013 New Revision: 258370 URL: http://svnweb.freebsd.org/changeset/base/258370 Log: 4091 e1000g I217/I218 support illumos/illumos-gate@75eba5b6d79ed4d2ce3daf7b2806306b6b69a938 Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:35:52 2013 (r258369) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:38:37 2013 (r258370) @@ -1923,21 +1923,31 @@ XGE_HAL_OBJS = xgehal-channel.o xgehal- xge-queue.o xgehal-mgmt.o xgehal-mgmtaux.o # -# e1000g module +# e1000/igb common objs +# +# Historically e1000g and igb had separate copies of all of the common +# code. At this time while they are now sharing the same copy of it, they +# are building it into their own modules which is due to the differences +# in the osdep and debug portions of their code. # -E1000G_OBJS += e1000_80003es2lan.o e1000_82540.o e1000_82541.o e1000_82542.o \ +E1000API_OBJS += e1000_80003es2lan.o e1000_82540.o e1000_82541.o e1000_82542.o \ e1000_82543.o e1000_82571.o e1000_api.o e1000_ich8lan.o \ - e1000_mac.o e1000_manage.o e1000_nvm.o e1000_osdep.o \ - e1000_phy.o e1000g_debug.o e1000g_main.o e1000g_alloc.o \ - e1000g_tx.o e1000g_rx.o e1000g_stat.o + e1000_mac.o e1000_manage.o e1000_nvm.o e1000_phy.o \ + e1000_82575.o e1000_i210.o e1000_mbx.o e1000_vf.o + +# +# e1000g module +# +E1000G_OBJS += e1000g_debug.o e1000g_main.o e1000g_alloc.o \ + e1000g_tx.o e1000g_rx.o e1000g_stat.o \ + e1000g_osdep.o e1000g_workarounds.o + # # Intel 82575 1G NIC driver module # -IGB_OBJS = igb_82575.o igb_api.o igb_mac.o igb_manage.o \ - igb_nvm.o igb_osdep.o igb_phy.o igb_buf.o \ - igb_debug.o igb_gld.o igb_log.o igb_main.o \ - igb_rx.o igb_stat.o igb_tx.o +IGB_OBJS = igb_buf.o igb_debug.o igb_gld.o igb_log.o igb_main.o \ + igb_rx.o igb_stat.o igb_tx.o igb_osdep.o # # Intel Pro/100 NIC driver module From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:41:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3C3E5CD; Wed, 20 Nov 2013 10:41:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 916D72FA1; Wed, 20 Nov 2013 10:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAfCPO052406; Wed, 20 Nov 2013 10:41:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAfCDU052402; Wed, 20 Nov 2013 10:41:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201041.rAKAfCDU052402@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258371 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c vendor-s... 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:41:12 -0000 Author: avg Date: Wed Nov 20 10:41:10 2013 New Revision: 258371 URL: http://svnweb.freebsd.org/changeset/base/258371 Log: 4101 metaslab_debug should allow for fine-grained control 4102 space_maps should store more information about themselves 4103 space map object blocksize should be increased 4104 ::spa_space no longer works 4105 removing a mirrored log device results in a leaked object 4106 asynchronously load metaslab Revision illumos/illumos-gate@0713e232b7712cd27d99e1e935ebb8d5de61c57d Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Added: vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c/ vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c/range_tree.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h/ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h/space_reftree.h (contents, props changed) Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Nov 20 10:38:37 2013 (r258370) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Nov 20 10:41:10 2013 (r258371) @@ -246,7 +246,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -267,7 +267,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -320,19 +320,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -521,26 +521,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -552,10 +611,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -563,10 +622,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -574,15 +633,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -590,33 +651,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -803,9 +876,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -835,17 +908,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2221,39 +2293,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2308,11 +2358,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2335,7 +2395,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2563,7 +2636,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2733,6 +2806,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Wed Nov 20 10:38:37 2013 (r258370) +++ vendor/illumos/dist/cmd/ztest/ztest.c Wed Nov 20 10:41:10 2013 (r258371) @@ -5336,7 +5336,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Wed Nov 20 10:38:37 2013 (r258370) +++ vendor/illumos/dist/man/man5/zpool-features.5 Wed Nov 20 10:41:10 2013 (r258371) @@ -1,5 +1,5 @@ '\" te -.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2013 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" The contents of this file are subject to the terms of the Common Development @@ -14,7 +14,7 @@ .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your .\" own identifying information: .\" Portions Copyright [yyyy] [name of copyright owner] -.TH ZPOOL-FEATURES 5 "Mar 16, 2012" +.TH ZPOOL-FEATURES 5 "Aug 27, 2013" .SH NAME zpool\-features \- ZFS pool feature descriptions .SH DESCRIPTION @@ -229,7 +229,26 @@ read-only compatible, this operation wil on systems without support for the \fBlz4_compress\fR feature. At the moment, this operation cannot be reversed. Booting off of \fBlz4\fR-compressed root pools is supported. +.RE + +.sp +.ne 2 +.na +\fB\fBspacemap_histogram\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:spacemap_histogram +READ\-ONLY COMPATIBLE yes +DEPENDENCIES none +.TE +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is \fBenabled\fR, ZFS will +set this feature to \fBactive\fR when a new space map object is created or +an existing space map is upgraded to the new format. Once the feature is +\fBactive\fR, it will remain in that state until the pool is destroyed. .RE .sp From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:41: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04FE35CC; Wed, 20 Nov 2013 10:41:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E58EB2FA0; Wed, 20 Nov 2013 10:41:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAfB3k052396; Wed, 20 Nov 2013 10:41:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAfBHw052390; Wed, 20 Nov 2013 10:41:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201041.rAKAfBHw052390@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258371 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c vendor-s... 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:41:12 -0000 Author: avg Date: Wed Nov 20 10:41:10 2013 New Revision: 258371 URL: http://svnweb.freebsd.org/changeset/base/258371 Log: 4101 metaslab_debug should allow for fine-grained control 4102 space_maps should store more information about themselves 4103 space map object blocksize should be increased 4104 ::spa_space no longer works 4105 removing a mirrored log device results in a leaked object 4106 asynchronously load metaslab Revision illumos/illumos-gate@0713e232b7712cd27d99e1e935ebb8d5de61c57d Added: vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c/ vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c/range_tree.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h/ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h/space_reftree.h (contents, props changed) Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Wed Nov 20 10:38:37 2013 (r258370) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Wed Nov 20 10:41:10 2013 (r258371) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -164,4 +164,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Wed Nov 20 10:38:37 2013 (r258370) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Wed Nov 20 10:41:10 2013 (r258371) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -56,6 +56,7 @@ enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:38:37 2013 (r258370) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:41:10 2013 (r258371) @@ -22,7 +22,7 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # @@ -1359,6 +1359,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -1369,6 +1370,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Wed Nov 20 10:38:37 2013 (r258370) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Wed Nov 20 10:41:10 2013 (r258371) @@ -1334,7 +1334,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Wed Nov 20 10:38:37 2013 (r258370) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Wed Nov 20 10:41:10 2013 (r258371) @@ -31,6 +31,7 @@ #include #include #include +#include /* * Allow allocations to switch to gang blocks quickly. We do this to @@ -44,6 +45,11 @@ (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ @@ -79,9 +85,14 @@ int zfs_mg_alloc_failures = 0; int zfs_mg_noalloc_threshold = 0; /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; +int metaslab_debug_load = 0; + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; /* * Minimum size which forces the dynamic allocator to change @@ -106,14 +117,16 @@ int metaslab_df_free_pct = 4; uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; /* - * Max number of space_maps to prefetch. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; +int metaslab_load_pct = 50; /* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. */ -int metaslab_smo_bonus_pct = 150; +int metaslab_unload_delay = TXG_SIZE * 2; /* * Should we be willing to write data to degraded vdevs? @@ -121,12 +134,28 @@ int metaslab_smo_bonus_pct = 150; boolean_t zfs_write_to_degraded = B_FALSE; /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -230,9 +259,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -300,6 +329,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -368,6 +400,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -447,130 +481,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; - - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + metaslab_t *msp = arg; - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; + metaslab_t *msp = arg; - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); - - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; + metaslab_t *msp = arg; - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } - - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -579,29 +683,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } /* ARGSUSED */ -boolean_t -metaslab_ff_fragmented(space_map_t *sm) +static boolean_t +metaslab_ff_fragmented(metaslab_t *msp) { return (B_TRUE); } -static space_map_ops_t metaslab_ff_ops = { - metaslab_pp_load, - metaslab_pp_unload, +static metaslab_ops_t metaslab_ff_ops = { metaslab_ff_alloc, - metaslab_pp_claim, - metaslab_pp_free, - metaslab_pp_maxsize, metaslab_ff_fragmented }; @@ -614,16 +720,24 @@ static space_map_ops_t metaslab_ff_ops = * ========================================================================== */ static uint64_t -metaslab_df_alloc(space_map_t *sm, uint64_t size) +metaslab_df_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; - uint64_t max_size = metaslab_pp_maxsize(sm); - int free_pct = sm->sm_space * 100 / sm->sm_size; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &rt->rt_root; + uint64_t max_size = metaslab_block_maxsize(msp); + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - ASSERT(MUTEX_HELD(sm->sm_lock)); - ASSERT3U(avl_numnodes(&sm->sm_root), ==, avl_numnodes(sm->sm_pp_root)); + ASSERT(MUTEX_HELD(&msp->ms_lock)); + ASSERT3U(avl_numnodes(t), ==, avl_numnodes(&msp->ms_size_tree)); if (max_size < size) return (-1ULL); @@ -634,7 +748,7 @@ metaslab_df_alloc(space_map_t *sm, uint6 */ if (max_size < metaslab_df_alloc_threshold || free_pct < metaslab_df_free_pct) { - t = sm->sm_pp_root; + t = &msp->ms_size_tree; *cursor = 0; } @@ -642,10 +756,11 @@ metaslab_df_alloc(space_map_t *sm, uint6 } static boolean_t -metaslab_df_fragmented(space_map_t *sm) +metaslab_df_fragmented(metaslab_t *msp) { - uint64_t max_size = metaslab_pp_maxsize(sm); - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + uint64_t max_size = metaslab_block_maxsize(msp); + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; if (max_size >= metaslab_df_alloc_threshold && free_pct >= metaslab_df_free_pct) @@ -654,182 +769,228 @@ metaslab_df_fragmented(space_map_t *sm) return (B_TRUE); } -static space_map_ops_t metaslab_df_ops = { - metaslab_pp_load, - metaslab_pp_unload, +static metaslab_ops_t metaslab_df_ops = { metaslab_df_alloc, - metaslab_pp_claim, - metaslab_pp_free, - metaslab_pp_maxsize, metaslab_df_fragmented }; /* * ========================================================================== - * Other experimental allocators + * Cursor fit block allocator - + * Select the largest region in the metaslab, set the cursor to the beginning + * of the range and the cursor_end to the end of the range. As allocations + * are made advance the cursor. Continue allocating from the cursor until + * the range is exhausted and then find a new range. * ========================================================================== */ static uint64_t -metaslab_cdf_alloc(space_map_t *sm, uint64_t size) +metaslab_cf_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; - uint64_t *cursor = (uint64_t *)sm->sm_ppd; - uint64_t *extent_end = (uint64_t *)sm->sm_ppd + 1; - uint64_t max_size = metaslab_pp_maxsize(sm); - uint64_t rsize = size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + uint64_t *cursor = &msp->ms_lbas[0]; + uint64_t *cursor_end = &msp->ms_lbas[1]; uint64_t offset = 0; - ASSERT(MUTEX_HELD(sm->sm_lock)); - ASSERT3U(avl_numnodes(&sm->sm_root), ==, avl_numnodes(sm->sm_pp_root)); - - if (max_size < size) - return (-1ULL); + ASSERT(MUTEX_HELD(&msp->ms_lock)); + ASSERT3U(avl_numnodes(t), ==, avl_numnodes(&rt->rt_root)); - ASSERT3U(*extent_end, >=, *cursor); + ASSERT3U(*cursor_end, >=, *cursor); - /* - * If we're running low on space switch to using the size - * sorted AVL tree (best-fit). - */ - if ((*cursor + size) > *extent_end) { + if ((*cursor + size) > *cursor_end) { + range_seg_t *rs; - t = sm->sm_pp_root; - *cursor = *extent_end = 0; + rs = avl_last(&msp->ms_size_tree); + if (rs == NULL || (rs->rs_end - rs->rs_start) < size) + return (-1ULL); - if (max_size > 2 * SPA_MAXBLOCKSIZE) - rsize = MIN(metaslab_min_alloc_size, max_size); - offset = metaslab_block_picker(t, extent_end, rsize, 1ULL); - if (offset != -1) - *cursor = offset + size; - } else { - offset = metaslab_block_picker(t, cursor, rsize, 1ULL); + *cursor = rs->rs_start; + *cursor_end = rs->rs_end; } - ASSERT3U(*cursor, <=, *extent_end); + + offset = *cursor; + *cursor += size; + return (offset); } static boolean_t -metaslab_cdf_fragmented(space_map_t *sm) +metaslab_cf_fragmented(metaslab_t *msp) { - uint64_t max_size = metaslab_pp_maxsize(sm); - - if (max_size > (metaslab_min_alloc_size * 10)) - return (B_FALSE); - return (B_TRUE); + return (metaslab_block_maxsize(msp) < metaslab_min_alloc_size); } -static space_map_ops_t metaslab_cdf_ops = { - metaslab_pp_load, - metaslab_pp_unload, - metaslab_cdf_alloc, - metaslab_pp_claim, - metaslab_pp_free, - metaslab_pp_maxsize, - metaslab_cdf_fragmented +static metaslab_ops_t metaslab_cf_ops = { + metaslab_cf_alloc, + metaslab_cf_fragmented }; +/* + * ========================================================================== + * New dynamic fit allocator - + * Select a region that is large enough to allocate 2^metaslab_ndf_clump_shift + * contiguous blocks. If no region is found then just use the largest segment + * that remains. + * ========================================================================== + */ + +/* + * Determines desired number of contiguous blocks (2^metaslab_ndf_clump_shift) + * to request from the allocator. + */ uint64_t metaslab_ndf_clump_shift = 4; static uint64_t -metaslab_ndf_alloc(space_map_t *sm, uint64_t size) +metaslab_ndf_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + avl_tree_t *t = &msp->ms_tree->rt_root; avl_index_t where; - space_seg_t *ss, ssearch; + range_seg_t *rs, rsearch; uint64_t hbit = highbit(size); - uint64_t *cursor = (uint64_t *)sm->sm_ppd + hbit - 1; - uint64_t max_size = metaslab_pp_maxsize(sm); + uint64_t *cursor = &msp->ms_lbas[hbit - 1]; + uint64_t max_size = metaslab_block_maxsize(msp); - ASSERT(MUTEX_HELD(sm->sm_lock)); - ASSERT3U(avl_numnodes(&sm->sm_root), ==, avl_numnodes(sm->sm_pp_root)); + ASSERT(MUTEX_HELD(&msp->ms_lock)); + ASSERT3U(avl_numnodes(t), ==, avl_numnodes(&msp->ms_size_tree)); if (max_size < size) return (-1ULL); - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL || (ss->ss_start + size > ss->ss_end)) { - t = sm->sm_pp_root; + rs = avl_find(t, &rsearch, &where); + if (rs == NULL || (rs->rs_end - rs->rs_start) < size) { + t = &msp->ms_size_tree; - ssearch.ss_start = 0; - ssearch.ss_end = MIN(max_size, + rsearch.rs_start = 0; + rsearch.rs_end = MIN(max_size, 1ULL << (hbit + metaslab_ndf_clump_shift)); - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); - ASSERT(ss != NULL); + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + ASSERT(rs != NULL); } - if (ss != NULL) { - if (ss->ss_start + size <= ss->ss_end) { - *cursor = ss->ss_start + size; - return (ss->ss_start); - } + if ((rs->rs_end - rs->rs_start) >= size) { + *cursor = rs->rs_start + size; + return (rs->rs_start); } return (-1ULL); } static boolean_t -metaslab_ndf_fragmented(space_map_t *sm) +metaslab_ndf_fragmented(metaslab_t *msp) { - uint64_t max_size = metaslab_pp_maxsize(sm); - - if (max_size > (metaslab_min_alloc_size << metaslab_ndf_clump_shift)) - return (B_FALSE); - return (B_TRUE); + return (metaslab_block_maxsize(msp) <= + (metaslab_min_alloc_size << metaslab_ndf_clump_shift)); } - -static space_map_ops_t metaslab_ndf_ops = { - metaslab_pp_load, - metaslab_pp_unload, +static metaslab_ops_t metaslab_ndf_ops = { metaslab_ndf_alloc, - metaslab_pp_claim, - metaslab_pp_free, - metaslab_pp_maxsize, metaslab_ndf_fragmented }; -space_map_ops_t *zfs_metaslab_ops = &metaslab_df_ops; +metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops; /* * ========================================================================== * Metaslabs * ========================================================================== */ + +/* + * Wait for any in-progress metaslab loads to complete. + */ +void +metaslab_load_wait(metaslab_t *msp) +{ + ASSERT(MUTEX_HELD(&msp->ms_lock)); + + while (msp->ms_loading) { + ASSERT(!msp->ms_loaded); + cv_wait(&msp->ms_load_cv, &msp->ms_lock); + } +} + +int +metaslab_load(metaslab_t *msp) +{ + int error = 0; + + ASSERT(MUTEX_HELD(&msp->ms_lock)); + ASSERT(!msp->ms_loaded); + ASSERT(!msp->ms_loading); + + msp->ms_loading = B_TRUE; + + /* + * If the space map has not been allocated yet, then treat + * all the space in the metaslab as free and add it to the + * ms_tree. + */ + if (msp->ms_sm != NULL) + error = space_map_load(msp->ms_sm, msp->ms_tree, SM_FREE); + else + range_tree_add(msp->ms_tree, msp->ms_start, msp->ms_size); + + msp->ms_loaded = (error == 0); + msp->ms_loading = B_FALSE; + + if (msp->ms_loaded) { + for (int t = 0; t < TXG_DEFER_SIZE; t++) { + range_tree_walk(msp->ms_defertree[t], + range_tree_remove, msp->ms_tree); + } + } + cv_broadcast(&msp->ms_load_cv); + return (error); +} + +void +metaslab_unload(metaslab_t *msp) +{ + ASSERT(MUTEX_HELD(&msp->ms_lock)); + range_tree_vacate(msp->ms_tree, NULL, NULL); + msp->ms_loaded = B_FALSE; + msp->ms_weight &= ~METASLAB_ACTIVE_MASK; +} + metaslab_t * -metaslab_init(metaslab_group_t *mg, space_map_obj_t *smo, - uint64_t start, uint64_t size, uint64_t txg) +metaslab_init(metaslab_group_t *mg, uint64_t id, uint64_t object, uint64_t txg) { vdev_t *vd = mg->mg_vd; + objset_t *mos = vd->vdev_spa->spa_meta_objset; metaslab_t *msp; msp = kmem_zalloc(sizeof (metaslab_t), KM_SLEEP); mutex_init(&msp->ms_lock, NULL, MUTEX_DEFAULT, NULL); + cv_init(&msp->ms_load_cv, NULL, CV_DEFAULT, NULL); + msp->ms_id = id; + msp->ms_start = id << vd->vdev_ms_shift; + msp->ms_size = 1ULL << vd->vdev_ms_shift; - msp->ms_smo_syncing = *smo; + /* + * We only open space map objects that already exist. All others + * will be opened when we finally allocate an object for it. + */ + if (object != 0) { + VERIFY0(space_map_open(&msp->ms_sm, mos, object, msp->ms_start, + msp->ms_size, vd->vdev_ashift, &msp->ms_lock)); + ASSERT(msp->ms_sm != NULL); + } /* - * We create the main space map here, but we don't create the - * allocmaps and freemaps until metaslab_sync_done(). This serves + * We create the main range tree here, but we don't create the + * alloctree and freetree until metaslab_sync_done(). This serves * two purposes: it allows metaslab_sync_done() to detect the * addition of new space; and for debugging, it ensures that we'd * data fault on any attempt to use this metaslab before it's ready. */ - msp->ms_map = kmem_zalloc(sizeof (space_map_t), KM_SLEEP); - space_map_create(msp->ms_map, start, size, - vd->vdev_ashift, &msp->ms_lock); - + msp->ms_tree = range_tree_create(&metaslab_rt_ops, msp, &msp->ms_lock); metaslab_group_add(mg, msp); - if (metaslab_debug && smo->smo_object != 0) { - mutex_enter(&msp->ms_lock); - VERIFY(space_map_load(msp->ms_map, mg->mg_class->mc_ops, - SM_FREE, smo, spa_meta_objset(vd->vdev_spa)) == 0); - mutex_exit(&msp->ms_lock); - } + msp->ms_ops = mg->mg_class->mc_ops; /* * If we're opening an existing pool (txg == 0) or creating @@ -840,6 +1001,17 @@ metaslab_init(metaslab_group_t *mg, spac if (txg <= TXG_INITIAL) metaslab_sync_done(msp, 0); + /* + * If metaslab_debug_load is set and we're initializing a metaslab + * that has an allocated space_map object then load the its space + * map so that can verify frees. + */ + if (metaslab_debug_load && msp->ms_sm != NULL) { + mutex_enter(&msp->ms_lock); + VERIFY0(metaslab_load(msp)); + mutex_exit(&msp->ms_lock); + } + if (txg != 0) { vdev_dirty(vd, 0, NULL, txg); vdev_dirty(vd, VDD_METASLAB, msp, txg); @@ -853,48 +1025,103 @@ metaslab_fini(metaslab_t *msp) { metaslab_group_t *mg = msp->ms_group; - vdev_space_update(mg->mg_vd, - -msp->ms_smo.smo_alloc, 0, -msp->ms_map->sm_size); - metaslab_group_remove(mg, msp); mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - space_map_destroy(msp->ms_map); - kmem_free(msp->ms_map, sizeof (*msp->ms_map)); + VERIFY(msp->ms_group == NULL); + vdev_space_update(mg->mg_vd, -space_map_allocated(msp->ms_sm), + 0, -msp->ms_size); + space_map_close(msp->ms_sm); + + metaslab_unload(msp); + range_tree_destroy(msp->ms_tree); for (int t = 0; t < TXG_SIZE; t++) { - space_map_destroy(msp->ms_allocmap[t]); - space_map_destroy(msp->ms_freemap[t]); - kmem_free(msp->ms_allocmap[t], sizeof (*msp->ms_allocmap[t])); - kmem_free(msp->ms_freemap[t], sizeof (*msp->ms_freemap[t])); + range_tree_destroy(msp->ms_alloctree[t]); + range_tree_destroy(msp->ms_freetree[t]); } for (int t = 0; t < TXG_DEFER_SIZE; t++) { - space_map_destroy(msp->ms_defermap[t]); - kmem_free(msp->ms_defermap[t], sizeof (*msp->ms_defermap[t])); + range_tree_destroy(msp->ms_defertree[t]); } ASSERT0(msp->ms_deferspace); mutex_exit(&msp->ms_lock); + cv_destroy(&msp->ms_load_cv); mutex_destroy(&msp->ms_lock); kmem_free(msp, sizeof (metaslab_t)); } -#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) -#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) -#define METASLAB_ACTIVE_MASK \ - (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) +/* + * Apply a weighting factor based on the histogram information for this + * metaslab. The current weighting factor is somewhat arbitrary and requires + * additional investigation. The implementation provides a measure of + * "weighted" free space and gives a higher weighting for larger contiguous + * regions. The weighting factor is determined by counting the number of + * sm_shift sectors that exist in each region represented by the histogram. + * That value is then multiplied by the power of 2 exponent and the sm_shift + * value. + * + * For example, assume the 2^21 histogram bucket has 4 2MB regions and the + * metaslab has an sm_shift value of 9 (512B): + * + * 1) calculate the number of sm_shift sectors in the region: + * 2^21 / 2^9 = 2^12 = 4096 * 4 (number of regions) = 16384 + * 2) multiply by the power of 2 exponent and the sm_shift value: + * 16384 * 21 * 9 = 3096576 + * This value will be added to the weighting of the metaslab. + */ +static uint64_t +metaslab_weight_factor(metaslab_t *msp) +{ + uint64_t factor = 0; + uint64_t sectors; + int i; + + /* + * A null space map means that the entire metaslab is free, + * calculate a weight factor that spans the entire size of the + * metaslab. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:50: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5554DA63; Wed, 20 Nov 2013 10:50:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43A3A2061; Wed, 20 Nov 2013 10:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAotbX055785; Wed, 20 Nov 2013 10:50:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAosl4055779; Wed, 20 Nov 2013 10:50:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201050.rAKAosl4055779@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258372 - in 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:50:55 -0000 Author: avg Date: Wed Nov 20 10:50:54 2013 New Revision: 258372 URL: http://svnweb.freebsd.org/changeset/base/258372 Log: fix a screw up in r258371 Pointyhat to: avg Added: vendor-sys/illumos/dist/uts/common/fs/zfs/space_reftree.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/range_tree.h (contents, props changed) Replaced: vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h (contents, props changed) Added: vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/range_tree.c Wed Nov 20 10:50:54 2013 (r258372) @@ -0,0 +1,391 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include + +static kmem_cache_t *range_seg_cache; + +void +range_tree_init(void) +{ + ASSERT(range_seg_cache == NULL); + range_seg_cache = kmem_cache_create("range_seg_cache", + sizeof (range_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +range_tree_fini(void) +{ + kmem_cache_destroy(range_seg_cache); + range_seg_cache = NULL; +} + +void +range_tree_stat_verify(range_tree_t *rt) +{ + range_seg_t *rs; + uint64_t hist[RANGE_TREE_HISTOGRAM_SIZE] = { 0 }; + int i; + + for (rs = avl_first(&rt->rt_root); rs != NULL; + rs = AVL_NEXT(&rt->rt_root, rs)) { + uint64_t size = rs->rs_end - rs->rs_start; + int idx = highbit(size) - 1; + + hist[idx]++; + ASSERT3U(hist[idx], !=, 0); + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) { + if (hist[i] != rt->rt_histogram[i]) { + zfs_dbgmsg("i=%d, hist=%p, hist=%llu, rt_hist=%llu", + i, hist, hist[i], rt->rt_histogram[i]); + } + VERIFY3U(hist[i], ==, rt->rt_histogram[i]); + } +} + +static void +range_tree_stat_incr(range_tree_t *rt, range_seg_t *rs) +{ + uint64_t size = rs->rs_end - rs->rs_start; + int idx = highbit(size) - 1; + + ASSERT3U(idx, <, + sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); + + ASSERT(MUTEX_HELD(rt->rt_lock)); + rt->rt_histogram[idx]++; + ASSERT3U(rt->rt_histogram[idx], !=, 0); +} + +static void +range_tree_stat_decr(range_tree_t *rt, range_seg_t *rs) +{ + uint64_t size = rs->rs_end - rs->rs_start; + int idx = highbit(size) - 1; + + ASSERT3U(idx, <, + sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); + + ASSERT(MUTEX_HELD(rt->rt_lock)); + ASSERT3U(rt->rt_histogram[idx], !=, 0); + rt->rt_histogram[idx]--; +} + +/* + * NOTE: caller is responsible for all locking. + */ +static int +range_tree_seg_compare(const void *x1, const void *x2) +{ + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + + if (r1->rs_start < r2->rs_start) { + if (r1->rs_end > r2->rs_start) + return (0); + return (-1); + } + if (r1->rs_start > r2->rs_start) { + if (r1->rs_start < r2->rs_end) + return (0); + return (1); + } + return (0); +} + +range_tree_t * +range_tree_create(range_tree_ops_t *ops, void *arg, kmutex_t *lp) +{ + range_tree_t *rt; + + rt = kmem_zalloc(sizeof (range_tree_t), KM_SLEEP); + + avl_create(&rt->rt_root, range_tree_seg_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_node)); + + rt->rt_lock = lp; + rt->rt_ops = ops; + rt->rt_arg = arg; + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_create(rt, rt->rt_arg); + + return (rt); +} + +void +range_tree_destroy(range_tree_t *rt) +{ + VERIFY0(rt->rt_space); + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_destroy(rt, rt->rt_arg); + + avl_destroy(&rt->rt_root); + kmem_free(rt, sizeof (*rt)); +} + +void +range_tree_add(void *arg, uint64_t start, uint64_t size) +{ + range_tree_t *rt = arg; + avl_index_t where; + range_seg_t rsearch, *rs_before, *rs_after, *rs; + uint64_t end = start + size; + boolean_t merge_before, merge_after; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + VERIFY(size != 0); + + rsearch.rs_start = start; + rsearch.rs_end = end; + rs = avl_find(&rt->rt_root, &rsearch, &where); + + if (rs != NULL && rs->rs_start <= start && rs->rs_end >= end) { + zfs_panic_recover("zfs: allocating allocated segment" + "(offset=%llu size=%llu)\n", + (longlong_t)start, (longlong_t)size); + return; + } + + /* Make sure we don't overlap with either of our neighbors */ + VERIFY(rs == NULL); + + rs_before = avl_nearest(&rt->rt_root, where, AVL_BEFORE); + rs_after = avl_nearest(&rt->rt_root, where, AVL_AFTER); + + merge_before = (rs_before != NULL && rs_before->rs_end == start); + merge_after = (rs_after != NULL && rs_after->rs_start == end); + + if (merge_before && merge_after) { + avl_remove(&rt->rt_root, rs_before); + if (rt->rt_ops != NULL) { + rt->rt_ops->rtop_remove(rt, rs_before, rt->rt_arg); + rt->rt_ops->rtop_remove(rt, rs_after, rt->rt_arg); + } + + range_tree_stat_decr(rt, rs_before); + range_tree_stat_decr(rt, rs_after); + + rs_after->rs_start = rs_before->rs_start; + kmem_cache_free(range_seg_cache, rs_before); + rs = rs_after; + } else if (merge_before) { + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_remove(rt, rs_before, rt->rt_arg); + + range_tree_stat_decr(rt, rs_before); + + rs_before->rs_end = end; + rs = rs_before; + } else if (merge_after) { + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_remove(rt, rs_after, rt->rt_arg); + + range_tree_stat_decr(rt, rs_after); + + rs_after->rs_start = start; + rs = rs_after; + } else { + rs = kmem_cache_alloc(range_seg_cache, KM_SLEEP); + rs->rs_start = start; + rs->rs_end = end; + avl_insert(&rt->rt_root, rs, where); + } + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_add(rt, rs, rt->rt_arg); + + range_tree_stat_incr(rt, rs); + rt->rt_space += size; +} + +void +range_tree_remove(void *arg, uint64_t start, uint64_t size) +{ + range_tree_t *rt = arg; + avl_index_t where; + range_seg_t rsearch, *rs, *newseg; + uint64_t end = start + size; + boolean_t left_over, right_over; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + VERIFY3U(size, !=, 0); + VERIFY3U(size, <=, rt->rt_space); + + rsearch.rs_start = start; + rsearch.rs_end = end; + rs = avl_find(&rt->rt_root, &rsearch, &where); + + /* Make sure we completely overlap with someone */ + if (rs == NULL) { + zfs_panic_recover("zfs: freeing free segment " + "(offset=%llu size=%llu)", + (longlong_t)start, (longlong_t)size); + return; + } + VERIFY3U(rs->rs_start, <=, start); + VERIFY3U(rs->rs_end, >=, end); + + left_over = (rs->rs_start != start); + right_over = (rs->rs_end != end); + + range_tree_stat_decr(rt, rs); + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_remove(rt, rs, rt->rt_arg); + + if (left_over && right_over) { + newseg = kmem_cache_alloc(range_seg_cache, KM_SLEEP); + newseg->rs_start = end; + newseg->rs_end = rs->rs_end; + range_tree_stat_incr(rt, newseg); + + rs->rs_end = start; + + avl_insert_here(&rt->rt_root, newseg, rs, AVL_AFTER); + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_add(rt, newseg, rt->rt_arg); + } else if (left_over) { + rs->rs_end = start; + } else if (right_over) { + rs->rs_start = end; + } else { + avl_remove(&rt->rt_root, rs); + kmem_cache_free(range_seg_cache, rs); + rs = NULL; + } + + if (rs != NULL) { + range_tree_stat_incr(rt, rs); + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_add(rt, rs, rt->rt_arg); + } + + rt->rt_space -= size; +} + +static range_seg_t * +range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size, + avl_index_t *wherep) +{ + range_seg_t rsearch, *rs; + uint64_t end = start + size; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + VERIFY(size != 0); + + rsearch.rs_start = start; + rsearch.rs_end = end; + rs = avl_find(&rt->rt_root, &rsearch, wherep); + + if (rs != NULL && rs->rs_start <= start && rs->rs_end >= end) + return (rs); + return (NULL); +} + +void +range_tree_verify(range_tree_t *rt, uint64_t off, uint64_t size) +{ + range_seg_t *rs; + avl_index_t where; + + mutex_enter(rt->rt_lock); + rs = range_tree_find(rt, off, size, &where); + if (rs != NULL) + panic("freeing free block; rs=%p", (void *)rs); + mutex_exit(rt->rt_lock); +} + +boolean_t +range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size) +{ + avl_index_t where; + + return (range_tree_find(rt, start, size, &where) != NULL); +} + +void +range_tree_swap(range_tree_t **rtsrc, range_tree_t **rtdst) +{ + range_tree_t *rt; + + ASSERT(MUTEX_HELD((*rtsrc)->rt_lock)); + ASSERT0(range_tree_space(*rtdst)); + ASSERT0(avl_numnodes(&(*rtdst)->rt_root)); + + rt = *rtsrc; + *rtsrc = *rtdst; + *rtdst = rt; +} + +void +range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg) +{ + range_seg_t *rs; + void *cookie = NULL; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + + if (rt->rt_ops != NULL) + rt->rt_ops->rtop_vacate(rt, rt->rt_arg); + + while ((rs = avl_destroy_nodes(&rt->rt_root, &cookie)) != NULL) { + if (func != NULL) + func(arg, rs->rs_start, rs->rs_end - rs->rs_start); + kmem_cache_free(range_seg_cache, rs); + } + + bzero(rt->rt_histogram, sizeof (rt->rt_histogram)); + rt->rt_space = 0; +} + +void +range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg) +{ + range_seg_t *rs; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + + for (rs = avl_first(&rt->rt_root); rs; rs = AVL_NEXT(&rt->rt_root, rs)) + func(arg, rs->rs_start, rs->rs_end - rs->rs_start); +} + +uint64_t +range_tree_space(range_tree_t *rt) +{ + return (rt->rt_space); +} Added: vendor-sys/illumos/dist/uts/common/fs/zfs/space_reftree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/space_reftree.c Wed Nov 20 10:50:54 2013 (r258372) @@ -0,0 +1,159 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#include +#include +#include + +/* + * Space reference trees. + * + * A range tree is a collection of integers. Every integer is either + * in the tree, or it's not. A space reference tree generalizes + * the idea: it allows its members to have arbitrary reference counts, + * as opposed to the implicit reference count of 0 or 1 in a range tree. + * This representation comes in handy when computing the union or + * intersection of multiple space maps. For example, the union of + * N range trees is the subset of the reference tree with refcnt >= 1. + * The intersection of N range trees is the subset with refcnt >= N. + * + * [It's very much like a Fourier transform. Unions and intersections + * are hard to perform in the 'range tree domain', so we convert the trees + * into the 'reference count domain', where it's trivial, then invert.] + * + * vdev_dtl_reassess() uses computations of this form to determine + * DTL_MISSING and DTL_OUTAGE for interior vdevs -- e.g. a RAID-Z vdev + * has an outage wherever refcnt >= vdev_nparity + 1, and a mirror vdev + * has an outage wherever refcnt >= vdev_children. + */ +static int +space_reftree_compare(const void *x1, const void *x2) +{ + const space_ref_t *sr1 = x1; + const space_ref_t *sr2 = x2; + + if (sr1->sr_offset < sr2->sr_offset) + return (-1); + if (sr1->sr_offset > sr2->sr_offset) + return (1); + + if (sr1 < sr2) + return (-1); + if (sr1 > sr2) + return (1); + + return (0); +} + +void +space_reftree_create(avl_tree_t *t) +{ + avl_create(t, space_reftree_compare, + sizeof (space_ref_t), offsetof(space_ref_t, sr_node)); +} + +void +space_reftree_destroy(avl_tree_t *t) +{ + space_ref_t *sr; + void *cookie = NULL; + + while ((sr = avl_destroy_nodes(t, &cookie)) != NULL) + kmem_free(sr, sizeof (*sr)); + + avl_destroy(t); +} + +static void +space_reftree_add_node(avl_tree_t *t, uint64_t offset, int64_t refcnt) +{ + space_ref_t *sr; + + sr = kmem_alloc(sizeof (*sr), KM_SLEEP); + sr->sr_offset = offset; + sr->sr_refcnt = refcnt; + + avl_add(t, sr); +} + +void +space_reftree_add_seg(avl_tree_t *t, uint64_t start, uint64_t end, + int64_t refcnt) +{ + space_reftree_add_node(t, start, refcnt); + space_reftree_add_node(t, end, -refcnt); +} + +/* + * Convert (or add) a range tree into a reference tree. + */ +void +space_reftree_add_map(avl_tree_t *t, range_tree_t *rt, int64_t refcnt) +{ + range_seg_t *rs; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + + for (rs = avl_first(&rt->rt_root); rs; rs = AVL_NEXT(&rt->rt_root, rs)) + space_reftree_add_seg(t, rs->rs_start, rs->rs_end, refcnt); +} + +/* + * Convert a reference tree into a range tree. The range tree will contain + * all members of the reference tree for which refcnt >= minref. + */ +void +space_reftree_generate_map(avl_tree_t *t, range_tree_t *rt, int64_t minref) +{ + uint64_t start = -1ULL; + int64_t refcnt = 0; + space_ref_t *sr; + + ASSERT(MUTEX_HELD(rt->rt_lock)); + + range_tree_vacate(rt, NULL, NULL); + + for (sr = avl_first(t); sr != NULL; sr = AVL_NEXT(t, sr)) { + refcnt += sr->sr_refcnt; + if (refcnt >= minref) { + if (start == -1ULL) { + start = sr->sr_offset; + } + } else { + if (start != -1ULL) { + uint64_t end = sr->sr_offset; + ASSERT(start <= end); + if (end > start) + range_tree_add(rt, start, end - start); + start = -1ULL; + } + } + } + ASSERT(refcnt == 0); + ASSERT(start == -1ULL); +} Added: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/range_tree.h Wed Nov 20 10:50:54 2013 (r258372) @@ -0,0 +1,96 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#ifndef _SYS_RANGE_TREE_H +#define _SYS_RANGE_TREE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define RANGE_TREE_HISTOGRAM_SIZE 64 + +typedef struct range_tree_ops range_tree_ops_t; + +typedef struct range_tree { + avl_tree_t rt_root; /* offset-ordered segment AVL tree */ + uint64_t rt_space; /* sum of all segments in the map */ + range_tree_ops_t *rt_ops; + void *rt_arg; + + /* + * The rt_histogram maintains a histogram of ranges. Each bucket, + * rt_histogram[i], contains the number of ranges whose size is: + * 2^i <= size of range in bytes < 2^(i+1) + */ + uint64_t rt_histogram[RANGE_TREE_HISTOGRAM_SIZE]; + kmutex_t *rt_lock; /* pointer to lock that protects map */ +} range_tree_t; + +typedef struct range_seg { + avl_node_t rs_node; /* AVL node */ + avl_node_t rs_pp_node; /* AVL picker-private node */ + uint64_t rs_start; /* starting offset of this segment */ + uint64_t rs_end; /* ending offset (non-inclusive) */ +} range_seg_t; + +struct range_tree_ops { + void (*rtop_create)(range_tree_t *rt, void *arg); + void (*rtop_destroy)(range_tree_t *rt, void *arg); + void (*rtop_add)(range_tree_t *rt, range_seg_t *rs, void *arg); + void (*rtop_remove)(range_tree_t *rt, range_seg_t *rs, void *arg); + void (*rtop_vacate)(range_tree_t *rt, void *arg); +}; + +typedef void range_tree_func_t(void *arg, uint64_t start, uint64_t size); + +void range_tree_init(void); +void range_tree_fini(void); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg, kmutex_t *lp); +void range_tree_destroy(range_tree_t *rt); +boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); +uint64_t range_tree_space(range_tree_t *rt); +void range_tree_verify(range_tree_t *rt, uint64_t start, uint64_t size); +void range_tree_swap(range_tree_t **rtsrc, range_tree_t **rtdst); +void range_tree_stat_verify(range_tree_t *rt); + +void range_tree_add(void *arg, uint64_t start, uint64_t size); +void range_tree_remove(void *arg, uint64_t start, uint64_t size); + +void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); +void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_RANGE_TREE_H */ Added: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_reftree.h Wed Nov 20 10:50:54 2013 (r258372) @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#ifndef _SYS_SPACE_REFTREE_H +#define _SYS_SPACE_REFTREE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct space_ref { + avl_node_t sr_node; /* AVL node */ + uint64_t sr_offset; /* range offset (start or end) */ + int64_t sr_refcnt; /* associated reference count */ +} space_ref_t; + +void space_reftree_create(avl_tree_t *t); +void space_reftree_destroy(avl_tree_t *t); +void space_reftree_add_seg(avl_tree_t *t, uint64_t start, uint64_t end, + int64_t refcnt); +void space_reftree_add_map(avl_tree_t *t, range_tree_t *rt, int64_t refcnt); +void space_reftree_generate_map(avl_tree_t *t, range_tree_t *rt, + int64_t minref); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_SPACE_REFTREE_H */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:52:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F567BDE; Wed, 20 Nov 2013 10:52:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8DEA82088; Wed, 20 Nov 2013 10:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAqn1C056031; Wed, 20 Nov 2013 10:52:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAqnHX056029; Wed, 20 Nov 2013 10:52:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201052.rAKAqnHX056029@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258373 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zhack 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:52:49 -0000 Author: avg Date: Wed Nov 20 10:52:48 2013 New Revision: 258373 URL: http://svnweb.freebsd.org/changeset/base/258373 Log: 4168 ztest assertion failure in dbuf_undirty 4169 verbatim import causes zdb to segfa 4170 zhack leaves pool in ACTIVE state illumos/illumos-gate@7fdd916c474ea52896c671bbe7b56ba34a1ca132 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zhack/zhack.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed Nov 20 10:50:54 2013 (r258372) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed Nov 20 10:52:48 2013 (r258373) @@ -1334,14 +1334,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ DB_DNODE_ENTER(db); dn = DB_DNODE(db); - /* - * Note: This code will probably work even if there are concurrent - * holders, but it is untested in that scenerio, as the ZPL and - * ztest have additional locking (the range locks) that prevents - * that type of concurrent access. - */ - ASSERT3U(refcount_count(&db->db_holds), ==, db->db_dirtycnt); - dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size); ASSERT(db->db.db_size != 0); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Nov 20 10:50:54 2013 (r258372) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Nov 20 10:52:48 2013 (r258373) @@ -3842,8 +3842,6 @@ spa_import(const char *pool, nvlist_t *c spa_config_sync(spa, B_FALSE, B_TRUE); mutex_exit(&spa_namespace_lock); - spa_history_log_version(spa, "import"); - return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:52: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E885BDF; Wed, 20 Nov 2013 10:52:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2E772089; Wed, 20 Nov 2013 10:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAqnxM056037; Wed, 20 Nov 2013 10:52:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAqnI9056036; Wed, 20 Nov 2013 10:52:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201052.rAKAqnI9056036@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258373 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zhack 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:52:50 -0000 Author: avg Date: Wed Nov 20 10:52:48 2013 New Revision: 258373 URL: http://svnweb.freebsd.org/changeset/base/258373 Log: 4168 ztest assertion failure in dbuf_undirty 4169 verbatim import causes zdb to segfa 4170 zhack leaves pool in ACTIVE state illumos/illumos-gate@7fdd916c474ea52896c671bbe7b56ba34a1ca132 Modified: vendor/illumos/dist/cmd/zhack/zhack.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Modified: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- vendor/illumos/dist/cmd/zhack/zhack.c Wed Nov 20 10:50:54 2013 (r258372) +++ vendor/illumos/dist/cmd/zhack/zhack.c Wed Nov 20 10:52:48 2013 (r258373) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -85,10 +85,15 @@ usage(void) static void -fatal(const char *fmt, ...) +fatal(spa_t *spa, void *tag, const char *fmt, ...) { va_list ap; + if (spa != NULL) { + spa_close(spa, tag); + (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE); + } + va_start(ap, fmt); (void) fprintf(stderr, "%s: ", cmdname); (void) vfprintf(stderr, fmt, ap); @@ -159,13 +164,14 @@ import_pool(const char *target, boolean_ g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || spa_open(target, &spa, FTAG) == 0) { - fatal("cannot import '%s': pool is active; run " - "\"zpool export %s\" first\n", - g_pool, g_pool); + fatal(spa, FTAG, "cannot import '%s': pool is " + "active; run " "\"zpool export %s\" " + "first\n", g_pool, g_pool); } } - fatal("cannot import '%s': no such pool available\n", g_pool); + fatal(NULL, FTAG, "cannot import '%s': no such pool " + "available\n", g_pool); } elem = nvlist_next_nvpair(pools, NULL); @@ -186,7 +192,8 @@ import_pool(const char *target, boolean_ error = 0; if (error) - fatal("can't import '%s': %s", name, strerror(error)); + fatal(NULL, FTAG, "can't import '%s': %s", name, + strerror(error)); } static void @@ -201,10 +208,11 @@ zhack_spa_open(const char *target, boole zfeature_checks_disable = B_FALSE; if (err != 0) - fatal("cannot open '%s': %s", target, strerror(err)); + fatal(*spa, FTAG, "cannot open '%s': %s", target, + strerror(err)); if (spa_version(*spa) < SPA_VERSION_FEATURES) { - fatal("'%s' has version %d, features not enabled", target, - (int)spa_version(*spa)); + fatal(*spa, FTAG, "'%s' has version %d, features not enabled", + target, (int)spa_version(*spa)); } } @@ -336,15 +344,16 @@ zhack_do_feature_enable(int argc, char * feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not enable"); + fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) - fatal("feature already enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature already enabled: %s", + feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, feature_enable_sync, &feature, 5)); @@ -423,13 +432,14 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not change refcount"); + fatal(spa, FTAG, "'%s' is a real feature, will not change " + "refcount"); if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -438,11 +448,12 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid)) { feature.fi_can_readonly = B_TRUE; } else { - fatal("feature is not enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } if (decr && !spa_feature_is_active(spa, &feature)) - fatal("feature refcount already 0: %s", feature.fi_guid); + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); @@ -530,8 +541,8 @@ main(int argc, char **argv) usage(); } - if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) { - fatal("pool export failed; " + if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) { + fatal(NULL, FTAG, "pool export failed; " "changes may not be committed to disk\n"); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:54:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE3EFE6B; Wed, 20 Nov 2013 10:54:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB89E20B1; Wed, 20 Nov 2013 10:54:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAsBgt056262; Wed, 20 Nov 2013 10:54:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAsAvn056257; Wed, 20 Nov 2013 10:54:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201054.rAKAsAvn056257@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258374 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/... 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:54:12 -0000 Author: avg Date: Wed Nov 20 10:54:06 2013 New Revision: 258374 URL: http://svnweb.freebsd.org/changeset/base/258374 Log: 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features illumos/illumos-gate@2acef22db7808606888f8f92715629ff3ba555b9 Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.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/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.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 Nov 20 10:52:48 2013 (r258373) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Nov 20 10:54:06 2013 (r258374) @@ -563,16 +563,20 @@ get_metaslab_refcount(vdev_t *vd) static int verify_spacemap_refcounts(spa_t *spa) { - int expected_refcount, actual_refcount; + uint64_t expected_refcount = 0; + uint64_t actual_refcount; - expected_refcount = spa_feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM], + &expected_refcount); actual_refcount = get_dtl_refcount(spa->spa_root_vdev); actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); if (expected_refcount != actual_refcount) { - (void) printf("space map refcount mismatch: expected %d != " - "actual %d\n", expected_refcount, actual_refcount); + (void) printf("space map refcount mismatch: expected %lld != " + "actual %lld\n", + (longlong_t)expected_refcount, + (longlong_t)actual_refcount); return (2); } return (0); @@ -674,8 +678,7 @@ dump_metaslab(metaslab_t *msp) } if (dump_opt['m'] > 1 && sm != NULL && - spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { /* * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). @@ -2466,8 +2469,7 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) { VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, &zcb, NULL)); @@ -2793,7 +2795,7 @@ dump_zpool(spa_t *spa) } if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { dump_bptree(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, "Pool dataset frees"); Modified: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- vendor/illumos/dist/cmd/zhack/zhack.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor/illumos/dist/cmd/zhack/zhack.c Wed Nov 20 10:54:06 2013 (r258374) @@ -283,12 +283,13 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg, dmu_tx_t *tx) +zhack_feature_enable_sync(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; - spa_feature_enable(spa, feature, tx); + feature_enable_sync(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, "guid=%s can_readonly=%u", feature->fi_guid, feature->fi_can_readonly); @@ -302,7 +303,7 @@ zhack_do_feature_enable(int argc, char * spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * Features are not added to the pool's label until their refcounts @@ -349,14 +350,14 @@ zhack_do_feature_enable(int argc, char * zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) + if (zfeature_is_supported(feature.fi_guid)) fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) fatal(spa, FTAG, "feature already enabled: %s", feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, - feature_enable_sync, &feature, 5)); + zhack_feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -368,8 +369,10 @@ feature_incr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_incr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "guid=%s", feature->fi_guid); } @@ -379,8 +382,10 @@ feature_decr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_decr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "guid=%s", feature->fi_guid); } @@ -394,7 +399,7 @@ zhack_do_feature_ref(int argc, char **ar spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * fi_desc does not matter here because it was written to disk @@ -437,9 +442,10 @@ zhack_do_feature_ref(int argc, char **ar zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal(spa, FTAG, "'%s' is a real feature, will not change " - "refcount"); + if (zfeature_is_supported(feature.fi_guid)) { + fatal(spa, FTAG, + "'%s' is a real feature, will not change refcount"); + } if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -451,9 +457,14 @@ zhack_do_feature_ref(int argc, char **ar fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } - if (decr && !spa_feature_is_active(spa, &feature)) - fatal(spa, FTAG, "feature refcount already 0: %s", - feature.fi_guid); + if (decr) { + uint64_t count; + if (feature_get_refcount(spa, &feature, &count) == 0 && + count != 0) { + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); + } + } VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Wed Nov 20 10:54:06 2013 (r258374) @@ -22,7 +22,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. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. */ @@ -876,7 +876,7 @@ zpool_do_create(int argc, char **argv) * Hand off to libzfs. */ if (enable_all_pool_feat) { - int i; + spa_feature_t i; for (i = 0; i < SPA_FEATURES; i++) { char propname[MAXPATHLEN]; zfeature_info_t *feat = &spa_feature_table[i]; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Wed Nov 20 10:54:06 2013 (r258374) @@ -22,7 +22,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. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -413,10 +413,9 @@ zpool_valid_proplist(libzfs_handle_t *hd prop = zpool_name_to_prop(propname); if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { int err; - zfeature_info_t *feature; char *fname = strchr(propname, '@') + 1; - err = zfeature_lookup_name(fname, &feature); + err = zfeature_lookup_name(fname, NULL); if (err != 0) { ASSERT3U(err, ==, ENOENT); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -807,14 +806,14 @@ zpool_prop_get_feature(zpool_handle_t *z */ if (supported) { int ret; - zfeature_info_t *fi; + spa_feature_t fid; - ret = zfeature_lookup_name(feature, &fi); + ret = zfeature_lookup_name(feature, &fid); if (ret != 0) { (void) strlcpy(buf, "-", len); return (ENOTSUP); } - feature = fi->fi_guid; + feature = spa_feature_table[fid].fi_guid; } if (nvlist_lookup_uint64(features, feature, &refcount) == 0) Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Wed Nov 20 10:52:48 2013 (r258373) +++ vendor/illumos/dist/man/man5/zpool-features.5 Wed Nov 20 10:54:06 2013 (r258374) @@ -271,6 +271,29 @@ configuration. When the \fBmulti_vdev_crash_dump\fR feature is set to \fBenabled\fR, the administrator can use the \fBdumpadm\fR(1M) command to configure a dump device on a pool comprised of multiple vdevs. +.RE + +.sp +.ne 2 +.na +\fB\fBextensible_dataset\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:extensible_dataset +READ\-ONLY COMPATIBLE no +DEPENDENCIES none +.TE + +This feature allows more flexible use of internal ZFS data structures, +and exists for other features to depend on. + +This feature will be \fBactive\fR when the first dependent feature uses it, +and will be returned to the \fBenabled\fR state when all datasets that use +this feature are destroyed. + +.RE .SH "SEE ALSO" \fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0A07E6A; Wed, 20 Nov 2013 10:54:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADA4620AF; Wed, 20 Nov 2013 10:54:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAsAds056252; Wed, 20 Nov 2013 10:54:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAs63j056222; Wed, 20 Nov 2013 10:54:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201054.rAKAs63j056222@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258374 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/... 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:54:10 -0000 Author: avg Date: Wed Nov 20 10:54:06 2013 New Revision: 258374 URL: http://svnweb.freebsd.org/changeset/base/258374 Log: 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features illumos/illumos-gate@2acef22db7808606888f8f92715629ff3ba555b9 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.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/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.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 vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Wed Nov 20 10:54:06 2013 (r258374) @@ -92,32 +92,22 @@ zfeature_is_supported(const char *guid) if (zfeature_checks_disable) return (B_TRUE); - return (0 == zfeature_lookup_guid(guid, NULL)); -} - -int -zfeature_lookup_guid(const char *guid, zfeature_info_t **res) -{ - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; - if (strcmp(guid, feature->fi_guid) == 0) { - if (res != NULL) - *res = feature; - return (0); - } + if (strcmp(guid, feature->fi_guid) == 0) + return (B_TRUE); } - - return (ENOENT); + return (B_FALSE); } int -zfeature_lookup_name(const char *name, zfeature_info_t **res) +zfeature_lookup_name(const char *name, spa_feature_t *res) { - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; if (strcmp(name, feature->fi_uname) == 0) { if (res != NULL) - *res = feature; + *res = i; return (0); } } @@ -126,11 +116,12 @@ zfeature_lookup_name(const char *name, z } static void -zfeature_register(int fid, const char *guid, const char *name, const char *desc, - boolean_t readonly, boolean_t mos, zfeature_info_t **deps) +zfeature_register(spa_feature_t fid, const char *guid, const char *name, + const char *desc, boolean_t readonly, boolean_t mos, + const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; - static zfeature_info_t *nodeps[] = { NULL }; + static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; ASSERT(name != NULL); ASSERT(desc != NULL); @@ -141,6 +132,7 @@ zfeature_register(int fid, const char *g if (deps == NULL) deps = nodeps; + feature->fi_feature = fid; feature->fi_guid = guid; feature->fi_uname = name; feature->fi_desc = desc; @@ -167,4 +159,8 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET, + "com.delphix:extensible_dataset", "extensible_dataset", + "Enhanced dataset functionality, used by other features.", + B_FALSE, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Wed Nov 20 10:54:06 2013 (r258374) @@ -38,35 +38,38 @@ extern "C" { struct zfeature_info; +typedef enum spa_feature { + SPA_FEATURE_NONE = -1, + SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, + SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURES +} spa_feature_t; + typedef struct zfeature_info { + spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ const char *fi_guid; /* On-disk feature identifier */ const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ - struct zfeature_info **fi_depends; /* array; null terminated */ + /* array of dependencies, terminated by SPA_FEATURE_NONE */ + const spa_feature_t *fi_depends; } zfeature_info_t; typedef int (zfeature_func_t)(zfeature_info_t *fi, void *arg); #define ZFS_FEATURE_DEBUG -enum spa_feature { - SPA_FEATURE_ASYNC_DESTROY, - SPA_FEATURE_EMPTY_BPOBJ, - SPA_FEATURE_LZ4_COMPRESS, - SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, - SPA_FEATURE_SPACEMAP_HISTOGRAM, - SPA_FEATURES -} spa_feature_t; - extern zfeature_info_t spa_feature_table[SPA_FEATURES]; extern boolean_t zfeature_is_valid_guid(const char *); extern boolean_t zfeature_is_supported(const char *); -extern int zfeature_lookup_guid(const char *, zfeature_info_t **res); -extern int zfeature_lookup_name(const char *, zfeature_info_t **res); +extern int zfeature_lookup_name(const char *name, spa_feature_t *res); extern void zpool_feature_init(void); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Wed Nov 20 10:54:06 2013 (r258374) @@ -36,13 +36,11 @@ uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; spa_t *spa = dmu_objset_spa(os); dsl_pool_t *dp = dmu_objset_pool(os); - if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { - if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_EMPTY_BPOBJ)) { + if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) { ASSERT0(dp->dp_empty_bpobj); dp->dp_empty_bpobj = bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); @@ -51,7 +49,7 @@ bpobj_alloc_empty(objset_t *os, int bloc DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj, tx) == 0); } - spa_feature_incr(spa, empty_bpobj_feat, tx); + spa_feature_incr(spa, SPA_FEATURE_EMPTY_BPOBJ, tx); ASSERT(dp->dp_empty_bpobj != 0); return (dp->dp_empty_bpobj); } else { @@ -62,12 +60,11 @@ bpobj_alloc_empty(objset_t *os, int bloc void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; dsl_pool_t *dp = dmu_objset_pool(os); - spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); - if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + spa_feature_decr(dmu_objset_spa(os), SPA_FEATURE_EMPTY_BPOBJ, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), + SPA_FEATURE_EMPTY_BPOBJ)) { VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, tx)); @@ -265,6 +262,7 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i mutex_exit(&bpo->bpo_lock); return (err); } + ASSERT3U(doi.doi_type, ==, DMU_OT_BPOBJ_SUBOBJ); epb = doi.doi_data_block_size / sizeof (uint64_t); for (i = bpo->bpo_phys->bpo_num_subobjs - 1; i >= 0; i--) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Wed Nov 20 10:54:06 2013 (r258374) @@ -27,6 +27,8 @@ #include #include #include +#include +#include uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, @@ -195,3 +197,54 @@ dmu_object_next(objset_t *os, uint64_t * return (error); } + +/* + * Turn this object from old_type into DMU_OTN_ZAP_METADATA, and bump the + * refcount on SPA_FEATURE_EXTENSIBLE_DATASET. + * + * Only for use from syncing context, on MOS objects. + */ +void +dmu_object_zapify(objset_t *mos, uint64_t object, dmu_object_type_t old_type, + dmu_tx_t *tx) +{ + dnode_t *dn; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + if (dn->dn_type == DMU_OTN_ZAP_METADATA) { + dnode_rele(dn, FTAG); + return; + } + ASSERT3U(dn->dn_type, ==, old_type); + ASSERT0(dn->dn_maxblkid); + dn->dn_next_type[tx->tx_txg & TXG_MASK] = dn->dn_type = + DMU_OTN_ZAP_METADATA; + dnode_setdirty(dn, tx); + dnode_rele(dn, FTAG); + + mzap_create_impl(mos, object, 0, 0, tx); + + spa_feature_incr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); +} + +void +dmu_object_free_zapified(objset_t *mos, uint64_t object, dmu_tx_t *tx) +{ + dnode_t *dn; + dmu_object_type_t t; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + t = dn->dn_type; + dnode_rele(dn, FTAG); + + if (t == DMU_OTN_ZAP_METADATA) { + spa_feature_decr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); + } + VERIFY0(dmu_object_free(mos, object, tx)); +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Wed Nov 20 10:54:06 2013 (r258374) @@ -605,7 +605,7 @@ traverse_pool(spa_t *spa, uint64_t txg_s continue; } - if (doi.doi_type == DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) { dsl_dataset_t *ds; uint64_t txg = txg_start; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Wed Nov 20 10:54:06 2013 (r258374) @@ -21,7 +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 Delphix. All rights reserved. */ #include @@ -574,7 +574,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) BP_GET_LSIZE(&dnp->dn_blkptr[0]) == dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); - if (dn->dn_next_blksz[txgoff]) { + if (dn->dn_next_type[txgoff] != 0) { + dnp->dn_type = dn->dn_type; + dn->dn_next_type[txgoff] = 0; + } + + if (dn->dn_next_blksz[txgoff] != 0) { ASSERT(P2PHASE(dn->dn_next_blksz[txgoff], SPA_MINBLOCKSIZE) == 0); ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) || @@ -587,7 +592,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_blksz[txgoff] = 0; } - if (dn->dn_next_bonuslen[txgoff]) { + if (dn->dn_next_bonuslen[txgoff] != 0) { if (dn->dn_next_bonuslen[txgoff] == DN_ZERO_BONUSLEN) dnp->dn_bonuslen = 0; else @@ -596,7 +601,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_bonuslen[txgoff] = 0; } - if (dn->dn_next_bonustype[txgoff]) { + if (dn->dn_next_bonustype[txgoff] != 0) { ASSERT(DMU_OT_IS_VALID(dn->dn_next_bonustype[txgoff])); dnp->dn_bonustype = dn->dn_next_bonustype[txgoff]; dn->dn_next_bonustype[txgoff] = 0; @@ -614,7 +619,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_rm_spillblk[txgoff] = 0; } - if (dn->dn_next_indblkshift[txgoff]) { + if (dn->dn_next_indblkshift[txgoff] != 0) { ASSERT(dnp->dn_nlevels == 1); dnp->dn_indblkshift = dn->dn_next_indblkshift[txgoff]; dn->dn_next_indblkshift[txgoff] = 0; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Nov 20 10:54:06 2013 (r258374) @@ -352,7 +352,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type != DMU_OT_DSL_DATASET) { dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); } @@ -2972,3 +2972,11 @@ dsl_dataset_is_before(dsl_dataset_t *lat dsl_dataset_rele(origin, FTAG); return (ret); } + + +void +dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx) +{ + objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, ds->ds_object, DMU_OT_DSL_DATASET, tx); +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Wed Nov 20 10:54:06 2013 (r258374) @@ -38,6 +38,7 @@ #include #include #include +#include typedef struct dmu_snapshots_destroy_arg { nvlist_t *dsda_snaps; @@ -448,7 +449,7 @@ dsl_destroy_snapshot_sync_impl(dsl_datas VERIFY0(zap_destroy(mos, ds->ds_phys->ds_userrefs_obj, tx)); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); } static void @@ -671,7 +672,7 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu dd->dd_parent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, tx)); dsl_dir_rele(dd, FTAG); - VERIFY0(dmu_object_free(mos, ddobj, tx)); + dmu_object_free_zapified(mos, ddobj, tx); } void @@ -724,10 +725,6 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ds->ds_prev->ds_phys->ds_num_children--; } - zfeature_info_t *async_destroy = - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; - objset_t *os; - /* * Destroy the deadlist. Unless it's a clone, the * deadlist should be empty. (If it's a clone, it's @@ -738,9 +735,10 @@ dsl_destroy_head_sync_impl(dsl_dataset_t dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_deadlist_obj = 0; + objset_t *os; VERIFY0(dmu_objset_from_ds(ds, &os)); - if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { old_synchronous_dataset_destroy(ds, tx); } else { /* @@ -751,10 +749,11 @@ dsl_destroy_head_sync_impl(dsl_dataset_t zil_destroy_sync(dmu_objset_zil(os), tx); - if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_active(dp->dp_spa, + SPA_FEATURE_ASYNC_DESTROY)) { dsl_scan_t *scn = dp->dp_scan; - - spa_feature_incr(dp->dp_spa, async_destroy, tx); + spa_feature_incr(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY, + tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, @@ -814,7 +813,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT0(ds->ds_phys->ds_userrefs_obj); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); dsl_dir_destroy_sync(ddobj, tx); @@ -870,8 +869,7 @@ dsl_destroy_head(const char *name) error = spa_open(name, &spa, FTAG); if (error != 0) return (error); - isenabled = spa_feature_is_enabled(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + isenabled = spa_feature_is_enabled(spa, SPA_FEATURE_ASYNC_DESTROY); spa_close(spa, FTAG); ddha.ddha_name = name; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Wed Nov 20 10:54:06 2013 (r258374) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -88,7 +89,7 @@ dsl_dir_hold_obj(dsl_pool_t *dp, uint64_ { dmu_object_info_t doi; dmu_object_info_from_db(dbuf, &doi); - ASSERT3U(doi.doi_type, ==, DMU_OT_DSL_DIR); + ASSERT3U(doi.doi_bonus_type, ==, DMU_OT_DSL_DIR); ASSERT3U(doi.doi_bonus_size, >=, sizeof (dsl_dir_phys_t)); } #endif @@ -1352,3 +1353,10 @@ dsl_dir_snap_cmtime_update(dsl_dir_t *dd dd->dd_snap_cmtime = t; mutex_exit(&dd->dd_lock); } + +void +dsl_dir_zapify(dsl_dir_t *dd, dmu_tx_t *tx) +{ + objset_t *mos = dd->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, dd->dd_object, DMU_OT_DSL_DIR, tx); +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Wed Nov 20 10:54:06 2013 (r258374) @@ -250,8 +250,7 @@ dsl_pool_open(dsl_pool_t *dp) dp->dp_meta_objset, obj)); } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj); @@ -259,8 +258,7 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMPTY_BPOBJ)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Wed Nov 20 10:54:06 2013 (r258374) @@ -102,7 +102,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t t */ ASSERT(!scn->scn_async_destroying); scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + SPA_FEATURE_ASYNC_DESTROY); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, "scrub_func", sizeof (uint64_t), 1, &f); @@ -1353,7 +1353,6 @@ dsl_scan_active(dsl_scan_t *scn) return (B_FALSE); if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING || scn->scn_async_destroying) return (B_TRUE); @@ -1412,7 +1411,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY3U(0, ==, zio_wait(scn->scn_zio_root)); if (err == 0 && spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { ASSERT(scn->scn_async_destroying); scn->scn_is_bptree = B_TRUE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, @@ -1423,11 +1422,11 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY0(zio_wait(scn->scn_zio_root)); if (err == 0) { - zfeature_info_t *feat = &spa_feature_table - [SPA_FEATURE_ASYNC_DESTROY]; /* finished; deactivate async destroy feature */ - spa_feature_decr(spa, feat, tx); - ASSERT(!spa_feature_is_active(spa, feat)); + spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, + tx); + ASSERT(!spa_feature_is_active(spa, + SPA_FEATURE_ASYNC_DESTROY)); VERIFY0(zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, tx)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed Nov 20 10:54:06 2013 (r258374) @@ -2300,14 +2300,12 @@ spa_load_impl(spa_t *spa, uint64_t pool_ enabled_feat = fnvlist_alloc(); unsup_feat = fnvlist_alloc(); - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_FALSE, unsup_feat, enabled_feat)) missing_feat_read = B_TRUE; if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) { - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_TRUE, unsup_feat, enabled_feat)) { missing_feat_write = B_TRUE; } @@ -5914,7 +5912,7 @@ spa_sync_props(void *arg, dmu_tx_t *tx) zpool_prop_t prop; const char *propname; zprop_type_t proptype; - zfeature_info_t *feature; + spa_feature_t fid; switch (prop = zpool_name_to_prop(nvpair_name(elem))) { case ZPROP_INVAL: @@ -5924,9 +5922,9 @@ spa_sync_props(void *arg, dmu_tx_t *tx) ASSERT(zpool_prop_feature(nvpair_name(elem))); fname = strchr(nvpair_name(elem), '@') + 1; - VERIFY0(zfeature_lookup_name(fname, &feature)); + VERIFY0(zfeature_lookup_name(fname, &fid)); - spa_feature_enable(spa, feature, tx); + spa_feature_enable(spa, fid, tx); spa_history_log_internal(spa, "set", tx, "%s=enabled", nvpair_name(elem)); break; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Wed Nov 20 10:54:06 2013 (r258374) @@ -1143,15 +1143,17 @@ spa_vdev_state_exit(spa_t *spa, vdev_t * void spa_activate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_add_boolean(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (!nvlist_exists(spa->spa_label_features, feature)) { + fnvlist_add_boolean(spa->spa_label_features, feature); + vdev_config_dirty(spa->spa_root_vdev); + } } void spa_deactivate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_remove_all(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (nvlist_remove_all(spa->spa_label_features, feature) == 0) + vdev_config_dirty(spa->spa_root_vdev); } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Wed Nov 20 10:54:06 2013 (r258374) @@ -474,8 +474,6 @@ space_map_truncate(space_map_t *sm, dmu_ { objset_t *os = sm->sm_os; spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; dmu_object_info_t doi; int bonuslen; @@ -485,7 +483,7 @@ space_map_truncate(space_map_t *sm, dmu_ VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx)); dmu_object_info_from_db(sm->sm_dbuf, &doi); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -525,13 +523,11 @@ uint64_t space_map_alloc(objset_t *os, dmu_tx_t *tx) { spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; uint64_t object; int bonuslen; - if (spa_feature_is_enabled(spa, space_map_histogram)) { - spa_feature_incr(spa, space_map_histogram, tx); + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { + spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -549,20 +545,20 @@ void space_map_free(space_map_t *sm, dmu_tx_t *tx) { spa_t *spa; - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; if (sm == NULL) return; spa = dmu_objset_spa(sm->sm_os); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { dmu_object_info_t doi; dmu_object_info_from_db(sm->sm_dbuf, &doi); if (doi.doi_bonus_size != SPACE_MAP_SIZE_V0) { - VERIFY(spa_feature_is_active(spa, space_map_histogram)); - spa_feature_decr(spa, space_map_histogram, tx); + VERIFY(spa_feature_is_active(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM)); + spa_feature_decr(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); } } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h Wed Nov 20 10:54:06 2013 (r258374) @@ -298,6 +298,8 @@ typedef struct dmu_sendarg { uint64_t dsa_last_data_offset; } dmu_sendarg_t; +void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *); +void dmu_object_free_zapified(objset_t *, uint64_t, dmu_tx_t *); #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Wed Nov 20 10:54:06 2013 (r258374) @@ -178,6 +178,7 @@ typedef struct dnode { uint16_t dn_datablkszsec; /* in 512b sectors */ uint32_t dn_datablksz; /* in bytes */ uint64_t dn_maxblkid; + uint8_t dn_next_type[TXG_SIZE]; uint8_t dn_next_nblkptr[TXG_SIZE]; uint8_t dn_next_nlevels[TXG_SIZE]; uint8_t dn_next_indblkshift[TXG_SIZE]; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 20 10:54:06 2013 (r258374) @@ -49,9 +49,9 @@ struct dsl_pool; #define DS_FLAG_INCONSISTENT (1ULL<<0) #define DS_IS_INCONSISTENT(ds) \ ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT) + /* - * Note: nopromote can not yet be set, but we want support for it in this - * on-disk version, so that we don't need to upgrade for it later. + * Do not allow this dataset to be promoted. */ #define DS_FLAG_NOPROMOTE (1ULL<<1) @@ -71,6 +71,11 @@ struct dsl_pool; ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY) /* + * DS_FIELD_* are strings that are used in the "extensified" dataset zap object. + * They should be of the format :. + */ + +/* * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose * name lookups should be performed case-insensitively. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Wed Nov 20 10:54:06 2013 (r258374) @@ -141,6 +141,12 @@ uint64_t zap_create_link(objset_t *os, d uint64_t parent_obj, const char *name, dmu_tx_t *tx); /* + * Initialize an already-allocated object. + */ +void mzap_create_impl(objset_t *os, uint64_t obj, int normflags, + zap_flags_t flags, dmu_tx_t *tx); + +/* * Create a new zapobj with no attributes from the given (unallocated) * object number. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h Wed Nov 20 10:54:06 2013 (r258374) @@ -27,6 +27,7 @@ #define _SYS_ZFEATURE_H #include +#include #include "zfeature_common.h" #ifdef __cplusplus @@ -37,17 +38,25 @@ struct spa; struct dmu_tx; struct objset; -extern boolean_t feature_is_supported(struct objset *os, uint64_t obj, - uint64_t desc_obj, nvlist_t *unsup_feat, nvlist_t *enabled_feat); - extern void spa_feature_create_zap_objects(struct spa *, struct dmu_tx *); -extern void spa_feature_enable(struct spa *, zfeature_info_t *, +extern void spa_feature_enable(struct spa *, spa_feature_t, + struct dmu_tx *); +extern void spa_feature_incr(struct spa *, spa_feature_t, struct dmu_tx *); +extern void spa_feature_decr(struct spa *, spa_feature_t, struct dmu_tx *); +extern boolean_t spa_feature_is_enabled(struct spa *, spa_feature_t); +extern boolean_t spa_feature_is_active(struct spa *, spa_feature_t); +extern uint64_t spa_feature_refcount(spa_t *, spa_feature_t, uint64_t); +extern boolean_t spa_features_check(spa_t *, boolean_t, nvlist_t *, nvlist_t *); + +/* + * These functions are only exported for zhack and zdb; normal callers should + * use the above interfaces. + */ +extern int feature_get_refcount(struct spa *, zfeature_info_t *, uint64_t *); +extern void feature_enable_sync(struct spa *, zfeature_info_t *, + struct dmu_tx *); +extern void feature_sync(struct spa *, zfeature_info_t *, uint64_t, struct dmu_tx *); -extern void spa_feature_incr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern void spa_feature_decr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern boolean_t spa_feature_is_enabled(struct spa *, zfeature_info_t *); -extern boolean_t spa_feature_is_active(struct spa *, zfeature_info_t *); -extern int spa_feature_get_refcount(struct spa *, zfeature_info_t *); #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Wed Nov 20 10:54:06 2013 (r258374) @@ -572,7 +572,7 @@ mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, return (err); } -static void +void mzap_create_impl(objset_t *os, uint64_t obj, int normflags, zap_flags_t flags, dmu_tx_t *tx) { @@ -862,8 +862,8 @@ zap_lookup_uint64(objset_t *os, uint64_t int zap_contains(objset_t *os, uint64_t zapobj, const char *name) { - int err = (zap_lookup_norm(os, zapobj, name, 0, - 0, NULL, MT_EXACT, NULL, 0, NULL)); + int err = zap_lookup_norm(os, zapobj, name, 0, + 0, NULL, MT_EXACT, NULL, 0, NULL); if (err == EOVERFLOW || err == EINVAL) err = 0; /* found, but skipped reading the value */ return (err); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Wed Nov 20 10:52:48 2013 (r258373) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Wed Nov 20 10:54:06 2013 (r258374) @@ -161,23 +161,25 @@ */ typedef enum { - FEATURE_ACTION_ENABLE, FEATURE_ACTION_INCR, FEATURE_ACTION_DECR, } feature_action_t; /* - * Checks that the features active in the specified object are supported by + * Checks that the active features in the pool are supported by * this software. Adds each unsupported feature (name -> description) to * the supplied nvlist. */ boolean_t -feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj, +spa_features_check(spa_t *spa, boolean_t for_write, nvlist_t *unsup_feat, nvlist_t *enabled_feat) { + objset_t *os = spa->spa_meta_objset; boolean_t supported; zap_cursor_t zc; zap_attribute_t za; + uint64_t obj = for_write ? + spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; supported = B_TRUE; for (zap_cursor_init(&zc, os, obj); @@ -199,8 +201,8 @@ feature_is_supported(objset_t *os, uint6 char *desc = ""; char buf[MAXPATHLEN]; - if (zap_lookup(os, desc_obj, za.za_name, - 1, sizeof (buf), buf) == 0) + if (zap_lookup(os, spa->spa_feat_desc_obj, + za.za_name, 1, sizeof (buf), buf) == 0) desc = buf; VERIFY(nvlist_add_string(unsup_feat, za.za_name, @@ -213,13 +215,18 @@ feature_is_supported(objset_t *os, uint6 return (supported); } -static int -feature_get_refcount(objset_t *os, uint64_t read_obj, uint64_t write_obj, - zfeature_info_t *feature, uint64_t *res) +/* + * Note: well-designed features will not need to use this; they should + * use spa_feature_is_enabled() and spa_feature_is_active() instead. + * However, this is non-static for zdb and zhack. + */ +int +feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) { int err; uint64_t refcount; - uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj; + uint64_t zapobj = feature->fi_can_readonly ? + spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; /* * If the pool is currently being created, the feature objects may not @@ -228,8 +235,8 @@ feature_get_refcount(objset_t *os, uint6 if (zapobj == 0) return (SET_ERROR(ENOTSUP)); - err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1, - &refcount); + err = zap_lookup(spa->spa_meta_objset, zapobj, + feature->fi_guid, sizeof (uint64_t), 1, &refcount); if (err != 0) { if (err == ENOENT) return (SET_ERROR(ENOTSUP)); @@ -240,49 +247,81 @@ feature_get_refcount(objset_t *os, uint6 return (0); } -static int -feature_do_action(objset_t *os, uint64_t read_obj, uint64_t write_obj, - uint64_t desc_obj, zfeature_info_t *feature, feature_action_t action, +/* + * This function is non-static for zhack; it should otherwise not be used + * outside this file. + */ +void +feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount, dmu_tx_t *tx) { - int error; - uint64_t refcount; - uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj; + uint64_t zapobj = feature->fi_can_readonly ? + spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; + + VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid, + sizeof (uint64_t), 1, &refcount, tx)); + + if (refcount == 0) + spa_deactivate_mos_feature(spa, feature->fi_guid); + else if (feature->fi_mos) + spa_activate_mos_feature(spa, feature->fi_guid); +} + +/* + * This function is non-static for zhack; it should otherwise not be used + * outside this file. + */ +void +feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx) +{ + uint64_t zapobj = feature->fi_can_readonly ? + spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; ASSERT(0 != zapobj); ASSERT(zfeature_is_valid_guid(feature->fi_guid)); - - error = zap_lookup(os, zapobj, feature->fi_guid, - sizeof (uint64_t), 1, &refcount); + ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); /* - * If we can't ascertain the status of the specified feature, an I/O - * error occurred. + * If the feature is already enabled, ignore the request. */ - if (error != 0 && error != ENOENT) - return (error); + if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0) + return; + + for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) + spa_feature_enable(spa, feature->fi_depends[i], tx); + + VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj, + feature->fi_guid, 1, strlen(feature->fi_desc) + 1, + feature->fi_desc, tx)); + feature_sync(spa, feature, 0, tx); +} + +static void +feature_do_action(spa_t *spa, spa_feature_t fid, feature_action_t action, + dmu_tx_t *tx) +{ + uint64_t refcount; + zfeature_info_t *feature = &spa_feature_table[fid]; + uint64_t zapobj = feature->fi_can_readonly ? + spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; + + ASSERT3U(fid, <, SPA_FEATURES); + ASSERT(0 != zapobj); + ASSERT(zfeature_is_valid_guid(feature->fi_guid)); + + ASSERT(dmu_tx_is_syncing(tx)); + ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); + + VERIFY0(zap_lookup(spa->spa_meta_objset, zapobj, feature->fi_guid, + sizeof (uint64_t), 1, &refcount)); switch (action) { - case FEATURE_ACTION_ENABLE: - /* - * If the feature is already enabled, ignore the request. - */ - if (error == 0) - return (0); - refcount = 0; - break; case FEATURE_ACTION_INCR: - if (error == ENOENT) - return (SET_ERROR(ENOTSUP)); - if (refcount == UINT64_MAX) - return (SET_ERROR(EOVERFLOW)); + VERIFY3U(refcount, !=, UINT64_MAX); refcount++; break; case FEATURE_ACTION_DECR: - if (error == ENOENT) - return (SET_ERROR(ENOTSUP)); - if (refcount == 0) - return (SET_ERROR(EOVERFLOW)); + VERIFY3U(refcount, !=, 0); refcount--; break; default: @@ -290,42 +329,7 @@ feature_do_action(objset_t *os, uint64_t break; } - if (action == FEATURE_ACTION_ENABLE) { - int i; - - for (i = 0; feature->fi_depends[i] != NULL; i++) { - zfeature_info_t *dep = feature->fi_depends[i]; - - error = feature_do_action(os, read_obj, write_obj, - desc_obj, dep, FEATURE_ACTION_ENABLE, tx); - if (error != 0) - return (error); - } - } - - error = zap_update(os, zapobj, feature->fi_guid, - sizeof (uint64_t), 1, &refcount, tx); - if (error != 0) - return (error); - - if (action == FEATURE_ACTION_ENABLE) { - error = zap_update(os, desc_obj, - feature->fi_guid, 1, strlen(feature->fi_desc) + 1, - feature->fi_desc, tx); - if (error != 0) - return (error); - } - - if (action == FEATURE_ACTION_INCR && refcount == 1 && feature->fi_mos) { - spa_activate_mos_feature(dmu_objset_spa(os), feature->fi_guid); - } - - if (action == FEATURE_ACTION_DECR && refcount == 0) { - spa_deactivate_mos_feature(dmu_objset_spa(os), - feature->fi_guid); - } - - return (0); + feature_sync(spa, feature, refcount, tx); } void @@ -353,82 +357,51 @@ spa_feature_create_zap_objects(spa_t *sp * Enable any required dependencies, then enable the requested feature. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:57:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8D451C9; Wed, 20 Nov 2013 10:57:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 989CC20CF; Wed, 20 Nov 2013 10:57:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAvjQf056713; Wed, 20 Nov 2013 10:57:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAvjIX056712; Wed, 20 Nov 2013 10:57:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201057.rAKAvjIX056712@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258375 - vendor-sys/illumos/dist/uts/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:57:45 -0000 Author: avg Date: Wed Nov 20 10:57:45 2013 New Revision: 258375 URL: http://svnweb.freebsd.org/changeset/base/258375 Log: 4166 EOF pcata 4167 EOF pcser 2995 pcan and pcwl wifi device drivers EOL illumos/illumos-gate@506aa7c68b127eefb0197e329af7e9abcc3ebc98 Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:54:06 2013 (r258374) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 10:57:45 2013 (r258375) @@ -1724,14 +1724,6 @@ BUSRA_OBJS += busra.o PCS_OBJS += pcs.o -PCAN_OBJS += pcan.o - -PCATA_OBJS += pcide.o pcdisk.o pclabel.o pcata.o - -PCSER_OBJS += pcser.o pcser_cis.o - -PCWL_OBJS += pcwl.o - PSET_OBJS += pset.o OHCI_OBJS += ohci.o ohci_hub.o ohci_polled.o From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:58: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11C1A304; Wed, 20 Nov 2013 10:58:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAED620DC; Wed, 20 Nov 2013 10:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAwQd4056832; Wed, 20 Nov 2013 10:58:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAwQH7056828; Wed, 20 Nov 2013 10:58:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201058.rAKAwQH7056828@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258376 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:58:27 -0000 Author: avg Date: Wed Nov 20 10:58:25 2013 New Revision: 258376 URL: http://svnweb.freebsd.org/changeset/base/258376 Log: 3964 L2ARC should always compress metadata buffers illumos/illumos-gate@e4be62a2b74a8f09bb669217a1a39eee069b13a1 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Wed Nov 20 10:57:45 2013 (r258375) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Wed Nov 20 10:58:25 2013 (r258376) @@ -329,7 +329,8 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_ ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA))) #define DBUF_IS_L2COMPRESSIBLE(_db) \ - ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF) + ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF || \ + (dbuf_is_metadata(_db) && zfs_mdcomp_disable == B_FALSE)) #ifdef ZFS_DEBUG Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Wed Nov 20 10:57:45 2013 (r258375) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Wed Nov 20 10:58:25 2013 (r258376) @@ -24,6 +24,7 @@ * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2013 DEY Storage Systems, Inc. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -806,6 +807,8 @@ int dmu_diff(const char *tosnap_name, co #define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */ extern uint64_t zfs_crc64_table[256]; +extern int zfs_mdcomp_disable; + #ifdef __cplusplus } #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Wed Nov 20 10:57:45 2013 (r258375) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Wed Nov 20 10:58:25 2013 (r258376) @@ -130,7 +130,7 @@ struct objset { ((os)->os_secondary_cache == ZFS_CACHE_ALL || \ (os)->os_secondary_cache == ZFS_CACHE_METADATA) -#define DMU_OS_IS_L2COMPRESSIBLE(os) ((os)->os_compress != ZIO_COMPRESS_OFF) +#define DMU_OS_IS_L2COMPRESSIBLE(os) (zfs_mdcomp_disable == B_FALSE) /* called from zpl */ int dmu_objset_hold(const char *name, void *tag, objset_t **osp); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 10:59:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E5BF459; Wed, 20 Nov 2013 10:59:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E33A20EC; Wed, 20 Nov 2013 10:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKAxgv7056988; Wed, 20 Nov 2013 10:59:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKAxgxF056986; Wed, 20 Nov 2013 10:59:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201059.rAKAxgxF056986@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 10:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258377 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 10:59:42 -0000 Author: avg Date: Wed Nov 20 10:59:41 2013 New Revision: 258377 URL: http://svnweb.freebsd.org/changeset/base/258377 Log: 4088 use after free in arc_release() illumos/illumos-gate@ccc22e130479b5bd7c0002267fee1e0602d3f772 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Nov 20 10:58:25 2013 (r258376) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Nov 20 10:59:41 2013 (r258377) @@ -3332,6 +3332,7 @@ arc_release(arc_buf_t *buf, void *tag) if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); hdr->b_l2hdr = NULL; + list_remove(l2hdr->b_dev->l2ad_buflist, hdr); } buf_size = hdr->b_size; @@ -3415,7 +3416,6 @@ arc_release(arc_buf_t *buf, void *tag) if (l2hdr) { ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); - list_remove(l2hdr->b_dev->l2ad_buflist, hdr); kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -buf_size); mutex_exit(&l2arc_buflist_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:00:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20AC65D6; Wed, 20 Nov 2013 11:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 018522124; Wed, 20 Nov 2013 11:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB0Kdc057299; Wed, 20 Nov 2013 11:00:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB0KW3057298; Wed, 20 Nov 2013 11:00:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201100.rAKB0KW3057298@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258378 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:00:21 -0000 Author: avg Date: Wed Nov 20 11:00:20 2013 New Revision: 258378 URL: http://svnweb.freebsd.org/changeset/base/258378 Log: 4089 NULL pointer dereference in arc_read() illumos/illumos-gate@57815f6b95a743697e148327725b7f568e75e6ea Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Nov 20 10:59:41 2013 (r258377) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Wed Nov 20 11:00:20 2013 (r258378) @@ -20,10 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ /* @@ -2972,6 +2972,8 @@ top: vdev_t *vd = NULL; uint64_t addr = 0; boolean_t devw = B_FALSE; + enum zio_compress b_compress = ZIO_COMPRESS_OFF; + uint64_t b_asize = 0; if (hdr == NULL) { /* this block is not in the cache */ @@ -3041,10 +3043,12 @@ top: hdr->b_acb = acb; hdr->b_flags |= ARC_IO_IN_PROGRESS; - if (HDR_L2CACHE(hdr) && hdr->b_l2hdr != NULL && + if (hdr->b_l2hdr != NULL && (vd = hdr->b_l2hdr->b_dev->l2ad_vdev) != NULL) { devw = hdr->b_l2hdr->b_dev->l2ad_writing; addr = hdr->b_l2hdr->b_daddr; + b_compress = hdr->b_l2hdr->b_compress; + b_asize = hdr->b_l2hdr->b_asize; /* * Lock out device removal. */ @@ -3092,7 +3096,7 @@ top: cb->l2rcb_bp = *bp; cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; - cb->l2rcb_compress = hdr->b_l2hdr->b_compress; + cb->l2rcb_compress = b_compress; ASSERT(addr >= VDEV_LABEL_START_SIZE && addr + size < vd->vdev_psize - @@ -3104,8 +3108,7 @@ top: * Issue a null zio if the underlying buffer * was squashed to zero size by compression. */ - if (hdr->b_l2hdr->b_compress == - ZIO_COMPRESS_EMPTY) { + if (b_compress == ZIO_COMPRESS_EMPTY) { rzio = zio_null(pio, spa, vd, l2arc_read_done, cb, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -3114,8 +3117,8 @@ top: ZIO_FLAG_DONT_RETRY); } else { rzio = zio_read_phys(pio, vd, addr, - hdr->b_l2hdr->b_asize, - buf->b_data, ZIO_CHECKSUM_OFF, + b_asize, buf->b_data, + ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_CANFAIL | @@ -3124,8 +3127,7 @@ top: } DTRACE_PROBE2(l2arc__read, vdev_t *, vd, zio_t *, rzio); - ARCSTAT_INCR(arcstat_l2_read_bytes, - hdr->b_l2hdr->b_asize); + ARCSTAT_INCR(arcstat_l2_read_bytes, b_asize); if (*arc_flags & ARC_NOWAIT) { zio_nowait(rzio); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:02:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3E2729; Wed, 20 Nov 2013 11:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D81F213E; Wed, 20 Nov 2013 11:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB2JLI059649; Wed, 20 Nov 2013 11:02:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB2J9H059648; Wed, 20 Nov 2013 11:02:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201102.rAKB2J9H059648@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258379 - vendor-sys/illumos/dist/uts/common/dtrace vendor/illumos/dist/lib/libdtrace/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:02:19 -0000 Author: avg Date: Wed Nov 20 11:02:18 2013 New Revision: 258379 URL: http://svnweb.freebsd.org/changeset/base/258379 Log: 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included illumos/illumos-gate@54a20ab41aadcb81c53e72fc65886e964e9add59 Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libdtrace/common/dt_dof.c vendor/illumos/dist/lib/libdtrace/common/dt_error.c vendor/illumos/dist/lib/libdtrace/common/dt_impl.h Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Wed Nov 20 11:00:20 2013 (r258378) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Wed Nov 20 11:02:18 2013 (r258379) @@ -21,7 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -13941,8 +13941,8 @@ dtrace_helper_provider_add(dof_helper_t * Check to make sure this isn't a duplicate. */ for (i = 0; i < help->dthps_nprovs; i++) { - if (dofhp->dofhp_addr == - help->dthps_provs[i]->dthp_prov.dofhp_addr) + if (dofhp->dofhp_dof == + help->dthps_provs[i]->dthp_prov.dofhp_dof) return (EALREADY); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:02: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43CB672A; Wed, 20 Nov 2013 11:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31774213F; Wed, 20 Nov 2013 11:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB2Kew059663; Wed, 20 Nov 2013 11:02:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB2JW3059655; Wed, 20 Nov 2013 11:02:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201102.rAKB2JW3059655@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258379 - vendor-sys/illumos/dist/uts/common/dtrace vendor/illumos/dist/lib/libdtrace/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:02:20 -0000 Author: avg Date: Wed Nov 20 11:02:18 2013 New Revision: 258379 URL: http://svnweb.freebsd.org/changeset/base/258379 Log: 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included illumos/illumos-gate@54a20ab41aadcb81c53e72fc65886e964e9add59 Modified: vendor/illumos/dist/lib/libdtrace/common/dt_dof.c vendor/illumos/dist/lib/libdtrace/common/dt_error.c vendor/illumos/dist/lib/libdtrace/common/dt_impl.h Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Modified: vendor/illumos/dist/lib/libdtrace/common/dt_dof.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_dof.c Wed Nov 20 11:00:20 2013 (r258378) +++ vendor/illumos/dist/lib/libdtrace/common/dt_dof.c Wed Nov 20 11:02:18 2013 (r258379) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -482,7 +483,7 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident return (0); } -static void +static int dof_add_provider(dt_dof_t *ddo, const dt_provider_t *pvp) { dtrace_hdl_t *dtp = ddo->ddo_hdl; @@ -493,8 +494,12 @@ dof_add_provider(dt_dof_t *ddo, const dt size_t sz; id_t i; - if (pvp->pv_flags & DT_PROVIDER_IMPL) - return; /* ignore providers that are exported by dtrace(7D) */ + if (pvp->pv_flags & DT_PROVIDER_IMPL) { + /* + * ignore providers that are exported by dtrace(7D) + */ + return (0); + } nxr = dt_popcb(pvp->pv_xrefs, pvp->pv_xrmax); dofs = alloca(sizeof (dof_secidx_t) * (nxr + 1)); @@ -521,6 +526,9 @@ dof_add_provider(dt_dof_t *ddo, const dt (void) dt_idhash_iter(pvp->pv_probes, dof_add_probe, ddo); + if (dt_buf_len(&ddo->ddo_probes) == 0) + return (dt_set_errno(dtp, EDT_NOPROBES)); + dofpv.dofpv_probes = dof_add_lsect(ddo, NULL, DOF_SECT_PROBES, sizeof (uint64_t), 0, sizeof (dof_probe_t), dt_buf_len(&ddo->ddo_probes)); @@ -575,6 +583,8 @@ dof_add_provider(dt_dof_t *ddo, const dt sizeof (dof_secidx_t), 0, sizeof (dof_secidx_t), sizeof (dof_secidx_t) * (nxr + 1)); } + + return (0); } static int @@ -818,8 +828,10 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr */ if (flags & DTRACE_D_PROBES) { for (pvp = dt_list_next(&dtp->dt_provlist); - pvp != NULL; pvp = dt_list_next(pvp)) - dof_add_provider(ddo, pvp); + pvp != NULL; pvp = dt_list_next(pvp)) { + if (dof_add_provider(ddo, pvp) != 0) + return (NULL); + } } /* Modified: vendor/illumos/dist/lib/libdtrace/common/dt_error.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_error.c Wed Nov 20 11:00:20 2013 (r258378) +++ vendor/illumos/dist/lib/libdtrace/common/dt_error.c Wed Nov 20 11:02:18 2013 (r258379) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -108,7 +109,8 @@ static const struct { { EDT_BADSTACKPC, "Invalid stack program counter size" }, { EDT_BADAGGVAR, "Invalid aggregation variable identifier" }, { EDT_OVERSION, "Client requested deprecated version of library" }, - { EDT_ENABLING_ERR, "Failed to enable probe" } + { EDT_ENABLING_ERR, "Failed to enable probe" }, + { EDT_NOPROBES, "No probe sites found for declared provider" } }; static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]); Modified: vendor/illumos/dist/lib/libdtrace/common/dt_impl.h ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_impl.h Wed Nov 20 11:00:20 2013 (r258378) +++ vendor/illumos/dist/lib/libdtrace/common/dt_impl.h Wed Nov 20 11:02:18 2013 (r258379) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -512,7 +512,8 @@ enum { EDT_BADSTACKPC, /* invalid stack program counter size */ EDT_BADAGGVAR, /* invalid aggregation variable identifier */ EDT_OVERSION, /* client is requesting deprecated version */ - EDT_ENABLING_ERR /* failed to enable probe */ + EDT_ENABLING_ERR, /* failed to enable probe */ + EDT_NOPROBES /* no probes sites for declared provider */ }; /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:03:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC9C698B; Wed, 20 Nov 2013 11:03:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC18C214F; Wed, 20 Nov 2013 11:03:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB3Bik059824; Wed, 20 Nov 2013 11:03:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB3Boa059823; Wed, 20 Nov 2013 11:03:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201103.rAKB3Boa059823@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258380 - vendor-sys/illumos/dist/uts/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:03:11 -0000 Author: avg Date: Wed Nov 20 11:03:11 2013 New Revision: 258380 URL: http://svnweb.freebsd.org/changeset/base/258380 Log: 4236 Internet Packet Disturber 4237 net_* and hook_* man pages are wrong illumos/illumos-gate@fe77cc0407fb667ddc04e1a8f2e203bb7b9c80e1 Modified: vendor-sys/illumos/dist/uts/common/Makefile.files Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 11:02:18 2013 (r258379) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Nov 20 11:03:11 2013 (r258380) @@ -1751,6 +1751,8 @@ IPF_OBJS += ip_fil_solaris.o fil.o solar ip_proxy.o ip_auth.o ip_pool.o ip_htable.o ip_lookup.o \ ip_log.o misc.o ip_compat.o ip_nat6.o drand48.o +IPD_OBJS += ipd.o + IBD_OBJS += ibd.o ibd_cm.o EIBNX_OBJS += enx_main.o enx_hdlrs.o enx_ibt.o enx_log.o enx_fip.o \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:04:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DC15AE3; Wed, 20 Nov 2013 11:04:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6F9215B; Wed, 20 Nov 2013 11:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB4Fjl060031; Wed, 20 Nov 2013 11:04:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB4FE8060029; Wed, 20 Nov 2013 11:04:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201104.rAKB4FE8060029@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258381 - vendor/illumos/dist/lib/libdtrace/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:04:15 -0000 Author: avg Date: Wed Nov 20 11:04:14 2013 New Revision: 258381 URL: http://svnweb.freebsd.org/changeset/base/258381 Log: 4251 libdtrace leaks open file handles 4250 libdtrace should use "F" specifier on fopen() illumos/illumos-gate@93ed8d0d4b068b95d0bb50d57bb854df462a8485 Modified: vendor/illumos/dist/lib/libdtrace/common/dt_cc.c Modified: vendor/illumos/dist/lib/libdtrace/common/dt_cc.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_cc.c Wed Nov 20 11:03:11 2013 (r258380) +++ vendor/illumos/dist/lib/libdtrace/common/dt_cc.c Wed Nov 20 11:04:14 2013 (r258381) @@ -2149,7 +2149,7 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons (void) snprintf(fname, sizeof (fname), "%s/%s", path, dp->d_name); - if ((fp = fopen(fname, "r")) == NULL) { + if ((fp = fopen(fname, "rF")) == NULL) { dt_dprintf("skipping library %s: %s\n", fname, strerror(errno)); continue; @@ -2171,12 +2171,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons dt_dprintf("skipping library %s, already processed " "library with the same name: %s", dp->d_name, dld->dtld_library); + (void) fclose(fp); continue; } dtp->dt_filetag = fname; - if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) + if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2184,8 +2187,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || - dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) + dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:05: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A2C9C44; Wed, 20 Nov 2013 11:05:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A00A2169; Wed, 20 Nov 2013 11:05:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB57b4060208; Wed, 20 Nov 2013 11:05:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB57Zb060207; Wed, 20 Nov 2013 11:05:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201105.rAKB57Zb060207@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258382 - vendor/illumos/dist/lib/libzpool/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:05:08 -0000 Author: avg Date: Wed Nov 20 11:05:07 2013 New Revision: 258382 URL: http://svnweb.freebsd.org/changeset/base/258382 Log: 4161 deadlock between zfs_read() and zfs_putpage() illumos/illumos-gate@b3d32f0ceb59362ba287dcfd6de471e98bfc7fa9 Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Wed Nov 20 11:04:14 2013 (r258381) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Wed Nov 20 11:05:07 2013 (r258382) @@ -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, Joyent, Inc. All rights reserved. */ #include @@ -221,10 +222,10 @@ rw_enter(krwlock_t *rwlp, krw_t rw) ASSERT(rwlp->rw_owner != (void *)-1UL); ASSERT(rwlp->rw_owner != curthread); - if (rw == RW_READER) - VERIFY(rw_rdlock(&rwlp->rw_lock) == 0); - else + if (rw == RW_WRITER) VERIFY(rw_wrlock(&rwlp->rw_lock) == 0); + else + VERIFY(rw_rdlock(&rwlp->rw_lock) == 0); rwlp->rw_owner = curthread; } @@ -247,10 +248,10 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw) ASSERT(rwlp->initialized == B_TRUE); ASSERT(rwlp->rw_owner != (void *)-1UL); - if (rw == RW_READER) - rv = rw_tryrdlock(&rwlp->rw_lock); - else + if (rw == RW_WRITER) rv = rw_trywrlock(&rwlp->rw_lock); + else + rv = rw_tryrdlock(&rwlp->rw_lock); if (rv == 0) { rwlp->rw_owner = curthread; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:06:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26679D8B; Wed, 20 Nov 2013 11:06:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15D81217C; Wed, 20 Nov 2013 11:06:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB62PG060374; Wed, 20 Nov 2013 11:06:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB627j060368; Wed, 20 Nov 2013 11:06:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201106.rAKB627j060368@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258383 - in vendor-sys/illumos/dist/uts/common: fs 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:06:03 -0000 Author: avg Date: Wed Nov 20 11:06:02 2013 New Revision: 258383 URL: http://svnweb.freebsd.org/changeset/base/258383 Log: 3928 `tail -f ...` doesn't notice file truncation 3929 `man tail` doesn't mentioned "-F" option 3930 'tail -F ...' not resetting the offset of file rotation properly 3968 want FILE_TRUNC event for PORT_SOURCE_FILE illumos/illumos-gate@72102e7461c97dc268d21d9dd8f02da45f174acd Modified: vendor-sys/illumos/dist/uts/common/fs/vnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/sys/vnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/vnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/vnode.c Wed Nov 20 11:05:07 2013 (r258382) +++ vendor-sys/illumos/dist/uts/common/fs/vnode.c Wed Nov 20 11:06:02 2013 (r258383) @@ -21,6 +21,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -2582,6 +2583,15 @@ vnevent_mountedover(vnode_t *vp, caller_ (void) VOP_VNEVENT(vp, VE_MOUNTEDOVER, NULL, NULL, ct); } +void +vnevent_truncate(vnode_t *vp, caller_context_t *ct) +{ + if (vp == NULL || vp->v_femhead == NULL) { + return; + } + (void) VOP_VNEVENT(vp, VE_TRUNCATE, NULL, NULL, ct); +} + /* * Vnode accessors. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Wed Nov 20 11:05:07 2013 (r258382) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Wed Nov 20 11:06:02 2013 (r258383) @@ -2756,6 +2756,9 @@ top: ZFS_EXIT(zfsvfs); return (err); } + + if (vap->va_size == 0) + vnevent_truncate(ZTOV(zp), ct); } if (mask & (AT_ATIME|AT_MTIME) || @@ -4770,6 +4773,9 @@ zfs_space(vnode_t *vp, int cmd, flock64_ error = zfs_freesp(zp, off, len, flag, TRUE); + if (error == 0 && off == 0 && len == 0) + vnevent_truncate(ZTOV(zp), ct); + ZFS_EXIT(zfsvfs); return (error); } Modified: vendor-sys/illumos/dist/uts/common/sys/vnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/vnode.h Wed Nov 20 11:05:07 2013 (r258382) +++ vendor-sys/illumos/dist/uts/common/sys/vnode.h Wed Nov 20 11:06:02 2013 (r258383) @@ -21,6 +21,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -733,7 +734,8 @@ typedef enum vnevent { VE_CREATE = 5, /* Create with vnode's name which exists */ VE_LINK = 6, /* Link with vnode's name as source */ VE_RENAME_DEST_DIR = 7, /* Rename with vnode as target dir */ - VE_MOUNTEDOVER = 8 /* File or Filesystem got mounted over vnode */ + VE_MOUNTEDOVER = 8, /* File or Filesystem got mounted over vnode */ + VE_TRUNCATE = 9 /* Truncate */ } vnevent_t; /* @@ -1290,6 +1292,7 @@ void vnevent_create(vnode_t *, caller_co void vnevent_link(vnode_t *, caller_context_t *); void vnevent_rename_dest_dir(vnode_t *, caller_context_t *ct); void vnevent_mountedover(vnode_t *, caller_context_t *); +void vnevent_truncate(vnode_t *, caller_context_t *); int vnevent_support(vnode_t *, caller_context_t *); /* Vnode specific data */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:06: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18E72ED9; Wed, 20 Nov 2013 11:06:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED238218B; Wed, 20 Nov 2013 11:06:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB6w34060532; Wed, 20 Nov 2013 11:06:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB6vAI060519; Wed, 20 Nov 2013 11:06:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201106.rAKB6vAI060519@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258384 - in vendor/illumos/dist: cmd/zfs lib/libzfs/common 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:06:59 -0000 Author: avg Date: Wed Nov 20 11:06:57 2013 New Revision: 258384 URL: http://svnweb.freebsd.org/changeset/base/258384 Log: 2583 Add -p (parsable) option to zfs list illumos/illumos-gate@43d68d68c1ce08fb35026bebfb141af422e7082e Modified: vendor/illumos/dist/cmd/zfs/zfs_iter.c vendor/illumos/dist/cmd/zfs/zfs_iter.h vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/cmd/zfs/zfs_iter.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_iter.c Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/cmd/zfs/zfs_iter.c Wed Nov 20 11:06:57 2013 (r258384) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -107,7 +109,8 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_props_table); if (zfs_expand_proplist(zhp, cb->cb_proplist, - (cb->cb_flags & ZFS_ITER_RECVD_PROPS)) + (cb->cb_flags & ZFS_ITER_RECVD_PROPS), + (cb->cb_flags & ZFS_ITER_LITERAL_PROPS)) != 0) { free(node); return (-1); Modified: vendor/illumos/dist/cmd/zfs/zfs_iter.h ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_iter.h Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/cmd/zfs/zfs_iter.h Wed Nov 20 11:06:57 2013 (r258384) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef ZFS_ITER_H @@ -43,6 +45,7 @@ typedef struct zfs_sort_column { #define ZFS_ITER_PROP_LISTSNAPS (1 << 2) #define ZFS_ITER_DEPTH_LIMIT (1 << 3) #define ZFS_ITER_RECVD_PROPS (1 << 4) +#define ZFS_ITER_LITERAL_PROPS (1 << 5) int zfs_for_each(int, char **, int options, zfs_type_t, zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *); Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Nov 20 11:06:57 2013 (r258384) @@ -21,11 +21,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -232,9 +232,8 @@ get_usage(zfs_help_t idx) return (gettext("\tupgrade [-v]\n" "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); case HELP_LIST: - return (gettext("\tlist [-rH][-d max] " - "[-o property[,...]] [-t type[,...]] [-s property] ...\n" - "\t [-S property] ... " + return (gettext("\tlist [-Hp] [-r|-d max] [-o property[,...]] " + "[-s property]...\n\t [-S property]... [-t type[,...]] " "[filesystem|volume|snapshot] ...\n")); case HELP_MOUNT: return (gettext("\tmount\n" @@ -291,12 +290,12 @@ get_usage(zfs_help_t idx) "\n")); case HELP_USERSPACE: return (gettext("\tuserspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -2104,7 +2103,7 @@ zfs_do_upgrade(int argc, char **argv) * -i Translate SID to POSIX ID. * -n Print numeric ID instead of user/group name. * -o Control which fields to display. - * -p Use exact (parseable) numeric output. + * -p Use exact (parsable) numeric output. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. * -t Control which object types to display. @@ -2782,24 +2781,25 @@ zfs_do_userspace(int argc, char **argv) } /* - * list [-r][-d max] [-H] [-o property[,property]...] [-t type[,type]...] - * [-s property [-s property]...] [-S property [-S property]...] - * ... + * list [-Hp][-r|-d max] [-o property[,...]] [-s property] ... [-S property] ... + * [-t type[,...]] [filesystem|volume|snapshot] ... * - * -r Recurse over all children + * -H Scripted mode; elide headers and separate columns by tabs. + * -p Display values in parsable (literal) format. + * -r Recurse over all children. * -d Limit recursion by depth. - * -H Scripted mode; elide headers and separate columns by tabs * -o Control which fields to display. - * -t Control which object types to display. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. + * -t Control which object types to display. * - * When given no arguments, lists all filesystems in the system. + * When given no arguments, list all filesystems in the system. * Otherwise, list the specified datasets, optionally recursing down them if * '-r' is specified. */ typedef struct list_cbdata { boolean_t cb_first; + boolean_t cb_literal; boolean_t cb_scripted; zprop_list_t *cb_proplist; } list_cbdata_t; @@ -2808,8 +2808,9 @@ typedef struct list_cbdata { * Given a list of columns to display, output appropriate headers for each one. */ static void -print_header(zprop_list_t *pl) +print_header(list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; char headerbuf[ZFS_MAXPROPLEN]; const char *header; int i; @@ -2850,19 +2851,19 @@ print_header(zprop_list_t *pl) * to the described layout. */ static void -print_dataset(zfs_handle_t *zhp, zprop_list_t *pl, boolean_t scripted) +print_dataset(zfs_handle_t *zhp, list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; boolean_t first = B_TRUE; char property[ZFS_MAXPROPLEN]; nvlist_t *userprops = zfs_get_user_props(zhp); nvlist_t *propval; char *propstr; boolean_t right_justify; - int width; for (; pl != NULL; pl = pl->pl_next) { if (!first) { - if (scripted) + if (cb->cb_scripted) (void) printf("\t"); else (void) printf(" "); @@ -2872,22 +2873,22 @@ print_dataset(zfs_handle_t *zhp, zprop_l if (pl->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, pl->pl_prop, property, - sizeof (property), NULL, NULL, 0, B_FALSE) != 0) + sizeof (property), NULL, NULL, 0, + cb->cb_literal) != 0) propstr = "-"; else propstr = property; - right_justify = zfs_prop_align_right(pl->pl_prop); } else if (zfs_prop_userquota(pl->pl_user_prop)) { if (zfs_prop_get_userquota(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; right_justify = B_TRUE; } else if (zfs_prop_written(pl->pl_user_prop)) { if (zfs_prop_get_written(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; @@ -2902,19 +2903,17 @@ print_dataset(zfs_handle_t *zhp, zprop_l right_justify = B_FALSE; } - width = pl->pl_width; - /* * If this is being called in scripted mode, or if this is the * last column and it is left-justified, don't include a width * format specifier. */ - if (scripted || (pl->pl_next == NULL && !right_justify)) + if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify)) (void) printf("%s", propstr); else if (right_justify) - (void) printf("%*s", width, propstr); + (void) printf("%*s", pl->pl_width, propstr); else - (void) printf("%-*s", width, propstr); + (void) printf("%-*s", pl->pl_width, propstr); } (void) printf("\n"); @@ -2930,11 +2929,11 @@ list_callback(zfs_handle_t *zhp, void *d if (cbp->cb_first) { if (!cbp->cb_scripted) - print_header(cbp->cb_proplist); + print_header(cbp); cbp->cb_first = B_FALSE; } - print_dataset(zhp, cbp->cb_proplist, cbp->cb_scripted); + print_dataset(zhp, cbp); return (0); } @@ -2943,7 +2942,6 @@ static int zfs_do_list(int argc, char **argv) { int c; - boolean_t scripted = B_FALSE; static char default_fields[] = "name,used,available,referenced,mountpoint"; int types = ZFS_TYPE_DATASET; @@ -2957,11 +2955,15 @@ zfs_do_list(int argc, char **argv) int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ - while ((c = getopt(argc, argv, ":d:o:rt:Hs:S:")) != -1) { + while ((c = getopt(argc, argv, "HS:d:o:prs:t:")) != -1) { switch (c) { case 'o': fields = optarg; break; + case 'p': + cb.cb_literal = B_TRUE; + flags |= ZFS_ITER_LITERAL_PROPS; + break; case 'd': limit = parse_depth(optarg, &flags); break; @@ -2969,7 +2971,7 @@ zfs_do_list(int argc, char **argv) flags |= ZFS_ITER_RECURSE; break; case 'H': - scripted = B_TRUE; + cb.cb_scripted = B_TRUE; break; case 's': if (zfs_add_sort_column(&sortcol, optarg, @@ -3051,7 +3053,6 @@ zfs_do_list(int argc, char **argv) != 0) usage(B_FALSE); - cb.cb_scripted = scripted; cb.cb_first = B_TRUE; ret = zfs_for_each(argc, argv, flags, types, sortcol, &cb.cb_proplist, Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Wed Nov 20 11:06:57 2013 (r258384) @@ -21,10 +21,10 @@ /* * 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) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef _LIBZFS_H @@ -458,7 +458,8 @@ typedef struct zprop_list { boolean_t pl_fixed; } zprop_list_t; -extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t); +extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t, + boolean_t); extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *); #define ZFS_MOUNTPOINT_NONE "none" Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Nov 20 11:06:57 2013 (r258384) @@ -23,9 +23,9 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -3798,7 +3798,8 @@ zfs_get_recvd_props(zfs_handle_t *zhp) * of the RECEIVED column. */ int -zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received) +zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received, + boolean_t literal) { libzfs_handle_t *hdl = zhp->zfs_hdl; zprop_list_t *entry; @@ -3860,18 +3861,18 @@ zfs_expand_proplist(zfs_handle_t *zhp, z * Now go through and check the width of any non-fixed columns */ for (entry = *plp; entry != NULL; entry = entry->pl_next) { - if (entry->pl_fixed) + if (entry->pl_fixed && !literal) continue; if (entry->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, entry->pl_prop, - buf, sizeof (buf), NULL, NULL, 0, B_FALSE) == 0) { + buf, sizeof (buf), NULL, NULL, 0, literal) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } if (received && zfs_prop_get_recvd(zhp, zfs_prop_to_name(entry->pl_prop), - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } else { @@ -3884,7 +3885,7 @@ zfs_expand_proplist(zfs_handle_t *zhp, z } if (received && zfs_prop_get_recvd(zhp, entry->pl_user_prop, - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Wed Nov 20 11:06:02 2013 (r258383) +++ vendor/illumos/dist/man/man1m/zfs.1m Wed Nov 20 11:06:57 2013 (r258384) @@ -27,7 +27,7 @@ .\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" -.TH ZFS 1M "Jan 26, 2013" +.TH ZFS 1M "Oct 16, 2013" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -95,7 +95,7 @@ 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[,\fIproperty\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] +\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\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 @@ -248,7 +248,6 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR .SH DESCRIPTION -.sp .LP The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path @@ -306,7 +305,6 @@ specified as \fIfilesystem@name\fR or \f .RE .SS "ZFS File System Hierarchy" -.sp .LP A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system @@ -320,7 +318,6 @@ characteristics, however, are managed by .LP See \fBzpool\fR(1M) for more information on creating and administering pools. .SS "Snapshots" -.sp .LP A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the @@ -337,7 +334,6 @@ in the root of the file system. Snapshot and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR directory can be controlled by the \fBsnapdir\fR property. .SS "Clones" -.sp .LP A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly @@ -357,7 +353,6 @@ The clone parent-child dependency relati clone of the specified file system, which makes it possible to destroy the file system that the clone was created from. .SS "Mount Points" -.sp .LP Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system is likely to be numerous. To cope with this, \fBZFS\fR @@ -390,7 +385,6 @@ is set to \fBlegacy\fR, \fBZFS\fR makes and the administrator is responsible for mounting and unmounting the file system. .SS "Zones" -.sp .LP A \fBZFS\fR file system can be added to a non-global zone by using the \fBzonecfg\fR \fBadd fs\fR subcommand. A \fBZFS\fR file system that is added to @@ -428,7 +422,6 @@ The global administrator can forcibly cl this should be done with extreme care. The global administrator should verify that all the mount points are acceptable before clearing the property. .SS "Native Properties" -.sp .LP Properties are divided into two types, native properties and user-defined (or "user") properties. Native properties either export internal statistics or @@ -1536,7 +1529,6 @@ The \fBcasesensitivity\fR, \fBnormalizat are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration feature. .SS "Temporary Mount Point Properties" -.sp .LP When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the \fBzfs mount\fR command for normal file systems, its mount options are @@ -1565,7 +1557,6 @@ are reported as "temporary" by the \fBzf changed while the dataset is mounted, the new setting overrides any temporary settings. .SS "User Properties" -.sp .LP In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but @@ -1598,7 +1589,6 @@ to clear a user property . If the proper dataset, it is removed entirely. Property values are limited to 1024 characters. .SS "ZFS Volumes as Swap or Dump Devices" -.sp .LP During an initial installation a swap device and dump device are created on \fBZFS\fR volumes in the \fBZFS\fR root pool. By default, the swap area size is @@ -1614,7 +1604,6 @@ installed or upgraded, use the \fBswap\f If you need to change the size of your swap area or dump device, see the \fISolaris ZFS Administration Guide\fR. .SH SUBCOMMANDS -.sp .LP All subcommands that modify state are logged persistently to the pool in their original form. @@ -2117,7 +2106,7 @@ only dataset that can be renamed recursi .sp .ne 2 .na -\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-H\fR] [\fB-o\fR +\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\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]...\fR @@ -2144,6 +2133,16 @@ tab instead of arbitrary white space. .sp .ne 2 .na +\fB\fB-p\fR\fR +.ad +.sp .6 +.RS 4n +Display numbers in parsable (exact) values. +.RE + +.sp +.ne 2 +.na \fB\fB-r\fR\fR .ad .sp .6 @@ -2380,7 +2379,7 @@ is all sources. .ad .sp .6 .RS 4n -Display numbers in parseable (exact) values. +Display numbers in parsable (exact) values. .RE .RE @@ -3392,7 +3391,7 @@ F Regular file .ad .sp .6 .RS 4n -Give more parseable tab-separated output, without header lines and without arrows. +Give more parsable tab-separated output, without header lines and without arrows. .RE .sp .ne 2 @@ -3953,7 +3952,6 @@ M F /tank/test/modified .sp .SH EXIT STATUS -.sp .LP The following exit values are returned: .sp @@ -3987,7 +3985,6 @@ Invalid command line options were specif .RE .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -4003,7 +4000,6 @@ Interface Stability Committed .TE .SH SEE ALSO -.sp .LP \fBssh\fR(1), \fBiscsitadm\fR(1M), \fBmount\fR(1M), \fBshare\fR(1M), \fBsharemgr\fR(1M), \fBunshare\fR(1M), \fBzonecfg\fR(1M), \fBzpool\fR(1M), From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:08:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24F0D98; Wed, 20 Nov 2013 11:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04ED62198; Wed, 20 Nov 2013 11:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB87EI060753; Wed, 20 Nov 2013 11:08:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB87gf060750; Wed, 20 Nov 2013 11:08:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201108.rAKB87gf060750@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258385 - in 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:08:08 -0000 Author: avg Date: Wed Nov 20 11:08:07 2013 New Revision: 258385 URL: http://svnweb.freebsd.org/changeset/base/258385 Log: 4128 disks in zpools never go away when pulled illumos/illumos-gate@39cddb10a31c1c2e66aed69e6871d09caa4c8147 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h Wed Nov 20 11:06:57 2013 (r258384) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h Wed Nov 20 11:08:07 2013 (r258385) @@ -22,6 +22,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2013 Joyent, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_VDEV_DISK_H @@ -44,6 +45,8 @@ typedef struct vdev_disk { ddi_devid_t vd_devid; char *vd_minor; ldi_handle_t vd_lh; + list_t vd_ldi_cbs; + boolean_t vd_ldi_offline; } vdev_disk_t; #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Wed Nov 20 11:06:57 2013 (r258384) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Wed Nov 20 11:08:07 2013 (r258385) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - * Copyright 2013 Joyent, Inc. All rights reserved. + * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ #include @@ -42,6 +42,146 @@ extern ldi_ident_t zfs_li; +static void vdev_disk_close(vdev_t *); + +typedef struct vdev_disk_ldi_cb { + list_node_t lcb_next; + ldi_callback_id_t lcb_id; +} vdev_disk_ldi_cb_t; + +static void +vdev_disk_alloc(vdev_t *vd) +{ + vdev_disk_t *dvd; + + dvd = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP); + /* + * Create the LDI event callback list. + */ + list_create(&dvd->vd_ldi_cbs, sizeof (vdev_disk_ldi_cb_t), + offsetof(vdev_disk_ldi_cb_t, lcb_next)); +} + +static void +vdev_disk_free(vdev_t *vd) +{ + vdev_disk_t *dvd = vd->vdev_tsd; + vdev_disk_ldi_cb_t *lcb; + + if (dvd == NULL) + return; + + /* + * We have already closed the LDI handle. Clean up the LDI event + * callbacks and free vd->vdev_tsd. + */ + while ((lcb = list_head(&dvd->vd_ldi_cbs)) != NULL) { + list_remove(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_remove_callbacks(lcb->lcb_id); + kmem_free(lcb, sizeof (vdev_disk_ldi_cb_t)); + } + list_destroy(&dvd->vd_ldi_cbs); + kmem_free(dvd, sizeof (vdev_disk_t)); + vd->vdev_tsd = NULL; +} + +/* ARGSUSED */ +static int +vdev_disk_off_notify(ldi_handle_t lh, ldi_ev_cookie_t ecookie, void *arg, + void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + vdev_disk_t *dvd = vd->vdev_tsd; + + /* + * Ignore events other than offline. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_OFFLINE) != 0) + return (LDI_EV_SUCCESS); + + /* + * All LDI handles must be closed for the state change to succeed, so + * call on vdev_disk_close() to do this. + * + * We inform vdev_disk_close that it is being called from offline + * notify context so it will defer cleanup of LDI event callbacks and + * freeing of vd->vdev_tsd to the offline finalize or a reopen. + */ + dvd->vd_ldi_offline = B_TRUE; + vdev_disk_close(vd); + + /* + * Now that the device is closed, request that the spa_async_thread + * mark the device as REMOVED and notify FMA of the removal. + */ + zfs_post_remove(vd->vdev_spa, vd); + vd->vdev_remove_wanted = B_TRUE; + spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE); + + return (LDI_EV_SUCCESS); +} + +/* ARGSUSED */ +static void +vdev_disk_off_finalize(ldi_handle_t lh, ldi_ev_cookie_t ecookie, + int ldi_result, void *arg, void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + + /* + * Ignore events other than offline. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_OFFLINE) != 0) + return; + + /* + * We have already closed the LDI handle in notify. + * Clean up the LDI event callbacks and free vd->vdev_tsd. + */ + vdev_disk_free(vd); + + /* + * Request that the vdev be reopened if the offline state change was + * unsuccessful. + */ + if (ldi_result != LDI_EV_SUCCESS) { + vd->vdev_probe_wanted = B_TRUE; + spa_async_request(vd->vdev_spa, SPA_ASYNC_PROBE); + } +} + +static ldi_ev_callback_t vdev_disk_off_callb = { + .cb_vers = LDI_EV_CB_VERS, + .cb_notify = vdev_disk_off_notify, + .cb_finalize = vdev_disk_off_finalize +}; + +/* ARGSUSED */ +static void +vdev_disk_dgrd_finalize(ldi_handle_t lh, ldi_ev_cookie_t ecookie, + int ldi_result, void *arg, void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + + /* + * Ignore events other than degrade. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_DEGRADE) != 0) + return; + + /* + * Degrade events always succeed. Mark the vdev as degraded. + * This status is purely informative for the user. + */ + (void) vdev_degrade(vd->vdev_spa, vd->vdev_guid, 0); +} + +static ldi_ev_callback_t vdev_disk_dgrd_callb = { + .cb_vers = LDI_EV_CB_VERS, + .cb_notify = NULL, + .cb_finalize = vdev_disk_dgrd_finalize +}; + static void vdev_disk_hold(vdev_t *vd) { @@ -146,7 +286,9 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi uint64_t *ashift) { spa_t *spa = vd->vdev_spa; - vdev_disk_t *dvd; + vdev_disk_t *dvd = vd->vdev_tsd; + ldi_ev_cookie_t ecookie; + vdev_disk_ldi_cb_t *lcb; union { struct dk_minfo_ext ude; struct dk_minfo ud; @@ -172,13 +314,25 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi * Reopen the device if it's not currently open. Otherwise, * just update the physical size of the device. */ - if (vd->vdev_tsd != NULL) { - ASSERT(vd->vdev_reopening); - dvd = vd->vdev_tsd; - goto skip_open; + if (dvd != NULL) { + if (dvd->vd_ldi_offline && dvd->vd_lh == NULL) { + /* + * If we are opening a device in its offline notify + * context, the LDI handle was just closed. Clean + * up the LDI event callbacks and free vd->vdev_tsd. + */ + vdev_disk_free(vd); + } else { + ASSERT(vd->vdev_reopening); + goto skip_open; + } } - dvd = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP); + /* + * Create vd->vdev_tsd. + */ + vdev_disk_alloc(vd); + dvd = vd->vdev_tsd; /* * When opening a disk device, we want to preserve the user's original @@ -211,23 +365,28 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi if (vd->vdev_wholedisk == -1ULL) { size_t len = strlen(vd->vdev_path) + 3; char *buf = kmem_alloc(len, KM_SLEEP); - ldi_handle_t lh; (void) snprintf(buf, len, "%ss0", vd->vdev_path); - if (ldi_open_by_name(buf, spa_mode(spa), kcred, - &lh, zfs_li) == 0) { + error = ldi_open_by_name(buf, spa_mode(spa), kcred, + &dvd->vd_lh, zfs_li); + if (error == 0) { spa_strfree(vd->vdev_path); vd->vdev_path = buf; vd->vdev_wholedisk = 1ULL; - (void) ldi_close(lh, spa_mode(spa), kcred); } else { kmem_free(buf, len); } } - error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), kcred, - &dvd->vd_lh, zfs_li); + /* + * If we have not yet opened the device, try to open it by the + * specified path. + */ + if (error != 0) { + error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), + kcred, &dvd->vd_lh, zfs_li); + } /* * Compare the devid to the stored value. @@ -334,6 +493,27 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi kmem_free(physpath, MAXPATHLEN); } + /* + * Register callbacks for the LDI offline event. + */ + if (ldi_ev_get_cookie(dvd->vd_lh, LDI_EV_OFFLINE, &ecookie) == + LDI_EV_SUCCESS) { + lcb = kmem_zalloc(sizeof (vdev_disk_ldi_cb_t), KM_SLEEP); + list_insert_tail(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_register_callbacks(dvd->vd_lh, ecookie, + &vdev_disk_off_callb, (void *) vd, &lcb->lcb_id); + } + + /* + * Register callbacks for the LDI degrade event. + */ + if (ldi_ev_get_cookie(dvd->vd_lh, LDI_EV_DEGRADE, &ecookie) == + LDI_EV_SUCCESS) { + lcb = kmem_zalloc(sizeof (vdev_disk_ldi_cb_t), KM_SLEEP); + list_insert_tail(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_register_callbacks(dvd->vd_lh, ecookie, + &vdev_disk_dgrd_callb, (void *) vd, &lcb->lcb_id); + } skip_open: /* * Determine the actual size of the device. @@ -412,18 +592,31 @@ vdev_disk_close(vdev_t *vd) if (vd->vdev_reopening || dvd == NULL) return; - if (dvd->vd_minor != NULL) + if (dvd->vd_minor != NULL) { ddi_devid_str_free(dvd->vd_minor); + dvd->vd_minor = NULL; + } - if (dvd->vd_devid != NULL) + if (dvd->vd_devid != NULL) { ddi_devid_free(dvd->vd_devid); + dvd->vd_devid = NULL; + } - if (dvd->vd_lh != NULL) + if (dvd->vd_lh != NULL) { (void) ldi_close(dvd->vd_lh, spa_mode(vd->vdev_spa), kcred); + dvd->vd_lh = NULL; + } vd->vdev_delayed_close = B_FALSE; - kmem_free(dvd, sizeof (vdev_disk_t)); - vd->vdev_tsd = NULL; + /* + * If we closed the LDI handle due to an offline notify from LDI, + * don't free vd->vdev_tsd or unregister the callbacks here; + * the offline finalize callback or a reopen will take care of it. + */ + if (dvd->vd_ldi_offline) + return; + + vdev_disk_free(vd); } int @@ -432,6 +625,13 @@ vdev_disk_physio(vdev_t *vd, caddr_t dat { vdev_disk_t *dvd = vd->vdev_tsd; + /* + * If the vdev is closed, it's likely in the REMOVED or FAULTED state. + * Nothing to be done here but return failure. + */ + if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) + return (EIO); + ASSERT(vd->vdev_ops == &vdev_disk_ops); /* @@ -527,6 +727,15 @@ vdev_disk_io_start(zio_t *zio) buf_t *bp; int error; + /* + * If the vdev is closed, it's likely in the REMOVED or FAULTED state. + * Nothing to be done here but return failure. + */ + if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */ if (!vdev_readable(vd)) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:09: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32A051EA; Wed, 20 Nov 2013 11:09:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 224B521A7; Wed, 20 Nov 2013 11:09:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKB9DUp060934; Wed, 20 Nov 2013 11:09:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKB9CEu060933; Wed, 20 Nov 2013 11:09:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201109.rAKB9CEu060933@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258386 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:09:13 -0000 Author: avg Date: Wed Nov 20 11:09:12 2013 New Revision: 258386 URL: http://svnweb.freebsd.org/changeset/base/258386 Log: 4322 ZFS deadlock on dp_config_rwlock illumos/illumos-gate@c50d56f667f119d78fa3d94d6bef2c298ba556f6 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c Wed Nov 20 11:08:07 2013 (r258385) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c Wed Nov 20 11:09:12 2013 (r258386) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:10: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95F0D3D1; Wed, 20 Nov 2013 11:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 763A721C3; Wed, 20 Nov 2013 11:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKBAOqL061216; Wed, 20 Nov 2013 11:10:24 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKBAOMY061212; Wed, 20 Nov 2013 11:10:24 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201311201110.rAKBAOMY061212@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 20 Nov 2013 11:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258387 - head/sys/dev/nand 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:10:24 -0000 Author: gber Date: Wed Nov 20 11:10:23 2013 New Revision: 258387 URL: http://svnweb.freebsd.org/changeset/base/258387 Log: Split raw reading/programming into smaller chunks to avoid allocating too big chunk of kernel memory. Validate size of data. Add error handling to avoid calling copyout() when data has not been read correctly. Reviewed by: zbb Reported by: x90c MFC after: 2 days Modified: head/sys/dev/nand/nand_cdev.c head/sys/dev/nand/nand_geom.c Modified: head/sys/dev/nand/nand_cdev.c ============================================================================== --- head/sys/dev/nand/nand_cdev.c Wed Nov 20 11:09:12 2013 (r258386) +++ head/sys/dev/nand/nand_cdev.c Wed Nov 20 11:10:23 2013 (r258387) @@ -294,19 +294,39 @@ nand_ioctl(struct cdev *dev, u_long cmd, struct thread *td) { struct nand_chip *chip; + struct chip_geom *cg; struct nand_oob_rw *oob_rw = NULL; struct nand_raw_rw *raw_rw = NULL; device_t nandbus; + size_t bufsize, len, raw_size; + off_t off; uint8_t *buf = NULL; int ret = 0; uint8_t status; chip = (struct nand_chip *)dev->si_drv1; + cg = &chip->chip_geom; nandbus = device_get_parent(chip->dev); if ((cmd == NAND_IO_RAW_READ) || (cmd == NAND_IO_RAW_PROG)) { raw_rw = (struct nand_raw_rw *)data; - buf = malloc(raw_rw->len, M_NAND, M_WAITOK); + raw_size = cg->pgs_per_blk * (cg->page_size + cg->oob_size); + + /* Check if len is not bigger than chip size */ + if (raw_rw->len > raw_size) + return (EFBIG); + + /* + * Do not ask for too much memory, in case of large transfers + * read/write in 16-pages chunks + */ + bufsize = 16 * (cg->page_size + cg->oob_size); + if (raw_rw->len < bufsize) + bufsize = raw_rw->len; + + buf = malloc(bufsize, M_NAND, M_WAITOK); + len = raw_rw->len; + off = 0; } switch(cmd) { case NAND_IO_ERASE: @@ -335,19 +355,37 @@ nand_ioctl(struct cdev *dev, u_long cmd, break; case NAND_IO_RAW_PROG: - ret = copyin(raw_rw->data, buf, raw_rw->len); - if (ret) - break; - ret = nand_prog_pages_raw(chip, raw_rw->off, buf, - raw_rw->len); + while (len > 0) { + if (len < bufsize) + bufsize = len; + ret = copyin(raw_rw->data + off, buf, bufsize); + if (ret) + break; + ret = nand_prog_pages_raw(chip, raw_rw->off + off, buf, + bufsize); + if (ret) + break; + len -= bufsize; + off += bufsize; + } break; case NAND_IO_RAW_READ: - ret = nand_read_pages_raw(chip, raw_rw->off, buf, - raw_rw->len); - if (ret) - break; - ret = copyout(buf, raw_rw->data, raw_rw->len); + while (len > 0) { + if (len < bufsize) + bufsize = len; + + ret = nand_read_pages_raw(chip, raw_rw->off + off, buf, + bufsize); + if (ret) + break; + + ret = copyout(buf, raw_rw->data + off, bufsize); + if (ret) + break; + len -= bufsize; + off += bufsize; + } break; case NAND_IO_PAGE_STAT: Modified: head/sys/dev/nand/nand_geom.c ============================================================================== --- head/sys/dev/nand/nand_geom.c Wed Nov 20 11:09:12 2013 (r258386) +++ head/sys/dev/nand/nand_geom.c Wed Nov 20 11:10:23 2013 (r258387) @@ -193,20 +193,41 @@ nand_ioctl(struct disk *ndisk, u_long cm struct thread *td) { struct nand_chip *chip; + struct chip_geom *cg; struct nand_oob_rw *oob_rw = NULL; struct nand_raw_rw *raw_rw = NULL; device_t nandbus; + size_t bufsize, len, raw_size; + off_t off; uint8_t *buf = NULL; int ret = 0; uint8_t status; chip = (struct nand_chip *)ndisk->d_drv1; + cg = &chip->chip_geom; nandbus = device_get_parent(chip->dev); if ((cmd == NAND_IO_RAW_READ) || (cmd == NAND_IO_RAW_PROG)) { raw_rw = (struct nand_raw_rw *)data; - buf = malloc(raw_rw->len, M_NAND, M_WAITOK); + raw_size = cg->pgs_per_blk * (cg->page_size + cg->oob_size); + + /* Check if len is not bigger than chip size */ + if (raw_rw->len > raw_size) + return (EFBIG); + + /* + * Do not ask for too much memory, in case of large transfers + * read/write in 16-pages chunks + */ + bufsize = 16 * (cg->page_size + cg->oob_size); + if (raw_rw->len < bufsize) + bufsize = raw_rw->len; + + buf = malloc(bufsize, M_NAND, M_WAITOK); + len = raw_rw->len; + off = 0; } + switch (cmd) { case NAND_IO_ERASE: ret = nand_erase_blocks(chip, ((off_t *)data)[0], @@ -234,15 +255,38 @@ nand_ioctl(struct disk *ndisk, u_long cm break; case NAND_IO_RAW_PROG: - copyin(raw_rw->data, buf, raw_rw->len); - ret = nand_prog_pages_raw(chip, raw_rw->off, buf, - raw_rw->len); + while (len > 0) { + if (len < bufsize) + bufsize = len; + + ret = copyin(raw_rw->data + off, buf, bufsize); + if (ret) + break; + ret = nand_prog_pages_raw(chip, raw_rw->off + off, buf, + bufsize); + if (ret) + break; + len -= bufsize; + off += bufsize; + } break; case NAND_IO_RAW_READ: - ret = nand_read_pages_raw(chip, raw_rw->off, buf, - raw_rw->len); - copyout(buf, raw_rw->data, raw_rw->len); + while (len > 0) { + if (len < bufsize) + bufsize = len; + + ret = nand_read_pages_raw(chip, raw_rw->off + off, buf, + bufsize); + if (ret) + break; + + ret = copyout(buf, raw_rw->data + off, bufsize); + if (ret) + break; + len -= bufsize; + off += bufsize; + } break; case NAND_IO_GET_CHIP_PARAM: From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:47:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C669B0A; Wed, 20 Nov 2013 11:47:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B91A241F; Wed, 20 Nov 2013 11:47:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKBlpVi073972; Wed, 20 Nov 2013 11:47:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKBlphC073971; Wed, 20 Nov 2013 11:47:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201147.rAKBlphC073971@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258388 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:47:51 -0000 Author: avg Date: Wed Nov 20 11:47:50 2013 New Revision: 258388 URL: http://svnweb.freebsd.org/changeset/base/258388 Log: MFV r258377: 4088 use after free in arc_release() illumos/illumos-gate@ccc22e130479b5bd7c0002267fee1e0602d3f772 MFC after: 5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Nov 20 11:10:23 2013 (r258387) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Nov 20 11:47:50 2013 (r258388) @@ -3540,6 +3540,7 @@ arc_release(arc_buf_t *buf, void *tag) if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); hdr->b_l2hdr = NULL; + list_remove(l2hdr->b_dev->l2ad_buflist, hdr); } buf_size = hdr->b_size; @@ -3627,7 +3628,6 @@ arc_release(arc_buf_t *buf, void *tag) ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, hdr->b_size, 0); - list_remove(l2hdr->b_dev->l2ad_buflist, hdr); kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -buf_size); mutex_exit(&l2arc_buflist_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 11:52:33 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08D55CA4; Wed, 20 Nov 2013 11:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD7C92471; Wed, 20 Nov 2013 11:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKBqWHa076580; Wed, 20 Nov 2013 11:52:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKBqWwi076579; Wed, 20 Nov 2013 11:52:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201311201152.rAKBqWwi076579@svn.freebsd.org> From: Andriy Gapon Date: Wed, 20 Nov 2013 11:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258389 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 11:52:33 -0000 Author: avg Date: Wed Nov 20 11:52:32 2013 New Revision: 258389 URL: http://svnweb.freebsd.org/changeset/base/258389 Log: MFV r258378: 4089 NULL pointer dereference in arc_read() illumos/illumos-gate@57815f6b95a743697e148327725b7f568e75e6ea Tested by: adrian MFC after: 4 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Nov 20 11:47:50 2013 (r258388) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Nov 20 11:52:32 2013 (r258389) @@ -20,9 +20,9 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ /* @@ -3173,6 +3173,8 @@ top: vdev_t *vd = NULL; uint64_t addr = 0; boolean_t devw = B_FALSE; + enum zio_compress b_compress = ZIO_COMPRESS_OFF; + uint64_t b_asize = 0; if (hdr == NULL) { /* this block is not in the cache */ @@ -3242,10 +3244,12 @@ top: hdr->b_acb = acb; hdr->b_flags |= ARC_IO_IN_PROGRESS; - if (HDR_L2CACHE(hdr) && hdr->b_l2hdr != NULL && + if (hdr->b_l2hdr != NULL && (vd = hdr->b_l2hdr->b_dev->l2ad_vdev) != NULL) { devw = hdr->b_l2hdr->b_dev->l2ad_writing; addr = hdr->b_l2hdr->b_daddr; + b_compress = hdr->b_l2hdr->b_compress; + b_asize = hdr->b_l2hdr->b_asize; /* * Lock out device removal. */ @@ -3296,7 +3300,7 @@ top: cb->l2rcb_bp = *bp; cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; - cb->l2rcb_compress = hdr->b_l2hdr->b_compress; + cb->l2rcb_compress = b_compress; ASSERT(addr >= VDEV_LABEL_START_SIZE && addr + size < vd->vdev_psize - @@ -3308,8 +3312,7 @@ top: * Issue a null zio if the underlying buffer * was squashed to zero size by compression. */ - if (hdr->b_l2hdr->b_compress == - ZIO_COMPRESS_EMPTY) { + if (b_compress == ZIO_COMPRESS_EMPTY) { rzio = zio_null(pio, spa, vd, l2arc_read_done, cb, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -3318,8 +3321,8 @@ top: ZIO_FLAG_DONT_RETRY); } else { rzio = zio_read_phys(pio, vd, addr, - hdr->b_l2hdr->b_asize, - buf->b_data, ZIO_CHECKSUM_OFF, + b_asize, buf->b_data, + ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_CANFAIL | @@ -3328,8 +3331,7 @@ top: } DTRACE_PROBE2(l2arc__read, vdev_t *, vd, zio_t *, rzio); - ARCSTAT_INCR(arcstat_l2_read_bytes, - hdr->b_l2hdr->b_asize); + ARCSTAT_INCR(arcstat_l2_read_bytes, b_asize); if (*arc_flags & ARC_NOWAIT) { zio_nowait(rzio); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 12:32: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0395A8EF; Wed, 20 Nov 2013 12:32:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E74722729; Wed, 20 Nov 2013 12:32:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKCWY3d090107; Wed, 20 Nov 2013 12:32:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKCWYdR090106; Wed, 20 Nov 2013 12:32:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311201232.rAKCWYdR090106@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Nov 2013 12:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258390 - head/tools/tools/umastat 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 12:32:35 -0000 Author: mav Date: Wed Nov 20 12:32:34 2013 New Revision: 258390 URL: http://svnweb.freebsd.org/changeset/base/258390 Log: Print some more flags. Modified: head/tools/tools/umastat/umastat.c Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Wed Nov 20 11:52:32 2013 (r258389) +++ head/tools/tools/umastat/umastat.c Wed Nov 20 12:32:34 2013 (r258390) @@ -117,6 +117,9 @@ static const struct flaginfo { u_int32_t fi_flag; const char *fi_name; } flaginfo[] = { + { UMA_ZFLAG_MULTI, "multi" }, + { UMA_ZFLAG_DRAINING, "draining" }, + { UMA_ZFLAG_BUCKET, "bucket" }, { UMA_ZFLAG_INTERNAL, "internal" }, { UMA_ZFLAG_FULL, "full" }, { UMA_ZFLAG_CACHEONLY, "cacheonly" }, @@ -132,6 +135,10 @@ static const struct flaginfo { { UMA_ZONE_SECONDARY, "secondary" }, { UMA_ZONE_REFCNT, "refcnt" }, { UMA_ZONE_MAXBUCKET, "maxbucket" }, + { UMA_ZONE_CACHESPREAD, "cachespread" }, + { UMA_ZONE_VTOSLAB, "vtoslab" }, + { UMA_ZONE_NODUMP, "nodump" }, + { UMA_ZONE_PCPU, "pcpu" }, }; static const int flaginfo_count = sizeof(flaginfo) / sizeof(struct flaginfo); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 13:22:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A8908D6; Wed, 20 Nov 2013 13:22:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD992A52; Wed, 20 Nov 2013 13:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKDMNUT007377; Wed, 20 Nov 2013 13:22:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKDMNd2007376; Wed, 20 Nov 2013 13:22:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311201322.rAKDMNd2007376@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 20 Nov 2013 13:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258391 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 13:22:23 -0000 Author: glebius Date: Wed Nov 20 13:22:22 2013 New Revision: 258391 URL: http://svnweb.freebsd.org/changeset/base/258391 Log: Fix comment after r250551. Modified: head/sys/sys/bufobj.h Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Wed Nov 20 12:32:34 2013 (r258390) +++ head/sys/sys/bufobj.h Wed Nov 20 13:22:22 2013 (r258391) @@ -63,7 +63,7 @@ extern struct buf_ops buf_ops_bio; TAILQ_HEAD(buflists, buf); -/* A Buffer splay list */ +/* A Buffer list & trie */ struct bufv { struct buflists bv_hd; /* Sorted blocklist */ struct pctrie bv_root; /* Buf trie */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 14:01:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10AFF5A4; Wed, 20 Nov 2013 14:01:59 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id C09512CC0; Wed, 20 Nov 2013 14:01:58 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Vj8Ox-000JLc-PC; Wed, 20 Nov 2013 18:05:07 +0400 Date: Wed, 20 Nov 2013 18:05:07 +0400 From: Slawa Olhovchenkov To: Steven Hartland Subject: Re: svn commit: r257831 - head/sys/cam/scsi Message-ID: <20131120140507.GA73194@zxy.spb.ru> References: <201311072321.rA7NLqrS005567@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311072321.rA7NLqrS005567@svn.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: 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 14:01:59 -0000 On Thu, Nov 07, 2013 at 11:21:52PM +0000, Steven Hartland wrote: > Author: smh > Date: Thu Nov 7 23:21:52 2013 > New Revision: 257831 > URL: http://svnweb.freebsd.org/changeset/base/257831 > > Log: > Corrected definition for old_rate to match d_rotation_rate > > MFC after: 2 Days > X-MFC-With: r256956 MFC? From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 14:17: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4A2D9B4; Wed, 20 Nov 2013 14:17:46 +0000 (UTC) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF462DBD; Wed, 20 Nov 2013 14:17:45 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006778879.msg; Wed, 20 Nov 2013 14:17:37 +0000 X-Spam-Processed: mail1.multiplay.co.uk, Wed, 20 Nov 2013 14:17:37 +0000 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=103643e192=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <0F6C0C6ED4934888897435C6CEAC0387@multiplay.co.uk> From: "Steven Hartland" To: "Slawa Olhovchenkov" References: <201311072321.rA7NLqrS005567@svn.freebsd.org> <20131120140507.GA73194@zxy.spb.ru> Subject: Re: svn commit: r257831 - head/sys/cam/scsi Date: Wed, 20 Nov 2013 14:17:32 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 14:17:47 -0000 ----- Original Message ----- From: "Slawa Olhovchenkov" To: "Steven Hartland" Cc: ; ; Sent: Wednesday, November 20, 2013 2:05 PM Subject: Re: svn commit: r257831 - head/sys/cam/scsi > On Thu, Nov 07, 2013 at 11:21:52PM +0000, Steven Hartland wrote: > >> Author: smh >> Date: Thu Nov 7 23:21:52 2013 >> New Revision: 257831 >> URL: http://svnweb.freebsd.org/changeset/base/257831 >> >> Log: >> Corrected definition for old_rate to match d_rotation_rate >> >> MFC after: 2 Days >> X-MFC-With: r256956 > > MFC? I have stable/9 done locally just pending me fixing my svn install so it uses the FreeBSD fields again which it appears to have lost for some unknown reason :( ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 14:21: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA845BC9; Wed, 20 Nov 2013 14:21:41 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 6605F2E1E; Wed, 20 Nov 2013 14:21:41 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Vj8i2-000Jcr-WC; Wed, 20 Nov 2013 18:24:51 +0400 Date: Wed, 20 Nov 2013 18:24:50 +0400 From: Slawa Olhovchenkov To: Steven Hartland Subject: Re: svn commit: r257831 - head/sys/cam/scsi Message-ID: <20131120142450.GB52936@zxy.spb.ru> References: <201311072321.rA7NLqrS005567@svn.freebsd.org> <20131120140507.GA73194@zxy.spb.ru> <0F6C0C6ED4934888897435C6CEAC0387@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0F6C0C6ED4934888897435C6CEAC0387@multiplay.co.uk> 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: 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 14:21:41 -0000 On Wed, Nov 20, 2013 at 02:17:32PM -0000, Steven Hartland wrote: > ----- Original Message ----- > From: "Slawa Olhovchenkov" > To: "Steven Hartland" > Cc: ; ; > Sent: Wednesday, November 20, 2013 2:05 PM > Subject: Re: svn commit: r257831 - head/sys/cam/scsi > > > > On Thu, Nov 07, 2013 at 11:21:52PM +0000, Steven Hartland wrote: > > > >> Author: smh > >> Date: Thu Nov 7 23:21:52 2013 > >> New Revision: 257831 > >> URL: http://svnweb.freebsd.org/changeset/base/257831 > >> > >> Log: > >> Corrected definition for old_rate to match d_rotation_rate > >> > >> MFC after: 2 Days > >> X-MFC-With: r256956 > > > > MFC? > > I have stable/9 done locally just pending me fixing my svn install > so it uses the FreeBSD fields again which it appears to have lost > for some unknown reason :( Can you fix this before next release cycle of 10.0? From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 14:32:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C63BFAD; Wed, 20 Nov 2013 14:32:17 +0000 (UTC) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9562E2EB5; Wed, 20 Nov 2013 14:32:15 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50006778946.msg; Wed, 20 Nov 2013 14:32:14 +0000 X-Spam-Processed: mail1.multiplay.co.uk, Wed, 20 Nov 2013 14:32:14 +0000 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=103643e192=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: From: "Steven Hartland" To: "Slawa Olhovchenkov" References: <201311072321.rA7NLqrS005567@svn.freebsd.org> <20131120140507.GA73194@zxy.spb.ru> <0F6C0C6ED4934888897435C6CEAC0387@multiplay.co.uk> <20131120142450.GB52936@zxy.spb.ru> Subject: Re: svn commit: r257831 - head/sys/cam/scsi Date: Wed, 20 Nov 2013 14:32:06 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 14:32:17 -0000 ----- Original Message ----- From: "Slawa Olhovchenkov" >> > On Thu, Nov 07, 2013 at 11:21:52PM +0000, Steven Hartland wrote: >> > >> >> Author: smh >> >> Date: Thu Nov 7 23:21:52 2013 >> >> New Revision: 257831 >> >> URL: http://svnweb.freebsd.org/changeset/base/257831 >> >> >> >> Log: >> >> Corrected definition for old_rate to match d_rotation_rate >> >> >> >> MFC after: 2 Days >> >> X-MFC-With: r256956 >> > >> > MFC? >> >> I have stable/9 done locally just pending me fixing my svn install >> so it uses the FreeBSD fields again which it appears to have lost >> for some unknown reason :( > > Can you fix this before next release cycle of 10.0? As the original change didnt make the 10 cut off it wont be in 10 I'm afraid. I did request consideration of re@ for it due the confusion about the change request process but it was denied :( If you feel strongly it should be in 10 you might want to ask re@ for reconsideration. Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 15:53:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB60A21; Wed, 20 Nov 2013 15:53:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADCE824D7; Wed, 20 Nov 2013 15:53:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKFroK2057979; Wed, 20 Nov 2013 15:53:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKFroGX057978; Wed, 20 Nov 2013 15:53:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311201553.rAKFroGX057978@svn.freebsd.org> From: Ian Lepore Date: Wed, 20 Nov 2013 15:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258392 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 15:53:50 -0000 Author: ian Date: Wed Nov 20 15:53:50 2013 New Revision: 258392 URL: http://svnweb.freebsd.org/changeset/base/258392 Log: Call cpu_setup() immediately after the page tables are installed. This enables data cache and other chip-specific features. It was previously done via an early SYSINIT, but it was being done after pmap and vm setup, and those setups need to use mutexes. On some modern ARM platforms, the ldrex/strex instructions that implement mutexes require the data cache to be enabled. A nice side effect of enabling caching earlier is that it eliminates the multi-second pause that used to happen early in boot while physical memory and pmap and vm were being set up. On boards with 1 GB or more of ram this pause was very noticible, sometimes 5-6 seconds. PR: arm/183740 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Nov 20 13:22:22 2013 (r258391) +++ head/sys/arm/arm/machdep.c Wed Nov 20 15:53:50 2013 (r258392) @@ -361,7 +361,6 @@ cpu_startup(void *dummy) #endif #endif - cpu_setup(""); identify_arm_cpu(); printf("real memory = %ju (%ju MB)\n", (uintmax_t)ptoa(physmem), @@ -1431,6 +1430,12 @@ initarm(struct arm_boot_params *abp) cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); /* + * Now that proper page tables are installed, call cpu_setup() to enable + * instruction and data caches and other chip-specific features. + */ + cpu_setup(""); + + /* * Only after the SOC registers block is mapped we can perform device * tree fixups, as they may attempt to read parameters from hardware. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 16:42:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43D9AC42; Wed, 20 Nov 2013 16:42:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 338CB285B; Wed, 20 Nov 2013 16:42:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKGg2sk074780; Wed, 20 Nov 2013 16:42:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKGg2nj074779; Wed, 20 Nov 2013 16:42:02 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311201642.rAKGg2nj074779@svn.freebsd.org> From: Ian Lepore Date: Wed, 20 Nov 2013 16:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258393 - head/sys/arm/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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 16:42:02 -0000 Author: ian Date: Wed Nov 20 16:42:01 2013 New Revision: 258393 URL: http://svnweb.freebsd.org/changeset/base/258393 Log: Add USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Wed Nov 20 15:53:50 2013 (r258392) +++ head/sys/arm/conf/BEAGLEBONE Wed Nov 20 16:42:01 2013 (r258393) @@ -104,6 +104,7 @@ device gpio # USB support device usb +options USB_HOST_ALIGN=64 # Cacheline size is 64 on AM335x. options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 17:46: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2BF6E43; Wed, 20 Nov 2013 17:46:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C29FB2C6C; Wed, 20 Nov 2013 17:46:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKHkN1I099017; Wed, 20 Nov 2013 17:46:23 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKHkNIc099015; Wed, 20 Nov 2013 17:46:23 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311201746.rAKHkNIc099015@svn.freebsd.org> From: Peter Wemm Date: Wed, 20 Nov 2013 17:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258394 - stable/10/usr.bin/uname X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 17:46:24 -0000 Author: peter Date: Wed Nov 20 17:46:23 2013 New Revision: 258394 URL: http://svnweb.freebsd.org/changeset/base/258394 Log: MFC r256557: add uname flags to access userland's __FreeBSD_version more conveniently than the traditional way of scripts parsing #include files. Approved by: re (hrs) Modified: stable/10/usr.bin/uname/uname.1 stable/10/usr.bin/uname/uname.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/uname/uname.1 ============================================================================== --- stable/10/usr.bin/uname/uname.1 Wed Nov 20 16:42:01 2013 (r258393) +++ stable/10/usr.bin/uname/uname.1 Wed Nov 20 17:46:23 2013 (r258394) @@ -28,7 +28,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd November 20, 2013 .Dt UNAME 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display information about the system .Sh SYNOPSIS .Nm -.Op Fl aimnoprsv +.Op Fl aiKmnoprsUv .Sh DESCRIPTION The .Nm @@ -55,6 +55,10 @@ and were specified. .It Fl i Write the kernel ident to standard output. +.It Fl K +Write the +.Fx +version of the kernel. .It Fl m Write the type of the current hardware platform to standard output. .It Fl n @@ -70,6 +74,10 @@ Write the current release level of the o to standard output. .It Fl s Write the name of the operating system implementation to standard output. +.It Fl U +Write the +.Fx +version of the user environment. .It Fl v Write the version level of this release of the operating system to standard output. @@ -79,6 +87,14 @@ If the .Fl a flag is specified, or multiple flags are specified, all output is written on a single line, separated by spaces. +.Pp +The +.Fl K +and +.Fl U +flags are intended to be used for fine grain differentiation of incremental +.Fx +development and user visible changes. .Sh ENVIRONMENT An environment variable composed of the string .Ev UNAME_ @@ -91,6 +107,8 @@ of the environment variable. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO +.Xr feature_present 3 , +.Xr getosreldate 3 , .Xr sysctl 3 , .Xr uname 3 , .Xr sysctl 8 @@ -104,3 +122,10 @@ specification. The .Nm command appeared in PWB UNIX. +.Pp +The +.Fl K +and +.Fl U +extension flags appeared in +.Fx 10.0 . Modified: stable/10/usr.bin/uname/uname.c ============================================================================== --- stable/10/usr.bin/uname/uname.c Wed Nov 20 16:42:01 2013 (r258393) +++ stable/10/usr.bin/uname/uname.c Wed Nov 20 17:46:23 2013 (r258394) @@ -54,6 +54,8 @@ static const char sccsid[] = "@(#)uname. #include #include +#include + #define MFLAG 0x01 #define NFLAG 0x02 #define PFLAG 0x04 @@ -61,10 +63,12 @@ static const char sccsid[] = "@(#)uname. #define SFLAG 0x10 #define VFLAG 0x20 #define IFLAG 0x40 +#define UFLAG 0x80 +#define KFLAG 0x100 typedef void (*get_t)(void); static get_t get_ident, get_platform, get_hostname, get_arch, - get_release, get_sysname, get_version; + get_release, get_sysname, get_kernvers, get_uservers, get_version; static void native_ident(void); static void native_platform(void); @@ -73,11 +77,13 @@ static void native_arch(void); static void native_release(void); static void native_sysname(void); static void native_version(void); +static void native_kernvers(void); +static void native_uservers(void); static void print_uname(u_int); static void setup_get(void); static void usage(void); -static char *ident, *platform, *hostname, *arch, *release, *sysname, *version; +static char *ident, *platform, *hostname, *arch, *release, *sysname, *version, *kernvers, *uservers; static int space; int @@ -89,7 +95,7 @@ main(int argc, char *argv[]) setup_get(); flags = 0; - while ((ch = getopt(argc, argv, "aimnoprsv")) != -1) + while ((ch = getopt(argc, argv, "aiKmnoprsUv")) != -1) switch(ch) { case 'a': flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG); @@ -97,6 +103,9 @@ main(int argc, char *argv[]) case 'i': flags |= IFLAG; break; + case 'K': + flags |= KFLAG; + break; case 'm': flags |= MFLAG; break; @@ -113,6 +122,9 @@ main(int argc, char *argv[]) case 'o': flags |= SFLAG; break; + case 'U': + flags |= UFLAG; + break; case 'v': flags |= VFLAG; break; @@ -153,6 +165,8 @@ setup_get(void) CHECK_ENV("m", platform); CHECK_ENV("p", arch); CHECK_ENV("i", ident); + CHECK_ENV("K", kernvers); + CHECK_ENV("U", uservers); } #define PRINT_FLAG(flags,flag,var) \ @@ -176,6 +190,8 @@ print_uname(u_int flags) PRINT_FLAG(flags, MFLAG, platform); PRINT_FLAG(flags, PFLAG, arch); PRINT_FLAG(flags, IFLAG, ident); + PRINT_FLAG(flags, KFLAG, kernvers); + PRINT_FLAG(flags, UFLAG, uservers); printf("\n"); } @@ -244,8 +260,26 @@ NATIVE_SYSCTLNAME_GET(ident, "kern.ident } NATIVE_SET; static void +native_uservers(void) +{ + static char buf[128]; + + snprintf(buf, sizeof(buf), "%d", __FreeBSD_version); + uservers = buf; +} + +static void +native_kernvers(void) +{ + static char buf[128]; + + snprintf(buf, sizeof(buf), "%d", getosreldate()); + kernvers = buf; +} + +static void usage(void) { - fprintf(stderr, "usage: uname [-aimnoprsv]\n"); + fprintf(stderr, "usage: uname [-aiKmnoprsUv]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 17:48:39 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62820FDB; Wed, 20 Nov 2013 17:48:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 524E72C8E; Wed, 20 Nov 2013 17:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKHmdWp099296; Wed, 20 Nov 2013 17:48:39 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKHmdfn099295; Wed, 20 Nov 2013 17:48:39 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311201748.rAKHmdfn099295@svn.freebsd.org> From: Peter Wemm Date: Wed, 20 Nov 2013 17:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258395 - head/usr.bin/uname 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 17:48:39 -0000 Author: peter Date: Wed Nov 20 17:48:38 2013 New Revision: 258395 URL: http://svnweb.freebsd.org/changeset/base/258395 Log: Change introduction history. Modified: head/usr.bin/uname/uname.1 Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Wed Nov 20 17:46:23 2013 (r258394) +++ head/usr.bin/uname/uname.1 Wed Nov 20 17:48:38 2013 (r258395) @@ -28,7 +28,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd November 20, 2013 .Dt UNAME 1 .Os .Sh NAME @@ -128,4 +128,4 @@ The and .Fl U extension flags appeared in -.Fx 11.0 . +.Fx 10.0 . From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 18:58: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 191E7814; Wed, 20 Nov 2013 18:58:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 07A062186; Wed, 20 Nov 2013 18:58:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKIw7BM023864; Wed, 20 Nov 2013 18:58:07 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKIw7HM023863; Wed, 20 Nov 2013 18:58:07 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311201858.rAKIw7HM023863@svn.freebsd.org> From: Peter Wemm Date: Wed, 20 Nov 2013 18:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258396 - stable/10/share/i18n/esdb/UTF X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 18:58:08 -0000 Author: peter Date: Wed Nov 20 18:58:07 2013 New Revision: 258396 URL: http://svnweb.freebsd.org/changeset/base/258396 Log: MFC r258254 - teach iconv about a WCHAR_T pseudo-type Approved by: re (kib) Modified: stable/10/share/i18n/esdb/UTF/UTF.alias Directory Properties: stable/10/ (props changed) stable/10/share/ (props changed) Modified: stable/10/share/i18n/esdb/UTF/UTF.alias ============================================================================== --- stable/10/share/i18n/esdb/UTF/UTF.alias Wed Nov 20 17:48:38 2013 (r258395) +++ stable/10/share/i18n/esdb/UTF/UTF.alias Wed Nov 20 18:58:07 2013 (r258396) @@ -28,6 +28,7 @@ 16LE utf16le 32-INTERNAL ucs-4-internal +32-INTERNAL wchar_t 32-SWAPPED ucs-4-swapped From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 19:41:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D16D2A6; Wed, 20 Nov 2013 19:41:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C97A2404; Wed, 20 Nov 2013 19:41:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKJf1F2039848; Wed, 20 Nov 2013 19:41:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKJf1fI039844; Wed, 20 Nov 2013 19:41:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311201941.rAKJf1fI039844@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 20 Nov 2013 19:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258397 - head/sys/fs/pseudofs 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 19:41:01 -0000 Author: kib Date: Wed Nov 20 19:41:00 2013 New Revision: 258397 URL: http://svnweb.freebsd.org/changeset/base/258397 Log: Redo r258088 to avoid relying on signed arithmetic overflow, since compiler interprets this as an undefined behaviour. Instead, ensure that the sum of uio_offset and uio_resid is below OFF_MAX using the operation which cannot overflow. Reported and tested by: pho Discussed with: bde Approved by: des (pseudofs maintainer) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 20 18:58:07 2013 (r258396) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 20 19:41:00 2013 (r258397) @@ -616,8 +616,7 @@ pfs_read(struct vop_read_args *va) struct proc *proc; struct sbuf *sb = NULL; int error, locked; - off_t offset; - ssize_t buflen, resid; + off_t buflen; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); @@ -654,16 +653,12 @@ pfs_read(struct vop_read_args *va) goto ret; } - resid = uio->uio_resid; - offset = uio->uio_offset; - buflen = offset + resid; - - /* beaucoup sanity checks so we don't ask for bogus allocation */ - if (resid < 0 || buflen < offset || buflen < resid || - buflen >= INT_MAX) { + if (uio->uio_resid < 0 || uio->uio_offset < 0 || + uio->uio_resid > OFF_MAX - uio->uio_offset) { error = EINVAL; goto ret; } + buflen = uio->uio_offset + uio->uio_resid; if (buflen > MAXPHYS) buflen = MAXPHYS; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:11:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0434EEC8; Wed, 20 Nov 2013 20:11:28 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9E272625; Wed, 20 Nov 2013 20:11:27 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAKKBQEG005832 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 12:11:26 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D1768.9000401@freebsd.org> Date: Wed, 20 Nov 2013 12:11:20 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Robert Watson , "George V. Neville-Neil" Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:11:28 -0000 On 11/19/13, 3:04 AM, Robert Watson wrote: > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > >> Allow ethernet drivers to pass in packets connected via the >> nextpkt pointer. >> Handling packets in this way allows drivers to amortize work >> during packet reception. >> >> Submitted by: Vijay Singh >> Sponsored by: NetApp > > Currently, it is quite easy to make mistakes regarding individual > mbuf chains vs. lists of mbuf chains. This leads me to wonder > whether a new type, perhaps simply constructed on the stack before > passing in, should be used for KPIs that accept lists of packets. E.g., > > /* > * This structure is almost always allocated on a caller stack, so > * cannot itself be queued without memory allocation in most cases. > */ > struct mbuf_queue { > struct mbuf *mq_head; > }; > > It's hard to believe that we don't have a structure around already that we can't use. With Luigi's comment, I wonder that there isn't an mbuf_list structure already we can just steal. it could almost be the current interface input queue structure. From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:12: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E09AE1C3; Wed, 20 Nov 2013 20:12:59 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B232D2646; Wed, 20 Nov 2013 20:12:59 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAKKCwZJ005840 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 12:12:58 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D17C5.6090006@freebsd.org> Date: Wed, 20 Nov 2013 12:12:53 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Robert Watson , "George V. Neville-Neil" Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:13:00 -0000 On 11/19/13, 3:04 AM, Robert Watson wrote: > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > >> Allow ethernet drivers to pass in packets connected via the >> nextpkt pointer. >> Handling packets in this way allows drivers to amortize work >> during packet reception. >> >> Submitted by: Vijay Singh >> Sponsored by: NetApp > > Currently, it is quite easy to make mistakes regarding individual > mbuf chains vs. lists of mbuf chains. This leads me to wonder > whether a new type, perhaps simply constructed on the stack before > passing in, should be used for KPIs that accept lists of packets. E.g., > > /* > * This structure is almost always allocated on a caller stack, so > * cannot itself be queued without memory allocation in most cases. > */ > struct mbuf_queue { > struct mbuf *mq_head; > }; > > int > ether_input(struct ifnet *ifp, struct mbuf_queue *m) > { > > ... > } or separate entrypoints, old and and new > > ... > struct mbuf_queue mq = { m }; > > return (ether_input(ifp, &mq)); > ... > > That way the compiler can help us figure out where we expect an > individual packet but have accidentally leaked a queue. Functions > that accept only a single packet could also more agressively assert > that m->m_nextpkt is NULL: > > M_ASSERT_ONEPACKET(m); > > Robert > >> >> > From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:21:58 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E048F591; Wed, 20 Nov 2013 20:21:58 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id BC7F526DD; Wed, 20 Nov 2013 20:21:58 +0000 (UTC) Received: from c0188.aw.cl.cam.ac.uk (c0188.aw.cl.cam.ac.uk [128.232.100.188]) by cyrus.watson.org (Postfix) with ESMTPSA id 753F746B2C; Wed, 20 Nov 2013 15:21:50 -0500 (EST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r258328 - head/sys/net From: "Robert N. M. Watson" In-Reply-To: <528D1768.9000401@freebsd.org> Date: Wed, 20 Nov 2013 20:21:47 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <528D1768.9000401@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1822) Cc: svn-src-head@freebsd.org, George Neville-Neil , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:21:59 -0000 On 20 Nov 2013, at 20:11, Julian Elischer wrote: >> Currently, it is quite easy to make mistakes regarding individual = mbuf chains vs. lists of mbuf chains. This leads me to wonder whether a = new type, perhaps simply constructed on the stack before passing in, = should be used for KPIs that accept lists of packets. E.g., >>=20 >> /* >> * This structure is almost always allocated on a caller stack, so >> * cannot itself be queued without memory allocation in most = cases. >> */ >> struct mbuf_queue { >> struct mbuf *mq_head; >> }; >>=20 >>=20 > It's hard to believe that we don't have a structure around already = that we can't use. With Luigi's comment, I wonder that there isn't an = mbuf_list structure already we can just steal. it could almost be the = current interface input queue structure. The exact details don't matter; what does matter is that we make it as = easy as possible to detect mistakes using the compiler (e.g., queue = passed where mbuf expected, or vice versa) and that those situations we = can't check statically, we try to check dynamically (multi-entry queue = passed where mbuf expected). In the past we've had bugs along similar = lines, where code expects m->m_nextpkt to be NULL when it isn't leading = to very unhappy times in socket buffers, etc. Ideally what we did would = have no expense at runtime unless debugging features were turned on = (INVARIANTS). Robert= From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:25:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D23274D; Wed, 20 Nov 2013 20:25:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6C3270F; Wed, 20 Nov 2013 20:25:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKKP1Ls054331; Wed, 20 Nov 2013 20:25:01 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKKP0ce054293; Wed, 20 Nov 2013 20:25:00 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201311202025.rAKKP0ce054293@svn.freebsd.org> From: Peter Wemm Date: Wed, 20 Nov 2013 20:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258398 - in stable/10: . include lib lib/libc lib/libc/iconv lib/libc_nonshared sys/sys X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:25:02 -0000 Author: peter Date: Wed Nov 20 20:24:59 2013 New Revision: 258398 URL: http://svnweb.freebsd.org/changeset/base/258398 Log: MFC r258283 - move iconv* symbols out of libc.so.7 namespace with compatibility symbols to aid transition for existing 10.x installs. Approved by: re (kib) Added: stable/10/lib/libc/iconv/iconv-internal.h - copied unchanged from r258283, head/lib/libc/iconv/iconv-internal.h stable/10/lib/libc/iconv/iconv_compat.c - copied unchanged from r258283, head/lib/libc/iconv/iconv_compat.c stable/10/lib/libc_nonshared/ - copied from r258283, head/lib/libc_nonshared/ Modified: stable/10/Makefile.inc1 (contents, props changed) stable/10/include/iconv.h stable/10/lib/Makefile stable/10/lib/libc/iconv/Makefile.inc stable/10/lib/libc/iconv/Symbol.map stable/10/lib/libc/iconv/iconv.c stable/10/lib/libc/libc.ldscript stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) stable/10/include/ (props changed) stable/10/lib/ (props changed) stable/10/lib/libc/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/Makefile.inc1 Wed Nov 20 20:24:59 2013 (r258398) @@ -1453,11 +1453,13 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc +_startup_libs+= lib/libc_nonshared .if ${MK_LIBCPLUSPLUS} != "no" _startup_libs+= lib/libcxxrt .endif gnu/lib/libgcc__L: lib/libc__L +gnu/lib/libgcc__L: lib/libc_nonshared__L .if ${MK_LIBCPLUSPLUS} != "no" lib/libcxxrt__L: gnu/lib/libgcc__L .endif Modified: stable/10/include/iconv.h ============================================================================== --- stable/10/include/iconv.h Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/include/iconv.h Wed Nov 20 20:24:59 2013 (r258398) @@ -69,17 +69,12 @@ size_t __iconv(iconv_t, const char **, s /* * GNU interfaces for iconv */ -/* We have iconvctl() */ -#define _ICONV_VERSION 0x0108 -extern int _iconv_version; - typedef struct { void *spaceholder[64]; } iconv_allocation_t; int iconv_open_into(const char *, const char *, iconv_allocation_t *); -void iconv_set_relocation_prefix(const char *orig_prefix, - const char *curr_prefix); +void iconv_set_relocation_prefix(const char *, const char *); /* * iconvctl() request macros Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/lib/Makefile Wed Nov 20 20:24:59 2013 (r258398) @@ -32,6 +32,7 @@ SUBDIR_ORDERED= ${_csu} \ libc \ + libc_nonshared \ libbsm \ libauditd \ libcompiler_rt \ Modified: stable/10/lib/libc/iconv/Makefile.inc ============================================================================== --- stable/10/lib/libc/iconv/Makefile.inc Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/lib/libc/iconv/Makefile.inc Wed Nov 20 20:24:59 2013 (r258398) @@ -14,5 +14,5 @@ SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_esdb.c citrus_hash.c citrus_iconv.c citrus_lookup.c \ citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \ citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \ - citrus_prop.c citrus_stdenc.c iconv.c + citrus_prop.c citrus_stdenc.c iconv.c iconv_compat.c SYM_MAPS+= ${.CURDIR}/iconv/Symbol.map Modified: stable/10/lib/libc/iconv/Symbol.map ============================================================================== --- stable/10/lib/libc/iconv/Symbol.map Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/lib/libc/iconv/Symbol.map Wed Nov 20 20:24:59 2013 (r258398) @@ -2,22 +2,18 @@ * $FreeBSD$ */ -FBSD_1.2 { - __iconv; - __iconv_free_list; - __iconv_get_list; - iconv_canonicalize; -}; - FBSD_1.3 { - _iconv_version; - iconv; - iconv_open; - iconv_close; - iconv_open_into; - iconv_set_relocation_prefix; - iconvctl; - iconvlist; + __bsd___iconv; + __bsd___iconv_free_list; + __bsd___iconv_get_list; + __bsd_iconv; + __bsd_iconv_canonicalize; + __bsd_iconv_close; + __bsd_iconv_open; + __bsd_iconv_open_into; + __bsd_iconv_set_relocation_prefix; + __bsd_iconvctl; + __bsd_iconvlist; }; FBSDprivate_1.0 { Copied: stable/10/lib/libc/iconv/iconv-internal.h (from r258283, head/lib/libc/iconv/iconv-internal.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/iconv/iconv-internal.h Wed Nov 20 20:24:59 2013 (r258398, copy of r258283, head/lib/libc/iconv/iconv-internal.h) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +/* + * Interal prototypes for our back-end functions. + */ +size_t __bsd___iconv(iconv_t, const char **, size_t *, char **, + size_t *, __uint32_t, size_t *); +void __bsd___iconv_free_list(char **, size_t); +int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool); +size_t __bsd_iconv(iconv_t, const char ** __restrict, + size_t * __restrict, char ** __restrict, + size_t * __restrict); +const char *__bsd_iconv_canonicalize(const char *); +int __bsd_iconv_close(iconv_t); +iconv_t __bsd_iconv_open(const char *, const char *); +int __bsd_iconv_open_into(const char *, const char *, iconv_allocation_t *); +void __bsd_iconv_set_relocation_prefix(const char *, const char *); +int __bsd_iconvctl(iconv_t, int, void *); +void __bsd_iconvlist(int (*) (unsigned int, const char * const *, void *), void *); Modified: stable/10/lib/libc/iconv/iconv.c ============================================================================== --- stable/10/lib/libc/iconv/iconv.c Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/lib/libc/iconv/iconv.c Wed Nov 20 20:24:59 2013 (r258398) @@ -47,15 +47,12 @@ #include "citrus_hash.h" #include "citrus_iconv.h" -#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) - -int _iconv_version = _ICONV_VERSION; +#include "iconv-internal.h" -iconv_t _iconv_open(const char *out, const char *in, - struct _citrus_iconv *prealloc); +#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) -iconv_t -_iconv_open(const char *out, const char *in, struct _citrus_iconv *handle) +static iconv_t +__bsd___iconv_open(const char *out, const char *in, struct _citrus_iconv *handle) { const char *out_slashes; char *out_noslashes; @@ -92,23 +89,23 @@ _iconv_open(const char *out, const char } iconv_t -iconv_open(const char *out, const char *in) +__bsd_iconv_open(const char *out, const char *in) { - return (_iconv_open(out, in, NULL)); + return (__bsd___iconv_open(out, in, NULL)); } int -iconv_open_into(const char *out, const char *in, iconv_allocation_t *ptr) +__bsd_iconv_open_into(const char *out, const char *in, iconv_allocation_t *ptr) { struct _citrus_iconv *handle; handle = (struct _citrus_iconv *)ptr; - return ((_iconv_open(out, in, handle) == (iconv_t)-1) ? -1 : 0); + return ((__bsd___iconv_open(out, in, handle) == (iconv_t)-1) ? -1 : 0); } int -iconv_close(iconv_t handle) +__bsd_iconv_close(iconv_t handle) { if (ISBADF(handle)) { @@ -122,7 +119,7 @@ iconv_close(iconv_t handle) } size_t -iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) +__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) { size_t ret; int err; @@ -143,7 +140,7 @@ iconv(iconv_t handle, const char **in, s } size_t -__iconv(iconv_t handle, const char **in, size_t *szin, char **out, +__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout, uint32_t flags, size_t *invalids) { size_t ret; @@ -167,7 +164,7 @@ __iconv(iconv_t handle, const char **in, } int -__iconv_get_list(char ***rlist, size_t *rsz, bool sorted) +__bsd___iconv_get_list(char ***rlist, size_t *rsz, bool sorted) { int ret; @@ -181,7 +178,7 @@ __iconv_get_list(char ***rlist, size_t * } void -__iconv_free_list(char **list, size_t sz) +__bsd___iconv_free_list(char **list, size_t sz) { _citrus_esdb_free_list(list, sz); @@ -202,7 +199,7 @@ qsort_helper(const void *first, const vo } void -iconvlist(int (*do_one) (unsigned int, const char * const *, +__bsd_iconvlist(int (*do_one) (unsigned int, const char * const *, void *), void *data) { char **list, **names; @@ -213,7 +210,7 @@ iconvlist(int (*do_one) (unsigned int, c i = 0; - if (__iconv_get_list(&list, &sz, true)) + if (__bsd___iconv_get_list(&list, &sz, true)) list = NULL; qsort((void *)list, sz, sizeof(char *), qsort_helper); while (i < sz) { @@ -222,7 +219,7 @@ iconvlist(int (*do_one) (unsigned int, c curkey = (char *)malloc(slashpos - list[i] + 2); names = (char **)malloc(sz * sizeof(char *)); if ((curkey == NULL) || (names == NULL)) { - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); return; } strlcpy(curkey, list[i], slashpos - list[i] + 1); @@ -231,7 +228,7 @@ iconvlist(int (*do_one) (unsigned int, c slashpos = strchr(list[i], '/'); curitem = (char *)malloc(strlen(slashpos) + 1); if (curitem == NULL) { - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); return; } strlcpy(curitem, &slashpos[1], strlen(slashpos) + 1); @@ -245,18 +242,18 @@ iconvlist(int (*do_one) (unsigned int, c free(names); } - __iconv_free_list(list, sz); + __bsd___iconv_free_list(list, sz); } -__inline const char -*iconv_canonicalize(const char *name) +__inline const char * +__bsd_iconv_canonicalize(const char *name) { return (_citrus_iconv_canonicalize(name)); } int -iconvctl(iconv_t cd, int request, void *argument) +__bsd_iconvctl(iconv_t cd, int request, void *argument) { struct _citrus_iconv *cv; struct iconv_hooks *hooks; @@ -308,7 +305,7 @@ iconvctl(iconv_t cd, int request, void * } void -iconv_set_relocation_prefix(const char *orig_prefix __unused, +__bsd_iconv_set_relocation_prefix(const char *orig_prefix __unused, const char *curr_prefix __unused) { Copied: stable/10/lib/libc/iconv/iconv_compat.c (from r258283, head/lib/libc/iconv/iconv_compat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/iconv/iconv_compat.c Wed Nov 20 20:24:59 2013 (r258398, copy of r258283, head/lib/libc/iconv/iconv_compat.c) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2013 Peter Wemm + * 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$ + */ + +/* + * These are ABI implementations for when the raw iconv_* symbol + * space was exposed via libc.so.7 in its early life. This is + * a transition aide, these wrappers will not normally ever be + * executed except via __sym_compat() references. + */ +#include +#include +#include "iconv-internal.h" + +size_t +__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d, + size_t * e, __uint32_t f, size_t *g) +{ + return __bsd___iconv(a, b, c, d, e, f, g); +} + +void +__iconv_free_list_compat(char ** a, size_t b) +{ + __bsd___iconv_free_list(a, b); +} + +int +__iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c) +{ + return __bsd___iconv_get_list(a, b, c); +} + +size_t +iconv_compat(iconv_t a, const char ** __restrict b, + size_t * __restrict c, char ** __restrict d, + size_t * __restrict e) +{ + return __bsd_iconv(a, b, c, d, e); +} + +const char * +iconv_canonicalize_compat(const char *a) +{ + return __bsd_iconv_canonicalize(a); +} + +int +iconv_close_compat(iconv_t a) +{ + return __bsd_iconv_close(a); +} + +iconv_t +iconv_open_compat(const char *a, const char *b) +{ + return __bsd_iconv_open(a, b); +} + +int +iconv_open_into_compat(const char *a, const char *b, iconv_allocation_t *c) +{ + return __bsd_iconv_open_into(a, b, c); +} + +void +iconv_set_relocation_prefix_compat(const char *a, const char *b) +{ + return __bsd_iconv_set_relocation_prefix(a, b); +} + +int +iconvctl_compat(iconv_t a, int b, void *c) +{ + return __bsd_iconvctl(a, b, c); +} + +void +iconvlist_compat(int (*a) (unsigned int, const char * const *, void *), void *b) +{ + return __bsd_iconvlist(a, b); +} + +int _iconv_version_compat = 0x0108; /* Magic - not used */ + +__sym_compat(__iconv, __iconv_compat, FBSD_1.2); +__sym_compat(__iconv_free_list, __iconv_free_list_compat, FBSD_1.2); +__sym_compat(__iconv_get_list, __iconv_get_list_compat, FBSD_1.2); +__sym_compat(_iconv_version, _iconv_version_compat, FBSD_1.3); +__sym_compat(iconv, iconv_compat, FBSD_1.3); +__sym_compat(iconv_canonicalize, iconv_canonicalize_compat, FBSD_1.2); +__sym_compat(iconv_close, iconv_close_compat, FBSD_1.3); +__sym_compat(iconv_open, iconv_open_compat, FBSD_1.3); +__sym_compat(iconv_open_into, iconv_open_into_compat, FBSD_1.3); +__sym_compat(iconv_set_relocation_prefix, iconv_set_relocation_prefix_compat, FBSD_1.3); +__sym_compat(iconvctl, iconvctl_compat, FBSD_1.3); +__sym_compat(iconvlist, iconvlist_compat, FBSD_1.3); Modified: stable/10/lib/libc/libc.ldscript ============================================================================== --- stable/10/lib/libc/libc.ldscript Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/lib/libc/libc.ldscript Wed Nov 20 20:24:59 2013 (r258398) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -GROUP ( @@SHLIB@@ @@LIBDIR@@/libssp_nonshared.a ) +GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a @@LIBDIR@@/libssp_nonshared.a ) Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Nov 20 19:41:00 2013 (r258397) +++ stable/10/sys/sys/param.h Wed Nov 20 20:24:59 2013 (r258398) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:25: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16421896; Wed, 20 Nov 2013 20:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05ED6271D; Wed, 20 Nov 2013 20:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKKPRHL054414; Wed, 20 Nov 2013 20:25:27 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKKPRsG054413; Wed, 20 Nov 2013 20:25:27 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201311202025.rAKKPRsG054413@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 20 Nov 2013 20:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258399 - head/sys/crypto/aesni 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:25:28 -0000 Author: jmg Date: Wed Nov 20 20:25:27 2013 New Revision: 258399 URL: http://svnweb.freebsd.org/changeset/base/258399 Log: flag that the aesni driver is sync... This means we don't waste a context switch just to call the done callback... On my machine, this improves geli/gzero decrypt performance by ~27% from 550MB/sec to ~700MB/sec... MFC after: 3 days Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Wed Nov 20 20:24:59 2013 (r258398) +++ head/sys/crypto/aesni/aesni.c Wed Nov 20 20:25:27 2013 (r258399) @@ -92,7 +92,8 @@ aesni_attach(device_t dev) sc = device_get_softc(dev); TAILQ_INIT(&sc->sessions); sc->sid = 1; - sc->cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE); + sc->cid = crypto_get_driverid(dev, + CRYPTOCAP_F_HARDWARE|CRYPTOCAP_F_SYNC); if (sc->cid < 0) { device_printf(dev, "Could not get crypto driver id.\n"); return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:28:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D31B5B10; Wed, 20 Nov 2013 20:28:01 +0000 (UTC) Received: from mail-ea0-x233.google.com (mail-ea0-x233.google.com [IPv6:2a00:1450:4013:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC4B82742; Wed, 20 Nov 2013 20:28:00 +0000 (UTC) Received: by mail-ea0-f179.google.com with SMTP id r15so4159025ead.38 for ; Wed, 20 Nov 2013 12:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=B2z23KLs6s1AR+5OquCy9sBRe/E+8EL880ZKP16oejc=; b=oIuM8/ViefQDTn4MXzPe3c9ZgMmGFpKxstlJKTz0gyKRsPbT1Yg95DGZ2NkrJODJ+E 77c+r1CHpEdNvjunYSpK2kgk+zu66tdK8BFGoII4qPqD4gecAAAXkPVMBeAc08Dvn3GQ GDC2V2H/TeoSpBPRfv+cmNxM95NePWLRFKijJzAWBB3PDVu1tLFasfuxJXbm+UFQ8gNS DuaRC1Y4iIpQWv5DDbczzlf/JbSsa2vccBhpH+/mbZnVbtHweGJdMuCzX2vdduoNPtpH vh5AQkobvD8SWLGI2/cpRJp6fxk0RVsyHZKEUv693pJdNNihDCMNyN5DCcQf1BfLWxLn Z0Qg== MIME-Version: 1.0 X-Received: by 10.14.199.1 with SMTP id w1mr3349517een.29.1384979279167; Wed, 20 Nov 2013 12:27:59 -0800 (PST) Sender: hiren.panchasara@gmail.com Received: by 10.14.127.195 with HTTP; Wed, 20 Nov 2013 12:27:59 -0800 (PST) In-Reply-To: <201309202018.r8KKIoK0033805@svn.freebsd.org> References: <201309202018.r8KKIoK0033805@svn.freebsd.org> Date: Wed, 20 Nov 2013 12:27:59 -0800 X-Google-Sender-Auth: Mfhzh7dnJl-rVBS_jIp1mDubGlw Message-ID: Subject: Re: svn commit: r255736 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/bxe sys/i386/conf sys/modules/bxe From: hiren panchasara To: David Christensen , Eric Davis Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:28:01 -0000 + Eric On Fri, Sep 20, 2013 at 1:18 PM, David Christensen wrote: > Author: davidch > Date: Fri Sep 20 20:18:49 2013 > New Revision: 255736 > URL: http://svnweb.freebsd.org/changeset/base/255736 > > Log: > Substantial rewrite of bxe(4) to add support for the BCM57712 and > BCM578XX controllers. > > Approved by: re > MFC after: 4 weeks David/Eric, Are you guys planning to mfc this back to 9? cheers, Hiren From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:37:22 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0E02F6E; Wed, 20 Nov 2013 20:37:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE61427E3; Wed, 20 Nov 2013 20:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKKbMDa058080; Wed, 20 Nov 2013 20:37:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKKbLZs058069; Wed, 20 Nov 2013 20:37:21 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311202037.rAKKbLZs058069@svn.freebsd.org> From: Devin Teske Date: Wed, 20 Nov 2013 20:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258400 - in head/usr.sbin/bsdconfig: . includes includes/include share 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:37:23 -0000 Author: dteske Date: Wed Nov 20 20:37:21 2013 New Revision: 258400 URL: http://svnweb.freebsd.org/changeset/base/258400 Log: Add new `includes' module for exploring the bsdconfig(8) API. Added: head/usr.sbin/bsdconfig/includes/ head/usr.sbin/bsdconfig/includes/INDEX (contents, props changed) head/usr.sbin/bsdconfig/includes/Makefile (contents, props changed) head/usr.sbin/bsdconfig/includes/USAGE (contents, props changed) head/usr.sbin/bsdconfig/includes/include/ head/usr.sbin/bsdconfig/includes/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/includes/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/includes/includes (contents, props changed) Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Wed Nov 20 20:25:27 2013 (r258399) +++ head/usr.sbin/bsdconfig/Makefile Wed Nov 20 20:37:21 2013 (r258400) @@ -6,6 +6,7 @@ SUBDIR= console \ dot \ examples \ include \ + includes \ mouse \ networking \ packages \ Added: head/usr.sbin/bsdconfig/includes/INDEX ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/INDEX Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,56 @@ +# Copyright (c) 2013 Devin Teske +# 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$ + +# +# Title that will be shown in the bsdconfig menu. +# +menu_title="" + +# +# A short descriptive line shown at the bottom of the bsdconfig menu. keep it +# short because any line longer than the terminal width will be truncated. +# +menu_help="" + +# +# Two-part variable that defines an action to take when `keyword' is passed on +# a bsdconfig command line. Variable takes the form "keyword|command" and +# multiple occurrences of the variable (with different `keyword's, or different +# `keyword's AND `command's) are allowed. If `command' begins with a '/' then +# the full path to the program is needed. If `command' begins with anything +# else it is a path relative to the directory this INDEX file is in. `keyword' +# can be i18n'ed but `command' is the name of a script. +# +menu_selection="includes|includes" + +# +# ------------ Items below this line do NOT need i18n translation ------------ +# +# Name of the program to be run when this menu choice is selected. If it begins +# with a '/' then the full path to the program is needed. If it begins with +# anything else it is a path relative to the directory this INDEX file is in. +# +menu_program="" Added: head/usr.sbin/bsdconfig/includes/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/Makefile Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +NO_OBJ= + +SUBDIR= include + +FILESDIR= ${LIBEXECDIR}/bsdconfig/includes +FILES= INDEX USAGE + +SCRIPTSDIR= ${FILESDIR} +SCRIPTS= includes + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/includes/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,66 @@ +# Copyright (c) 2013 Devin Teske +# 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$ + +Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] [include ...] + +OPTIONS: + -a Always use color even when output is not to a terminal. + -f Show functions for selected includes. + -F pattern + If `-f', only print functions matching pattern. Without `-f' + print only includes containing functions matching pattern. + -h Print this usage statement and exit. + -n Disable the use of color. + +EXAMPLES: + View a list of available includes: + + bsdconfig @PROGRAM_NAME@ + + View functions for all available includes (function names are + highlighted): + + bsdconfig @PROGRAM_NAME@ -f + + View functions with less(1) (function names are not highlighted): + + bsdconfig @PROGRAM_NAME@ -f | less + + View functions with less(1) and color: + + bsdconfig @PROGRAM_NAME@ -af | less -R + + View functions from `common.subr': + + bsdconfig @PROGRAM_NAME@ common.subr + + NB: The `-f' flag is implied when given an include. + + Show only functions containing the word `show' in common.subr: + + bsdconfig @PROGRAM_NAME@ -F show common + + NB: The `.subr' suffix on the end of the include is optional. Added: head/usr.sbin/bsdconfig/includes/include/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/include/Makefile Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${LIBEXECDIR}/bsdconfig/includes/include +FILES= messages.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/includes/include/messages.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/include/messages.subr Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,28 @@ +# Copyright (c) 2013 Devin Teske +# 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$ + +msg_functions_in="Functions in %s:" +msg_functions_in_matching="Functions in %s matching \`%s':" Added: head/usr.sbin/bsdconfig/includes/includes ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 20:37:21 2013 (r258400) @@ -0,0 +1,161 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +# Prevent common.subr from auto initializing debugging (this is not an inter- +# active utility that requires debugging). +# +DEBUG_SELF_INITIALIZE=NO + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="includes" +f_include_lang $BSDCFG_LIBE/include/messages.subr +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" + +############################################################ GLOBALS + +# +# Options +# +USE_COLOR=1 +SHOW_FUNCS= +FUNC_PATTERN= + +############################################################ FUNCTIONS + +# show_functions $file +# +# Show the functions in the given include file. +# +show_include() +{ + local file="${1#./}" + + local pattern="${FUNC_PATTERN:-.*}" + output=$( awk -v use_color=${USE_COLOR:-0} -v re="$pattern" ' + /^$/,/^#/ { + if ($0 ~ /^# f_/) { + if (!match($2, re)) next + if (use_color) + printf " %s%s%s\n", + substr($0, 2, RSTART), + substr($0, 2 + RSTART, RLENGTH), + substr($0, 2 + RSTART + RLENGTH) + else + print substr($0, 2) + print_more = substr($0, length($0)) == "\\" + } + while (print_more) { + getline + print substr($0, 2) + print_more = substr($0, length($0)) == "\\" + } + }' "$file" ) + if [ "$output" ]; then + if [ ! "$SHOW_FUNCS" ]; then + echo "$file" + return $SUCCESS + fi + if [ "$FUNC_PATTERN" ]; then + printf "$msg_functions_in_matching\n" \ + "$file" "$FUNC_PATTERN" + else + printf "$msg_functions_in\n" "$file" + fi + echo "$output" + echo # blank line to simplify awk(1)-based reparse + fi +} + +############################################################ MAIN + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# Are we in a terminal? +[ -t 1 ] || USE_COLOR= + +# +# Process command-line arguments +# +while getopts afF:hn flag; do + case "$flag" in + a) USE_COLOR=1 ;; + f) SHOW_FUNCS=1 ;; + F) FUNC_PATTERN="$OPTARG" ;; + n) USE_COLOR= ;; + h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm" ;; + esac +done +shift $(( $OPTIND - 1 )) + +# cd(1) to `share' dir so relative paths work for find and positional args +cd $BSDCFG_SHARE || f_die 1 "$msg_directory_not_found" "$BSDCFG_SHARE" + +# +# If given an argument, operate on it specifically (implied `-f') and exit +# +[ $# -gt 0 ] && SHOW_FUNCS=1 +for include in "$@"; do + # See if they've just omitted the `*.subr' suffix + [ -f "$include.subr" -a ! -f "$include" ] && include="$include.subr" + if [ ! -f "$include" ]; then + f_die 1 "$msg_no_such_file_or_directory" "$0" "$include" + elif [ ! -r "$include" ]; then + f_die 1 "$msg_permission_denied" "$0" "$include" + fi + show_include "$include" || f_die +done + +# Exit if we processed some include arguments +[ $# -gt 0 ] && exit $SUCCESS + +# +# Operate an all known include files +# NB: If we get this far, we had no include arguments +# +find -s . -type f -and -iname '*.subr' | while read file; do + if [ "$SHOW_FUNCS" -o "$FUNC_PATTERN" ]; then + show_include "$file" + else + echo "${file#./}" + fi +done + +exit $SUCCESS + +################################################################################ +# END +################################################################################ Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Wed Nov 20 20:25:27 2013 (r258399) +++ head/usr.sbin/bsdconfig/share/variable.subr Wed Nov 20 20:37:21 2013 (r258400) @@ -179,7 +179,7 @@ f_debugging() f_getvar $VAR_DEBUG value && [ "$value" ] } -# f_interactive() +# f_interactive # # Are we running interactively? Return error if $nonInteractive is set and non- # NULL, otherwise return success. @@ -190,7 +190,7 @@ f_interactive() ! f_getvar $VAR_NONINTERACTIVE value || [ ! "$value" ] } -# f_netinteractive() +# f_netinteractive # # Has the user specifically requested the network-portion of configuration and # setup to be performed interactively? Returns success if the user has asked @@ -205,7 +205,7 @@ f_netinteractive() f_getvar $VAR_NETINTERACTIVE value && [ "$value" ] } -# f_zfsinteractive() +# f_zfsinteractive # # Has the user specifically requested the ZFS-portion of configuration and # setup to be performed interactively? Returns success if the user has asked From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 20:37: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 947BD13E; Wed, 20 Nov 2013 20:37:48 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 559FE27EA; Wed, 20 Nov 2013 20:37:48 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 4AA2C7300B; Wed, 20 Nov 2013 21:40:04 +0100 (CET) Date: Wed, 20 Nov 2013 21:40:04 +0100 From: Luigi Rizzo To: Julian Elischer Subject: Re: svn commit: r258328 - head/sys/net Message-ID: <20131120204004.GA29017@onelab2.iet.unipi.it> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <528D1768.9000401@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <528D1768.9000401@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, "George V. Neville-Neil" , svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 20:37:48 -0000 On Wed, Nov 20, 2013 at 12:11:20PM -0800, Julian Elischer wrote: > On 11/19/13, 3:04 AM, Robert Watson wrote: > > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > > > >> Allow ethernet drivers to pass in packets connected via the > >> nextpkt pointer. > >> Handling packets in this way allows drivers to amortize work > >> during packet reception. > >> > >> Submitted by: Vijay Singh > >> Sponsored by: NetApp > > > > Currently, it is quite easy to make mistakes regarding individual > > mbuf chains vs. lists of mbuf chains. This leads me to wonder > > whether a new type, perhaps simply constructed on the stack before > > passing in, should be used for KPIs that accept lists of packets. E.g., > > > > /* > > * This structure is almost always allocated on a caller stack, so > > * cannot itself be queued without memory allocation in most cases. > > */ > > struct mbuf_queue { > > struct mbuf *mq_head; > > }; > > > > > It's hard to believe that we don't have a structure around already > that we can't use. With Luigi's comment, I wonder that there isn't an > mbuf_list structure already we can just steal. it could almost be the > current interface input queue structure. The fact is that the structure is so simple that every piece of code seems to have its own implementation. The closest thing is "struct ifqueue" in sys/net/ifq.h, but it has some unnecessary fields (e.g. a struct mtx and a few counters). sys/sys/sockbuf.h has a queue embedded in struct sockbuf sys/netinet/tcp_lro.h has one in struct lro_entry sctp and dummynet redefine their own queues, as well as a number of device drivers (dev/xen/netfrnt/mbufq.h, cxgb, ...) I am not sure I see anything worth reusing. cheers luigi From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:05:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 328379E2; Wed, 20 Nov 2013 21:05:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 218AE299A; Wed, 20 Nov 2013 21:05:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKL5Y8N069412; Wed, 20 Nov 2013 21:05:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKL5XSw069410; Wed, 20 Nov 2013 21:05:33 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311202105.rAKL5XSw069410@svn.freebsd.org> From: Devin Teske Date: Wed, 20 Nov 2013 21:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258401 - head/usr.sbin/bsdconfig/includes 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:05:34 -0000 Author: dteske Date: Wed Nov 20 21:05:33 2013 New Revision: 258401 URL: http://svnweb.freebsd.org/changeset/base/258401 Log: Add a `-d' flag for printing the description of each function. Modified: head/usr.sbin/bsdconfig/includes/USAGE head/usr.sbin/bsdconfig/includes/includes Modified: head/usr.sbin/bsdconfig/includes/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 20:37:21 2013 (r258400) +++ head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 21:05:33 2013 (r258401) @@ -28,6 +28,7 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS OPTIONS: -a Always use color even when output is not to a terminal. + -d Print the description for each function selected. -f Show functions for selected includes. -F pattern If `-f', only print functions matching pattern. Without `-f' @@ -64,3 +65,7 @@ EXAMPLES: bsdconfig @PROGRAM_NAME@ -F show common NB: The `.subr' suffix on the end of the include is optional. + + Show descriptions of each of the `show' functions: + + bsdconfig @PROGRAM_NAME@ -dfF show Modified: head/usr.sbin/bsdconfig/includes/includes ============================================================================== --- head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 20:37:21 2013 (r258400) +++ head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 21:05:33 2013 (r258401) @@ -29,7 +29,7 @@ ############################################################ INCLUDES # Prevent common.subr from auto initializing debugging (this is not an inter- -# active utility that requires debugging). +# active utility that requires debugging; also `-d' has been repurposed). # DEBUG_SELF_INITIALIZE=NO @@ -50,6 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_ # Options # USE_COLOR=1 +SHOW_DESC= SHOW_FUNCS= FUNC_PATTERN= @@ -64,20 +65,33 @@ show_include() local file="${1#./}" local pattern="${FUNC_PATTERN:-.*}" - output=$( awk -v use_color=${USE_COLOR:-0} -v re="$pattern" ' + output=$( awk \ + -v use_color=${USE_COLOR:-0} \ + -v re="$pattern" \ + -v show_desc=${SHOW_DESC:-0} ' /^$/,/^#/ { if ($0 ~ /^# f_/) { if (!match($2, re)) next if (use_color) - printf " %s%s%s\n", + printf "+%s%s%s\n", substr($0, 2, RSTART), substr($0, 2 + RSTART, RLENGTH), substr($0, 2 + RSTART + RLENGTH) else print substr($0, 2) - print_more = substr($0, length($0)) == "\\" + if (show_desc) + print_more = 1 + else + print_more = substr($0, length($0)) == "\\" } - while (print_more) { + if (show_desc && print_more) { + getline + while ($0 ~ /^#/) { + print substr($0, 2) + getline + } + print_more = 0 + } else while (print_more) { getline print substr($0, 2) print_more = substr($0, length($0)) == "\\" @@ -89,10 +103,10 @@ show_include() return $SUCCESS fi if [ "$FUNC_PATTERN" ]; then - printf "$msg_functions_in_matching\n" \ + printf ">>> $msg_functions_in_matching\n" \ "$file" "$FUNC_PATTERN" else - printf "$msg_functions_in\n" "$file" + printf ">>> $msg_functions_in\n" "$file" fi echo "$output" echo # blank line to simplify awk(1)-based reparse @@ -110,9 +124,10 @@ show_include() # # Process command-line arguments # -while getopts afF:hn flag; do +while getopts adfF:hn flag; do case "$flag" in a) USE_COLOR=1 ;; + d) SHOW_DESC=1 ;; f) SHOW_FUNCS=1 ;; F) FUNC_PATTERN="$OPTARG" ;; n) USE_COLOR= ;; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:16: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95A38FCF; Wed, 20 Nov 2013 21:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 851812A40; Wed, 20 Nov 2013 21:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKLGrrs073403; Wed, 20 Nov 2013 21:16:53 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKLGrdB073402; Wed, 20 Nov 2013 21:16:53 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201311202116.rAKLGrdB073402@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 20 Nov 2013 21:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258402 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:16:53 -0000 Author: jmg Date: Wed Nov 20 21:16:53 2013 New Revision: 258402 URL: http://svnweb.freebsd.org/changeset/base/258402 Log: fix a use after free, jsegdep_merge will free wk, avoid the next check... CID: 1006098 Sponsored by: Imaginary Forces Reviewed by: mckusick MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Nov 20 21:05:33 2013 (r258401) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Nov 20 21:16:53 2013 (r258402) @@ -1096,7 +1096,7 @@ jwork_move(dst, src) LIST_FOREACH_SAFE(wk, dst, wk_list, wkn) { if (wk->wk_type == D_JSEGDEP) jsegdep = jsegdep_merge(WK_JSEGDEP(wk), jsegdep); - if (wk->wk_type == D_FREEDEP) + else if (wk->wk_type == D_FREEDEP) freedep = freedep_merge(WK_FREEDEP(wk), freedep); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:19:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 799CF1E0; Wed, 20 Nov 2013 21:19:19 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3403C2A52; Wed, 20 Nov 2013 21:19:18 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAKLJGA4006077 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 13:19:17 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D274E.5020007@freebsd.org> Date: Wed, 20 Nov 2013 13:19:10 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Peter Wemm , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r258398 - in stable/10: . include lib lib/libc lib/libc/iconv lib/libc_nonshared sys/sys References: <201311202025.rAKKP0ce054293@svn.freebsd.org> In-Reply-To: <201311202025.rAKKP0ce054293@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:19:19 -0000 On 11/20/13, 12:25 PM, Peter Wemm wrote: > +int _iconv_version_compat = 0x0108; /* Magic - not used */ > + > can you illuminate this a bit more? is it magic, or is it not used? From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:21:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12F9434A; Wed, 20 Nov 2013 21:21:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0314E2A93; Wed, 20 Nov 2013 21:21:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKLLT5K076011; Wed, 20 Nov 2013 21:21:29 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKLLTXm076010; Wed, 20 Nov 2013 21:21:29 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201311202121.rAKLLTXm076010@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 20 Nov 2013 21:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258403 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:21:30 -0000 Author: jmg Date: Wed Nov 20 21:21:29 2013 New Revision: 258403 URL: http://svnweb.freebsd.org/changeset/base/258403 Log: fix white space... MFC after: 1 week Modified: head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Wed Nov 20 21:16:53 2013 (r258402) +++ head/sys/ufs/ffs/softdep.h Wed Nov 20 21:21:29 2013 (r258403) @@ -132,7 +132,7 @@ #define INPROGRESS 0x001000 /* dirrem, freeblks, freefrag, freefile only */ #define UFS1FMT 0x002000 /* indirdep only */ #define EXTDATA 0x004000 /* allocdirect only */ -#define ONWORKLIST 0x008000 +#define ONWORKLIST 0x008000 #define IOWAITING 0x010000 /* Thread is waiting for IO to complete. */ #define ONDEPLIST 0x020000 /* Structure is on a dependency list. */ #define UNLINKED 0x040000 /* inodedep has been unlinked. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:27: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E064552 for ; Wed, 20 Nov 2013 21:27:26 +0000 (UTC) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AF482AD0 for ; Wed, 20 Nov 2013 21:27:25 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id oz11so2020094veb.32 for ; Wed, 20 Nov 2013 13:27:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=szL6FY91JM8xT4cccIJgMT5ruBqcsTMjstcgOb+OK1I=; b=RUXKkbTM0A8s50r9PGkIpasbD171PEHbLH8DhFpJt6dkWuF8zW13DqCIgWCOooxNo0 DU02KLsB+uOzEQMPUXhszCIlLFOn4iDlkYmVxoPcbWY4aXpLKv2rz/cA68wSx+svj8fl TGiQe/ydXAODXMhuVMAXhrk0iygJ9zDrK7WDYCxietWhEi7haqlefKvGwNQPR/fV3hmU 7Ar+WoxXCSSt3+oSxMXSM+PAvW+Cln6kV6Qire8nuOicpY4lONNWetPYlQT8OLW/6F05 W1WjivEP4otG6OZnjLgqU2wY50pc/76IpbkGUp+hYYOQWkTMxRr9fzVRg+vSnzpLbQiO TygQ== X-Gm-Message-State: ALoCoQnk9byf96FvY1DTaTffD9FaT5yAG3iLYehLDXF+HgDcfC+s4x5Lx3iPHLugc7f4LZIh/zrf X-Received: by 10.52.116.74 with SMTP id ju10mr1728737vdb.20.1384979424914; Wed, 20 Nov 2013 12:30:24 -0800 (PST) MIME-Version: 1.0 Sender: edavis@insanum.com Received: by 10.52.184.98 with HTTP; Wed, 20 Nov 2013 12:29:44 -0800 (PST) In-Reply-To: References: <201309202018.r8KKIoK0033805@svn.freebsd.org> From: Eric Davis Date: Wed, 20 Nov 2013 12:29:44 -0800 X-Google-Sender-Auth: CLbP_IsevLopfTFkYKlQmcqGRZM Message-ID: Subject: Re: svn commit: r255736 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/bxe sys/i386/conf sys/modules/bxe To: hiren panchasara Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: svn-src-head , svn-src-all , src-committers , David Christensen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:27:26 -0000 Hi Hiren, Yes I am planning on it. - eric On Wed, Nov 20, 2013 at 12:27 PM, hiren panchasara wrote: > + Eric > > On Fri, Sep 20, 2013 at 1:18 PM, David Christensen > wrote: > > Author: davidch > > Date: Fri Sep 20 20:18:49 2013 > > New Revision: 255736 > > URL: http://svnweb.freebsd.org/changeset/base/255736 > > > > Log: > > Substantial rewrite of bxe(4) to add support for the BCM57712 and > > BCM578XX controllers. > > > > Approved by: re > > MFC after: 4 weeks > > David/Eric, > > Are you guys planning to mfc this back to 9? > > cheers, > Hiren > From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 21:31: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E718A725; Wed, 20 Nov 2013 21:31:20 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5F132B2A; Wed, 20 Nov 2013 21:31:20 +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 rAKLVJ3J088184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 13:31:19 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rAKLVJPd088183; Wed, 20 Nov 2013 13:31:19 -0800 (PST) (envelope-from jmg) Date: Wed, 20 Nov 2013 13:31:19 -0800 From: John-Mark Gurney To: Grzegorz Bernacki Subject: Re: svn commit: r258387 - head/sys/dev/nand Message-ID: <20131120213119.GL2279@funkthat.com> References: <201311201110.rAKBAOMY061212@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311201110.rAKBAOMY061212@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 20 Nov 2013 13:31:20 -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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 21:31:21 -0000 Grzegorz Bernacki wrote this message on Wed, Nov 20, 2013 at 11:10 +0000: > Author: gber > Date: Wed Nov 20 11:10:23 2013 > New Revision: 258387 > URL: http://svnweb.freebsd.org/changeset/base/258387 > > Log: > Split raw reading/programming into smaller chunks to avoid allocating too > big chunk of kernel memory. Validate size of data. Add error handling to > avoid calling copyout() when data has not been read correctly. > > Reviewed by: zbb > Reported by: x90c > MFC after: 2 days > > Modified: > head/sys/dev/nand/nand_cdev.c > head/sys/dev/nand/nand_geom.c Looks like this change errors w/ gcc: http://tinderbox.freebsd.org/tinderbox-head-noclang-build-HEAD-armv6-arm.brief -- 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 Wed Nov 20 22:02:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED356308; Wed, 20 Nov 2013 22:02:27 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5915D2CCC; Wed, 20 Nov 2013 22:02:27 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id i13so2574116qae.3 for ; Wed, 20 Nov 2013 14:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HQFZhn/dLqkdw1iISOkod7K0WU/e+sX2vtPWRWn3csw=; b=FrEz4seDFuHpbprYomYXLQuE9UOhnywGQgvic2EH8H74GdrxF5vWx30NcMsVRD13w2 33W+VzQO+Sm6fe2B8kad/8LKNO4g+96dmxd++l2MH5hyrHwd4XSo2LMNSRK86Vg6hgoc lSx+lrOupDE0nt0AgxX57W2VrkIyU8EWkP4v5NcD8NdAwWzetnr02Kz0T8opNI11bkmJ V3xs1GsFEmQKjjjMmmBBfCIXSj2n3l4bXIvzxMaxkZraYMN/VQ3200bEifhZ0cz8ZoS2 bqPz2OA1jghdmbFOy17kV5NHxSEMPcn2FsG7v5LX7TZ5WEkIbeUJd0IABcULvI6w9gwp 8tXw== MIME-Version: 1.0 X-Received: by 10.224.64.200 with SMTP id f8mr5675355qai.55.1384984946603; Wed, 20 Nov 2013 14:02:26 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Wed, 20 Nov 2013 14:02:26 -0800 (PST) In-Reply-To: <201311182258.rAIMwEFd048783@svn.freebsd.org> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> Date: Wed, 20 Nov 2013 14:02:26 -0800 X-Google-Sender-Auth: ki1OX3h-CVp1suO6clamTiMqGqo Message-ID: Subject: Re: svn commit: r258328 - head/sys/net From: Adrian Chadd To: "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , FreeBSD Net 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 22:02:28 -0000 Can we revert this and just quickly put together something else that won't potentially come back to bite us with weird side effects? My suggestions (and I'm happy to do this work if needed): * create a lightweight mbuf queue representation so an mbuf list isn't just the mbuf header pointer; * create a new ether input (say, ether_input_multi) that takes an mbuf list, so existing driver code does the right thing. After that it'd be nice to write a set of mbuf list macros for abstract the whole queue, dequeue, concat, iterate, etc (like sys/queue.h, but for mbufs.) What do people think? (I've been doing it for m->next chained things, but not m->m_nextpkt things..) -adrian On 18 November 2013 14:58, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Nov 18 22:58:14 2013 > New Revision: 258328 > URL: http://svnweb.freebsd.org/changeset/base/258328 > > Log: > Allow ethernet drivers to pass in packets connected via the nextpkt pointer. > Handling packets in this way allows drivers to amortize work during packet reception. > > Submitted by: Vijay Singh > Sponsored by: NetApp > > Modified: > head/sys/net/if_ethersubr.c > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) > +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) > @@ -708,13 +708,25 @@ static void > ether_input(struct ifnet *ifp, struct mbuf *m) > { > > + struct mbuf *mn; > + > /* > - * We will rely on rcvif being set properly in the deferred context, > - * so assert it is correct here. > + * The drivers are allowed to pass in a chain of packets linked with > + * m_nextpkt. We split them up into separate packets here and pass > + * them up. This allows the drivers to amortize the receive lock. > */ > - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + while (m) { > + mn = m->m_nextpkt; > + m->m_nextpkt = NULL; > > - netisr_dispatch(NETISR_ETHER, m); > + /* > + * We will rely on rcvif being set properly in the deferred context, > + * so assert it is correct here. > + */ > + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); > + netisr_dispatch(NETISR_ETHER, m); > + m = mn; > + } > } > > /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 22:11: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E3B79A; Wed, 20 Nov 2013 22:11:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A42F92D5C; Wed, 20 Nov 2013 22:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKMBhsU093187; Wed, 20 Nov 2013 22:11:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKMBhSx093185; Wed, 20 Nov 2013 22:11:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311202211.rAKMBhSx093185@svn.freebsd.org> From: Devin Teske Date: Wed, 20 Nov 2013 22:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258406 - head/usr.sbin/bsdconfig/includes 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 22:11:43 -0000 Author: dteske Date: Wed Nov 20 22:11:42 2013 New Revision: 258406 URL: http://svnweb.freebsd.org/changeset/base/258406 Log: Make `-d' implicitly enable `-f' for simplification. Modified: head/usr.sbin/bsdconfig/includes/USAGE head/usr.sbin/bsdconfig/includes/includes Modified: head/usr.sbin/bsdconfig/includes/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 21:59:24 2013 (r258405) +++ head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 22:11:42 2013 (r258406) @@ -28,7 +28,7 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS OPTIONS: -a Always use color even when output is not to a terminal. - -d Print the description for each function selected. + -d Print description for each function selected. Implies `-f'. -f Show functions for selected includes. -F pattern If `-f', only print functions matching pattern. Without `-f' @@ -68,4 +68,4 @@ EXAMPLES: Show descriptions of each of the `show' functions: - bsdconfig @PROGRAM_NAME@ -dfF show + bsdconfig @PROGRAM_NAME@ -dF show Modified: head/usr.sbin/bsdconfig/includes/includes ============================================================================== --- head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 21:59:24 2013 (r258405) +++ head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 22:11:42 2013 (r258406) @@ -127,7 +127,7 @@ show_include() while getopts adfF:hn flag; do case "$flag" in a) USE_COLOR=1 ;; - d) SHOW_DESC=1 ;; + d) SHOW_DESC=1 SHOW_FUNCS=1 ;; f) SHOW_FUNCS=1 ;; F) FUNC_PATTERN="$OPTARG" ;; n) USE_COLOR= ;; From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 22:12:22 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 831EF8DB; Wed, 20 Nov 2013 22:12:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 724942D64; Wed, 20 Nov 2013 22:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKMCMWs093338; Wed, 20 Nov 2013 22:12:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKMCMcj093337; Wed, 20 Nov 2013 22:12:22 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311202212.rAKMCMcj093337@svn.freebsd.org> From: Devin Teske Date: Wed, 20 Nov 2013 22:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258407 - head/usr.sbin/bsdconfig/share/media 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 22:12:22 -0000 Author: dteske Date: Wed Nov 20 22:12:21 2013 New Revision: 258407 URL: http://svnweb.freebsd.org/changeset/base/258407 Log: Update function description for API tool: bsdconfig includes -dF f_validate_hostname Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Nov 20 22:11:42 2013 (r258406) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Nov 20 22:12:21 2013 (r258407) @@ -110,10 +110,11 @@ f_struct_define DHCP_LEASE \ # begin or end with a hyphen). # 3 One or more individual labels within the hostname are null. # -# f_dialog_validate_hostname $hostname +# To call this function and display an appropriate error message to the user +# based on the above error codes, use the following function defined in +# dialog.subr: # -# If the hostname is determined to be invalid, the appropriate error will be -# displayed using the f_show_msg function. +# f_dialog_validate_hostname $hostname # f_validate_hostname() { From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 22:29:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE8E9D27; Wed, 20 Nov 2013 22:29:56 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2AB2E11; Wed, 20 Nov 2013 22:29:56 +0000 (UTC) Received: from [209.249.190.124] (port=55801 helo=gnnmac.hudson-trading.com) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1VjGHP-0008Qy-E7; Wed, 20 Nov 2013 17:29:53 -0500 Content-Type: multipart/signed; boundary="Apple-Mail=_E7352C3B-1624-44C1-8794-7B37258E98DD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r258328 - head/sys/net From: George Neville-Neil In-Reply-To: Date: Wed, 20 Nov 2013 17:29:37 -0500 Message-Id: <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1822) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: "svn-src-head@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "freebsd-arch@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 22:29:56 -0000 --Apple-Mail=_E7352C3B-1624-44C1-8794-7B37258E98DD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 20, 2013, at 17:02 , Adrian Chadd wrote: > Can we revert this and just quickly put together something else that > won't potentially come back to bite us with weird side effects? >=20 > My suggestions (and I'm happy to do this work if needed): >=20 > * create a lightweight mbuf queue representation so an mbuf list isn't > just the mbuf header pointer; > * create a new ether input (say, ether_input_multi) that takes an mbuf > list, so existing driver code does the right thing. >=20 > After that it'd be nice to write a set of mbuf list macros for > abstract the whole queue, dequeue, concat, iterate, etc (like > sys/queue.h, but for mbufs.) >=20 > What do people think? >=20 > (I've been doing it for m->next chained things, but not m->m_nextpkt = things..) I think the right way to do this is to move forwards and not backwards. This change has the nice effect of not breaking anything else in the tree while providing us with a feature that will be useful. =20 If you want to add an ether_input_multi() that might make sense as an adjunct to what=92s there now. Best, Geoge =20 --Apple-Mail=_E7352C3B-1624-44C1-8794-7B37258E98DD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlKNN9EACgkQYdh2wUQKM9IhNwCgxNJQY383jR+pHPAg6DuJc4/a O4wAnirp4BKvFIPw48tB7ddl+po7Fb2G =YkRf -----END PGP SIGNATURE----- --Apple-Mail=_E7352C3B-1624-44C1-8794-7B37258E98DD-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 20 23:06:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B1F4CC5; Wed, 20 Nov 2013 23:06:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89F222043; Wed, 20 Nov 2013 23:06:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAKN6s3R010622; Wed, 20 Nov 2013 23:06:54 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAKN6sMV010621; Wed, 20 Nov 2013 23:06:54 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201311202306.rAKN6sMV010621@svn.freebsd.org> From: Olivier Houchard Date: Wed, 20 Nov 2013 23:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258410 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2013 23:06:54 -0000 Author: cognet Date: Wed Nov 20 23:06:54 2013 New Revision: 258410 URL: http://svnweb.freebsd.org/changeset/base/258410 Log: In pmap_unmapdev(), remember the size, and use that as an argument to kva_free(), or we'd end up always passing it a size of 0, and for some strange reason it doesn't seem to like it. Modified: head/sys/arm/arm/devmap.c Modified: head/sys/arm/arm/devmap.c ============================================================================== --- head/sys/arm/arm/devmap.c Wed Nov 20 23:02:09 2013 (r258409) +++ head/sys/arm/arm/devmap.c Wed Nov 20 23:06:54 2013 (r258410) @@ -240,6 +240,7 @@ void pmap_unmapdev(vm_offset_t va, vm_size_t size) { vm_offset_t tmpva, offset; + vm_size_t origsize = size; offset = va & PAGE_MASK; va = trunc_page(va); @@ -251,6 +252,6 @@ pmap_unmapdev(vm_offset_t va, vm_size_t tmpva += PAGE_SIZE; } - kva_free(va, size); + kva_free(va, origsize); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 00:00:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CD4CAE0; Thu, 21 Nov 2013 00:00:36 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id E0D552317; Thu, 21 Nov 2013 00:00:34 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 6093F7300A; Thu, 21 Nov 2013 01:02:45 +0100 (CET) Date: Thu, 21 Nov 2013 01:02:45 +0100 From: Luigi Rizzo To: George Neville-Neil Subject: Re: svn commit: r258328 - head/sys/net Message-ID: <20131121000245.GA30549@onelab2.iet.unipi.it> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Adrian Chadd , "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 00:00:36 -0000 On Wed, Nov 20, 2013 at 05:29:37PM -0500, George Neville-Neil wrote: > > On Nov 20, 2013, at 17:02 , Adrian Chadd wrote: > > > Can we revert this and just quickly put together something else that > > won't potentially come back to bite us with weird side effects? > > > > My suggestions (and I'm happy to do this work if needed): > > > > * create a lightweight mbuf queue representation so an mbuf list isn't > > just the mbuf header pointer; > > * create a new ether input (say, ether_input_multi) that takes an mbuf > > list, so existing driver code does the right thing. > > > > After that it'd be nice to write a set of mbuf list macros for > > abstract the whole queue, dequeue, concat, iterate, etc (like > > sys/queue.h, but for mbufs.) > > > > What do people think? > > > > (I've been doing it for m->next chained things, but not m->m_nextpkt things..) > > I think the right way to do this is to move forwards and not backwards. > This change has the nice effect of not breaking anything else in the > tree while providing us with a feature that will be useful. I am a bit torn on this. George is right - we should move forward, and we have been discussing this trivial change for two years. It is impossible to tell when someone will find the time to implement the mbuf queue and the new method (more on this later). So we should not back it out. At the same time: in principle this change does not break anything, but Robert is right that some of the 50-100 drivers we have might forget to clear m_nextpkt and cause trouble. So it would be nice to implement some protection, maybe something as simple as setting a flag in the first mbuf to tell that this is a chain and not a single mbuf. We have 12 M_PROTO* flags to use. For the next step: I am still wondering what is the best way to implement an alternate ifp->if_input_multi method (which takes an mbuf queue as an argument, and can be checked by the compiler). I am not too fond of having two different input methods, as it complicates life when one has to intercept packets. On the other hand, globally changing all drivers to use the if_input_multi() method is too much trouble, so i suspect we will have to come up with some nice trick, e.g. use a pseudo mbuf with m_type = MT_MBQUEUE and overload the m_hdr fields as queue pointers. cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 00:07:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67CBCE2D; Thu, 21 Nov 2013 00:07:09 +0000 (UTC) Received: from mail-qe0-x235.google.com (mail-qe0-x235.google.com [IPv6:2607:f8b0:400d:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7EDF236D; Thu, 21 Nov 2013 00:07:08 +0000 (UTC) Received: by mail-qe0-f53.google.com with SMTP id cy11so6858980qeb.12 for ; Wed, 20 Nov 2013 16:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=KajDMffiIXncp1WKPF9oXTEogDIzTZoJnsZewsmr2v8=; b=bb5uCOqzwFDPLeDtWrLPQHTspQiCQw/FjzDGq5dn2zznM8FsTnKl3FJ07qJtLqm3rp LdBs86y1eJy/W/dqUUskphKO8PC474dmlUkIX18/qZBCwxjes6SLZ6kD6pDvGgy/h5bI dYHKtz2iy1z+5n473RgGIkMOHnG1V47UcdKnS30VRYU3CvvdK17JzY472PAwazvv4eWc +UdSxZ4R9tlbgJaky1FNSfTW5XkBKWsoxWRmFAnvbQPe3Ug5fBZs1S37ugy80BjRPd60 B0eAUBElEVAaEEwafM5IAh2qOplByAReAvVzbD7QjT5KFbjcJc8y9iK+C1IRVHBkFhLO uD6A== MIME-Version: 1.0 X-Received: by 10.224.12.10 with SMTP id v10mr6394090qav.98.1384992427830; Wed, 20 Nov 2013 16:07:07 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Wed, 20 Nov 2013 16:07:07 -0800 (PST) In-Reply-To: <20131121000245.GA30549@onelab2.iet.unipi.it> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> <20131121000245.GA30549@onelab2.iet.unipi.it> Date: Wed, 20 Nov 2013 16:07:07 -0800 X-Google-Sender-Auth: WL_16bDMg3EIC-et8hOOltYtOIc Message-ID: Subject: Re: svn commit: r258328 - head/sys/net From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , George Neville-Neil , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 00:07:09 -0000 Hi, We should migrate drivers to use a multi-input method where it's appropriate. It's the same pain as if_transmit() is/was. I'd really like to avoid having hacky solutions like mbufs with magic types. If we're going down that path, we should create a correct inline messaging mechanism that includes arbitrary messages in the stream, where some may or may not be mbufs. Magic mbufs just makes me want to tear out my eyes a little. So, the reason I'd like to back it out is because we should be doing it via a multi method with some type that represents an mbuf list. If George doesn't mind, I'll add a multi input method, move this stuff into it, and make ether_input just be single frames. -adrian From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 00:32:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 999C24C2; Thu, 21 Nov 2013 00:32:49 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 56CEF24EB; Thu, 21 Nov 2013 00:32:49 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 975807300A; Thu, 21 Nov 2013 01:35:06 +0100 (CET) Date: Thu, 21 Nov 2013 01:35:06 +0100 From: Luigi Rizzo To: Adrian Chadd Subject: Re: svn commit: r258328 - head/sys/net Message-ID: <20131121003506.GA30962@onelab2.iet.unipi.it> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> <20131121000245.GA30549@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , George Neville-Neil , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 00:32:49 -0000 On Wed, Nov 20, 2013 at 04:07:07PM -0800, Adrian Chadd wrote: > Hi, > > We should migrate drivers to use a multi-input method where it's > appropriate. It's the same pain as if_transmit() is/was. right, and i think that is very confusing and i'd rather not replicate the experience. But what is your plan, have both if_input and if_input_multi ? And then make the vlan and all similar filters intercept both ? Because all of the existing options have pros and cons: 1. having both if_input and if_input_multi is visually cleaner but requires extending ifnet and some convoluted code in the initialization (same as if_transmit) 2. just if_input with typed mbufs is less clean but has the big advantage thay you only need to change ether_input() (and equivalent for other L2 protocols), and it is not error prone 3. having only if_input_multi (even without renaming if_input) requires you to change all the 100+ drivers. It seems to me that #2 at least preserves binary compatibility with driver modules and is easier to backport to other versions of FreeBSD, this is why i prefer it. my two cents... cheers luigi > I'd really like to avoid having hacky solutions like mbufs with magic > types. If we're going down that path, we should create a correct > inline messaging mechanism that includes arbitrary messages in the > stream, where some may or may not be mbufs. Magic mbufs just makes me > want to tear out my eyes a little. > > So, the reason I'd like to back it out is because we should be doing > it via a multi method with some type that represents an mbuf list. If > George doesn't mind, I'll add a multi input method, move this stuff > into it, and make ether_input just be single frames. > > > > -adrian From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 00: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6985B97; Thu, 21 Nov 2013 00:54:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9704725E8; Thu, 21 Nov 2013 00:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL0sQk5047325; Thu, 21 Nov 2013 00:54:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL0sQst047324; Thu, 21 Nov 2013 00:54:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311210054.rAL0sQst047324@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 00:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258411 - head/usr.sbin/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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 00:54:26 -0000 Author: dteske Date: Thu Nov 21 00:54:26 2013 New Revision: 258411 URL: http://svnweb.freebsd.org/changeset/base/258411 Log: Revert SVN r257830 -- that feature was annoying and was removed long ago. Was a momentary memory lapse induced by old code that was lying in my ~/bin Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Wed Nov 20 23:06:54 2013 (r258410) +++ head/usr.sbin/sysrc/sysrc.8 Thu Nov 21 00:54:26 2013 (r258411) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 7, 2013 +.Dd Nov 20, 2013 .Dt SYSRC 8 .Os .Sh NAME @@ -185,7 +185,7 @@ be called repeatedly). .Sh ENVIRONMENT The following environment variables are referenced by .Nm : -.Bl -tag -width ".Ev SYSRC_VERBOSE" +.Bl -tag -width ".Ev RC_DEFAULTS" .It Ev RC_CONFS Override default .Ql rc_conf_files @@ -194,9 +194,6 @@ Override default Location of .Ql /etc/defaults/rc.conf file. -.It Ev SYSRC_VERBOSE -Default verbosity. -Set to non-NULL to enable. .El .Sh DEPENDENCIES The following standard commands are required by From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 01:08: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79524DF7; Thu, 21 Nov 2013 01:08:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59E5C2675; Thu, 21 Nov 2013 01:08:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL18CMk051380; Thu, 21 Nov 2013 01:08:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL18AoQ051365; Thu, 21 Nov 2013 01:08:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311210108.rAL18AoQ051365@svn.freebsd.org> From: Ian Lepore Date: Thu, 21 Nov 2013 01:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258412 - in head/sys/arm: at91 econa s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 01:08:12 -0000 Author: ian Date: Thu Nov 21 01:08:10 2013 New Revision: 258412 URL: http://svnweb.freebsd.org/changeset/base/258412 Log: Call cpu_setup() from the initarm() routine on platforms that don't use the common FDT-aware initarm() in arm/machdep.c. Pointed out by: cognet Pointy hat to: ian Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/at91/at91_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -604,6 +604,7 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); + cpu_setup(""); set_stackptrs(0); Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/econa/econa_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -309,6 +309,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Set stack for exception handlers */ data_abort_handler_address = (u_int)data_abort_handler; Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -355,6 +355,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Disable all peripheral interrupts */ ioreg_write32(S3C24X0_INTCTL_BASE + INTCTL_INTMSK, ~0); Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/sa11x0/assabet_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -371,6 +371,7 @@ initarm(struct arm_boot_params *abp) cpufunc_control(0x337f, 0x107d); arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); + cpu_setup(""); pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000; Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -334,6 +334,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -335,6 +335,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -320,6 +320,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + i80321_calibrate_delay(); i81342_sdram_bounds(&obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -405,6 +405,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* ready to setup the console (XXX move earlier if possible) */ cninit(); /* Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Thu Nov 21 00:54:26 2013 (r258411) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Thu Nov 21 01:08:10 2013 (r258412) @@ -317,6 +317,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* * Sort out bus_space for on-board devices. From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 01:27: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 720F0200; Thu, 21 Nov 2013 01:27:24 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DEF0E2754; Thu, 21 Nov 2013 01:27:23 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAL1RKmp006812 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 17:27:22 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D6173.4080406@freebsd.org> Date: Wed, 20 Nov 2013 17:27:15 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Adrian Chadd , "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , FreeBSD Net Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 01:27:24 -0000 On 11/20/13, 2:02 PM, Adrian Chadd wrote: > Can we revert this and just quickly put together something else that > won't potentially come back to bite us with weird side effects? > > My suggestions (and I'm happy to do this work if needed): > > * create a lightweight mbuf queue representation so an mbuf list isn't > just the mbuf header pointer; > * create a new ether input (say, ether_input_multi) that takes an mbuf > list, so existing driver code does the right thing. > > After that it'd be nice to write a set of mbuf list macros for > abstract the whole queue, dequeue, concat, iterate, etc (like > sys/queue.h, but for mbufs.) > > What do people think? > > (I've been doing it for m->next chained things, but not m->m_nextpkt things..) I was thinking: new interfaces.. (your -multi names sound good). macros for handling said lists so that people don't screw them up Old drivers run with no change. > > > > -adrian > > > On 18 November 2013 14:58, George V. Neville-Neil wrote: >> Author: gnn >> Date: Mon Nov 18 22:58:14 2013 >> New Revision: 258328 >> URL: http://svnweb.freebsd.org/changeset/base/258328 >> >> Log: >> Allow ethernet drivers to pass in packets connected via the nextpkt pointer. >> Handling packets in this way allows drivers to amortize work during packet reception. >> >> Submitted by: Vijay Singh >> Sponsored by: NetApp >> >> Modified: >> head/sys/net/if_ethersubr.c >> >> Modified: head/sys/net/if_ethersubr.c >> ============================================================================== >> --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) >> +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) >> @@ -708,13 +708,25 @@ static void >> ether_input(struct ifnet *ifp, struct mbuf *m) >> { >> >> + struct mbuf *mn; >> + >> /* >> - * We will rely on rcvif being set properly in the deferred context, >> - * so assert it is correct here. >> + * The drivers are allowed to pass in a chain of packets linked with >> + * m_nextpkt. We split them up into separate packets here and pass >> + * them up. This allows the drivers to amortize the receive lock. >> */ >> - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); >> + while (m) { >> + mn = m->m_nextpkt; >> + m->m_nextpkt = NULL; >> >> - netisr_dispatch(NETISR_ETHER, m); >> + /* >> + * We will rely on rcvif being set properly in the deferred context, >> + * so assert it is correct here. >> + */ >> + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); >> + netisr_dispatch(NETISR_ETHER, m); >> + m = mn; >> + } >> } >> >> /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 01:31: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99B77523; Thu, 21 Nov 2013 01:31:53 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6008327A0; Thu, 21 Nov 2013 01:31:53 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rAL1Vku3006851 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 20 Nov 2013 17:31:47 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <528D627D.2020009@freebsd.org> Date: Wed, 20 Nov 2013 17:31:41 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Luigi Rizzo , Adrian Chadd Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> <20131121000245.GA30549@onelab2.iet.unipi.it> <20131121003506.GA30962@onelab2.iet.unipi.it> In-Reply-To: <20131121003506.GA30962@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , George Neville-Neil , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 01:31:53 -0000 On 11/20/13, 4:35 PM, Luigi Rizzo wrote: > On Wed, Nov 20, 2013 at 04:07:07PM -0800, Adrian Chadd wrote: >> Hi, >> >> We should migrate drivers to use a multi-input method where it's >> appropriate. It's the same pain as if_transmit() is/was. > right, and i think that is very confusing and i'd rather > not replicate the experience. > > But what is your plan, have both if_input and if_input_multi ? > And then make the vlan and all similar filters intercept both ? > Because all of the existing options have pros and cons: > > 1. having both if_input and if_input_multi is visually cleaner > but requires extending ifnet and some convoluted code in the > initialization (same as if_transmit) > > 2. just if_input with typed mbufs is less clean but has the big > advantage thay you only need to change ether_input() (and equivalent > for other L2 protocols), and it is not error prone if_input_multi() or whatever it is called is just this patch split into two bits. in the simple case it just calls the single one multiple times, just like this patch does. it is clean from teh compiler's point of view, > > 3. having only if_input_multi (even without renaming if_input) > requires you to change all the 100+ drivers. > > It seems to me that #2 at least preserves binary compatibility > with driver modules and is easier to backport to other versions > of FreeBSD, this is why i prefer it. > > my two cents... > > cheers > luigi > >> I'd really like to avoid having hacky solutions like mbufs with magic >> types. If we're going down that path, we should create a correct >> inline messaging mechanism that includes arbitrary messages in the >> stream, where some may or may not be mbufs. Magic mbufs just makes me >> want to tear out my eyes a little. >> >> So, the reason I'd like to back it out is because we should be doing >> it via a multi method with some type that represents an mbuf list. If >> George doesn't mind, I'll add a multi input method, move this stuff >> into it, and make ether_input just be single frames. >> >> >> >> -adrian > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 02:45:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3509E340; Thu, 21 Nov 2013 02:45:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23A132AE7; Thu, 21 Nov 2013 02:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL2jcUc084460; Thu, 21 Nov 2013 02:45:38 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL2jasX084451; Thu, 21 Nov 2013 02:45:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311210245.rAL2jasX084451@svn.freebsd.org> From: Glen Barber Date: Thu, 21 Nov 2013 02:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258415 - in stable/10: release release/amd64 release/i386 release/scripts share/man/man7 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 02:45:38 -0000 Author: gjb Date: Thu Nov 21 02:45:36 2013 New Revision: 258415 URL: http://svnweb.freebsd.org/changeset/base/258415 Log: MFC r258305, r258307, r258308, r258309, r258310, r258314, r258317, r258319, r258320: r258305: Use the IMAGES variable to determine which image files to remove as part of 'make -C /usr/src/release clean'. r258307: Add a script and configuration files to fetch pre-built packages from pkg.FreeBSD.org for inclusion on release medium (dvd1.iso). r258308: Unconditionally copy the build host /etc/resolv.conf into the chroot directory, since hostname resolution may be needed in the case of building a dvd image (with packages) and also setting 'NOPORTS=1'. r258309: Set the PKG_CACHEDIR directory to 'dvd/' instead of 'release/' in preparation of adding a 'dvd1.iso' target. r258310: Add the 'dvd1.iso' target. This mimics the 'release.iso' target, with the additional step of fetching packages for inclusion on the dvd image. The 'pkg-stage' target is used to run 'scripts/pkg-stage.sh' if the '${TARGET}/pkg-stage.conf' configuration file exists (currently only amd64 and i386). Allow dvd1.iso to be skipped if NODVD=1. r258314: Fix how ABI is evaluated so it matches more than a dot-zero case. r258317: Document the 'dvdrom' target. r258319: Remove WITHOUT_PROFILE=1 for the dvd1.iso medium. r258320: Simplify PKG_ABI for pkg-stage.sh. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Added: stable/10/release/amd64/pkg-stage.conf - copied, changed from r258307, head/release/amd64/pkg-stage.conf stable/10/release/i386/pkg-stage.conf - copied, changed from r258307, head/release/i386/pkg-stage.conf stable/10/release/scripts/pkg-stage.sh - copied unchanged from r258307, head/release/scripts/pkg-stage.sh Modified: stable/10/release/Makefile stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/release/ (props changed) stable/10/share/man/man7/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Thu Nov 21 02:45:07 2013 (r258414) +++ stable/10/release/Makefile Thu Nov 21 02:45:36 2013 (r258415) @@ -71,6 +71,10 @@ IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom IMAGES+= disc1.iso bootonly.iso +. if(!defined(NODVD)) +RELEASE_TARGETS+= dvdrom +IMAGES+= dvd1.iso +. endif .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img @@ -160,10 +164,32 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc +dvd: +# Install system + mkdir -p ${.TARGET} + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 +# Copy distfiles + mkdir -p ${.TARGET}/usr/freebsd-dist + cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist +# Copy documentation, if generated +.if !defined(NODOC) + cp reldoc/* ${.TARGET} +.endif +# Set up installation environment + ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf + echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf + echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + cp ${.CURDIR}/rc.local ${.TARGET}/etc + touch ${.TARGET} + release.iso: disc1.iso disc1.iso: system sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release +dvd1.iso: dvd pkg-stage + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} dvd + bootonly.iso: bootonly sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly @@ -175,7 +201,14 @@ packagesystem: base.txz kernel.txz ${EXT sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} +pkg-stage: +.if(exists(${.CURDIR}/${TARGET}/pkg-stage.conf)) + sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ + ${REVISION} +.endif + cdrom: disc1.iso bootonly.iso +dvdrom: dvd1.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -191,8 +224,8 @@ clean: rm -f packagesystem rm -f *.txz MANIFEST rm -f system - rm -rf release bootonly - rm -f disc1.iso bootonly.iso memstick.img + rm -rf release bootonly dvd + rm -f ${IMAGES} install: .if defined(DESTDIR) && !empty(DESTDIR) Copied and modified: stable/10/release/amd64/pkg-stage.conf (from r258307, head/release/amd64/pkg-stage.conf) ============================================================================== --- head/release/amd64/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307, copy source) +++ stable/10/release/amd64/pkg-stage.conf Thu Nov 21 02:45:36 2013 (r258415) @@ -3,14 +3,14 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:64" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" Copied and modified: stable/10/release/i386/pkg-stage.conf (from r258307, head/release/i386/pkg-stage.conf) ============================================================================== --- head/release/i386/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307, copy source) +++ stable/10/release/i386/pkg-stage.conf Thu Nov 21 02:45:36 2013 (r258415) @@ -3,14 +3,14 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:32" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:32" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Thu Nov 21 02:45:07 2013 (r258414) +++ stable/10/release/release.sh Thu Nov 21 02:45:36 2013 (r258415) @@ -159,6 +159,7 @@ if [ "x${NOPORTS}" = "x" ]; then svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports fi +cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf cd ${CHROOTDIR}/usr/src make ${CHROOT_WMAKEFLAGS} buildworld make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} @@ -193,7 +194,6 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO fi if [ -d ${CHROOTDIR}/usr/ports ]; then - cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf build_doc_ports ${CHROOTDIR} fi Copied: stable/10/release/scripts/pkg-stage.sh (from r258307, head/release/scripts/pkg-stage.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/scripts/pkg-stage.sh Thu Nov 21 02:45:36 2013 (r258415, copy of r258307, head/release/scripts/pkg-stage.sh) @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +set -e + +usage() { + echo "$(basename ${0}) /path/to/pkg-stage.conf revision" + exit 1 +} + +if [ ! -e "${1}" ]; then + echo "Configuration file not specified." + echo + usage +fi + +if [ "$#" -lt 2 ]; then + usage +fi + +# Source config file for this architecture. +REVISION="${2}" +. "${1}" || exit 1 + +if [ ! -x /usr/local/sbin/pkg ]; then + /usr/sbin/pkg bootstrap +fi + +/bin/mkdir -p ${PKG_CACHEDIR} + +${PKGCMD} update -f +${PKGCMD} fetch -d ${DVD_PACKAGES} + +${PKGCMD} repo ${PKG_CACHEDIR} + +# Always exit '0', even if pkg(8) complains about conflicts. +exit 0 Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Thu Nov 21 02:45:07 2013 (r258414) +++ stable/10/share/man/man7/release.7 Thu Nov 21 02:45:36 2013 (r258415) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2013 +.Dd November 18, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -230,6 +230,10 @@ When set, will prevent the .Fa doc.txz distribution package from being created. +.It Va NODVD +Set to a non-empty value to skip the +.Cm dvdrom +target. .It Va NOPORTS Set to a non-empty value to skip the .Li ports/ @@ -270,6 +274,15 @@ This target produces files called and .Pa bootonly.iso as its output. +.It Cm dvdrom +Builds installation DVD-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 the +.Pa dvd1.iso +file as its output. .It Cm memstick Builds an installation memory stick image named .Pa memstick.img . @@ -297,7 +310,8 @@ Builds a bootable installation system co packaged by the .Cm packagesystem target, and suitable for imaging by the -.Cm cdrom +.Cm cdrom , +.Cm dvdrom and .Cm memstick targets. From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 03:22: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8A1EF56; Thu, 21 Nov 2013 03:22:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C8A842D95; Thu, 21 Nov 2013 03:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL3MDnH098853; Thu, 21 Nov 2013 03:22:13 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL3MDwR098852; Thu, 21 Nov 2013 03:22:13 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311210322.rAL3MDwR098852@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 03:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258418 - head/usr.sbin/bsdconfig/networking/share 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 03:22:13 -0000 Author: dteske Date: Thu Nov 21 03:22:13 2013 New Revision: 258418 URL: http://svnweb.freebsd.org/changeset/base/258418 Log: Quote the interface name for good measure. Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Thu Nov 21 03:01:28 2013 (r258417) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Thu Nov 21 03:22:13 2013 (r258418) @@ -278,22 +278,23 @@ f_dialog_menu_netdev_edit() msg=$( printf "$msg_scanning_for_dhcp" "$interface" ) if [ "$USE_XDIALOG" ]; then ( - f_quietly ifconfig $interface delete - f_quietly dhclient $interface + f_quietly ifconfig "$interface" delete + f_quietly dhclient "$interface" ) | f_xdialog_info "$msg" else f_dialog_info "$msg" - f_quietly ifconfig $interface delete - f_quietly dhclient $interface + f_quietly ifconfig "$interface" delete + f_quietly dhclient "$interface" fi ) retval=$? trap 'interrupt' SIGINT if [ $retval -eq $DIALOG_OK ]; then dhcp=1 - ipaddr=$( f_ifconfig_inet $interface ) - netmask=$( f_ifconfig_netmask $interface ) + f_ifconfig_inet "$interface" ipaddr + f_ifconfig_inet6 "$interface" ipaddr6 + f_ifconfig_netmask "$interface" netmask options= # Fixup search/domain in resolv.conf(5) From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 03:38: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AC48352; Thu, 21 Nov 2013 03:38:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 685712E4B; Thu, 21 Nov 2013 03:38:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL3cnhp002929; Thu, 21 Nov 2013 03:38:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL3clfK002918; Thu, 21 Nov 2013 03:38:47 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311210338.rAL3clfK002918@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 03:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258420 - in stable/10/usr.sbin/bsdconfig: . include packages share share/media share/packages startup/share X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 03:38:49 -0000 Author: dteske Date: Thu Nov 21 03:38:47 2013 New Revision: 258420 URL: http://svnweb.freebsd.org/changeset/base/258420 Log: MFC r257755-257756,257780-257785,257787-257793, and 257795,257817,257819,257937-257938,258029,258263-258267: 257755: SRV records 257756: fix spurious error message 257780: Whitespace 257781: Comments and funny syntax 257782: Debug file truncation is optional 257783: f_show_err for debugging 257784: f_eval_catch for debugging 257785: fix size calculations bug 257787: fix broken HTTP "any" media type 257788: more debugging 257789: Comments 257790: fix printf usage bug 257791: f_[v]sprintf added 257792: Comments 257793: fix off-by-one error in size calcs 257795: Replace pkg-tools with pkgng 257817: fix cosmetic typos 257819: Use `pkg -vv' to get ABI 257937: Adjustment to last 257938: Adjustment to last 258029: Comments 258263: Shuffle code around 258264: Remove unused code 258265: Debugging. Use f_eval_catch with pkg 258266: Shutdown media on exit from packages 258267: Fix pkg install from DVD Reviewed by: many Discussed on: -current Approved by: re (hrs) Modified: stable/10/usr.sbin/bsdconfig/bsdconfig stable/10/usr.sbin/bsdconfig/include/messages.subr stable/10/usr.sbin/bsdconfig/packages/packages stable/10/usr.sbin/bsdconfig/share/common.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr stable/10/usr.sbin/bsdconfig/share/media/http.subr stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr stable/10/usr.sbin/bsdconfig/share/packages/index.subr stable/10/usr.sbin/bsdconfig/share/packages/packages.subr stable/10/usr.sbin/bsdconfig/share/strings.subr stable/10/usr.sbin/bsdconfig/share/sysrc.subr stable/10/usr.sbin/bsdconfig/startup/share/rcconf.subr Directory Properties: stable/10/usr.sbin/bsdconfig/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- stable/10/usr.sbin/bsdconfig/bsdconfig Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/bsdconfig Thu Nov 21 03:38:47 2013 (r258420) @@ -342,7 +342,7 @@ while getopts f:h$GETOPTS_STDARGS flag; h|\?) usage ;; esac done -shift $(( $OPTIND -1 )) +shift $(( $OPTIND - 1 )) # If we've loaded any scripts, do not continue any further [ $scripts_loaded -gt 0 ] && exit Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/include/messages.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/include/messages.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -40,6 +40,7 @@ msg_afterstep_desc="Ports to support the msg_all="All" msg_all_desc="All available packages in all categories." msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" +msg_an_unknown_error_occurred="An unknown error occurred" msg_arabic_desc="Ported software for Arab countries." msg_archivers_desc="Utilities for archiving and unarchiving data." msg_armenia="Armenia" @@ -48,7 +49,7 @@ msg_assume_yes_to_all_non_critical_dialo msg_astro_desc="Applications related to astronomy." msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces" msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces" -msg_attempting_to_fetch_file_from_selected_media="Attempting to fetch %s file from selected media." +msg_attempting_to_update_repository_catalogue="Attempting to update repository catalogue from selected media." msg_audio_desc="Audio utilities - most require a supported sound card." msg_australia="Australia" msg_austria="Austria" @@ -137,9 +138,12 @@ msg_ftp_desc="FTP client and server util msg_ftp_passive="FTP Passive" msg_ftp_username="FTP username" msg_games_desc="Various games and sundry amusements." +msg_generating_index_from_pkg_database="Generating INDEX from pkg(8) database\n(this can take a while)..." msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" +msg_getting_package_categories_via_pkg_rquery="Getting package categories via pkg-rquery(8)..." +msg_getting_package_dependencies_via_pkg_rquery="Getting package dependencies via pkg-rquery(8)\n(this can take a while)..." msg_gnome_desc="Components of the Gnome Desktop environment." msg_gnustep_desc="Software for GNUstep desktop environment." msg_graphics_desc="Graphics libraries and utilities." @@ -175,7 +179,7 @@ msg_invalid_name_server_ip_address_speci msg_invalid_netmask_value="Invalid netmask value" msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir" msg_io_error_while_reading_in_the_package="I/O error while reading in the %s package." -msg_io_or_format_error_on_index_file="I/O or format error on %s file.\nPlease verify media (or path to media) and try again." +msg_io_or_format_error_on_index_file="I/O or format error on INDEX file.\nPlease verify media (or path to media) and try again." msg_ipv4_address="IPv4 Address" msg_ipv4_gateway="IPv4 Gateway" msg_ipv6="IPv6" @@ -245,6 +249,7 @@ msg_no_gateway_has_been_set="No gateway msg_no_network_devices="No network devices available!" msg_no_package_name_passed_in_package_variable="No package name passed in package variable" msg_no_packages_were_selected_for_extraction="No packages were selected for extraction." +msg_no_pkg_database_found="No pkg(8) database found!" msg_no_such_file_or_directory="%s: %s: No such file or directory" msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)" msg_no_username="No username provided!" @@ -256,10 +261,9 @@ msg_ok="OK" msg_options="Options" msg_options_editor="Options Editor" msg_other="other" -msg_pkg_delete_failed="Warning: pkg_delete of %s failed.\n Run with debugging for details." +msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details." msg_package_is_needed_by_other_installed_packages="Warning: Package %s is needed by\n %d other installed package%s." msg_package_not_installed_cannot_delete="Warning: package %s not installed\n No package can be deleted." -msg_package_read_successfully_waiting_for_pkg_add="Package %s read successfully - waiting for pkg_add(1)" msg_package_temp="Package Temp" msg_package_was_added_successfully="Package %s was added successfully" msg_packages="packages" @@ -269,7 +273,7 @@ msg_parallel_desc="Applications dealing msg_pear_desc="Software related to the Pear PHP framework." msg_perl5_desc="Utilities/modules for the PERL5 language." msg_permission_denied="%s: %s: Permission denied" -msg_pkg_add_apparently_did_not_like_the_package="pkg_add(1) apparently did not like the %s package." +msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package." msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" @@ -371,10 +375,13 @@ msg_unable_to_get_file_from_selected_med msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized." msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" +msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!" +msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!" msg_unable_to_open="Unable to open %s" +msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media." msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" -msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg_delete(1)" +msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" Modified: stable/10/usr.sbin/bsdconfig/packages/packages ============================================================================== --- stable/10/usr.sbin/bsdconfig/packages/packages Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/packages/packages Thu Nov 21 03:38:47 2013 (r258420) @@ -38,6 +38,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/packages/packages.subr @@ -73,6 +74,7 @@ f_device_get_all # # Display the package configuration menu and exit # +trap 'f_media_close' EXIT f_package_config ################################################################################ Modified: stable/10/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/common.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/common.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -60,7 +60,14 @@ FAILURE=1 # export UNAME_S="$(uname -s)" # Operating System (i.e. FreeBSD) export UNAME_P="$(uname -p)" # Processor Architecture (i.e. i386) +export UNAME_M="$(uname -m)" # Machine platform (i.e. i386) export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) +if [ ! "${PKG_ABI+set}" ]; then + export PKG_ABI="$( + ASSUME_ALWAYS_YES=1 pkg -vv | + awk '$1=="ABI:"{print $2;exit}' 2> /dev/null + )" +fi # # Default behavior is to call f_debug_init() automatically when loaded. @@ -68,6 +75,14 @@ export UNAME_R="$(uname -r)" # Release L : ${DEBUG_SELF_INITIALIZE=1} # +# Default behavior of f_debug_init() is to truncate $debugFile (set to NULL to +# disable truncating the debug file when initializing). To get child processes +# to append to the same log file, export this variarable (with a NULL value) +# and also export debugFile with the desired value. +# +: ${DEBUG_INITIALIZE_FILE=1} + +# # Define standard optstring arguments that should be supported by all programs # using this include (unless DEBUG_SELF_INITIALIZE is set to NULL to prevent # f_debug_init() from autamatically processing "$@" for the below arguments): @@ -106,7 +121,7 @@ GETOPTS_ALLFLAGS="${GETOPTS_ALLFLAGS}012 ############################################################ FUNCTIONS -# f_dprintf $fmt [ $opts ... ] +# f_dprintf $format [$arguments ...] # # Sensible debug function. Override in ~/.bsdconfigrc if desired. # See /usr/share/examples/bsdconfig/bsdconfigrc for example. @@ -164,18 +179,17 @@ f_debug_init() [ "$debugFile" ] && export debugFile # - # Truncate the debug file upon. Note that we will trim a leading plus - # (`+') from the value of debugFile to support persistant meaning that - # f_dprintf() should print both to standard output and $debugFile - # (minus the leading plus, of course). + # Truncate debug file unless requested otherwise. Note that we will + # trim a leading plus (`+') from the value of debugFile to support + # persistant meaning that f_dprintf() should print both to standard + # output and $debugFile (minus the leading plus, of course). # local _debug_file="${debugFile#+}" - if [ "$_debug_file" ]; then + if [ "$_debug_file" -a "$DEBUG_INITIALIZE_FILE" ]; then if ( umask 022 && :> "$_debug_file" ); then f_dprintf "Successfully initialized debugFile \`%s'" \ "$_debug_file" - [ "${debug+set}" ] || - debug=1 # turn debugging on if not set + f_isset debug || debug=1 # turn debugging on if not set else unset debugFile f_dprintf "Unable to initialize debugFile \`%s'" \ @@ -184,7 +198,7 @@ f_debug_init() fi } -# f_err $fmt [ $opts ... ] +# f_err $format [$arguments ...] # # Print a message to stderr (fd=2). # @@ -193,7 +207,7 @@ f_err() printf "$@" >&${TERMINAL_STDERR_PASSTHRU:-2} } -# f_quietly $command [ $arguments ... ] +# f_quietly $command [$arguments ...] # # Run a command quietly (quell any output to stdout or stderr) # @@ -275,7 +289,7 @@ f_isset() eval [ \"\${${1%%[$IFS]*}+set}\" ] } -# f_die [ $status [ $fmt [ $opts ... ]]] +# f_die [$status [$format [$arguments ...]]] # # Abruptly terminate due to an error optionally displaying a message in a # dialog box using printf(1) syntax. @@ -309,7 +323,7 @@ f_interrupt() f_die } -# f_show_info $fmt [ $opts ... ] +# f_show_info $format [$arguments ...] # # Display a message in a dialog infobox using printf(1) syntax. # @@ -330,7 +344,7 @@ f_show_info() fi } -# f_show_msg $fmt [ $opts ... ] +# f_show_msg $format [$arguments ...] # # Display a message in a dialog box using printf(1) syntax. # @@ -351,8 +365,32 @@ f_show_msg() fi } +# f_show_err $format [$arguments ...] +# +# Display a message in a dialog box with ``Error'' i18n title (overridden by +# setting msg_error) using printf(1) syntax. If running non-interactively, +# the process will terminate (using [above] f_die()). +# +f_show_err() +{ + [ "$nonInteractive" ] && f_die + + local msg + msg=$( printf "$@" ) -# f_yesno $fmt [ $opts ... ] + : ${msg:=${msg_an_unknown_error_occurred:-An unknown error occurred}} + + if [ "$_DIALOG_SUBR" ]; then + f_dialog_title "${msg_error:-Error}" + f_dialog_msgbox "$msg" + f_dialog_title_restore + else + dialog --title "${msg_error:-Error}" --msgbox "$msg" 0 0 + fi + return $SUCCESS +} + +# f_yesno $format [$arguments ...] # # Display a message in a dialog yes/no box using printf(1) syntax. # @@ -373,7 +411,7 @@ f_yesno() fi } -# f_noyes $fmt [ $opts ... ] +# f_noyes $format [$arguments ...] # # Display a message in a dialog yes/no box using printf(1) syntax. # NOTE: THis is just like the f_yesno function except "No" is default. @@ -466,7 +504,7 @@ f_include_lang() fi } -# f_usage $file [ $key1 $value1 ... ] +# f_usage $file [$key1 $value1 ...] # # Display USAGE file with optional pre-processor macro definitions. The first # argument is the template file containing the usage text to be displayed. If @@ -746,6 +784,88 @@ f_mounted() mount | grep -Eq " on $dir \([^)]+\)$" } +# f_eval_catch [-d] $funcname $utility $format [$arguments ...] +# +# Silently evaluate a command in a sub-shell and test for error. If debugging +# is enabled a copy of the command and its output is sent to debug (either +# stdout or file depending on environment). If an error occurs, output of the +# command is displayed in a dialog(1) msgbox using the [above] f_show_err() +# function (unless optional `-d' flag is the first argument, then no dialog). +# The $funcname argument is sent to debugging while the $utility argument is +# used in the title of the dialog box. The command that is sent to debugging +# along with $funcname is the product of the printf(1) syntax produced by +# $format with optional $arguments. +# +# Example 1: +# +# debug=1 +# f_eval_catch myfunc cat 'contents=$( cat "%s" )' /some/file +# # Error displayed ``cat: /some/file: No such file or directory'' +# +# Produces the following debug output: +# +# DEBUG: myfunc: cat "/some/file" +# DEBUG: myfunc: retval=1 +# cat: /some/file: No such file or directory +# +# Example 2: +# +# debug=1 +# f_eval_catch myfunc echo 'echo "%s"' "Hello, World!" +# # No error displayed +# +# Produces the following debug output: +# +# DEBUG: myfunc: echo "Hello, World!" +# DEBUG: myfunc: retval=0 +# Hello, World! +# +# Example 3: +# +# debug=1 +# echo 123 | f_eval_catch myfunc rev rev +# # No error displayed +# +# Produces the following debug output: +# +# DEBUG: myfunc: rev +# DEBUG: myfunc: retval=0 +# 321 +# +# Example 4: +# +# debug=1 +# f_eval_catch myfunc true true +# # No error displayed +# +# Produces the following debug output: +# +# DEBUG: myfunc: true +# DEBUG: myfunc: retval=0 +# +f_eval_catch() +{ + local no_dialog= + [ "$1" = "-d" ] && no_dialog=1 && shift 1 + local funcname="$1" utility="$2"; shift 2 + local cmd output retval + cmd=$( printf -- "$@" ) + f_dprintf "%s: %s" "$funcname" "$cmd" # Log command *before* eval + output=$( exec 2>&1; eval "$cmd" ) + retval=$? + if [ "$output" ]; then + f_dprintf "%s: retval=%i \n%s" "$funcname" \ + $retval "$output" + else + f_dprintf "%s: retval=%i " "$funcname" $retval + fi + ! [ "$no_dialog" -o "$nonInteractive" -o $retval -eq $SUCCESS ] && + msg_error="${msg_error:-Error}${utility:+: $utility}" \ + f_show_err "%s" "$output" + # NB: f_show_err will handle NULL output appropriately + return $retval +} + ############################################################ MAIN # Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -301,7 +301,16 @@ f_dialog_max_size() if [ "$USE_XDIALOG" ]; then __max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION else - __max_size=$( stty size 2> /dev/null ) # usually "24 80" + if __max_size=$( $DIALOG --print-maxsize \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) + then + # usually "MaxSize: 24, 80" + __max_size="${__max_size#*: }" + f_replaceall "$__max_size" "," "" __max_size + else + __max_size=$( stty size 2> /dev/null ) + # usually "24 80" + fi : ${__max_size:=$DEFAULT_TERMINAL_SIZE} fi if [ "$__var_height" ]; then @@ -518,7 +527,7 @@ f_dialog_menu_constrain() : ${__min_rows:=0} fi - local __max_rows=$(( $__max_height_menu_constrain - 8 )) + local __max_rows=$(( $__max_height_menu_constrain - 7 )) # If prompt_len is zero (no prompt), bump the max-rows by 1 # Default assumption is (if no argument) that there's no prompt [ ${__prompt_len:-0} -gt 0 ] || Modified: stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -163,8 +163,7 @@ f_media_get_cdrom() # f_media_shutdown_cdrom $device # -# Shuts down the CDROM device and ejects the media using f_media_eject_cdrom(), -# below. Return status should be ignored. +# Shuts down the CDROM device. Return status should be ignored. # f_media_shutdown_cdrom() { @@ -184,8 +183,6 @@ f_media_shutdown_cdrom() else CDROM_MOUNTED= fi - - f_media_eject_cdrom "$dev" } # f_media_eject_cdrom $device Modified: stable/10/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/http.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/media/http.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -77,7 +77,8 @@ f_dialog_menu_media_http() f_dialog_title_restore local prompt="$msg_please_select_the_site_closest_to_you_or_other" local menu_list=" - '$msg_main_site' 'ftp.freebsd.org' + 'dist $msg_main_site' 'ftp.freebsd.org' + 'pkg $msg_main_site' 'pkg.freebsd.org' 'URL' '$msg_specify_some_other_http_site' " # END-QUOTE local hline="$msg_select_a_site_thats_close" @@ -452,6 +453,11 @@ f_media_init_http() local dev="$1" f_dprintf "Init routine called for HTTP device. dev=[%s]" "$dev" + if [ "$HTTP_INITIALIZED" ]; then + f_dprintf "HTTP device already initialized." + return $SUCCESS + fi + # # First verify access # @@ -481,7 +487,7 @@ f_media_init_http() case "$rel" in __RELEASE|any) - setvar $VAR_HTTP_PATH "$VAR_HTTP_DIR" + f_getvar $VAR_HTTP_DIR $VAR_HTTP_PATH f_http_check_access http_found=$? ;; @@ -493,22 +499,31 @@ f_media_init_http() # local fdir hp f_getvar $VAR_HTTP_PATH%/ hp - for fdir in $HTTP_DIRS; do - setvar $VAR_HTTP_PATH "$hp/$fdir/$rel" - if f_http_check_access; then - http_found=$SUCCESS - break - fi - done + setvar $VAR_HTTP_PATH "$hp/$PKG_ABI/latest" + if [ "$PKG_ABI" ] && f_http_check_access; then + http_found=$SUCCESS + setvar $VAR_HTTP_PATH "$hp" + else + for fdir in $HTTP_DIRS; do + setvar $VAR_HTTP_PATH "$hp/$fdir/$rel" + if f_http_check_access; then + http_found=$SUCCESS + break + fi + done + fi esac - [ $http_found -eq $SUCCESS ] && break + if [ $http_found -eq $SUCCESS ]; then + HTTP_INITIALIZED=YES + break + fi f_getvar $VAR_HTTP_PATH http_path f_show_msg "$msg_please_check_the_url_and_try_again" \ "$http_path" - unset $VAR_HTTP_PATH + unset HTTP_INITIALIZED $VAR_HTTP_PATH f_media_set_http || break done @@ -558,6 +573,11 @@ f_media_get_http() f_getvar $VAR_HTTP_HOST http_host f_getvar $VAR_HTTP_PORT http_port + if [ ! "$HTTP_INITIALIZED" ]; then + f_dprintf "No HTTP connection open, can't get file %s" "$file" + return $FAILURE + fi + if ! { f_validate_ipaddr "$http_host" || f_validate_ipaddr6 "$http_host" || @@ -595,6 +615,7 @@ f_media_get_http() local url="$http_path/$file" rx f_dprintf "sending http request for: %s" "$url" + f_dprintf "using nc to connect to: %s:%s" "$host" "$http_port" printf "GET %s HTTP/1.0\r\n\r\n" "$url" | nc -n "$host" "$http_port" | ( # @@ -648,6 +669,18 @@ f_media_get_http() return $FAILURE } +# f_media_shutdown_http $device +# +# Shuts down the HTTP device. Return status should be ignored. Note that since +# we don't maintain an open connection to the HTTP server, nothing to do. +# +f_media_shutdown_http() +{ + [ "$HTTP_INITIALIZED" ] || return $SUCCESS + + unset HTTP_INITIALIZED +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." media/http.subr Modified: stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -1020,10 +1020,41 @@ f_host_lookup() # Fall back to host(1) -- which is further governed by nsswitch.conf(5) # - local __output __ip6 __addrs="" __wait="" - f_getvar $VAR_MEDIA_TIMEOUT __wait - [ "$__wait" ] && __wait="-W $(( $__wait / 2 ))" + local __output __ip6 __addrs= f_getvar $VAR_IPV6_ENABLE __ip6 + + # If we have a TCP media type configured, check for an SRV record + local __srvtypes= + { f_quietly f_getvar $VAR_HTTP_PATH || + f_quietly f_getvar $VAR_HTTP_PROXY_PATH + } && __srvtypes="$__srvtypes _http._tcp" + f_quietly f_getvar $VAR_FTP_PATH && __srvtypes="$__srvtypes _ftp._tcp" + f_quietly f_getvar $VAR_NFS_PATH && + __srvtypes="$__srvtypes _nfs._tcp _nfs._udp" + + # Calculate wait time as dividend of total time and host(1) invocations + local __host_runs __wait + if [ "$__ip6" = "YES" ]; then + __host_runs=$(( 2 + $( set -- $__srvtypes; echo $# ) )) + else + __host_runs=$(( 1 + $( set -- $__srvtypes; echo $# ) )) + fi + f_getvar $VAR_MEDIA_TIMEOUT __wait + [ "$__wait" ] && __wait="-W $(( $__wait / $__host_runs ))" + + # Query SRV types first (1st host response taken as new host to query) + for __type in $__srvtypes; do + if __output=$( + host -t SRV $__wait -- "$__type.$__host" \ + 2> /dev/null + ); then + __host=$( echo "$__output" | + awk '/ SRV /{print $NF;exit}' ) + break + fi + done + + # Try IPv6 first (if enabled) if [ "$__ip6" = "YES" ]; then if ! __output=$( host -t AAAA $__wait -- "$__host" 2>&1 ); then # An error occurred, display in-full and return error @@ -1031,13 +1062,17 @@ f_host_lookup() setvar "$__var_to_set" "$__output" return $FAILURE fi + # Add the IPv6 addresses and fall-through to collect IPv4 too __addrs=$( echo "$__output" | awk '/ address /{print $NF}' ) fi + + # Good ol' IPv4 if ! __output=$( host -t A $__wait -- "$__host" 2>&1 ); then # An error occurred, display it in-full and return error [ "$__var_to_set" ] && setvar "$__var_to_set" "$__output" return $FAILURE fi + __addrs="$__addrs${__addrs:+ }$( echo "$__output" | awk '/ address /{print $NF}' )" if [ "$__var_to_set" ]; then Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -43,24 +43,53 @@ f_include_lang $BSDCFG_LIBE/include/mess PACKAGE_INDEX= _INDEX_INITTED= +# +# Default path to pkg(8) repo-packagesite.sqlite database +# +SQLITE_REPO="/var/db/pkg/repo-packagesite.sqlite" + +# +# Default path to on-disk cache INDEX file +# +PACKAGES_INDEX_CACHEFILE="/var/run/bsdconfig/packages_INDEX.cache" + +# +# INDEX format for FreeBSD-6.0 or higher: +# +# package|port-origin|install-prefix|comment|port-desc-file|maintainer| +# categories|build-deps|run-deps|www-site|reserve|reserve|reserve|disc +# +INDEX_FORMAT="%n-%v" # package +INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o" # port-origin +INDEX_FORMAT="$INDEX_FORMAT|%p" # install-prefix +INDEX_FORMAT="$INDEX_FORMAT|%c" # comment +INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o/pkg-descr" # port-desc-file +INDEX_FORMAT="$INDEX_FORMAT|%m" # maintainer +INDEX_FORMAT="$INDEX_FORMAT|@CATEGORIES@" # place-holder +INDEX_FORMAT="$INDEX_FORMAT|" # build-deps +INDEX_FORMAT="$INDEX_FORMAT|@RUNDEPS@" # place-holder +INDEX_FORMAT="$INDEX_FORMAT|%w" # www-site +INDEX_FORMAT="$INDEX_FORMAT|" # reserved +INDEX_FORMAT="$INDEX_FORMAT|" # reserved +INDEX_FORMAT="$INDEX_FORMAT|" # reserved +INDEX_FORMAT="$INDEX_FORMAT|" # disc + ############################################################ FUNCTIONS -# f_index_initialize $path [$var_to_set] +# f_index_initialize [$var_to_set] # -# Read and initialize the global index. $path is to be relative to the chosen -# media (not necessarily the filesystem; e.g. FTP) -- this is usually going to -# be `packages/INDEX'. Returns success unless media cannot be initialized for -# any reason (e.g. user cancels media selection dialog) or an error occurs. The -# index is sorted before being loaded into $var_to_set. +# Read and initialize the global index. Returns success unless media cannot be +# initialized for any reason (e.g. user cancels media selection dialog or an +# error occurs). The index is sorted before being loaded into $var_to_set. # # NOTE: The index is processed with f_index_read() [below] after being loaded. # f_index_initialize() { - local __path="$1" __var_to_set="${2:-PACKAGE_INDEX}" + local __funcname=f_index_initialize + local __var_to_set="${2:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS - [ "$__path" ] || return $FAILURE # Got any media? f_media_verify || return $FAILURE @@ -68,20 +97,170 @@ f_index_initialize() # Does it move when you kick it? f_device_init media || return $FAILURE - f_show_info "$msg_attempting_to_fetch_file_from_selected_media" \ - "$__path" - eval "$__var_to_set"='$( f_device_get media "$__path" )' - if [ $? -ne $SUCCESS ]; then - f_show_msg "$msg_unable_to_get_file_from_selected_media" \ - "$__path" + f_show_info "$msg_attempting_to_update_repository_catalogue" + + # + # Generate $PACKAGESITE variable for pkg(8) based on media type + # + local __type __data __site + device_media get type __type + device_media get private __data + case "$__type" in + $DEVICE_TYPE_DIRECTORY) + __site="file://$__data/packages/$PKG_ABI" ;; + $DEVICE_TYPE_FLOPPY) + __site="file://${__data:-$MOUNTPOINT}/packages/$PKG_ABI" ;; + $DEVICE_TYPE_FTP) + f_getvar $VAR_FTP_PATH __site + __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_HTTP) + f_getvar $VAR_HTTP_PATH __site + __site="$__site/$PKG_ABI/latest" ;; + $DEVICE_TYPE_HTTP_PROXY) + f_getvar $VAR_HTTP_PROXY_PATH __site + __site="$__site/packages/$PKG_ABI" ;; + *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. + __site="file://$MOUNTPOINT/packages/$PKG_ABI" + esac + + export PACKAGESITE="$__site" + f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" + if ! f_eval_catch $__funcname pkg "pkg update"; then + f_show_err "$msg_unable_to_update_pkg_from_selected_media" + f_device_shutdown media + return $FAILURE + fi + + # + # Try to get contents from validated on-disk cache + # + + # + # Calculate digest used to determine if the on-disk persistant cache + # INDEX (containing this digest on the first line) is valid and can be + # used to quickly populate the environment. + # + local __sqlite_digest + if ! __sqlite_digest=$( md5 < "$SQLITE_REPO" 2> /dev/null ); then + f_show_err "$msg_no_pkg_database_found" + f_device_shutdown media + return $FAILURE + fi + + # + # Check to see if the persistant cache INDEX file exists + # + if [ -f "$PACKAGES_INDEX_CACHEFILE" ]; then + # + # Attempt to populate the environment with the (soon to be) + # validated on-disk cache. If validation fails, fall-back to + # generating a fresh cache. + # + if eval $__var_to_set='$( + ( # Get digest as the first word on first line + read digest rest_ignored + + # + # If the stored digest matches the calculated- + # one populate the environment from the on-disk + # cache and provide success exit status. + # + if [ "$digest" = "$__sqlite_digest" ]; then + cat + exit $SUCCESS + else + # Otherwise, return the current value + eval echo \"\$__var_to_set\" + exit $FAILURE + fi + ) < "$PACKAGES_INDEX_CACHEFILE" 2> /dev/null + )'; then + f_show_info \ + "$msg_located_index_now_reading_package_data_from_it" + if ! f_index_read "$__var_to_set"; then + f_show_err \ + "$msg_io_or_format_error_on_index_file" + return $FAILURE + fi + _INDEX_INITTED=1 + return $SUCCESS + fi + # Otherwise, fall-thru to create a fresh cache from scratch + fi + + # + # If we reach this point, we need to generate the data from scratch + # + + f_show_info "$msg_getting_package_categories_via_pkg_rquery" + if ! eval "$( pkg rquery "%n-%v %C" | awk ' + { categories[$1] = categories[$1] " " $2 } + END { + for (package in categories) + { + cats = categories[package] + sub(/^ /, "", cats) + gsub(/[^[:alnum:]_]/, "_", package) + printf "local _%s_categories=\"%s\";\n", package, cats + } + }' )"; then + f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" f_device_shutdown media return $FAILURE fi + + f_show_info "$msg_getting_package_dependencies_via_pkg_rquery" + if ! eval "$( pkg rquery "%n-%v %dn-%dv" | awk ' + { rundeps[$1] = rundeps[$1] " " $2 } + END { + for (package in rundeps) + { + deps = rundeps[package] + sub(/^ /, "", deps) + gsub(/[^[:alnum:]_]/, "_", package) + printf "local _%s_rundeps=\"%s\";\n", package, deps + } + }' )"; then + f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" + f_device_shutdown media + return $FAILURE + fi + + f_show_info "$msg_generating_index_from_pkg_database" + eval "$__var_to_set"='$( pkg rquery "$INDEX_FORMAT" | + while read LINE; do + package="${LINE%%|*}"; + f_str2varname "$package" varpkg; + eval f_replaceall \"\$LINE\" \"\|@CATEGORIES@\|\" \ + \"\|\$_${varpkg}_categories\|\" LINE + eval f_replaceall \"\$LINE\" \"\|@RUNDEPS@\|\" \ + \"\|\$_${varpkg}_rundeps\|\" LINE + echo "$LINE" + done + )' # always returns true (status of last item in pipe-chain) eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )' + # + # Attempt to create the persistant on-disk cache + # + + # Create a new temporary file to write to + local __tmpfile="$( mktemp -t "$pgm" )" + if [ "$__tmpfile" ]; then + # Write the temporary file contents + echo "$__sqlite_digest" > "$__tmpfile" + debug= f_getvar "$__var_to_set" >> "$__tmpfile" + + # Finally, move the temporary file into place + case "$PACKAGES_INDEX_CACHEFILE" in + */*) f_quietly mkdir -p "${PACKAGES_INDEX_CACHEFILE%/*}" + esac + f_quietly mv -f "$__tmpfile" "$PACKAGES_INDEX_CACHEFILE" + fi + f_show_info "$msg_located_index_now_reading_package_data_from_it" if ! f_index_read "$__var_to_set"; then - f_show_msg "$msg_io_or_format_error_on_index_file" "$__path" + f_show_err "$msg_io_or_format_error_on_index_file" return $FAILURE fi Modified: stable/10/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/packages.subr Thu Nov 21 03:24:10 2013 (r258419) +++ stable/10/usr.sbin/bsdconfig/share/packages/packages.subr Thu Nov 21 03:38:47 2013 (r258420) @@ -53,7 +53,7 @@ f_include_lang $BSDCFG_LIBE/include/mess # # Package extensions to try # -PACKAGE_EXTENSIONS=".tbz .tbz2 .tgz" +PACKAGE_EXTENSIONS=".txz .tbz .tbz2 .tgz" # # Variables used to track runtime states @@ -164,24 +164,13 @@ f_package_deselect() # f_package_detect_installed # -# Detect installed packages. Currently this searches /var/db/pkg for directory +# Detect installed packages. Currently this uses pkg-query(8) for querying # entries and marks each entry as an installed/selected package. # f_package_detect_installed() { - local installed package varpkg - # - # XXX KLUDGE ALERT! This makes evil assumptions about how XXX - # packages register themselves and should *really* be done with - # `pkg_info -e ' except that this is too slow for an - # item check routine.. :-( - # - # NOTE: When transitioning to pkgng, make a single fork to `pkg' to - # produce a list of all installed packages and parse _that_ - # - installed=$( find -s /var/db/pkg -mindepth 1 -maxdepth 1 -type d | - sed -e 's:/var/db/pkg/::' ) - for package in $installed; do + local package varpkg + for package in $( pkg query "%n-%v" ); do f_str2varname $package varpkg export _mark_$varpkg=X # exported for awk(1) ENVIRON[] f_package_select $package @@ -582,12 +571,12 @@ f_package_menu_deselect() # f_package_review() { + local funcname=f_package_review local prompt # Calculated below local menu_list # Calculated below local hline="$hline_alnum_arrows_punc_tab_enter" - local fname=f_package_review - f_dprintf "%s: SELECTED_PACKAGES=[%s]" $fname "$SELECTED_PACKAGES" + f_dprintf "$funcname: SELECTED_PACKAGES=[%s]" "$SELECTED_PACKAGES" prompt=$( printf "$msg_reviewing_selected_packages" "$_All_nselected" ) @@ -639,7 +628,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue - f_dprintf "%s: Installing %s package" $fname "$package" + f_dprintf "$funcname: Installing %s package" "$package" f_package_add "$package" done for package in $SELECTED_PACKAGES; do @@ -647,7 +636,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "R" ] || continue - f_dprintf "%s: Reinstalling %s package" $fname "$package" + f_dprintf "$funcname: Reinstalling %s package" "$package" f_package_reinstall "$package" done for package in $SELECTED_PACKAGES; do @@ -655,7 +644,7 @@ f_package_review() f_str2varname "$package" varpkg debug= f_getvar _mark_$varpkg mark [ "$mark" = "U" ] || continue - f_dprintf "%s: Uninstalling %s package" $fname "$package" + f_dprintf "$funcname: Uninstalling %s package" "$package" f_package_delete "$package" || continue f_package_deselect "$package" done @@ -954,11 +943,11 @@ f_package_add() # f_package_extract() { + local funcname=f_package_extract local device="$1" name="$2" depended="$3" - local fname=f_package_extract - f_dprintf "%s: device=[%s] name=[%s] depended=[%s]" \ - $fname "$device" "$name" "$depended" + f_dprintf "$funcname: device=[%s] name=[%s] depended=[%s]" \ + "$device" "$name" "$depended" # Check to make sure it's not already there local varpkg mark= @@ -982,35 +971,45 @@ f_package_extract() f_getvar $VAR_PKG_TMPDIR:-/var/tmp tmpdir f_quietly mkdir -p -m 1777 "$tmpdir" - local path + local path device_type + device_$device get type device_type case "$name" in */*) path="$name" ;; *) - case "$name" in - *-*|*_*) path="packages/All/$name" ;; - *) path="packages/Latest/$name" - esac + if [ "$device_type" = "$DEVICE_TYPE_HTTP" ]; then + path="$PKG_ABI/latest/All/$name" + else + path="packages/$PKG_ABI/All/$name" + fi esac - # We have a path, call the device strategy routine to get the file + # We have a path, call the device strategy routine to check the file local pkg_ext found= for pkg_ext in "" $PACKAGE_EXTENSIONS; do if f_device_get $device "$path$pkg_ext" $PROBE_EXIST; then path="$path$pkg_ext" - f_dprintf "%s: found path=[%s] dev=[%s]" \ - $fname "$path" "$device" + found=1 + break + elif [ "$device_type" = "$DEVICE_TYPE_HTTP" ] && + f_device_get $device \ + "packages/$PKG_ABI/All/$name$pkg_ext" $PROBE_EXIST + then + # Mirroring physical media over HTTP + path="packages/$PKG_ABI/All/$name$pkg_ext" found=1 break fi done + [ "$found" ] && f_dprintf "$funcname: found path=[%s] dev=[%s]" \ + "$path" "$device" local alert=f_show_msg no_confirm= f_getvar $VAR_NO_CONFIRM no_confirm [ "$no_confirm" ] && alert=f_show_info if [ ! "$found" ]; then - f_dprintf "%s: No such %s file on %s device" \ - $fname "$path" "$device" + f_dprintf "$funcname: No such %s file on %s device" \ + "$path" "$device" $alert "$msg_unable_to_fetch_package_from_selected_media" \ "$name" [ "$no_confirm" ] && sleep 2 @@ -1026,27 +1025,14 @@ f_package_extract() f_show_info "$msg_adding_package_from_media" "$name" "$devname" fi - # Get package data and pipe into pkg_add(1) while providing feedback - { - if ! f_device_get $device "$path"; then - $alert "$msg_io_error_while_reading_in_the_package" \ - "$name" \ - >&$DIALOG_TERMINAL_PASSTHRU_FD 2> /dev/null - [ "$no_confirm" ] && sleep 2 - else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 03:40:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEC214BE; Thu, 21 Nov 2013 03:40:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD13A2E80; Thu, 21 Nov 2013 03:40:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL3esZV005273; Thu, 21 Nov 2013 03:40:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL3eqKt005257; Thu, 21 Nov 2013 03:40:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311210340.rAL3eqKt005257@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 03:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258421 - in stable/10/usr.sbin/bsdinstall: . scripts X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 03:40:54 -0000 Author: dteske Date: Thu Nov 21 03:40:52 2013 New Revision: 258421 URL: http://svnweb.freebsd.org/changeset/base/258421 Log: MFC Revisions: 256549: man-page updates 256551: .Dd bump in manpage 256553: bootenv -> ROOT fix 257842: monster list of fixes 257843: minor touchup 257844: copy install log 257845: fixup to last 257872: mdoc fixup 257939: debug check 258021: MBR bootcode fixup Reviewed by: many Discussed on: -current Approved by: re (hrs) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall stable/10/usr.sbin/bsdinstall/bsdinstall.8 stable/10/usr.sbin/bsdinstall/scripts/auto stable/10/usr.sbin/bsdinstall/scripts/config stable/10/usr.sbin/bsdinstall/scripts/docsinstall stable/10/usr.sbin/bsdinstall/scripts/jail stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv4 stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv6 stable/10/usr.sbin/bsdinstall/scripts/script stable/10/usr.sbin/bsdinstall/scripts/wlanconfig stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/usr.sbin/bsdinstall/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/bsdinstall Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,17 +26,62 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +# Delay processing of debug flags as the parent until MAIN. export'd to disable +# re-processing of flags (all children log to the parent's log file). +# +export DEBUG_SELF_INITIALIZE= + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +############################################################ GLOBALS -: ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG : ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC : ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT -VERB=${1:-auto}; shift +export debugFile="${debugFile-${BSDINSTALL_LOG-/tmp/bsdinstall_log}}" + +############################################################ MAIN + +# +# Process command-line arguments +# +while getopts $GETOPTS_STDARGS ignored; do + : just skipping known flags +done +shift $(( $OPTIND - 1 )) + +# What are we here to do? +VERB="${1:-auto}"; shift [ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC" [ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT" -echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" -exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG" + +# Only enable debugging if debugFile is non-NULL and can be initialized +f_quietly f_debug_init +f_isset debugFile || debug= + +f_dprintf "Running installation step: %s %s" "$VERB" "$*" +if [ "$debug" ]; then + case "$debugFile" in + # If NULL, send errors to the bit-bucket + "") exec "/usr/libexec/bsdinstall/$VERB" "$@" 2> /dev/null ;; + # If begins with `+', send errors to both terminal and file (no `+') + +*) exec "/usr/libexec/bsdinstall/$VERB" "$@" \ + 2>&1 >&$TERMINAL_STDOUT_PASSTHRU | tee "${debugFile#+}" ;; + # Otherwise, just send errors to the file specified + *) exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$debugFile" + esac +else + exec "/usr/libexec/bsdinstall/$VERB" "$@" 2> /dev/null +fi + +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Thu Nov 21 03:40:52 2013 (r258421) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2013 +.Dd October 15, 2013 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd system installer .Sh SYNOPSIS .Nm +.Op Ar options .Op Ar target .Op Ar ... .Sh DESCRIPTION @@ -49,6 +50,18 @@ invoked with no arguments, it will invok target, which provides a standard interactive installation, invoking the others in sequence. To perform a scripted installation, these subtargets can be invoked separately by an installation script. +.Sh OPTIONS +.Nm +supports the following options, global to all targets: +.Bl -tag -width indent+ +.It Fl D Ar file +Provide a path for the installation log file +.Pq overrides Ev BSDINSTALL_LOG . +See +.Sx ENVIRONMENT VARIABLES +for more information on +.Ev BSDINSTALL_LOG . +.El .Sh TARGETS Most of the following targets are only useful for scripting the installer. For interactive use, most users will be interested only in the @@ -108,6 +121,21 @@ installations. Partitions disks, runs .Xr newfs 8 , and writes the new system's .Pa fstab . +.It Cm zfsboot +Provides the installer's +.Pq experimental +interactive/scriptable ZFS partitioner for multi-disk installations. +Creates a single +.Ic zpool +with datasets and writes to the new system's +.Pa rc.conf , +.Pa loader.conf , +and +.Pa fstab . +Supports +.Xr geli 8 , +.Xr gnop 8 , +and many other features. .It Cm partedit Provides the installer's interactive manual disk partitioner, with support for multi disk setups, non-UFS file systems, and manual selection of @@ -315,6 +343,15 @@ the preamble can contain a variable which is passed to the .Cm scriptedpart target to control disk setup. +Alternatively, +instead of +.Ev PARTITIONS , +the preamble can contain the variable +.Ev ZFSBOOT_DATASETS +which is parsed by the +.Pq experimental +.Cm zfsboot +target to control ZFS datasets/options of the boot pool setup. .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! declaration. This script will be run at the end of the installation process Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,8 +26,13 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 -echo "Begun Installation at $(date)" > $BSDINSTALL_LOG +############################################################ FUNCTIONS error() { test -n "$DISTDIR_IS_UNIONFS" && umount -f $BSDINSTALL_DISTDIR @@ -41,6 +47,9 @@ error() { fi } +############################################################ MAIN + +f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC @@ -126,7 +135,12 @@ case "$PARTMODE" in sh 2>&1 ;; "Manual") # Manual - bsdinstall partedit || error + if f_isset debugFile; then + # Give partedit the path to our logfile so it can append + BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error + else + bsdinstall partedit || error + fi bsdinstall mount || error ;; "ZFS") # ZFS @@ -247,5 +261,8 @@ fi bsdinstall entropy bsdinstall umount -echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG +f_dprintf "Installation Completed at %s" "$( date )" +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/config Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/config Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,6 +26,8 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ MAIN cat $BSDINSTALL_TMPETC/rc.conf.* >> $BSDINSTALL_TMPETC/rc.conf rm $BSDINSTALL_TMPETC/rc.conf.* @@ -36,6 +39,11 @@ rm $BSDINSTALL_TMPBOOT/loader.conf.* cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot +[ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/ + # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/docsinstall Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/docsinstall Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Marc Fonvieille +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,62 +26,137 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/packages/packages.subr +############################################################ CONFIGURATION -exec 3>&1 -DOCS=$(dialog --backtitle "FreeBSD Installer" \ - --title "FreeBSD Documentation Installation" --separate-output \ - --checklist "This menu will allow you to install the whole documentation set -from the FreeBSD Documentation Project: Handbook, FAQ and articles.\n\n -Please select the language versions you wish to install. At minimum, -you should install the English version, this is the original version -of the documentation.\n\n -NB: This requires a working, configured network connection." 0 0 0 \ - bn "Bengali Documentation" ${DIST_DOC_BN:-off} \ - da "Danish Documentation" ${DIST_DOC_DA:-off} \ - de "German Documentation" ${DIST_DOC_DE:-off} \ - el "Greek Documentation" ${DIST_DOC_EL:-off} \ - en "English Documentation (recommended)" ${DIST_DOC_EN:-on} \ - es "Spanish Documentation" ${DIST_DOC_ES:-off} \ - fr "French Documentation" ${DIST_DOC_FR:-off} \ - hu "Hungarian Documentation" ${DIST_DOC_HU:-off} \ - it "Italian Documentation" ${DIST_DOC_IT:-off} \ - ja "Japanese Documentation" ${DIST_DOC_JA:-off} \ - mn "Mongolian Documentation" ${DIST_DOC_MN:-off} \ - nl "Dutch Documentation" ${DIST_DOC_NL:-off} \ - pl "Polish Documentation" ${DIST_DOC_PL:-off} \ - pt "Portuguese Documentation" ${DIST_DOC_PT:-off} \ - ru "Russian Documentation" ${DIST_DOC_RU:-off} \ - sr "Serbian Documentation" ${DIST_DOC_SR:-off} \ - tr "Turkish Documentation" ${DIST_DOC_TR:-off} \ - zh_cn "Simplified Chinese Documentation" ${DIST_DOC_ZH_CN:-off} \ - zh_tw "Traditional Chinese Documentation" ${DIST_DOC_ZH_TW:-off} \ -2>&1 1>&3) -test $? -eq 0 || exit 0 -exec 3>&- - -# Let pkg(8) be able to use name servers -cp ${BSDINSTALL_TMPETC}/resolv.conf ${BSDINSTALL_CHROOT}/etc - -error() { - dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Could not install package $1 (`tail -n 1 ${BSDINSTALL_LOG}`)" 0 0 - exit 1 +# +# List of languages to display (descriptions pulled from $msg_{lang}doc_desc) +# +: ${DOCSINSTALL_LANGS:=\ + bn da de el en es fr hu it ja mn nl pl pt ru sr tr zh_cn zh_tw \ } +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +hline_arrows_space_tab_enter="Use arrows, SPACE, TAB or ENTER" +msg_bndoc_desc="Bengali Documentation" +msg_cancel="Cancel" +msg_dadoc_desc="Danish Documentation" +msg_dedoc_desc="German Documentation" +msg_docsinstall_menu_text="This menu allows you to install the whole documentation set from\nthe FreeBSD Documentation Project: Handbook, FAQ, and articles.\n\nPlease select the language versions you wish to install. At\nminimum, you should install the English version, the original\nversion of the documentation." +msg_eldoc_desc="Greek Documentation" +msg_endoc_desc="English Documentation (recommended)" +msg_esdoc_desc="Spanish Documentation" +msg_frdoc_desc="French Documentation" +msg_freebsd_documentation_installation="FreeBSD Documentation Installation" +msg_freebsd_installer="FreeBSD Installer" +msg_hudoc_desc="Hungarian Documentation" +msg_itdoc_desc="Italian Documentation" +msg_jadoc_desc="Japanese Documentation" +msg_mndoc_desc="Mongolian Documentation" +msg_nldoc_desc="Dutch Documentation" +msg_ok="OK" +msg_pldoc_desc="Polish Documentation" +msg_ptdoc_desc="Portuguese Documentation" +msg_rudoc_desc="Russian Documentation" +msg_srdoc_desc="Serbian Documentation" +msg_trdoc_desc="Turkish Documentation" +msg_zh_cndoc_desc="Simplified Chinese Documentation" +msg_zh_twdoc_desc="Traditional Chinese Documentation" + +############################################################ FUNCTIONS + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_docsinstall_menu_text" + local check_list= # Calculated below + local hline="$hline_arrows_space_tab_enter" + + local lang desc upper status + for lang in $DOCSINSTALL_LANGS; do + # Fetch the i18n description to display + f_getvar msg_${lang}doc_desc desc + f_shell_escape "$desc" desc + + # Get default status for each language + upper=$( echo "$lang" | awk '{print toupper($0)}' ) + case "$lang" in + en) f_getvar DIST_DOC_$upper:-on status ;; + *) f_getvar DIST_DOC_$upper:-off status + esac + + check_list="$check_list + '$lang' '$desc' '$status' + " # END-QUOTE + done + + local height width rows + eval f_dialog_checklist_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\$hline\" \ + $check_list + local selected + selected=$( eval $DIALOG \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --checklist \"\$prompt\" \ + $height $width $rows \ + $check_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + f_dialog_menutag_store -s "$selected" + return $retval +} -clear -echo "FreeBSD Installer" -echo "========================" -echo - -echo "Please wait while the repository metadata is fetched." -echo "This may take a few moments." - -env ASSUME_ALWAYS_YES=1 pkg -c ${BSDINSTALL_CHROOT} install pkg \ - || error pkg - -for i in $DOCS; do - env ASSUME_ALWAYS_YES=1 pkg -c ${BSDINSTALL_CHROOT} install ${i}-freebsd-doc \ - || error $i-freebsd-doc +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_freebsd_documentation_installation" +f_dialog_backtitle "$msg_freebsd_installer" +f_mustberoot_init + +# +# Launch application main menu +# +dialog_menu_main || f_die +f_dialog_menutag_fetch selected + +# Let pkg_add be able to use name servers +f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf $BSDINSTALL_CHROOT/etc/ + +# +# Install each of the selected packages +# +for lang in $selected; do + f_package_add $lang-freebsd-doc || return $FAILURE done + +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/jail ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/jail Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/jail Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,8 +26,15 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +############################################################ MAIN -echo "Begun Installation at $(date)" > $BSDINSTALL_LOG +f_dprintf "Began Installation at %s" "$( date )" export BSDINSTALL_CHROOT=$1 error() { @@ -112,5 +120,8 @@ cp /etc/localtime $1/etc bsdinstall entropy -echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG +f_dprintf "Installation Completed at %s" "$(date)" +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,13 +26,15 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr -: ${DIALOG_OK=0} -: ${DIALOG_CANCEL=1} -: ${DIALOG_HELP=2} -: ${DIALOG_EXTRA=3} -: ${DIALOG_ITEM_HELP=4} -: ${DIALOG_ESC=255} +############################################################ MAIN INTERFACE=$1 IFCONFIG_PREFIX="$2" @@ -49,8 +52,9 @@ if [ $? -eq $DIALOG_OK ]; then if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 - dhclient $INTERFACE 2>> $BSDINSTALL_LOG + err=$( dhclient $INTERFACE 2>&1 ) if [ $? -ne 0 ]; then + f_dprintf "%s" "$err" dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0 exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}" fi @@ -86,3 +90,6 @@ if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; t fi fi +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv6 ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Thu Nov 21 03:40:52 2013 (r258421) @@ -1,8 +1,8 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# All rights reserved. # Copyright (c) 2011 The FreeBSD Foundation +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Portions of this software were developed by Bjoern Zeeb @@ -30,19 +30,21 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr + +############################################################ MAIN # # TODO: # - Add DHCPv6 support once FreeBSD ships with it. # -: ${DIALOG_OK=0} -: ${DIALOG_CANCEL=1} -: ${DIALOG_HELP=2} -: ${DIALOG_EXTRA=3} -: ${DIALOG_ITEM_HELP=4} -: ${DIALOG_ESC=255} - INTERFACE=$1 case "${INTERFACE}" in "") dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \ @@ -61,8 +63,9 @@ while : ; do dialog --backtitle 'FreeBSD Installer' \ --infobox "Sending Router Solicitation ..." 0 0 ifconfig ${INTERFACE} inet6 -ifdisabled accept_rtadv up - rtsol -F $INTERFACE 2>> $BSDINSTALL_LOG + err=$( rtsol -F $INTERFACE 2>&1 ) if [ $? -ne 0 ]; then + f_dprintf "%s" "$err" dialog --backtitle 'FreeBSD Installer' --msgbox "SLAAC failed." 0 0 AGAIN=" again" continue @@ -148,3 +151,6 @@ if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; t fi fi +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/script ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/script Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/script Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2013 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,27 +26,55 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/variable.subr + +############################################################ CONFIGURATION # VARIABLES: # PARTITIONS # DISTRIBUTIONS # BSDINSTALL_DISTDIR -error() { - test -f $PATH_FSTAB && bsdinstall umount - echo "Installation Error!" - cat $BSDINSTALL_LOG - echo "Installation Error!" +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +msg_installation_error="Installation Error!" + +############################################################ FUNCTIONS + +error() +{ + [ -f "$PATH_FSTAB" ] && bsdinstall umount + + local file + f_getvar "$VAR_DEBUG_FILE#+" file + if [ "$file" ]; then + f_dialog_title "$msg_installation_error" + f_dialog_textbox "$file" + # No need to restore title, pining for the fjords + fi + exit 1 } +############################################################ MAIN + set -e trap error EXIT SCRIPT="$1" shift -echo "Begun Installation at $(date)" > $BSDINSTALL_LOG +f_dprintf "Began Instalation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC @@ -55,6 +84,14 @@ split -a 2 -p '^#!.*' "$SCRIPT" /tmp/bsd : ${DISTRIBUTIONS="kernel.txz base.txz"}; export DISTRIBUTIONS export BSDINSTALL_DISTDIR +# Re-initialize a new log if preamble changed BSDINSTALL_LOG +if [ "$BSDINSTALL_LOG" != "${debugFile#+}" ]; then + export debugFile="$BSDINSTALL_LOG" + f_quietly f_debug_init + # NB: Being scripted, let debug go to terminal for invalid debugFile + f_dprintf "Began Instalation at %s" "$( date )" +fi + # Make partitions rm -f $PATH_FSTAB touch $PATH_FSTAB @@ -86,6 +123,10 @@ fi bsdinstall entropy bsdinstall umount -echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG +f_dprintf "Installation Completed at %s" "$( date )" trap true EXIT + +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Thu Nov 21 03:40:52 2013 (r258421) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,6 +26,13 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +############################################################ MAIN echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf @@ -50,7 +58,8 @@ if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCU exit 1 fi -wpa_cli scan >>$BSDINSTALL_LOG +output=$( wpa_cli scan 2>&1 ) +f_dprintf "%s" "$output" dialog --backtitle "FreeBSD Installer" --title "Scanning" --ok-label "Skip" \ --pause "Waiting 5 seconds to scan for wireless networks..." \ 9 40 5 || exit 1 @@ -132,6 +141,13 @@ echo "network={ }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf # Bring up new network -test ! -z $BSDINSTALL_CONFIGCURRENT && wpa_cli reconfigure >>$BSDINSTALL_LOG +if [ "$BSDINSTALL_CONFIGCURRENT" ]; then + output=$( wpa_cli reconfigure 2>&1 ) + f_dprintf "%s" "$output" +fi exit 0 + +################################################################################ +# END +################################################################################ Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Nov 21 03:38:47 2013 (r258420) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Nov 21 03:40:52 2013 (r258421) @@ -47,7 +47,7 @@ f_include $BSDCFG_SHARE/variable.subr # # Default name for the boot environment parent dataset # -: ${ZFSBOOT_BEROOT_NAME:=bootenv} +: ${ZFSBOOT_BEROOT_NAME:=ROOT} # # Default name for the primany boot environment @@ -67,7 +67,7 @@ f_include $BSDCFG_SHARE/variable.subr # # Should we use geli(8) to encrypt the drives? # -: ${ZFSBOOT_GELI_ENCRYPTION:=} +: ${ZFSBOOT_GELI_ENCRYPTION=} # # Default name the unencrypted pool when using geli(8) to encrypt the drives @@ -101,7 +101,7 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_SWAP_SIZE:=2g} # -# Default ZFS layout for root zpool +# Default ZFS datasets for root zpool # # NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME # NOTE: Anything after pound/hash character [#] is ignored as a comment. @@ -119,69 +119,110 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA # Don't mount /usr so that 'base' files go to the BEROOT /usr mountpoint=/usr,canmount=off - /usr/local # local files (i.e. from packages) separate from base system - # Home directories separated so they are common to all BEs - /usr/home setuid=off + /usr/home # NB: /home is a symlink to /usr/home # Ports tree /usr/ports compression=lz4,setuid=off - /usr/ports/distfiles compression=off,exec=off,setuid=off - /usr/ports/packages compression=off,exec=off,setuid=off # Source tree (compressed) /usr/src compression=lz4,exec=off,setuid=off - /usr/obj # Object files # Create /var and friends /var mountpoint=/var /var/crash compression=lz4,exec=off,setuid=off - /var/db exec=off,setuid=off - /var/db/pkg compression=lz4,exec=off,setuid=off - /var/empty exec=off,setuid=off /var/log compression=lz4,exec=off,setuid=off - /var/mail compression=lz4,exec=off,setuid=off - /var/run exec=off,setuid=off /var/tmp compression=lz4,exec=on,setuid=off " # END-QUOTE +# +# If interactive and the user has not explicitly chosen a vdev type or disks, +# make the user confirm scripted/default choices when proceeding to install. +# +: ${ZFSBOOT_CONFIRM_LAYOUT:=1} + ############################################################ GLOBALS # +# Format of a line in printf(1) syntax to add to fstab(5) +# +FSTAB_FMT="%s\t\t%s\t%s\t%s\t\t%s\t%s\n" + +# +# Command strings for various tasks +# +CHMOD_MODE='chmod %s "%s"' +DD_WITH_OPTIONS='dd if="%s" of="%s" %s' +ECHO_APPEND='echo "%s" >> "%s"' +GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' +GNOP_CREATE='gnop create -S 4096 "%s"' +GPART_ADD='gpart add -t %s "%s"' +GPART_ADD_INDEX='gpart add -i %s -t %s "%s"' +GPART_ADD_INDEX_WITH_SIZE='gpart add -i %s -t %s -s %s "%s"' +GPART_ADD_LABEL='gpart add -l %s -t %s "%s"' +GPART_ADD_LABEL_WITH_SIZE='gpart add -l %s -t %s -s %s "%s"' +GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' +GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' +GPART_CREATE='gpart create -s %s "%s"' +GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' +LN_SF='ln -sf "%s" "%s"' +MKDIR_P='mkdir -p "%s"' +MOUNT_TYPE='mount -t %s "%s" "%s"' +PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" +PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' +SHELL_TRUNCATE=':> "%s"' +ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' +ZFS_SET='zfs set "%s" "%s"' +ZFS_UNMOUNT='zfs unmount "%s"' +ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' +ZPOOL_EXPORT='zpool export "%s"' +ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' +ZPOOL_SET='zpool set %s "%s"' + +# # Strings that should be moved to an i18n file and loaded with f_include_lang() # hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" hline_arrows_space_tab_enter="Use arrows, SPACE, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_an_unknown_error_occurred="An unknown error occurred" msg_back="Back" msg_cancel="Cancel" -msg_change="Change Selection" +msg_change_selection="Change Selection" msg_configure_options="Configure Options:" -msg_create="Install" -msg_create_desc="Proceed with Installation" -msg_create_help="Create ZFS boot pool with displayed options" msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" -msg_disks_to_use="Disks To Use" -msg_disks_to_use_help="Choose which disks to use for the Virtual Device (Required)" +msg_encrypt_disks="Encrypt Disks?" +msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" +msg_error="Error" msg_force_4k_sectors="Force 4K Sectors?" msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" msg_freebsd_installer="FreeBSD Installer" -msg_geli_encryption="Encrypt Disks?" -msg_geli_encryption_help="Use geli(8) to encrypt all data partitions" msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_install="Install" +msg_install_desc="Proceed with Installation" +msg_install_help="Create ZFS boot pool with displayed options" +msg_invalid_disk_argument="Invalid disk argument \`%s'" +msg_invalid_geli_boot_size="Invalid geli(8) boot size \`%s'" +msg_invalid_index_argument="Invalid index argument \`%s'" +msg_invalid_swap_size="Invalid swap size \`%s'" msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" -msg_invalid_virtual_device_type_help="Select another Virtual Device type or Cancel to\nreturn to the ZFS menu. From there you can select\nmore disks or rescan for additional devices." -msg_last_chance_are_you_sure="Last Chance! Are you sure you want to destroy the current contents of the following disks:\n%s" -msg_last_chance_are_you_sure_color="\\\\ZrLast Chance!\\\\ZR Are you \\\\Z1sure\\\\Zn you want to \\\\Zr\\\\Z1destroy\\\\Zn the current contents of the following disks:\n%s" +msg_last_chance_are_you_sure="Last Chance! Are you sure you want to destroy\nthe current contents of the following disks:\n\n %s" +msg_last_chance_are_you_sure_color='\\ZrLast Chance!\\ZR Are you \\Z1sure\\Zn you want to \\Zr\\Z1destroy\\Zn\nthe current contents of the following disks:\n\n %s' msg_mirror_desc="Mirror - n-Way Mirroring" msg_mirror_help="[2+ Disks] Mirroring provides the best performance, but the least storage" +msg_missing_disk_arguments="missing disk arguments" +msg_missing_one_or_more_scripted_disks="Missing one or more scripted disks!" msg_no="NO" msg_no_disks_present_to_configure="No disk(s) present to configure" msg_no_disks_selected="No disks selected." -msg_not_enough_disks_selected="Not enough disks selected. (%u < %u wanted)" +msg_not_enough_disks_selected="Not enough disks selected. (%u < %u minimum)" +msg_null_disk_argument="NULL disk argument" +msg_null_index_argument="NULL index argument" +msg_null_poolname="NULL poolname" msg_ok="OK" msg_partition_scheme="Partition Scheme" msg_partition_scheme_help="Toggle between GPT and MBR partitioning schemes" @@ -191,6 +232,8 @@ msg_please_select_one_or_more_disks="Ple msg_pool_name="Pool Name" msg_pool_name_cannot_be_empty="Pool name cannot be empty." msg_pool_name_help="Customize the name of the zpool to be created (Required)" +msg_pool_type_disks="Pool Type/Disks:" +msg_pool_type_disks_help="Choose type of ZFS Virtual Device and disks to use (Required)" msg_processing_selection="Processing selection..." msg_raidz1_desc="RAID-Z1 - Single Redundant RAID" msg_raidz1_help="[3+ Disks] Withstand failure of 1 disk. Recommended for: 3, 5 or 9 disks" @@ -207,11 +250,12 @@ msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" -msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or GELI (%s) partitions, which would take\n50%% or more (not recommended) of each of the following\nselected disk devices:\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" +msg_unsupported_partition_scheme="%s is an unsupported partition scheme" +msg_user_cancelled="User Cancelled." msg_yes="YES" msg_zfs_configuration="ZFS Configuration" -msg_zfs_vdev_type="ZFS VDev Type" -msg_zfs_vdev_type_help="Select type of ZFS Virtual Device to create" ############################################################ FUNCTIONS @@ -228,26 +272,26 @@ dialog_menu_main() local usegeli="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" + local disks n=$( set -- $ZFSBOOT_DISKS; echo $# ) + { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar local menu_list=" - '>>> $msg_create' '$msg_create_desc' - '$msg_create_help' + '>>> $msg_install' '$msg_install_desc' + '$msg_install_help' + 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks' + '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' '- $msg_disk_info' '*' '$msg_disk_info_help' - '1 $msg_pool_name' '$ZFSBOOT_POOL_NAME' + 'N $msg_pool_name' '$ZFSBOOT_POOL_NAME' '$msg_pool_name_help' - '2 $msg_disks_to_use' '$ZFSBOOT_DISKS' - '$msg_disks_to_use_help' - '3 $msg_zfs_vdev_type' '$ZFSBOOT_VDEV_TYPE' - '$msg_zfs_vdev_type_help' '4 $msg_force_4k_sectors' '$force4k' '$msg_force_4k_sectors_help' - '5 $msg_geli_encryption' '$usegeli' - '$msg_geli_encryption_help' - '6 $msg_partition_scheme' '$ZFSBOOT_PARTITION_SCHEME' + 'E $msg_encrypt_disks' '$usegeli' + '$msg_encrypt_disks_help' + 'P $msg_partition_scheme' '$ZFSBOOT_PARTITION_SCHEME' '$msg_partition_scheme_help' - '7 $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' + 'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' '$msg_swap_size_help' " # END-QUOTE local defaultitem= # Calculated below @@ -284,158 +328,279 @@ dialog_menu_main() return $retval } -# dialog_edit_disks +# dialog_last_chance $disks ... # -# Edit the list of disks to be used by the ZFS boot pool. +# Display a list of the disks that the user is about to destroy. The default +# action is to return error status unless the user explicitly (non-default) +# selects "Yes" from the noyes dialog. # -dialog_edit_disks() +dialog_last_chance() { local title="$DIALOG_TITLE" local btitle="$DIALOG_BACKTITLE" - local prompt="$msg_please_select_one_or_more_disks" - local check_list= # Calculated below - local hline="$hline_arrows_space_tab_enter" - local dev vardev disks= + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" - # - # Get a [new] list of disk devices - # - f_device_find "" $DEVICE_TYPE_DISK disks - if [ ! "$disks" ]; then - f_show_msg "$msg_no_disks_present_to_configure" - return $FAILURE + local height=8 width=50 prefix=" " + local plen=${#prefix} list= line= + local max_width=$(( $width - 3 - $plen )) + + local yes no defaultno extra_args format *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 06:21: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2734C04 for ; Thu, 21 Nov 2013 06:21:54 +0000 (UTC) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [IPv6:2607:f8b0:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E60E25A2 for ; Thu, 21 Nov 2013 06:21:53 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id if17so3004841vcb.39 for ; Wed, 20 Nov 2013 22:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rbM1fGAeYUBQPVZxbzIE/Ec2gtHCJ8ltHy3Kmagdkbk=; b=mTfCKJ2Cue5Ac+GaKKgG2yuWn9tAdSHMiY6Bs823oae13RRFPhDkl6milgWrm1QO+I RifmS0uVz/akR+/oApEA7Sn0UCIYeu+7pveyZLiU0g98oRKlhP2QYBtF2gPc4RrY86bi zQvJmF6tTpoEKWxmFa8sHz5VcjMYCNWg+scCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rbM1fGAeYUBQPVZxbzIE/Ec2gtHCJ8ltHy3Kmagdkbk=; b=Lxx+U4hIlyzPad2LtVrbJEx/x3AK+WyzQTmKP/j92zwrGWqL2LYeRDgS1Qzerm0GUw 3vFj4QcM8dCGqYT/CEVbWIf0aYGf+9fwZ6XHOa0Y7RZSR6vunOmlbCDnkqgREvsVmDGT IgRSwl/RfhruLwQTy2xjbZTGnDyKERcBbCr5CR+Gh9DksLcwjBxEL6d0iVzUvJIy3+UO Qrm1dsD+ebiBcmfBk/o+p+bcEYJTX+xMR3m4kLCu+0yuF2F9+lgkmbHuAsPd2Zf3/LKY 5qxl+gYXMyT1NvC7nOacdTQ4SEWz3cymulhlKIYHyvF/AYjQIgzAyhkGDAFGn61kX84f T6IQ== X-Gm-Message-State: ALoCoQl2tiUXiztgzBIyfGRiEkSI7Fb5k4zhP8kLfYlIcwSHdHh8Ty8SFFlrw+P0pE5d6V4Flt18 MIME-Version: 1.0 X-Received: by 10.221.51.206 with SMTP id vj14mr4287733vcb.17.1385014912688; Wed, 20 Nov 2013 22:21:52 -0800 (PST) Received: by 10.220.167.74 with HTTP; Wed, 20 Nov 2013 22:21:52 -0800 (PST) In-Reply-To: <528D274E.5020007@freebsd.org> References: <201311202025.rAKKP0ce054293@svn.freebsd.org> <528D274E.5020007@freebsd.org> Date: Wed, 20 Nov 2013 22:21:52 -0800 Message-ID: Subject: Re: svn commit: r258398 - in stable/10: . include lib lib/libc lib/libc/iconv lib/libc_nonshared sys/sys From: Peter Wemm To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: svn-src-stable@freebsd.org, svn-src-all , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 06:21:55 -0000 On Wed, Nov 20, 2013 at 1:19 PM, Julian Elischer wrote: > On 11/20/13, 12:25 PM, Peter Wemm wrote: > >> +int _iconv_version_compat = 0x0108; /* Magic - not used */ >> + >> >> can you illuminate this a bit more? is it magic, or is it not used? > libiconv has a unique, non-standard, private identifier for its version, 'extern int libiconv_version'. Ours acquired one via search/replace, by accident. In theory, nothing knows of "iconv_version", but in order to be ABI compatible with old 10-alpha/beta snapshots, I left it there via its .symdef alias. "Magic" refers to the old magic number that it had. Not that it does anything special. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 06:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6237462E; Thu, 21 Nov 2013 06:54:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 520C3275C; Thu, 21 Nov 2013 06:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL6sTQe070173; Thu, 21 Nov 2013 06:54:29 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL6sTTR070172; Thu, 21 Nov 2013 06:54:29 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201311210654.rAL6sTTR070172@svn.freebsd.org> From: Justin Hibbits Date: Thu, 21 Nov 2013 06:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258424 - head/sys/powerpc/aim 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 06:54:29 -0000 Author: jhibbits Date: Thu Nov 21 06:54:28 2013 New Revision: 258424 URL: http://svnweb.freebsd.org/changeset/base/258424 Log: Remove stale comment. The PID provider is handled elsewhere already. Modified: head/sys/powerpc/aim/trap.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Nov 21 05:17:36 2013 (r258423) +++ head/sys/powerpc/aim/trap.c Thu Nov 21 06:54:28 2013 (r258424) @@ -205,9 +205,6 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - /* - * XXXDTRACE: add pid probe handler here (if ever) - */ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) return; #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 09:19: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 016B1E87; Thu, 21 Nov 2013 09:19:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E550E2402; Thu, 21 Nov 2013 09:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAL9JEa5017941; Thu, 21 Nov 2013 09:19:14 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAL9JExi017939; Thu, 21 Nov 2013 09:19:14 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201311210919.rAL9JExi017939@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 21 Nov 2013 09:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258425 - head/sys/dev/nand 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 09:19:15 -0000 Author: gber Date: Thu Nov 21 09:19:14 2013 New Revision: 258425 URL: http://svnweb.freebsd.org/changeset/base/258425 Log: Unbreak compilation with GCC. Modified: head/sys/dev/nand/nand_cdev.c head/sys/dev/nand/nand_geom.c Modified: head/sys/dev/nand/nand_cdev.c ============================================================================== --- head/sys/dev/nand/nand_cdev.c Thu Nov 21 06:54:28 2013 (r258424) +++ head/sys/dev/nand/nand_cdev.c Thu Nov 21 09:19:14 2013 (r258425) @@ -298,7 +298,8 @@ nand_ioctl(struct cdev *dev, u_long cmd, struct nand_oob_rw *oob_rw = NULL; struct nand_raw_rw *raw_rw = NULL; device_t nandbus; - size_t bufsize, len, raw_size; + size_t bufsize = 0, len = 0; + size_t raw_size; off_t off; uint8_t *buf = NULL; int ret = 0; Modified: head/sys/dev/nand/nand_geom.c ============================================================================== --- head/sys/dev/nand/nand_geom.c Thu Nov 21 06:54:28 2013 (r258424) +++ head/sys/dev/nand/nand_geom.c Thu Nov 21 09:19:14 2013 (r258425) @@ -197,7 +197,8 @@ nand_ioctl(struct disk *ndisk, u_long cm struct nand_oob_rw *oob_rw = NULL; struct nand_raw_rw *raw_rw = NULL; device_t nandbus; - size_t bufsize, len, raw_size; + size_t bufsize = 0, len = 0; + size_t raw_size; off_t off; uint8_t *buf = NULL; int ret = 0; From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 09:34:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED6BC5E7 for ; Thu, 21 Nov 2013 09:34:17 +0000 (UTC) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC4982531 for ; Thu, 21 Nov 2013 09:34:17 +0000 (UTC) Received: by mail-ie0-f178.google.com with SMTP id lx4so7769380iec.9 for ; Thu, 21 Nov 2013 01:34:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Rc85Rp5NDFJxVLL89ngogi9QZmgSy2m9Eo2b37EnRDU=; b=LMLUfvmtlRkQ8SUYbgyquhqMS8YJVtpUYWPgFzpx2HRyEzPMBiYiv52JW7v96zQ3NU tWjZC1cSWNHpOGdhyiOlht7nGCoQpVfU6VICrSz6wSCylgSl6Owh3yvlS4iLxQOApSTk aWON3JTtHaJumk6zUARrL3se3Vz7YItSuuesWzf2WPabxYcSBSkfXc7rbqREvIZvYg/s 4leZh7vOhmKTt5HJBQLKwSHUq2iD4jBDbEst7MVdnp51BpGTUUL+omU2qq0bkE6OXSej bD86ASog+qF+NFK5PlaTNYBazlcrXH7Ph1JASm3xCNrfjrn9LWJN+1kjxw3XdT0OW5Gt 5Bjg== X-Gm-Message-State: ALoCoQkImeaUOKtTzx9/qFZnRpyumBEdXHJuw9mQRTymC52h4C4OMmTNN/oQAW/r0/hOKo5B2SVD MIME-Version: 1.0 X-Received: by 10.50.79.198 with SMTP id l6mr4514556igx.31.1385026456858; Thu, 21 Nov 2013 01:34:16 -0800 (PST) Received: by 10.50.209.5 with HTTP; Thu, 21 Nov 2013 01:34:16 -0800 (PST) In-Reply-To: <20131120213119.GL2279@funkthat.com> References: <201311201110.rAKBAOMY061212@svn.freebsd.org> <20131120213119.GL2279@funkthat.com> Date: Thu, 21 Nov 2013 10:34:16 +0100 Message-ID: Subject: Re: svn commit: r258387 - head/sys/dev/nand From: Grzegorz Bernacki To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Grzegorz Bernacki , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 09:34:18 -0000 Hi, Thanks for information. Fix has been committed. regards, grzesiek 2013/11/20 John-Mark Gurney > Grzegorz Bernacki wrote this message on Wed, Nov 20, 2013 at 11:10 +0000: > > Author: gber > > Date: Wed Nov 20 11:10:23 2013 > > New Revision: 258387 > > URL: http://svnweb.freebsd.org/changeset/base/258387 > > > > Log: > > Split raw reading/programming into smaller chunks to avoid allocating > too > > big chunk of kernel memory. Validate size of data. Add error handling > to > > avoid calling copyout() when data has not been read correctly. > > > > Reviewed by: zbb > > Reported by: x90c > > MFC after: 2 days > > > > Modified: > > head/sys/dev/nand/nand_cdev.c > > head/sys/dev/nand/nand_geom.c > > Looks like this change errors w/ gcc: > > http://tinderbox.freebsd.org/tinderbox-head-noclang-build-HEAD-armv6-arm.brief > > -- > 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 Thu Nov 21 14:12:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57B00AB8; Thu, 21 Nov 2013 14:12:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4700D2A2D; Thu, 21 Nov 2013 14:12:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALECbI6017753; Thu, 21 Nov 2013 14:12:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALECbPj017752; Thu, 21 Nov 2013 14:12:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311211412.rALECbPj017752@svn.freebsd.org> From: Ed Maste Date: Thu, 21 Nov 2013 14:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258426 - head/contrib/libexecinfo 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 14:12:37 -0000 Author: emaste Date: Thu Nov 21 14:12:36 2013 New Revision: 258426 URL: http://svnweb.freebsd.org/changeset/base/258426 Log: libexecinfo: Include terminating null in byte count Otherwise, a formatted string with a strlen equal to the remaining buffer space would have the last character omitted (because vsnprintf always null-terminates), and later the assert in backtrace_symbols_fmt would fail. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/contrib/libexecinfo/backtrace.c Modified: head/contrib/libexecinfo/backtrace.c ============================================================================== --- head/contrib/libexecinfo/backtrace.c Thu Nov 21 09:19:14 2013 (r258425) +++ head/contrib/libexecinfo/backtrace.c Thu Nov 21 14:12:36 2013 (r258426) @@ -89,7 +89,7 @@ rasprintf(char **buf, size_t *bufsiz, si len = vsnprintf(*buf + offs, *bufsiz - offs, fmt, ap); va_end(ap); - if (len < 0 || (size_t)len < *bufsiz - offs) + if (len < 0 || (size_t)len + 1 < *bufsiz - offs) return len; nbufsiz = MAX(*bufsiz + 512, (size_t)len + 1); } else From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 14:36:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C01DA1D9; Thu, 21 Nov 2013 14:36:28 +0000 (UTC) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 308832B87; Thu, 21 Nov 2013 14:36:27 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id n7so8595584lam.16 for ; Thu, 21 Nov 2013 06:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VaVxEoUPpZNrmL8zcobT0aB48Mi+hvla+bWrEHYteMo=; b=BurAQuIngXdOcdketejPR7elj5w0MY3hoCyCzMhvbvSzuqm7TN1GBcQjAdgUTgzvIn s/gsQdjTUnW7KNALsYFNAgtheZXbq3PcATRk0h7fznzK1suM+cYHQ+BSQzaxq0lRckP7 zOV+mHt3qS2zuK4yN9VMNI7VaxanbbIZ2J/VwuqUxXYnerOvZAPZrP1RdqUtrteMhFDu OItCvwsXA2/o1Q0ubBEv8wFfSTx0tevd6m0eUVdr2n6UbBfpCxXUzXa5hfSHD6FUI0OD D9W0i5UFKMFnD9N+dRIY6yM/Hm+ylgmEJDbw/oJfUUSB9WAkVxG9eagn8wqFYrE1L74g MxPw== X-Received: by 10.112.150.103 with SMTP id uh7mr2039905lbb.34.1385044585178; Thu, 21 Nov 2013 06:36:25 -0800 (PST) Received: from [192.168.2.30] ([2.176.162.77]) by mx.google.com with ESMTPSA id vz9sm23479590lbb.17.2013.11.21.06.36.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 06:36:24 -0800 (PST) Message-ID: <528E1A83.7070509@gmail.com> Date: Thu, 21 Nov 2013 18:06:51 +0330 From: Hooman Fazaeli User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r258328 - head/sys/net References: <201311182258.rAIMwEFd048783@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 14:36:28 -0000 On 11/21/2013 1:32 AM, Adrian Chadd wrote: > Can we revert this and just quickly put together something else that > won't potentially come back to bite us with weird side effects? > > My suggestions (and I'm happy to do this work if needed): > > * create a lightweight mbuf queue representation so an mbuf list isn't > just the mbuf header pointer; > * create a new ether input (say, ether_input_multi) that takes an mbuf > list, so existing driver code does the right thing. > > After that it'd be nice to write a set of mbuf list macros for > abstract the whole queue, dequeue, concat, iterate, etc (like > sys/queue.h, but for mbufs.) > > What do people think? > > (I've been doing it for m->next chained things, but not m->m_nextpkt things..) > > > > -adrian > > > What are possible sideeffects? What are the benefits we achieve by a distinct queue structure and having both if_input and if_input_multi? -- Best regards. Hooman Fazaeli From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 15: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3E1B3BD; Thu, 21 Nov 2013 15:41:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2E2B2FBE; Thu, 21 Nov 2013 15:41:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALFfqr3047589; Thu, 21 Nov 2013 15:41:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALFfq49047588; Thu, 21 Nov 2013 15:41:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201311211541.rALFfq49047588@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 21 Nov 2013 15:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258427 - head/sys/powerpc/pseries 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 15:41:53 -0000 Author: nwhitehorn Date: Thu Nov 21 15:41:52 2013 New Revision: 258427 URL: http://svnweb.freebsd.org/changeset/base/258427 Log: For PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the ibm,dma-window properties. This is especially a concern when #ibm,dma-address-cells is not specified and we have to use the regular #address-cells property. MFC after: 1 week Modified: head/sys/powerpc/pseries/plpar_iommu.c Modified: head/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- head/sys/powerpc/pseries/plpar_iommu.c Thu Nov 21 14:12:36 2013 (r258426) +++ head/sys/powerpc/pseries/plpar_iommu.c Thu Nov 21 15:41:52 2013 (r258427) @@ -73,8 +73,9 @@ phyp_iommu_set_dma_tag(device_t bus, dev { device_t p; phandle_t node; - cell_t dma_acells, dma_scells, dmawindow[5]; + cell_t dma_acells, dma_scells, dmawindow[6]; struct iommu_map *i; + int cell; for (p = dev; device_get_parent(p) != NULL; p = device_get_parent(p)) { if (ofw_bus_has_prop(p, "ibm,my-dma-window")) @@ -104,16 +105,17 @@ phyp_iommu_set_dma_tag(device_t bus, dev struct dma_window *window = malloc(sizeof(struct dma_window), M_PHYPIOMMU, M_WAITOK); - if (dma_acells == 1) - window->start = dmawindow[1]; - else - window->start = ((uint64_t)(dmawindow[1]) << 32) | dmawindow[2]; - if (dma_scells == 1) - window->end = window->start + dmawindow[dma_acells + 1]; - else - window->end = window->start + - (((uint64_t)(dmawindow[dma_acells + 1]) << 32) | - dmawindow[dma_acells + 2]); + window->start = 0; + for (cell = 1; cell < 1 + dma_acells; cell++) { + window->start <<= 32; + window->start |= dmawindow[cell]; + } + window->end = 0; + for (; cell < 1 + dma_acells + dma_scells; cell++) { + window->end <<= 32; + window->end |= dmawindow[cell]; + } + window->end += window->start; if (bootverbose) device_printf(dev, "Mapping IOMMU domain %#x\n", dmawindow[0]); From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 16:39:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62AB4429; Thu, 21 Nov 2013 16:39:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 506D7233A; Thu, 21 Nov 2013 16:39:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALGd0hu066037; Thu, 21 Nov 2013 16:39:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALGcv2P066013; Thu, 21 Nov 2013 16:38:57 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201311211638.rALGcv2P066013@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 21 Nov 2013 16:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258428 - in head/contrib/gcc: . config config/i386 config/rs6000 cp doc 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 16:39:00 -0000 Author: pfg Date: Thu Nov 21 16:38:57 2013 New Revision: 258428 URL: http://svnweb.freebsd.org/changeset/base/258428 Log: gcc: another round of merges from the gcc pre-43 branch. Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks Added: head/contrib/gcc/cp/ChangeLog.gcc43 Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/Makefile.in head/contrib/gcc/builtin-types.def head/contrib/gcc/builtins.c head/contrib/gcc/builtins.def head/contrib/gcc/cgraphunit.c head/contrib/gcc/collect2.c head/contrib/gcc/config/i386/beos-elf.h head/contrib/gcc/config/i386/cygwin.h head/contrib/gcc/config/i386/i386.c head/contrib/gcc/config/i386/i386.h head/contrib/gcc/config/i386/i386.md head/contrib/gcc/config/i386/nto.h head/contrib/gcc/config/rs6000/aix.h head/contrib/gcc/config/rs6000/sysv4.h head/contrib/gcc/config/svr4.h head/contrib/gcc/configure head/contrib/gcc/configure.ac head/contrib/gcc/coverage.c head/contrib/gcc/cp/decl2.c head/contrib/gcc/cp/name-lookup.c head/contrib/gcc/cppdefault.c head/contrib/gcc/doc/extend.texi head/contrib/gcc/doc/libgcc.texi head/contrib/gcc/doc/rtl.texi head/contrib/gcc/dwarf2out.c head/contrib/gcc/expr.c head/contrib/gcc/fold-const.c head/contrib/gcc/gcc.c head/contrib/gcc/genattrtab.c head/contrib/gcc/genopinit.c head/contrib/gcc/libgcc-std.ver head/contrib/gcc/libgcc2.c head/contrib/gcc/libgcc2.h head/contrib/gcc/mips-tdump.c head/contrib/gcc/mips-tfile.c head/contrib/gcc/mklibgcc.in head/contrib/gcc/optabs.c head/contrib/gcc/optabs.h head/contrib/gcc/reload1.c head/contrib/gcc/rtl.def head/contrib/gcc/simplify-rtx.c head/contrib/gcc/tree-ssa-propagate.c head/contrib/gcc/tree.c head/contrib/gcc/tree.h Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/ChangeLog.gcc43 Thu Nov 21 16:38:57 2013 (r258428) @@ -10,6 +10,12 @@ * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-31 Eric Christopher + + * expr.c (convert_move): Assert that we don't have a BLKmode + operand. + (store_expr): Handle BLKmode moves by calling emit_block_move. + 2007-05-24 Richard Sandiford (r125037) * postreload-gcse.c (reg_changed_after_insn_p): New function. @@ -99,6 +105,12 @@ (dwarf2out_imported_module_or_decl): Suppress struct debug information using should_emit_struct_debug when appropriate. +2007-04-16 Ian Lance Taylor (r123906) + + * tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer + predecessors at head rather than tail. + + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -333,6 +345,28 @@ * doc/invoke.texi (Warning Options): Update -Wparentheses description. +2006-12-12 Geoffrey Keating (r119820) + + * mips-tdump.c: Replace CROSS_COMPILE with + CROSS_DIRECTORY_STRUCTURE. + * mips-tfile.c: Likewise. + * gcc.c: Likewise. + * configure.ac: Likewise. + * cppdefault.c: Likewise. + * Makefile.in: Likewise. + * config/alpha/osf.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/beos-elf.h: Likewise. + * config/i386/nto.h: Likewise. + * config/svr4.h: Likewise. + * config/rs6000/aix.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * collect2.c: Likewise. + * configure: Regenerate. + + * doc/tm.texi (Alignment Output): Document that ASM_OUTPUT_SKIP + actually takes an unsigned HOST_WIDE_INT for its second parameter. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -371,6 +405,30 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-11-07 Eric Christopher (r118576) + + * libgcc2.c (__bswapdi2): Rename from bswapDI2. + (__bswapsi2): Ditto. + * libgcc2.h: Remove transformation of bswap routines. + * config/i386/i386.md (bswapsi2): New. + (bswapdi2): Ditto. + +2006-10-31 Geoffrey Keating (r118360) + + * coverage.c (coverage_checksum_string): Update comment. + * dwarf2out.c (switch_to_eh_frame_section): Update for removal + of get_file_function_name. + * cgraphunit.c (cgraph_build_static_cdtor): Update for rename + of get_file_function_name_long. + * tree.c (get_file_function_name): Rename from + get_file_function_name_long; improve comment; handle 'I' and 'D' + specially when the target has ctor/dtor support; remove special + handling for 'F'. + (get_file_function_name): Remove. + * tree.h (get_file_function_name): Rename from + get_file_function_name_long. + (get_file_function_name): Remove prototype. + 2006-10-31 Geoffrey Keating (r118356) * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on @@ -521,3 +579,51 @@ * builtins.c (fold_builtin_classify): Fix typo. +2006-09-07 Eric Christopher (r118361) + Falk Hueffner + + * doc/extend.texi (__builtin_bswap32): Document. + (__builtin_bswap64): Ditto. + * doc/libgcc.texi (bswapsi2): Document. + (bswapdi2): Ditto. + * doc/rtl.texi (bswap): Document. + * optabs.c (expand_unop): Don't widen a bswap. + (init_optabs): Init bswap. Set libfuncs explicitly + for bswapsi2 and bswapdi2. + * optabs.h (OTI_bswap): New. + (bswap_optab): Ditto. + * genopinit.c (optabs): Handle bswap_optab. + * tree.h (tree_index): Add TI_UINT32_TYPE and + TI_UINT64_TYPE. + (uint32_type_node): New. + (uint64_type_node): Ditto. + * tree.c (build_common_tree_nodes_2): Initialize + uint32_type_node and uint64_type_node. + * builtins.c (expand_builtin_bswap): New. + (expand_builtin): Call. + (fold_builtin_bswap): New. + (fold_builtin_1): Call. + * fold-const.c (tree_expr_nonnegative_p): Return true + for bswap. + * builtin-types.def (BT_UINT32): New. + (BT_UINT64): Ditto. + (BT_FN_UINT32_UINT32): Ditto. + (BT_FN_UINT64_UINT64): Ditto. + * builtins.def (BUILT_IN_BSWAP32): New. + (BUILT_IN_BSWAP64): Ditto. + * rtl.def (BSWAP): New. + * genattrtab.c (check_attr_value): New. + * libgcc2.c (__bswapSI2): New. + (__bswapDI2): Ditto. + * libgcc2.h (__bswapSI2): Declare. + (__bswapDI2): Ditto. + * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. + * simplify-rtx.c (simplify_const_unary_operation): Return + 0 for BSWAP. + * libgcc-std.ver (__bwapsi2): Add. + (__bswapdi2): Ditto. + * reload1.c (eliminate_regs_1): Add bswap. + (elimination_effects): Ditto. + * config/i386/i386.h (x86_bswap): New. + (TARGET_BSWAP): Use. + * config/i386/i386.c (x86_bswap): Set. Modified: head/contrib/gcc/Makefile.in ============================================================================== --- head/contrib/gcc/Makefile.in Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/Makefile.in Thu Nov 21 16:38:57 2013 (r258428) @@ -822,7 +822,8 @@ REAL_H = real.h $(MACHMODE_H) # IN_GCC distinguishes between code compiled into GCC itself and other # programs built during a bootstrap. -# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler. +# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a +# cross compiler which does not use the native headers and libraries. INTERNAL_CFLAGS = -DIN_GCC @CROSS@ # This is the variable actually used when we compile. If you change this, Modified: head/contrib/gcc/builtin-types.def ============================================================================== --- head/contrib/gcc/builtin-types.def Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/builtin-types.def Thu Nov 21 16:38:57 2013 (r258428) @@ -75,6 +75,8 @@ DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_lo DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node) DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0)) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node) @@ -204,6 +206,10 @@ DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFL DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONGLONG_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) @@ -435,4 +441,3 @@ DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRIN DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE) - Modified: head/contrib/gcc/builtins.c ============================================================================== --- head/contrib/gcc/builtins.c Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/builtins.c Thu Nov 21 16:38:57 2013 (r258428) @@ -4589,6 +4589,30 @@ expand_builtin_alloca (tree arglist, rtx return result; } +/* Expand a call to a bswap builtin. The arguments are in ARGLIST. MODE + is the mode to expand with. */ + +static rtx +expand_builtin_bswap (tree arglist, rtx target, rtx subtarget) +{ + enum machine_mode mode; + tree arg; + rtx op0; + + if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + mode = TYPE_MODE (TREE_TYPE (arg)); + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + target = expand_unop (mode, bswap_optab, op0, target, 1); + + gcc_assert (target); + + return convert_to_mode (mode, target, 0); +} + /* Expand a call to a unary builtin. The arguments are in ARGLIST. Return 0 if a normal call should be emitted rather than expanding the function in-line. If convenient, the result should be placed in TARGET. @@ -5877,6 +5901,14 @@ expand_builtin (tree exp, rtx target, rt expand_stack_restore (TREE_VALUE (arglist)); return const0_rtx; + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + target = expand_builtin_bswap (arglist, target, subtarget); + + if (target) + return target; + break; + CASE_INT_FN (BUILT_IN_FFS): case BUILT_IN_FFSIMAX: target = expand_builtin_unop (target_mode, arglist, target, @@ -7539,6 +7571,67 @@ fold_builtin_bitop (tree fndecl, tree ar return NULL_TREE; } +/* Fold function call to builtin_bswap and the long and long long + variants. Return NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_bswap (tree fndecl, tree arglist) +{ + tree arg; + + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + /* Optimize constant value. */ + arg = TREE_VALUE (arglist); + if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg)) + { + HOST_WIDE_INT hi, width, r_hi = 0; + unsigned HOST_WIDE_INT lo, r_lo = 0; + tree type; + + type = TREE_TYPE (arg); + width = TYPE_PRECISION (type); + lo = TREE_INT_CST_LOW (arg); + hi = TREE_INT_CST_HIGH (arg); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + { + int s; + + for (s = 0; s < width; s += 8) + { + int d = width - s - 8; + unsigned HOST_WIDE_INT byte; + + if (s < HOST_BITS_PER_WIDE_INT) + byte = (lo >> s) & 0xff; + else + byte = (hi >> (s - HOST_BITS_PER_WIDE_INT)) & 0xff; + + if (d < HOST_BITS_PER_WIDE_INT) + r_lo |= byte << d; + else + r_hi |= byte << (d - HOST_BITS_PER_WIDE_INT); + } + } + + break; + + default: + gcc_unreachable (); + } + + if (width < HOST_BITS_PER_WIDE_INT) + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), r_lo); + else + return build_int_cst_wide (TREE_TYPE (TREE_TYPE (fndecl)), r_lo, r_hi); + } + + return NULL_TREE; +} /* Return true if EXPR is the real constant contained in VALUE. */ static bool @@ -9053,6 +9146,10 @@ fold_builtin_1 (tree fndecl, tree arglis CASE_FLT_FN (BUILT_IN_LLRINT): return fold_fixed_mathfn (fndecl, arglist); + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + return fold_builtin_bswap (fndecl, arglist); + CASE_INT_FN (BUILT_IN_FFS): CASE_INT_FN (BUILT_IN_CLZ): CASE_INT_FN (BUILT_IN_CTZ): Modified: head/contrib/gcc/builtins.def ============================================================================== --- head/contrib/gcc/builtins.def Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/builtins.def Thu Nov 21 16:38:57 2013 (r258428) @@ -594,6 +594,8 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) Modified: head/contrib/gcc/cgraphunit.c ============================================================================== --- head/contrib/gcc/cgraphunit.c Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/cgraphunit.c Thu Nov 21 16:38:57 2013 (r258428) @@ -1676,7 +1676,7 @@ cgraph_build_static_cdtor (char which, t tree decl, name, resdecl; sprintf (which_buf, "%c_%d", which, counter++); - name = get_file_function_name_long (which_buf); + name = get_file_function_name (which_buf); decl = build_decl (FUNCTION_DECL, name, build_function_type (void_type_node, void_list_node)); Modified: head/contrib/gcc/collect2.c ============================================================================== --- head/contrib/gcc/collect2.c Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/collect2.c Thu Nov 21 16:38:57 2013 (r258428) @@ -53,7 +53,7 @@ Software Foundation, 51 Franklin Street, the utilities are not correct for a cross-compiler; we have to hope that cross-versions are in the proper directories. */ -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #undef OBJECT_FORMAT_COFF #undef MD_EXEC_PREFIX #undef REAL_LD_FILE_NAME @@ -553,7 +553,7 @@ is_ctor_dtor (const char *s) static struct path_prefix cpath, path; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* This is the name of the target machine. We use it to form the name of the files to execute. */ @@ -746,7 +746,7 @@ main (int argc, char **argv) static const char *const strip_suffix = "strip"; static const char *const gstrip_suffix = "gstrip"; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* If we look for a program in the compiler directories, we just use the short name, since these directories are already system-specific. But it we look for a program in the system directories, we need to @@ -775,7 +775,7 @@ main (int argc, char **argv) #endif const char *const full_strip_suffix = strip_suffix; const char *const full_gstrip_suffix = gstrip_suffix; -#endif /* CROSS_COMPILE */ +#endif /* CROSS_DIRECTORY_STRUCTURE */ const char *arg; FILE *outf; @@ -957,7 +957,7 @@ main (int argc, char **argv) c_file_name = getenv ("COLLECT_GCC"); if (c_file_name == 0) { -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE c_file_name = concat (target_machine, "-gcc", NULL); #else c_file_name = "gcc"; Modified: head/contrib/gcc/config/i386/beos-elf.h ============================================================================== --- head/contrib/gcc/config/i386/beos-elf.h Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/config/i386/beos-elf.h Thu Nov 21 16:38:57 2013 (r258428) @@ -135,7 +135,7 @@ Boston, MA 02110-1301, USA. */ for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we use ANSI string concatenation here (FIXME) */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ @@ -177,7 +177,7 @@ Boston, MA 02110-1301, USA. */ { "/boot/develop/headers", 0, 0, 0 }, \ { 0, 0, 0, 0 } \ } -#else /* CROSS_COMPILE */ +#else /* CROSS_DIRECTORY_STRUCTURE */ #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ Modified: head/contrib/gcc/config/i386/cygwin.h ============================================================================== --- head/contrib/gcc/config/i386/cygwin.h Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/config/i386/cygwin.h Thu Nov 21 16:38:57 2013 (r258428) @@ -146,7 +146,7 @@ char cygwin_tool_include_dir[sizeof (TOO #undef TOOL_INCLUDE_DIR #define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir) -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/usr/include" char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1 Modified: head/contrib/gcc/config/i386/i386.c ============================================================================== --- head/contrib/gcc/config/i386/i386.c Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/config/i386/i386.c Thu Nov 21 16:38:57 2013 (r258428) @@ -1089,6 +1089,8 @@ const int x86_cmpxchg = ~m_386; const int x86_cmpxchg8b = ~(m_386 | m_486); /* Exchange and add was added for 80486. */ const int x86_xadd = ~m_386; +/* Byteswap was added for 80486. */ +const int x86_bswap = ~m_386; const int x86_pad_returns = m_ATHLON_K8_AMDFAM10 | m_CORE2 | m_GENERIC; /* In case the average insn count for single function invocation is Modified: head/contrib/gcc/config/i386/i386.h ============================================================================== --- head/contrib/gcc/config/i386/i386.h Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/config/i386/i386.h Thu Nov 21 16:38:57 2013 (r258428) @@ -168,6 +168,7 @@ extern const int x86_use_bt; extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd; extern const int x86_use_incdec; extern const int x86_pad_returns; +extern const int x86_bswap; extern const int x86_partial_flag_reg_stall; extern int x86_prefetch_sse, x86_cmpxchg16b; @@ -243,6 +244,7 @@ extern int x86_prefetch_sse, x86_cmpxchg #define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch)) #define TARGET_CMPXCHG16B (x86_cmpxchg16b) #define TARGET_XADD (x86_xadd & (1 << ix86_arch)) +#define TARGET_BSWAP (x86_bswap & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 Modified: head/contrib/gcc/config/i386/i386.md ============================================================================== --- head/contrib/gcc/config/i386/i386.md Thu Nov 21 15:41:52 2013 (r258427) +++ head/contrib/gcc/config/i386/i386.md Thu Nov 21 16:38:57 2013 (r258428) @@ -284,14 +284,14 @@ (const_int 0))) ;; Set when string REP prefix is used. -(define_attr "prefix_rep" "" +(define_attr "prefix_rep" "" (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF")) (const_int 1) (const_int 0))) ;; Set when 0f opcode prefix is used. (define_attr "prefix_0f" "" - (if_then_else + (if_then_else (ior (eq_attr "type" "imovx,setcc,icmov,bitmanip") (eq_attr "unit" "sse,mmx")) (const_int 1) @@ -466,7 +466,7 @@ ;; All x87 floating point modes (define_mode_macro X87MODEF [SF DF XF]) - + ;; All integer modes handled by x87 fisttp operator. (define_mode_macro X87MODEI [HI SI DI]) @@ -475,7 +475,7 @@ ;; All SSE floating point modes (define_mode_macro SSEMODEF [SF DF]) - + ;; All integer modes handled by SSE cvtts?2si* operators. (define_mode_macro SSEMODEI24 [SI DI]) @@ -1098,7 +1098,7 @@ ;; Push/pop instructions. They are separate since autoinc/dec is not a ;; general_operand. ;; -;; %%% We don't use a post-inc memory reference because x86 is not a +;; %%% We don't use a post-inc memory reference because x86 is not a ;; general AUTO_INC_DEC host, which impacts how it is treated in flow. ;; Changing this impacts compiler performance on other non-AUTO_INC_DEC ;; targets without our curiosities, and it is just as easy to represent @@ -1160,7 +1160,7 @@ [(set_attr "type" "alu1") (set_attr "mode" "SI") (set_attr "length_immediate" "0")]) - + (define_insn "*movsi_or" [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "immediate_operand" "i")) @@ -2308,7 +2308,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], SFmode))" + || memory_operand (operands[0], SFmode))" { switch (which_alternative) { @@ -2368,7 +2368,7 @@ (const_string "V4SF")) /* For architectures resolving dependencies on whole SSE registers use APS move to break dependency - chains, otherwise use short move to avoid extra work. + chains, otherwise use short move to avoid extra work. Do the same for architectures resolving dependencies on the parts. While in DF mode it is better to always handle @@ -2476,7 +2476,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2596,7 +2596,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2712,10 +2712,10 @@ (match_operand:DF 1 "general_operand" ""))] "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -2807,7 +2807,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2841,7 +2841,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2875,10 +2875,10 @@ "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && GET_MODE (operands[0]) == XFmode - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -3073,7 +3073,7 @@ [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_operand:HI 0 "register_operand" "") @@ -3143,7 +3143,7 @@ [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_dup 0) @@ -3220,7 +3220,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3229,7 +3229,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3308,7 +3308,7 @@ (set_attr "mode" "DI")]) ;; Extend to memory case when source register does die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3323,7 +3323,7 @@ "split_di (&operands[0], 1, &operands[3], &operands[4]);") ;; Extend to memory case when source register does not die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3353,7 +3353,7 @@ ;; Extend to register case. Optimize case where source and destination ;; registers match and cases where we can use cltd. -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3482,7 +3482,7 @@ ;; These are all no-ops in the model used for the 80387. So just ;; emit moves. -;; %%% Kill these when call knows how to work out a DFmode push earlier. +;; %%% Kill these when call knows how to work out a DFmode push earlier. (define_insn "*dummy_extendsfdf2" [(set (match_operand:DF 0 "push_operand" "=<") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fY")))] @@ -4365,7 +4365,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4380,7 +4380,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4421,7 +4421,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4434,7 +4434,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4913,7 +4913,7 @@ (define_insn "*addsi3_carry_zext" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI + (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0")) (match_operand:SI 2 "general_operand" "rim")))) @@ -5222,7 +5222,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rme,re")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=r,rm") (plus:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5369,7 +5369,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rme")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:DI 0 "=r"))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5568,7 +5568,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm") (plus:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -5616,7 +5616,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5794,7 +5794,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM) @@ -5934,7 +5934,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm") (plus:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -6054,7 +6054,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:HI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" @@ -7483,7 +7483,7 @@ (match_operand:DF 2 "nonimmediate_operand" "")))] "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" "") - + (define_expand "divsf3" [(set (match_operand:SF 0 "register_operand" "") (div:SF (match_operand:SF 1 "register_operand" "") @@ -8161,7 +8161,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bq|x}\t{%1,%0|%0, %1}"; @@ -8226,7 +8226,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bl|x}\t{%1,%0|%0, %1}"; @@ -8270,7 +8270,7 @@ [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) @@ -8458,7 +8458,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8487,7 +8487,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_dup 1) (const_int 8) @@ -8503,7 +8503,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8521,7 +8521,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8864,7 +8864,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8881,7 +8881,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8900,7 +8900,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8919,7 +8919,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9202,7 +9202,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9219,7 +9219,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9238,7 +9238,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9257,7 +9257,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9325,7 +9325,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "!TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9346,7 +9346,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9368,7 +9368,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))])] "" @@ -9867,7 +9867,7 @@ enum machine_mode mode = GET_MODE (operands[0]); enum machine_mode vmode = GET_MODE (operands[2]); rtx tmp; - + operands[0] = simplify_gen_subreg (vmode, operands[0], mode, 0); operands[1] = simplify_gen_subreg (vmode, operands[1], mode, 0); if (operands_match_p (operands[0], operands[2])) @@ -9891,7 +9891,7 @@ "reload_completed" [(parallel [(set (match_dup 0) (match_dup 1)) (clobber (reg:CC FLAGS_REG))])] -{ +{ rtx tmp; operands[0] = gen_lowpart (SImode, operands[0]); if (GET_CODE (operands[1]) == ABS) @@ -9998,7 +9998,7 @@ operands[1] = tmp; }) -;; Conditionalize these after reload. If they match before reload, we +;; Conditionalize these after reload. If they match before reload, we ;; lose the clobber and ability to use integer instructions. (define_insn "*negsf2_1" @@ -11415,8 +11415,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11448,8 +11448,8 @@ && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11628,8 +11628,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11684,8 +11684,8 @@ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11785,8 +11785,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 16:44: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1467709; Thu, 21 Nov 2013 16:44:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E80123A2; Thu, 21 Nov 2013 16:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALGichY069009; Thu, 21 Nov 2013 16:44:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALGiaC1068994; Thu, 21 Nov 2013 16:44:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201311211644.rALGiaC1068994@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 21 Nov 2013 16:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258429 - in head/contrib/libstdc++: include/bits include/ext libsupc++ 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 16:44:38 -0000 Author: pfg Date: Thu Nov 21 16:44:36 2013 New Revision: 258429 URL: http://svnweb.freebsd.org/changeset/base/258429 Log: libstdc++: merge non-abi changes from Apple's developer tools Take some changes from Apple's Developer Tools 4.0 [1]: block.patch emergency-buffer-reduction.patch test_cleanup.patch vector_copy_no_alloc.patch problem/6473222 copy-constructing a std::vector from an empty std::vector calls malloc 2008-10-27 Howard Hinnant stl_tree_system_header.patch Added #pragma GCC system_header to stl_tree.h. copy_doc.patch Corrected documentation concerning copy in stl_algobase.h. string_compare.patch Fixed basic_string.h, basic_string.tcc, incorrect 64bit to 32bit narrowing. Reference: [1] http://opensource.apple.com/source/libstdcxx/libstdcxx-39/patches-4.2.1/ Obtained from: Apple MFC after: 1 month Modified: head/contrib/libstdc++/include/bits/basic_string.h head/contrib/libstdc++/include/bits/basic_string.tcc head/contrib/libstdc++/include/bits/stl_algobase.h head/contrib/libstdc++/include/bits/stl_tree.h head/contrib/libstdc++/include/bits/stl_vector.h head/contrib/libstdc++/include/ext/mt_allocator.h head/contrib/libstdc++/include/ext/throw_allocator.h head/contrib/libstdc++/libsupc++/eh_alloc.cc head/contrib/libstdc++/src/mt_allocator.cc Modified: head/contrib/libstdc++/include/bits/basic_string.h ============================================================================== --- head/contrib/libstdc++/include/bits/basic_string.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/bits/basic_string.h Thu Nov 21 16:44:36 2013 (r258429) @@ -390,6 +390,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) { _M_copy(__p, __k1, __k2 - __k1); } + static int + _S_compare(size_type __x, size_type __y) + { + if (__x > __y) + return 1; + if (__x < __y) + return -1; + return 0; + } + void _M_mutate(size_type __pos, size_type __len1, size_type __len2); @@ -1934,7 +1944,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) int __r = traits_type::compare(_M_data(), __str.data(), __len); if (!__r) - __r = __size - __osize; + __r = _S_compare(__size, __osize); return __r; } Modified: head/contrib/libstdc++/include/bits/basic_string.tcc ============================================================================== --- head/contrib/libstdc++/include/bits/basic_string.tcc Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/bits/basic_string.tcc Thu Nov 21 16:44:36 2013 (r258429) @@ -903,7 +903,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n, __osize); int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len); if (!__r) - __r = __n - __osize; + __r = _S_compare(__n, __osize); return __r; } @@ -921,7 +921,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) int __r = traits_type::compare(_M_data() + __pos1, __str.data() + __pos2, __len); if (!__r) - __r = __n1 - __n2; + __r = _S_compare(__n1, __n2); return __r; } @@ -936,7 +936,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__size, __osize); int __r = traits_type::compare(_M_data(), __s, __len); if (!__r) - __r = __size - __osize; + __r = _S_compare(__size, __osize); return __r; } @@ -952,7 +952,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n1, __osize); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) - __r = __n1 - __osize; + __r = _S_compare(__n1, __osize); return __r; } @@ -968,7 +968,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n1, __n2); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) - __r = __n1 - __n2; + __r = _S_compare(__n1, __n2); return __r; } Modified: head/contrib/libstdc++/include/bits/stl_algobase.h ============================================================================== --- head/contrib/libstdc++/include/bits/stl_algobase.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/bits/stl_algobase.h Thu Nov 21 16:44:36 2013 (r258429) @@ -373,7 +373,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @param first An input iterator. * @param last An input iterator. * @param result An output iterator. - * @return result + (first - last) + * @return result + (last - first) * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the Modified: head/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- head/contrib/libstdc++/include/bits/stl_tree.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/bits/stl_tree.h Thu Nov 21 16:44:36 2013 (r258429) @@ -64,6 +64,8 @@ #ifndef _TREE_H #define _TREE_H 1 +#pragma GCC system_header + #include #include #include Modified: head/contrib/libstdc++/include/bits/stl_vector.h ============================================================================== --- head/contrib/libstdc++/include/bits/stl_vector.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/bits/stl_vector.h Thu Nov 21 16:44:36 2013 (r258429) @@ -119,9 +119,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Vector_base(size_t __n, const allocator_type& __a) : _M_impl(__a) { - this->_M_impl._M_start = this->_M_allocate(__n); - this->_M_impl._M_finish = this->_M_impl._M_start; - this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; + if (__n) + { + this->_M_impl._M_start = this->_M_allocate(__n); + this->_M_impl._M_finish = this->_M_impl._M_start; + this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; + } } ~_Vector_base() Modified: head/contrib/libstdc++/include/ext/mt_allocator.h ============================================================================== --- head/contrib/libstdc++/include/ext/mt_allocator.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/ext/mt_allocator.h Thu Nov 21 16:44:36 2013 (r258429) @@ -342,12 +342,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { return _M_bin[__which]; } void - _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block, + _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block_record, size_t __thread_id) { if (__gthread_active_p()) { - __block->_M_thread_id = __thread_id; + __block_record->_M_thread_id = __thread_id; --__bin._M_free[__thread_id]; ++__bin._M_used[__thread_id]; } @@ -697,11 +697,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { // Already reserved. typedef typename __pool_type::_Block_record _Block_record; - _Block_record* __block = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __block->_M_next; + _Block_record* __block_record = __bin._M_first[__thread_id]; + __bin._M_first[__thread_id] = __block_record->_M_next; - __pool._M_adjust_freelist(__bin, __block, __thread_id); - __c = reinterpret_cast(__block) + __pool._M_get_align(); + __pool._M_adjust_freelist(__bin, __block_record, __thread_id); + __c = reinterpret_cast(__block_record) + __pool._M_get_align(); } else { Modified: head/contrib/libstdc++/include/ext/throw_allocator.h ============================================================================== --- head/contrib/libstdc++/include/ext/throw_allocator.h Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/include/ext/throw_allocator.h Thu Nov 21 16:44:36 2013 (r258429) @@ -423,11 +423,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) s += buf; s += tab; s += "label: "; - sprintf(buf, "%u", ref.second.first); + sprintf(buf, "%lu", ref.second.first); s += buf; s += tab; s += "size: "; - sprintf(buf, "%u", ref.second.second); + sprintf(buf, "%lu", ref.second.second); s += buf; s += '\n'; } Modified: head/contrib/libstdc++/libsupc++/eh_alloc.cc ============================================================================== --- head/contrib/libstdc++/libsupc++/eh_alloc.cc Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/libsupc++/eh_alloc.cc Thu Nov 21 16:44:36 2013 (r258429) @@ -78,6 +78,14 @@ using namespace __cxxabiv1; # define EMERGENCY_OBJ_COUNT 4 #endif +/* APPLE LOCAL begin reduce emergency buffer size */ +/* 256 bytes is more than large enough for an std::bad_alloc object */ +#undef EMERGENCY_OBJ_SIZE +#undef EMERGENCY_OBJ_COUNT +#define EMERGENCY_OBJ_SIZE 256 +#define EMERGENCY_OBJ_COUNT 2 +/* APPLE LOCAL end reduce emergency buffer size */ + #if INT_MAX == 32767 || EMERGENCY_OBJ_COUNT <= 32 typedef unsigned int bitmask_type; #else Modified: head/contrib/libstdc++/src/mt_allocator.cc ============================================================================== --- head/contrib/libstdc++/src/mt_allocator.cc Thu Nov 21 16:38:57 2013 (r258428) +++ head/contrib/libstdc++/src/mt_allocator.cc Thu Nov 21 16:44:36 2013 (r258429) @@ -107,11 +107,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _Bin_record& __bin = _M_bin[__which]; char* __c = __p - _M_get_align(); - _Block_record* __block = reinterpret_cast<_Block_record*>(__c); + _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c); // Single threaded application - return to global pool. - __block->_M_next = __bin._M_first[0]; - __bin._M_first[0] = __block; + __block_record->_M_next = __bin._M_first[0]; + __bin._M_first[0] = __block_record; } char* @@ -134,22 +134,22 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) __bin._M_address = __address; char* __c = static_cast(__v) + sizeof(_Block_address); - _Block_record* __block = reinterpret_cast<_Block_record*>(__c); - __bin._M_first[__thread_id] = __block; + _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c); + __bin._M_first[__thread_id] = __block_record; while (--__block_count > 0) { __c += __bin_size; - __block->_M_next = reinterpret_cast<_Block_record*>(__c); - __block = __block->_M_next; + __block_record->_M_next = reinterpret_cast<_Block_record*>(__c); + __block_record = __block_record->_M_next; } - __block->_M_next = NULL; + __block_record->_M_next = NULL; - __block = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __block->_M_next; + __block_record = __bin._M_first[__thread_id]; + __bin._M_first[__thread_id] = __block_record->_M_next; // NB: For alignment reasons, we can't use the first _M_align // bytes, even when sizeof(_Block_record) < _M_align. - return reinterpret_cast(__block) + __options._M_align; + return reinterpret_cast(__block_record) + __options._M_align; } void @@ -256,7 +256,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // Know __p not null, assume valid block. char* __c = __p - _M_get_align(); - _Block_record* __block = reinterpret_cast<_Block_record*>(__c); + _Block_record* __block_record = reinterpret_cast<_Block_record*>(__c); if (__gthread_active_p()) { // Calculate the number of records to remove from our freelist: @@ -313,13 +313,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // Return this block to our list and update counters and // owner id as needed. - if (__block->_M_thread_id == __thread_id) + if (__block_record->_M_thread_id == __thread_id) --__bin._M_used[__thread_id]; else - __atomic_add(&__reclaimed_base[__block->_M_thread_id], 1); + __atomic_add(&__reclaimed_base[__block_record->_M_thread_id], 1); - __block->_M_next = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __block; + __block_record->_M_next = __bin._M_first[__thread_id]; + __bin._M_first[__thread_id] = __block_record; ++__bin._M_free[__thread_id]; } @@ -327,8 +327,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { // Not using threads, so single threaded application - return // to global pool. - __block->_M_next = __bin._M_first[0]; - __bin._M_first[0] = __block; + __block_record->_M_next = __bin._M_first[0]; + __bin._M_first[0] = __block_record; } } @@ -354,7 +354,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // blocks on global list (and if not add new ones) and // get the first one. _Bin_record& __bin = _M_bin[__which]; - _Block_record* __block = NULL; + _Block_record* __block_record = NULL; if (__gthread_active_p()) { // Resync the _M_used counters. @@ -378,16 +378,16 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // No need to hold the lock when we are adding a whole // chunk to our own list. char* __c = static_cast(__v) + sizeof(_Block_address); - __block = reinterpret_cast<_Block_record*>(__c); + __block_record = reinterpret_cast<_Block_record*>(__c); __bin._M_free[__thread_id] = __block_count; - __bin._M_first[__thread_id] = __block; + __bin._M_first[__thread_id] = __block_record; while (--__block_count > 0) { __c += __bin_size; - __block->_M_next = reinterpret_cast<_Block_record*>(__c); - __block = __block->_M_next; + __block_record->_M_next = reinterpret_cast<_Block_record*>(__c); + __block_record = __block_record->_M_next; } - __block->_M_next = NULL; + __block_record->_M_next = NULL; } else { @@ -405,11 +405,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { __bin._M_free[__thread_id] = __block_count; __bin._M_free[0] -= __block_count; - __block = __bin._M_first[0]; + __block_record = __bin._M_first[0]; while (--__block_count > 0) - __block = __block->_M_next; - __bin._M_first[0] = __block->_M_next; - __block->_M_next = NULL; + __block_record = __block_record->_M_next; + __bin._M_first[0] = __block_record->_M_next; + __block_record->_M_next = NULL; } __gthread_mutex_unlock(__bin._M_mutex); } @@ -423,30 +423,30 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) __bin._M_address = __address; char* __c = static_cast(__v) + sizeof(_Block_address); - __block = reinterpret_cast<_Block_record*>(__c); - __bin._M_first[0] = __block; + __block_record = reinterpret_cast<_Block_record*>(__c); + __bin._M_first[0] = __block_record; while (--__block_count > 0) { __c += __bin_size; - __block->_M_next = reinterpret_cast<_Block_record*>(__c); - __block = __block->_M_next; + __block_record->_M_next = reinterpret_cast<_Block_record*>(__c); + __block_record = __block_record->_M_next; } - __block->_M_next = NULL; + __block_record->_M_next = NULL; } - __block = __bin._M_first[__thread_id]; - __bin._M_first[__thread_id] = __block->_M_next; + __block_record = __bin._M_first[__thread_id]; + __bin._M_first[__thread_id] = __block_record->_M_next; if (__gthread_active_p()) { - __block->_M_thread_id = __thread_id; + __block_record->_M_thread_id = __thread_id; --__bin._M_free[__thread_id]; ++__bin._M_used[__thread_id]; } // NB: For alignment reasons, we can't use the first _M_align // bytes, even when sizeof(_Block_record) < _M_align. - return reinterpret_cast(__block) + __options._M_align; + return reinterpret_cast(__block_record) + __options._M_align; } void From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 17:49: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBD0CDB; Thu, 21 Nov 2013 17:49:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB8D82731; Thu, 21 Nov 2013 17:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALHnuPL089429; Thu, 21 Nov 2013 17:49:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALHnumK089428; Thu, 21 Nov 2013 17:49:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311211749.rALHnumK089428@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 17:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258430 - head/usr.sbin/bsdconfig/networking/share 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 17:49:56 -0000 Author: dteske Date: Thu Nov 21 17:49:56 2013 New Revision: 258430 URL: http://svnweb.freebsd.org/changeset/base/258430 Log: Remove unused line -- cruft left over from SVN r258360. Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Thu Nov 21 16:44:36 2013 (r258429) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Thu Nov 21 17:49:56 2013 (r258430) @@ -74,7 +74,6 @@ f_dialog_menu_netdev() # # Get list of usable network interfaces # - local d='[[:digit:]]+:' local if iflist= # Calculated below for if in $( ifconfig -l ); do # Skip unsavory interfaces From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 18:37:11 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D171202; Thu, 21 Nov 2013 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA1C2B07; Thu, 21 Nov 2013 18:37:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALIbB6F006194; Thu, 21 Nov 2013 18:37:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALIbBdU006191; Thu, 21 Nov 2013 18:37:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311211837.rALIbBdU006191@svn.freebsd.org> From: Ed Maste Date: Thu, 21 Nov 2013 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258431 - head/sys/amd64/amd64 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 18:37:11 -0000 Author: emaste Date: Thu Nov 21 18:37:11 2013 New Revision: 258431 URL: http://svnweb.freebsd.org/changeset/base/258431 Log: Disable amd64 boot time memory test by default The page presence memory test takes a long time on large memory systems and has little value on contemporary amd64 hardware. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Nov 21 17:49:56 2013 (r258430) +++ head/sys/amd64/amd64/machdep.c Thu Nov 21 18:37:11 2013 (r258431) @@ -1476,13 +1476,15 @@ getmemsize(caddr_t kmdp, u_int64_t first Maxmem = atop(physmem_tunable); /* - * By default enable the memory test on real hardware, and disable - * it if we appear to be running in a VM. This avoids touching all - * pages unnecessarily, which doesn't matter on real hardware but is - * bad for shared VM hosts. Use a general name so that - * one could eventually do more with the code than just disable it. + * The boot memory test is disabled by default, as it takes a + * significant amount of time on large-memory systems, and is + * unfriendly to virtual machines as it unnecessarily touches all + * pages. + * + * A general name is used as the code may be extended to support + * additional tests beyond the current "page present" test. */ - memtest = (vm_guest > VM_GUEST_NO) ? 0 : 1; + memtest = 0; TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:00:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD24BE90; Thu, 21 Nov 2013 19:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCD402D10; Thu, 21 Nov 2013 19:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJ0LhT015133; Thu, 21 Nov 2013 19:00:21 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJ0LeU015131; Thu, 21 Nov 2013 19:00:21 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201311211900.rALJ0LeU015131@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 21 Nov 2013 19:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258432 - in head/release/doc/en_US.ISO8859-1: errata readme 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:00:21 -0000 Author: rodrigc Date: Thu Nov 21 19:00:21 2013 New Revision: 258432 URL: http://svnweb.freebsd.org/changeset/base/258432 Log: Update copyrights Submitted by: skreuzer Modified: head/release/doc/en_US.ISO8859-1/errata/article.xml head/release/doc/en_US.ISO8859-1/readme/article.xml Modified: head/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 21 18:37:11 2013 (r258431) +++ head/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 21 19:00:21 2013 (r258432) @@ -32,6 +32,14 @@ 2003 2004 2005 + 2006 + 2007 + 2008 + 2009 + 2010 + 2011 + 2012 + 2013 The &os; Documentation Project Modified: head/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/readme/article.xml Thu Nov 21 18:37:11 2013 (r258431) +++ head/release/doc/en_US.ISO8859-1/readme/article.xml Thu Nov 21 19:00:21 2013 (r258432) @@ -30,6 +30,11 @@ 2006 2007 2008 + 2009 + 2010 + 2011 + 2012 + 2013 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:04:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B887F24E; Thu, 21 Nov 2013 19:04:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7D802D77; Thu, 21 Nov 2013 19:04:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJ4xgs016291; Thu, 21 Nov 2013 19:04:59 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJ4xYn016290; Thu, 21 Nov 2013 19:04:59 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201311211904.rALJ4xYn016290@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 21 Nov 2013 19:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258433 - head/release/doc/en_US.ISO8859-1/hardware 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:04:59 -0000 Author: rodrigc Date: Thu Nov 21 19:04:59 2013 New Revision: 258433 URL: http://svnweb.freebsd.org/changeset/base/258433 Log: Update text related to Intel CPU support and Apple hardware support. Submitted by: skreuzer Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Nov 21 19:00:21 2013 (r258432) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Nov 21 19:04:59 2013 (r258433) @@ -178,9 +178,7 @@ the &a.smp; may yield some clues. &os; will take advantage of HyperThreading (HTT) support - on &intel; CPUs that support this feature. A kernel with the - options SMP feature enabled will - automatically detect the additional logical processors. The + on &intel; CPUs that support this feature. The default &os; scheduler treats the logical processors the same as additional physical processors; in other words, no attempt is made to optimize scheduling decisions given the shared @@ -303,63 +301,12 @@ powerpc - This section describes the systems currently known to be - supported by &os; on the PowerPC platform. This list is not - exhaustive. - - In general, all New World architecture Apple hardware - is supported, as well a limited selection of non-Apple - machines. - - All systems listed below are fully supported, with the - exception that software fan control is currently missing on - some Power Macintosh G5 models. SMP is supported on all systems - with more than 1 processor. + All Apple PowerPC machines with built-in USB are supported, + as well a limited selection of non-Apple machines, + including KVM on POWER7 - - - Apple iMac G3 - - - Apple iMac G4 - - - Apple iMac G5 - - - Apple Power Macintosh G3 (Blue & White) - - - Apple Power Macintosh G4 - - - Apple Power Macintosh G5 - - - Apple iBook G3 - - - Apple iBook G4 - - - Apple PowerBook G3 (Lombard and Pismo) - - - Apple PowerBook G4 - - - Apple XServe G4 - - - Apple XServe G5 - - - Apple Mac Mini - - - Embedded boards based on MPC85XX - - + SMP is supported on all systems with more than + 1 processor. @@ -367,10 +314,7 @@ This section describes the systems currently known to be supported by &os; on the Fujitsu &sparc64; and Sun &ultrasparc; - platforms. For - background information on the various hardware designs see the - Sun System - Handbook. + platforms. SMP is supported on all systems with more than 1 processor. From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:16: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51C967FC; Thu, 21 Nov 2013 19:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 406F52E3B; Thu, 21 Nov 2013 19:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJGrEw020629; Thu, 21 Nov 2013 19:16:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJGqnp020626; Thu, 21 Nov 2013 19:16:52 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311211916.rALJGqnp020626@svn.freebsd.org> From: Brooks Davis Date: Thu, 21 Nov 2013 19:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258434 - vendor/NetBSD/mtree/dist 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:16:53 -0000 Author: brooks Date: Thu Nov 21 19:16:52 2013 New Revision: 258434 URL: http://svnweb.freebsd.org/changeset/base/258434 Log: Vendor import of NetBSD's mtree at 2013-11-21 Modified: vendor/NetBSD/mtree/dist/compare.c vendor/NetBSD/mtree/dist/create.c vendor/NetBSD/mtree/dist/spec.c Modified: vendor/NetBSD/mtree/dist/compare.c ============================================================================== --- vendor/NetBSD/mtree/dist/compare.c Thu Nov 21 19:04:59 2013 (r258433) +++ vendor/NetBSD/mtree/dist/compare.c Thu Nov 21 19:16:52 2013 (r258434) @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $ */ +/* $NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $"); #endif #endif /* not lint */ @@ -48,6 +48,7 @@ __RCSID("$NetBSD: compare.c,v 1.56 2013/ #include #include #include +#include #include #include #include @@ -71,13 +72,18 @@ __RCSID("$NetBSD: compare.c,v 1.56 2013/ #define INDENTNAMELEN 8 #define MARK \ do { \ - len = printf("%s: ", RP(p)); \ - if (len > INDENTNAMELEN) { \ + if (flavor == F_FREEBSD9) { \ + len = printf("%s changed\n", RP(p)); \ tab = "\t"; \ - printf("\n"); \ } else { \ - tab = ""; \ - printf("%*s", INDENTNAMELEN - (int)len, ""); \ + len = printf("%s: ", RP(p)); \ + if (len > INDENTNAMELEN) { \ + tab = "\t"; \ + printf("\n"); \ + } else { \ + tab = ""; \ + printf("%*s", INDENTNAMELEN - (int)len, ""); \ + } \ } \ } while (0) #define LABEL if (!label++) MARK @@ -170,7 +176,8 @@ compare(NODE *s, FTSENT *p) break; #endif typeerr: LABEL; - printf("\ttype (%s, %s)\n", + printf(flavor == F_FREEBSD9 ? + "\ttype expected %s found %s\n" : "\ttype (%s, %s)\n", nodetype(s->type), inotype(p->fts_statp->st_mode)); return (label); } @@ -192,7 +199,9 @@ typeerr: LABEL; (s->type == F_BLOCK || s->type == F_CHAR) && s->st_rdev != p->fts_statp->st_rdev) { LABEL; - printf("%sdevice (%#jx, %#jx", + printf(flavor == F_FREEBSD9 ? + "%sdevice expected %#jx found %#jx" : + "%sdevice (%#jx, %#jx", tab, (uintmax_t)s->st_rdev, (uintmax_t)p->fts_statp->st_rdev); if (uflag) { @@ -202,10 +211,12 @@ typeerr: LABEL; s->st_rdev) == -1) || (lchown(p->fts_accpath, p->fts_statp->st_uid, p->fts_statp->st_gid) == -1) ) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; @@ -213,28 +224,34 @@ typeerr: LABEL; /* Set the uid/gid first, then set the mode. */ if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { LABEL; - printf("%suser (%lu, %lu", + printf(flavor == F_FREEBSD9 ? + "%suser expected %lu found %lu" : "%suser (%lu, %lu", tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); if (uflag) { if (lchown(p->fts_accpath, s->st_uid, -1)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; } if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { LABEL; - printf("%sgid (%lu, %lu", + printf(flavor == F_FREEBSD9 ? + "%sgid expected %lu found %lu" : "%sgid (%lu, %lu", tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); if (uflag) { if (lchown(p->fts_accpath, -1, s->st_gid)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); @@ -259,15 +276,19 @@ typeerr: LABEL; } LABEL; - printf("%spermissions (%#lo, %#lo", + printf(flavor == F_FREEBSD9 ? + "%spermissions expcted %#lo found %#lo" : + "%spermissions (%#lo, %#lo", tab, (u_long)s->st_mode, (u_long)p->fts_statp->st_mode & MBITS); if (uflag) { if (lchmod(p->fts_accpath, s->st_mode)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); @@ -277,13 +298,16 @@ typeerr: LABEL; if (s->flags & F_NLINK && s->type != F_DIR && s->st_nlink != p->fts_statp->st_nlink) { LABEL; - printf("%slink count (%lu, %lu)\n", + printf(flavor == F_FREEBSD9 ? + "%slink count expected %lu found %lu\n" : + "%slink count (%lu, %lu)\n", tab, (u_long)s->st_nlink, (u_long)p->fts_statp->st_nlink); tab = "\t"; } if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size) { LABEL; - printf("%ssize (%ju, %ju)\n", + printf(flavor == F_FREEBSD9 ? + "%ssize expected %ju found %ju\n" : "%ssize (%ju, %ju)\n", tab, (uintmax_t)s->st_size, (uintmax_t)p->fts_statp->st_size); tab = "\t"; @@ -318,18 +342,22 @@ typeerr: LABEL; if (tv[0].tv_sec != tv[1].tv_sec || tv[0].tv_usec != tv[1].tv_usec) { LABEL; - printf("%smodification time (%.24s, ", + printf(flavor == F_FREEBSD9 ? + "%smodification time expected %.24s found " : + "%smodification time (%.24s, ", tab, ctime(&smtime)); printf("%.24s", ctime(&pmtime)); if (tflag) { tv[1] = tv[0]; if (utimes(p->fts_accpath, tv)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); tab = "\t"; } } @@ -346,7 +374,9 @@ typeerr: LABEL; char *f_s; LABEL; f_s = flags_to_string(s->st_flags, "none"); - printf("%sflags (\"%s\" is not ", tab, f_s); + printf(flavor == F_FREEBSD9 ? + "%sflags expected \"%s\" found " : + "%sflags (\"%s\" is not ", tab, f_s); free(f_s); f_s = flags_to_string(p->fts_statp->st_flags, "none"); printf("\"%s\"", f_s); @@ -360,7 +390,7 @@ typeerr: LABEL; else SETFLAGS(0, (~SP_FLGS & CH_MASK)); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); tab = "\t"; } #endif /* HAVE_STRUCT_STAT_ST_FLAGS */ @@ -386,7 +416,9 @@ typeerr: LABEL; close(fd); if (s->cksum != val) { LABEL; - printf("%scksum (%lu, %lu)\n", + printf(flavor == F_FREEBSD9 ? + "%scksum expected %lu found %lu\n" : + "%scksum (%lu, %lu)\n", tab, s->cksum, (unsigned long)val); } tab = "\t"; @@ -402,7 +434,9 @@ typeerr: LABEL; } else { if (strcmp(s->md5digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, MD5KEY, s->md5digest, digestbuf); } tab = "\t"; @@ -420,7 +454,9 @@ typeerr: LABEL; } else { if (strcmp(s->rmd160digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, RMD160KEY, s->rmd160digest, digestbuf); } tab = "\t"; @@ -438,7 +474,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha1digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA1KEY, s->sha1digest, digestbuf); } tab = "\t"; @@ -456,7 +494,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha256digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA256KEY, s->sha256digest, digestbuf); } tab = "\t"; @@ -473,7 +513,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha384digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA384KEY, s->sha384digest, digestbuf); } tab = "\t"; @@ -490,7 +532,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha512digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA512KEY, s->sha512digest, digestbuf); } tab = "\t"; @@ -501,16 +545,20 @@ typeerr: LABEL; if (s->flags & F_SLINK && strcmp(cp = rlink(p->fts_accpath), s->slink)) { LABEL; - printf("%slink ref (%s, %s", tab, cp, s->slink); + printf(flavor == F_FREEBSD9 ? + "%slink ref expected %s found %s" : + "%slink ref (%s, %s", tab, cp, s->slink); if (uflag) { if ((unlink(p->fts_accpath) == -1) || (symlink(s->slink, p->fts_accpath) == -1) ) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); } return (label); } Modified: vendor/NetBSD/mtree/dist/create.c ============================================================================== --- vendor/NetBSD/mtree/dist/create.c Thu Nov 21 19:04:59 2013 (r258433) +++ vendor/NetBSD/mtree/dist/create.c Thu Nov 21 19:16:52 2013 (r258434) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $ */ +/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); #endif #endif /* not lint */ @@ -55,6 +55,7 @@ __RCSID("$NetBSD: create.c,v 1.71 2013/1 #include #include #include +#include #include #include #include Modified: vendor/NetBSD/mtree/dist/spec.c ============================================================================== --- vendor/NetBSD/mtree/dist/spec.c Thu Nov 21 19:04:59 2013 (r258433) +++ vendor/NetBSD/mtree/dist/spec.c Thu Nov 21 19:16:52 2013 (r258434) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $ */ +/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); #endif #endif /* not lint */ @@ -81,6 +81,7 @@ __RCSID("$NetBSD: spec.c,v 1.87 2013/10/ #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:17:40 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BE78941; Thu, 21 Nov 2013 19:17:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31EBE2E47; Thu, 21 Nov 2013 19:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJHe8E020760; Thu, 21 Nov 2013 19:17:40 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJHelb020759; Thu, 21 Nov 2013 19:17:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311211917.rALJHelb020759@svn.freebsd.org> From: Brooks Davis Date: Thu, 21 Nov 2013 19:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258435 - vendor/NetBSD/mtree/20131121 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:17:40 -0000 Author: brooks Date: Thu Nov 21 19:17:39 2013 New Revision: 258435 URL: http://svnweb.freebsd.org/changeset/base/258435 Log: Tag 2013-11-21 import of NetBSD's mtree Added: vendor/NetBSD/mtree/20131121/ - copied from r258434, vendor/NetBSD/mtree/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:20:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA094A91; Thu, 21 Nov 2013 19:20:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9D402E5D; Thu, 21 Nov 2013 19:20:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJK89u022763; Thu, 21 Nov 2013 19:20:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJK81w022762; Thu, 21 Nov 2013 19:20:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311211920.rALJK81w022762@svn.freebsd.org> From: Ed Maste Date: Thu, 21 Nov 2013 19:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258436 - head/sys/amd64/amd64 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:20:08 -0000 Author: emaste Date: Thu Nov 21 19:20:08 2013 New Revision: 258436 URL: http://svnweb.freebsd.org/changeset/base/258436 Log: Refactor amd64 startup SMAP parsing Extracted from the projects/uefi branch, this change is a reasonable cleanup and will reduce the diffs to review when bringing in the UEFI work. Reviewed by: kib@ Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Nov 21 19:17:39 2013 (r258435) +++ head/sys/amd64/amd64/machdep.c Thu Nov 21 19:20:08 2013 (r258436) @@ -1328,20 +1328,14 @@ isa_irq_pending(void) u_int basemem; static int -add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, + int *physmap_idxp) { int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016lx len=%016lx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - return (1); - - if (smap->length == 0) + if (length == 0) return (0); /* @@ -1350,8 +1344,8 @@ add_smap_entry(struct bios_smap *smap, v */ insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (smap->base + smap->length <= physmap[i]) { + if (base < physmap[i + 1]) { + if (base + length <= physmap[i]) { insert_idx = i; break; } @@ -1363,15 +1357,14 @@ add_smap_entry(struct bios_smap *smap, v } /* See if we can prepend to the next entry. */ - if (insert_idx <= physmap_idx && - smap->base + smap->length == physmap[insert_idx]) { - physmap[insert_idx] = smap->base; + if (insert_idx <= physmap_idx && base + length == physmap[insert_idx]) { + physmap[insert_idx] = base; return (1); } /* See if we can append to the previous entry. */ - if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { - physmap[insert_idx - 1] += smap->length; + if (insert_idx > 0 && base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += length; return (1); } @@ -1393,11 +1386,42 @@ add_smap_entry(struct bios_smap *smap, v } /* Insert the new entry. */ - physmap[insert_idx] = smap->base; - physmap[insert_idx + 1] = smap->base + smap->length; + physmap[insert_idx] = base; + physmap[insert_idx + 1] = base + length; return (1); } +static void +add_smap_entries(struct bios_smap *smapbase, vm_paddr_t *physmap, + int *physmap_idx) +{ + struct bios_smap *smap, *smapend; + u_int32_t smapsize; + + /* + * Memory map from INT 15:E820. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes smap. + */ + smapsize = *((u_int32_t *)smapbase - 1); + smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); + + for (smap = smapbase; smap < smapend; smap++) { + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016lx len=%016lx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + continue; + + if (!add_physmap_entry(smap->base, smap->length, physmap, + physmap_idx)) + break; + } +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1415,32 +1439,19 @@ getmemsize(caddr_t kmdp, u_int64_t first vm_paddr_t pa, physmap[PHYSMAP_SIZE]; u_long physmem_start, physmem_tunable, memtest; pt_entry_t *pte; - struct bios_smap *smapbase, *smap, *smapend; - u_int32_t smapsize; + struct bios_smap *smapbase; quad_t dcons_addr, dcons_size; bzero(physmap, sizeof(physmap)); basemem = 0; physmap_idx = 0; - /* - * get memory map from INT 15:E820, kindly supplied by the loader. - * - * subr_module.c says: - * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. - */ smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) panic("No BIOS smap info from loader!"); - smapsize = *((u_int32_t *)smapbase - 1); - smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); - - for (smap = smapbase; smap < smapend; smap++) - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; + add_smap_entries(smapbase, physmap, &physmap_idx); /* * Find the 'base memory' segment for SMP From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:29:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84793E38; Thu, 21 Nov 2013 19:29:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 737BF2EFD; Thu, 21 Nov 2013 19:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJTgxh024295; Thu, 21 Nov 2013 19:29:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJTffG024292; Thu, 21 Nov 2013 19:29:41 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311211929.rALJTffG024292@svn.freebsd.org> From: Brooks Davis Date: Thu, 21 Nov 2013 19:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258437 - head/contrib/mtree 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:29:42 -0000 Author: brooks Date: Thu Nov 21 19:29:41 2013 New Revision: 258437 URL: http://svnweb.freebsd.org/changeset/base/258437 Log: Sync with NetBSD. The funtional change is to make the output when comparing a directory to an mtree file more compatible with fmtree when FreeBSD 9 compatiblity mode is on. This output is clearly intended for humans not computers, but some tools such as mergemaster's -U option rely on it. MFC after: 3 days Modified: head/contrib/mtree/compare.c head/contrib/mtree/create.c head/contrib/mtree/spec.c Directory Properties: head/contrib/mtree/ (props changed) Modified: head/contrib/mtree/compare.c ============================================================================== --- head/contrib/mtree/compare.c Thu Nov 21 19:20:08 2013 (r258436) +++ head/contrib/mtree/compare.c Thu Nov 21 19:29:41 2013 (r258437) @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $ */ +/* $NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.58 2013/11/21 18:39:50 christos Exp $"); #endif #endif /* not lint */ @@ -47,8 +47,8 @@ __RCSID("$NetBSD: compare.c,v 1.56 2013/ #include #include -#include #include +#include #include #include #include @@ -72,13 +72,18 @@ __RCSID("$NetBSD: compare.c,v 1.56 2013/ #define INDENTNAMELEN 8 #define MARK \ do { \ - len = printf("%s: ", RP(p)); \ - if (len > INDENTNAMELEN) { \ + if (flavor == F_FREEBSD9) { \ + len = printf("%s changed\n", RP(p)); \ tab = "\t"; \ - printf("\n"); \ } else { \ - tab = ""; \ - printf("%*s", INDENTNAMELEN - (int)len, ""); \ + len = printf("%s: ", RP(p)); \ + if (len > INDENTNAMELEN) { \ + tab = "\t"; \ + printf("\n"); \ + } else { \ + tab = ""; \ + printf("%*s", INDENTNAMELEN - (int)len, ""); \ + } \ } \ } while (0) #define LABEL if (!label++) MARK @@ -171,7 +176,8 @@ compare(NODE *s, FTSENT *p) break; #endif typeerr: LABEL; - printf("\ttype (%s, %s)\n", + printf(flavor == F_FREEBSD9 ? + "\ttype expected %s found %s\n" : "\ttype (%s, %s)\n", nodetype(s->type), inotype(p->fts_statp->st_mode)); return (label); } @@ -193,7 +199,9 @@ typeerr: LABEL; (s->type == F_BLOCK || s->type == F_CHAR) && s->st_rdev != p->fts_statp->st_rdev) { LABEL; - printf("%sdevice (%#jx, %#jx", + printf(flavor == F_FREEBSD9 ? + "%sdevice expected %#jx found %#jx" : + "%sdevice (%#jx, %#jx", tab, (uintmax_t)s->st_rdev, (uintmax_t)p->fts_statp->st_rdev); if (uflag) { @@ -203,10 +211,12 @@ typeerr: LABEL; s->st_rdev) == -1) || (lchown(p->fts_accpath, p->fts_statp->st_uid, p->fts_statp->st_gid) == -1) ) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; @@ -214,28 +224,34 @@ typeerr: LABEL; /* Set the uid/gid first, then set the mode. */ if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) { LABEL; - printf("%suser (%lu, %lu", + printf(flavor == F_FREEBSD9 ? + "%suser expected %lu found %lu" : "%suser (%lu, %lu", tab, (u_long)s->st_uid, (u_long)p->fts_statp->st_uid); if (uflag) { if (lchown(p->fts_accpath, s->st_uid, -1)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); tab = "\t"; } if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) { LABEL; - printf("%sgid (%lu, %lu", + printf(flavor == F_FREEBSD9 ? + "%sgid expected %lu found %lu" : "%sgid (%lu, %lu", tab, (u_long)s->st_gid, (u_long)p->fts_statp->st_gid); if (uflag) { if (lchown(p->fts_accpath, -1, s->st_gid)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); @@ -260,15 +276,19 @@ typeerr: LABEL; } LABEL; - printf("%spermissions (%#lo, %#lo", + printf(flavor == F_FREEBSD9 ? + "%spermissions expcted %#lo found %#lo" : + "%spermissions (%#lo, %#lo", tab, (u_long)s->st_mode, (u_long)p->fts_statp->st_mode & MBITS); if (uflag) { if (lchmod(p->fts_accpath, s->st_mode)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else printf(")\n"); @@ -278,13 +298,16 @@ typeerr: LABEL; if (s->flags & F_NLINK && s->type != F_DIR && s->st_nlink != p->fts_statp->st_nlink) { LABEL; - printf("%slink count (%lu, %lu)\n", + printf(flavor == F_FREEBSD9 ? + "%slink count expected %lu found %lu\n" : + "%slink count (%lu, %lu)\n", tab, (u_long)s->st_nlink, (u_long)p->fts_statp->st_nlink); tab = "\t"; } if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size) { LABEL; - printf("%ssize (%ju, %ju)\n", + printf(flavor == F_FREEBSD9 ? + "%ssize expected %ju found %ju\n" : "%ssize (%ju, %ju)\n", tab, (uintmax_t)s->st_size, (uintmax_t)p->fts_statp->st_size); tab = "\t"; @@ -319,18 +342,22 @@ typeerr: LABEL; if (tv[0].tv_sec != tv[1].tv_sec || tv[0].tv_usec != tv[1].tv_usec) { LABEL; - printf("%smodification time (%.24s, ", + printf(flavor == F_FREEBSD9 ? + "%smodification time expected %.24s found " : + "%smodification time (%.24s, ", tab, ctime(&smtime)); printf("%.24s", ctime(&pmtime)); if (tflag) { tv[1] = tv[0]; if (utimes(p->fts_accpath, tv)) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); tab = "\t"; } } @@ -347,7 +374,9 @@ typeerr: LABEL; char *f_s; LABEL; f_s = flags_to_string(s->st_flags, "none"); - printf("%sflags (\"%s\" is not ", tab, f_s); + printf(flavor == F_FREEBSD9 ? + "%sflags expected \"%s\" found " : + "%sflags (\"%s\" is not ", tab, f_s); free(f_s); f_s = flags_to_string(p->fts_statp->st_flags, "none"); printf("\"%s\"", f_s); @@ -361,7 +390,7 @@ typeerr: LABEL; else SETFLAGS(0, (~SP_FLGS & CH_MASK)); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); tab = "\t"; } #endif /* HAVE_STRUCT_STAT_ST_FLAGS */ @@ -387,7 +416,9 @@ typeerr: LABEL; close(fd); if (s->cksum != val) { LABEL; - printf("%scksum (%lu, %lu)\n", + printf(flavor == F_FREEBSD9 ? + "%scksum expected %lu found %lu\n" : + "%scksum (%lu, %lu)\n", tab, s->cksum, (unsigned long)val); } tab = "\t"; @@ -403,7 +434,9 @@ typeerr: LABEL; } else { if (strcmp(s->md5digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, MD5KEY, s->md5digest, digestbuf); } tab = "\t"; @@ -421,7 +454,9 @@ typeerr: LABEL; } else { if (strcmp(s->rmd160digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, RMD160KEY, s->rmd160digest, digestbuf); } tab = "\t"; @@ -439,7 +474,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha1digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA1KEY, s->sha1digest, digestbuf); } tab = "\t"; @@ -457,7 +494,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha256digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA256KEY, s->sha256digest, digestbuf); } tab = "\t"; @@ -474,7 +513,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha384digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA384KEY, s->sha384digest, digestbuf); } tab = "\t"; @@ -491,7 +532,9 @@ typeerr: LABEL; } else { if (strcmp(s->sha512digest, digestbuf)) { LABEL; - printf("%s%s (0x%s, 0x%s)\n", + printf(flavor == F_FREEBSD9 ? + "%s%s expected %s found %s\n" : + "%s%s (0x%s, 0x%s)\n", tab, SHA512KEY, s->sha512digest, digestbuf); } tab = "\t"; @@ -502,16 +545,20 @@ typeerr: LABEL; if (s->flags & F_SLINK && strcmp(cp = rlink(p->fts_accpath), s->slink)) { LABEL; - printf("%slink ref (%s, %s", tab, cp, s->slink); + printf(flavor == F_FREEBSD9 ? + "%slink ref expected %s found %s" : + "%slink ref (%s, %s", tab, cp, s->slink); if (uflag) { if ((unlink(p->fts_accpath) == -1) || (symlink(s->slink, p->fts_accpath) == -1) ) - printf(", not modified: %s)\n", - strerror(errno)); + printf(", not modified: %s%s\n", + strerror(errno), + flavor == F_FREEBSD9 ? "" : ")"); else - printf(", modified)\n"); + printf(", modified%s\n", + flavor == F_FREEBSD9 ? "" : ")"); } else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); } return (label); } Modified: head/contrib/mtree/create.c ============================================================================== --- head/contrib/mtree/create.c Thu Nov 21 19:20:08 2013 (r258436) +++ head/contrib/mtree/create.c Thu Nov 21 19:29:41 2013 (r258437) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $ */ +/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); #endif #endif /* not lint */ @@ -53,9 +53,9 @@ __RCSID("$NetBSD: create.c,v 1.71 2013/1 #include #include #include -#include #include #include +#include #include #include #include Modified: head/contrib/mtree/spec.c ============================================================================== --- head/contrib/mtree/spec.c Thu Nov 21 19:20:08 2013 (r258436) +++ head/contrib/mtree/spec.c Thu Nov 21 19:29:41 2013 (r258437) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $ */ +/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); #endif #endif /* not lint */ @@ -80,8 +80,8 @@ __RCSID("$NetBSD: spec.c,v 1.87 2013/10/ #include #include #include -#include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:31: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFD88FB6; Thu, 21 Nov 2013 19:31:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFBC12F4C; Thu, 21 Nov 2013 19:31:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJVvQK026692; Thu, 21 Nov 2013 19:31:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJVv6b026691; Thu, 21 Nov 2013 19:31:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311211931.rALJVv6b026691@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Nov 2013 19:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258438 - head/usr.sbin/wpa/ndis_events 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:31:58 -0000 Author: pluknet Date: Thu Nov 21 19:31:57 2013 New Revision: 258438 URL: http://svnweb.freebsd.org/changeset/base/258438 Log: Fix reference to ioctl(2). Modified: head/usr.sbin/wpa/ndis_events/ndis_events.8 Modified: head/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu Nov 21 19:29:41 2013 (r258437) +++ head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu Nov 21 19:31:57 2013 (r258438) @@ -81,7 +81,7 @@ The version performs the same functions as the .Tn Windows\[rg] one, except that it uses an -.Xr ioctl 4 +.Xr ioctl 2 and routing socket interface instead of WMI. .Pp Note that a single instance of From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:43: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ADA65FA; Thu, 21 Nov 2013 19:43:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 009AF2FFF; Thu, 21 Nov 2013 19:43:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJhjBB030155; Thu, 21 Nov 2013 19:43:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJhjmS030153; Thu, 21 Nov 2013 19:43:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311211943.rALJhjmS030153@svn.freebsd.org> From: Devin Teske Date: Thu, 21 Nov 2013 19:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258439 - in head/usr.sbin/bsdconfig: dot includes 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:43:46 -0000 Author: dteske Date: Thu Nov 21 19:43:45 2013 New Revision: 258439 URL: http://svnweb.freebsd.org/changeset/base/258439 Log: f_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been documented as such; I just forgot). These utilities are command-line only and as such should stick to either using f_die without arguments or printf) Modified: head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/includes/includes Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Thu Nov 21 19:31:57 2013 (r258438) +++ head/usr.sbin/bsdconfig/dot/dot Thu Nov 21 19:43:45 2013 (r258439) @@ -163,7 +163,7 @@ while getopts cdhi flag; do done shift $(( $OPTIND - 1 )) -cd $BSDCFG_LIBE || f_die 1 "$msg_directory_not_found" "$BSDCFG_LIB" +cd $BSDCFG_LIBE || f_die # Pedantic # # Get a list of menu programs Modified: head/usr.sbin/bsdconfig/includes/includes ============================================================================== --- head/usr.sbin/bsdconfig/includes/includes Thu Nov 21 19:31:57 2013 (r258438) +++ head/usr.sbin/bsdconfig/includes/includes Thu Nov 21 19:43:45 2013 (r258439) @@ -137,7 +137,7 @@ done shift $(( $OPTIND - 1 )) # cd(1) to `share' dir so relative paths work for find and positional args -cd $BSDCFG_SHARE || f_die 1 "$msg_directory_not_found" "$BSDCFG_SHARE" +cd $BSDCFG_SHARE || f_die # Pedantic # # If given an argument, operate on it specifically (implied `-f') and exit @@ -147,9 +147,11 @@ for include in "$@"; do # See if they've just omitted the `*.subr' suffix [ -f "$include.subr" -a ! -f "$include" ] && include="$include.subr" if [ ! -f "$include" ]; then - f_die 1 "$msg_no_such_file_or_directory" "$0" "$include" + printf "$msg_no_such_file_or_directory" "$0" "$include" + exit $FAILURE elif [ ! -r "$include" ]; then - f_die 1 "$msg_permission_denied" "$0" "$include" + printf "$msg_permission_denied" "$0" "$include" + exit $FAILURE fi show_include "$include" || f_die done From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 19:44:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33E76748; Thu, 21 Nov 2013 19:44:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 242402036; Thu, 21 Nov 2013 19:44:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALJinSL030344; Thu, 21 Nov 2013 19:44:49 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALJinhc030343; Thu, 21 Nov 2013 19:44:49 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201311211944.rALJinhc030343@svn.freebsd.org> From: Joel Dahl Date: Thu, 21 Nov 2013 19:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258440 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 19:44:49 -0000 Author: joel (doc committer) Date: Thu Nov 21 19:44:48 2013 New Revision: 258440 URL: http://svnweb.freebsd.org/changeset/base/258440 Log: mdoc: remove EOL whitespace. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Nov 21 19:43:45 2013 (r258439) +++ head/share/man/man5/rc.conf.5 Thu Nov 21 19:44:48 2013 (r258440) @@ -919,13 +919,13 @@ This variable contains additional flags program. .It Va pflog_instances .Pq Vt str -If logging to more than one +If logging to more than one .Xr pflog 4 -interface is desired, +interface is desired, .Va pflog_instances is set to the list of .Xr pflogd 8 -instances that should be started at system boot time. If +instances that should be started at system boot time. If .Va pflog_instances is set, for each whitespace-seperated .Ar element @@ -966,7 +966,7 @@ program. .Pq Vt str Empty by default. If multiple instances of .Xr ftp-proxy 8 -are desired at boot time, +are desired at boot time, .Va ftpproxy_instances should contain a whitespace-seperated list of instance names. For each .Ar element From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 20:07:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 414B818B; Thu, 21 Nov 2013 20:07:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 310B02195; Thu, 21 Nov 2013 20:07:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALK7xJF037843; Thu, 21 Nov 2013 20:07:59 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALK7xoM037842; Thu, 21 Nov 2013 20:07:59 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201311212007.rALK7xoM037842@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 21 Nov 2013 20:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258441 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 20:07:59 -0000 Author: np Date: Thu Nov 21 20:07:58 2013 New Revision: 258441 URL: http://svnweb.freebsd.org/changeset/base/258441 Log: cxgbe(4): update the internal list of device features. 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 Thu Nov 21 19:44:48 2013 (r258440) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 21 20:07:58 2013 (r258441) @@ -4167,13 +4167,15 @@ t4_sysctls(struct adapter *sc) struct sysctl_oid_list *children, *c0; static char *caps[] = { "\20\1PPP\2QFC\3DCBX", /* caps[0] linkcaps */ - "\20\1NIC\2VM\3IDS\4UM\5UM_ISGL", /* caps[1] niccaps */ + "\20\1NIC\2VM\3IDS\4UM\5UM_ISGL" /* caps[1] niccaps */ + "\6HASHFILTER\7ETHOFLD", "\20\1TOE", /* caps[2] toecaps */ "\20\1RDDP\2RDMAC", /* caps[3] rdmacaps */ "\20\1INITIATOR_PDU\2TARGET_PDU" /* caps[4] iscsicaps */ "\3INITIATOR_CNXOFLD\4TARGET_CNXOFLD" "\5INITIATOR_SSNOFLD\6TARGET_SSNOFLD", "\20\1INITIATOR\2TARGET\3CTRL_OFLD" /* caps[5] fcoecaps */ + "\4PO_INITIAOR\5PO_TARGET" }; static char *doorbells = {"\20\1UDB\2WCWR\3UDBWC\4KDB"}; From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 20:09:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E47B2318; Thu, 21 Nov 2013 20:09:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1C4E21B0; Thu, 21 Nov 2013 20:09:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALK9ir6038134; Thu, 21 Nov 2013 20:09:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALK9iMu038131; Thu, 21 Nov 2013 20:09:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201311212009.rALK9iMu038131@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Nov 2013 20:09:44 +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: r258442 - in stable/9/usr.bin: kdump truss 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 20:09:45 -0000 Author: jhb Date: Thu Nov 21 20:09:44 2013 New Revision: 258442 URL: http://svnweb.freebsd.org/changeset/base/258442 Log: MFC 226145,226147,226148,226150,226151,226153,226157,226158,226164,226246, 226262,226329,226344,226608: Merge most "infrastructure" changes to kdump to make other MFC's to add new decodings, etc. easier: - Some of the #defines or enums for which we auto-generate naming functions may be wider than int, so use intmax_t throughout. - Auto-generate kdump_subr.h. - Use a switch statement instead of a giant if-else. - Remove a lot of (void) casts. - Bring ioctlname() in line with all the other *name() functions, which actually print the name (or the numeric value, if they can't figure out the correct name) instead of just returning a pointer to it. Also, since ioctl numbers are not and probably never will be unique, drop support for using a switch statement instead of an if/else chain. - Mostly WARNS=6 clean. - Update mkioctls to still work with both kdump and truss. Deleted: stable/9/usr.bin/kdump/kdump_subr.h Modified: stable/9/usr.bin/kdump/Makefile stable/9/usr.bin/kdump/kdump.c stable/9/usr.bin/kdump/mkioctls stable/9/usr.bin/kdump/mksubr stable/9/usr.bin/truss/Makefile stable/9/usr.bin/truss/extern.h Directory Properties: stable/9/usr.bin/kdump/ (props changed) stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/kdump/Makefile ============================================================================== --- stable/9/usr.bin/kdump/Makefile Thu Nov 21 20:07:58 2013 (r258441) +++ stable/9/usr.bin/kdump/Makefile Thu Nov 21 20:09:44 2013 (r258442) @@ -8,23 +8,28 @@ SFX= 32 .PATH: ${.CURDIR}/../ktrace PROG= kdump -SRCS= kdump.c ioctl.c kdump_subr.c subr.c -CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. +SRCS= kdump_subr.c kdump.c ioctl.c subr.c +DPSRCS= kdump_subr.h +CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif -WARNS?= 0 +NO_WERROR?= YES -CLEANFILES= ioctl.c kdump_subr.c linux_syscalls.c +CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c ioctl.c: mkioctls - env CPP="${CPP}" \ - sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + env MACHINE=${MACHINE} CPP="${CPP}" \ + sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET} -kdump_subr.c: mksubr - sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET} +kdump_subr.h: mksubr + sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \ + sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET} + +kdump_subr.c: mksubr kdump_subr.h + sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET} linux_syscalls.c: /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Thu Nov 21 20:07:58 2013 (r258441) +++ stable/9/usr.bin/kdump/kdump.c Thu Nov 21 20:09:44 2013 (r258442) @@ -96,6 +96,8 @@ void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktrcsw_old(struct ktr_csw_old *); +void ktruser_malloc(unsigned char *); +void ktruser_rtld(int, unsigned char *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); @@ -103,8 +105,7 @@ void ktrstruct(char *, size_t); void ktrfault(struct ktr_fault *); void ktrfaultend(struct ktr_faultend *); void usage(void); -void sockfamilyname(int); -const char *ioctlname(u_long); +void ioctlname(unsigned long, int); int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0; @@ -114,15 +115,15 @@ struct ktr_header ktr_header; #define TIME_FORMAT "%b %e %T %Y" #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) -#define print_number(i,n,c) do { \ - if (decimal) \ - printf("%c%ld", c, (long)*i); \ - else \ - printf("%c%#lx", c, (long)*i); \ - i++; \ - n--; \ - c = ','; \ - } while (0); +#define print_number(i,n,c) do { \ + if (decimal) \ + printf("%c%jd", c, (intmax_t)*i); \ + else \ + printf("%c%#jx", c, (uintmax_t)(u_register_t)*i); \ + i++; \ + n--; \ + c = ','; \ +} while (0) #if defined(__amd64__) || defined(__i386__) @@ -168,10 +169,10 @@ main(int argc, char *argv[]) pid_t pid = 0; u_int sv_flags; - (void) setlocale(LC_CTYPE, ""); + setlocale(LC_CTYPE, ""); while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) - switch((char)ch) { + switch (ch) { case 'A': abiflag = 1; break; @@ -223,7 +224,7 @@ main(int argc, char *argv[]) if (argc > optind) usage(); - m = (void *)malloc(size = 1025); + m = malloc(size = 1025); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); if (!freopen(tracefile, "r", stdin)) @@ -234,7 +235,7 @@ main(int argc, char *argv[]) if (ktr_header.ktr_type & KTR_DROP) { ktr_header.ktr_type &= ~KTR_DROP; if (!drop_logged && threads) { - (void)printf( + printf( "%6jd %6jd %-8.*s Events dropped.\n", (intmax_t)ktr_header.ktr_pid, ktr_header.ktr_tid > 0 ? @@ -242,7 +243,7 @@ main(int argc, char *argv[]) MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } else if (!drop_logged) { - (void)printf("%6jd %-8.*s Events dropped.\n", + printf("%6jd %-8.*s Events dropped.\n", (intmax_t)ktr_header.ktr_pid, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; @@ -255,7 +256,7 @@ main(int argc, char *argv[]) if ((ktrlen = ktr_header.ktr_len) < 0) errx(1, "bogus length 0x%x", ktrlen); if (ktrlen > size) { - m = (void *)realloc(m, ktrlen+1); + m = realloc(m, ktrlen+1); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); size = ktrlen; @@ -321,7 +322,7 @@ main(int argc, char *argv[]) break; } if (tail) - (void)fflush(stdout); + fflush(stdout); } return 0; } @@ -332,7 +333,7 @@ fread_tail(void *buf, int size, int num) int i; while ((i = fread(buf, size, num, stdin)) == 0 && tail) { - (void)sleep(1); + sleep(1); clearerr(stdin); } return (i); @@ -462,7 +463,7 @@ dumpheader(struct ktr_header *kth) type = "PRET"; break; default: - (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); + sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; } @@ -475,11 +476,11 @@ dumpheader(struct ktr_header *kth) * negative tid's as 0. */ if (threads) - (void)printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, + printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0, MAXCOMLEN, kth->ktr_comm); else - (void)printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, + printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); if (timestamp) { if (timestamp == 3) { @@ -492,10 +493,10 @@ dumpheader(struct ktr_header *kth) timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; } - (void)printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, kth->ktr_time.tv_usec); } - (void)printf("%s ", type); + printf("%s ", type); } #include @@ -512,465 +513,509 @@ ktrsyscall(struct ktr_syscall *ktr, u_in if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)) - (void)printf("[%d]", ktr->ktr_code); + printf("[%d]", ktr->ktr_code); else - (void)printf("%s", syscallnames[ktr->ktr_code]); + printf("%s", syscallnames[ktr->ktr_code]); ip = &ktr->ktr_args[0]; if (narg) { char c = '('; if (fancy && (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { - if (ktr->ktr_code == SYS_ioctl) { - const char *cp; - print_number(ip,narg,c); - if ((cp = ioctlname(*ip)) != NULL) - (void)printf(",%s", cp); - else { - if (decimal) - (void)printf(",%ld", (long)*ip); - else - (void)printf(",%#lx ", (long)*ip); - } + switch (ktr->ktr_code) { + case SYS_ioctl: { + print_number(ip, narg, c); + putchar(c); + ioctlname(*ip, decimal); c = ','; ip++; narg--; - } else if (ktr->ktr_code == SYS_ptrace) { - (void)putchar('('); - ptraceopname ((int)*ip); + break; + } + case SYS_ptrace: + putchar('('); + ptraceopname(*ip); c = ','; ip++; narg--; - } else if (ktr->ktr_code == SYS_access || - ktr->ktr_code == SYS_eaccess) { - print_number(ip,narg,c); - (void)putchar(','); - accessmodename ((int)*ip); + break; + case SYS_access: + case SYS_eaccess: + print_number(ip, narg, c); + putchar(','); + accessmodename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_open) { - int flags; - int mode; - print_number(ip,narg,c); - flags = *ip; - mode = *++ip; - (void)putchar(','); - flagsandmodename (flags, mode, decimal); - ip++; - narg-=2; - } else if (ktr->ktr_code == SYS_wait4) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - wait4optname ((int)*ip); + break; + case SYS_open: + print_number(ip, narg, c); + putchar(','); + flagsandmodename(ip[0], ip[1], decimal); + ip += 2; + narg -= 2; + break; + case SYS_wait4: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + wait4optname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_chmod || - ktr->ktr_code == SYS_fchmod || - ktr->ktr_code == SYS_lchmod) { - print_number(ip,narg,c); - (void)putchar(','); - modename ((int)*ip); + break; + case SYS_chmod: + case SYS_fchmod: + case SYS_lchmod: + print_number(ip, narg, c); + putchar(','); + modename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mknod) { - print_number(ip,narg,c); - (void)putchar(','); - modename ((int)*ip); + break; + case SYS_mknod: + print_number(ip, narg, c); + putchar(','); + modename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_getfsstat) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - getfsstatflagsname ((int)*ip); + break; + case SYS_getfsstat: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + getfsstatflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mount) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - mountflagsname ((int)*ip); + break; + case SYS_mount: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + mountflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_unmount) { - print_number(ip,narg,c); - (void)putchar(','); - mountflagsname ((int)*ip); + break; + case SYS_unmount: + print_number(ip, narg, c); + putchar(','); + mountflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_recvmsg || - ktr->ktr_code == SYS_sendmsg) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - sendrecvflagsname ((int)*ip); + break; + case SYS_recvmsg: + case SYS_sendmsg: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + sendrecvflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_recvfrom || - ktr->ktr_code == SYS_sendto) { - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - sendrecvflagsname ((int)*ip); + break; + case SYS_recvfrom: + case SYS_sendto: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + sendrecvflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_chflags || - ktr->ktr_code == SYS_fchflags || - ktr->ktr_code == SYS_lchflags) { - print_number(ip,narg,c); - (void)putchar(','); - modename((int)*ip); + break; + case SYS_chflags: + case SYS_fchflags: + case SYS_lchflags: + print_number(ip, narg, c); + putchar(','); + modename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_kill) { - print_number(ip,narg,c); - (void)putchar(','); - signame((int)*ip); + break; + case SYS_kill: + print_number(ip, narg, c); + putchar(','); + signame(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_reboot) { - (void)putchar('('); - rebootoptname((int)*ip); + break; + case SYS_reboot: + putchar('('); + rebootoptname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_umask) { - (void)putchar('('); - modename((int)*ip); + break; + case SYS_umask: + putchar('('); + modename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_msync) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - msyncflagsname((int)*ip); + break; + case SYS_msync: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + msyncflagsname(*ip); ip++; narg--; + break; #ifdef SYS_freebsd6_mmap - } else if (ktr->ktr_code == SYS_freebsd6_mmap) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - mmapprotname ((int)*ip); - (void)putchar(','); + case SYS_freebsd6_mmap: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + mmapprotname(*ip); + putchar(','); ip++; narg--; - mmapflagsname ((int)*ip); + mmapflagsname(*ip); ip++; narg--; + break; #endif - } else if (ktr->ktr_code == SYS_mmap) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - mmapprotname ((int)*ip); - (void)putchar(','); + case SYS_mmap: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + mmapprotname(*ip); + putchar(','); ip++; narg--; - mmapflagsname ((int)*ip); + mmapflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mprotect) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - mmapprotname ((int)*ip); + break; + case SYS_mprotect: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + mmapprotname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_madvise) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - madvisebehavname((int)*ip); + break; + case SYS_madvise: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + madvisebehavname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_setpriority) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - prioname((int)*ip); + break; + case SYS_setpriority: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + prioname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_fcntl) { - int cmd; - int arg; - print_number(ip,narg,c); - cmd = *ip; - arg = *++ip; - (void)putchar(','); - fcntlcmdname(cmd, arg, decimal); - ip++; - narg-=2; - } else if (ktr->ktr_code == SYS_socket) { + break; + case SYS_fcntl: + print_number(ip, narg, c); + putchar(','); + fcntlcmdname(ip[0], ip[1], decimal); + ip += 2; + narg -= 2; + break; + case SYS_socket: { int sockdomain; - (void)putchar('('); - sockdomain=(int)*ip; + putchar('('); + sockdomain = *ip; sockdomainname(sockdomain); ip++; narg--; - (void)putchar(','); - socktypename((int)*ip); + putchar(','); + socktypename(*ip); ip++; narg--; if (sockdomain == PF_INET || sockdomain == PF_INET6) { - (void)putchar(','); - sockipprotoname((int)*ip); + putchar(','); + sockipprotoname(*ip); ip++; narg--; } c = ','; - } else if (ktr->ktr_code == SYS_setsockopt || - ktr->ktr_code == SYS_getsockopt) { - print_number(ip,narg,c); - (void)putchar(','); - sockoptlevelname((int)*ip, decimal); - if ((int)*ip == SOL_SOCKET) { + break; + } + case SYS_setsockopt: + case SYS_getsockopt: + print_number(ip, narg, c); + putchar(','); + sockoptlevelname(*ip, decimal); + if (*ip == SOL_SOCKET) { ip++; narg--; - (void)putchar(','); - sockoptname((int)*ip); + putchar(','); + sockoptname(*ip); } ip++; narg--; + break; #ifdef SYS_freebsd6_lseek - } else if (ktr->ktr_code == SYS_freebsd6_lseek) { - print_number(ip,narg,c); + case SYS_freebsd6_lseek: + print_number(ip, narg, c); /* Hidden 'pad' argument, not in lseek(2) */ - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - whencename ((int)*ip); + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + whencename(*ip); ip++; narg--; + break; #endif - } else if (ktr->ktr_code == SYS_lseek) { - print_number(ip,narg,c); + case SYS_lseek: + print_number(ip, narg, c); /* Hidden 'pad' argument, not in lseek(2) */ - print_number(ip,narg,c); - (void)putchar(','); - whencename ((int)*ip); + print_number(ip, narg, c); + putchar(','); + whencename(*ip); ip++; narg--; - - } else if (ktr->ktr_code == SYS_flock) { - print_number(ip,narg,c); - (void)putchar(','); - flockname((int)*ip); + break; + case SYS_flock: + print_number(ip, narg, c); + putchar(','); + flockname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mkfifo || - ktr->ktr_code == SYS_mkdir) { - print_number(ip,narg,c); - (void)putchar(','); - modename((int)*ip); + break; + case SYS_mkfifo: + case SYS_mkdir: + print_number(ip, narg, c); + putchar(','); + modename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_shutdown) { - print_number(ip,narg,c); - (void)putchar(','); - shutdownhowname((int)*ip); + break; + case SYS_shutdown: + print_number(ip, narg, c); + putchar(','); + shutdownhowname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_socketpair) { - (void)putchar('('); - sockdomainname((int)*ip); + break; + case SYS_socketpair: + putchar('('); + sockdomainname(*ip); ip++; narg--; - (void)putchar(','); - socktypename((int)*ip); + putchar(','); + socktypename(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_getrlimit || - ktr->ktr_code == SYS_setrlimit) { - (void)putchar('('); - rlimitname((int)*ip); + break; + case SYS_getrlimit: + case SYS_setrlimit: + putchar('('); + rlimitname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_quotactl) { - print_number(ip,narg,c); - (void)putchar(','); - quotactlname((int)*ip); + break; + case SYS_quotactl: + print_number(ip, narg, c); + putchar(','); + quotactlname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_nfssvc) { - (void)putchar('('); - nfssvcname((int)*ip); + break; + case SYS_nfssvc: + putchar('('); + nfssvcname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_rtprio) { - (void)putchar('('); - rtprioname((int)*ip); + break; + case SYS_rtprio: + putchar('('); + rtprioname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS___semctl) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - semctlname((int)*ip); + break; + case SYS___semctl: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + semctlname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_semget) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - semgetname((int)*ip); + break; + case SYS_semget: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + semgetname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_msgctl) { - print_number(ip,narg,c); - (void)putchar(','); - shmctlname((int)*ip); + break; + case SYS_msgctl: + print_number(ip, narg, c); + putchar(','); + shmctlname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_shmat) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - shmatname((int)*ip); + break; + case SYS_shmat: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + shmatname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_shmctl) { - print_number(ip,narg,c); - (void)putchar(','); - shmctlname((int)*ip); + break; + case SYS_shmctl: + print_number(ip, narg, c); + putchar(','); + shmctlname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_minherit) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - minheritname((int)*ip); + break; + case SYS_minherit: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + minheritname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_rfork) { - (void)putchar('('); - rforkname((int)*ip); + break; + case SYS_rfork: + putchar('('); + rforkname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_lio_listio) { - (void)putchar('('); - lio_listioname((int)*ip); + break; + case SYS_lio_listio: + putchar('('); + lio_listioname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_mlockall) { - (void)putchar('('); - mlockallname((int)*ip); + break; + case SYS_mlockall: + putchar('('); + mlockallname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_sched_setscheduler) { - print_number(ip,narg,c); - (void)putchar(','); - schedpolicyname((int)*ip); + break; + case SYS_sched_setscheduler: + print_number(ip, narg, c); + putchar(','); + schedpolicyname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_sched_get_priority_max || - ktr->ktr_code == SYS_sched_get_priority_min) { - (void)putchar('('); - schedpolicyname((int)*ip); - ip++; - narg--; - } else if (ktr->ktr_code == SYS_sendfile) { - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - sendfileflagsname((int)*ip); + break; + case SYS_sched_get_priority_max: + case SYS_sched_get_priority_min: + putchar('('); + schedpolicyname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_kldsym) { - print_number(ip,narg,c); - (void)putchar(','); - kldsymcmdname((int)*ip); + break; + case SYS_sendfile: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + sendfileflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_sigprocmask) { - (void)putchar('('); - sigprocmaskhowname((int)*ip); + break; + case SYS_kldsym: + print_number(ip, narg, c); + putchar(','); + kldsymcmdname(*ip); + ip++; + narg--; + break; + case SYS_sigprocmask: + putchar('('); + sigprocmaskhowname(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS___acl_get_file || - ktr->ktr_code == SYS___acl_set_file || - ktr->ktr_code == SYS___acl_get_fd || - ktr->ktr_code == SYS___acl_set_fd || - ktr->ktr_code == SYS___acl_delete_file || - ktr->ktr_code == SYS___acl_delete_fd || - ktr->ktr_code == SYS___acl_aclcheck_file || - ktr->ktr_code == SYS___acl_aclcheck_fd || - ktr->ktr_code == SYS___acl_get_link || - ktr->ktr_code == SYS___acl_set_link || - ktr->ktr_code == SYS___acl_delete_link || - ktr->ktr_code == SYS___acl_aclcheck_link) { - print_number(ip,narg,c); - (void)putchar(','); - acltypename((int)*ip); + break; + case SYS___acl_get_file: + case SYS___acl_set_file: + case SYS___acl_get_fd: + case SYS___acl_set_fd: + case SYS___acl_delete_file: + case SYS___acl_delete_fd: + case SYS___acl_aclcheck_file: + case SYS___acl_aclcheck_fd: + case SYS___acl_get_link: + case SYS___acl_set_link: + case SYS___acl_delete_link: + case SYS___acl_aclcheck_link: + print_number(ip, narg, c); + putchar(','); + acltypename(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_sigaction) { - (void)putchar('('); - signame((int)*ip); + break; + case SYS_sigaction: + putchar('('); + signame(*ip); ip++; narg--; c = ','; - } else if (ktr->ktr_code == SYS_extattrctl) { - print_number(ip,narg,c); - (void)putchar(','); - extattrctlname((int)*ip); + break; + case SYS_extattrctl: + print_number(ip, narg, c); + putchar(','); + extattrctlname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_nmount) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - mountflagsname ((int)*ip); + break; + case SYS_nmount: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + mountflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_thr_create) { - print_number(ip,narg,c); - print_number(ip,narg,c); - (void)putchar(','); - thrcreateflagsname ((int)*ip); + break; + case SYS_thr_create: + print_number(ip, narg, c); + print_number(ip, narg, c); + putchar(','); + thrcreateflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_thr_kill) { - print_number(ip,narg,c); - (void)putchar(','); - signame ((int)*ip); + break; + case SYS_thr_kill: + print_number(ip, narg, c); + putchar(','); + signame(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_kldunloadf) { - print_number(ip,narg,c); - (void)putchar(','); - kldunloadfflagsname ((int)*ip); + break; + case SYS_kldunloadf: + print_number(ip, narg, c); + putchar(','); + kldunloadfflagsname(*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_posix_fadvise) { - print_number(ip,narg,c); - print_number(ip,narg,c); - print_number(ip,narg,c); + break; + case SYS_posix_fadvise: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); (void)putchar(','); fadvisebehavname((int)*ip); ip++; narg--; + break; } } while (narg > 0) { - print_number(ip,narg,c); + print_number(ip, narg, c); } - (void)putchar(')'); + putchar(')'); } - (void)putchar('\n'); + putchar('\n'); } void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 20:27: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89427F14; Thu, 21 Nov 2013 20:27:26 +0000 (UTC) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E84912331; Thu, 21 Nov 2013 20:27:25 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id ne12so225806qeb.25 for ; Thu, 21 Nov 2013 12:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rVgtVdKNVGHJJXvnnjh8Lu0bJyME0SRoO5j6+SiROAM=; b=016dqiEySlUq3jx/zYzuzOGlS455QON0BUUqCdFrrBFCnxw3idNEP32VzDdii4mN2U YYFKuXV2HyInaqZTgMU4t6nQQf0zOUqhLkdOV4aFz2NQ+b9MIbt8Id3VPWUyBEZc5AcB 1jG4rHFmIW+c8x+q9fZUkDWRE3+KZ6+Bk9scn8FIcUIuag5fJQ2Axbp+hUjlWvVwP2br vJUUofbnqs1rUilvsXpcSuJpM2uFpM3CnbpQ++JLWWZlyvKJw2pizkb6mhJKx9SOHsLH Im6W4r7PzZXxlcKR/IHxRMdri3plEBKhskqPhZdoknuD1oJFBK7lyo7iQPMLEaP0walF wvUw== MIME-Version: 1.0 X-Received: by 10.224.12.10 with SMTP id v10mr14737114qav.98.1385065645153; Thu, 21 Nov 2013 12:27:25 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Thu, 21 Nov 2013 12:27:25 -0800 (PST) In-Reply-To: <528E1A83.7070509@gmail.com> References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <528E1A83.7070509@gmail.com> Date: Thu, 21 Nov 2013 12:27:25 -0800 X-Google-Sender-Auth: RV0JYfXTj1fTPfmfag55WipDIHw Message-ID: Subject: Re: svn commit: r258328 - head/sys/net From: Adrian Chadd To: Hooman Fazaeli Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 20:27:26 -0000 On 21 November 2013 06:36, Hooman Fazaeli wrote: > What are possible sideeffects? What are the benefits we achieve by a > distinct > queue structure and having both if_input and if_input_multi? Doing incremental development where you can minimise unintended side-effects during development? -adrian From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 20:39:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01EC960D; Thu, 21 Nov 2013 20:39:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E54D82424; Thu, 21 Nov 2013 20:39:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALKdrPL048604; Thu, 21 Nov 2013 20:39:53 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALKdrRO048603; Thu, 21 Nov 2013 20:39:53 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201311212039.rALKdrRO048603@svn.freebsd.org> From: Olivier Houchard Date: Thu, 21 Nov 2013 20:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258443 - 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 20:39:54 -0000 Author: cognet Date: Thu Nov 21 20:39:53 2013 New Revision: 258443 URL: http://svnweb.freebsd.org/changeset/base/258443 Log: Kill ARM_VFP_SUPPORT, it's been removed some time ago. Modified: head/sys/conf/options.arm Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Thu Nov 21 20:09:44 2013 (r258442) +++ head/sys/conf/options.arm Thu Nov 21 20:39:53 2013 (r258443) @@ -5,7 +5,6 @@ ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h ARM_USE_SMALL_ALLOC opt_global.h -ARM_VFP_SUPPORT opt_global.h ARM_WANT_TP_ADDRESS opt_global.h COUNTS_PER_SEC opt_timer.h CPU_ARM9 opt_global.h From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 20:43:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09F3082A; Thu, 21 Nov 2013 20:43:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EDAB32482; Thu, 21 Nov 2013 20:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALKhh5N051136; Thu, 21 Nov 2013 20:43:43 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALKhh4l051135; Thu, 21 Nov 2013 20:43:43 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311212043.rALKhh4l051135@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 21 Nov 2013 20:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258444 - head/lib/libpam/libpam 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 20:43:44 -0000 Author: pluknet Date: Thu Nov 21 20:43:43 2013 New Revision: 258444 URL: http://svnweb.freebsd.org/changeset/base/258444 Log: Catch up with OpenPAM Nummularia. This fixes libpam for build32 target to dlopen() pam libraries in /usr/lib32. Reviewed by: des (a while ago) MFC after: 1 week Modified: head/lib/libpam/libpam/Makefile Modified: head/lib/libpam/libpam/Makefile ============================================================================== --- head/lib/libpam/libpam/Makefile Thu Nov 21 20:39:53 2013 (r258443) +++ head/lib/libpam/libpam/Makefile Thu Nov 21 20:43:43 2013 (r258444) @@ -154,7 +154,7 @@ MLINKS= pam.conf.5 pam.d.5 CSTD?= c99 CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR} -CFLAGS+= -DOPENPAM_MODULES_DIR='"${PAM_MOD_DIR:C/\/*$//}/"' +CFLAGS+= -DOPENPAM_MODULES_DIRECTORY='"${PAM_MOD_DIR:C/\/*$//}/"' CFLAGS+= -DHAVE_DLFUNC=1 CFLAGS+= -DHAVE_FDLOPEN=1 CFLAGS+= -DHAVE_FPURGE=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 21:05:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 439B6453; Thu, 21 Nov 2013 21:05:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 335D72620; Thu, 21 Nov 2013 21:05:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALL5CIQ058466; Thu, 21 Nov 2013 21:05:12 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALL5B3m058462; Thu, 21 Nov 2013 21:05:11 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311212105.rALL5B3m058462@svn.freebsd.org> From: Andreas Tobler Date: Thu, 21 Nov 2013 21:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258445 - in head/gnu/usr.bin/cc: . cc_tools 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 21:05:12 -0000 Author: andreast Date: Thu Nov 21 21:05:11 2013 New Revision: 258445 URL: http://svnweb.freebsd.org/changeset/base/258445 Log: Fix cross compilation after r258428. Reviewed by: pfg Modified: head/gnu/usr.bin/cc/Makefile.inc head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Thu Nov 21 20:43:43 2013 (r258444) +++ head/gnu/usr.bin/cc/Makefile.inc Thu Nov 21 21:05:11 2013 (r258445) @@ -23,7 +23,7 @@ CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\ CSTD?= gnu89 .if ${TARGET_ARCH} != ${MACHINE_ARCH} -CFLAGS+= -DCROSS_COMPILE +CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE .endif .if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Nov 21 20:43:43 2013 (r258444) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Nov 21 21:05:11 2013 (r258445) @@ -18,7 +18,7 @@ #define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/c++/"GCCVER #define GPLUSPLUS_BACKWARD_INCLUDE_DIR PREFIX"/include/c++/"GCCVER"/backward" #define GCC_INCLUDE_DIR PREFIX"/include/gcc/"GCCVER -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #define CROSS_INCLUDE_DIR PREFIX"/include" #else #define STANDARD_INCLUDE_DIR PREFIX"/include" From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 21:19:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A9CACF; Thu, 21 Nov 2013 21:19:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 802FB26FE; Thu, 21 Nov 2013 21:19:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALLJ11t062690; Thu, 21 Nov 2013 21:19:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALLJ1W3062689; Thu, 21 Nov 2013 21:19:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201311212119.rALLJ1W3062689@svn.freebsd.org> From: Eitan Adler Date: Thu, 21 Nov 2013 21:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258446 - head/usr.bin/from 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 21:19:01 -0000 Author: eadler Date: Thu Nov 21 21:19:01 2013 New Revision: 258446 URL: http://svnweb.freebsd.org/changeset/base/258446 Log: Add static where appropriate. Sync with some of DragonflyBSD's latest cleanups Reviewed by: mjg Modified: head/usr.bin/from/from.c Modified: head/usr.bin/from/from.c ============================================================================== --- head/usr.bin/from/from.c Thu Nov 21 21:05:11 2013 (r258445) +++ head/usr.bin/from/from.c Thu Nov 21 21:19:01 2013 (r258446) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -int match(const char *, const char *); +static int match(const char *, const char *); static void usage(void); int @@ -81,8 +81,7 @@ main(int argc, char **argv) case 's': sender = optarg; for (p = sender; *p; ++p) - if (isupper(*p)) - *p = tolower(*p); + *p = tolower(*p); break; case '?': default: @@ -142,7 +141,7 @@ usage(void) exit(1); } -int +static int match(const char *line, const char *sender) { char ch, pch, first; @@ -152,15 +151,14 @@ match(const char *line, const char *send if (isspace(ch = *line)) return(0); ++line; - if (isupper(ch)) - ch = tolower(ch); + ch = tolower(ch); if (ch != first) continue; for (p = sender, t = line;;) { if (!(pch = *p++)) return(1); - if (isupper(ch = *t++)) - ch = tolower(ch); + ch = tolower(*t); + t++; if (ch != pch) break; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 21:26:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E982E69; Thu, 21 Nov 2013 21:26:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC4E279C; Thu, 21 Nov 2013 21:26:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALLQ1k3065585; Thu, 21 Nov 2013 21:26:01 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALLPxo5065558; Thu, 21 Nov 2013 21:25:59 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311212125.rALLPxo5065558@svn.freebsd.org> From: Andreas Tobler Date: Thu, 21 Nov 2013 21:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258447 - in head: lib/libc/amd64 lib/libc/amd64/gen lib/libc/amd64/sys sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 21:26:01 -0000 Author: andreast Date: Thu Nov 21 21:25:58 2013 New Revision: 258447 URL: http://svnweb.freebsd.org/changeset/base/258447 Log: Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the CONCAT macros in SYS.h. Reviewed by: bde, kib Modified: head/lib/libc/amd64/SYS.h head/lib/libc/amd64/gen/_setjmp.S head/lib/libc/amd64/gen/setjmp.S head/lib/libc/amd64/gen/sigsetjmp.S head/lib/libc/amd64/sys/getcontext.S head/lib/libc/amd64/sys/pipe.S head/lib/libc/amd64/sys/reboot.S head/lib/libc/amd64/sys/setlogin.S head/lib/libc/amd64/sys/vfork.S head/sys/amd64/include/asm.h Modified: head/lib/libc/amd64/SYS.h ============================================================================== --- head/lib/libc/amd64/SYS.h Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/SYS.h Thu Nov 21 21:25:58 2013 (r258447) @@ -36,20 +36,17 @@ #include #include -#define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; \ +#define RSYSCALL(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ jb HIDENAME(cerror); ret; \ - END(__CONCAT(__sys_,x)) + END(__sys_##name) -#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; \ +#define PSEUDO(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ jb HIDENAME(cerror); ret; \ - END(__CONCAT(__sys_,x)) + END(__sys_##name) -#define KERNCALL movq %rcx, %r10; syscall +#define KERNCALL movq %rcx, %r10; syscall Modified: head/lib/libc/amd64/gen/_setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/_setjmp.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/gen/_setjmp.S Thu Nov 21 21:25:58 2013 (r258447) @@ -63,8 +63,7 @@ ENTRY(_setjmp) ret END(_setjmp) - .weak CNAME(_longjmp) - .set CNAME(_longjmp),CNAME(___longjmp) + WEAK_REFERENCE(___longjmp, _longjmp) ENTRY(___longjmp) movq %rdi,%rdx /* Restore the mxcsr, but leave exception flags intact. */ Modified: head/lib/libc/amd64/gen/setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/setjmp.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/gen/setjmp.S Thu Nov 21 21:25:58 2013 (r258447) @@ -73,8 +73,7 @@ ENTRY(setjmp) ret END(setjmp) - .weak CNAME(longjmp) - .set CNAME(longjmp),CNAME(__longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) pushq %rdi pushq %rsi Modified: head/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/amd64/gen/sigsetjmp.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/gen/sigsetjmp.S Thu Nov 21 21:25:58 2013 (r258447) @@ -80,8 +80,7 @@ ENTRY(sigsetjmp) ret END(sigsetjmp) - .weak CNAME(siglongjmp) - .set CNAME(siglongjmp),CNAME(__siglongjmp) + WEAK_REFERENCE(__siglongjmp, siglongjmp) ENTRY(__siglongjmp) cmpl $0,88(%rdi) jz 2f Modified: head/lib/libc/amd64/sys/getcontext.S ============================================================================== --- head/lib/libc/amd64/sys/getcontext.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/sys/getcontext.S Thu Nov 21 21:25:58 2013 (r258447) @@ -34,10 +34,8 @@ __FBSDID("$FreeBSD$"); * Otherwise, the setcontext() syscall will return here and we'll * pop off the return address and go to the *setcontext* call. */ - .weak _getcontext - .set _getcontext,__sys_getcontext - .weak getcontext - .set getcontext,__sys_getcontext + WEAK_REFERENCE(__sys_getcontext, _getcontext) + WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movq (%rsp),%rsi /* save getcontext return address */ mov $SYS_getcontext,%rax Modified: head/lib/libc/amd64/sys/pipe.S ============================================================================== --- head/lib/libc/amd64/sys/pipe.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/sys/pipe.S Thu Nov 21 21:25:58 2013 (r258447) @@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" - .weak _pipe - .set _pipe,__sys_pipe - .weak pipe - .set pipe,__sys_pipe + WEAK_REFERENCE(__sys_pipe, _pipe) + WEAK_REFERENCE(__sys_pipe, pipe) ENTRY(__sys_pipe) mov $SYS_pipe,%rax KERNCALL Modified: head/lib/libc/amd64/sys/reboot.S ============================================================================== --- head/lib/libc/amd64/sys/reboot.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/sys/reboot.S Thu Nov 21 21:25:58 2013 (r258447) @@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" - .weak _reboot - .set _reboot,__sys_reboot - .weak reboot - .set reboot,__sys_reboot + WEAK_REFERENCE(__sys_reboot, _reboot) + WEAK_REFERENCE(__sys_reboot, reboot) ENTRY(__sys_reboot) mov $SYS_reboot,%rax KERNCALL Modified: head/lib/libc/amd64/sys/setlogin.S ============================================================================== --- head/lib/libc/amd64/sys/setlogin.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/sys/setlogin.S Thu Nov 21 21:25:58 2013 (r258447) @@ -40,10 +40,8 @@ __FBSDID("$FreeBSD$"); .globl CNAME(_logname_valid) /* in _getlogin() */ - .weak _setlogin - .set _setlogin,__sys_setlogin - .weak setlogin - .set setlogin,__sys_setlogin + WEAK_REFERENCE(__sys_setlogin, _setlogin) + WEAK_REFERENCE(__sys_setlogin, setlogin) ENTRY(__sys_setlogin) mov $SYS_setlogin,%rax KERNCALL Modified: head/lib/libc/amd64/sys/vfork.S ============================================================================== --- head/lib/libc/amd64/sys/vfork.S Thu Nov 21 21:19:01 2013 (r258446) +++ head/lib/libc/amd64/sys/vfork.S Thu Nov 21 21:25:58 2013 (r258447) @@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" - .weak _vfork - .set _vfork,__sys_vfork - .weak vfork - .set vfork,__sys_vfork + WEAK_REFERENCE(__sys_vfork, _vfork) + WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popq %rsi /* fetch return address (%rsi preserved) */ mov $SYS_vfork,%rax Modified: head/sys/amd64/include/asm.h ============================================================================== --- head/sys/amd64/include/asm.h Thu Nov 21 21:19:01 2013 (r258446) +++ head/sys/amd64/include/asm.h Thu Nov 21 21:25:58 2013 (r258447) @@ -77,6 +77,15 @@ #endif #define END(x) .size x, . - x +/* + * WEAK_REFERENCE(): create a weak reference alias from sym. + * The macro is not a general asm macro that takes arbitrary names, + * but one that takes only C names. It does the non-null name + * translation inside the macro. + */ +#define WEAK_REFERENCE(sym, alias) \ + .weak CNAME(alias); \ + .equ CNAME(alias),CNAME(sym) #define RCSID(x) .text; .asciz x From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:00: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3299DB83; Thu, 21 Nov 2013 22:00:27 +0000 (UTC) Received: from mail.egr.msu.edu (boomhauer.egr.msu.edu [35.9.37.167]) by mx1.freebsd.org (Postfix) with ESMTP id 0833429D2; Thu, 21 Nov 2013 22:00:26 +0000 (UTC) Received: from boomhauer (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id 32D6723F3; Thu, 21 Nov 2013 17:00:19 -0500 (EST) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by boomhauer (boomhauer.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhEw8Yv93WZB; Thu, 21 Nov 2013 17:00:19 -0500 (EST) Received: from EGR authenticated sender Message-ID: <528E8272.1010301@egr.msu.edu> Date: Thu, 21 Nov 2013 17:00:18 -0500 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org, "Justin T. Gibbs" Subject: Re: svn commit: r256423 - head/sys/dev/xen/blkfront References: <201310130234.r9D2YKs2034280@svn.freebsd.org> In-Reply-To: <201310130234.r9D2YKs2034280@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Mark Felder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 22:00:27 -0000 On 10/12/2013 22:34, Justin T. Gibbs wrote: > Author: gibbs > Date: Sun Oct 13 02:34:20 2013 > New Revision: 256423 > URL: http://svnweb.freebsd.org/changeset/base/256423 > > Log: > Allow FreeBSD to be booted from CDROM media on XenServer 6.2 and > prior releases. > > Submitted by: Roger Pau Monné > Sponsored by: Citrix Systems R&D > Reviewed by: gibbs > Approved by: re (gjb) > > sys/dev/xen/blkfront/blkfront.c: > On XenServer versions up to an including 6.2, paravirtualized > CDROM support is broken. When running in an HVM domain, > ignore paravirtualized instances of CDROM media, and instead > rely on native drivers attaching to emulated hardware. This > functions correctly on all currently known Xen based > platforms. Can this pretty please be MFC'ed for 10.0? I haven't heard of any problems with it, only successes on freebsd-xen@freebsd.org (thread: "FreeBSD Alpha5 amd64 - Citrix Xen 6.2 problem"). Thanks! From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 000E9CDD; Thu, 21 Nov 2013 22:02:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9D3F2A1C; Thu, 21 Nov 2013 22:02:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALM2xZs078473; Thu, 21 Nov 2013 22:02:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALM2xAS078472; Thu, 21 Nov 2013 22:02:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201311212202.rALM2xAS078472@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 21 Nov 2013 22:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258448 - head/sys/geom/part 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 22:03:00 -0000 Author: marcel Date: Thu Nov 21 22:02:59 2013 New Revision: 258448 URL: http://svnweb.freebsd.org/changeset/base/258448 Log: Have the GPT probe return a lower priority when the MBR is not a PMBR The purpose of the PMBR is to have the disk appear in use to GPT unaware utilities (like fdisk). However, if the PMBR has been changed by a GPT unaware utlity then we must assume that this was deliberate (as it involved removal of the special slice) and we should not treat the unmodified GPT-specific sectors as being valid. By lowering the probe priority in that case, the MBR scheme will take precedence and the kernel will end up using the MBR and not the GPT. We will still use the GPT if the kernel does not support the MBR scheme. Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Thu Nov 21 21:25:58 2013 (r258447) +++ head/sys/geom/part/g_part_gpt.c Thu Nov 21 22:02:59 2013 (r258448) @@ -759,8 +759,8 @@ static int g_part_gpt_probe(struct g_part_table *table, struct g_consumer *cp) { struct g_provider *pp; - char *buf; - int error, res; + u_char *buf; + int error, index, pri, res; /* We don't nest, which means that our depth should be 0. */ if (table->gpt_depth != 0) @@ -785,11 +785,21 @@ g_part_gpt_probe(struct g_part_table *ta if (pp->sectorsize < MBRSIZE || pp->mediasize < 6 * pp->sectorsize) return (ENOSPC); - /* Check that there's a MBR. */ + /* + * Check that there's a MBR or a PMBR. If it's a PMBR, we return + * as the highest priority on a match, otherwise we assume some + * GPT-unaware tool has destroyed the GPT by recreating a MBR and + * we really want the MBR scheme to take precedence. + */ buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) return (error); res = le16dec(buf + DOSMAGICOFFSET); + pri = G_PART_PROBE_PRI_LOW; + for (index = 0; index < NDOSPART; index++) { + if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee) + pri = G_PART_PROBE_PRI_HIGH; + } g_free(buf); if (res != DOSMAGIC) return (ENXIO); @@ -801,7 +811,7 @@ g_part_gpt_probe(struct g_part_table *ta res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); if (res == 0) - return (G_PART_PROBE_PRI_HIGH); + return (pri); /* No primary? Check that there's a secondary. */ buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, @@ -810,7 +820,7 @@ g_part_gpt_probe(struct g_part_table *ta return (error); res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); - return ((res == 0) ? G_PART_PROBE_PRI_HIGH : ENXIO); + return ((res == 0) ? pri : ENXIO); } static int From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:23: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A7A66E5; Thu, 21 Nov 2013 22:23:56 +0000 (UTC) Received: from mail.egr.msu.edu (boomhauer.egr.msu.edu [35.9.37.167]) by mx1.freebsd.org (Postfix) with ESMTP id E33FB2B91; Thu, 21 Nov 2013 22:23:55 +0000 (UTC) Received: from boomhauer (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id C9F9141692; Thu, 21 Nov 2013 17:23:54 -0500 (EST) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by boomhauer (boomhauer.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p72rtpYZZB9I; Thu, 21 Nov 2013 17:23:54 -0500 (EST) Received: from EGR authenticated sender Message-ID: <528E87FA.7010902@egr.msu.edu> Date: Thu, 21 Nov 2013 17:23:54 -0500 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org, "Justin T. Gibbs" Subject: Re: svn commit: r256423 - head/sys/dev/xen/blkfront References: <201310130234.r9D2YKs2034280@svn.freebsd.org> <528E8272.1010301@egr.msu.edu> In-Reply-To: <528E8272.1010301@egr.msu.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Mark Felder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 22:23:56 -0000 On 11/21/2013 17:00, Adam McDougall wrote: > On 10/12/2013 22:34, Justin T. Gibbs wrote: >> Author: gibbs >> Date: Sun Oct 13 02:34:20 2013 >> New Revision: 256423 >> URL: http://svnweb.freebsd.org/changeset/base/256423 >> >> Log: >> Allow FreeBSD to be booted from CDROM media on XenServer 6.2 and >> prior releases. >> >> Submitted by: Roger Pau Monné >> Sponsored by: Citrix Systems R&D >> Reviewed by: gibbs >> Approved by: re (gjb) >> >> sys/dev/xen/blkfront/blkfront.c: >> On XenServer versions up to an including 6.2, paravirtualized >> CDROM support is broken. When running in an HVM domain, >> ignore paravirtualized instances of CDROM media, and instead >> rely on native drivers attaching to emulated hardware. This >> functions correctly on all currently known Xen based >> platforms. > > Can this pretty please be MFC'ed for 10.0? I haven't heard of any > problems with it, only successes on freebsd-xen@freebsd.org (thread: > "FreeBSD Alpha5 amd64 - Citrix Xen 6.2 problem"). Thanks! Oops nevermind! Mark clued me in to r256757 which is in BETA 3. Thanks again. From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:30: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1E819A7; Thu, 21 Nov 2013 22:30:42 +0000 (UTC) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B84C52C15; Thu, 21 Nov 2013 22:30:42 +0000 (UTC) Received: from [10.85.60.164] (207-225-98-3.dia.static.qwest.net [207.225.98.3]) (authenticated bits=0) by aslan.scsiguy.com (8.14.7/8.14.5) with ESMTP id rALMUbOl034496 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 21 Nov 2013 15:30:39 -0700 (MST) (envelope-from gibbs@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r256423 - head/sys/dev/xen/blkfront From: "Justin T. Gibbs" In-Reply-To: <528E87FA.7010902@egr.msu.edu> Date: Thu, 21 Nov 2013 15:30:31 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <246C1C00-6485-481B-BCBE-F236466A579C@FreeBSD.org> References: <201310130234.r9D2YKs2034280@svn.freebsd.org> <528E8272.1010301@egr.msu.edu> <528E87FA.7010902@egr.msu.edu> To: Adam McDougall X-Mailer: Apple Mail (2.1822) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (aslan.scsiguy.com [70.89.174.89]); Thu, 21 Nov 2013 15:30:39 -0700 (MST) Cc: svn-src-all@freebsd.org, Mark Felder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 22:30:43 -0000 Actually, my oops. It seems that I put the wrong commit message in for = that MFC. Is there anyway to change it on the server? =97 Justin On Nov 21, 2013, at 3:23 PM, Adam McDougall = wrote: > On 11/21/2013 17:00, Adam McDougall wrote: >> On 10/12/2013 22:34, Justin T. Gibbs wrote: >>> Author: gibbs >>> Date: Sun Oct 13 02:34:20 2013 >>> New Revision: 256423 >>> URL: http://svnweb.freebsd.org/changeset/base/256423 >>>=20 >>> Log: >>> Allow FreeBSD to be booted from CDROM media on XenServer 6.2 and >>> prior releases. >>>=20 >>> Submitted by: Roger Pau Monn=E9 >>> Sponsored by: Citrix Systems R&D >>> Reviewed by: gibbs >>> Approved by: re (gjb) >>>=20 >>> sys/dev/xen/blkfront/blkfront.c: >>> On XenServer versions up to an including 6.2, paravirtualized >>> CDROM support is broken. When running in an HVM domain, >>> ignore paravirtualized instances of CDROM media, and instead >>> rely on native drivers attaching to emulated hardware. This >>> functions correctly on all currently known Xen based >>> platforms. >>=20 >> Can this pretty please be MFC'ed for 10.0? I haven't heard of any >> problems with it, only successes on freebsd-xen@freebsd.org (thread: >> "FreeBSD Alpha5 amd64 - Citrix Xen 6.2 problem"). Thanks! >=20 > Oops nevermind! Mark clued me in to r256757 which is in BETA 3. = Thanks > again. >=20 From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:31:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0629DA0E; Thu, 21 Nov 2013 22:31:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA58E2C23; Thu, 21 Nov 2013 22:31:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALMVKuK088939; Thu, 21 Nov 2013 22:31:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALMVIJs088924; Thu, 21 Nov 2013 22:31:18 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311212231.rALMVIJs088924@svn.freebsd.org> From: Andreas Tobler Date: Thu, 21 Nov 2013 22:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258451 - in head: lib/libc/i386 lib/libc/i386/gen lib/libc/i386/string lib/libc/i386/sys lib/libkse/arch/i386/i386 sys/i386/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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 22:31:21 -0000 Author: andreast Date: Thu Nov 21 22:31:18 2013 New Revision: 258451 URL: http://svnweb.freebsd.org/changeset/base/258451 Log: Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib Modified: head/lib/libc/i386/SYS.h head/lib/libc/i386/gen/_setjmp.S head/lib/libc/i386/gen/setjmp.S head/lib/libc/i386/gen/sigsetjmp.S head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/i386/sys/Ovfork.S head/lib/libc/i386/sys/getcontext.S head/lib/libkse/arch/i386/i386/thr_getcontext.S head/sys/i386/include/asm.h Modified: head/lib/libc/i386/SYS.h ============================================================================== --- head/lib/libc/i386/SYS.h Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/SYS.h Thu Nov 21 22:31:18 2013 (r258451) @@ -36,22 +36,19 @@ #include #include -#define SYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; \ - jb HIDENAME(cerror) +#define SYSCALL(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ + jb HIDENAME(cerror) -#define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) +#define RSYSCALL(name) SYSCALL(name); ret; END(__sys_##name) -#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ - END(__CONCAT(__sys_,x)) +#define PSEUDO(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ + END(__sys_##name) /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x Modified: head/lib/libc/i386/gen/_setjmp.S ============================================================================== --- head/lib/libc/i386/gen/_setjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/_setjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -60,8 +60,7 @@ ENTRY(_setjmp) ret END(_setjmp) - .weak CNAME(_longjmp) - .set CNAME(_longjmp),CNAME(___longjmp) + WEAK_REFERENCE(___longjmp, _longjmp) ENTRY(___longjmp) movl 4(%esp),%edx movl 8(%esp),%eax Modified: head/lib/libc/i386/gen/setjmp.S ============================================================================== --- head/lib/libc/i386/gen/setjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/setjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -78,8 +78,7 @@ ENTRY(setjmp) ret END(setjmp) - .weak CNAME(longjmp) - .set CNAME(longjmp),CNAME(__longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) movl 4(%esp),%edx PIC_PROLOGUE Modified: head/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/i386/gen/sigsetjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/sigsetjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -87,8 +87,7 @@ ENTRY(sigsetjmp) ret END(sigsetjmp) - .weak CNAME(siglongjmp); - .set CNAME(siglongjmp),CNAME(__siglongjmp) + WEAK_REFERENCE(__siglongjmp, siglongjmp) ENTRY(__siglongjmp) movl 4(%esp),%edx cmpl $0,44(%edx) Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/string/strchr.S Thu Nov 21 22:31:18 2013 (r258451) @@ -63,6 +63,6 @@ L2: ret END(strchr) -WEAK_ALIAS(index, strchr) +WEAK_REFERENCE(strchr, index) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/string/strrchr.S Thu Nov 21 22:31:18 2013 (r258451) @@ -64,6 +64,6 @@ L2: ret END(strrchr) -WEAK_ALIAS(rindex, strrchr) +WEAK_REFERENCE(strrchr, rindex) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/Ovfork.S ============================================================================== --- head/lib/libc/i386/sys/Ovfork.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/sys/Ovfork.S Thu Nov 21 22:31:18 2013 (r258451) @@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" - .weak _vfork - .set _vfork,__sys_vfork - .weak vfork - .set vfork,__sys_vfork + WEAK_REFERENCE(__sys_vfork, _vfork) + WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popl %ecx /* my rta into ecx */ mov $SYS_vfork,%eax Modified: head/lib/libc/i386/sys/getcontext.S ============================================================================== --- head/lib/libc/i386/sys/getcontext.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/sys/getcontext.S Thu Nov 21 22:31:18 2013 (r258451) @@ -34,10 +34,8 @@ __FBSDID("$FreeBSD$"); * Otherwise, the setcontext() syscall will return here and we'll * pop off the return address and go to the *setcontext* call. */ - .weak _getcontext - .set _getcontext,__sys_getcontext - .weak getcontext - .set getcontext,__sys_getcontext + WEAK_REFERENCE(__sys_getcontext, _getcontext) + WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movl (%esp),%ecx /* save getcontext return address */ mov $SYS_getcontext,%eax Modified: head/lib/libkse/arch/i386/i386/thr_getcontext.S ============================================================================== --- head/lib/libkse/arch/i386/i386/thr_getcontext.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libkse/arch/i386/i386/thr_getcontext.S Thu Nov 21 22:31:18 2013 (r258451) @@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$"); * * Returns 0 if there are no errors; -1 otherwise */ - .weak CNAME(_thr_setcontext) - .set CNAME(_thr_setcontext),CNAME(__thr_setcontext) + WEAK_REFERENCE(__thr_setcontext, _thr_setcontext) ENTRY(__thr_setcontext) movl 4(%esp), %edx /* get address of mcontext */ cmpl $0, %edx /* check for null pointer */ @@ -116,8 +115,7 @@ ENTRY(__thr_setcontext) * Returns -1 if there is an error, 0 no errors; 1 upon return * from a setcontext(). */ - .weak CNAME(_thr_getcontext) - .set CNAME(_thr_getcontext),CNAME(__thr_getcontext) + WEAK_REFERENCE(__thr_getcontext, _thr_getcontext) ENTRY(__thr_getcontext) pushl %edx /* save edx */ movl 8(%esp), %edx /* get address of mcontext */ Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Thu Nov 21 22:17:55 2013 (r258450) +++ head/sys/i386/include/asm.h Thu Nov 21 22:31:18 2013 (r258451) @@ -91,11 +91,15 @@ #endif /* - * WEAK_ALIAS: create a weak alias. + * WEAK_REFERENCE(): create a weak reference alias from sym. + * The macro is not a general asm macro that takes arbitrary names, + * but one that takes only C names. It does the non-null name + * translation inside the macro. */ -#define WEAK_ALIAS(alias,sym) \ - .weak alias; \ - alias = sym + +#define WEAK_REFERENCE(sym, alias) \ + .weak CNAME(alias); \ + .equ CNAME(alias),CNAME(sym) /* * STRONG_ALIAS: create a strong alias. From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 23:00: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3FE89EC; Thu, 21 Nov 2013 23:00:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B229B2E08; Thu, 21 Nov 2013 23:00:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALN0Ci0096859; Thu, 21 Nov 2013 23:00:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALN0A6x096839; Thu, 21 Nov 2013 23:00:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201311212300.rALN0A6x096839@svn.freebsd.org> From: Michael Tuexen Date: Thu, 21 Nov 2013 23:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258454 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 23:00:12 -0000 Author: tuexen Date: Thu Nov 21 23:00:09 2013 New Revision: 258454 URL: http://svnweb.freebsd.org/changeset/base/258454 Log: MFC r256556: Remove a buggy comparision when setting manually the path MTU. After fixing, the comparision would have become redundant. Thanks to Andrew Galante for reporting the issue. MFC r257272: Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined. The issue was reported by Andrew Galante. MFC r257274: Fix the value of *optlen when calling getsockopt() for SCTP_REMOTE_UDP_ENCAPS_PORT. This issue was reported by Andrew Galante. MFC r257359: Terminate a debug output with a \n. MFC r257555: Changes from upstream to improve compilation when INET or INET6 or none of them is defined. MFC r257574: Unlock the lock before destroying it. This issue was reported by Andrew Galante. MFC r257800: Use htons()/ntohs() appropriately. These issues were reported by Andrew Galante. MFC r257803: Make sure that we don't try to build an ASCONF-ACK chunk larger than what fits in the the mbuf cluster. This issue was reported by Andrew Galante. MFC r257804: Get rid of the artification limitation enforced by SCTP_AUTH_RANDOM_SIZE_MAX. This was suggested by Andrew Galante. MFC r258221: Cleanups which result in fixes which have been made upstream and where partially suggested by Andrew Galante. There is no functional change in FreeBSD. MFC r258224: When determining if an address belongs to an stcb, take the address family into account for wildcard bound endpoints. MFC r258228: Remove a stray write operation. MFC r258235: Use SCTP_PR_SCTP_TTL when the user provides a positive timetolive in sctp_sendmsg(). Approved by: re@ Modified: stable/10/sys/netinet/sctp_asconf.c stable/10/sys/netinet/sctp_auth.c stable/10/sys/netinet/sctp_auth.h stable/10/sys/netinet/sctp_bsd_addr.c stable/10/sys/netinet/sctp_constants.h stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_timer.c stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_asconf.c Thu Nov 21 23:00:09 2013 (r258454) @@ -150,7 +150,12 @@ sctp_process_asconf_add_ip(struct sockad struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; int bad_address = 0; @@ -169,8 +174,9 @@ sctp_process_asconf_add_ip(struct sockad aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -298,7 +304,12 @@ sctp_process_asconf_delete_ip(struct soc struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; int result; @@ -317,8 +328,9 @@ sctp_process_asconf_delete_ip(struct soc aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -427,7 +439,12 @@ sctp_process_asconf_set_primary(struct s struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; @@ -445,8 +462,9 @@ sctp_process_asconf_set_primary(struct s aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -860,10 +878,12 @@ sctp_asconf_addr_match(struct sctp_ascon static uint32_t sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa) { +#if defined(INET) || defined(INET6) uint16_t param_type, param_length; param_type = ntohs(ph->param_type); param_length = ntohs(ph->param_length); +#endif switch (sa->sa_family) { #ifdef INET6 case AF_INET6: @@ -874,7 +894,7 @@ sctp_addr_match(struct sctp_paramhdr *ph v6addr = (struct sctp_ipv6addr_param *)ph; if ((param_type == SCTP_IPV6_ADDRESS) && - param_length == sizeof(struct sctp_ipv6addr_param) && + (param_length == sizeof(struct sctp_ipv6addr_param)) && (memcmp(&v6addr->addr, &sin6->sin6_addr, sizeof(struct in6_addr)) == 0)) { return (1); @@ -890,7 +910,7 @@ sctp_addr_match(struct sctp_paramhdr *ph v4addr = (struct sctp_ipv4addr_param *)ph; if ((param_type == SCTP_IPV4_ADDRESS) && - param_length == sizeof(struct sctp_ipv4addr_param) && + (param_length == sizeof(struct sctp_ipv4addr_param)) && (memcmp(&v4addr->addr, &sin->sin_addr, sizeof(struct in_addr)) == 0)) { return (1); @@ -2596,7 +2616,8 @@ sctp_compose_asconf(struct sctp_tcb *stc /* get the parameter length */ p_length = SCTP_SIZE32(aa->ap.aph.ph.param_length); /* will it fit in current chunk? */ - if (SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) { + if ((SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) || + (SCTP_BUF_LEN(m_asconf) + p_length > MCLBYTES)) { /* won't fit, so we're done with this chunk */ break; } @@ -2717,7 +2738,7 @@ sctp_compose_asconf(struct sctp_tcb *stc /* chain it all together */ SCTP_BUF_NEXT(m_asconf_chk) = m_asconf; *retlen = SCTP_BUF_LEN(m_asconf_chk) + SCTP_BUF_LEN(m_asconf); - acp->ch.chunk_length = ntohs(*retlen); + acp->ch.chunk_length = htons(*retlen); return (m_asconf_chk); } Modified: stable/10/sys/netinet/sctp_auth.c ============================================================================== --- stable/10/sys/netinet/sctp_auth.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_auth.c Thu Nov 21 23:00:09 2013 (r258454) @@ -333,10 +333,6 @@ sctp_generate_random_key(uint32_t keylen { sctp_key_t *new_key; - /* validate keylen */ - if (keylen > SCTP_AUTH_RANDOM_SIZE_MAX) - keylen = SCTP_AUTH_RANDOM_SIZE_MAX; - new_key = sctp_alloc_key(keylen); if (new_key == NULL) { /* out of memory */ @@ -374,7 +370,7 @@ sctp_compare_key(sctp_key_t * key1, sctp uint32_t i; uint32_t key1len, key2len; uint8_t *key_1, *key_2; - uint8_t temp[SCTP_AUTH_RANDOM_SIZE_MAX]; + uint8_t val1, val2; /* sanity/length check */ key1len = sctp_get_keylen(key1); @@ -386,38 +382,24 @@ sctp_compare_key(sctp_key_t * key1, sctp else if (key2len == 0) return (1); - if (key1len != key2len) { - if (key1len >= key2len) - maxlen = key1len; - else - maxlen = key2len; - bzero(temp, maxlen); - if (key1len < maxlen) { - /* prepend zeroes to key1 */ - bcopy(key1->key, temp + (maxlen - key1len), key1len); - key_1 = temp; - key_2 = key2->key; - } else { - /* prepend zeroes to key2 */ - bcopy(key2->key, temp + (maxlen - key2len), key2len); - key_1 = key1->key; - key_2 = temp; - } + if (key1len < key2len) { + maxlen = key2len; } else { maxlen = key1len; - key_1 = key1->key; - key_2 = key2->key; } - + key_1 = key1->key; + key_2 = key2->key; + /* check for numeric equality */ for (i = 0; i < maxlen; i++) { - if (*key_1 > *key_2) + /* left-pad with zeros */ + val1 = (i < (maxlen - key1len)) ? 0 : *(key_1++); + val2 = (i < (maxlen - key2len)) ? 0 : *(key_2++); + if (val1 > val2) { return (1); - else if (*key_1 < *key_2) + } else if (val1 < val2) { return (-1); - key_1++; - key_2++; + } } - /* keys are equal value, so check lengths */ if (key1len == key2len) return (0); Modified: stable/10/sys/netinet/sctp_auth.h ============================================================================== --- stable/10/sys/netinet/sctp_auth.h Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_auth.h Thu Nov 21 23:00:09 2013 (r258454) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); /* random sizes */ #define SCTP_AUTH_RANDOM_SIZE_DEFAULT 32 #define SCTP_AUTH_RANDOM_SIZE_REQUIRED 32 -#define SCTP_AUTH_RANDOM_SIZE_MAX 256 /* union of all supported HMAC algorithm contexts */ typedef union sctp_hash_context { Modified: stable/10/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/10/sys/netinet/sctp_bsd_addr.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_bsd_addr.c Thu Nov 21 23:00:09 2013 (r258454) @@ -96,22 +96,12 @@ sctp_iterator_thread(void *v SCTP_UNUSED void sctp_startup_iterator(void) { - static int called = 0; - int ret; - - if (called) { + if (sctp_it_ctl.thread_proc) { /* You only get one */ return; } - /* init the iterator head */ - called = 1; - sctp_it_ctl.iterator_running = 0; - sctp_it_ctl.iterator_flags = 0; - sctp_it_ctl.cur_it = NULL; - SCTP_ITERATOR_LOCK_INIT(); - SCTP_IPI_ITERATOR_WQ_INIT(); TAILQ_INIT(&sctp_it_ctl.iteratorhead); - ret = kproc_create(sctp_iterator_thread, + kproc_create(sctp_iterator_thread, (void *)NULL, &sctp_it_ctl.thread_proc, RFPROC, Modified: stable/10/sys/netinet/sctp_constants.h ============================================================================== --- stable/10/sys/netinet/sctp_constants.h Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_constants.h Thu Nov 21 23:00:09 2013 (r258454) @@ -726,7 +726,6 @@ __FBSDID("$FreeBSD$"); /* small chunk store for looking at chunk_list in auth */ #define SCTP_SMALL_CHUNK_STORE 260 -#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ #define SCTP_HOW_MANY_SECRETS 2 /* how many secrets I keep */ #define SCTP_NUMBER_OF_SECRETS 8 /* or 8 * 4 = 32 octets */ Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_indata.c Thu Nov 21 23:00:09 2013 (r258454) @@ -1787,7 +1787,6 @@ failed_express_del: asoc->highest_tsn_inside_nr_map = tsn; } SCTP_STAT_INCR(sctps_recvexpressm); - control->sinfo_tsn = tsn; asoc->tsn_last_delivered = tsn; asoc->fragment_flags = chunk_flags; asoc->tsn_of_pdapi_last_delivered = tsn; Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_output.c Thu Nov 21 23:00:09 2013 (r258454) @@ -1937,10 +1937,13 @@ sctp_is_address_in_scope(struct sctp_ifa static struct mbuf * sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len) { +#if defined(INET) || defined(INET6) struct sctp_paramhdr *parmh; struct mbuf *mret; uint16_t plen; +#endif + switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: @@ -1955,6 +1958,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st default: return (m); } +#if defined(INET) || defined(INET6) if (M_TRAILINGSPACE(m) >= plen) { /* easy side we just drop it on the end */ parmh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); @@ -2015,6 +2019,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st *len += plen; } return (mret); +#endif } @@ -3384,7 +3389,11 @@ sctp_find_cmsg(int c_type, void *data, s return (found); } m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); - sndrcvinfo->sinfo_timetolive = prinfo.pr_value; + if (prinfo.pr_policy != SCTP_PR_SCTP_NONE) { + sndrcvinfo->sinfo_timetolive = prinfo.pr_value; + } else { + sndrcvinfo->sinfo_timetolive = 0; + } sndrcvinfo->sinfo_flags |= prinfo.pr_policy; break; case SCTP_AUTHINFO: @@ -3855,8 +3864,11 @@ sctp_lowlevel_chunk_output(struct sctp_i struct sctphdr *sctphdr; int packet_length; int ret; + +#if defined(INET) || defined(INET6) uint32_t vrf_id; +#endif #if defined(INET) || defined(INET6) struct mbuf *o_pak; sctp_route_t *ro = NULL; @@ -3875,12 +3887,13 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (EFAULT); } +#if defined(INET) || defined(INET6) if (stcb) { vrf_id = stcb->asoc.vrf_id; } else { vrf_id = inp->def_vrf_id; } - +#endif /* fill in the HMAC digest for any AUTH chunk in the packet */ if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); @@ -6069,13 +6082,13 @@ sctp_set_prsctp_policy(struct sctp_strea { /* * We assume that the user wants PR_SCTP_TTL if the user provides a - * positive lifetime but does not specify any PR_SCTP policy. This - * is a BAD assumption and causes problems at least with the - * U-Vancovers MPI folks. I will change this to be no policy means - * NO PR-SCTP. + * positive lifetime but does not specify any PR_SCTP policy. */ if (PR_SCTP_ENABLED(sp->sinfo_flags)) { sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags); + } else if (sp->timetolive > 0) { + sp->sinfo_flags |= SCTP_PR_SCTP_TTL; + sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags); } else { return; } @@ -10798,8 +10811,12 @@ sctp_send_resp_msg(struct sockaddr *src, struct sctphdr *shout; struct sctp_chunkhdr *ch; struct udphdr *udp; - int len, cause_len, padding_len, ret; + int len, cause_len, padding_len; +#if defined(INET) || defined(INET6) + int ret; + +#endif #ifdef INET struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_pcb.c Thu Nov 21 23:00:09 2013 (r258454) @@ -827,18 +827,30 @@ out_now: static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined(INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) 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; +#endif SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); @@ -863,6 +875,9 @@ sctp_does_stcb_own_this_addr(struct sctp */ continue; } + if (sctp_ifa->address.sa.sa_family != to->sa_family) { + continue; + } switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: @@ -1971,8 +1986,13 @@ sctp_findassociation_special_addr(struct struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; + +#if defined(INET) || defined(INET6) struct sctp_tcb *stcb; - uint32_t ptype, plen; + uint16_t ptype; + +#endif + uint16_t plen; #ifdef INET struct sockaddr_in sin4; @@ -1996,13 +2016,14 @@ sctp_findassociation_special_addr(struct sin6.sin6_port = sh->src_port; #endif - stcb = NULL; offset += sizeof(struct sctp_init_chunk); phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); while (phdr != NULL) { /* now we must see if we want the parameter */ +#if defined(INET) || defined(INET6) ptype = ntohs(phdr->param_type); +#endif plen = ntohs(phdr->param_length); if (plen == 0) { break; @@ -3740,7 +3761,7 @@ sctp_add_remote_addr(struct sctp_tcb *st sin->sin_len = sizeof(struct sockaddr_in); if (set_scope) { #ifdef SCTP_DONT_DO_PRIVADDR_SCOPE - stcb->ipv4_local_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; #else if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { stcb->asoc.scope.ipv4_local_scope = 1; @@ -4314,6 +4335,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, asoc->nr_mapping_array = NULL; } SCTP_DECR_ASOC_COUNT(); + SCTP_TCB_UNLOCK(stcb); SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); LIST_REMOVE(stcb, sctp_tcbasocidhash); @@ -5116,6 +5138,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, /* Insert new items here :> */ /* Get rid of LOCK */ + SCTP_TCB_UNLOCK(stcb); SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); if (from_inpcbfree == SCTP_NORMAL_PROC) { @@ -5841,7 +5864,8 @@ sctp_pcb_init() for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } - + SCTP_ITERATOR_LOCK_INIT(); + SCTP_IPI_ITERATOR_WQ_INIT(); sctp_startup_iterator(); #if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) @@ -5870,35 +5894,31 @@ sctp_pcb_finish(void) struct sctp_tagblock *twait_block, *prev_twait_block; struct sctp_laddr *wi, *nwi; int i; + struct sctp_iterator *it, *nit; /* - * Free BSD the it thread never exits but we do clean up. The only - * way freebsd reaches here if we have VRF's but we still add the - * ifdef to make it compile on old versions. + * In FreeBSD the iterator thread never exits but we do clean up. + * The only way FreeBSD reaches here is if we have VRF's but we + * still add the ifdef to make it compile on old versions. */ - { - struct sctp_iterator *it, *nit; - - SCTP_IPI_ITERATOR_WQ_LOCK(); - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - if (it->vn != curvnet) { - continue; - } - TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); - if (it->function_atend != NULL) { - (*it->function_atend) (it->pointer, it->val); - } - SCTP_FREE(it, SCTP_M_ITER); - } - SCTP_IPI_ITERATOR_WQ_UNLOCK(); - SCTP_ITERATOR_LOCK(); - if ((sctp_it_ctl.cur_it) && - (sctp_it_ctl.cur_it->vn == curvnet)) { - sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; + SCTP_IPI_ITERATOR_WQ_LOCK(); + TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { + if (it->vn != curvnet) { + continue; } - SCTP_ITERATOR_UNLOCK(); + TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + SCTP_FREE(it, SCTP_M_ITER); } - + SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_ITERATOR_LOCK(); + if ((sctp_it_ctl.cur_it) && + (sctp_it_ctl.cur_it->vn == curvnet)) { + sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; + } + SCTP_ITERATOR_UNLOCK(); SCTP_OS_TIMER_STOP(&SCTP_BASE_INFO(addr_wq_timer.timer)); SCTP_WQ_ADDR_LOCK(); LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { Modified: stable/10/sys/netinet/sctp_timer.c ============================================================================== --- stable/10/sys/netinet/sctp_timer.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_timer.c Thu Nov 21 23:00:09 2013 (r258454) @@ -552,7 +552,7 @@ start_again: TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.TSN_seq)) { /* Strange case our list got out of order? */ - SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x", + SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x\n", (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.TSN_seq); recovery_cnt++; #ifdef INVARIANTS Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctp_usrreq.c Thu Nov 21 23:00:09 2013 (r258454) @@ -1120,9 +1120,17 @@ sctp_fill_up_addresses_vrf(struct sctp_i { struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; - int loopback_scope, ipv4_local_scope, local_scope, site_scope; size_t actual; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined(INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; actual = 0; @@ -1132,27 +1140,43 @@ sctp_fill_up_addresses_vrf(struct sctp_i if (stcb) { /* Turn on all the appropriate scope */ loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) 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; +#endif } else { /* Use generic values for endpoints. */ loopback_scope = 1; +#if defined(INET) ipv4_local_scope = 1; +#endif +#if defined(INET6) local_scope = 1; site_scope = 1; +#endif if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { +#if defined(INET6) ipv6_addr_legal = 1; +#endif +#if defined(INET) if (SCTP_IPV6_V6ONLY(inp)) { ipv4_addr_legal = 0; } else { ipv4_addr_legal = 1; } +#endif } else { +#if defined(INET6) ipv6_addr_legal = 0; +#endif +#if defined(INET) ipv4_addr_legal = 1; +#endif } } vrf = sctp_find_vrf(vrf_id); @@ -3281,7 +3305,7 @@ flags_out: } } if (error == 0) { - *optsize = sizeof(struct sctp_paddrparams); + *optsize = sizeof(struct sctp_udpencaps); } break; } @@ -4796,11 +4820,9 @@ sctp_setopt(struct socket *so, int optna SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { - net->mtu = paddrp->spp_pathmtu + ovh; - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); - } + net->mtu = paddrp->spp_pathmtu + ovh; + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); } } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -4920,11 +4942,9 @@ sctp_setopt(struct socket *so, int optna SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { - net->mtu = paddrp->spp_pathmtu + ovh; - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); - } + net->mtu = paddrp->spp_pathmtu + ovh; + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); } } sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet/sctputil.c Thu Nov 21 23:00:09 2013 (r258454) @@ -2602,7 +2602,7 @@ sctp_notify_assoc_change(uint16_t state, if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { notif_len = sizeof(struct sctp_assoc_change); if (abort != NULL) { - abort_len = htons(abort->ch.chunk_length); + abort_len = ntohs(abort->ch.chunk_length); } else { abort_len = 0; } @@ -3474,7 +3474,7 @@ sctp_notify_remote_error(struct sctp_tcb return; } if (chunk != NULL) { - chunk_len = htons(chunk->ch.chunk_length); + chunk_len = ntohs(chunk->ch.chunk_length); } else { chunk_len = 0; } @@ -6612,8 +6612,16 @@ sctp_bindx_delete_address(struct sctp_in int sctp_local_addr_count(struct sctp_tcb *stcb) { - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined (INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; @@ -6621,11 +6629,15 @@ sctp_local_addr_count(struct sctp_tcb *s /* Turn on all the appropriate scopes */ loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) 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; +#endif SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); if (vrf == NULL) { Modified: stable/10/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/sctp6_usrreq.c Thu Nov 21 23:00:00 2013 (r258453) +++ stable/10/sys/netinet6/sctp6_usrreq.c Thu Nov 21 23:00:09 2013 (r258454) @@ -839,16 +839,18 @@ sctp6_connect(struct socket *so, struct uint32_t vrf_id; int error = 0; struct sctp_inpcb *inp; - struct in6pcb *inp6; struct sctp_tcb *stcb; #ifdef INET + struct in6pcb *inp6; struct sockaddr_in6 *sin6; struct sockaddr_storage ss; #endif +#ifdef INET inp6 = (struct in6pcb *)so->so_pcb; +#endif inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET); From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 23:09: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71459D7C; Thu, 21 Nov 2013 23:09:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D96B2EAD; Thu, 21 Nov 2013 23:09:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALN98LY000285; Thu, 21 Nov 2013 23:09:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALN98la000284; Thu, 21 Nov 2013 23:09:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201311212309.rALN98la000284@svn.freebsd.org> From: Dimitry Andric Date: Thu, 21 Nov 2013 23:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258455 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 23:09:08 -0000 Author: dim Date: Thu Nov 21 23:09:07 2013 New Revision: 258455 URL: http://svnweb.freebsd.org/changeset/base/258455 Log: Pull in r195318 from upstream llvm trunk: The basic problem is that some mainstream programs cannot deal with the way clang optimizes tail calls, as in this example: int foo(void); int bar(void) { return foo(); } where the call is transformed to: calll .L0$pb .L0$pb: popl %eax .Ltmp0: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax movl foo@GOT(%eax), %eax popl %ebp jmpl *%eax # TAILCALL However, the GOT references must all be resolved at dlopen() time, and so this approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which usually populates the PLT with stubs that perform the actual resolving. This patch changes X86TargetLowering::LowerCall() to skip tail call optimization, if the called function is a global or external symbol. This fixes problems with loading X.org driver modules, which could occur when X.org was compiled on i386 with tailcall optimization on, for which ports r312583 was committed as a workaround. After this change, the workaround can be removed. MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Nov 21 23:00:09 2013 (r258454) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Nov 21 23:09:07 2013 (r258455) @@ -2449,21 +2449,15 @@ X86TargetLowering::LowerCall(TargetLower RegsToPass.push_back(std::make_pair(unsigned(X86::EBX), DAG.getNode(X86ISD::GlobalBaseReg, DebugLoc(), getPointerTy()))); } else { - // If we are tail calling and generating PIC/GOT style code load the - // address of the callee into ECX. The value in ecx is used as target of - // the tail jump. This is done to circumvent the ebx/callee-saved problem - // for tail calls on PIC/GOT architectures. Normally we would just put the - // address of GOT into ebx and then call target@PLT. But for tail calls - // ebx would be restored (since ebx is callee saved) before jumping to the - // target@PLT. - - // Note: The actual moving to ECX is done further down. + // If we are tail calling a global or external symbol in GOT pic mode, we + // cannot use a direct jump, since that would make lazy dynamic linking + // impossible (see PR15086). So pretend this is not a tail call, to + // prevent the optimization to a jump. GlobalAddressSDNode *G = dyn_cast(Callee); - if (G && !G->getGlobal()->hasHiddenVisibility() && - !G->getGlobal()->hasProtectedVisibility()) - Callee = LowerGlobalAddress(Callee, DAG); - else if (isa(Callee)) - Callee = LowerExternalSymbol(Callee, DAG); + if ((G && !G->getGlobal()->hasHiddenVisibility() && + !G->getGlobal()->hasProtectedVisibility()) || + isa(Callee)) + isTailCall = false; } } From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 23:29: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4479D242 for ; Thu, 21 Nov 2013 23:29:44 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C21822071 for ; Thu, 21 Nov 2013 23:29:43 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id y6so369003lbh.0 for ; Thu, 21 Nov 2013 15:29:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=lP1ygXqlcaFSGybC6Uh7vbOYz0HDyJhdTVPXaFrYlCQ=; b=dWOwK5lzMBE4xg3NFinGOnVAbgdBejtqV7o8/vErUz9j/fthgx6Xz87yZ5VrIYoBHI w8yTTlBwQaq4POzVs3aBhd/7YlYa5m1vy/i4XUC9qtuVR2uQrV2zlqV4xl1jbe7jO3IB 6UOIFQFEjeOVOpb5BFm3k8XVMOdfn8zWJLNKJKK0GduUMUyMrDJN0KC0at6j87OsavRf mcrpdUtFEMKo8089l8vX5iSvXoLqUez9K7Y6/qoLoa7KlS3CvS0NRut6lBOfHt6cg5xF Yqe6uhVMGQow6Tt37AErsCv+TX97xcACY9WYRiwPUQ0yqv7JY4QNnvZJEvEeNi0GxupJ pWkA== X-Gm-Message-State: ALoCoQn6CXsQjsgyWEo2wCd3qY1okWTxu5DunRy7kaNlEph+ykMxKsR3UUyB72/1g3kyAMc4Xp6d X-Received: by 10.112.158.231 with SMTP id wx7mr2793989lbb.27.1385076575634; Thu, 21 Nov 2013 15:29:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.181.169 with HTTP; Thu, 21 Nov 2013 15:29:15 -0800 (PST) X-Originating-IP: [2620:0:1003:1007:e1a0:7089:8f4f:6f0d] In-Reply-To: <20131119003307.9E25A5807E@chaos.jnpr.net> References: <201311172312.rAHNCtOY010186@svn.freebsd.org> <20131119003307.9E25A5807E@chaos.jnpr.net> From: Julio Merino Date: Thu, 21 Nov 2013 18:29:15 -0500 Message-ID: Subject: Re: svn commit: r258285 - in head/lib/atf: libatf-c++/tests libatf-c/tests tests/test-programs To: "Simon J. Gerraty" 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.16 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2013 23:29:44 -0000 On Mon, Nov 18, 2013 at 7:33 PM, Simon J. Gerraty wrote: > > On Sun, 17 Nov 2013 23:12:55 +0000, Julio Merino writes: >> I am not sure how this ever worked before given that manual inspection >> of bsd.progs.mk clearly shows that the expected character between the >> two components is a dot and not an underscore... but I suspect the > > Actually . or _ worked, until recently. I think only supporting one form is better in the name of simplicity. > Will fix. Garrett also mentioned to me that we should not be required to explicitly set SRCS.*: when building various programs, each of them should be able to determine a reasonable value for this variable on its own. In other words, what I did in r258298 should probably not be required. What do you think? -- Julio Merino / @jmmv From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 00:06: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 106A926B; Fri, 22 Nov 2013 00:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F39532333; Fri, 22 Nov 2013 00:06:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM06BE9021387; Fri, 22 Nov 2013 00:06:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM06BYw021386; Fri, 22 Nov 2013 00:06:11 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311220006.rAM06BYw021386@svn.freebsd.org> From: Brooks Davis Date: Fri, 22 Nov 2013 00:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258456 - head/usr.sbin/mergemaster 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 00:06:12 -0000 Author: brooks Date: Fri Nov 22 00:06:11 2013 New Revision: 258456 URL: http://svnweb.freebsd.org/changeset/base/258456 Log: Fix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is nmtree. The mtree output used by mergemaster in this case was clearly not meant for computer consumption and an approach based on -f -f would probalby be a better idea, but this is a minimal change. MFC after: 3 days X-MFC-with: r258437 Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu Nov 21 23:09:07 2013 (r258455) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri Nov 22 00:06:11 2013 (r258456) @@ -492,8 +492,14 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # files the user changed from the reference files. # if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then + # Force FreeBSD 9 compatible output when available. + if mtree -F freebsd9 -c -p /var/empty/ > /dev/null 2>&1; then + MTREE_FLAVOR="-F freebsd9" + else + MTREE_FLAVOR= + fi CHANGED=: - for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL ${MTREE_FLAVOR} -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 00:26:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79D3EA63; Fri, 22 Nov 2013 00:26:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 682F924B4; Fri, 22 Nov 2013 00:26:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM0QMuT028247; Fri, 22 Nov 2013 00:26:22 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM0QLIS028243; Fri, 22 Nov 2013 00:26:21 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201311220026.rAM0QLIS028243@svn.freebsd.org> From: David C Somayajulu Date: Fri, 22 Nov 2013 00:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258457 - in stable/10/sys/dev: qlxgbe qlxge X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 00:26:22 -0000 Author: davidcs Date: Fri Nov 22 00:26:21 2013 New Revision: 258457 URL: http://svnweb.freebsd.org/changeset/base/258457 Log: MFC r258155 ql_hw.[c,h]: set minimum thresholds on pkt size for lro path. ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP MFC r258156 qls_ioctl.c: Validate the buffer and its length passed to QLA_MPI_DUMP. copyout dump only if qls_mpi_core_dump() is successful. (like to credit x90c for pointing the issue) Approved by: re (delphij) Modified: stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_hw.h stable/10/sys/dev/qlxgbe/ql_ioctl.c stable/10/sys/dev/qlxge/qls_ioctl.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.c Fri Nov 22 00:06:11 2013 (r258456) +++ stable/10/sys/dev/qlxgbe/ql_hw.c Fri Nov 22 00:26:21 2013 (r258457) @@ -212,6 +212,12 @@ ql_hw_add_sysctls(qla_host_t *ha) "Number of Rcv Rings Entries to post before updating" " RDS Ring Producer Index"); + ha->hw.min_lro_pkt_size = 512; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "min_lro_pkt_size", CTLFLAG_RD, &ha->hw.min_lro_pkt_size, + ha->hw.min_lro_pkt_size, "minimum packet size to trigger lro"); + ha->hw.mdump_active = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1069,6 +1075,11 @@ qla_config_fw_lro(qla_host_t *ha, uint16 fw_lro->cntxt_id = cntxt_id; + if (ha->hw.min_lro_pkt_size) { + fw_lro->flags |= Q8_MBX_FW_LRO_LOW_THRESHOLD; + fw_lro->low_threshold = ha->hw.min_lro_pkt_size; + } + if (qla_mbx_cmd(ha, (uint32_t *)fw_lro, (sizeof (q80_config_fw_lro_t) >> 2), ha->hw.mbox, (sizeof (q80_config_fw_lro_rsp_t) >> 2), 0)) { Modified: stable/10/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.h Fri Nov 22 00:06:11 2013 (r258456) +++ stable/10/sys/dev/qlxgbe/ql_hw.h Fri Nov 22 00:26:21 2013 (r258457) @@ -568,9 +568,13 @@ typedef struct _q80_config_fw_lro { #define Q8_MBX_FW_LRO_IPV6 0x2 #define Q8_MBX_FW_LRO_IPV4_WO_DST_IP_CHK 0x4 #define Q8_MBX_FW_LRO_IPV6_WO_DST_IP_CHK 0x8 +#define Q8_MBX_FW_LRO_LOW_THRESHOLD 0x10 uint8_t rsrvd; uint16_t cntxt_id; + + uint16_t low_threshold; + uint16_t rsrvd0; } __packed q80_config_fw_lro_t; typedef struct _q80_config_fw_lro_rsp { @@ -1521,6 +1525,7 @@ typedef struct _qla_hw { uint32_t health_count; uint32_t max_tx_segs; + uint32_t min_lro_pkt_size; /* Flash Descriptor Table */ qla_flash_desc_table_t fdt; Modified: stable/10/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_ioctl.c Fri Nov 22 00:06:11 2013 (r258456) +++ stable/10/sys/dev/qlxgbe/ql_ioctl.c Fri Nov 22 00:26:21 2013 (r258457) @@ -223,6 +223,13 @@ ql_eioctl(struct cdev *dev, u_long cmd, } fw_dump = (qla_rd_fw_dump_t *)data; + + if ((fw_dump->md_template == NULL) || + (fw_dump->template_size != ha->hw.dma_buf.minidump.size)) { + rval = EINVAL; + break; + } + if ((rval = copyout(ha->hw.dma_buf.minidump.dma_b, fw_dump->md_template, fw_dump->template_size))) rval = ENXIO; Modified: stable/10/sys/dev/qlxge/qls_ioctl.c ============================================================================== --- stable/10/sys/dev/qlxge/qls_ioctl.c Fri Nov 22 00:06:11 2013 (r258456) +++ stable/10/sys/dev/qlxge/qls_ioctl.c Fri Nov 22 00:26:21 2013 (r258457) @@ -100,13 +100,16 @@ qls_eioctl(struct cdev *dev, u_long cmd, if (mpi_dump->size == 0) { mpi_dump->size = sizeof (qls_mpi_coredump_t); } else { - if (mpi_dump->size < sizeof (qls_mpi_coredump_t)) + if ((mpi_dump->size != sizeof (qls_mpi_coredump_t)) || + (mpi_dump->dbuf == NULL)) rval = EINVAL; else { - qls_mpi_core_dump(ha); - rval = copyout( &ql_mpi_coredump, - mpi_dump->dbuf, - mpi_dump->size); + if (qls_mpi_core_dump(ha) == 0) { + rval = copyout(&ql_mpi_coredump, + mpi_dump->dbuf, + mpi_dump->size); + } else + rval = ENXIO; if (rval) { device_printf(ha->pci_dev, From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 00:28: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C20BBFA; Fri, 22 Nov 2013 00:28:24 +0000 (UTC) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 495FF24C7; Fri, 22 Nov 2013 00:28:23 +0000 (UTC) Received: from mail57-tx2-R.bigfish.com (10.9.14.225) by TX2EHSOBE008.bigfish.com (10.9.40.28) with Microsoft SMTP Server id 14.1.225.22; Fri, 22 Nov 2013 00:13:07 +0000 Received: from mail57-tx2 (localhost [127.0.0.1]) by mail57-tx2-R.bigfish.com (Postfix) with ESMTP id 2288D120229; Fri, 22 Nov 2013 00:13:07 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.239.16; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF02-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 7 X-BigFish: VPS7(zz1432Izz1f42h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6h1082kzzz31h2a8h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1b88h224fh1fb3h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h222dm1155h) Received-SPF: softfail (mail57-tx2: transitioning domain of juniper.net does not designate 66.129.239.16 as permitted sender) client-ip=66.129.239.16; envelope-from=sjg@juniper.net; helo=P-EMF02-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail57-tx2 (localhost.localdomain [127.0.0.1]) by mail57-tx2 (MessageSwitch) id 1385079182770056_24750; Fri, 22 Nov 2013 00:13:02 +0000 (UTC) Received: from TX2EHSMHS012.bigfish.com (unknown [10.9.14.233]) by mail57-tx2.bigfish.com (Postfix) with ESMTP id 7E201E005B; Fri, 22 Nov 2013 00:13:01 +0000 (UTC) Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by TX2EHSMHS012.bigfish.com (10.9.99.112) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 22 Nov 2013 00:13:01 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Thu, 21 Nov 2013 16:13:00 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id rAM0CsL78811; Thu, 21 Nov 2013 16:12:58 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id C33AE5807E; Thu, 21 Nov 2013 16:12:52 -0800 (PST) To: Julio Merino Subject: Re: svn commit: r258285 - in head/lib/atf: libatf-c++/tests libatf-c/tests tests/test-programs In-Reply-To: References: <201311172312.rAHNCtOY010186@svn.freebsd.org> <20131119003307.9E25A5807E@chaos.jnpr.net> Comments: In-reply-to: Julio Merino message dated "Thu, 21 Nov 2013 18:29:15 -0500." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 21 Nov 2013 16:12:52 -0800 Message-ID: <20131122001252.C33AE5807E@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 00:28:24 -0000 On Thu, 21 Nov 2013 18:29:15 -0500, Julio Merino writes: >> Actually . or _ worked, until recently. > >I think only supporting one form is better in the name of simplicity. Generally I would agree. Originally I used '_' for this and a number of other things, but in many cases find that '.' makes for easier reading. >> Will fix. > >Garrett also mentioned to me that we should not be required to >explicitly set SRCS.*: when building various programs, each of them Being explicit doesn't hurt. From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 00:32:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF79DF23; Fri, 22 Nov 2013 00:32:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAAB32536; Fri, 22 Nov 2013 00:32:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM0WX5S031055; Fri, 22 Nov 2013 00:32:33 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM0WXKB031052; Fri, 22 Nov 2013 00:32:33 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311220032.rAM0WXKB031052@svn.freebsd.org> From: Devin Teske Date: Fri, 22 Nov 2013 00:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258458 - in head/usr.sbin/bsdconfig: networking networking/share share 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 00:32:33 -0000 Author: dteske Date: Fri Nov 22 00:32:32 2013 New Revision: 258458 URL: http://svnweb.freebsd.org/changeset/base/258458 Log: Improve network device scanning in the netdev module. First, make it use the `device.subr' framework (improving performane and reducing sub-shells). Next improve the `device.subr' framework itself. Make use of the `flags' device struct member for network interfaces to indicate if an interface is Active, Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks against the `flags' bit-field quick and efficient. Last, add function for rescanning the network to update the device registers. Remove an unnecessary local (ifn) while we're here (use already provided local `if'). Modified: head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Nov 22 00:26:21 2013 (r258457) +++ head/usr.sbin/bsdconfig/networking/devices Fri Nov 22 00:32:32 2013 (r258458) @@ -28,6 +28,12 @@ # ############################################################ INCLUDES +# Prevent device.subr (included indirectly) from auto scanning; this will be +# performed indirectly later via f_dialog_menu_netdev() -- but only after we've +# successfully completed f_mustberoot_init(). +# +DEVICE_SELF_SCAN_ALL=NO + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Nov 22 00:26:21 2013 (r258457) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Nov 22 00:32:32 2013 (r258458) @@ -74,8 +74,10 @@ f_dialog_menu_netdev() # # Get list of usable network interfaces # - local if iflist= # Calculated below - for if in $( ifconfig -l ); do + local devs if iflist= # Calculated below + f_device_rescan_network + f_device_find "" $DEVICE_TYPE_NETWORK devs + for if in $devs; do # Skip unsavory interfaces case "$if" in lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;; @@ -91,9 +93,8 @@ f_dialog_menu_netdev() if [ "$DIALOG_MENU_NETDEV_KICK_INTERFACES" ]; then DIALOG_MENU_NETDEV_KICK_INTERFACES= - local ifn - for ifn in $iflist; do - f_quietly ifconfig $ifn up + for if in $iflist; do + f_quietly ifconfig $if up done if [ "$DIALOG_MENU_NETDEV_SLEEP_AFTER_KICK" ]; then @@ -107,13 +108,14 @@ f_dialog_menu_netdev() # to the right of the device name. # menu_list=$( - for ifn in $iflist; do - active=$( ifconfig $ifn 2> /dev/null | awk ' - ($1 == "status:") { - if ($2 == "active") { print 1; exit } - }' ) - printf "'%s%s' '%s'\n" \ - $ifn "${active:+*}" "$( f_device_desc $ifn )" + for if in $iflist; do + f_device_desc $if $DEVICE_TYPE_NETWORK desc + f_shell_escape "$desc" desc + if f_device_is_active $if; then + printf "'%s\*' '%s'\n" $if "$desc" + else + printf "'%s' '%s'\n" $if "$desc" + fi done ) if [ ! "$menu_list" ]; then @@ -121,21 +123,14 @@ f_dialog_menu_netdev() return $DIALOG_CANCEL fi - # # Maybe the default item was marked as active - # - if [ "$defaultitem" ]; then - ifconfig "$defaultitem" 2> /dev/null | - awk '($1 == "status:" && $2 == "active"){exit 1}' || - defaultitem="$defaultitem*" - fi - - local hline="$hline_arrows_tab_enter" + f_device_is_active "$defaultitem" && defaultitem="$defaultitem*" # # Ask user to select an interface # local prompt="$msg_select_network_interface" + local hline="$hline_arrows_tab_enter" local height width rows eval f_dialog_menu_size height width rows \ \"\$DIALOG_TITLE\" \ Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Nov 22 00:26:21 2013 (r258457) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Nov 22 00:32:32 2013 (r258458) @@ -76,6 +76,11 @@ setvar DEVICE_TYPE_ANY 11 setvar DEVICE_TYPE_HTTP_PROXY 12 setvar DEVICE_TYPE_HTTP 13 +# Network devices have the following flags available +setvar IF_ETHERNET 1 +setvar IF_WIRELESS 2 +setvar IF_ACTIVE 4 + # # Default behavior is to call f_device_get_all() automatically when loaded. # @@ -175,6 +180,33 @@ f_device_reset() DEVICES= } +# f_device_reset_network +# +# Reset the registered network device chain. +# +f_device_reset_network() +{ + local dev type private pruned_list= + for dev in $DEVICES; do + device_$dev get type type + if [ "$type" != "$DEVICE_TYPE_NETWORK" ]; then + pruned_list="$pruned_list $dev" + continue + fi + + # + # Leave the device up (don't call shutdown routine) + # + + # Network devices may have DEVICE_INFO private member + device_$dev get private private + [ "$private" ] && f_struct_free "$private" + + f_struct_free device_$dev + done + DEVICES="${pruned_list# }" +} + # f_device_get_all # # Get all device information for devices we have attached. @@ -187,20 +219,7 @@ f_device_get_all() f_dialog_info "$msg_probing_devices_please_wait_this_can_take_a_while" # First go for the network interfaces - for devname in $( ifconfig -l ); do - # Eliminate network devices that don't make sense - case "$devname" in - lo*) continue ;; - esac - - # Try and find its description - f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc - - f_dprintf "Found a network device named %s" "$devname" - f_device_register $devname \ - "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ - f_media_init_network "" f_media_shutdown_network "" -1 - done + f_device_get_all_network # Next, try to find all the types of devices one might use # as a media source for content @@ -378,6 +397,48 @@ f_device_get_all() done # disks } +# f_device_get_all_network +# +# Get all network device information for attached network devices. +# +f_device_get_all_network() +{ + local devname desc flags + for devname in $( ifconfig -l ); do + # Eliminate network devices that don't make sense + case "$devname" in + lo*) continue ;; + esac + + # Try and find its description + f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc + + f_dprintf "Found a network device named %s" "$devname" + f_device_register $devname \ + "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ + f_media_init_network "" f_media_shutdown_network "" -1 + + # Set flags based on media and status + flags=0 + eval "$( ifconfig $devname 2> /dev/null | awk -v var=flags ' + function _or(var, mask) { + printf "%s=$(( $%s | $%s ))\n", var, var, mask + } + BEGIN { S = "[[:space:]]+" } + { + if (!match($0, "^" S "(media|status):" S)) next + value = substr($0, RLENGTH + 1) + if ($1 == "media:") { + if (value ~ /Ethernet/) _or(var, "IF_ETHERNET") + if (value ~ /802\.11/) _or(var, "IF_WIRELESS") + } else if ($1 == "status:") { + if (value ~ /^active/) _or(var, "IF_ACTIVE") + } + }' )" + device_$devname set flags $flags + done +} + # f_device_name_get $type $name type|desc|max [$var_to_set] # # Fetch the device type (type), description (desc), or maximum number of @@ -571,6 +632,72 @@ f_device_desc() return $FAILURE } +# f_device_is_ethernet $device +# +# Returns true if $device is a wired Ethernet network interface. Otherwise +# returns false. Example wired interfaces include: fxp0 em0 bge0 rl0 etc. +# +f_device_is_ethernet() +{ + local dev="$1" type flags + + # Make sure we have an actual device by that name + f_struct "device_$dev" || return $FAILURE + + # Make sure that the device is a network device + device_$dev get type type + [ "$type" = "$DEVICE_TYPE_NETWORK" ] || return $FAILURE + + # Make sure that the media flags indicate that it is Ethernet + device_$dev get flags flags + [ $(( ${flags:-0} & $IF_ETHERNET )) -eq $IF_ETHERNET ] +} + +# f_device_is_wireless $device +# +# Returns true if $device is a Wireless network interface. Otherwise returns +# false. Examples of wireless interfaces include: iwn0 +# +f_device_is_wireless() +{ + local dev="$1" type flags + + # Make sure we have an actual device by that name + f_struct "device_$dev" || return $FAILURE + + # Make sure that the device is a network device + device_$dev get type type + [ "$type" = "$DEVICE_TYPE_NETWORK" ] || return $FAILURE + + # Make sure that the media flags indicate that it is Ethernet + device_$dev get flags flags + [ $(( ${flags:-0} & $IF_WIRELESS )) -eq $IF_WIRELESS ] +} + +# f_device_is_active $device +# +# Returns true if $device is active. Otherwise returns false. Currently this +# only works for network interfaces. +# +f_device_is_active() +{ + local dev="$1" type flags=0 + + # Make sure we have an actual device by that name + f_struct "device_$dev" || return $FAILURE + + device_$dev get type type + case "$type" in + $DEVICE_TYPE_NETWORK) + # Make sure that the media flags indicate that it is active + device_$dev get flags flags + [ $(( ${flags:-0} & $IF_ACTIVE )) -eq $IF_ACTIVE ] + ;; + *) + return $FAILURE + esac +} + # f_device_rescan # # Rescan all devices, after closing previous set - convenience function. @@ -581,6 +708,16 @@ f_device_rescan() f_device_get_all } +# f_device_rescan_network +# +# Rescan all network devices, after closing previous set - for convenience. +# +f_device_rescan_network() +{ + f_device_reset_network + f_device_get_all_network +} + # f_device_find $name [$type [$var_to_set]] # # Find one or more registered devices by name, type, or both. Returns a space- From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 04:57:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DE8FAF5; Fri, 22 Nov 2013 04:57:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E09F27AD; Fri, 22 Nov 2013 04:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM4vp4C019391; Fri, 22 Nov 2013 04:57:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM4vpbW019390; Fri, 22 Nov 2013 04:57:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220457.rAM4vpbW019390@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 04:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258463 - head/sys/netpfil/ipfw 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 04:57:51 -0000 Author: luigi Date: Fri Nov 22 04:57:50 2013 New Revision: 258463 URL: http://svnweb.freebsd.org/changeset/base/258463 Log: make ipfw_check_packet() and ipfw_check_frame() public, so they can be used in the userspace version of ipfw/dummynet (normally using netmap for the I/O path). This is the first of a few commits to ease compiling the ipfw kernel code in userspace. Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 22 04:05:24 2013 (r258462) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 22 04:57:50 2013 (r258463) @@ -82,9 +82,9 @@ int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); /* Forward declarations. */ static int ipfw_divert(struct mbuf **, int, struct ipfw_rule_ref *, int); -static int ipfw_check_packet(void *, struct mbuf **, struct ifnet *, int, +int ipfw_check_packet(void *, struct mbuf **, struct ifnet *, int, struct inpcb *); -static int ipfw_check_frame(void *, struct mbuf **, struct ifnet *, int, +int ipfw_check_frame(void *, struct mbuf **, struct ifnet *, int, struct inpcb *); #ifdef SYSCTL_NODE @@ -116,7 +116,7 @@ SYSEND * dummynet, divert, netgraph or other modules. * The packet may be consumed. */ -static int +int ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) { @@ -292,7 +292,7 @@ again: * Inteface is NULL from ether_demux, and ifp from * ether_output_frame. */ -static int +int ipfw_check_frame(void *arg, struct mbuf **m0, struct ifnet *dst, int dir, struct inpcb *inp) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 04:59: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4CB0C62; Fri, 22 Nov 2013 04:59:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4E9527BD; Fri, 22 Nov 2013 04:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM4xHNa019594; Fri, 22 Nov 2013 04:59:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM4xHSJ019593; Fri, 22 Nov 2013 04:59:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220459.rAM4xHSJ019593@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 04:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258464 - head/sys/netpfil/ipfw 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 04:59:17 -0000 Author: luigi Date: Fri Nov 22 04:59:17 2013 New Revision: 258464 URL: http://svnweb.freebsd.org/changeset/base/258464 Log: more support for userspace compiling of this code: emulate the uma_zone for dynamic rules. Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:57:50 2013 (r258463) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:59:17 2013 (r258464) @@ -181,6 +181,13 @@ static VNET_DEFINE(u_int32_t, dyn_max); #define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) #define V_dyn_max VNET(dyn_max) +/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ +static int ipfw_dyn_count; /* number of objects */ + +#ifdef USERSPACE /* emulation of UMA object counters for userspace */ +#define uma_zone_get_cur(x) ipfw_dyn_count +#endif /* USERSPACE */ + static int last_log; /* Log ratelimiting */ static void ipfw_dyn_tick(void *vnetx); @@ -579,6 +586,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in } return NULL; } + ipfw_dyn_count++; /* * refcount on parent is already incremented, so @@ -1253,11 +1261,13 @@ check_dyn_rules(struct ip_fw_chain *chai for (q = exp_head; q != NULL; q = q_next) { q_next = q->next; uma_zfree(V_ipfw_dyn_rule_zone, q); + ipfw_dyn_count--; } for (q = exp_lhead; q != NULL; q = q_next) { q_next = q->next; uma_zfree(V_ipfw_dyn_rule_zone, q); + ipfw_dyn_count--; } /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 05:00: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB70FDD7; Fri, 22 Nov 2013 05:00:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBD0027D2; Fri, 22 Nov 2013 05:00:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM50IAh021435; Fri, 22 Nov 2013 05:00:18 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM50Iha021434; Fri, 22 Nov 2013 05:00:18 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220500.rAM50Iha021434@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 05:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258465 - head/sys/netpfil/ipfw 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 05:00:19 -0000 Author: luigi Date: Fri Nov 22 05:00:18 2013 New Revision: 258465 URL: http://svnweb.freebsd.org/changeset/base/258465 Log: make this code compile in userspace on OSX Modified: head/sys/netpfil/ipfw/ip_fw_log.c Modified: head/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_log.c Fri Nov 22 04:59:17 2013 (r258464) +++ head/sys/netpfil/ipfw/ip_fw_log.c Fri Nov 22 05:00:18 2013 (r258465) @@ -85,8 +85,15 @@ __FBSDID("$FreeBSD$"); #define ICMP(p) ((struct icmphdr *)(p)) #define ICMP6(p) ((struct icmp6_hdr *)(p)) +#ifdef __APPLE__ +#undef snprintf +#define snprintf sprintf +#define SNPARGS(buf, len) buf + len +#define SNP(buf) buf +#else /* !__APPLE__ */ #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 #define SNP(buf) buf, sizeof(buf) +#endif /* !__APPLE__ */ #ifdef WITHOUT_BPF void From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 05:01:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76314FCB; Fri, 22 Nov 2013 05:01:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C915280D; Fri, 22 Nov 2013 05:01:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM51dEk022241; Fri, 22 Nov 2013 05:01:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM51dTb022240; Fri, 22 Nov 2013 05:01:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220501.rAM51dTb022240@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 05:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258466 - head/sys/netpfil/ipfw 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 05:01:39 -0000 Author: luigi Date: Fri Nov 22 05:01:38 2013 New Revision: 258466 URL: http://svnweb.freebsd.org/changeset/base/258466 Log: disable some ipfw match options when compiling in userspace Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 22 05:00:18 2013 (r258465) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 22 05:01:38 2013 (r258466) @@ -370,7 +370,7 @@ iface_match(struct ifnet *ifp, ipfw_insn return(1); } } else { -#ifdef __FreeBSD__ /* and OSX too ? */ +#if !defined(USERSPACE) && defined(__FreeBSD__) /* and OSX too ? */ struct ifaddr *ia; if_addr_rlock(ifp); @@ -413,7 +413,7 @@ iface_match(struct ifnet *ifp, ipfw_insn static int verify_path(struct in_addr src, struct ifnet *ifp, u_int fib) { -#ifndef __FreeBSD__ +#if defined(USERSPACE) || !defined(__FreeBSD__) return 0; #else struct route ro; @@ -664,6 +664,9 @@ static int check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp, struct ucred **uc) { +#if defined(USERSPACE) + return 0; // not supported in userspace +#else #ifndef __FreeBSD__ /* XXX */ return cred_check(insn, proto, oif, @@ -766,6 +769,7 @@ check_uidgid(ipfw_insn_u32 *insn, struct match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]); return (match); #endif /* __FreeBSD__ */ +#endif /* not supported in userspace */ } /* @@ -1464,6 +1468,7 @@ do { \ key = htonl(dst_port); else if (v == 3) key = htonl(src_port); +#ifndef USERSPACE else if (v == 4 || v == 5) { check_uidgid( (ipfw_insn_u32 *)cmd, @@ -1483,6 +1488,7 @@ do { \ #endif /* !__FreeBSD__ */ key = htonl(key); } else +#endif /* !USERSPACE */ break; } match = ipfw_lookup_table(chain, @@ -1946,6 +1952,7 @@ do { \ break; case O_SOCKARG: { +#ifndef USERSPACE /* not supported in userspace */ struct inpcb *inp = args->inp; struct inpcbinfo *pi; @@ -1986,6 +1993,7 @@ do { \ match = 1; } } +#endif /* !USERSPACE */ break; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 05:02: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE4D91B1; Fri, 22 Nov 2013 05:02:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A438F2817; Fri, 22 Nov 2013 05:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM52cLl022445; Fri, 22 Nov 2013 05:02:38 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM52cEr022439; Fri, 22 Nov 2013 05:02:38 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220502.rAM52cEr022439@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 05:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258467 - head/sys/netpfil/ipfw 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 05:02:38 -0000 Author: luigi Date: Fri Nov 22 05:02:37 2013 New Revision: 258467 URL: http://svnweb.freebsd.org/changeset/base/258467 Log: add a counter on the struct mq (a queue of mbufs), and add a block for userspace compiling. Modified: head/sys/netpfil/ipfw/dn_sched.h head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_dn_private.h Modified: head/sys/netpfil/ipfw/dn_sched.h ============================================================================== --- head/sys/netpfil/ipfw/dn_sched.h Fri Nov 22 05:01:38 2013 (r258466) +++ head/sys/netpfil/ipfw/dn_sched.h Fri Nov 22 05:02:37 2013 (r258467) @@ -166,6 +166,7 @@ dn_dequeue(struct dn_queue *q) if (m == NULL) return NULL; q->mq.head = m->m_nextpkt; + q->mq.count--; /* Update stats for the queue */ q->ni.length--; Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Fri Nov 22 05:01:38 2013 (r258466) +++ head/sys/netpfil/ipfw/ip_dn_io.c Fri Nov 22 05:02:37 2013 (r258467) @@ -260,10 +260,39 @@ dn_tag_get(struct mbuf *m) static inline void mq_append(struct mq *q, struct mbuf *m) { +#ifdef USERSPACE + // buffers from netmap need to be copied + // XXX note that the routine is not expected to fail + ND("append %p to %p", m, q); + if (m->m_flags & M_STACK) { + struct mbuf *m_new; + void *p; + int l, ofs; + + ofs = m->m_data - m->__m_extbuf; + // XXX allocate + MGETHDR(m_new, M_NOWAIT, MT_DATA); + ND("*** WARNING, volatile buf %p ext %p %d dofs %d m_new %p", + m, m->__m_extbuf, m->__m_extlen, ofs, m_new); + p = m_new->__m_extbuf; /* new pointer */ + l = m_new->__m_extlen; /* new len */ + if (l <= m->__m_extlen) { + panic("extlen too large"); + } + + *m_new = *m; // copy + m_new->m_flags &= ~M_STACK; + m_new->__m_extbuf = p; // point to new buffer + pkt_copy(m->__m_extbuf, p, m->__m_extlen); + m_new->m_data = p + ofs; + m = m_new; + } +#endif /* USERSPACE */ if (q->head == NULL) q->head = m; else q->tail->m_nextpkt = m; + q->count++; q->tail = m; m->m_nextpkt = NULL; } @@ -455,6 +484,7 @@ transmit_event(struct mq *q, struct dela if (!DN_KEY_LEQ(pkt->output_time, now)) break; dline->mq.head = m->m_nextpkt; + dline->mq.count--; mq_append(q, m); } if (m != NULL) { Modified: head/sys/netpfil/ipfw/ip_dn_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_private.h Fri Nov 22 05:01:38 2013 (r258466) +++ head/sys/netpfil/ipfw/ip_dn_private.h Fri Nov 22 05:02:37 2013 (r258467) @@ -83,6 +83,7 @@ SLIST_HEAD(dn_alg_head, dn_alg); struct mq { /* a basic queue of packets*/ struct mbuf *head, *tail; + int count; }; static inline void From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 10:45: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B760FD2; Fri, 22 Nov 2013 10:45:02 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8009B293E; Fri, 22 Nov 2013 10:45:00 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rAMAixYG087710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Nov 2013 14:44:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rAMAix9H087709; Fri, 22 Nov 2013 14:44:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 22 Nov 2013 14:44:59 +0400 From: Gleb Smirnoff To: Luigi Rizzo Subject: Re: svn commit: r258464 - head/sys/netpfil/ipfw Message-ID: <20131122104459.GD7577@FreeBSD.org> References: <201311220459.rAM4xHSJ019593@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311220459.rAM4xHSJ019593@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 10:45:02 -0000 Luigi, On Fri, Nov 22, 2013 at 04:59:17AM +0000, Luigi Rizzo wrote: L> Author: luigi L> Date: Fri Nov 22 04:59:17 2013 L> New Revision: 258464 L> URL: http://svnweb.freebsd.org/changeset/base/258464 L> L> Log: L> more support for userspace compiling of this code: L> emulate the uma_zone for dynamic rules. Why isn't the ipfw_dyn_count variable entirely under USERSPACE? We are working in direction of removing global counters in networking stack, and this change is a step back. L> Modified: L> head/sys/netpfil/ipfw/ip_fw_dynamic.c L> L> Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c L> ============================================================================== L> --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:57:50 2013 (r258463) L> +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 22 04:59:17 2013 (r258464) L> @@ -181,6 +181,13 @@ static VNET_DEFINE(u_int32_t, dyn_max); L> #define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) L> #define V_dyn_max VNET(dyn_max) L> L> +/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ L> +static int ipfw_dyn_count; /* number of objects */ L> + L> +#ifdef USERSPACE /* emulation of UMA object counters for userspace */ L> +#define uma_zone_get_cur(x) ipfw_dyn_count L> +#endif /* USERSPACE */ L> + L> static int last_log; /* Log ratelimiting */ L> L> static void ipfw_dyn_tick(void *vnetx); L> @@ -579,6 +586,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in L> } L> return NULL; L> } L> + ipfw_dyn_count++; L> L> /* L> * refcount on parent is already incremented, so L> @@ -1253,11 +1261,13 @@ check_dyn_rules(struct ip_fw_chain *chai L> for (q = exp_head; q != NULL; q = q_next) { L> q_next = q->next; L> uma_zfree(V_ipfw_dyn_rule_zone, q); L> + ipfw_dyn_count--; L> } L> L> for (q = exp_lhead; q != NULL; q = q_next) { L> q_next = q->next; L> uma_zfree(V_ipfw_dyn_rule_zone, q); L> + ipfw_dyn_count--; L> } L> L> /* -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 10:45: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1D6B28D; Fri, 22 Nov 2013 10:45:48 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22C8D2953; Fri, 22 Nov 2013 10:45:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rAMAjkRg087728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Nov 2013 14:45:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rAMAjk2C087727; Fri, 22 Nov 2013 14:45:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 22 Nov 2013 14:45:46 +0400 From: Gleb Smirnoff To: Luigi Rizzo Subject: Re: svn commit: r258463 - head/sys/netpfil/ipfw Message-ID: <20131122104546.GE7577@FreeBSD.org> References: <201311220457.rAM4vpbW019390@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201311220457.rAM4vpbW019390@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 10:45:48 -0000 Luigi, On Fri, Nov 22, 2013 at 04:57:51AM +0000, Luigi Rizzo wrote: L> Author: luigi L> Date: Fri Nov 22 04:57:50 2013 L> New Revision: 258463 L> URL: http://svnweb.freebsd.org/changeset/base/258463 L> L> Log: L> make ipfw_check_packet() and ipfw_check_frame() public, L> so they can be used in the userspace version of ipfw/dummynet L> (normally using netmap for the I/O path). L> L> This is the first of a few commits to ease compiling the L> ipfw kernel code in userspace. Is it possible to put the static word under #ifndef USERSPACE? Or do we want to expose these functions to the rest of kernel? L> Modified: L> head/sys/netpfil/ipfw/ip_fw_pfil.c L> L> Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c L> ============================================================================== L> --- head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 22 04:05:24 2013 (r258462) L> +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 22 04:57:50 2013 (r258463) L> @@ -82,9 +82,9 @@ int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); L> L> /* Forward declarations. */ L> static int ipfw_divert(struct mbuf **, int, struct ipfw_rule_ref *, int); L> -static int ipfw_check_packet(void *, struct mbuf **, struct ifnet *, int, L> +int ipfw_check_packet(void *, struct mbuf **, struct ifnet *, int, L> struct inpcb *); L> -static int ipfw_check_frame(void *, struct mbuf **, struct ifnet *, int, L> +int ipfw_check_frame(void *, struct mbuf **, struct ifnet *, int, L> struct inpcb *); L> L> #ifdef SYSCTL_NODE L> @@ -116,7 +116,7 @@ SYSEND L> * dummynet, divert, netgraph or other modules. L> * The packet may be consumed. L> */ L> -static int L> +int L> ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, L> struct inpcb *inp) L> { L> @@ -292,7 +292,7 @@ again: L> * Inteface is NULL from ether_demux, and ifp from L> * ether_output_frame. L> */ L> -static int L> +int L> ipfw_check_frame(void *arg, struct mbuf **m0, struct ifnet *dst, int dir, L> struct inpcb *inp) L> { -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 12:09: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DC5B79A; Fri, 22 Nov 2013 12:09:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC022051; Fri, 22 Nov 2013 12:09:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMC9GYJ067917; Fri, 22 Nov 2013 12:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMC9GTk067916; Fri, 22 Nov 2013 12:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311221209.rAMC9GTk067916@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 22 Nov 2013 12:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258469 - head/sbin/swapon 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 12:09:16 -0000 Author: pluknet Date: Fri Nov 22 12:09:15 2013 New Revision: 258469 URL: http://svnweb.freebsd.org/changeset/base/258469 Log: - Purge one more reference to ad(4)[1]. - NSWAPDEV limit has gone. Noticed by: Sergey V. Dyatko [1] MFC after: 1 week Modified: head/sbin/swapon/swapon.8 Modified: head/sbin/swapon/swapon.8 ============================================================================== --- head/sbin/swapon/swapon.8 Fri Nov 22 05:25:03 2013 (r258468) +++ head/sbin/swapon/swapon.8 Fri Nov 22 12:09:15 2013 (r258469) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 21, 2013 +.Dd November 22, 2013 .Dt SWAPON 8 .Os .Sh NAME @@ -60,9 +60,7 @@ At boot time all swap entries in .Pa /etc/fstab are added automatically when the system goes multi-user. Swap devices use a fixed interleave; the maximum number of devices -is specified by the kernel configuration option -.Dv NSWAPDEV , -which is typically set to 4. +is unlimited. There is no priority mechanism. .Pp The @@ -193,8 +191,8 @@ overridden. 512 byte blocks are used by default. .El .Sh FILES -.Bl -tag -width ".Pa /dev/{ad,da}?s?b" -compact -.It Pa /dev/{ad,da}?s?b +.Bl -tag -width ".Pa /dev/{ada,da}?s?b" -compact +.It Pa /dev/{ada,da}?s?b standard paging devices .It Pa /dev/md? memory disk devices From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 12:51:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDD77123; Fri, 22 Nov 2013 12:51:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD72A22C0; Fri, 22 Nov 2013 12:51:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMCptem083554; Fri, 22 Nov 2013 12:51:55 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMCptns083553; Fri, 22 Nov 2013 12:51:55 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201311221251.rAMCptns083553@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 22 Nov 2013 12:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258470 - stable/10 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 12:51:56 -0000 Author: tijl Date: Fri Nov 22 12:51:55 2013 New Revision: 258470 URL: http://svnweb.freebsd.org/changeset/base/258470 Log: MFC r258318: Also delete lib32 libiconv. Reported by: Tomoaki AOKI MFC r258345: One more BIND remnant: /etc/mtree/BIND.chroot.dist Discussed with: des Approved by: re (kib) Modified: stable/10/ObsoleteFiles.inc (contents, props changed) Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Nov 22 12:09:15 2013 (r258469) +++ stable/10/ObsoleteFiles.inc Fri Nov 22 12:51:55 2013 (r258470) @@ -47,6 +47,10 @@ OLD_FILES+=usr/lib/libiconv.a OLD_FILES+=usr/lib/libiconv.so OLD_FILES+=usr/lib/libiconv.so.3 OLD_FILES+=usr/lib/libiconv_p.a +OLD_FILES+=usr/lib32/libiconv.a +OLD_FILES+=usr/lib32/libiconv.so +OLD_FILES+=usr/lib32/libiconv.so.3 +OLD_FILES+=usr/lib32/libiconv_p.a # 20131030: /etc/keys moved to /usr/share/keys OLD_DIRS+=etc/keys OLD_DIRS+=etc/keys/pkg @@ -91,6 +95,7 @@ OLD_FILES+=usr/bin/gnu-ranlib OLD_FILES+=usr/share/man/man1/gnu-ar.1.gz OLD_FILES+=usr/share/man/man1/gnu-ranlib.1.gz # 20130930: BIND removed from base +OLD_FILES+=etc/mtree/BIND.chroot.dist OLD_FILES+=etc/namedb OLD_FILES+=etc/periodic/daily/470.status-named OLD_FILES+=usr/bin/dig From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 14:56:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9417F82D; Fri, 22 Nov 2013 14:56:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83BAD2978; Fri, 22 Nov 2013 14:56:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMEuA3f025774; Fri, 22 Nov 2013 14:56:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMEuA9L025773; Fri, 22 Nov 2013 14:56:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311221456.rAMEuA9L025773@svn.freebsd.org> From: Ed Maste Date: Fri, 22 Nov 2013 14:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258471 - head/sys/amd64/amd64 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 14:56:10 -0000 Author: emaste Date: Fri Nov 22 14:56:10 2013 New Revision: 258471 URL: http://svnweb.freebsd.org/changeset/base/258471 Log: Don't abort SMAP processing after an entry of length 0 Length 0 is not special and should just be skipped. This is the same behaviour as i386. Discussed with: jhb@ Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Nov 22 12:51:55 2013 (r258470) +++ head/sys/amd64/amd64/machdep.c Fri Nov 22 14:56:10 2013 (r258471) @@ -1336,7 +1336,7 @@ add_physmap_entry(uint64_t base, uint64_ physmap_idx = *physmap_idxp; if (length == 0) - return (0); + return (1); /* * Find insertion point while checking for overlap. Start off by From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 17:54: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B460F6B0; Fri, 22 Nov 2013 17:54:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89B8923C9; Fri, 22 Nov 2013 17:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMHssA9085269; Fri, 22 Nov 2013 17:54:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMHssIV085268; Fri, 22 Nov 2013 17:54:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201311221754.rAMHssIV085268@svn.freebsd.org> From: Dimitry Andric Date: Fri, 22 Nov 2013 17:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258472 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 17:54:54 -0000 Author: dim Date: Fri Nov 22 17:54:53 2013 New Revision: 258472 URL: http://svnweb.freebsd.org/changeset/base/258472 Log: Revert r258455 for now, as it apparently causes miscompilation in some situations. Until this is fully resolved, the X.org workaround in ports still needs to take place. Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Nov 22 14:56:10 2013 (r258471) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Nov 22 17:54:53 2013 (r258472) @@ -2449,15 +2449,21 @@ X86TargetLowering::LowerCall(TargetLower RegsToPass.push_back(std::make_pair(unsigned(X86::EBX), DAG.getNode(X86ISD::GlobalBaseReg, DebugLoc(), getPointerTy()))); } else { - // If we are tail calling a global or external symbol in GOT pic mode, we - // cannot use a direct jump, since that would make lazy dynamic linking - // impossible (see PR15086). So pretend this is not a tail call, to - // prevent the optimization to a jump. + // If we are tail calling and generating PIC/GOT style code load the + // address of the callee into ECX. The value in ecx is used as target of + // the tail jump. This is done to circumvent the ebx/callee-saved problem + // for tail calls on PIC/GOT architectures. Normally we would just put the + // address of GOT into ebx and then call target@PLT. But for tail calls + // ebx would be restored (since ebx is callee saved) before jumping to the + // target@PLT. + + // Note: The actual moving to ECX is done further down. GlobalAddressSDNode *G = dyn_cast(Callee); - if ((G && !G->getGlobal()->hasHiddenVisibility() && - !G->getGlobal()->hasProtectedVisibility()) || - isa(Callee)) - isTailCall = false; + if (G && !G->getGlobal()->hasHiddenVisibility() && + !G->getGlobal()->hasProtectedVisibility()) + Callee = LowerGlobalAddress(Callee, DAG); + else if (isa(Callee)) + Callee = LowerExternalSymbol(Callee, DAG); } } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 18:31: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7046FE8A; Fri, 22 Nov 2013 18:31:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7D52617; Fri, 22 Nov 2013 18:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMIV8dG098515; Fri, 22 Nov 2013 18:31:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMIV8QM098514; Fri, 22 Nov 2013 18:31:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201311221831.rAMIV8QM098514@svn.freebsd.org> From: Ed Maste Date: Fri, 22 Nov 2013 18:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258473 - head/sys/i386/i386 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 18:31:08 -0000 Author: emaste Date: Fri Nov 22 18:31:07 2013 New Revision: 258473 URL: http://svnweb.freebsd.org/changeset/base/258473 Log: Refactor i386 startup SMAP parsing This is a port from amd64 of r258436, and is intended to make diffs (against amd64 and for future UEFI work) easier to review. Reviewed by: jhb@ Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Nov 22 17:54:53 2013 (r258472) +++ head/sys/i386/i386/machdep.c Fri Nov 22 18:31:07 2013 (r258473) @@ -2002,26 +2002,20 @@ sdtossd(sd, ssd) #ifndef XEN static int -add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, + int *physmap_idxp) { int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; - if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016llx len=%016llx\n", - smap->type, smap->base, smap->length); - - if (smap->type != SMAP_TYPE_MEMORY) - return (1); - - if (smap->length == 0) + if (length == 0) return (1); #ifndef PAE - if (smap->base > 0xffffffff) { + if (base > 0xffffffff) { printf("%uK of memory above 4GB ignored\n", - (u_int)(smap->length / 1024)); + (u_int)(length / 1024)); return (1); } #endif @@ -2032,8 +2026,8 @@ add_smap_entry(struct bios_smap *smap, v */ insert_idx = physmap_idx + 2; for (i = 0; i <= physmap_idx; i += 2) { - if (smap->base < physmap[i + 1]) { - if (smap->base + smap->length <= physmap[i]) { + if (base < physmap[i + 1]) { + if (base + length <= physmap[i]) { insert_idx = i; break; } @@ -2045,15 +2039,14 @@ add_smap_entry(struct bios_smap *smap, v } /* See if we can prepend to the next entry. */ - if (insert_idx <= physmap_idx && - smap->base + smap->length == physmap[insert_idx]) { - physmap[insert_idx] = smap->base; + if (insert_idx <= physmap_idx && base + length == physmap[insert_idx]) { + physmap[insert_idx] = base; return (1); } /* See if we can append to the previous entry. */ - if (insert_idx > 0 && smap->base == physmap[insert_idx - 1]) { - physmap[insert_idx - 1] += smap->length; + if (insert_idx > 0 && base == physmap[insert_idx - 1]) { + physmap[insert_idx - 1] += length; return (1); } @@ -2075,11 +2068,46 @@ add_smap_entry(struct bios_smap *smap, v } /* Insert the new entry. */ - physmap[insert_idx] = smap->base; - physmap[insert_idx + 1] = smap->base + smap->length; + physmap[insert_idx] = base; + physmap[insert_idx + 1] = base + length; return (1); } +static int +add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) +{ + if (boothowto & RB_VERBOSE) + printf("SMAP type=%02x base=%016llx len=%016llx\n", + smap->type, smap->base, smap->length); + + if (smap->type != SMAP_TYPE_MEMORY) + return (1); + + return (add_physmap_entry(smap->base, smap->length, physmap, + physmap_idxp)); +} + +static void +add_smap_entries(struct bios_smap *smapbase, vm_paddr_t *physmap, + int *physmap_idxp) +{ + struct bios_smap *smap, *smapend; + u_int32_t smapsize; + /* + * Memory map from INT 15:E820. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes SMAP. + */ + smapsize = *((u_int32_t *)smapbase - 1); + smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); + + for (smap = smapbase; smap < smapend; smap++) + if (!add_smap_entry(smap, physmap, physmap_idxp)) + break; +} + static void basemem_setup(void) { @@ -2156,8 +2184,7 @@ getmemsize(int first) struct vm86frame vmf; struct vm86context vmc; vm_paddr_t pa; - struct bios_smap *smap, *smapbase, *smapend; - u_int32_t smapsize; + struct bios_smap *smap, *smapbase; caddr_t kmdp; #endif @@ -2199,18 +2226,8 @@ getmemsize(int first) smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { - /* - * subr_module.c says: - * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes SMAP. - */ - smapsize = *((u_int32_t *)smapbase - 1); - smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); + add_smap_entries(smapbase, physmap, &physmap_idx); has_smap = 1; - - for (smap = smapbase; smap < smapend; smap++) - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; goto have_smap; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 18:53:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECAC2584; Fri, 22 Nov 2013 18:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBDA3273A; Fri, 22 Nov 2013 18:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMIrs5u005784; Fri, 22 Nov 2013 18:53:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMIrsKY005783; Fri, 22 Nov 2013 18:53:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201311221853.rAMIrsKY005783@svn.freebsd.org> From: Neel Natu Date: Fri, 22 Nov 2013 18:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258474 - head/usr.sbin/acpi/acpidump 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 18:53:55 -0000 Author: neel Date: Fri Nov 22 18:53:54 2013 New Revision: 258474 URL: http://svnweb.freebsd.org/changeset/base/258474 Log: Teach acpidump(8) to display the 'Flags' field in the HPET Description Table. Reviewed by: jhb@ Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Nov 22 18:31:07 2013 (r258473) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Nov 22 18:53:54 2013 (r258474) @@ -501,6 +501,7 @@ acpi_handle_hpet(ACPI_TABLE_HEADER *sdp) printf("FALSE}\n"); printf("\tPCI Vendor ID=0x%04x\n", hpet->Id >> 16); printf("\tMinimal Tick=%d\n", hpet->MinimumTick); + printf("\tFlags=0x%02x\n", hpet->Flags); printf(END_COMMENT); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 18:54: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 772296BB; Fri, 22 Nov 2013 18:54:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66BD4273B; Fri, 22 Nov 2013 18:54:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMIs78r005863; Fri, 22 Nov 2013 18:54:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMIs7kZ005862; Fri, 22 Nov 2013 18:54:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221854.rAMIs7kZ005862@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 18:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258475 - head/sys/netpfil/pf 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 18:54:07 -0000 Author: glebius Date: Fri Nov 22 18:54:06 2013 New Revision: 258475 URL: http://svnweb.freebsd.org/changeset/base/258475 Log: Style: don't compare unsigned <= 0. Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Nov 22 18:53:54 2013 (r258474) +++ head/sys/netpfil/pf/pf.c Fri Nov 22 18:54:06 2013 (r258475) @@ -1471,7 +1471,7 @@ pf_purge_expired_src_nodes() for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) - if (cur->states <= 0 && cur->expire <= time_uptime) { + if (cur->states == 0 && cur->expire <= time_uptime) { if (cur->rule.ptr != NULL) cur->rule.ptr->src_nodes--; LIST_REMOVE(cur, entry); @@ -1492,7 +1492,7 @@ pf_src_tree_remove_state(struct pf_state if (s->src_node != NULL) { if (s->src.tcp_est) --s->src_node->conn; - if (--s->src_node->states <= 0) { + if (--s->src_node->states == 0) { timeout = s->rule.ptr->timeout[PFTM_SRC_NODE]; if (!timeout) timeout = @@ -1501,7 +1501,7 @@ pf_src_tree_remove_state(struct pf_state } } if (s->nat_src_node != s->src_node && s->nat_src_node != NULL) { - if (--s->nat_src_node->states <= 0) { + if (--s->nat_src_node->states == 0) { timeout = s->rule.ptr->timeout[PFTM_SRC_NODE]; if (!timeout) timeout = From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 18:57: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC652904; Fri, 22 Nov 2013 18:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A760B2776; Fri, 22 Nov 2013 18:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMIvRmu006345; Fri, 22 Nov 2013 18:57:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMIvRDd006344; Fri, 22 Nov 2013 18:57:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221857.rAMIvRDd006344@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 18:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258477 - head/sys/netpfil/pf 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 18:57:27 -0000 Author: glebius Date: Fri Nov 22 18:57:27 2013 New Revision: 258477 URL: http://svnweb.freebsd.org/changeset/base/258477 Log: Fix off by ones when scanning source nodes hash. Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Nov 22 18:57:22 2013 (r258476) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Nov 22 18:57:27 2013 (r258477) @@ -3081,7 +3081,7 @@ DIOCCHANGEADDR_error: uint32_t i, nr = 0; if (psn->psn_len == 0) { - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -3093,7 +3093,7 @@ DIOCCHANGEADDR_error: } p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK); - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -3385,7 +3385,7 @@ pf_clear_srcnodes(struct pf_src_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 18:57:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EB238F9; Fri, 22 Nov 2013 18:57:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54C7A2772; Fri, 22 Nov 2013 18:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMIvNb1006302; Fri, 22 Nov 2013 18:57:23 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMIvNE0006301; Fri, 22 Nov 2013 18:57:23 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201311221857.rAMIvNE0006301@svn.freebsd.org> From: Neel Natu Date: Fri, 22 Nov 2013 18:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258476 - head/sys/amd64/vmm 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 18:57:23 -0000 Author: neel Date: Fri Nov 22 18:57:22 2013 New Revision: 258476 URL: http://svnweb.freebsd.org/changeset/base/258476 Log: Eliminate redundant information about the host cpu in bhyve's KTR trace points. This is always tracked by ktr(4) and can be displayed using the "-c" option of ktrdump(8). Discussed with: grehan Modified: head/sys/amd64/vmm/vmm_ktr.h Modified: head/sys/amd64/vmm/vmm_ktr.h ============================================================================== --- head/sys/amd64/vmm/vmm_ktr.h Fri Nov 22 18:54:06 2013 (r258475) +++ head/sys/amd64/vmm/vmm_ktr.h Fri Nov 22 18:57:22 2013 (r258476) @@ -32,32 +32,31 @@ #include #include +#ifndef KTR_VMM #define KTR_VMM KTR_GEN +#endif #define VCPU_CTR0(vm, vcpuid, format) \ -CTR3(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu) +CTR2(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid)) #define VCPU_CTR1(vm, vcpuid, format, p1) \ -CTR4(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ - (p1)) +CTR3(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1)) #define VCPU_CTR2(vm, vcpuid, format, p1, p2) \ -CTR5(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ - (p1), (p2)) +CTR4(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1), (p2)) #define VCPU_CTR3(vm, vcpuid, format, p1, p2, p3) \ -CTR6(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ - (p1), (p2), (p3)) +CTR5(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1), (p2), (p3)) #define VM_CTR0(vm, format) \ -CTR2(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu) +CTR1(KTR_VMM, "vm %s: " format, vm_name((vm))) #define VM_CTR1(vm, format, p1) \ -CTR3(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1)) +CTR2(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1)) #define VM_CTR2(vm, format, p1, p2) \ -CTR4(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1), (p2)) +CTR3(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1), (p2)) #define VM_CTR3(vm, format, p1, p2, p3) \ -CTR5(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1), (p2), (p3)) +CTR4(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1), (p2), (p3)) #endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19:02:22 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8553C68; Fri, 22 Nov 2013 19:02:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A777A27D5; Fri, 22 Nov 2013 19:02:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJ2MMw009195; Fri, 22 Nov 2013 19:02:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJ2MgT009194; Fri, 22 Nov 2013 19:02:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221902.rAMJ2MgT009194@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258478 - head/sys/net 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:02:22 -0000 Author: glebius Date: Fri Nov 22 19:02:22 2013 New Revision: 258478 URL: http://svnweb.freebsd.org/changeset/base/258478 Log: Add missing 'extern'. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 22 18:57:27 2013 (r258477) +++ head/sys/net/pfvar.h Fri Nov 22 19:02:22 2013 (r258478) @@ -1574,8 +1574,8 @@ pf_release_state(struct pf_state *s) extern struct pf_state *pf_find_state_byid(uint64_t, uint32_t); extern struct pf_state *pf_find_state_all(struct pf_state_key_cmp *, u_int, int *); -struct pf_src_node *pf_find_src_node(struct pf_addr *, struct pf_rule *, - sa_family_t, int); +extern struct pf_src_node *pf_find_src_node(struct pf_addr *, + struct pf_rule *, sa_family_t, int); extern void pf_print_state(struct pf_state *); extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10A9B35E; Fri, 22 Nov 2013 19:16:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E497728A2; Fri, 22 Nov 2013 19:16:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJGYBQ013668; Fri, 22 Nov 2013 19:16:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJGYWj013666; Fri, 22 Nov 2013 19:16:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221916.rAMJGYWj013666@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258479 - in head/sys: net netpfil/pf 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:16:35 -0000 Author: glebius Date: Fri Nov 22 19:16:34 2013 New Revision: 258479 URL: http://svnweb.freebsd.org/changeset/base/258479 Log: To support upcoming changes change internal API for source node handling: - Removed pf_remove_src_node(). - Introduce pf_unlink_src_node() and pf_unlink_src_node_locked(). These function do not proceed with freeing of a node, just disconnect it from storage. - New function pf_free_src_nodes() works on a list of previously disconnected nodes and frees them. - Utilize new API in pf_purge_expired_src_nodes(). In collaboration with: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Sponsored by: Nginx, Inc. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 22 19:02:22 2013 (r258478) +++ head/sys/net/pfvar.h Fri Nov 22 19:16:34 2013 (r258479) @@ -1467,8 +1467,9 @@ struct pf_ifspeed { #define DIOCGIFSPEED _IOWR('D', 92, struct pf_ifspeed) #ifdef _KERNEL +LIST_HEAD(pf_src_node_list, pf_src_node); struct pf_srchash { - LIST_HEAD(, pf_src_node) nodes; + struct pf_src_node_list nodes; struct mtx lock; }; @@ -1576,6 +1577,9 @@ extern struct pf_state *pf_find_state_a u_int, int *); extern struct pf_src_node *pf_find_src_node(struct pf_addr *, struct pf_rule *, sa_family_t, int); +extern void pf_unlink_src_node(struct pf_src_node *); +extern void pf_unlink_src_node_locked(struct pf_src_node *); +extern u_int pf_free_src_nodes(struct pf_src_node_list *); extern void pf_print_state(struct pf_state *); extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Nov 22 19:02:22 2013 (r258478) +++ head/sys/netpfil/pf/pf.c Fri Nov 22 19:16:34 2013 (r258479) @@ -681,20 +681,54 @@ pf_insert_src_node(struct pf_src_node ** return (0); } -static void -pf_remove_src_node(struct pf_src_node *src) +void +pf_unlink_src_node_locked(struct pf_src_node *src) { +#ifdef INVARIANTS struct pf_srchash *sh; sh = &V_pf_srchash[pf_hashsrc(&src->addr, src->af)]; - PF_HASHROW_LOCK(sh); + PF_HASHROW_ASSERT(sh); +#endif LIST_REMOVE(src, entry); - PF_HASHROW_UNLOCK(sh); - + if (src->rule.ptr) + src->rule.ptr->src_nodes--; V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; V_pf_status.src_nodes--; +} - uma_zfree(V_pf_sources_z, src); +void +pf_unlink_src_node(struct pf_src_node *src) +{ + struct pf_srchash *sh; + + sh = &V_pf_srchash[pf_hashsrc(&src->addr, src->af)]; + PF_HASHROW_LOCK(sh); + pf_unlink_src_node_locked(src); + PF_HASHROW_UNLOCK(sh); +} + +static void +pf_free_src_node(struct pf_src_node *sn) +{ + + KASSERT(sn->states == 0, ("%s: %p has refs", __func__, sn)); + LIST_REMOVE(sn, entry); + uma_zfree(V_pf_sources_z, sn); +} + +u_int +pf_free_src_nodes(struct pf_src_node_list *head) +{ + struct pf_src_node *sn, *tmp; + u_int count = 0; + + LIST_FOREACH_SAFE(sn, head, entry, tmp) { + pf_free_src_node(sn); + count++; + } + + return (count); } /* Data storage structures initialization. */ @@ -1464,24 +1498,24 @@ pf_state_expires(const struct pf_state * void pf_purge_expired_src_nodes() { + struct pf_src_node_list freelist; struct pf_srchash *sh; struct pf_src_node *cur, *next; int i; + LIST_INIT(&freelist); for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { - if (cur->rule.ptr != NULL) - cur->rule.ptr->src_nodes--; - LIST_REMOVE(cur, entry); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; - uma_zfree(V_pf_sources_z, cur); + pf_unlink_src_node_locked(cur); + LIST_INSERT_HEAD(&freelist, cur, entry); } else if (cur->rule.ptr != NULL) cur->rule.ptr->rule_flag |= PFRULE_REFS; PF_HASHROW_UNLOCK(sh); } + + pf_free_src_nodes(&freelist); } static void @@ -3771,11 +3805,15 @@ csfailed: if (nk != NULL) uma_zfree(V_pf_state_key_z, nk); - if (sn != NULL && sn->states == 0 && sn->expire == 0) - pf_remove_src_node(sn); + if (sn != NULL && sn->states == 0 && sn->expire == 0) { + pf_unlink_src_node(sn); + pf_free_src_node(sn); + } - if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) - pf_remove_src_node(nsn); + if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) { + pf_unlink_src_node(nsn); + pf_free_src_node(nsn); + } return (PF_DROP); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19:22:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EE6D505; Fri, 22 Nov 2013 19:22:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D19128F4; Fri, 22 Nov 2013 19:22:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJMQbd016435; Fri, 22 Nov 2013 19:22:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJMQHR016434; Fri, 22 Nov 2013 19:22:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221922.rAMJMQHR016434@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258480 - head/sys/netpfil/pf 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:22:26 -0000 Author: glebius Date: Fri Nov 22 19:22:26 2013 New Revision: 258480 URL: http://svnweb.freebsd.org/changeset/base/258480 Log: The DIOCKILLSRCNODES operation was implemented with O(m*n) complexity, where "m" is number of source nodes and "n" is number of states. Thus, on heavy loaded router its processing consumed a lot of CPU time. Reimplement it with O(m+n) complexity. We first scan through source nodes and disconnect matching ones, putting them on the freelist and marking with a cookie value in their expire field. Then we scan through the states, detecting references to source nodes with a cookie, and disconnect them as well. Then the freelist is passed to pf_free_src_nodes(). In collaboration with: Kajetan Staszkiewicz PR: kern/176763 Sponsored by: InnoGames GmbH Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Nov 22 19:16:34 2013 (r258479) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Nov 22 19:22:26 2013 (r258480) @@ -155,6 +155,7 @@ struct cdev *pf_dev; static void pf_clear_states(void); static int pf_clear_tables(void); static void pf_clear_srcnodes(struct pf_src_node *); +static void pf_kill_srcnodes(struct pfioc_src_node_kill *); static void pf_tbladdr_copyout(struct pf_addr_wrap *); /* @@ -3143,45 +3144,9 @@ DIOCCHANGEADDR_error: break; } - case DIOCKILLSRCNODES: { - struct pfioc_src_node_kill *psnk = - (struct pfioc_src_node_kill *)addr; - struct pf_srchash *sh; - struct pf_src_node *sn; - u_int i, killed = 0; - - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; - i++, sh++) { - /* - * XXXGL: we don't ever acquire sources hash lock - * but if we ever do, the below call to pf_clear_srcnodes() - * would lead to a LOR. - */ - PF_HASHROW_LOCK(sh); - LIST_FOREACH(sn, &sh->nodes, entry) - if (PF_MATCHA(psnk->psnk_src.neg, - &psnk->psnk_src.addr.v.a.addr, - &psnk->psnk_src.addr.v.a.mask, - &sn->addr, sn->af) && - PF_MATCHA(psnk->psnk_dst.neg, - &psnk->psnk_dst.addr.v.a.addr, - &psnk->psnk_dst.addr.v.a.mask, - &sn->raddr, sn->af)) { - /* Handle state to src_node linkage */ - if (sn->states != 0) - pf_clear_srcnodes(sn); - sn->expire = 1; - killed++; - } - PF_HASHROW_UNLOCK(sh); - } - - if (killed > 0) - pf_purge_expired_src_nodes(); - - psnk->psnk_killed = killed; + case DIOCKILLSRCNODES: + pf_kill_srcnodes((struct pfioc_src_node_kill *)addr); break; - } case DIOCSETHOSTID: { u_int32_t *hostid = (u_int32_t *)addr; @@ -3400,6 +3365,59 @@ pf_clear_srcnodes(struct pf_src_node *n) n->states = 0; } } + +static void +pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) +{ + struct pf_src_node_list kill; + + LIST_INIT(&kill); + for (int i = 0; i <= V_pf_srchashmask; i++) { + struct pf_srchash *sh = &V_pf_srchash[i]; + struct pf_src_node *sn, *tmp; + + PF_HASHROW_LOCK(sh); + LIST_FOREACH_SAFE(sn, &sh->nodes, entry, tmp) + if (PF_MATCHA(psnk->psnk_src.neg, + &psnk->psnk_src.addr.v.a.addr, + &psnk->psnk_src.addr.v.a.mask, + &sn->addr, sn->af) && + PF_MATCHA(psnk->psnk_dst.neg, + &psnk->psnk_dst.addr.v.a.addr, + &psnk->psnk_dst.addr.v.a.mask, + &sn->raddr, sn->af)) { + pf_unlink_src_node_locked(sn); + LIST_INSERT_HEAD(&kill, sn, entry); + sn->expire = 1; + } + PF_HASHROW_UNLOCK(sh); + } + + for (int i = 0; i <= V_pf_hashmask; i++) { + struct pf_idhash *ih = &V_pf_idhash[i]; + struct pf_state *s; + + PF_HASHROW_LOCK(ih); + LIST_FOREACH(s, &ih->states, entry) { + if (s->src_node && s->src_node->expire == 1) { +#ifdef INVARIANTS + s->src_node->states--; +#endif + s->src_node = NULL; + } + if (s->nat_src_node && s->nat_src_node->expire == 1) { +#ifdef INVARIANTS + s->nat_src_node->states--; +#endif + s->nat_src_node = NULL; + } + } + PF_HASHROW_UNLOCK(ih); + } + + psnk->psnk_killed = pf_free_src_nodes(&kill); +} + /* * XXX - Check for version missmatch!!! */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19:26: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8A6F7AE; Fri, 22 Nov 2013 19:26:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7053291F; Fri, 22 Nov 2013 19:26:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJQ42T016992; Fri, 22 Nov 2013 19:26:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJQ4xe016989; Fri, 22 Nov 2013 19:26:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221926.rAMJQ4xe016989@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258481 - in stable/10: . etc/mtree X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:26:05 -0000 Author: glebius Date: Fri Nov 22 19:26:04 2013 New Revision: 258481 URL: http://svnweb.freebsd.org/changeset/base/258481 Log: Merge r256769 by des from head: Last few remnants of BIND (hopefully...) Approved by: re (kib) Modified: stable/10/ObsoleteFiles.inc (contents, props changed) stable/10/etc/mtree/BSD.usr.dist Directory Properties: stable/10/etc/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Nov 22 19:22:26 2013 (r258480) +++ stable/10/ObsoleteFiles.inc Fri Nov 22 19:26:04 2013 (r258481) @@ -117,7 +117,7 @@ OLD_FILES+=usr/include/lwres/result.h OLD_FILES+=usr/include/lwres/version.h OLD_FILES+=usr/lib/liblwres.a OLD_FILES+=usr/lib/liblwres.so -OLD_LIBS+=usr/lib/liblwres.so.50 +OLD_LIBS+=usr/lib/liblwres.so.90 OLD_FILES+=usr/lib/liblwres_p.a OLD_FILES+=usr/sbin/arpaname OLD_FILES+=usr/sbin/ddns-confgen @@ -127,6 +127,7 @@ OLD_FILES+=usr/sbin/dnssec-keygen OLD_FILES+=usr/sbin/dnssec-revoke OLD_FILES+=usr/sbin/dnssec-settime OLD_FILES+=usr/sbin/dnssec-signzone +OLD_FILES+=usr/sbin/dnssec-verify OLD_FILES+=usr/sbin/genrandom OLD_FILES+=usr/sbin/isc-hmac-fixup OLD_FILES+=usr/sbin/lwresd Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Fri Nov 22 19:22:26 2013 (r258480) +++ stable/10/etc/mtree/BSD.usr.dist Fri Nov 22 19:26:04 2013 (r258481) @@ -169,12 +169,6 @@ .. atm .. - bind9 - arm - .. - misc - .. - .. legal intel_ipw .. From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19:26: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB70F8F0; Fri, 22 Nov 2013 19:26:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA24A292C; Fri, 22 Nov 2013 19:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJQqbJ017097; Fri, 22 Nov 2013 19:26:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJQqc3017096; Fri, 22 Nov 2013 19:26:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221926.rAMJQqc3017096@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258482 - stable/10/share/man/man4 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:26:52 -0000 Author: glebius Date: Fri Nov 22 19:26:52 2013 New Revision: 258482 URL: http://svnweb.freebsd.org/changeset/base/258482 Log: Merge r258122 from head: Emphasize that pf(4) in FreeBSD doesn't match pf(4) in OpenBSD 4.5, but is derived from it, and got some important local changes. Approved by: re (kib) Modified: stable/10/share/man/man4/pf.4 Directory Properties: stable/10/share/man/ (props changed) stable/10/share/man/man4/ (props changed) Modified: stable/10/share/man/man4/pf.4 ============================================================================== --- stable/10/share/man/man4/pf.4 Fri Nov 22 19:26:04 2013 (r258481) +++ stable/10/share/man/man4/pf.4 Fri Nov 22 19:26:52 2013 (r258482) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18 2012 +.Dd November 14, 2013 .Dt PF 4 .Os .Sh NAME @@ -1181,5 +1181,8 @@ packet filtering mechanism first appeare and then .Fx 5.2 . .Pp -This implementation matches +This implementation is derived from .Ox 4.5 . +It has been heavily modified to be capable of running in multithreaded +.Fx +kernel and scale its performance on multiple CPUs. From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 19:27:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2522CA26; Fri, 22 Nov 2013 19:27:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 137292933; Fri, 22 Nov 2013 19:27:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMJRHtE017189; Fri, 22 Nov 2013 19:27:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMJRHbe017188; Fri, 22 Nov 2013 19:27:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311221927.rAMJRHbe017188@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 19:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258483 - stable/10/sys/kern X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 19:27:18 -0000 Author: glebius Date: Fri Nov 22 19:27:17 2013 New Revision: 258483 URL: http://svnweb.freebsd.org/changeset/base/258483 Log: Merge r258128 from head: Fix a very bad typo from r248887. Approved by: re (kib) Modified: stable/10/sys/kern/uipc_mbuf.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/kern/uipc_mbuf.c ============================================================================== --- stable/10/sys/kern/uipc_mbuf.c Fri Nov 22 19:26:52 2013 (r258482) +++ stable/10/sys/kern/uipc_mbuf.c Fri Nov 22 19:27:17 2013 (r258483) @@ -1196,6 +1196,7 @@ m_split(struct mbuf *m0, int len0, int w remain = m->m_len - len; if (m0->m_flags & M_PKTHDR && remain == 0) { n = m_gethdr(wait, m0->m_type); + if (n == NULL) return (NULL); n->m_next = m->m_next; m->m_next = NULL; From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 20:11: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BD5C87D; Fri, 22 Nov 2013 20:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2AC2BA3; Fri, 22 Nov 2013 20:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMKBIxZ033590; Fri, 22 Nov 2013 20:11:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMKBIs4033589; Fri, 22 Nov 2013 20:11:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311222011.rAMKBIs4033589@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 20:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258484 - head/sbin/pfctl 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 20:11:18 -0000 Author: glebius Date: Fri Nov 22 20:11:17 2013 New Revision: 258484 URL: http://svnweb.freebsd.org/changeset/base/258484 Log: Rewrite usage() so that its source code resembles what is printed. Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Fri Nov 22 19:27:17 2013 (r258483) +++ head/sbin/pfctl/pfctl.c Fri Nov 22 20:11:17 2013 (r258484) @@ -234,13 +234,13 @@ usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname); - fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n"); - fprintf(stderr, "\t[-f file] [-i interface] [-K host | network]\n"); - fprintf(stderr, "\t[-k host | network | label | id] "); - fprintf(stderr, "[-o level] [-p device]\n"); - fprintf(stderr, "\t[-s modifier] "); - fprintf(stderr, "[-t table -T command [address ...]] [-x level]\n"); + fprintf(stderr, +"usage: %s [-AdeghmNnOPqRrvz] [-a anchor] [-D macro=value] [-F modifier]\n" + "\t[-f file] [-i interface] [-K host | network]\n" + "\t[-k host | network | label | id] [-o level] [-p device]\n" + "\t[-s modifier] [-t table -T command [address ...]] [-x level]\n", + __progname); + exit(1); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 20:13:32 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD0FDB0F; Fri, 22 Nov 2013 20:13:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC3BB2BD6; Fri, 22 Nov 2013 20:13:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMKDWj2033956; Fri, 22 Nov 2013 20:13:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMKDWeH033955; Fri, 22 Nov 2013 20:13:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311222013.rAMKDWeH033955@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Nov 2013 20:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258485 - head/sbin/pfctl 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 20:13:32 -0000 Author: glebius Date: Fri Nov 22 20:13:32 2013 New Revision: 258485 URL: http://svnweb.freebsd.org/changeset/base/258485 Log: Remove __FreeBSD__ ifdefs. Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Fri Nov 22 20:11:17 2013 (r258484) +++ head/sbin/pfctl/pfctl.c Fri Nov 22 20:13:32 2013 (r258485) @@ -38,10 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#ifdef __FreeBSD__ #include -#endif #include #include @@ -250,10 +247,8 @@ pfctl_enable(int dev, int opts) if (ioctl(dev, DIOCSTART)) { if (errno == EEXIST) errx(1, "pf already enabled"); -#ifdef __FreeBSD__ else if (errno == ESRCH) errx(1, "pfil registeration failed"); -#endif else err(1, "DIOCSTART"); } @@ -2185,7 +2180,7 @@ main(int argc, char *argv[]) /* turn off options */ opts &= ~ (PF_OPT_DISABLE | PF_OPT_ENABLE); clearopt = showopt = debugopt = NULL; -#if defined(__FreeBSD__) && !defined(ENABLE_ALTQ) +#if !defined(ENABLE_ALTQ) altqsupport = 0; #else altqsupport = 1; From owner-svn-src-all@FreeBSD.ORG Fri Nov 22 21:50:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B2A0F05; Fri, 22 Nov 2013 21:50:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ADD8208A; Fri, 22 Nov 2013 21:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAMLoEtI065285; Fri, 22 Nov 2013 21:50:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAMLoDJd065279; Fri, 22 Nov 2013 21:50:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201311222150.rAMLoDJd065279@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 22 Nov 2013 21:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258489 - head/tools/regression/bin/sh/execution 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.16 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2013 21:50:14 -0000 Author: jilles Date: Fri Nov 22 21:50:13 2013 New Revision: 258489 URL: http://svnweb.freebsd.org/changeset/base/258489 Log: sh: Add tests for the Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F32A9513; Sat, 23 Nov 2013 00:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2932278D; Sat, 23 Nov 2013 00:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAN0SI1i041388; Sat, 23 Nov 2013 00:28:18 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAN0SI9c041387; Sat, 23 Nov 2013 00:28:18 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201311230028.rAN0SI9c041387@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 23 Nov 2013 00:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258492 - head/sys/crypto/aesni 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 00:28:19 -0000 Author: jmg Date: Sat Nov 23 00:28:18 2013 New Revision: 258492 URL: http://svnweb.freebsd.org/changeset/base/258492 Log: fix broken style(9) in r258399 Pointed out by: brd Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Fri Nov 22 23:36:41 2013 (r258491) +++ head/sys/crypto/aesni/aesni.c Sat Nov 23 00:28:18 2013 (r258492) @@ -92,8 +92,8 @@ aesni_attach(device_t dev) sc = device_get_softc(dev); TAILQ_INIT(&sc->sessions); sc->sid = 1; - sc->cid = crypto_get_driverid(dev, - CRYPTOCAP_F_HARDWARE|CRYPTOCAP_F_SYNC); + sc->cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE | + CRYPTOCAP_F_SYNC); if (sc->cid < 0) { device_printf(dev, "Could not get crypto driver id.\n"); return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 01: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B0D2F25; Sat, 23 Nov 2013 01:20:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B9AD298B; Sat, 23 Nov 2013 01:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAN1KHYX058679; Sat, 23 Nov 2013 01:20:17 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAN1KHoZ058676; Sat, 23 Nov 2013 01:20:17 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201311230120.rAN1KHoZ058676@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 23 Nov 2013 01:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258493 - in stable/10/release/doc/en_US.ISO8859-1: errata hardware readme X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 01:20:18 -0000 Author: rodrigc Date: Sat Nov 23 01:20:17 2013 New Revision: 258493 URL: http://svnweb.freebsd.org/changeset/base/258493 Log: MFC r258432, r258433 Update text related to Intel CPU support and Apple hardware support. Update copyrights Submitted by: skreuzer Approved by: re (hrs, delphij) Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml stable/10/release/doc/en_US.ISO8859-1/readme/article.xml Directory Properties: stable/10/release/ (props changed) stable/10/release/doc/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Sat Nov 23 00:28:18 2013 (r258492) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Sat Nov 23 01:20:17 2013 (r258493) @@ -32,6 +32,14 @@ 2003 2004 2005 + 2006 + 2007 + 2008 + 2009 + 2010 + 2011 + 2012 + 2013 The &os; Documentation Project Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 23 00:28:18 2013 (r258492) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 23 01:20:17 2013 (r258493) @@ -178,9 +178,7 @@ the &a.smp; may yield some clues. &os; will take advantage of HyperThreading (HTT) support - on &intel; CPUs that support this feature. A kernel with the - options SMP feature enabled will - automatically detect the additional logical processors. The + on &intel; CPUs that support this feature. The default &os; scheduler treats the logical processors the same as additional physical processors; in other words, no attempt is made to optimize scheduling decisions given the shared @@ -303,63 +301,12 @@ powerpc - This section describes the systems currently known to be - supported by &os; on the PowerPC platform. This list is not - exhaustive. - - In general, all New World architecture Apple hardware - is supported, as well a limited selection of non-Apple - machines. - - All systems listed below are fully supported, with the - exception that software fan control is currently missing on - some Power Macintosh G5 models. SMP is supported on all systems - with more than 1 processor. + All Apple PowerPC machines with built-in USB are supported, + as well a limited selection of non-Apple machines, + including KVM on POWER7 - - - Apple iMac G3 - - - Apple iMac G4 - - - Apple iMac G5 - - - Apple Power Macintosh G3 (Blue & White) - - - Apple Power Macintosh G4 - - - Apple Power Macintosh G5 - - - Apple iBook G3 - - - Apple iBook G4 - - - Apple PowerBook G3 (Lombard and Pismo) - - - Apple PowerBook G4 - - - Apple XServe G4 - - - Apple XServe G5 - - - Apple Mac Mini - - - Embedded boards based on MPC85XX - - + SMP is supported on all systems with more than + 1 processor. @@ -367,10 +314,7 @@ This section describes the systems currently known to be supported by &os; on the Fujitsu &sparc64; and Sun &ultrasparc; - platforms. For - background information on the various hardware designs see the - Sun System - Handbook. + platforms. SMP is supported on all systems with more than 1 processor. Modified: stable/10/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/readme/article.xml Sat Nov 23 00:28:18 2013 (r258492) +++ stable/10/release/doc/en_US.ISO8859-1/readme/article.xml Sat Nov 23 01:20:17 2013 (r258493) @@ -30,6 +30,11 @@ 2006 2007 2008 + 2009 + 2010 + 2011 + 2012 + 2013 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 03:56: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B84E36AE; Sat, 23 Nov 2013 03:56:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99B772129; Sat, 23 Nov 2013 03:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAN3u52l013285; Sat, 23 Nov 2013 03:56:05 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAN3u30w013275; Sat, 23 Nov 2013 03:56:03 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201311230356.rAN3u30w013275@svn.freebsd.org> From: Neel Natu Date: Sat, 23 Nov 2013 03:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258494 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 03:56:05 -0000 Author: neel Date: Sat Nov 23 03:56:03 2013 New Revision: 258494 URL: http://svnweb.freebsd.org/changeset/base/258494 Log: Add an ioctl to assert and deassert an ioapic pin atomically. This will be used to inject edge triggered legacy interrupts into the guest. Start using the new API in device models that use edge triggered interrupts: viz. the 8254 timer and the LPC/uart device emulation. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/vioapic.c head/sys/amd64/vmm/io/vioapic.h head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyve/pit_8254.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/lib/libvmmapi/vmmapi.c Sat Nov 23 03:56:03 2013 (r258494) @@ -419,6 +419,17 @@ vm_ioapic_deassert_irq(struct vmctx *ctx } int +vm_ioapic_pulse_irq(struct vmctx *ctx, int irq) +{ + struct vm_ioapic_irq ioapic_irq; + + bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); + ioapic_irq.irq = irq; + + return (ioctl(ctx->fd, VM_IOAPIC_PULSE_IRQ, &ioapic_irq)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat Nov 23 01:20:17 2013 (r258493) +++ head/lib/libvmmapi/vmmapi.h Sat Nov 23 03:56:03 2013 (r258494) @@ -69,6 +69,7 @@ int vm_inject_event2(struct vmctx *ctx, int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); +int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sat Nov 23 01:20:17 2013 (r258493) +++ head/sys/amd64/include/vmm_dev.h Sat Nov 23 03:56:03 2013 (r258494) @@ -170,6 +170,7 @@ enum { IOCNUM_INJECT_NMI = 32, IOCNUM_IOAPIC_ASSERT_IRQ = 33, IOCNUM_IOAPIC_DEASSERT_IRQ = 34, + IOCNUM_IOAPIC_PULSE_IRQ = 35, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -209,6 +210,8 @@ enum { _IOW('v', IOCNUM_IOAPIC_ASSERT_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_DEASSERT_IRQ \ _IOW('v', IOCNUM_IOAPIC_DEASSERT_IRQ, struct vm_ioapic_irq) +#define VM_IOAPIC_PULSE_IRQ \ + _IOW('v', IOCNUM_IOAPIC_PULSE_IRQ, struct vm_ioapic_irq) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: head/sys/amd64/vmm/io/vioapic.c ============================================================================== --- head/sys/amd64/vmm/io/vioapic.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/sys/amd64/vmm/io/vioapic.c Sat Nov 23 03:56:03 2013 (r258494) @@ -160,8 +160,14 @@ vioapic_set_pinstate(struct vioapic *vio } } +enum irqstate { + IRQSTATE_ASSERT, + IRQSTATE_DEASSERT, + IRQSTATE_PULSE +}; + static int -vioapic_set_irqstate(struct vm *vm, int irq, bool state) +vioapic_set_irqstate(struct vm *vm, int irq, enum irqstate irqstate) { struct vioapic *vioapic; @@ -171,7 +177,20 @@ vioapic_set_irqstate(struct vm *vm, int vioapic = vm_ioapic(vm); VIOAPIC_LOCK(vioapic); - vioapic_set_pinstate(vioapic, irq, state); + switch (irqstate) { + case IRQSTATE_ASSERT: + vioapic_set_pinstate(vioapic, irq, true); + break; + case IRQSTATE_DEASSERT: + vioapic_set_pinstate(vioapic, irq, false); + break; + case IRQSTATE_PULSE: + vioapic_set_pinstate(vioapic, irq, true); + vioapic_set_pinstate(vioapic, irq, false); + break; + default: + panic("vioapic_set_irqstate: invalid irqstate %d", irqstate); + } VIOAPIC_UNLOCK(vioapic); return (0); @@ -181,14 +200,21 @@ int vioapic_assert_irq(struct vm *vm, int irq) { - return (vioapic_set_irqstate(vm, irq, true)); + return (vioapic_set_irqstate(vm, irq, IRQSTATE_ASSERT)); } int vioapic_deassert_irq(struct vm *vm, int irq) { - return (vioapic_set_irqstate(vm, irq, false)); + return (vioapic_set_irqstate(vm, irq, IRQSTATE_DEASSERT)); +} + +int +vioapic_pulse_irq(struct vm *vm, int irq) +{ + + return (vioapic_set_irqstate(vm, irq, IRQSTATE_PULSE)); } static uint32_t Modified: head/sys/amd64/vmm/io/vioapic.h ============================================================================== --- head/sys/amd64/vmm/io/vioapic.h Sat Nov 23 01:20:17 2013 (r258493) +++ head/sys/amd64/vmm/io/vioapic.h Sat Nov 23 03:56:03 2013 (r258494) @@ -41,6 +41,7 @@ void vioapic_cleanup(struct vioapic *vio int vioapic_assert_irq(struct vm *vm, int irq); int vioapic_deassert_irq(struct vm *vm, int irq); +int vioapic_pulse_irq(struct vm *vm, int irq); int vioapic_mmio_write(void *vm, int vcpuid, uint64_t gpa, uint64_t wval, int size, void *arg); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/sys/amd64/vmm/vmm_dev.c Sat Nov 23 03:56:03 2013 (r258494) @@ -303,6 +303,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c ioapic_irq = (struct vm_ioapic_irq *)data; error = vioapic_deassert_irq(sc->vm, ioapic_irq->irq); break; + case VM_IOAPIC_PULSE_IRQ: + ioapic_irq = (struct vm_ioapic_irq *)data; + error = vioapic_pulse_irq(sc->vm, ioapic_irq->irq); + break; case VM_MAP_MEMORY: seg = (struct vm_memory_segment *)data; error = vm_malloc(sc->vm, seg->gpa, seg->len); Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/usr.sbin/bhyve/pci_emul.c Sat Nov 23 03:56:03 2013 (r258494) @@ -1135,7 +1135,11 @@ pci_lintr_assert(struct pci_devinst *pi) { assert(pi->pi_lintr_pin >= 0); - vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + + if (pi->pi_lintr_state == 0) { + pi->pi_lintr_state = 1; + vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + } } void @@ -1143,7 +1147,11 @@ pci_lintr_deassert(struct pci_devinst *p { assert(pi->pi_lintr_pin >= 0); - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + + if (pi->pi_lintr_state == 1) { + pi->pi_lintr_state = 0; + vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + } } /* Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Sat Nov 23 01:20:17 2013 (r258493) +++ head/usr.sbin/bhyve/pci_emul.h Sat Nov 23 03:56:03 2013 (r258494) @@ -104,6 +104,7 @@ struct pci_devinst { struct vmctx *pi_vmctx; uint8_t pi_bus, pi_slot, pi_func; int8_t pi_lintr_pin; + int8_t pi_lintr_state; char pi_name[PI_NAMESZ]; int pi_bar_getsize; Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/usr.sbin/bhyve/pci_lpc.c Sat Nov 23 03:56:03 2013 (r258494) @@ -94,17 +94,16 @@ lpc_uart_intr_assert(void *arg) assert(sc->irq >= 0); - vm_ioapic_assert_irq(lpc_bridge->pi_vmctx, sc->irq); + vm_ioapic_pulse_irq(lpc_bridge->pi_vmctx, sc->irq); } static void lpc_uart_intr_deassert(void *arg) { - struct lpc_uart_softc *sc = arg; - - assert(sc->irq >= 0); - - vm_ioapic_deassert_irq(lpc_bridge->pi_vmctx, sc->irq); + /* + * The COM devices on the LPC bus generate edge triggered interrupts, + * so nothing more to do here. + */ } static int Modified: head/usr.sbin/bhyve/pit_8254.c ============================================================================== --- head/usr.sbin/bhyve/pit_8254.c Sat Nov 23 01:20:17 2013 (r258493) +++ head/usr.sbin/bhyve/pit_8254.c Sat Nov 23 03:56:03 2013 (r258494) @@ -105,8 +105,7 @@ pit_mevent_cb(int fd, enum ev_type type, pit_mev_count++; - vm_ioapic_assert_irq(c->ctx, 2); - vm_ioapic_deassert_irq(c->ctx, 2); + vm_ioapic_pulse_irq(c->ctx, 2); /* * Delete the timer for one-shots From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 10:55: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 760B4B46; Sat, 23 Nov 2013 10:55:42 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED41221F; Sat, 23 Nov 2013 10:55:42 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 4614146B3C; Sat, 23 Nov 2013 05:55:35 -0500 (EST) Date: Sat, 23 Nov 2013 10:55:34 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Adrian Chadd Subject: Re: svn commit: r258328 - head/sys/net In-Reply-To: Message-ID: References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <023E719B-1059-4670-8556-EBAC18A2F007@freebsd.org> <20131121000245.GA30549@onelab2.iet.unipi.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , George Neville-Neil , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 10:55:42 -0000 On Wed, 20 Nov 2013, Adrian Chadd wrote: > We should migrate drivers to use a multi-input method where it's > appropriate. It's the same pain as if_transmit() is/was. > > I'd really like to avoid having hacky solutions like mbufs with magic types. > If we're going down that path, we should create a correct inline messaging > mechanism that includes arbitrary messages in the stream, where some may or > may not be mbufs. Magic mbufs just makes me want to tear out my eyes a > little. > > So, the reason I'd like to back it out is because we should be doing it via > a multi method with some type that represents an mbuf list. If George > doesn't mind, I'll add a multi input method, move this stuff into it, and > make ether_input just be single frames. My worry here is that the failure modes for easy oversights and bugs are quite subtle ones: mbuf leakage and data corruption. Our goal should be to shift as many as possible of those bugs to compiler-detected events (e.g., due to type checking), or where not possible, run-time detected events (e.g., due to easily detected non-NULL pointers). I'm OK with the current change staying in the tree for a few weeks on the path there, but I much prefer the world in which we use different symbols for different "types". This is especially important if we will have device driver vendors maintaining drivers across many versions (which we do): we really don't want a driver using ether_input for queue handoff in 11.x to just mysteriously leak mbufs in 10.x. Instead, the driver should fail to compile. Robert From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 10:57:33 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E365CDCD; Sat, 23 Nov 2013 10:57:32 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id BD1DC223F; Sat, 23 Nov 2013 10:57:32 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 61B7C46B3C; Sat, 23 Nov 2013 05:57:32 -0500 (EST) Date: Sat, 23 Nov 2013 10:57:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Julian Elischer Subject: Re: svn commit: r258328 - head/sys/net In-Reply-To: <528D6173.4080406@freebsd.org> Message-ID: References: <201311182258.rAIMwEFd048783@svn.freebsd.org> <528D6173.4080406@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Adrian Chadd , "src-committers@freebsd.org" , FreeBSD Net , "svn-src-all@freebsd.org" , "George V. Neville-Neil" , "freebsd-arch@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 10:57:33 -0000 On Wed, 20 Nov 2013, Julian Elischer wrote: >> After that it'd be nice to write a set of mbuf list macros for abstract the >> whole queue, dequeue, concat, iterate, etc (like sys/queue.h, but for >> mbufs.) >> >> What do people think? >> >> (I've been doing it for m->next chained things, but not m->m_nextpkt >> things..) > > I was thinking: new interfaces.. (your -multi names sound good). macros for > handling said lists so that people don't screw them up Old drivers run with > no change. To me, the name "multi" is ambiguous: could be multicast. If we call the new datastructure "mbqueue" or "mqueue", then we should name the method ether_input_mbqueue or ether_input_mqueue. Robert > >> >> >> >> -adrian >> >> >> On 18 November 2013 14:58, George V. Neville-Neil wrote: >>> Author: gnn >>> Date: Mon Nov 18 22:58:14 2013 >>> New Revision: 258328 >>> URL: http://svnweb.freebsd.org/changeset/base/258328 >>> >>> Log: >>> Allow ethernet drivers to pass in packets connected via the nextpkt >>> pointer. >>> Handling packets in this way allows drivers to amortize work during >>> packet reception. >>> >>> Submitted by: Vijay Singh >>> Sponsored by: NetApp >>> >>> Modified: >>> head/sys/net/if_ethersubr.c >>> >>> Modified: head/sys/net/if_ethersubr.c >>> ============================================================================== >>> --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013 (r258327) >>> +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013 (r258328) >>> @@ -708,13 +708,25 @@ static void >>> ether_input(struct ifnet *ifp, struct mbuf *m) >>> { >>> >>> + struct mbuf *mn; >>> + >>> /* >>> - * We will rely on rcvif being set properly in the deferred >>> context, >>> - * so assert it is correct here. >>> + * The drivers are allowed to pass in a chain of packets linked >>> with >>> + * m_nextpkt. We split them up into separate packets here and pass >>> + * them up. This allows the drivers to amortize the receive lock. >>> */ >>> - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", >>> __func__)); >>> + while (m) { >>> + mn = m->m_nextpkt; >>> + m->m_nextpkt = NULL; >>> >>> - netisr_dispatch(NETISR_ETHER, m); >>> + /* >>> + * We will rely on rcvif being set properly in the >>> deferred context, >>> + * so assert it is correct here. >>> + */ >>> + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", >>> __func__)); >>> + netisr_dispatch(NETISR_ETHER, m); >>> + m = mn; >>> + } >>> } >>> >>> /* > > From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 11:46:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 579B874E; Sat, 23 Nov 2013 11:46:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4789D2446; Sat, 23 Nov 2013 11:46:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANBkEnJ075368; Sat, 23 Nov 2013 11:46:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANBkEjr075367; Sat, 23 Nov 2013 11:46:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311231146.rANBkEjr075367@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Nov 2013 11:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258495 - head/release/doc/en_US.ISO8859-1/hardware 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 11:46:14 -0000 Author: mav Date: Sat Nov 23 11:46:13 2013 New Revision: 258495 URL: http://svnweb.freebsd.org/changeset/base/258495 Log: MFreleng/8.4 r251256 (by hrs): Update description of logical CPU handling in the latest releases and remove obsolete sysctl variable machdep.hlt_logical_cpus. MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 23 03:56:03 2013 (r258494) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat Nov 23 11:46:13 2013 (r258495) @@ -177,16 +177,13 @@ bugs may generate some problems. Perusal of the archives of the &a.smp; may yield some clues. - &os; will take advantage of HyperThreading (HTT) support - on &intel; CPUs that support this feature. The - default &os; scheduler treats the logical processors the same - as additional physical processors; in other words, no attempt - is made to optimize scheduling decisions given the shared - resources between logical processors within the same CPU. - Because this naive scheduling can result in suboptimal - performance, under certain circumstances it may be useful to - disable the logical processors with the - machdep.hyperthreading_allowed tunable. + &os; will take advantage of SMT (Symmetric MultiThreading, + also known as HyperThreading on &intel; CPUs) on the supported + CPUs. The GENERIC kernel which is + installed by default will automatically detect the additional + logical processors. The default &os; scheduler recognizes + processor topology on the system and selects logical and + physical processors to obtain optimal performance. The &man.smp.4; manual page has more details. &os; will take advantage of Physical Address Extensions From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 12:17:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64AA3C93; Sat, 23 Nov 2013 12:17:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5453B2568; Sat, 23 Nov 2013 12:17:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANCH67t085741; Sat, 23 Nov 2013 12:17:06 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANCH6LX085740; Sat, 23 Nov 2013 12:17:06 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201311231217.rANCH6LX085740@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 23 Nov 2013 12:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258496 - stable/10/lib/libiconv_modules/UTF7 X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 12:17:06 -0000 Author: tijl Date: Sat Nov 23 12:17:05 2013 New Revision: 258496 URL: http://svnweb.freebsd.org/changeset/base/258496 Log: MFC r258316: Bug fixes in iconv(3) UTF-7 support. - Add ' to the list of directly encoded characters and * to the list of optionally directly encoded characters as per RFC 2152. - In _citrus_UTF7_mbtoutf16 on end of input when the next output character has only been partially decoded, save a copy of the buffer of input characters (not just its length). On the next call with more input characters this buffer is reprocessed together with the new input to form a fully decoded output character. - At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT) by decrementing psenc->chlen and i. This is needed to make room in psenc->ch (input buffer) in case the next input character starts a new base64 encoded sequence. And also, if this is the end of input and no output character can be returned, this brings the encoder in the initial state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which is used by the caller to distinguish between no output and partial output. - In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer) directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0). This way s is updated correctly in case of errors. - In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set (previous call did not have enough input), retrieve the previously decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of (psenc->cache >> 2). Approved by: re (kib) Modified: stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Directory Properties: stable/10/lib/libiconv_modules/ (props changed) Modified: stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c ============================================================================== --- stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Sat Nov 23 11:46:13 2013 (r258495) +++ stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Sat Nov 23 12:17:05 2013 (r258496) @@ -113,9 +113,9 @@ static const char base64[] = static const char direct[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" - "0123456789(),-./:?"; + "0123456789'(),-./:?"; -static const char option[] = "!\"#$%&';<=>@[]^_`{|}"; +static const char option[] = "!\"#$%&*;<=>@[]^_`{|}"; static const char spaces[] = " \t\r\n"; #define BASE64_BIT 6 @@ -165,6 +165,7 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo *nresult = (size_t)-2; *s = s0; sv.chlen = psenc->chlen; + memcpy(sv.ch, psenc->ch, sizeof(sv.ch)); *psenc = sv; return (0); } @@ -202,6 +203,9 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo goto ilseq; *u16 = (uint16_t)psenc->ch[i]; done = 1; + } else { + psenc->chlen--; + i--; } } else { psenc->cache = @@ -241,7 +245,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { - const char *s0; uint32_t u32; uint16_t hi, lo; size_t nr, siz; @@ -252,14 +255,13 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT; return (0); } - s0 = *s; if (psenc->surrogate) { - hi = (psenc->cache >> 2) & UTF16_MAX; + hi = (psenc->cache >> psenc->bits) & UTF16_MAX; if (hi < HISRG_MIN || hi > HISRG_MAX) return (EINVAL); siz = 0; } else { - err = _citrus_UTF7_mbtoutf16(ei, &hi, &s0, n, psenc, &nr); + err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { *nresult = nr; return (err); @@ -274,7 +276,7 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI } psenc->surrogate = 1; } - err = _citrus_UTF7_mbtoutf16(ei, &lo, &s0, n, psenc, &nr); + err = _citrus_UTF7_mbtoutf16(ei, &lo, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { *nresult = nr; return (err); @@ -286,7 +288,6 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI u32 = (hi << 10 | lo) + SRG_BASE; siz += nr; done: - *s = s0; if (pwc != NULL) *pwc = (wchar_t)u32; if (u32 == (uint32_t)0) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 13:42: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8ACACFA; Sat, 23 Nov 2013 13:42:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C908B28D9; Sat, 23 Nov 2013 13:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANDguc0014895; Sat, 23 Nov 2013 13:42:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANDgucq014894; Sat, 23 Nov 2013 13:42:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311231342.rANDgucq014894@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Nov 2013 13:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258497 - head/sys/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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 13:42:56 -0000 Author: mav Date: Sat Nov 23 13:42:56 2013 New Revision: 258497 URL: http://svnweb.freebsd.org/changeset/base/258497 Log: When purging per-CPU UMA caches do not return empty buckets into the global full bucket cache to not trigger assertion if allocation happen before that global cache get purged. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Nov 23 12:17:05 2013 (r258496) +++ head/sys/vm/uma_core.c Sat Nov 23 13:42:56 2013 (r258497) @@ -701,25 +701,37 @@ static void cache_drain_safe_cpu(uma_zone_t zone) { uma_cache_t cache; + uma_bucket_t b1, b2; if (zone->uz_flags & UMA_ZFLAG_INTERNAL) return; + b1 = b2 = NULL; ZONE_LOCK(zone); critical_enter(); cache = &zone->uz_cpu[curcpu]; if (cache->uc_allocbucket) { - LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_allocbucket, - ub_link); + if (cache->uc_allocbucket->ub_cnt != 0) + LIST_INSERT_HEAD(&zone->uz_buckets, + cache->uc_allocbucket, ub_link); + else + b1 = cache->uc_allocbucket; cache->uc_allocbucket = NULL; } if (cache->uc_freebucket) { - LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_freebucket, - ub_link); + if (cache->uc_freebucket->ub_cnt != 0) + LIST_INSERT_HEAD(&zone->uz_buckets, + cache->uc_freebucket, ub_link); + else + b2 = cache->uc_freebucket; cache->uc_freebucket = NULL; } critical_exit(); ZONE_UNLOCK(zone); + if (b1) + bucket_free(zone, b1, NULL); + if (b2) + bucket_free(zone, b2, NULL); } /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 14:40:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC9A2947; Sat, 23 Nov 2013 14:40:09 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A52072B35; Sat, 23 Nov 2013 14:40:09 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VkENP-0001Ax-0V; Sat, 23 Nov 2013 14:40:08 +0000 Subject: Re: svn commit: r258497 - head/sys/vm Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FCFB1022-D4EA-41D1-89FF-03683B389769"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark Robert Vaughan Murray In-Reply-To: <201311231342.rANDgucq014894@svn.freebsd.org> Date: Sat, 23 Nov 2013 14:39:50 +0000 Message-Id: <4DBC5244-9B44-4B78-8272-6087A901D062@FreeBSD.org> References: <201311231342.rANDgucq014894@svn.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.1822) X-SA-Score: -1.0 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 14:40:09 -0000 --Apple-Mail=_FCFB1022-D4EA-41D1-89FF-03683B389769 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 23 Nov 2013, at 13:42, Alexander Motin wrote: > Author: mav > Date: Sat Nov 23 13:42:56 2013 > New Revision: 258497 > URL: http://svnweb.freebsd.org/changeset/base/258497 >=20 > Log: > When purging per-CPU UMA caches do not return empty buckets into the = global > full bucket cache to not trigger assertion if allocation happen = before that > global cache get purged. Thanks - this one has been getting me! M --=20 Mark R V Murray --Apple-Mail=_FCFB1022-D4EA-41D1-89FF-03683B389769 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUpC+QN58vKOKE6LNAQr6dQP/XrgxgIzxBmH87AV1oUEtyGtaFrrIJR9Q eoeG41UbJFiZzIcPm3S2U0PEBtt1Acza1qs37uqSZvbFzdWzow7qh0bpKBwUlUNt f+ik1mEC1HjM6oXZCizDa6ETt4rsHNnx4V49M1z5R6pEYXwoDdhdHaPnrEW40lzF Bxr710ZjNEA= =2Vej -----END PGP SIGNATURE----- --Apple-Mail=_FCFB1022-D4EA-41D1-89FF-03683B389769-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 15:48:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54C0B912; Sat, 23 Nov 2013 15:48:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3584D2DD3; Sat, 23 Nov 2013 15:48:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANFmI6e056238; Sat, 23 Nov 2013 15:48:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANFmHeJ056236; Sat, 23 Nov 2013 15:48:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311231548.rANFmHeJ056236@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 23 Nov 2013 15:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258499 - head/lib/libthr/thread 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 15:48:18 -0000 Author: kib Date: Sat Nov 23 15:48:17 2013 New Revision: 258499 URL: http://svnweb.freebsd.org/changeset/base/258499 Log: If check_deferred_signal() execution needs binding of PLT symbol, unlocking the rtld bind lock results in the processing of ast and recursing into the check_deferred_signal(). Nested execution of check_deferred_signal() delivers the signal to user code and clears si_signo. On return, top-level check_deferred_signal() frame continues delivering the same signal one more time, but now with zero si_signo. Fix this by adding a flag to indicate that deferred delivery is running, so check_deferred_signal() should avoid doing anything. Since user signal handler is allowed to modify the passed machine context to make return from the signal handler to cause arbitrary jump, or do longjmp(). For this case, also clear the flag in thr_sighandler(), since kernel signal delivery means that nested delivery code should not run right now. Reported by: Vitaly Magerya Reviewed by: davidxu, jilles Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sat Nov 23 14:54:20 2013 (r258498) +++ head/lib/libthr/thread/thr_private.h Sat Nov 23 15:48:17 2013 (r258499) @@ -433,6 +433,9 @@ struct pthread { /* the sigaction should be used for deferred signal. */ struct sigaction deferred_sigact; + /* deferred signal delivery is performed, do not reenter. */ + int deferred_run; + /* Force new thread to exit. */ int force_exit; Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Sat Nov 23 14:54:20 2013 (r258498) +++ head/lib/libthr/thread/thr_sig.c Sat Nov 23 15:48:17 2013 (r258499) @@ -162,6 +162,7 @@ thr_sighandler(int sig, siginfo_t *info, act = _thr_sigact[sig-1].sigact; _thr_rwl_unlock(&_thr_sigact[sig-1].lock); errno = err; + curthread->deferred_run = 0; /* * if a thread is in critical region, for example it holds low level locks, @@ -320,14 +321,18 @@ check_deferred_signal(struct pthread *cu siginfo_t info; int uc_len; - if (__predict_true(curthread->deferred_siginfo.si_signo == 0)) + if (__predict_true(curthread->deferred_siginfo.si_signo == 0 || + curthread->deferred_run)) return; + curthread->deferred_run = 1; uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); - if (curthread->deferred_siginfo.si_signo == 0) + if (curthread->deferred_siginfo.si_signo == 0) { + curthread->deferred_run = 0; return; + } __fillcontextx2((char *)uc); act = curthread->deferred_sigact; uc->uc_sigmask = curthread->deferred_sigmask; From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 18:32:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02FE3C6A; Sat, 23 Nov 2013 18:32:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E419B24E0; Sat, 23 Nov 2013 18:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANIWuWl013751; Sat, 23 Nov 2013 18:32:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANIWrNl013730; Sat, 23 Nov 2013 18:32:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201311231832.rANIWrNl013730@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 23 Nov 2013 18:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258501 - in head/contrib: gcc gcc/cp gcc/doc gcclibs/libcpp gcclibs/libcpp/include libstdc++/include/ext 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 18:32:57 -0000 Author: pfg Date: Sat Nov 23 18:32:53 2013 New Revision: 258501 URL: http://svnweb.freebsd.org/changeset/base/258501 Log: gcc: Bring updates from Google's enhanced gcc-4.2.1. Google released and enhanced version of gcc-4.2.1 plus their local patches for Android[1]. The patches are owned by Google and the license hasn't been changed from the original GPLv2. We are only bringing a subset of the available patches that may be helpful in FreeBSD. Changes specific to android are not included. From the README.google file[1]. Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1: gcc/Makefile.in gcc/c-common.c gcc/c-common.h gcc/c-opts.c gcc/c-typeck.c gcc/cp/typeck.c gcc/doc/invoke.texi gcc/flags.h gcc/opts.c gcc/tree-flow.h gcc/tree-ssa-alias-warnings.c gcc/tree-ssa-alias.c Backport of -Wstrict-aliasing from mainline. Silvius Rus gcc/coverage.c: Patch coverage_checksum_string for PR 25351. Seongbae Park Not yet submitted to FSF. gcc/c-opts.c gcc/c-ppoutput.c gcc/c.opt gcc/doc/cppopts.texi libcpp/Makefile.in libcpp/directives-only.c libcpp/directives.c libcpp/files.c libcpp/include/cpplib.h libcpp/init.c libcpp/internal.h libcpp/macro.c Support for -fdirectives-only. Ollie Wild . Submitted to FSF but not yet approved. libstdc++-v3/include/ext/hashtable.h http://b/742065 http://b/629994 Reduce min size of hashtable for hash_map, hash_set from 53 to 5 libstdc++-v3/include/ext/hashtable.h http://b/629994 Do not iterate over buckets if hashtable is empty. gcc/common.opt gcc/doc/invoke.texi gcc/flags.h gcc/gimplify.c gcc/opts.c Add Saito's patch for -finstrument-functions-exclude-* options. gcc/common.opt gcc/doc/invoke.texi gcc/final.c gcc/flags.h gcc/opts.c gcc/testsuite/gcc.dg/Wframe-larger-than.c Add a new flag -Wframe-larger-than- which enables a new warning when a frame size of a function is larger than specified. This patch hasn't been integrated into gcc mainline yet. gcc/tree-vrp.c Add a hack to avoid using ivopts information for pointers starting at constant values. Reference: [1] https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/ Obtained from: Google Inc. MFC after: 3 weeks Added: head/contrib/gcc/tree-ssa-alias-warnings.c (contents, props changed) head/contrib/gcclibs/libcpp/directives-only.c (contents, props changed) Modified: head/contrib/gcc/c-common.c head/contrib/gcc/c-common.h head/contrib/gcc/c-opts.c head/contrib/gcc/c-ppoutput.c head/contrib/gcc/c-typeck.c head/contrib/gcc/c.opt head/contrib/gcc/common.opt head/contrib/gcc/coverage.c head/contrib/gcc/cp/typeck.c head/contrib/gcc/doc/cppopts.texi head/contrib/gcc/doc/invoke.texi head/contrib/gcc/final.c head/contrib/gcc/flags.h head/contrib/gcc/gimplify.c head/contrib/gcc/opts.c head/contrib/gcc/tree-flow.h head/contrib/gcc/tree-ssa-alias.c head/contrib/gcc/tree-vrp.c head/contrib/gcclibs/libcpp/Makefile.in head/contrib/gcclibs/libcpp/directives.c head/contrib/gcclibs/libcpp/files.c head/contrib/gcclibs/libcpp/include/cpplib.h head/contrib/gcclibs/libcpp/init.c head/contrib/gcclibs/libcpp/internal.h head/contrib/gcclibs/libcpp/macro.c head/contrib/libstdc++/include/ext/hashtable.h Modified: head/contrib/gcc/c-common.c ============================================================================== --- head/contrib/gcc/c-common.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c-common.c Sat Nov 23 18:32:53 2013 (r258501) @@ -983,35 +983,67 @@ unsigned_conversion_warning (tree result strict aliasing mode is in effect. OTYPE is the original TREE_TYPE of EXPR, and TYPE the type we're casting to. */ -void +bool strict_aliasing_warning (tree otype, tree type, tree expr) { - if (flag_strict_aliasing && warn_strict_aliasing - && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype) - && TREE_CODE (expr) == ADDR_EXPR + if (!(flag_strict_aliasing && POINTER_TYPE_P (type) + && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type)))) + return false; + + if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR && (DECL_P (TREE_OPERAND (expr, 0)) - || handled_component_p (TREE_OPERAND (expr, 0))) - && !VOID_TYPE_P (TREE_TYPE (type))) + || handled_component_p (TREE_OPERAND (expr, 0)))) { /* Casting the address of an object to non void pointer. Warn if the cast breaks type based aliasing. */ - if (!COMPLETE_TYPE_P (TREE_TYPE (type))) - warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " - "might break strict-aliasing rules"); + if (!COMPLETE_TYPE_P (TREE_TYPE (type)) && warn_strict_aliasing == 2) + { + warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " + "might break strict-aliasing rules"); + return true; + } else { - HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); + /* warn_strict_aliasing >= 3. This includes the default (3). + Only warn if the cast is dereferenced immediately. */ + HOST_WIDE_INT set1 = + get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); if (!alias_sets_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer will break strict-aliasing rules"); - else if (warn_strict_aliasing > 1 - && !alias_sets_might_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer might break strict-aliasing rules"); + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer will break strict-aliasing rules"); + return true; + } + else if (warn_strict_aliasing == 2 + && !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } } } + else + if ((warn_strict_aliasing == 1) && !VOID_TYPE_P (TREE_TYPE (otype))) + { + /* At this level, warn for any conversions, even if an address is + not taken in the same statement. This will likely produce many + false positives, but could be useful to pinpoint problems that + are not revealed at higher levels. */ + HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (otype)); + HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); + if (!COMPLETE_TYPE_P(type) + || !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } + } + + return false; } @@ -3108,6 +3140,85 @@ def_fn_type (builtin_type def, builtin_t builtin_types[def] = t; } +/* Build builtin functions common to both C and C++ language + frontends. */ + +static void +c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node) +{ +#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ + builtin_types[ENUM] = VALUE; +#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 0, 0); +#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 0, 1, ARG1); +#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6) \ + def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); +#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6, ARG7) \ + def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); +#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 1, 0); +#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 1, 1, ARG1); +#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_POINTER_TYPE(ENUM, TYPE) \ + builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); + +#include "builtin-types.def" + +#undef DEF_PRIMITIVE_TYPE +#undef DEF_FUNCTION_TYPE_1 +#undef DEF_FUNCTION_TYPE_2 +#undef DEF_FUNCTION_TYPE_3 +#undef DEF_FUNCTION_TYPE_4 +#undef DEF_FUNCTION_TYPE_5 +#undef DEF_FUNCTION_TYPE_6 +#undef DEF_FUNCTION_TYPE_VAR_0 +#undef DEF_FUNCTION_TYPE_VAR_1 +#undef DEF_FUNCTION_TYPE_VAR_2 +#undef DEF_FUNCTION_TYPE_VAR_3 +#undef DEF_FUNCTION_TYPE_VAR_4 +#undef DEF_FUNCTION_TYPE_VAR_5 +#undef DEF_POINTER_TYPE + builtin_types[(int) BT_LAST] = NULL_TREE; + + c_init_attributes (); + +#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ + NONANSI_P, ATTRS, IMPLICIT, COND) \ + if (NAME && COND) \ + def_builtin_1 (ENUM, NAME, CLASS, \ + builtin_types[(int) TYPE], \ + builtin_types[(int) LIBTYPE], \ + BOTH_P, FALLBACK_P, NONANSI_P, \ + built_in_attributes[(int) ATTRS], IMPLICIT); +#include "builtins.def" +#undef DEF_BUILTIN + + build_common_builtin_nodes (); + + targetm.init_builtins (); + if (flag_mudflap) + mudflap_init (); +} + /* Build tree nodes and builtin functions common to both C and C++ language frontends. */ @@ -3320,77 +3431,8 @@ c_common_nodes_and_builtins (void) va_list_ref_type_node = build_reference_type (va_list_type_node); } -#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ - builtin_types[ENUM] = VALUE; -#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 0, 0); -#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 0, 1, ARG1); -#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6) \ - def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); -#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6, ARG7) \ - def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); -#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 1, 0); -#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 1, 1, ARG1); -#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_POINTER_TYPE(ENUM, TYPE) \ - builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); - -#include "builtin-types.def" - -#undef DEF_PRIMITIVE_TYPE -#undef DEF_FUNCTION_TYPE_1 -#undef DEF_FUNCTION_TYPE_2 -#undef DEF_FUNCTION_TYPE_3 -#undef DEF_FUNCTION_TYPE_4 -#undef DEF_FUNCTION_TYPE_5 -#undef DEF_FUNCTION_TYPE_6 -#undef DEF_FUNCTION_TYPE_VAR_0 -#undef DEF_FUNCTION_TYPE_VAR_1 -#undef DEF_FUNCTION_TYPE_VAR_2 -#undef DEF_FUNCTION_TYPE_VAR_3 -#undef DEF_FUNCTION_TYPE_VAR_4 -#undef DEF_FUNCTION_TYPE_VAR_5 -#undef DEF_POINTER_TYPE - builtin_types[(int) BT_LAST] = NULL_TREE; - - c_init_attributes (); - -#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ - NONANSI_P, ATTRS, IMPLICIT, COND) \ - if (NAME && COND) \ - def_builtin_1 (ENUM, NAME, CLASS, \ - builtin_types[(int) TYPE], \ - builtin_types[(int) LIBTYPE], \ - BOTH_P, FALLBACK_P, NONANSI_P, \ - built_in_attributes[(int) ATTRS], IMPLICIT); -#include "builtins.def" -#undef DEF_BUILTIN - - build_common_builtin_nodes (); - - targetm.init_builtins (); - if (flag_mudflap) - mudflap_init (); + if (!flag_preprocess_only) + c_define_builtins (va_list_ref_type_node, va_list_arg_type_node); main_identifier_node = get_identifier ("main"); Modified: head/contrib/gcc/c-common.h ============================================================================== --- head/contrib/gcc/c-common.h Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c-common.h Sat Nov 23 18:32:53 2013 (r258501) @@ -654,7 +654,7 @@ extern void binary_op_error (enum tree_c extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); -extern void strict_aliasing_warning(tree, tree, tree); +extern bool strict_aliasing_warning (tree, tree, tree); extern void empty_body_warning (tree, tree); extern tree convert_and_check (tree, tree); extern void overflow_warning (tree); Modified: head/contrib/gcc/c-opts.c ============================================================================== --- head/contrib/gcc/c-opts.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c-opts.c Sat Nov 23 18:32:53 2013 (r258501) @@ -396,7 +396,7 @@ c_common_handle_option (size_t scode, co if (c_dialect_cxx ()) warn_sign_compare = value; warn_switch = value; - warn_strict_aliasing = value; + set_warn_strict_aliasing (value); warn_strict_overflow = value; warn_address = value; @@ -606,6 +606,10 @@ c_common_handle_option (size_t scode, co disable_builtin_function (arg); break; + case OPT_fdirectives_only: + cpp_opts->directives_only = 1; + break; + case OPT_fdollars_in_identifiers: cpp_opts->dollars_in_ident = value; break; @@ -1329,6 +1333,11 @@ sanitize_cpp_opts (void) if (flag_dump_macros == 'M') flag_no_output = 1; + /* By default, -fdirectives-only implies -dD. This allows subsequent phases + to perform proper macro expansion. */ + if (cpp_opts->directives_only && !cpp_opts->preprocessed && !flag_dump_macros) + flag_dump_macros = 'D'; + /* Disable -dD, -dN and -dI if normal output is suppressed. Allow -dM since at least glibc relies on -M -dM to work. */ /* Also, flag_no_output implies flag_no_line_commands, always. */ @@ -1359,6 +1368,14 @@ sanitize_cpp_opts (void) actually output the current directory? */ if (flag_working_directory == -1) flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE); + + if (cpp_opts->directives_only) + { + if (warn_unused_macros) + error ("-fdirectives-only is incompatible with -Wunused_macros"); + if (cpp_opts->traditional) + error ("-fdirectives-only is incompatible with -traditional"); + } } /* Add include path with a prefix at the front of its name. */ @@ -1442,6 +1459,8 @@ finish_options (void) } } } + else if (cpp_opts->directives_only) + cpp_init_special_builtins (parse_in); include_cursor = 0; push_command_line_include (); Modified: head/contrib/gcc/c-ppoutput.c ============================================================================== --- head/contrib/gcc/c-ppoutput.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c-ppoutput.c Sat Nov 23 18:32:53 2013 (r258501) @@ -41,6 +41,8 @@ static struct /* General output routines. */ static void scan_translation_unit (cpp_reader *); +static void print_lines_directives_only (int, const void *, size_t); +static void scan_translation_unit_directives_only (cpp_reader *); static void scan_translation_unit_trad (cpp_reader *); static void account_for_newlines (const unsigned char *, size_t); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); @@ -75,6 +77,9 @@ preprocess_file (cpp_reader *pfile) } else if (cpp_get_options (pfile)->traditional) scan_translation_unit_trad (pfile); + else if (cpp_get_options (pfile)->directives_only + && !cpp_get_options (pfile)->preprocessed) + scan_translation_unit_directives_only (pfile); else scan_translation_unit (pfile); @@ -179,6 +184,26 @@ scan_translation_unit (cpp_reader *pfile } } +static void +print_lines_directives_only (int lines, const void *buf, size_t size) +{ + print.src_line += lines; + fwrite (buf, 1, size, print.outf); +} + +/* Writes out the preprocessed file, handling spacing and paste + avoidance issues. */ +static void +scan_translation_unit_directives_only (cpp_reader *pfile) +{ + struct _cpp_dir_only_callbacks cb; + + cb.print_lines = print_lines_directives_only; + cb.maybe_print_line = maybe_print_line; + + _cpp_preprocess_dir_only (pfile, &cb); +} + /* Adjust print.src_line for newlines embedded in output. */ static void account_for_newlines (const unsigned char *str, size_t len) Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c-typeck.c Sat Nov 23 18:32:53 2013 (r258501) @@ -1876,6 +1876,19 @@ build_indirect_ref (tree ptr, const char if (TREE_CODE (type) == POINTER_TYPE) { + if (TREE_CODE (pointer) == CONVERT_EXPR + || TREE_CODE (pointer) == NOP_EXPR + || TREE_CODE (pointer) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (pointer, 0)), + type, TREE_OPERAND (pointer, 0))) + TREE_NO_WARNING (pointer) = 1; + } + if (TREE_CODE (pointer) == ADDR_EXPR && (TREE_TYPE (TREE_OPERAND (pointer, 0)) == TREE_TYPE (type))) @@ -3562,7 +3575,8 @@ build_c_cast (tree type, tree expr) warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer " "of different size"); - strict_aliasing_warning (otype, type, expr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (otype, type, expr); /* If pedantic, warn for conversions between function and object pointer types, except for converting a null pointer constant Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/c.opt Sat Nov 23 18:32:53 2013 (r258501) @@ -494,6 +494,10 @@ fdefault-inline C++ ObjC++ Inline member functions by default +fdirectives-only +C ObjC C++ ObjC++ +Preprocess directives only. + fdollars-in-identifiers C ObjC C++ ObjC++ Permit '$' as an identifier character Modified: head/contrib/gcc/common.opt ============================================================================== --- head/contrib/gcc/common.opt Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/common.opt Sat Nov 23 18:32:53 2013 (r258501) @@ -95,7 +95,11 @@ Warn when an inlined function cannot be Wlarger-than- Common RejectNegative Joined UInteger --Wlarger-than- Warn if an object is larger than bytes +-Wlarger-than- Warn if an object is larger than bytes + +Wframe-larger-than- +Common RejectNegative Joined UInteger +-Wframe-larger-than- Warn if the frame size of a function is larger than bytes Wunsafe-loop-optimizations Common Var(warn_unsafe_loop_optimizations) @@ -537,6 +541,14 @@ finstrument-functions Common Report Var(flag_instrument_function_entry_exit) Instrument function entry and exit with profiling calls +finstrument-functions-exclude-function-list= +Common RejectNegative Joined +-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions + +finstrument-functions-exclude-file-list= +Common RejectNegative Joined +-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files + fipa-cp Common Report Var(flag_ipa_cp) Perform Interprocedural constant propagation Modified: head/contrib/gcc/coverage.c ============================================================================== --- head/contrib/gcc/coverage.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/coverage.c Sat Nov 23 18:32:53 2013 (r258501) @@ -429,57 +429,75 @@ tree_coverage_counter_ref (unsigned coun static unsigned coverage_checksum_string (unsigned chksum, const char *string) { - int i; char *dup = NULL; + char *ptr; /* Look for everything that looks if it were produced by get_file_function_name and zero out the second part that may result from flag_random_seed. This is not critical as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) +#define GLOBAL_PREFIX "_GLOBAL__" +#define TRAILING_N "N_" +#define ISCAPXDIGIT(a) (((a) >= '0' && (a) <= '9') || ((a) >= 'A' && (a) <= 'F')) + if ((ptr = strstr (string, GLOBAL_PREFIX))) { - int offset = 0; - if (!strncmp (string + i, "_GLOBAL__N_", 11)) - offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) - offset = 9; - - /* C++ namespaces do have scheme: - _GLOBAL__N___functionname - since filename might contain extra underscores there seems - to be no better chance then walk all possible offsets looking - for magicnuber. */ - if (offset) - { - for (i = i + offset; string[i]; i++) - if (string[i]=='_') - { - int y; - - for (y = 1; y < 9; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 9 || string[i + 9] != '_') - continue; - for (y = 10; y < 18; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 18) - continue; - if (!dup) - string = dup = xstrdup (string); - for (y = 10; y < 18; y++) - dup[i + y] = '0'; - } - break; - } + /* Skip _GLOBAL__. */ + ptr += strlen (GLOBAL_PREFIX); + + /* Skip optional N_ (in case __GLOBAL_N__). */ + if (!strncmp (ptr, TRAILING_N, strlen (TRAILING_N))) + ptr += strlen (TRAILING_N); + /* At this point, ptr should point after "_GLOBAL__N_" or "_GLOBAL__". */ + + while ((ptr = strchr (ptr, '_')) != NULL) + { + int y; + /* For every "_" in the rest of the string, + try the follwing pattern matching */ + + /* Skip over '_'. */ + ptr++; +#define NDIGITS (8) + /* Try matching the pattern: + <8-digit hex>_<8-digit hex> + The second number is randomly generated + so we want to mask it out before computing the checksum. */ + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + if (y != NDIGITS || *ptr != '_') + continue; + /* Skip over '_' again. */ + ptr++; + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + + if (y == NDIGITS) + { + /* We have a match. + Duplicate the string and mask out + the second 8-digit number. */ + dup = xstrdup (string); + ptr = dup + (ptr - string); + for(y = -NDIGITS - 1 ; y < 0; y++) + { + ptr[y] = '0'; + } + ptr = dup; + break; + } + } + /* "ptr" should be NULL if we couldn't find the match + (strchr will return NULL if no match is found), + or it should point to dup which contains the string + with the random part masked. */ } - chksum = crc32_string (chksum, string); + chksum = crc32_string (chksum, (ptr) ? ptr : string); + if (dup) - free (dup); + free (dup); return chksum; } Modified: head/contrib/gcc/cp/typeck.c ============================================================================== --- head/contrib/gcc/cp/typeck.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/cp/typeck.c Sat Nov 23 18:32:53 2013 (r258501) @@ -2334,6 +2334,19 @@ build_indirect_ref (tree ptr, const char types. */ tree t = canonical_type_variant (TREE_TYPE (type)); + if (TREE_CODE (ptr) == CONVERT_EXPR + || TREE_CODE (ptr) == NOP_EXPR + || TREE_CODE (ptr) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (ptr, 0)), + type, TREE_OPERAND (ptr, 0))) + TREE_NO_WARNING (ptr) = 1; + } + if (VOID_TYPE_P (t)) { /* A pointer to incomplete type (other than cv void) can be @@ -5256,7 +5269,8 @@ build_reinterpret_cast_1 (tree type, tre /* We need to strip nops here, because the frontend likes to create (int *)&a for array-to-pointer decay, instead of &a[0]. */ STRIP_NOPS (sexpr); - strict_aliasing_warning (intype, type, sexpr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (intype, type, sexpr); return fold_if_not_in_template (build_nop (type, expr)); } Modified: head/contrib/gcc/doc/cppopts.texi ============================================================================== --- head/contrib/gcc/doc/cppopts.texi Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/doc/cppopts.texi Sat Nov 23 18:32:53 2013 (r258501) @@ -506,6 +506,22 @@ Search @var{dir} only for header files r @xref{Search Path}. @end ifset +@item -fdirectives-only +@opindex fdirectives-only +This option provides a simplified preprocessor to improve the +performance of distributed build systems such as distcc. It's +behavior depends on a number of other flags. + +If the @option{-E} option is enabled, it suppresses things like macro +expansion, trigraph conversion, and escaped newline splicing +outside of directives. All directives are processed normally, except that +macro definitions are output similar to the @option{-dD} option. + +If the @option{-fpreprocessed} option is enabled, it suppresses +predefinition of most builtin and command line macros. This +prevents duplicate definition of macros output with the @option{-E} +option. + @item -fdollars-in-identifiers @opindex fdollars-in-identifiers @anchor{fdollars-in-identifiers} Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/doc/invoke.texi Sat Nov 23 18:32:53 2013 (r258501) @@ -214,7 +214,8 @@ in the following sections. -Wimport -Wno-import -Winit-self -Winline @gol -Wno-int-to-pointer-cast @gol -Wno-invalid-offsetof -Winvalid-pch @gol --Wlarger-than-@var{len} -Wunsafe-loop-optimizations -Wlong-long @gol +-Wlarger-than-@var{len} -Wframe-larger-than-@var{len} @gol +-Wunsafe-loop-optimizations -Wlong-long @gol -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol @@ -758,6 +759,8 @@ See S/390 and zSeries Options. -fnon-call-exceptions -funwind-tables @gol -fasynchronous-unwind-tables @gol -finhibit-size-directive -finstrument-functions @gol +-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol +-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol -fno-common -fno-ident @gol -fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol -fno-jump-tables @gol @@ -2505,14 +2508,40 @@ It warns about code which might break th compiler is using for optimization. The warning does not catch all cases, but does attempt to catch the more common pitfalls. It is included in @option{-Wall}. +It is equivalent to -Wstrict-aliasing=3 -@item -Wstrict-aliasing=2 -@opindex Wstrict-aliasing=2 +@item -Wstrict-aliasing=n +@opindex Wstrict-aliasing=n This option is only active when @option{-fstrict-aliasing} is active. It warns about code which might break the strict aliasing rules that the -compiler is using for optimization. This warning catches more cases than -@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous -cases that are safe. +compiler is using for optimization. +Higher levels correspond to higher accuracy (fewer false positives). +Higher levels also correspond to more effort, similar to the way -O works. +@option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n}, +with n=3. + +Level 1: Most aggressive, quick, least accurate. +Possibly useful when higher levels +do not warn but -fstrict-aliasing still breaks the code, as it has very few +false negatives. However, it has many false positives. +Warns for all pointer conversions between possibly incompatible types, +even if never dereferenced. Runs in the frontend only. + +Level 2: Aggressive, quick, not too precise. +May still have many false positives (not as many as level 1 though), +and few false negatives (but possibly more than level 1). +Unlike level 1, it only warns when an address is taken. Warns about +incomplete types. Runs in the frontend only. + +Level 3 (default for @option{-Wstrict-aliasing}): +Should have very few false positives and few false +negatives. Slightly slower than levels 1 or 2 when optimization is enabled. +Takes care of the common punn+dereference pattern in the frontend: +@code{*(int*)&some_float}. +If optimization is enabled, it also runs in the backend, where it deals +with multiple statement cases using flow-sensitive points-to information. +Only warns when the converted pointer is dereferenced. +Does not warn about incomplete types. @item -Wstrict-overflow @item -Wstrict-overflow=@var{n} @@ -2828,6 +2857,10 @@ global variable or whenever a built-in f @opindex Wlarger-than Warn whenever an object of larger than @var{len} bytes is defined. +@item -Wframe-larger-than-@var{len} +@opindex Wframe-larger-than +Warn whenever the frame size of a function is larger than @var{len} bytes. + @item -Wunsafe-loop-optimizations @opindex Wunsafe-loop-optimizations Warn if the loop cannot be optimized because the compiler could not @@ -13355,6 +13388,37 @@ interrupt routines, and any functions fr cannot safely be called (perhaps signal handlers, if the profiling routines generate output or allocate memory). +@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} +@opindex finstrument-functions-exclude-file-list + +Set the list of functions that are excluded from instrumentation (see +the description of @code{-finstrument-functions}). If the file that +contains a function definition matches with one of @var{file}, then +that function is not instrumented. The match is done on substrings: +if the @var{file} parameter is a substring of the file name, it is +considered to be a match. + +For example, +@code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys} +will exclude any inline function defined in files whose pathnames +contain @code{/bits/stl} or @code{include/sys}. + +If, for some reason, you want to include letter @code{','} in one of +@var{sym}, write @code{'\,'}. For example, +@code{-finstrument-functions-exclude-file-list='\,\,tmp'} +(note the single quote surrounding the option). + +@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} +@opindex finstrument-functions-exclude-function-list + +This is similar to @code{-finstrument-functions-exclude-file-list}, +but this option sets the list of function names to be excluded from +instrumentation. The function name to be matched is its user-visible +name, such as @code{vector blah(const vector &)}, not the +internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}). The +match is done on substrings: if the @var{sym} parameter is a substring +of the function name, it is considered to be a match. + @item -fstack-check @opindex fstack-check Generate code to verify that you do not go beyond the boundary of the @@ -13932,3 +13996,4 @@ exist, because otherwise they won't get @xref{Protoize Caveats}, for more information on how to use @code{protoize} successfully. + Modified: head/contrib/gcc/final.c ============================================================================== --- head/contrib/gcc/final.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/final.c Sat Nov 23 18:32:53 2013 (r258501) @@ -1425,6 +1425,15 @@ final_start_function (rtx first ATTRIBUT TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1; } + if (warn_frame_larger_than + && get_frame_size () > frame_larger_than_size) + { + /* Issue a warning */ + warning (OPT_Wframe_larger_than_, + "the frame size of %wd bytes is larger than %wd bytes", + get_frame_size (), frame_larger_than_size); + } + /* First output the function prologue: code to set up the stack frame. */ targetm.asm_out.function_prologue (file, get_frame_size ()); @@ -4083,4 +4092,3 @@ struct tree_opt_pass pass_clean_state = 0, /* todo_flags_finish */ 0 /* letter */ }; - Modified: head/contrib/gcc/flags.h ============================================================================== --- head/contrib/gcc/flags.h Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/flags.h Sat Nov 23 18:32:53 2013 (r258501) @@ -122,6 +122,15 @@ extern bool extra_warnings; extern void set_Wunused (int setting); +/* Used to set the level of -Wstrict-aliasing, when no level is specified. + The external way to set the default level is to use + -Wstrict-aliasing=level. + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level. */ + +extern void set_warn_strict_aliasing (int onoff); + /* Nonzero means warn about any objects definitions whose size is larger than N bytes. Also want about function definitions whose returned values are larger than N bytes. The value N is in `larger_than_size'. */ @@ -129,6 +138,12 @@ extern void set_Wunused (int setting); extern bool warn_larger_than; extern HOST_WIDE_INT larger_than_size; +/* Nonzero means warn about any function whose frame size is larger + than N bytes. */ + +extern bool warn_frame_larger_than; +extern HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict aliasing safe. */ @@ -287,6 +302,10 @@ extern const char *flag_random_seed; #define abi_version_at_least(N) \ (flag_abi_version == 0 || flag_abi_version >= (N)) +/* Return whether the function should be excluded from + instrumentation. */ +extern bool flag_instrument_functions_exclude_p (tree fndecl); + /* True if the given mode has a NaN representation and the treatment of NaN operands is important. Certain optimizations, such as folding x * 0 into 0, are not correct for NaN operands, and are normally Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/gimplify.c Sat Nov 23 18:32:53 2013 (r258501) @@ -6397,7 +6397,8 @@ gimplify_function_tree (tree fndecl) catch the exit hook. */ /* ??? Add some way to ignore exceptions for this TFE. */ if (flag_instrument_function_entry_exit - && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)) + && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl) + && !flag_instrument_functions_exclude_p (fndecl)) { tree tf, x, bind; Modified: head/contrib/gcc/opts.c ============================================================================== --- head/contrib/gcc/opts.c Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/opts.c Sat Nov 23 18:32:53 2013 (r258501) @@ -59,6 +59,11 @@ bool extra_warnings; bool warn_larger_than; HOST_WIDE_INT larger_than_size; +/* True to warn about any function whose frame size is larger + * than N bytes. */ +bool warn_frame_larger_than; +HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict-aliasing safe. */ int warn_strict_aliasing; @@ -358,6 +363,15 @@ static bool flag_unroll_loops_set, flag_ static bool flag_value_profile_transformations_set; static bool flag_peel_loops_set, flag_branch_probabilities_set; +/* Functions excluded from profiling. */ + +typedef char *char_p; /* For DEF_VEC_P. */ +DEF_VEC_P(char_p); +DEF_VEC_ALLOC_P(char_p,heap); + +static VEC(char_p,heap) *flag_instrument_functions_exclude_functions; +static VEC(char_p,heap) *flag_instrument_functions_exclude_files; + /* Input file names. */ const char **in_fnames; unsigned num_in_fnames; @@ -604,6 +618,87 @@ add_input_filename (const char *filename in_fnames[num_in_fnames - 1] = filename; } +/* Add functions or file names to a vector of names to exclude from + instrumentation. */ + +static void +add_instrument_functions_exclude_list (VEC(char_p,heap) **pvec, + const char* arg) +{ + char *tmp; + char *r; + char *w; + char *token_start; + + /* We never free this string. */ + tmp = xstrdup (arg); + + r = tmp; + w = tmp; + token_start = tmp; + + while (*r != '\0') + { + if (*r == ',') + { + *w++ = '\0'; + ++r; + VEC_safe_push (char_p, heap, *pvec, token_start); + token_start = w; + } + if (*r == '\\' && r[1] == ',') + { + *w++ = ','; + r += 2; + } + else + *w++ = *r++; + } + if (*token_start != '\0') + VEC_safe_push (char_p, heap, *pvec, token_start); +} + +/* Return whether we should exclude FNDECL from instrumentation. */ + +bool +flag_instrument_functions_exclude_p (tree fndecl) +{ + if (VEC_length (char_p, flag_instrument_functions_exclude_functions) > 0) + { + const char *name; + int i; + char *s; + + name = lang_hooks.decl_printable_name (fndecl, 0); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_functions, + i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0) + { + const char *name; + int i; + char *s; + + name = DECL_SOURCE_FILE (fndecl); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_files, i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + return false; +} + /* Decode and handle the vector of command line options. LANG_MASK contains has a single bit set representing the current language. */ @@ -979,7 +1074,15 @@ common_handle_option (size_t scode, cons warn_larger_than = value != -1; break; + case OPT_Wframe_larger_than_: + frame_larger_than_size = value; + warn_frame_larger_than = value != -1; + break; + case OPT_Wstrict_aliasing: + set_warn_strict_aliasing (value); + break; + case OPT_Wstrict_aliasing_: warn_strict_aliasing = value; break; @@ -1086,6 +1189,16 @@ common_handle_option (size_t scode, cons set_param_value ("max-inline-insns-auto", value / 2); break; + case OPT_finstrument_functions_exclude_function_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_functions, arg); + break; + + case OPT_finstrument_functions_exclude_file_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_files, arg); + break; + case OPT_fmessage_length_: pp_set_line_maximum_length (global_dc->printer, value); break; @@ -1348,6 +1461,20 @@ set_Wunused (int setting) warn_unused_value = setting; } +/* Used to set the level of strict aliasing warnings, + when no level is specified (i.e., when -Wstrict-aliasing, and not + -Wstrict-aliasing=level was given). + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level, currently 3. */ +void +set_warn_strict_aliasing (int onoff) +{ + gcc_assert (onoff == 0 || onoff == 1); + if (onoff != 0) + warn_strict_aliasing = 3; +} + /* The following routines are useful in setting all the flags that -ffast-math and -fno-fast-math imply. */ void Modified: head/contrib/gcc/tree-flow.h ============================================================================== --- head/contrib/gcc/tree-flow.h Sat Nov 23 17:20:24 2013 (r258500) +++ head/contrib/gcc/tree-flow.h Sat Nov 23 18:32:53 2013 (r258501) @@ -694,6 +694,8 @@ static inline bool overlap_subvar (unsig definition, a function with this prototype is called. */ typedef bool (*walk_use_def_chains_fn) (tree, tree, void *); +/* In tree-ssa-alias-warnings.c */ +extern void strict_aliasing_warning_backend (void); /* In tree-ssa.c */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 18:50: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3C7F219; Sat, 23 Nov 2013 18:50:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C280B258D; Sat, 23 Nov 2013 18:50:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANIohZC019932; Sat, 23 Nov 2013 18:50:43 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANIohrT019593; Sat, 23 Nov 2013 18:50:43 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311231850.rANIohrT019593@svn.freebsd.org> From: Andreas Tobler Date: Sat, 23 Nov 2013 18:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258502 - in head/lib/libc: powerpc 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 18:50:44 -0000 Author: andreast Date: Sat Nov 23 18:50:43 2013 New Revision: 258502 URL: http://svnweb.freebsd.org/changeset/base/258502 Log: Get rid of the CONCAT macro. Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc64/SYS.h Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Sat Nov 23 18:32:53 2013 (r258501) +++ head/lib/libc/powerpc/SYS.h Sat Nov 23 18:50:43 2013 (r258502) @@ -36,24 +36,24 @@ #define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_, name)); \ + li 0,(SYS_##name); \ sc #define SYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bso 2b #define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) @@ -62,9 +62,9 @@ ENTRY(__CONCAT(__sys_, name)); \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Sat Nov 23 18:32:53 2013 (r258501) +++ head/lib/libc/powerpc64/SYS.h Sat Nov 23 18:50:43 2013 (r258502) @@ -36,7 +36,7 @@ #define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_, name)); \ + li 0,(SYS_##name); \ sc #define SYSCALL(name) \ @@ -51,17 +51,17 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ - _SYSCALL(name); \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL(name); \ bso 2b #define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ mflr %r0; \ @@ -77,9 +77,9 @@ ENTRY(__CONCAT(__sys_, name)); \ #define RSYSCALL(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_, name)); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ - WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ \ From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 18:52: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECF7F379; Sat, 23 Nov 2013 18:52:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBEBA25A6; Sat, 23 Nov 2013 18:52:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANIqEgi020365; Sat, 23 Nov 2013 18:52:14 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANIqEZD020364; Sat, 23 Nov 2013 18:52:14 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311231852.rANIqEZD020364@svn.freebsd.org> From: Andreas Tobler Date: Sat, 23 Nov 2013 18:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258503 - head/sys/powerpc/pseries 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 18:52:15 -0000 Author: andreast Date: Sat Nov 23 18:52:14 2013 New Revision: 258503 URL: http://svnweb.freebsd.org/changeset/base/258503 Log: Limit the large page size to 16MB for now. MFC after: 1 week Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Sat Nov 23 18:50:43 2013 (r258502) +++ head/sys/powerpc/pseries/mmu_phyp.c Sat Nov 23 18:52:14 2013 (r258503) @@ -165,6 +165,11 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t nptlp--; } } + + /* For now we allow shift only to be <= 0x18. */ + if (shift >= 0x18) + shift = 0x18; + moea64_large_page_shift = shift; moea64_large_page_size = 1ULL << shift; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 18:58:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44A06514; Sat, 23 Nov 2013 18:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3350525C3; Sat, 23 Nov 2013 18:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANIwHoC021067; Sat, 23 Nov 2013 18:58:17 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANIwHs0021064; Sat, 23 Nov 2013 18:58:17 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311231858.rANIwHs0021064@svn.freebsd.org> From: Andreas Tobler Date: Sat, 23 Nov 2013 18:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258504 - in head/sys/powerpc: aim include ofw 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 18:58:18 -0000 Author: andreast Date: Sat Nov 23 18:58:17 2013 New Revision: 258504 URL: http://svnweb.freebsd.org/changeset/base/258504 Log: Save and restore the trap vectors when doing OF calls on pSeries machines. It turned out that on pSeries machines the call into OF modified the trap vectors and this made further behaviour unpredictable. With this commit I'm now able to boot multi user on a network booted environment on my IntelliStation 285. This is a POWER5+ machine. Discussed with: nwhitehorn MFC after: 1 week Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/include/ofw_machdep.h head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Nov 23 18:52:14 2013 (r258503) +++ head/sys/powerpc/aim/machdep.c Sat Nov 23 18:58:17 2013 (r258504) @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -249,6 +250,7 @@ extern void *dblow, *dbsize; extern void *imisstrap, *imisssize; extern void *dlmisstrap, *dlmisssize; extern void *dsmisstrap, *dsmisssize; +char save_trap_init[0x2f00]; /* EXC_LAST */ uintptr_t powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, @@ -273,6 +275,9 @@ powerpc_init(vm_offset_t startkernel, vm trap_offset = 0; cacheline_warn = 0; + /* Save trap vectors. */ + ofw_save_trap_vec(save_trap_init); + #ifdef WII /* * The Wii loader doesn't pass us any environment so, mdp Modified: head/sys/powerpc/include/ofw_machdep.h ============================================================================== --- head/sys/powerpc/include/ofw_machdep.h Sat Nov 23 18:52:14 2013 (r258503) +++ head/sys/powerpc/include/ofw_machdep.h Sat Nov 23 18:58:17 2013 (r258504) @@ -47,5 +47,6 @@ void OF_reboot(void); void ofw_mem_regions(struct mem_region **, int *, struct mem_region **, int *); void ofw_quiesce(void); /* Must be called before VM is up! */ +void ofw_save_trap_vec(char *); #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 23 18:52:14 2013 (r258503) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 23 18:58:17 2013 (r258504) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ]; static struct mem_region OFfree[PHYS_AVAIL_SZ]; @@ -70,10 +71,31 @@ extern register_t ofmsr[5]; extern void *openfirmware_entry; static void *fdt; int ofw_real_mode; +extern char save_trap_init[0x2f00]; /* EXC_LAST */ +char save_trap_of[0x2f00]; /* EXC_LAST */ int ofwcall(void *); static int openfirmware(void *args); +__inline void +ofw_save_trap_vec(char *save_trap_vec) +{ + if (apple_hacks) + return; + + bcopy((void *)EXC_RST, save_trap_vec, EXC_LAST - EXC_RST); +} + +static __inline void +ofw_restore_trap_vec(char *restore_trap_vec) +{ + if (apple_hacks) + return; + + bcopy(restore_trap_vec, (void *)EXC_RST, EXC_LAST - EXC_RST); + __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); +} + /* * Saved SPRG0-3 from OpenFirmware. Will be restored prior to the callback. */ @@ -524,6 +546,12 @@ openfirmware_core(void *args) ofw_sprg_prepare(); + /* Save trap vectors */ + ofw_save_trap_vec(save_trap_of); + + /* Restore initially saved trap vectors */ + ofw_restore_trap_vec(save_trap_init); + #if defined(AIM) && !defined(__powerpc64__) /* * Clear battable[] translations @@ -535,6 +563,10 @@ openfirmware_core(void *args) #endif result = ofwcall(args); + + /* Restore trap vecotrs */ + ofw_restore_trap_vec(save_trap_of); + ofw_sprg_restore(); intr_restore(oldmsr); From owner-svn-src-all@FreeBSD.ORG Sat Nov 23 23:54: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF055D8C; Sat, 23 Nov 2013 23:54:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDAFB2286; Sat, 23 Nov 2013 23:54:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rANNscMl020927; Sat, 23 Nov 2013 23:54:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rANNscU0020926; Sat, 23 Nov 2013 23:54:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201311232354.rANNscU0020926@svn.freebsd.org> From: Mateusz Guzik Date: Sat, 23 Nov 2013 23:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258505 - stable/10/sys/geom/nop X-SVN-Group: stable-10 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.16 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2013 23:54:39 -0000 Author: mjg Date: Sat Nov 23 23:54:38 2013 New Revision: 258505 URL: http://svnweb.freebsd.org/changeset/base/258505 Log: MFC r256951: gnop: make sure that newly allocated memory for softc is zeroed This prevents mtx_init from encountering non-zeros and panicking the kernel as a result. Approved by: re Modified: stable/10/sys/geom/nop/g_nop.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/geom/nop/g_nop.c ============================================================================== --- stable/10/sys/geom/nop/g_nop.c Sat Nov 23 18:58:17 2013 (r258504) +++ stable/10/sys/geom/nop/g_nop.c Sat Nov 23 23:54:38 2013 (r258505) @@ -214,7 +214,7 @@ g_nop_create(struct gctl_req *req, struc } } gp = g_new_geomf(mp, "%s", name); - sc = g_malloc(sizeof(*sc), M_WAITOK); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); sc->sc_offset = offset; sc->sc_explicitsize = explicitsize; sc->sc_error = ioerror;