From owner-svn-src-head@FreeBSD.ORG Sun Nov 17 01:59:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 02:03:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 02:03:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 02:05:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 02:26:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 05:03:16 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 05:38:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 06:50:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 14:07:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 14:44:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 15:09:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 15:12:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 15:14:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 16:07:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:31:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:35:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:42:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:46:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:48:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 17:53:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:03:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:07:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:12:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:15:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84996548 for ; Sun, 17 Nov 2013 18:15:10 +0000 (UTC) Received: from mail-qc0-x229.google.com (mail-qc0-x229.google.com [IPv6:2607:f8b0:400d:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 410922B88 for ; Sun, 17 Nov 2013 18:15:10 +0000 (UTC) Received: by mail-qc0-f169.google.com with SMTP id u18so3352772qcx.0 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=mZKTUkNJj2uPlLvtcorejF3aiw2SKPvZm2WF7upTavNFHXBqBUPC5EX3ijbwzcLLQA OQCce1H5g7W2/IRP+5D9ONBIT+4vbcNhvfSwl5004nAiDz+Kv+40Wx/P8xqJ1ht8IEuD PqNR5xvYBdFjWZ3xdnoY/m1hAwRWl/cReVRlpKXN/pR5Y3pkHH0JrMHXcsXRzragZ9wx XMTI9W43F98pNmI0+T+F0fE4owO4Zc0fVHij1dEYgSD5H5GN9h/l6s3msTXDUlOPEDib 5q6eiyF12jMLGJVT++lyOPzG3Cdpr1oB6Zxhu+CFNfIdvKRgCwYxnYi1RxJZElZk7Zwh h+HQ== X-Gm-Message-State: ALoCoQl2xAujLdhpmVO9uCG/4TMuPD96V+0iihfU4djh0E3mwi4Z6swgH4fFjXpn2r4b75/Dzrn3 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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:16:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:27:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 18:46:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 19:01:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 19:37:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 19:50:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 20:29:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 20:58:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 22:31:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 22:52:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 22:59:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 23:12:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 23:19:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 23:28:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Sun Nov 17 23:51:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 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-head@FreeBSD.ORG Mon Nov 18 01:28:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 03:24:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 11:28:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 12:44:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 12:47:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 12:57:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 14:22:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 14:55:33 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 15:11:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 15:22:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 16:04:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 16:09:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 16:11:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 16:25:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 16:51:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 17:52:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 18:14:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 18:45:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 18:49:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 19:13:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 19:55:10 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 19:57:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 20:01:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 20:21:45 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 20:36:06 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 20:40:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 22:53:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 23:11:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Mon Nov 18 23:11:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 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-head@FreeBSD.ORG Tue Nov 19 00:33:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 00:34:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 00:37:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 00:40:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 00:43:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 10:05:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 10:10:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 10:17:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 10:49:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 10:51:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 11:04:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 11:19:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 12:11:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 12:12:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 13:32:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 14:30:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 15:35:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 15:43:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 16:11:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 17:53:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 18:04:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 18:35:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 18:35:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 18:43:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 18:45:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 19:55:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 21:06:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 22:14:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 22:55:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 23:31:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Tue Nov 19 23:37:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 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-head@FreeBSD.ORG Wed Nov 20 00:17:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 01:33:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 01:42:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 02:16:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 02:20:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 08:27:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 08:45:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 08:47:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 09:03:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 11:10:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 11:47:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 11:52:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 12:32:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 13:22:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 14:01:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 14:17:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 14:21:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 14:32:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 15:53:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 16:42:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 17:48:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 19:41:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:11:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:12:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:21:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:25:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:28:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:37:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:37:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 20:59:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FB3929 for ; Wed, 20 Nov 2013 20:59:53 +0000 (UTC) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3260292F for ; Wed, 20 Nov 2013 20:59:53 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id c14so817006vea.9 for ; Wed, 20 Nov 2013 12:59:46 -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=PC+ax6xF+gBLWDb6TSwr6/gkuZsQ1PzY7pL2aVInVS4h4oCasXNdW1D2CSAjxG1zBn j+eJERVGP2YeXZXiJp9uhjUwBqRSSHOITDPZYQy64ieN3Obqe81xHvRXid+b7wut47QP FHEb2CBeJjGn9ZA7ixeRgA45uWtJUe1j8WtcL+d4YrJ1y1xM6YCK8wCd5SFINCoP7g8h Qtv3BLdUcfjO13FjhClWi9SMXpCwg+j/tzNGI6EPwdKvFZs+EfpA8UCyJkKPgK344PrA /fC6MRdPjd9dBjV7ir8g3OagnpSwRNBIUsQqmf6wP0pmCfso07YwO+vw+kYbdcCjZ/Io mhNA== X-Gm-Message-State: ALoCoQlyA+ST1EYcUjDuoL5AGicX9QKTmEOP0oTsmd7C4AK+Dw0M/ky7iBxPErGmWQ55tE4Ry+di 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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Nov 2013 20:59:54 -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-head@FreeBSD.ORG Wed Nov 20 21:05:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 21:16:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 21:21:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 21:31:20 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 22:02:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 22:11:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 22:12:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 22:29:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Wed Nov 20 23:06:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 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-head@FreeBSD.ORG Thu Nov 21 00:00:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 00:07:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 00:32:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 00:54:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 01:08:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 01:27:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 01:31:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 03:22:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 06:54:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 09:19:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 09:34:17 2013 Return-Path: Delivered-To: svn-src-head@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 CFB065E4 for ; Thu, 21 Nov 2013 09:34:17 +0000 (UTC) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2F5E252F for ; Thu, 21 Nov 2013 09:34:17 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id x13so2608841ief.20 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=OKf5w1m4rfFN/bI9IEsvjtvQmzmNIDhq8wQ89QKhf9yQnCQPysIwGgVsxX3gfsOUaB JUu4jj14foi8Mf8BEX96YHQrX/eJeBZ6koKLNztO8eJgOY1w+nqRCUNETfLYVWqSFRmB HPtaGPyLy2i3A7BnUNV3U/tOMmVtBTrrGg4sIfqJ2f88EhnutMX/v8oQ7o7IHKoRdLYn +ztc7MA+oA3SrzDpBc7CmN4tUnaFdyWMDheZJystTsSvDkwiYmKR6LdgZ/RICEmfU2bs XfIKkn0SFnr8zvyQHW+uNulaf1outpe8UsyOs4bS7Ri163gVWDarPkCKUVSJmZLBBzvj qCzQ== X-Gm-Message-State: ALoCoQmJC5/Q9A2HyQGhKbFI/KLGtVhoYHAj1xBfKigUjlYyVfhSVMz2AkzWjafKbhYzUE/RNnL0 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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 14:12:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 14:36:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 15:41:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 16:39:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 16:44:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 17:49:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 18:37:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:00:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:04:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:20:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:29:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:31:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:43:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 19:44:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 20:07:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 20:27:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 20:39:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 20:43:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 21:05:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 21:19:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 21:26:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 22:03:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 22:31:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 23:09:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 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-head@FreeBSD.ORG Thu Nov 21 23:36:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67D2766E for ; Thu, 21 Nov 2013 23:36:52 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9BC220FB for ; Thu, 21 Nov 2013 23:36:51 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id w6so359028lbh.39 for ; Thu, 21 Nov 2013 15:36:43 -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=MSODgi8o6Q/Qja5OGIna2gtA0RVkUJxTPlpXQRRRUkfJP9zzNfNcbNF8BEQUdU5lAV XY76cwQhpsDZKDHKGMYRJ00plGKcmVxqi/tUaxRCd5NOrK+qG1dxB4/iPF6xfZ2tnpmi U4G/cj6j9X2IvOM9TuehEt8YQfodM6M8csGPbJ92XsicrXeo+/pRHqWp2oGWk+m2/StP TYHx9Zdo5PFeH4fudbXJjNVRHv+RV99BpFk7b2Hnd9J2slewZu3Tz0TdNBnLU15jeADr hLav6UD3bGkgzMs3YmVR/NEUKPGYNqv/7cC87FyqeLqczWBmWERD3K1nkZkO5y/+EGUV 3QDA== X-Gm-Message-State: ALoCoQkpsAYLoz8T2W8ok38TLsqi2pe8wWvf7Qgo4pKh0jSMVeA2q2qJ2ted03CENjP6xZUCwCrh 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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2013 23:36:52 -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-head@FreeBSD.ORG Fri Nov 22 00:06:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 00:28:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 00:32:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 04:57:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 04:59:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 05:00:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 05:01:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 05:02:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 10:45:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 10:45:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 12:09:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 14:56:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 17:54:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 18:31:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 18:53:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 18:54:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 18:57:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 18:57:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 19:02:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 19:16:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 19:22:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 20:11:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 20:13:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@FreeBSD.ORG Fri Nov 22 21:50:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 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-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 03:56:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 10:55:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 10:57:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 11:46:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 13:42:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 14:40:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 15:48:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 18:32:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 18:50:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 18:52:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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-head@FreeBSD.ORG Sat Nov 23 18:58:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 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);