From owner-svn-src-head@freebsd.org Sun Aug 7 01:29:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10003BA9792; Sun, 7 Aug 2016 01:29:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C35A41E72; Sun, 7 Aug 2016 01:29:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u771TvQB077947; Sun, 7 Aug 2016 01:29:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u771Tumi077937; Sun, 7 Aug 2016 01:29:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608070129.u771Tumi077937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 7 Aug 2016 01:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303809 - in head: lib/libthr/arch/mips/include libexec/rtld-elf/mips sys/mips/include sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 01:29:58 -0000 Author: adrian Date: Sun Aug 7 01:29:55 2016 New Revision: 303809 URL: https://svnweb.freebsd.org/changeset/base/303809 Log: [mips] add support for using the MIPS user register for TLS data. This work, originally from Stacey Son, uses the MIPS UserReg for reading the TLS data, and will fall back to the normal syscall path when it isn't supported. This code dynamically patches cpu_switch() to bypass the UserReg instruction so to avoid generating a machine exception. Thanks to sson for the original work, and to Dan Nelson for bringing it to date and testing it on MIPS32 with me. Tested: * mips64 (sson) * mips74k (dnelson_1901@yahoo.com) - AR9344 SoC, UserReg support * mips24k (adrian) - AR9331 SoC, no UserReg support Obtained from: sson, dnelson_1901@yahoo.com Modified: head/lib/libthr/arch/mips/include/pthread_md.h head/libexec/rtld-elf/mips/reloc.c head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuinfo.h head/sys/mips/include/cpuregs.h head/sys/mips/mips/cpu.c head/sys/mips/mips/genassym.c head/sys/mips/mips/swtch.S head/sys/mips/mips/sys_machdep.c head/sys/mips/mips/vm_machdep.c Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Sat Aug 6 23:53:33 2016 (r303808) +++ head/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 7 01:29:55 2016 (r303809) @@ -61,6 +61,7 @@ _tcb_set(struct tcb *tcb) /* * Get the current tcb. */ +#ifdef TLS_USE_SYSARCH static __inline struct tcb * _tcb_get(void) { @@ -70,6 +71,55 @@ _tcb_get(void) return tcb; } +#else /* ! TLS_USE_SYSARCH */ + +# if defined(__mips_n64) +static __inline struct tcb * +_tcb_get(void) +{ + uint64_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips64r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=v" (_rv)); + + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + return (struct tcb *)(_rv - TLS_TP_OFFSET - TLS_TCB_SIZE); +} +# else /* mips 32 */ +static __inline struct tcb * +_tcb_get(void) +{ + uint32_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips32r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=v" (_rv)); + + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + return (struct tcb *)(_rv - TLS_TP_OFFSET - TLS_TCB_SIZE); +} +# endif /* ! __mips_n64 */ +#endif /* ! TLS_USE_SYSARCH */ + extern struct pthread *_thr_initial; static __inline struct pthread * Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Sat Aug 6 23:53:33 2016 (r303808) +++ head/libexec/rtld-elf/mips/reloc.c Sun Aug 7 01:29:55 2016 (r303809) @@ -634,13 +634,67 @@ allocate_initial_tls(Obj_Entry *objs) sysarch(MIPS_SET_TLS, tls); } +#ifdef __mips_n64 +void * +_mips_get_tls(void) +{ + uint64_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips64r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=v" (_rv)); + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; + + return (void *)_rv; +} + +#else /* mips 32 */ + +void * +_mips_get_tls(void) +{ + uint32_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips32r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=v" (_rv)); + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; + + return (void *)_rv; +} +#endif /* ! __mips_n64 */ + void * __tls_get_addr(tls_index* ti) { Elf_Addr** tls; char *p; +#ifdef TLS_USE_SYSARCH sysarch(MIPS_GET_TLS, &tls); +#else + tls = _mips_get_tls(); +#endif p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/include/cpufunc.h Sun Aug 7 01:29:55 2016 (r303809) @@ -159,6 +159,7 @@ mips_wr_ ## n(uint64_t a0) \ MIPS_RW64_COP0(excpc, MIPS_COP_0_EXC_PC); MIPS_RW64_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RW64_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +MIPS_RW64_COP0_SEL(userlocal, MIPS_COP_0_USERLOCAL, 2); #ifdef CPU_CNMIPS MIPS_RW64_COP0_SEL(cvmcount, MIPS_COP_0_COUNT, 6); MIPS_RW64_COP0_SEL(cvmctl, MIPS_COP_0_COUNT, 7); @@ -265,6 +266,7 @@ MIPS_RW32_COP0_SEL(cmgcrbase, 15, 3); #if !defined(__mips_n64) MIPS_RW32_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +MIPS_RW32_COP0_SEL(userlocal, MIPS_COP_0_USERLOCAL, 2); #endif #ifdef CPU_NLM MIPS_RW32_COP0_SEL(pagegrain, MIPS_COP_0_TLB_PG_MASK, 1); @@ -289,6 +291,7 @@ MIPS_RW32_COP0_SEL(perfcnt0, MIPS_COP_0_ MIPS_RW32_COP0_SEL(perfcnt1, MIPS_COP_0_PERFCNT, 1); MIPS_RW32_COP0_SEL(perfcnt2, MIPS_COP_0_PERFCNT, 2); MIPS_RW32_COP0_SEL(perfcnt3, MIPS_COP_0_PERFCNT, 3); +MIPS_RW32_COP0(hwrena, MIPS_COP_0_HWRENA); #undef MIPS_RW32_COP0 #undef MIPS_RW32_COP0_SEL Modified: head/sys/mips/include/cpuinfo.h ============================================================================== --- head/sys/mips/include/cpuinfo.h Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/include/cpuinfo.h Sun Aug 7 01:29:55 2016 (r303809) @@ -58,6 +58,7 @@ struct mips_cpuinfo { u_int16_t tlb_nentries; u_int8_t icache_virtual; boolean_t cache_coherent_dma; + boolean_t userlocal_reg; struct { u_int32_t ic_size; u_int8_t ic_linesize; Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/include/cpuregs.h Sun Aug 7 01:29:55 2016 (r303809) @@ -454,9 +454,10 @@ * 2 MIPS_COP_0_TLB_LO0 .636 r4k TLB entry low. * 3 MIPS_COP_0_TLB_LO1 .636 r4k TLB entry low, extended. * 4 MIPS_COP_0_TLB_CONTEXT 3636 TLB Context. + * 4/2 MIPS_COP_0_USERLOCAL ..36 UserLocal. * 5 MIPS_COP_0_TLB_PG_MASK .333 TLB Page Mask register. * 6 MIPS_COP_0_TLB_WIRED .333 Wired TLB number. - * 7 MIPS_COP_0_INFO ..33 Info registers + * 7 MIPS_COP_0_HWRENA ..33 rdHWR Enable. * 8 MIPS_COP_0_BAD_VADDR 3636 Bad virtual address. * 9 MIPS_COP_0_COUNT .333 Count register. * 10 MIPS_COP_0_TLB_HI 3636 TLB entry high. @@ -534,7 +535,8 @@ #define MIPS_COP_0_ERROR_PC _(30) /* MIPS32/64 */ -#define MIPS_COP_0_INFO _(7) +#define MIPS_COP_0_USERLOCAL _(4) /* sel 2 is userlevel register */ +#define MIPS_COP_0_HWRENA _(7) #define MIPS_COP_0_DEBUG _(23) #define MIPS_COP_0_DEPC _(24) #define MIPS_COP_0_PERFCNT _(25) @@ -548,11 +550,21 @@ #define MIPS_MMU_BAT 0x02 /* Standard BAT */ #define MIPS_MMU_FIXED 0x03 /* Standard fixed mapping */ -#define MIPS_CONFIG0_MT_MASK 0x00000380 /* bits 9..7 MMU Type */ -#define MIPS_CONFIG0_MT_SHIFT 7 -#define MIPS_CONFIG0_BE 0x00008000 /* data is big-endian */ -#define MIPS_CONFIG0_VI 0x00000008 /* instruction cache is virtual */ - +/* + * Config Register Fields + * (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.39) + */ +#define MIPS_CONFIG0_M 0x80000000 /* Flag: Config1 is present. */ +#define MIPS_CONFIG0_MT_MASK 0x00000380 /* bits 9..7 MMU Type */ +#define MIPS_CONFIG0_MT_SHIFT 7 +#define MIPS_CONFIG0_BE 0x00008000 /* data is big-endian */ +#define MIPS_CONFIG0_VI 0x00000008 /* inst cache is virtual */ + +/* + * Config1 Register Fields + * (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9-1) + */ +#define MIPS_CONFIG1_M 0x80000000 /* Flag: Config2 is present. */ #define MIPS_CONFIG1_TLBSZ_MASK 0x7E000000 /* bits 30..25 # tlb entries minus one */ #define MIPS_CONFIG1_TLBSZ_SHIFT 25 @@ -586,6 +598,19 @@ #define MIPS_CONFIG3_CMGCR_MASK (1 << 29) /* Coherence manager present */ +/* + * Config2 Register Fields + * (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.40) + */ +#define MIPS_CONFIG2_M 0x80000000 /* Flag: Config3 is present. */ + +/* + * Config3 Register Fields + * (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.41) + */ +#define MIPS_CONFIG3_M 0x80000000 /* Flag: Config4 is present */ +#define MIPS_CONFIG3_ULR 0x00002000 /* UserLocal reg implemented */ + #define MIPS_CONFIG4_MMUSIZEEXT 0x000000FF /* bits 7.. 0 MMU Size Extension */ #define MIPS_CONFIG4_MMUEXTDEF 0x0000C000 /* bits 15.14 MMU Extension Definition */ #define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x00004000 /* This values denotes CONFIG4 bits */ @@ -667,4 +692,15 @@ #define MIPS_CMGCRB_BASE 11 #define MIPS_CMGCRF_BASE (~((1 << MIPS_CMGCRB_BASE) - 1)) +/* + * Bits defined for for the HWREna (CP0 register 7, select 0). + */ +#define MIPS_HWRENA_CPUNUM (1<<0) /* CPU number program is running on */ +#define MIPS_HWRENA_SYNCI_STEP (1<<1) /* Address step sized used with SYNCI */ +#define MIPS_HWRENA_CC (1<<2) /* Hi Res cycle counter */ +#define MIPS_HWRENA_CCRES (1<<3) /* Cycle counter resolution */ +#define MIPS_HWRENA_UL (1<<29) /* UserLocal Register */ +#define MIPS_HWRENA_IMPL30 (1<<30) /* Implementation-dependent 30 */ +#define MIPS_HWRENA_IMPL31 (1<<31) /* Implementation-dependent 31 */ + #endif /* _MIPS_CPUREGS_H_ */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/mips/cpu.c Sun Aug 7 01:29:55 2016 (r303809) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -49,6 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #if defined(CPU_CNMIPS) #include @@ -59,6 +63,63 @@ static void cpu_identify(void); struct mips_cpuinfo cpuinfo; +#define _ENCODE_INSN(a,b,c,d,e) \ + ((uint32_t)(((a) << 26)|((b) << 21)|((c) << 16)|((d) << 11)|(e))) + +#if defined(__mips_n64) + +# define _LOAD_T0_MDTLS_A1 \ + _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) + +# if defined(COMPAT_FREEBSD32) +# define _ADDIU_V0_T0_TLS_OFFSET \ + _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE32)) +# else +# define _ADDIU_V0_T0_TLS_OFFSET \ + _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) +# endif /* ! COMPAT_FREEBSD32 */ + +# define _MTC0_V0_USERLOCAL \ + _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) + +#else /* mips 32 */ + +# define _LOAD_T0_MDTLS_A1 \ + _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) +# define _ADDIU_V0_T0_TLS_OFFSET \ + _ENCODE_INSN(OP_ADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) +# define _MTC0_V0_USERLOCAL \ + _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) + +#endif /* ! __mips_n64 */ + +#define _JR_RA _ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR) +#define _NOP 0 + +/* + * Patch cpu_switch() by removing the UserLocal register code at the end. + * For MIPS hardware that don't support UserLocal Register Implementation + * we remove the instructions that update this register which may cause a + * reserved instruction exception in the kernel. + */ +static void +remove_userlocal_code(uint32_t *cpu_switch_code) +{ + uint32_t *instructp; + + for (instructp = cpu_switch_code;; instructp++) { + if (instructp[0] == _JR_RA) + panic("%s: Unable to patch cpu_switch().", __func__); + if (instructp[0] == _LOAD_T0_MDTLS_A1 && + instructp[1] == _ADDIU_V0_T0_TLS_OFFSET && + instructp[2] == _MTC0_V0_USERLOCAL) { + instructp[0] = _JR_RA; + instructp[1] = _NOP; + break; + } + } +} + /* * Attempt to identify the MIPS CPU as much as possible. * @@ -73,9 +134,8 @@ mips_get_identity(struct mips_cpuinfo *c u_int32_t prid; u_int32_t cfg0; u_int32_t cfg1; -#ifndef CPU_CNMIPS u_int32_t cfg2; -#endif + u_int32_t cfg3; #if defined(CPU_CNMIPS) u_int32_t cfg4; #endif @@ -96,13 +156,36 @@ mips_get_identity(struct mips_cpuinfo *c ((cfg0 & MIPS_CONFIG0_MT_MASK) >> MIPS_CONFIG0_MT_SHIFT); cpuinfo->icache_virtual = cfg0 & MIPS_CONFIG0_VI; - /* If config register selection 1 does not exist, exit. */ - if (!(cfg0 & MIPS_CONFIG_CM)) + /* If config register selection 1 does not exist, return. */ + if (!(cfg0 & MIPS_CONFIG0_M)) return; /* Learn TLB size and L1 cache geometry. */ cfg1 = mips_rd_config1(); + /* Get the Config2 and Config3 registers as well. */ + if (cfg1 & MIPS_CONFIG1_M) { + cfg2 = mips_rd_config2(); + if (cfg2 & MIPS_CONFIG2_M) + cfg3 = mips_rd_config3(); + } + + /* Check to see if UserLocal register is implemented. */ + if (cfg3 & MIPS_CONFIG3_ULR) { + /* UserLocal register is implemented, enable it. */ + cpuinfo->userlocal_reg = true; + tmp = mips_rd_hwrena(); + mips_wr_hwrena(tmp | MIPS_HWRENA_UL); + } else { + /* + * UserLocal register is not implemented. Patch + * cpu_switch() and remove unsupported code. + */ + cpuinfo->userlocal_reg = false; + remove_userlocal_code((uint32_t *)cpu_switch); + } + + #if defined(CPU_NLM) /* Account for Extended TLB entries in XLP */ tmp = mips_rd_config6(); @@ -387,7 +470,7 @@ cpu_identify(void) /* Print Config3 if it contains any useful info */ if (cfg3 & ~(0x80000000)) - printf(" Config3=0x%b\n", cfg3, "\20\2SmartMIPS\1TraceLogic"); + printf(" Config3=0x%b\n", cfg3, "\20\14ULRI\2SmartMIPS\1TraceLogic"); } static struct rman cpu_hardirq_rman; Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/mips/genassym.c Sun Aug 7 01:29:55 2016 (r303809) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef CPU_CNMIPS #include @@ -72,6 +73,13 @@ ASSYM(TD_KSTACK, offsetof(struct thread, ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); +ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls)); + +#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) +ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE32)); +#else +ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE)); +#endif ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/mips/swtch.S Sun Aug 7 01:29:55 2016 (r303809) @@ -358,6 +358,7 @@ sw2: * Restore registers and return. */ move a0, s0 + move a1, s7 RESTORE_U_PCB_CONTEXT(gp, PCB_REG_GP, a0) RESTORE_U_PCB_CONTEXT(v0, PCB_REG_SR, a0) # restore kernel context RESTORE_U_PCB_CONTEXT(ra, PCB_REG_RA, a0) @@ -377,6 +378,15 @@ sw2: or v0, v0, t0 mtc0 v0, MIPS_COP_0_STATUS ITLBNOPFIX +/* + * Set the new thread's TLS pointer. + * + * Note that this code is removed if the CPU doesn't support ULRI by + * remove_userlocal_code() in cpu.c. + */ + PTR_L t0, TD_MDTLS(a1) # Get TLS pointer + PTR_ADDIU v0, t0, TLS_TCB_OFFSET # Add TLS/TCB offset + MTC0 v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr j ra nop Modified: head/sys/mips/mips/sys_machdep.c ============================================================================== --- head/sys/mips/mips/sys_machdep.c Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/mips/sys_machdep.c Sun Aug 7 01:29:55 2016 (r303809) @@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include +#include #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { @@ -57,6 +61,22 @@ sysarch(struct thread *td, struct sysarc switch (uap->op) { case MIPS_SET_TLS: td->td_md.md_tls = uap->parms; + + /* + * If there is an user local register implementation (ULRI) + * update it as well. Add the TLS and TCB offsets so the + * value in this register is adjusted like in the case of the + * rdhwr trap() instruction handler. + */ + if (cpuinfo.userlocal_reg == true) { +#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) + mips_wr_userlocal((unsigned long)(uap->parms + + TLS_TP_OFFSET + TLS_TCB_SIZE32)); +#else + mips_wr_userlocal((unsigned long)(uap->parms + + TLS_TP_OFFSET + TLS_TCB_SIZE)); +#endif + } return (0); case MIPS_GET_TLS: tlsbase = td->td_md.md_tls; Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sat Aug 6 23:53:33 2016 (r303808) +++ head/sys/mips/mips/vm_machdep.c Sun Aug 7 01:29:55 2016 (r303809) @@ -60,8 +60,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include +#include #include #include @@ -492,6 +495,15 @@ cpu_set_user_tls(struct thread *td, void { td->td_md.md_tls = (char*)tls_base; + if (td == curthread && cpuinfo.userlocal_reg == true) { +#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) + mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + + TLS_TCB_SIZE32); +#else + mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + + TLS_TCB_SIZE); +#endif + } return (0); } From owner-svn-src-head@freebsd.org Sun Aug 7 01:32:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B468BA9934; Sun, 7 Aug 2016 01:32:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D61A1350; Sun, 7 Aug 2016 01:32:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u771WcHw081324; Sun, 7 Aug 2016 01:32:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u771Wbuf081319; Sun, 7 Aug 2016 01:32:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608070132.u771Wbuf081319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 7 Aug 2016 01:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303810 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 01:32:39 -0000 Author: adrian Date: Sun Aug 7 01:32:37 2016 New Revision: 303810 URL: https://svnweb.freebsd.org/changeset/base/303810 Log: [arswitch] extend the debug support to be configurable at runtime. * remove the DEBUG ifdef; defining it is too far reaching throughout the whole system; * add a bitmask in the softc for controlling debugging; * .. enable said debugging as a sysctl; * add bitmaps for register access, reset and vlans. TODO: * Now that the debug statements are configurable, we definitely could do with more debugging * Move the debugging into the top-level etherswitch driver and have sub-drivers obey. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Aug 7 01:29:55 2016 (r303809) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Aug 7 01:32:37 2016 (r303810) @@ -73,10 +73,6 @@ #include "miibus_if.h" #include "etherswitch_if.h" -#if defined(DEBUG) -static SYSCTL_NODE(_debug, OID_AUTO, arswitch, CTLFLAG_RD, 0, "arswitch"); -#endif - /* Map ETHERSWITCH_PORT_LED_* to Atheros pattern codes */ static int led_pattern_table[] = { [ETHERSWITCH_PORT_LED_DEFAULT] = 0x3, @@ -156,7 +152,7 @@ arswitch_probe(device_t dev) done: - DPRINTF(dev, "chipname=%s, id=%08x\n", chipname, id); + DPRINTF(sc, ARSWITCH_DBG_ANY, "chipname=%s, id=%08x\n", chipname, id); if (chipname != NULL) { snprintf(desc, sizeof(desc), "Atheros %s Ethernet Switch (ver %d rev %d)", @@ -309,12 +305,12 @@ ar8xxx_atu_flush(struct arswitch_softc * static int arswitch_attach(device_t dev) { - struct arswitch_softc *sc; + struct arswitch_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; int err = 0; int port; - sc = device_get_softc(dev); - /* sc->sc_switchtype is already decided in arswitch_probe() */ sc->sc_dev = dev; mtx_init(&sc->sc_mtx, "arswitch", NULL, MTX_DEF); @@ -322,6 +318,13 @@ arswitch_attach(device_t dev) strlcpy(sc->info.es_name, device_get_desc(dev), sizeof(sc->info.es_name)); + /* Debugging */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree = device_get_sysctl_tree(sc->sc_dev); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->sc_debug, 0, + "control debugging printfs"); + /* Default HAL methods */ sc->hal.arswitch_port_init = ar8xxx_port_init; sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; @@ -363,7 +366,8 @@ arswitch_attach(device_t dev) else if (AR8X16_IS_SWITCH(sc, AR8327)) ar8327_attach(sc); else { - DPRINTF(dev, "%s: unknown switch (%d)?\n", __func__, sc->sc_switchtype); + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: unknown switch (%d)?\n", __func__, sc->sc_switchtype); return (ENXIO); } @@ -393,19 +397,24 @@ arswitch_attach(device_t dev) /* Reset the switch. */ if (arswitch_reset(dev)) { - DPRINTF(dev, "%s: arswitch_reset: failed\n", __func__); + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: arswitch_reset: failed\n", __func__); return (ENXIO); } err = sc->hal.arswitch_hw_setup(sc); - DPRINTF(dev, "%s: hw_setup: err=%d\n", __func__, err); - if (err != 0) + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: hw_setup: err=%d\n", __func__, err); return (err); + } err = sc->hal.arswitch_hw_global_setup(sc); - DPRINTF(dev, "%s: hw_global_setup: err=%d\n", __func__, err); - if (err != 0) + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: hw_global_setup: err=%d\n", __func__, err); return (err); + } /* Initialize the switch ports. */ for (port = 0; port <= sc->numphys; port++) { @@ -416,22 +425,28 @@ arswitch_attach(device_t dev) * Attach the PHYs and complete the bus enumeration. */ err = arswitch_attach_phys(sc); - DPRINTF(dev, "%s: attach_phys: err=%d\n", __func__, err); - if (err != 0) + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: attach_phys: err=%d\n", __func__, err); return (err); + } /* Default to ingress filters off. */ err = arswitch_set_vlan_mode(sc, 0); - DPRINTF(dev, "%s: set_vlan_mode: err=%d\n", __func__, err); - if (err != 0) + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: set_vlan_mode: err=%d\n", __func__, err); return (err); + } bus_generic_probe(dev); bus_enumerate_hinted_children(dev); err = bus_generic_attach(dev); - DPRINTF(dev, "%s: bus_generic_attach: err=%d\n", __func__, err); - if (err != 0) + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: bus_generic_attach: err=%d\n", __func__, err); return (err); + } callout_init_mtx(&sc->callout_tick, &sc->sc_mtx, 0); @@ -560,10 +575,11 @@ arswitch_miipollstat(struct arswitch_sof else portstatus = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_STS(arswitch_portforphy(i))); -#if 0 - DPRINTF(sc->sc_dev, "p[%d]=%b\n", +#if 1 + DPRINTF(sc, ARSWITCH_DBG_POLL, "p[%d]=0x%08x (%b)\n", i, portstatus, + portstatus, "\20\3TXMAC\4RXMAC\5TXFLOW\6RXFLOW\7" "DUPLEX\11LINK_UP\12LINK_AUTO\13LINK_PAUSE"); #endif @@ -845,8 +861,9 @@ arswitch_setled(struct arswitch_softc *s static void arswitch_statchg(device_t dev) { + struct arswitch_softc *sc = device_get_softc(dev); - DPRINTF(dev, "%s\n", __func__); + DPRINTF(sc, ARSWITCH_DBG_POLL, "%s\n", __func__); } static int @@ -867,7 +884,7 @@ arswitch_ifmedia_sts(struct ifnet *ifp, struct arswitch_softc *sc = ifp->if_softc; struct mii_data *mii = arswitch_miiforport(sc, ifp->if_dunit); - DPRINTF(sc->sc_dev, "%s\n", __func__); + DPRINTF(sc, ARSWITCH_DBG_POLL, "%s\n", __func__); if (mii == NULL) return; Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Aug 7 01:29:55 2016 (r303809) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Aug 7 01:32:37 2016 (r303810) @@ -1086,7 +1086,7 @@ ar8327_get_dot1q_vlan(struct arswitch_so } reg = arswitch_readreg(sc->sc_dev, AR8327_REG_VTU_FUNC0); - DPRINTF(sc->sc_dev, "%s: %d: reg=0x%08x\n", __func__, vid, reg); + DPRINTF(sc, ARSWITCH_DBG_REGIO, "%s: %d: reg=0x%08x\n", __func__, vid, reg); /* * If any of the bits are set, update the port mask. @@ -1118,7 +1118,7 @@ ar8327_set_dot1q_vlan(struct arswitch_so op = AR8327_VTU_FUNC1_OP_LOAD; vid &= 0xfff; - DPRINTF(sc->sc_dev, + DPRINTF(sc, ARSWITCH_DBG_VLAN, "%s: vid: %d, ports=0x%08x, untagged_ports=0x%08x\n", __func__, vid, Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sun Aug 7 01:29:55 2016 (r303809) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sun Aug 7 01:32:37 2016 (r303810) @@ -62,10 +62,6 @@ #include "miibus_if.h" #include "etherswitch_if.h" -#if defined(DEBUG) -static SYSCTL_NODE(_debug, OID_AUTO, arswitch, CTLFLAG_RD, 0, "arswitch"); -#endif - /* * Access PHYs integrated into the switch by going direct * to the PHY space itself, rather than through the switch @@ -81,6 +77,9 @@ arswitch_readphy_external(device_t dev, ARSWITCH_LOCK(sc); ret = (MDIO_READREG(device_get_parent(dev), phy, reg)); + DPRINTF(sc, ARSWITCH_DBG_PHYIO, + "%s: phy=0x%08x, reg=0x%08x, ret=0x%08x\n", + __func__, phy, reg, ret); ARSWITCH_UNLOCK(sc); return (ret); @@ -96,6 +95,9 @@ arswitch_writephy_external(device_t dev, ARSWITCH_LOCK(sc); (void) MDIO_WRITEREG(device_get_parent(dev), phy, reg, data); + DPRINTF(sc, ARSWITCH_DBG_PHYIO, + "%s: phy=0x%08x, reg=0x%08x, data=0x%08x\n", + __func__, phy, reg, data); ARSWITCH_UNLOCK(sc); return (0); @@ -141,7 +143,9 @@ arswitch_readphy_internal(device_t dev, break; } if (timeout < 0) { - DPRINTF(dev, "arswitch_readphy(): phy=%d.%02x; timeout=%d\n", phy, reg, timeout); + DPRINTF(sc, ARSWITCH_DBG_ANY, + "arswitch_readphy(): phy=%d.%02x; timeout=%d\n", + phy, reg, timeout); goto fail; } data = arswitch_readreg_lsb(dev, a) & Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sun Aug 7 01:29:55 2016 (r303809) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sun Aug 7 01:32:37 2016 (r303810) @@ -232,6 +232,8 @@ arswitch_modifyreg(device_t dev, int add int value; uint16_t phy, reg; + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + arswitch_split_setpage(dev, addr, &phy, ®); value = arswitch_reg_read32(dev, 0x10 | phy, reg); @@ -243,9 +245,12 @@ arswitch_modifyreg(device_t dev, int add int arswitch_waitreg(device_t dev, int addr, int mask, int val, int timeout) { + struct arswitch_softc *sc = device_get_softc(dev); int err, v; uint16_t phy, reg; + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + arswitch_split_setpage(dev, addr, &phy, ®); err = -1; @@ -261,5 +266,10 @@ arswitch_waitreg(device_t dev, int addr, DELAY(1); timeout--; } + if (err != 0) { + DPRINTF(sc, ARSWITCH_DBG_ANY, + "%s: waitreg failed; addr=0x%08x, mask=0x%08x, val=0x%08x\n", + __func__, addr, mask, val); + } return (err); } Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Aug 7 01:29:55 2016 (r303809) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Aug 7 01:32:37 2016 (r303810) @@ -79,6 +79,8 @@ struct arswitch_softc { struct callout callout_tick; etherswitch_info_t info; + uint32_t sc_debug; + /* VLANs support */ int vid[AR8X16_MAX_VLANS]; uint32_t vlan_mode; @@ -142,18 +144,27 @@ struct arswitch_softc { #define ARSWITCH_TRYLOCK(_sc) \ mtx_trylock(&(_sc)->sc_mtx) -#if defined(DEBUG) -#define DPRINTF(dev, args...) device_printf(dev, args) +#define ARSWITCH_DBG_RESET 0x00000001 +#define ARSWITCH_DBG_REGIO 0x00000002 +#define ARSWITCH_DBG_PHYIO 0x00000004 +#define ARSWITCH_DBG_POLL 0x00000008 +#define ARSWITCH_DBG_VLAN 0x00000010 +#define ARSWITCH_DBG_ANY 0xffffffff + +#if 1 +#define DPRINTF(sc, dbg, args...) \ + do { \ + if (((sc)->sc_debug & (dbg)) || \ + ((sc)->sc_debug == ARSWITCH_DBG_ANY)) { \ + device_printf((sc)->sc_dev, args); \ + } \ + } while (0) #define DEVERR(dev, err, fmt, args...) do { \ if (err != 0) device_printf(dev, fmt, err, args); \ } while (0) -#define DEBUG_INCRVAR(var) do { \ - var++; \ - } while (0) #else -#define DPRINTF(dev, args...) +#define DPRINTF(dev, dbg, args...) #define DEVERR(dev, err, fmt, args...) -#define DEBUG_INCRVAR(var) #endif #endif /* __ARSWITCHVAR_H__ */ From owner-svn-src-head@freebsd.org Sun Aug 7 03:48:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99BCBB0776; Sun, 7 Aug 2016 03:48:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840271A3D; Sun, 7 Aug 2016 03:48:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u773mXDb030943; Sun, 7 Aug 2016 03:48:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u773mXXt030939; Sun, 7 Aug 2016 03:48:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608070348.u773mXXt030939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 7 Aug 2016 03:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303811 - in head/sys: net net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 03:48:34 -0000 Author: adrian Date: Sun Aug 7 03:48:33 2016 New Revision: 303811 URL: https://svnweb.freebsd.org/changeset/base/303811 Log: Extract out the various local definitions of ETHER_IS_BROADCAST() and turn them into a shared definition. Set M_MCAST/M_BCAST appropriately upon packet reception in net80211, just before they are delivered up to the ethernet stack. Submitted by: rstone Modified: head/sys/net/ethernet.h head/sys/net/if_ethersubr.c head/sys/net/if_gif.c head/sys/net80211/ieee80211_input.c Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Sun Aug 7 01:32:37 2016 (r303810) +++ head/sys/net/ethernet.h Sun Aug 7 03:48:33 2016 (r303811) @@ -71,6 +71,9 @@ struct ether_addr { } __packed; #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ +#define ETHER_IS_BROADCAST(addr) \ + (((addr)[0] & (addr)[1] & (addr)[2] & \ + (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) /* * 802.1q Virtual LAN header. Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sun Aug 7 01:32:37 2016 (r303810) +++ head/sys/net/if_ethersubr.c Sun Aug 7 03:48:33 2016 (r303811) @@ -115,8 +115,6 @@ static void ether_reassign(struct ifnet #endif static int ether_requestencap(struct ifnet *, struct if_encap_req *); -#define ETHER_IS_BROADCAST(addr) \ - (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) #define senderr(e) do { error = (e); goto bad;} while (0) Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Aug 7 01:32:37 2016 (r303810) +++ head/sys/net/if_gif.c Sun Aug 7 03:48:33 2016 (r303811) @@ -166,14 +166,6 @@ SYSCTL_INT(_net_link_gif, OID_AUTO, para CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); -/* copy from src/sys/net/if_ethersubr.c */ -static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#ifndef ETHER_IS_BROADCAST -#define ETHER_IS_BROADCAST(addr) \ - (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) -#endif - static int gif_clone_create(struct if_clone *ifc, int unit, caddr_t params) { Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sun Aug 7 01:32:37 2016 (r303810) +++ head/sys/net80211/ieee80211_input.c Sun Aug 7 03:48:33 2016 (r303811) @@ -283,7 +283,10 @@ ieee80211_deliver_data(struct ieee80211v IEEE80211_NODE_STAT(ni, rx_data); IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); if (ETHER_IS_MULTICAST(eh->ether_dhost)) { - m->m_flags |= M_MCAST; /* XXX M_BCAST? */ + if (ETHER_IS_BROADCAST(eh->ether_dhost)) + m->m_flags |= M_BCAST; + else + m->m_flags |= M_MCAST; IEEE80211_NODE_STAT(ni, rx_mcast); } else IEEE80211_NODE_STAT(ni, rx_ucast); From owner-svn-src-head@freebsd.org Sun Aug 7 06:53:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BADDBAFD0C for ; Sun, 7 Aug 2016 06:53:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-168.reflexion.net [208.70.211.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABC76195A for ; Sun, 7 Aug 2016 06:53:07 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 8271 invoked from network); 7 Aug 2016 06:52:53 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 7 Aug 2016 06:52:53 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.90.6) with SMTP; Sun, 07 Aug 2016 02:52:54 -0400 (EDT) Received: (qmail 25748 invoked from network); 7 Aug 2016 06:52:53 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 7 Aug 2016 06:52:53 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 5AAD5B1E001; Sat, 6 Aug 2016 23:52:59 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r303797 - head/contrib/binutils/bfd Message-Id: Date: Sat, 6 Aug 2016 23:52:58 -0700 To: svn-src-head@freebsd.org, jhibbits@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 06:53:08 -0000 Is there to be an MFC for the below? > Author: jhibbits > Date: Sat Aug 6 15:10:14 2016 > New Revision: 303797 > URL:=20 > https://svnweb.freebsd.org/changeset/base/303797 >=20 >=20 > Log: > Check the first byte of the array for NUL, instead of the array as a = NULL pointer > =20 > The partition_name field is an array, so can never be NULL itself. = Check only > the first byte instead. > =20 > This was found when test building with clang, but I'm not sure how = it passes > gcc's warnings either. >=20 > Modified: > head/contrib/binutils/bfd/ppcboot.c >=20 > Modified: head/contrib/binutils/bfd/ppcboot.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/contrib/binutils/bfd/ppcboot.c Sat Aug 6 15:06:19 2016 = (r303796) > +++ head/contrib/binutils/bfd/ppcboot.c Sat Aug 6 15:10:14 2016 = (r303797) > @@ -419,7 +419,7 @@ ppcboot_bfd_print_private_bfd_data (abfd > if (tdata->header.os_id) > fprintf (f, "OS_ID =3D 0x%.2x\n", = tdata->header.os_id); > =20 > - if (tdata->header.partition_name) > + if (tdata->header.partition_name[0]) > fprintf (f, _("Partition name =3D \"%s\"\n"), = tdata->header.partition_name); > =20 > for (i =3D 0; i < 4; i++) =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sun Aug 7 08:20:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE838BB1B07; Sun, 7 Aug 2016 08:20:40 +0000 (UTC) (envelope-from email@piotr-stefaniak.me) Received: from BAY004-OMC4S21.hotmail.com (bay004-omc4s21.hotmail.com [65.54.190.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B75313AF; Sun, 7 Aug 2016 08:20:39 +0000 (UTC) (envelope-from email@piotr-stefaniak.me) Received: from EUR01-DB5-obe.outbound.protection.outlook.com ([65.54.190.200]) by BAY004-OMC4S21.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 7 Aug 2016 01:19:34 -0700 Received: from DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com (10.152.4.55) by DB5EUR01HT108.eop-EUR01.prod.protection.outlook.com (10.152.4.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.567.7; Sun, 7 Aug 2016 08:19:32 +0000 Received: from VI1PR0901MB1501.eurprd09.prod.outlook.com (10.152.4.58) by DB5EUR01FT058.mail.protection.outlook.com (10.152.5.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.567.7 via Frontend Transport; Sun, 7 Aug 2016 08:19:33 +0000 Received: from VI1PR0901MB1501.eurprd09.prod.outlook.com ([10.173.75.149]) by VI1PR0901MB1501.eurprd09.prod.outlook.com ([10.173.75.149]) with mapi id 15.01.0549.023; Sun, 7 Aug 2016 08:19:31 +0000 From: Piotr Stefaniak To: Pedro Giffuni , Ed Schouten CC: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r303746 - head/usr.bin/indent Thread-Topic: svn commit: r303746 - head/usr.bin/indent Thread-Index: AQHR7mS6FWbeMdnRU02VgSfUBvEfu6A8YROAgAABgICAAMlsAA== Date: Sun, 7 Aug 2016 08:19:31 +0000 Message-ID: References: <201608041527.u74FR9xo083057@repo.freebsd.org> <54ec1a67-177b-9fb7-ad2a-b3f371926cc5@FreeBSD.org> In-Reply-To: <54ec1a67-177b-9fb7-ad2a-b3f371926cc5@FreeBSD.org> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=softfail (sender IP is 10.152.4.58) smtp.mailfrom=piotr-stefaniak.me; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=piotr-stefaniak.me; received-spf: SoftFail (protection.outlook.com: domain of transitioning piotr-stefaniak.me discourages use of 10.152.4.58 as permitted sender) x-ms-exchange-messagesentrepresentingtype: 1 x-eopattributedmessage: 0 x-forefront-antispam-report: CIP:10.152.4.58; IPV:NLI; CTRY:; EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5EUR01HT108; H:VI1PR0901MB1501.eurprd09.prod.outlook.com; FPR:; SPF:None; LANG:en; x-microsoft-exchange-diagnostics: 1; DB5EUR01HT108; 6:cBDPWuKtlMD6cDePp+2N9Lj8UN0VDlxh0Z+GTVXdlUGmIe8u5F/wa2e5O39+ucRr2sS9rQdHDfVZAs/xPSp0B3fhvMWumUbd7GMtWkqf97zhPRQl7vHTpRSJEiTC5GfT7iAwfU+7CyypYcFVahk5FfFr26grkjPRMOUIV40RSvPsNj+vTA6nguUfEnfGJZnULzifwh+fOyYfNomfJ0PJGUOzvDeo7TlAC3cLFbPsGyDDTktyyDQQobtLt/7jr98IaAxlBNni7LHRTk2Os6LuLqKBhT6EKn1J3LkwCbnTy5vm+sDOhQt3/+7Zzo/2XTOt; 5:mVQSFb7O6B90FZpSQ0BFrpDv4UnGJERpp6UK+EHHr/oagHXAgKIHduQwkmbZ3E2DPSHJuFaz4InK6H6xUqnaopY72Qnng1coKNDslQZCu9VLVvdEs6mW/MOe9inudcapzhCEKnPftoa5DXP69ALamg==; 24:Jjfq67PSve3pCo6cF85BdOHehooKFj3XRsSjx5nIpyKiFDk5fnXuBzhPbUIt8wKW/BcwfTONrDPOHMAAuZIyv9b6xE1CFs+x47w2Vuvsrug=; 7:2Mz158m9QwnpxNH8n2a9W7nU2ZTnrTWLPbGroIkGAjtrXnpBoDM9iTJ0j15mWn5F5rIQv8JeAeBy+bYNxGBwii6+oaPL5zIiI5Vmd3TmASnvkPFojMKhxjbfvSfiuVOfdJnJ3lQs5ezzH0xi691XjYR7Ee2Ve7nNycwjBgLkrrlP5ZGDSG7ZLAEGwCY4I+vHt/C5PNDhOkzermsEqW3v1P6wAtxGSz7qixsIDwyoiW8TSOaIQNqmyUt4DNBniYoo x-ms-office365-filtering-correlation-id: 0c7a8393-6aed-4fbd-2a60-08d3be9b8e3a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(1601124038)(1601125047); SRVR:DB5EUR01HT108; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(102415321)(82015046); SRVR:DB5EUR01HT108; BCL:0; PCL:0; RULEID:; SRVR:DB5EUR01HT108; x-forefront-prvs: 0027ED21E7 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/mixed; boundary="_002_VI1PR0901MB150127A162620B7A73B1C3EB851A0VI1PR0901MB1501_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2016 08:19:31.4524 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT108 X-OriginalArrivalTime: 07 Aug 2016 08:19:34.0303 (UTC) FILETIME=[6E0B2AF0:01D1F084] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 08:20:40 -0000 --_002_VI1PR0901MB150127A162620B7A73B1C3EB851A0VI1PR0901MB1501_ Content-Type: text/plain; charset="utf-8" Content-ID: <2E6B34E094EC8946BE1CBBBB169BEA9B@eurprd09.prod.outlook.com> Content-Transfer-Encoding: base64 T24gMjAxNi0wOC0wNiAyMjoxOCwgUGVkcm8gR2lmZnVuaSB3cm90ZToNCj4gT24gMDYvMDgvMjAx NiAxNToxMywgRWQgU2Nob3V0ZW4gd3JvdGU6DQo+PiAyMDE2LTA4LTA0IDE3OjI3IEdNVCswMjow MCBQZWRybyBGLiBHaWZmdW5pIDxwZmdAZnJlZWJzZC5vcmc+Og0KPj4+IExvZzoNCj4+PiAgICBp bmRlbnQoMSk6IFVzZSBic2VhcmNoKCkgZm9yIGxvb2tpbmcgdXAgdHlwZSBrZXl3b3Jkcy4NCj4+ IFlvdSdyZSBuZXZlciBkb2luZyBhbnkgZGVsZXRpb25zLCByaWdodD8gV291bGQgaXQgbWFrZSBt b3JlIHNlbnNlIHRvDQo+PiB1c2UgaHNlYXJjaF9yKCkgaW4gdGhhdCBjYXNlPw0KPj4NCj4gSW5k ZWVkLCBnb29kIGlkZWEsIGFsdGhvdWdoIGl0IG1heSBiZSBhbiBpc3N1ZSBpZiBwb3J0YWJpbGl0 eSB0byBXaW5kb3dzDQo+IGlzIGRlc2lyZWQuDQoNCkkgdGhpbmsgSSBjb3VsZCBoYXZlIGRvbmUg YmV0dGVyIGpvYiBkZXNjcmliaW5nIHRoZSByZWFzb25zIGJlaGluZCB0aGF0IA0KY29tbWl0LCBi ZWNhdXNlIHRoZXJlIGFyZSB0d28gb2YgdGhvc2UuDQoNClRoZSBtYWluIHRoaW5nIGlzIHRoYXQg SSB3YW50ZWQgdG8gZ2V0IHJpZCBvZiBhcmJpdHJhcnkgbGltaXQgb2YgMTYzODQgDQoic3BlY2lh bHMiIChrZXl3b3JkcywgaW5jbHVkaW5nIHR5cGVkZWYgbmFtZXMpIC0tIGFuZCB0aGUgDQptYWxs b2MvcmVhbGxvYy9ic2VhcmNoIGJhc2VkIGltcGxlbWVudGF0aW9uIG9mIGxvb2tpbmcgdXAgdHlw ZSBrZXl3b3JkcyANCnNvbHZlZCB0aGF0LCB3aGlsZSBiZWluZyByZWxhdGl2ZWx5IHNpbXBsZSBh bmQgZWFzeSB0byBmb2xsb3cuDQoNCkl0IHdhcyBhbHNvIHZlcnkgbmljZSB0byBub3RpY2UgYSBz aWduaWZpY2FudCBwZXJmb3JtYW5jZSBpbXByb3ZlbWVudCANCnNpbmNlIEkgd291bGQgcmUtaW5k ZW50IHdob2xlIHNyYy8gZGlyZWN0b3J5IG9mIHRoZSBQb3N0Z3JlU1FMIHByb2plY3QgDQptYW55 IHRpbWVzIHdoaWxlIHRlc3RpbmcgY2hhbmdlcyBJIG1hZGUuIEJ1dCBpdCdzIG5vdCB0aGF0IGlt cG9ydGFudCANCmFmdGVyIGFsbCwgYmVjYXVzZSBQb3N0Z3JlU1FMIHNvdXJjZXMgZ2V0IHJlLWlu ZGVudGVkIHZlcnkgcmFyZWx5Lg0KDQpIYXZpbmcgc2FpZCB0aGF0LCBJIGZlbHQgY29tcGVsbGVk IHRvIGNvbXBhcmUgcGVyZm9ybWFuY2Ugb2YgYnNlYXJjaCgpIA0KdG8gdGhhdCBvZiBoc2VhcmNo KCkuDQoNCkZpcnN0IHRoaW5nIHRvIHNheSBoZXJlIGlzIHRoYXQgSSBkaWQgdGhlIHRlc3Rpbmcg b24gYSBMaW51eCtnbGliYyANCnBsYXRmb3JtLCBiZWNhdXNlIDEpIHRoYXQncyBteSBtYWluIGRl dmVsb3BtZW50IHBsYXRmb3JtLCBhbmQgMikgaXQncyANCnByb2JhYmx5IHRoZSBvbmx5IG9uZSB3 aGVyZSBhbnlib2R5IHJlLWluZGVudHMgaHVuZHJlZHMgb2YgdGhvdXNhbmRzIG9mIA0KbGluZXMg b2YgY29kZSB3aXRoIGluZGVudCgxKSBpbiBvbmUgZ28sIG9mdGVuLCBhbmQgbXVsdGlwbGUgdGlt ZXMgYSBkYXkgDQotLSBhbmQgdGhlcmVmb3JlIGNhbiBhY3R1YWxseSBub3RpY2UgdGhlIGRpZmZl cmVuY2UuDQoNClNlY29uZGx5LCB3aGlsZSBoc2VhcmNoX3IoKSBiZWluZyBhIEdOVSBleHRlbnNp b24gaXMgYW4gYXJndW1lbnQgYWdhaW5zdCANCnVzaW5nIGl0LCBpbiB0aGlzIHBhcnRpY3VsYXIg Y2FzZSB0aGVyZSB3b3VsZCBiZSBubyBhZHZhbnRhZ2UgdG8gYmUgDQpnYWluZWQgYnkgcHJlZmVy cmluZyB0aGUgcmUtZW50cmFudCB2ZXJzaW9uLCBJIGJlbGlldmUgLS0gd2hpY2ggcmVuZGVycyAN CnRoZSBsb3dlciBwb3J0YWJpbGl0eSBhcmd1bWVudCBtb290LiBTbyB3aGF0IEkgdGVzdGVkIHdh cyBoc2VhcmNoKCkuDQoNCkFuZCBteSBpbXBsZW1lbnRhdGlvbiBvZiBoc2VhcmNoKCkgYmFzZWQg dHlwZWRlZiBuYW1lIGxvb2t1cCAoZGlmZiANCmF0dGFjaGVkKSB3YXNuJ3Qgc2lnbmlmaWNhbnRs eSBmYXN0ZXIgdGhhbiBic2VhcmNoKCkuIE9idmlvdXNseSBJIHRlc3RlZCANCnRoZSBnbGliYyB2 ZXJzaW9uIGFuZCBwZXJoYXBzIEZyZWVCU0QgaHNlYXJjaCgpIGlzIGZhc3RlciwgYnV0IEkgZG9u J3QgDQpleHBlY3QgaXQgdG8gYmUgc2lnbmlmaWNhbnRseSBmYXN0ZXIuDQoNClRoZSBtb3N0IGlt cG9ydGFudCBjb25jbHVzaW9uLCB0aG91Z2gsIGlzIHRoYXQgYXQgbGVhc3QgdGhlIGdsaWJjIA0K aW1wbGVtZW50YXRpb24gaW1wb3NlcyBhbiBhcmJpdHJhcnkgbGltaXQgb24gaG93IG1hbnkgaXRl bXMgeW91IGNhbiBhZGQgDQp0byB0aGUgZGF0YSBzdHJ1Y3R1cmU6DQoJVGhlIGFyZ3VtZW50IG5l bCBzcGVjaWZpZXMgdGhlIG1heGltdW0gbnVtYmVyIG9mIGVudHJpZXMgaW4gdGhlIHRhYmxlLiAN CihUaGlzICBtYXhpbXVtICBjYW5ub3QgYmUgY2hhbmdlZCBsYXRlciwgc28gY2hvb3NlIGl0IHdp c2VseS4pDQpBZGRpbmcgbmV3IGl0ZW1zIHRvIHRoZSBkYXRhIHN0cnVjdHVyZSAob3Igc2VhcmNo aW5nIHRoZW0gLSBJIGRpZG4ndCANCmludmVzdGlnYXRlKSBhY3R1YWxseSBfc3RvcHBlZCB3b3Jr aW5nXyB3aGVuIGFwcHJveGltYXRlbHkgL25lbC8gbnVtYmVyIA0Kb2YgZWxlbWVudHMgd2FzIHJl YWNoZWQgKEkgYWNjaWRlbnRhbGx5IHNldCBpdCB0byAyMDAwIHdoaWxlIFBvc3RncmVTUUwgDQpo YXMgbmVhcmx5IDMwMDAgdHlwZWRlZiBuYW1lcykuIEkgZG9uJ3Qga25vdyBpZiBGcmVlQlNEJ3Mg aW1wbGVtZW50YXRpb24gDQpkb2VzIHRoZSBzYW1lLCBidXQgaXQncyBhIHNob3ctc3RvcHBlciB0 byBtZSBhbnl3YXksIHNvIHBlcnNvbmFsbHkgSSANCndvbid0IGJlIHB1cnN1aW5nIHRoaXMgaWRl YSBvZiByZXBsYWNpbmcgYnNlYXJjaCgpIHdpdGggaHNlYXJjaCgpLg0KDQo= --_002_VI1PR0901MB150127A162620B7A73B1C3EB851A0VI1PR0901MB1501_ Content-Type: text/x-patch; name="lexi.c.diff" Content-Description: lexi.c.diff Content-Disposition: attachment; filename="lexi.c.diff"; size=2121; creation-date="Sun, 07 Aug 2016 08:19:30 GMT"; modification-date="Sun, 07 Aug 2016 08:19:30 GMT" Content-ID: Content-Transfer-Encoding: base64 LS0tIGxleGkuYwkyMDE2LTA4LTA3IDEwOjEwOjU0LjExNTM4MjYyMSArMDIwMA0KKysrIGxleGku Yy5oY3JlYXRlCTIwMTYtMDgtMDcgMTA6MDk6MzMuNTQ4Mzk0NDU2ICswMjAwDQpAQCAtNTIsNiAr NTIsNyBAQA0KICNpbmNsdWRlIDxjdHlwZS5oPg0KICNpbmNsdWRlIDxzdGRsaWIuaD4NCiAjaW5j bHVkZSA8c3RyaW5nLmg+DQorI2luY2x1ZGUgPHNlYXJjaC5oPg0KICNpbmNsdWRlICJpbmRlbnRf Z2xvYnMuaCINCiAjaW5jbHVkZSAiaW5kZW50X2NvZGVzLmgiDQogI2luY2x1ZGUgImluZGVudC5o Ig0KQEAgLTI3MCwxMyArMjcxLDE0IEBADQogCSAgICBzaXplb2Yoc3BlY2lhbHNbMF0pLA0KIAkg ICAgc3RyY21wX3R5cGUpOw0KIAlpZiAocCA9PSBOVUxMKSB7CS8qIG5vdCBhIHNwZWNpYWwga2V5 d29yZC4uLiAqLw0KKwkgICAgRU5UUlkgaXRlbTsNCiAJICAgIGNoYXIgKnU7DQogDQorCSAgICBp dGVtLmtleSA9IHNfdG9rZW47DQorDQogCSAgICAvKiAuLi4gc28gbWF5YmUgYSB0eXBlX3Qgb3Ig YSB0eXBlZGVmICovDQogCSAgICBpZiAoKGF1dG9fdHlwZWRlZnMgJiYgKCh1ID0gc3RycmNocihz X3Rva2VuLCAnXycpKSAhPSBOVUxMKSAmJg0KLQkgICAgICAgIHN0cmNtcCh1LCAiX3QiKSA9PSAw KSB8fCAodHlwZW5hbWVfdG9wID49IDAgJiYNCi0JCSAgYnNlYXJjaChzX3Rva2VuLCB0eXBlbmFt ZXMsIHR5cGVuYW1lX3RvcCArIDEsDQotCQkgICAgc2l6ZW9mKHR5cGVuYW1lc1swXSksIHN0cmNt cF90eXBlKSkpIHsNCisJICAgICAgICBzdHJjbXAodSwgIl90IikgPT0gMCkgfHwgaHNlYXJjaChp dGVtLCBGSU5EKSAhPSBOVUxMKSB7DQogCQlwcy5rZXl3b3JkID0gNDsJLyogYSB0eXBlIG5hbWUg Ki8NCiAJCXBzLmxhc3RfdV9kID0gdHJ1ZTsNCiAJICAgICAgICBnb3RvIGZvdW5kX3R5cGVuYW1l Ow0KQEAgLTU5MCw0MCArNTkyLDE1IEBADQogdm9pZA0KIGFsbG9jX3R5cGVuYW1lcyh2b2lkKQ0K IHsNCi0NCi0gICAgdHlwZW5hbWVzID0gKGNvbnN0IGNoYXIgKiopbWFsbG9jKHNpemVvZih0eXBl bmFtZXNbMF0pICoNCi0gICAgICAgICh0eXBlbmFtZV9jb3VudCA9IDE2KSk7DQotICAgIGlmICh0 eXBlbmFtZXMgPT0gTlVMTCkNCi0JZXJyKDEsIE5VTEwpOw0KKyAgICBoY3JlYXRlKDEwMDAwKTsN CiB9DQogDQogdm9pZA0KIGFkZF90eXBlbmFtZShjb25zdCBjaGFyICprZXkpDQogew0KLSAgICBp bnQgY29tcGFyaXNvbjsNCi0NCi0gICAgaWYgKHR5cGVuYW1lX3RvcCArIDEgPj0gdHlwZW5hbWVf Y291bnQpIHsNCi0JdHlwZW5hbWVzID0gcmVhbGxvYygodm9pZCAqKXR5cGVuYW1lcywNCi0JICAg IHNpemVvZih0eXBlbmFtZXNbMF0pICogKHR5cGVuYW1lX2NvdW50ICo9IDIpKTsNCi0JaWYgKHR5 cGVuYW1lcyA9PSBOVUxMKQ0KLQkgICAgZXJyKDEsIE5VTEwpOw0KLSAgICB9DQotICAgIGlmICh0 eXBlbmFtZV90b3AgPT0gLTEpDQotCXR5cGVuYW1lc1srK3R5cGVuYW1lX3RvcF0gPSBrZXk7DQot ICAgIGVsc2UgaWYgKChjb21wYXJpc29uID0gc3RyY21wKGtleSwgdHlwZW5hbWVzW3R5cGVuYW1l X3RvcF0pKSA+PSAwKSB7DQotCS8qIHRha2UgYWR2YW50YWdlIG9mIHNvcnRlZCBpbnB1dCAqLw0K LQlpZiAoY29tcGFyaXNvbiAhPSAwKQkvKiByZW1vdmUgZHVwbGljYXRlcyAqLw0KLQkgICAgdHlw ZW5hbWVzWysrdHlwZW5hbWVfdG9wXSA9IGtleTsNCi0gICAgfQ0KLSAgICBlbHNlIHsNCi0JaW50 IHA7DQotDQotCWZvciAocCA9IDA7IChjb21wYXJpc29uID0gc3RyY21wKGtleSwgdHlwZW5hbWVz W3BdKSkgPj0gMDsgcCsrKQ0KLQkgICAgLyogZmluZCBwbGFjZSBmb3IgdGhlIG5ldyBrZXkgKi87 DQotCWlmIChjb21wYXJpc29uID09IDApCS8qIHJlbW92ZSBkdXBsaWNhdGVzICovDQotCSAgICBy ZXR1cm47DQotCW1lbW1vdmUoJnR5cGVuYW1lc1twICsgMV0sICZ0eXBlbmFtZXNbcF0sDQotCSAg ICBzaXplb2YodHlwZW5hbWVzWzBdKSAqICgrK3R5cGVuYW1lX3RvcCAtIHApKTsNCi0JdHlwZW5h bWVzW3BdID0ga2V5Ow0KLSAgICB9DQorICAgIEVOVFJZIGl0ZW07DQorICAgIA0KKyAgICBpdGVt LmtleSA9IGtleTsNCisgICAgaXRlbS5kYXRhID0gTlVMTDsNCisgICAgaHNlYXJjaChpdGVtLCBF TlRFUik7DQogfQ0K --_002_VI1PR0901MB150127A162620B7A73B1C3EB851A0VI1PR0901MB1501_-- From owner-svn-src-head@freebsd.org Sun Aug 7 08:51:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72485BB02C1; Sun, 7 Aug 2016 08:51:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52B6B11EB; Sun, 7 Aug 2016 08:51:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 691BD5A9F27; Sun, 7 Aug 2016 08:51:28 +0000 (UTC) Date: Sun, 7 Aug 2016 08:51:28 +0000 From: Brooks Davis To: "Stephen J. Kiernan" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303803 - in head/sys/dev: fdt ofw Message-ID: <20160807085128.GD88936@spindle.one-eyed-alien.net> References: <201608061848.u76ImlqK030395@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <201608061848.u76ImlqK030395@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 08:51:35 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 06, 2016 at 06:48:47PM +0000, Stephen J. Kiernan wrote: > Author: stevek > Date: Sat Aug 6 18:48:47 2016 > New Revision: 303803 > URL: https://svnweb.freebsd.org/changeset/base/303803 >=20 > Log: > Add hw.fdt sysctl node. > Make FDT blob available via opaque hw.fdt.dtb sysctl, if a DTB has been > installed by the time sysctls are registered. Thanks! This has been on my todo list for ages. -- Brooks --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXpvaPAAoJEKzQXbSebgfAr7AH/2NxJ4fDg34V2Yl/oV0JfhZc 1Gmdn3aNLRtqPuzCpNawYUpYZBTiqAj4T3SMmPaa1r3N0iPlVHRsgLeWdI/f3O0/ 4rhxkk2u4+sB1T5xX+ieSNrUM8JHiX0NFBI2uujkurZVKrHh6tZfmzyabdLXbSHD bcgDijEPdsgXn1RchQImjtFdoIcL6LygmHDBNijDP9ncq3U8qvTvf9Y6Y3IeUi2N R4NMME8pjfb1XGILSazz4nDFOwC7Lm7lItoiERr+LnhD/ukxfAzvolxMF03lXkgu EiLnaUsexGTnuS5S4SYeVc2DXes92OIX1a1siQvmxfXwv8PM4RGMaBvjnq3IUu8= =thKN -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-head@freebsd.org Sun Aug 7 08:59:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1136ABB03FE; Sun, 7 Aug 2016 08:59:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D002014B0; Sun, 7 Aug 2016 08:59:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C84201FE024; Sun, 7 Aug 2016 10:59:00 +0200 (CEST) Subject: Re: svn commit: r303811 - in head/sys: net net80211 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608070348.u773mXXt030939@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <46183559-343f-401b-6471-3822e3383a50@selasky.org> Date: Sun, 7 Aug 2016 11:03:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608070348.u773mXXt030939@repo.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.22 Precedence: list List-Id: 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, 07 Aug 2016 08:59:03 -0000 On 08/07/16 05:48, Adrian Chadd wrote: > Author: adrian > Date: Sun Aug 7 03:48:33 2016 > New Revision: 303811 > URL: https://svnweb.freebsd.org/changeset/base/303811 > > Log: > Extract out the various local definitions of ETHER_IS_BROADCAST() and > turn them into a shared definition. > > Set M_MCAST/M_BCAST appropriately upon packet reception in net80211, just > before they are delivered up to the ethernet stack. > > Submitted by: rstone > > Modified: > head/sys/net/ethernet.h > head/sys/net/if_ethersubr.c > head/sys/net/if_gif.c > head/sys/net80211/ieee80211_input.c > > Modified: head/sys/net/ethernet.h > ============================================================================== > --- head/sys/net/ethernet.h Sun Aug 7 01:32:37 2016 (r303810) > +++ head/sys/net/ethernet.h Sun Aug 7 03:48:33 2016 (r303811) > @@ -71,6 +71,9 @@ struct ether_addr { > } __packed; > > #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ > +#define ETHER_IS_BROADCAST(addr) \ > + (((addr)[0] & (addr)[1] & (addr)[2] & \ > + (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) > Hi, The compiler might be able to produce more optimal code if you use "+" instead of "&", because there are instructions on x86, that can add multiple variables at the same time. With "&" you need to process every one as a single instructions usually I think. > +#define ETHER_IS_BROADCAST(addr) \ > + (((addr)[0] + (addr)[1] + (addr)[2] + \ > + (addr)[3] + (addr)[4] + (addr)[5]) == (6*0xff)) --HPS From owner-svn-src-head@freebsd.org Sun Aug 7 09:02:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F674BB07F9; Sun, 7 Aug 2016 09:02:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3279119B6; Sun, 7 Aug 2016 09:02:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7792sEt047430; Sun, 7 Aug 2016 09:02:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7792sSU047429; Sun, 7 Aug 2016 09:02:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201608070902.u7792sSU047429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 7 Aug 2016 09:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303812 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 09:02:55 -0000 Author: brooks Date: Sun Aug 7 09:02:54 2016 New Revision: 303812 URL: https://svnweb.freebsd.org/changeset/base/303812 Log: Use a more conventional spelling of "breakpoint". Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sun Aug 7 03:48:33 2016 (r303811) +++ head/sys/mips/mips/trap.c Sun Aug 7 09:02:54 2016 (r303812) @@ -849,7 +849,7 @@ dofault: } /* * The restoration of the original instruction and - * the clearing of the berakpoint will be done later + * the clearing of the breakpoint will be done later * by the call to ptrace_clear_single_step() in * issignal() when SIGTRAP is processed. */ From owner-svn-src-head@freebsd.org Sun Aug 7 10:58:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40608BA9DDB; Sun, 7 Aug 2016 10:58:11 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 179D4199E; Sun, 7 Aug 2016 10:58:10 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5521A20158; Sun, 7 Aug 2016 06:58:09 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 06:58:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=XrZQpJmiNUxWY1OfhtucOUPMtPE=; b=AcHaii 4vVyuC7IVhDnV5gcjObiAytoE1J1+BGJY2E+9VBJkqoFd05osf4fXxjhTO8O4ZLf 7iQplDLH0VpdJEWpBtEdxQ62aH2z0+f0181p0Qmqmx6IMqhDYchwDMHnh4klNjHd qF45oA1iNP6Ux885M/Dw8nErvBKAQ5N09dmms= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=XrZQpJmiNUxWY1O fhtucOUPMtPE=; b=Ulq5fFYAEQrVSqPtDce8s2njclNaMEmdpocEI8Zxsd4fdrW xqZk0nZFbPfgeJfibAB/uItB6wAWRPspDMjHHF1FOoMNsFgW37WnjON9kxzEcs1+ /S+khdBkfup1N6B2g1PAdwLQTc0QbZ60StDWWgVnu1XXqK9JlB+iHSsH1bDQ= X-Sasl-enc: zWbfV6M6ioIYVbNmoqz3wT6zLi6u0StOvWlJaZWc0lgV 1470567488 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 69AC8F296E; Sun, 7 Aug 2016 06:58:08 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608031608.u73G8Mjq055909@repo.freebsd.org> From: Bruce Simpson Message-ID: Date: Sun, 7 Aug 2016 11:58:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608031608.u73G8Mjq055909@repo.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.22 Precedence: list List-Id: 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, 07 Aug 2016 10:58:11 -0000 DES, I believe this breaks logging into various embedded network devices, unfortunately. E.g. the Netonix WISP Switch, which uses an embedded Linux variant with dropbear 0.51. It is expecting to use DSA not RSA for the key exchange.g Is there a way to revert this change, at least on an ongoing operational basis (e.g. configuration file) for those of us who use FreeBSD to connect directly to such devices? I speculate this might affect folk logging into Cisco UCS IPMI controllers, also. thanks Bruce From owner-svn-src-head@freebsd.org Sun Aug 7 11:40:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D85BAE95C; Sun, 7 Aug 2016 11:40:44 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212481C9E; Sun, 7 Aug 2016 11:40:43 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BCE29202C1; Sun, 7 Aug 2016 07:40:42 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 07:40:42 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Xt9bKD9wjXwPdwYvyS900wt6Wv8=; b=UwLLP5 /+P8zW6omsolZzRQbD3MkjtHF8UHLAJj6ex66paWCUSdseBiGdVMwpnLbH2ojqef Civp3WEqTNO3vKrCztSJ6A2D6rPxRh+rharseYc9ZvvoW9OayvZyNOZ/e0eAhHCk HMB5kwTouReJHwg9mdc+3qhZkMx9CTggKqdsc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Xt9bKD9wjXwPdwY vyS900wt6Wv8=; b=pQlIylqVwuG39/sxZmz9fwpKbtgBlBhHh72YH3uP+70minB 0pJq1OsHdWjcfyJQxJltaulMz7yWCynM6Vy2CRphYWjQ/KHzBjaJf+7L/GCo1ccY N4RPJr9QuT5+vUZY1ox9BOxKxhXA/C4emTirDF7ALPQcV/h4iSIGxr5mNkO8= X-Sasl-enc: /DbiMTYnPffmku0XEqGYWw28YqV2YeoGtk7jTCgX38TK 1470570042 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id CD1A9F296E; Sun, 7 Aug 2016 07:40:41 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608031608.u73G8Mjq055909@repo.freebsd.org> From: Bruce Simpson Message-ID: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> Date: Sun, 7 Aug 2016 12:40:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: 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, 07 Aug 2016 11:40:44 -0000 On 07/08/16 11:58, Bruce Simpson wrote: > Is there a way to revert this change, at least on an ongoing operational > basis (e.g. configuration file) for those of us who use FreeBSD to > connect directly to such devices? I was able to override this (somewhat unilateral, to my mind) deprecation of the DH key exchange by using this option: -oKexAlgorithms=+diffie-hellman-group1-sha1 Obviously that is too much of a mouthful for day-to-day operational memory. I shudder to think how a novice SSH user, who is otherwise competent with network switches, is going to cope with this confusion. OK, so deprecating the (unwanted/vulnerable/obsolete for whatever other reason) cipher suite is an ideologically sound move, but the road to hell is paved with good intentions. But surely the operational implications of this on people who use SSH on a daily basis could have been better thought out, given many of these devices cannot just magically be updated to stop using DH? As I've said this may not affect just Netonix devices, but a wide range of network devices which -- let's be frank -- be grateful they even have a basic SSH implementation. I'm staring at $VENDOR_A and $VENDOR_H. Strikes me as foot shooting. Just my 2c. Please, at least add a central knob for overriding this. pfSense took the change too. I couldn't log in to our local Netonix this morning (without booting up a Linux laptop), which violated POLA horribly for me. From owner-svn-src-head@freebsd.org Sun Aug 7 11:43:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6AABAEA28 for ; Sun, 7 Aug 2016 11:43:56 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 149DE1247 for ; Sun, 7 Aug 2016 11:43:56 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x235.google.com with SMTP id f65so80332679wmi.0 for ; Sun, 07 Aug 2016 04:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TNoLesTx90bO9VOAenonZMXYf0WqDGIJdClMtuhGQok=; b=ztm0wYhs1ltaR74o7Dp/c+dbyVSSICTEH9iM6UrMUE9WqOZr6nrxvU2AM6YbuhehxZ LYWA9ph+orYLfggy8h/aKtc5tPvFjA5e1/bP6WkaSlvuqBgJN/p4KNiCL/pVPIC1SrmQ Hu0ZbBgjaGZEgjQ45uFxSCmz/n1Z8ycjTekttnn+WHZMwSjTacCjonmkRohotmslbL0k CSajH/HRUPm5/Xi+a45jIDZ7MkPO0svTdB3B7Aqp4K9MmJsucafw7wbT2DfEMAtlV5kz gDoimYADxZXyqdhb61EjVB5u6LscZweURrF3GrkydJyO5q1noeUCXOxqdpgltxZh9Ksj W/8A== 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; bh=TNoLesTx90bO9VOAenonZMXYf0WqDGIJdClMtuhGQok=; b=iTqC1E87fJPtq9+AUFb08qvGCadTrE1aSCygTNybUnR8vahRLBIhubIq7YTGQAhgTw ZsT4KoYJejvZgAnTyyd1ttTtyoAkgdQgBSDNoj6R5YQM+hCwvIrmE6C5prF98XP/yoOJ P8DesSAudn/xhetxExHuEPaO4dZdgH9Imjqb8f0za3kHhQ0vrJtjN8qVAMTPaCdCqLgp pvFnRVukBDh9y5og5qJh5FQZuWx3zTjwVD18wavwaOXQY4GGkjmkKsHGNxRLmxc5QYRg meRfOQUNJnlguRVJvjoszagzAizIhK45QDzLRJrxgv4ErQmXDnZZZXmtO0mb/W6hTqwb GgOA== X-Gm-Message-State: AEkoouuZjIP0d5+gM6qzjtNpcSBUE6O8ALp1qa0q25e39RCmEAPWq5I9No5TTzJsp+nm94gMHH6Evf2i+5IIU3Mu X-Received: by 10.28.134.203 with SMTP id i194mr11515001wmd.22.1470570234324; Sun, 07 Aug 2016 04:43:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Sun, 7 Aug 2016 04:43:53 -0700 (PDT) In-Reply-To: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> From: Oliver Pinter Date: Sun, 7 Aug 2016 13:43:53 +0200 Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh To: Bruce Simpson Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 11:43:56 -0000 On 8/7/16, Bruce Simpson wrote: > On 07/08/16 11:58, Bruce Simpson wrote: >> Is there a way to revert this change, at least on an ongoing operational >> basis (e.g. configuration file) for those of us who use FreeBSD to >> connect directly to such devices? > > I was able to override this (somewhat unilateral, to my mind) > deprecation of the DH key exchange by using this option: > -oKexAlgorithms=+diffie-hellman-group1-sha1 You can add this option to /etc/ssh/ssh.conf or ~/.ssh/config too. > > Obviously that is too much of a mouthful for day-to-day operational > memory. I shudder to think how a novice SSH user, who is otherwise > competent with network switches, is going to cope with this confusion. > > OK, so deprecating the (unwanted/vulnerable/obsolete for whatever other > reason) cipher suite is an ideologically sound move, but the road to > hell is paved with good intentions. > > But surely the operational implications of this on people who use SSH on > a daily basis could have been better thought out, given many of these > devices cannot just magically be updated to stop using DH? > > As I've said this may not affect just Netonix devices, but a wide range > of network devices which -- let's be frank -- be grateful they even have > a basic SSH implementation. I'm staring at $VENDOR_A and $VENDOR_H. > > Strikes me as foot shooting. Just my 2c. > > Please, at least add a central knob for overriding this. pfSense took > the change too. I couldn't log in to our local Netonix this morning > (without booting up a Linux laptop), which violated POLA horribly for me. > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sun Aug 7 11:59:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438FEBAEDE5; Sun, 7 Aug 2016 11:59:31 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1798518DC; Sun, 7 Aug 2016 11:59:30 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8A8B3202C9; Sun, 7 Aug 2016 07:59:29 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 07:59:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ix4oJnCHoTFZEYRrs5YiFrFOubM=; b=dBri/K PB8XoXsyMuQaVQT7VTGezjbdtfmsT+iA/+EdhGr2d0S0sPNmGgkejXdAuV3uH9R0 67fLLPxnyFqhwPwy4MepbiPJKMuMQ1krpzDqVpFCUZEwBgGVzsLGxNiCyamo6LGA rNKJAUGqG8onGc+wt6lJnqustIYIUtrXddmdU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ix4oJnCHoTFZEYR rs5YiFrFOubM=; b=IXgHIcp0lUSA0HNcxZ5cs1SwciUAlf4vZ3MqQ5r6zdc+cqz GCKTze3ZEK6PBZEd33QKnFYX2zD/wU+eBbSzQFjckVhsUk8xwOBoKj7sHO8Kc3XN WtYWRVUAQ28xXT9bi37mmoWKjUIm1lbnyQRiafZ0SajW2OfE8e0M6Z4Kqv8I= X-Sasl-enc: g7B3pwxhlIgcKCnTe5fJdo7w/mnEmmiT+wjgQxrE7H/T 1470571169 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 88BF1F2985; Sun, 7 Aug 2016 07:59:28 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Oliver Pinter References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bruce Simpson Message-ID: Date: Sun, 7 Aug 2016 12:59:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: 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, 07 Aug 2016 11:59:31 -0000 On 07/08/16 12:43, Oliver Pinter wrote: >> I was able to override this (somewhat unilateral, to my mind) >> deprecation of the DH key exchange by using this option: >> -oKexAlgorithms=+diffie-hellman-group1-sha1 > > You can add this option to /etc/ssh/ssh.conf or ~/.ssh/config too. Can this at least be added (commented out, if you really want to enforce this policy on users out-of-the-box) to the former file in FreeBSD itself? And a note added to UPDATING? Otherwise, it's almost as though those behind the change are assuming that users will just know exactly what to do in their operational situation. That's a good way to cause problems for folk using FreeBSD in IT operations. (systemd epitomises this kind of foot shooting.) I understand already - you want to deprecate a set of key exchanges, and believe in setting an example - but the rest of the world might not be ready for that just yet. From owner-svn-src-head@freebsd.org Sun Aug 7 12:15:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066D9BAFB3F for ; Sun, 7 Aug 2016 12:15:31 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7F94149A for ; Sun, 7 Aug 2016 12:15:30 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22f.google.com with SMTP id j12so290344156ywb.2 for ; Sun, 07 Aug 2016 05:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KsPXHo6xtX2YjVMibdBlmv6JedYfknHpCglTP77LKlo=; b=Tyx4Cv1Py6Wmmcd5TIGn4dC5t+pj8UQyF+SDT2vwd0KaULlmSYfPTThOKSxoj316pD Ytu4aNzXxdaINH6gr1OGmT4OoX5HX9wkQTo/wuZeBHBp3spjz/RLk8iTKoujT0imqVCL 2aXHk7vfTmBWnwewAO7ALo1q6BsdZ7mo8VtrIVtk+JXutUde2oOVvYMq4dMlyR+0xeVw 7itCFP3c2aM7ofdWQimo8OGpAg1Ny+wRkStGARWWjPEDYeRwjkRf8OL+pFYzLNM+uN6y UyIiNLpdfiU368K4AwgvlRxL2acDsy5wglN+HyrQz1tFamtRjOe0Fjj1wIk8XBYtWFNK BfFA== 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; bh=KsPXHo6xtX2YjVMibdBlmv6JedYfknHpCglTP77LKlo=; b=THyZiroGLofrfRCqqNFEhFKyWXUfnWmM9IBJUrT9hLIII2w+nQFPNEPzoOxUyEZr/W HlYgRGyx+7Gtqbr1XXx3jHRp7n1wqfG1AdjhqUe6B9GZ4+kuqBvT4V72F/Bt1TAhQzs/ zJVNTVjSJdePXQkMEbnPP3J7k58j+8Qq91CBEoXVBWABMiBfZDt8QZGcpSQziE4crSLd FLxKkINxEGOMFnZ9ukMFDxYe08sG+2iTLGZ9hq3Zq/ctg6cFIrGtzri5YpLFAmPFSwUY +LJ3pDVcTlv97i/AJ30qqwib/D5xbtDGMcbh9UB9SLUZrNyFMGBmCiU7QZzAYbCq9wme bvUw== X-Gm-Message-State: AEkooutyaaEmcYhBzpn+99/gib46Z8gI0nVq2j8pto5S4CGuZGCI1KkvQLm0OtBUC0f0Iz/N/HGyLmIbowhGZA== X-Received: by 10.129.98.2 with SMTP id w2mr45257730ywb.313.1470572129573; Sun, 07 Aug 2016 05:15:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Sun, 7 Aug 2016 05:15:29 -0700 (PDT) In-Reply-To: References: <201608041527.u74FR9xo083057@repo.freebsd.org> <54ec1a67-177b-9fb7-ad2a-b3f371926cc5@FreeBSD.org> From: Ed Schouten Date: Sun, 7 Aug 2016 14:15:29 +0200 Message-ID: Subject: Re: svn commit: r303746 - head/usr.bin/indent To: Piotr Stefaniak Cc: Pedro Giffuni , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 12:15:31 -0000 Hi Piotr, 2016-08-07 10:19 GMT+02:00 Piotr Stefaniak : > The most important conclusion, though, is that at least the glibc > implementation imposes an arbitrary limit on how many items you can add > to the data structure: > The argument nel specifies the maximum number of entries in the table. > (This maximum cannot be changed later, so choose it wisely.) > Adding new items to the data structure (or searching them - I didn't > investigate) actually _stopped working_ when approximately /nel/ number > of elements was reached (I accidentally set it to 2000 while PostgreSQL > has nearly 3000 typedef names). I don't know if FreeBSD's implementation > does the same, but it's a show-stopper to me anyway, so personally I > won't be pursuing this idea of replacing bsearch() with hsearch(). Yeah, that's quite annoying. Both the hsearch() implementation of FreeBSD <11.0 and glibc seem to have a strong disregard of data structure theory. FreeBSD <11.0 uses a fixed size hash table with chaining. glibc also uses a fixed size, but doesn't even do chaining, meaning that there is a hard limit on the number of elements that can be stored. It also becomes incredibly slow by the time it gets close to full. In FreeBSD 11.0 I replaced our implementation by one that runs in constant time per operation (expected and amortised) and also has no fixed limit on the number of elements it can store. In fact, it even ignores the size hint that you provide. Source code: https://svnweb.freebsd.org/base/head/lib/libc/stdlib/hcreate_r.c?view=markup https://svnweb.freebsd.org/base/head/lib/libc/stdlib/hdestroy_r.c?view=markup https://svnweb.freebsd.org/base/head/lib/libc/stdlib/hsearch_r.c?view=markup My guess is that it's faster than bsearch() in this specific case, but if Linux compatibility is important, then I'd say we'd better stick to bsearch(). Thanks for sharing your thoughts! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sun Aug 7 12:26:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B54BB0071 for ; Sun, 7 Aug 2016 12:26:05 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED02F1B32 for ; Sun, 7 Aug 2016 12:26:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f53.google.com with SMTP id g62so230399726lfe.3 for ; Sun, 07 Aug 2016 05:26:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=BTZQGZ+m+bzAQFFmIVdAmEWzlntZOrn9hD/PckltQd4=; b=k1qIAFr7/FNWQqRb1jXEwAnRgKtokNW4GP5FHpjINIjk8xLzyHrPhs6D9YQU8XXHaD yCyTA+kk4IPqLa3otvnXKKtaBRZ1cb4k54YgHVT4Laizv3ckbmAarLdt+U/SslyjWOpG to6OPWwpgoNf2hHTNn8vSZjMQot4KzuAJLiKPtOex9dGlA96lCIHn3rpUlPosc4rz05H zIZZiDjf7rudlnLOXbI76msWybUt67aMetKhsylbwdWm0vJJQdtS7J43idXWykjzAWsl t5d9Fm+90xvzD7FjdmlF7RUo+UULvCs1AAJ0yPDVFcgduvZSjh+bYJVmMgrKdQ02cVlg LAag== X-Gm-Message-State: AEkoouuJ8+8SQMp4Bp6FApKHiEr4rzSP3Qi7n+T7y2U0IW2/EwAomg3C0VCSaZzJRpT8vA== X-Received: by 10.25.84.132 with SMTP id i126mr21613072lfb.116.1470572756467; Sun, 07 Aug 2016 05:25:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 85sm4752833ljf.6.2016.08.07.05.25.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 05:25:55 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Bruce Simpson , Oliver Pinter References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> Date: Sun, 7 Aug 2016 15:25:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 12:26:05 -0000 On 07.08.2016 14:59, Bruce Simpson wrote: > On 07/08/16 12:43, Oliver Pinter wrote: >>> I was able to override this (somewhat unilateral, to my mind) >>> deprecation of the DH key exchange by using this option: >>> -oKexAlgorithms=+diffie-hellman-group1-sha1 >> >> You can add this option to /etc/ssh/ssh.conf or ~/.ssh/config too. > > Can this at least be added (commented out, if you really want to enforce > this policy on users out-of-the-box) to the former file in FreeBSD > itself? And a note added to UPDATING? > > Otherwise, it's almost as though those behind the change are assuming > that users will just know exactly what to do in their operational > situation. That's a good way to cause problems for folk using FreeBSD in > IT operations. > > (systemd epitomises this kind of foot shooting.) > > I understand already - you want to deprecate a set of key exchanges, and > believe in setting an example - but the rest of the world might not be > ready for that just yet. > You should address your complains to original openssh author instead, it was his decision to get rid of weak algos. In my personal opinion, if your hardware is outdated, just drop it out. We can't turn our security team into compatibility team, by constantly restoring removed code, such code quickly becomes outdated and may add new security holes even being inactive. From owner-svn-src-head@freebsd.org Sun Aug 7 12:31:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D18B4BB00F3 for ; Sun, 7 Aug 2016 12:31:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x231.google.com (mail-yb0-x231.google.com [IPv6:2607:f8b0:4002:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80B671D11 for ; Sun, 7 Aug 2016 12:31:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x231.google.com with SMTP id v8so27984237ybe.3 for ; Sun, 07 Aug 2016 05:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RV11HN991Dpa9CB19B6/EecJSgjjKlY0X/lZMKaQw0I=; b=lYJ2eiPJ9Pg7/wrqJQqvy7AwJx8Do9deRfZMCiMkfRvN06IGNd8sPBviIWG6XUr0Kr 7fX1WNcG6YCNyMihBPkwuklUnv3NhQce8sYQ6tjOLLecAgF9xLI76qW60QIqhR6VkyLX qrIg+wPOGkezH3efPF6F7pMAOdOmyhiJUf2Yh5Jhli37UA8daaQkZ/Rk9nxkL1Yb3zJB 4R6BrreXc7DRc8a/xzvxTBc+LqXSo7sFkRzZEBnG9GSi8ps+PBCvDXevoefgug/b9BPb 7OmHRuBdApfTmN0fZmv+Q/bcjbeJ6CHOb6FQanh5M4nmtr3TxTJbA/BWmKSq847/UK2X K4+g== 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; bh=RV11HN991Dpa9CB19B6/EecJSgjjKlY0X/lZMKaQw0I=; b=HBfC0iOC2L5bDTujD98JmbjQ994fQjGqD1skkNxEBwSAMSt3XmMz3qLYqh7ZwnK1I9 JrqDYKtu8oDveQZR+ovPGcuX147lqZxL/UqXxj7YxBYHd1a7TGd05L4t0akRbNggHDAK 45oKl/Fw1XRGx5HxeiCXnbQBBYsnaF04tGX9Rbj6q5rZSnidnR2z7HKS+SVVh8eOrkhL JVzA7BgTWKjgeQz7nhr+k6ZQpeE/yIGc3IWOMScdH7Mi9VdYc9GDatC3oNpo0zWMXUSp SiYX3+YpPW198g5l9u5YIcjy6rFnrT9w/BW6Fa/zu2mMG81MJH/KDGltPpa4W0NwrIjs 7AlQ== X-Gm-Message-State: AEkoousii5wLq9Xe84BV14WfH1AVIMF6ladOuRCSIuFubhkazJ9QXQGh8YCZzRytUq0JIiSYH/TXmJHlHRJccA== X-Received: by 10.37.163.33 with SMTP id d30mr38403140ybi.54.1470573071666; Sun, 07 Aug 2016 05:31:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Sun, 7 Aug 2016 05:31:11 -0700 (PDT) In-Reply-To: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> From: Ed Schouten Date: Sun, 7 Aug 2016 14:31:11 +0200 Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh To: Andrey Chernov Cc: Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 12:31:12 -0000 2016-08-07 14:25 GMT+02:00 Andrey Chernov : > You should address your complains to original openssh author instead, it > was his decision to get rid of weak algos. In my personal opinion, if > your hardware is outdated, just drop it out. We can't turn our security > team into compatibility team, by constantly restoring removed code, such > code quickly becomes outdated and may add new security holes even being > inactive. +1. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sun Aug 7 12:51:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8902BB0539; Sun, 7 Aug 2016 12:51:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB6B16AF; Sun, 7 Aug 2016 12:51:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77CpD47031727; Sun, 7 Aug 2016 12:51:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77CpDda031723; Sun, 7 Aug 2016 12:51:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608071251.u77CpDda031723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 7 Aug 2016 12:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303813 - 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.22 Precedence: list List-Id: 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, 07 Aug 2016 12:51:14 -0000 Author: tuexen Date: Sun Aug 7 12:51:13 2016 New Revision: 303813 URL: https://svnweb.freebsd.org/changeset/base/303813 Log: Remove stream queue entry consistently from wheel. While there, improve the handling of drain. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 7 09:02:54 2016 (r303812) +++ head/sys/netinet/sctp_input.c Sun Aug 7 12:51:13 2016 (r303813) @@ -260,6 +260,7 @@ sctp_is_there_unsent_data(struct sctp_tc } atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, &asoc->strmout[i], sp, 1); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -341,8 +342,9 @@ sctp_process_init(struct sctp_init_chunk for (i = newcnt; i < asoc->pre_open_streams; i++) { outs = &asoc->strmout[i]; TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { + atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); - asoc->stream_queue_cnt--; + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 1); sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, 0, sp, SCTP_SO_NOT_LOCKED); if (sp->data) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Aug 7 09:02:54 2016 (r303812) +++ head/sys/netinet/sctp_output.c Sun Aug 7 12:51:13 2016 (r303813) @@ -7232,12 +7232,12 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if ((strq->state == SCTP_STREAM_RESET_PENDING) && (strq->chunks_on_queues == 0) && TAILQ_EMPTY(&strq->outqueue)) { stcb->asoc.trigger_reset = 1; } - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7661,7 +7661,6 @@ dont_do_it: } if (sp->msg_is_complete && (sp->length == 0) && (sp->sender_all_done)) { /* All done pull and kill the message */ - atomic_subtract_int(&asoc->stream_queue_cnt, 1); if (sp->put_last_out == 0) { SCTP_PRINTF("Gak, put out entire msg with NO end!-2\n"); SCTP_PRINTF("sender_done:%d len:%d msg_comp:%d put_last_out:%d send_lock:%d\n", @@ -7675,13 +7674,14 @@ dont_do_it: SCTP_TCB_SEND_LOCK(stcb); send_lock_up = 1; } + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if ((strq->state == SCTP_STREAM_RESET_PENDING) && (strq->chunks_on_queues == 0) && TAILQ_EMPTY(&strq->outqueue)) { stcb->asoc.trigger_reset = 1; } - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Aug 7 09:02:54 2016 (r303812) +++ head/sys/netinet/sctp_pcb.c Sun Aug 7 12:51:13 2016 (r303813) @@ -4978,7 +4978,9 @@ sctp_free_assoc(struct sctp_inpcb *inp, outs = &asoc->strmout[i]; /* now clean up any chunks here */ TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 0); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { @@ -6869,9 +6871,6 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) ctl, ctl->on_strm_q); } #endif - if (ctl->on_read_q) { - continue; - } if (SCTP_TSN_GT(ctl->sinfo_tsn, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Aug 7 09:02:54 2016 (r303812) +++ head/sys/netinet/sctputil.c Sun Aug 7 12:51:13 2016 (r303813) @@ -3907,8 +3907,9 @@ sctp_report_all_outbound(struct sctp_tcb outs = &asoc->strmout[i]; /* clean up any sends there */ TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { - asoc->stream_queue_cnt--; + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, holds_lock); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, From owner-svn-src-head@freebsd.org Sun Aug 7 12:52:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94044BB06F1; Sun, 7 Aug 2016 12:52:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56ACB193A; Sun, 7 Aug 2016 12:52:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWNZ5-000HgL-In; Sun, 07 Aug 2016 15:52:27 +0300 Date: Sun, 7 Aug 2016 15:52:27 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: Bruce Simpson , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807125227.GC22212@zxy.spb.ru> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 12:52:37 -0000 On Sun, Aug 07, 2016 at 03:25:54PM +0300, Andrey Chernov wrote: > On 07.08.2016 14:59, Bruce Simpson wrote: > > On 07/08/16 12:43, Oliver Pinter wrote: > >>> I was able to override this (somewhat unilateral, to my mind) > >>> deprecation of the DH key exchange by using this option: > >>> -oKexAlgorithms=+diffie-hellman-group1-sha1 > >> > >> You can add this option to /etc/ssh/ssh.conf or ~/.ssh/config too. > > > > Can this at least be added (commented out, if you really want to enforce > > this policy on users out-of-the-box) to the former file in FreeBSD > > itself? And a note added to UPDATING? > > > > Otherwise, it's almost as though those behind the change are assuming > > that users will just know exactly what to do in their operational > > situation. That's a good way to cause problems for folk using FreeBSD in > > IT operations. > > > > (systemd epitomises this kind of foot shooting.) > > > > I understand already - you want to deprecate a set of key exchanges, and > > believe in setting an example - but the rest of the world might not be > > ready for that just yet. > > > > You should address your complains to original openssh author instead, it > was his decision to get rid of weak algos. In my personal opinion, if > your hardware is outdated, just drop it out. Hardware outdated by outdated main function, not by outdated ssh upstream. > We can't turn our security > team into compatibility team, by constantly restoring removed code, such > code quickly becomes outdated and may add new security holes even being > inactive. What is security hole by present this ciphers in _client_? From owner-svn-src-head@freebsd.org Sun Aug 7 13:21:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F624BB0BDE for ; Sun, 7 Aug 2016 13:21:15 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17AAC12E6 for ; Sun, 7 Aug 2016 13:21:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id g62so230874323lfe.3 for ; Sun, 07 Aug 2016 06:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ie9mxW4XNrrm9NpAXKKiJwMNTtf+noAIuZwt8h+uo84=; b=DRBQfezqcrnyoVr5AtgGKUtKlYWcNoQZ3w/rXNyOfJGPXM4NGaP27+9A/a/afwtM64 hajaz11Fl3lp3Uyt1OF5J97I6JNWfH/El28O1rpdM1/V9QGBkgES7du4+VdULkBeMR0U qHQYWYwPvEH8LWIcslQhBxGr6S2AWqEV+JX4ePpxR42plJUvGssVGBGpCXK7gBKSRLvl keOsaH/bftG2LBi4DRSCSwCoCSXgEk9krd9jzyALRjKYH1Wf+hZ8UFjc+p9159tmmwu2 ztWDSFtvUivfXi+WhMxt1sLv35X7mnvhqPXlZa0RgVVMRsVeEfGDIcdyHp+NuEfIXbqh 4Wug== X-Gm-Message-State: AEkooutbpjQoAfAqz4Tv1G/gNnMwdZE8ZwUrtA4YfB/07rakB3+5JGg2bN9o12Rx3iUWBg== X-Received: by 10.46.9.71 with SMTP id 68mr24828233ljj.0.1470576067370; Sun, 07 Aug 2016 06:21:07 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id p128sm4772418lfb.32.2016.08.07.06.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 06:21:06 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> Cc: Bruce Simpson , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> Date: Sun, 7 Aug 2016 16:21:05 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807125227.GC22212@zxy.spb.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 13:21:15 -0000 On 07.08.2016 15:52, Slawa Olhovchenkov wrote: >> You should address your complains to original openssh author instead, it >> was his decision to get rid of weak algos. In my personal opinion, if >> your hardware is outdated, just drop it out. > > Hardware outdated by outdated main function, not by outdated ssh > upstream. There are too many reason for outdating hardware without losing its main function in real world. But I don't want to conduct a lecture. As I already say, it is just my personal opinion. > >> We can't turn our security >> team into compatibility team, by constantly restoring removed code, such >> code quickly becomes outdated and may add new security holes even being >> inactive. > > What is security hole by present this ciphers in _client_? It is obvious, but it will be better for you to ask openssh author about his decisions, I have no intention to act like explainer of his action. From owner-svn-src-head@freebsd.org Sun Aug 7 14:40:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C94BB1BC0 for ; Sun, 7 Aug 2016 14:40:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8AD91275 for ; Sun, 7 Aug 2016 14:40:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id f6so62735559ith.0 for ; Sun, 07 Aug 2016 07:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OE8fWqjYbgplNFYdQwBC9FowNMrrfuYyd5TjMSduSYs=; b=BEGVP7GeBFf64dr3XIoXuFPVUSiSWeFCmenYuWvtZOBPx1VHidcMuN1RF0DQ0mKNFR +/o1EOO/OooR+fZfNrReJqLnJtbrCCNLSSQZynExRNMrJcYkY5NFpAr3VvwafHy20mmi OelfEPqfWapm3dwEBXBg6ip2Qkyu2nzDlQAmEn9QtDhYVzk3l48JdPtttpvfnbVgy3XM xs1pA4cjGDNxsduP+NQ7vqfiTV/9toVwcw9YlT4Onq2tHF7Sv3fHa2kCFv+GBinvqWXo Bwx3KmYBWMy7fh3Xg/I6fxtcWhfjYQm8/ySWFA6SpwL3TUM349XvtsKUFE78sbn83lLr 6cRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OE8fWqjYbgplNFYdQwBC9FowNMrrfuYyd5TjMSduSYs=; b=icekJfP6udsID6aphSn6rB61z8kwh1rJUrAU738KRrXLI+d7QIGri6iOXTa7jzNvwh V01FV5n/feCrKDMqbEDIdRZuXzQC5oyyh+FZf0Vz2i8unQ0+YTALWHxUG5I/sHJGsW0N HRw4T2Ehsu6q+uRTVhTZ+UkR6guTXbJ3Vnfpyjy+lkHMDgitsi4QBiyzy8r06m9AuhD4 XC0FZvhfeK8krcf10S6CrqqiDaeEQ9hPeiV1LjJF7FxmoHdyBQZb86Ug93rGTKFhbmCU CaJ6YJ6fLo2rrv++uXHdw6q5b7F+1fH0KNaOZYHdByPshJdBB8mxj+WQCJvFS3jqO2qe xJ7g== X-Gm-Message-State: AEkooutBQaDu2NMDtvkbkBDRrERnMUGTsbdUJfuaH6SaEivoYFa5DtmvClY04C/WCMt7QQ== X-Received: by 10.36.188.65 with SMTP id n62mr13933410ite.61.1470580817361; Sun, 07 Aug 2016 07:40:17 -0700 (PDT) Received: from mac.nflx.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id 97sm12270117ioi.12.2016.08.07.07.40.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Aug 2016 07:40:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r303716 - head/crypto/openssh From: Warner Losh In-Reply-To: <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> Date: Sun, 7 Aug 2016 08:40:14 -0600 Cc: Slawa Olhovchenkov , Bruce Simpson , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Content-Transfer-Encoding: quoted-printable Message-Id: <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 14:40:18 -0000 > On Aug 7, 2016, at 7:21 AM, Andrey Chernov wrote: >>=20 >>> We can't turn our security >>> team into compatibility team, by constantly restoring removed code, = such >>> code quickly becomes outdated and may add new security holes even = being >>> inactive. >>=20 >> What is security hole by present this ciphers in _client_? >=20 > It is obvious, but it will be better for you to ask openssh author = about > his decisions, I have no intention to act like explainer of his = action. That=E2=80=99s a cop-out answer. We, as a project, need to articulate to = our users, whom we care about, why this rather obnoxious hit to usability was taken. The answer must be more complete than =E2=80=9CWe just = disabled it because upstream disabled it for reasons we=E2=80=99re too lazy to = explain or document how to work around" Warner= From owner-svn-src-head@freebsd.org Sun Aug 7 14:57:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F89BBB00CE for ; Sun, 7 Aug 2016 14:57:41 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2FE21C8B for ; Sun, 7 Aug 2016 14:57:40 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f43.google.com with SMTP id f93so231945810lfi.2 for ; Sun, 07 Aug 2016 07:57:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=fMIDfZPEK2gO4bwTtKRvw2kl0arpAAKA5fLK99Zt3G0=; b=Cc+kkeBcuGq2ljcj0lLLxqlUZ7MazR88wNx8vVxbS6NaaB9yL01lf2VOReBBJd0arC NoXSIlTNeNcQCLdMZzV9Pf5fn5UVfuOV98l5UzumxywsIZenfzcYIoeMWr959JXmmAPo UBJH8KDVSATnAw2taAjFTACNwX4n5a4hj8rPeyiUDwWNMscdJk5uEoXFF7TN9kY0XhtV r/GB0ETApsag3g6TMMhp0A8xFEvqwvAYVUPaFHjnYZtl2Fu9/yynCIVittSJoB9dA4Be lNt+hnoC0eDQhCSJ4BsbozwBu0A181zEgA3sCArO54vBwANeuLbDmH1ifel8rC/WtU/n OqiA== X-Gm-Message-State: AEkoouuYVlXgTAtVpEF7Ro2c0Lm840IHEg3xiPFxnCBR/X8J+GcRs4IgmSSp2HDVhrrYbg== X-Received: by 10.25.20.226 with SMTP id 95mr23209958lfu.194.1470581852710; Sun, 07 Aug 2016 07:57:32 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 74sm4873109ljb.36.2016.08.07.07.57.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 07:57:32 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Cc: Slawa Olhovchenkov , Bruce Simpson , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: Date: Sun, 7 Aug 2016 17:57:31 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 14:57:41 -0000 On 07.08.2016 17:40, Warner Losh wrote: > >> On Aug 7, 2016, at 7:21 AM, Andrey Chernov wrote: >>> >>>> We can't turn our security >>>> team into compatibility team, by constantly restoring removed code, such >>>> code quickly becomes outdated and may add new security holes even being >>>> inactive. >>> >>> What is security hole by present this ciphers in _client_? >> >> It is obvious, but it will be better for you to ask openssh author about >> his decisions, I have no intention to act like explainer of his action. > > That’s a cop-out answer. We, as a project, need to articulate to our > users, whom we care about, why this rather obnoxious hit to usability > was taken. The answer must be more complete than “We just disabled > it because upstream disabled it for reasons we’re too lazy to explain > or document how to work around" Maybe I am too lazy, but in this particular case I prefer explanation from the author rather then my own explanations. In general my guessing of author intentions related to compatibility case can be not correct enough, so I don't want anybody relay on it. I.e. I don't want to mislead anybody. From owner-svn-src-head@freebsd.org Sun Aug 7 15:50:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B077BBB0D98; Sun, 7 Aug 2016 15:50:09 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7628114A8; Sun, 7 Aug 2016 15:50:09 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77Fo88D096764; Sun, 7 Aug 2016 15:50:08 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77Fo8Kk096763; Sun, 7 Aug 2016 15:50:08 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201608071550.u77Fo8Kk096763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 7 Aug 2016 15:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303814 - head/sys/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.22 Precedence: list List-Id: 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, 07 Aug 2016 15:50:09 -0000 Author: jah Date: Sun Aug 7 15:50:08 2016 New Revision: 303814 URL: https://svnweb.freebsd.org/changeset/base/303814 Log: powerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle bouncing of unmapped buffers. Also treat userspace buffers as unmapped, to avoid borrowing the UVA for copies. This allows sync'ing userspace buffers outside the context of the owning process, and sync'ing bounced maps in non-sleepable contexts. This change is equivalent to r286787 for x86. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D3989 Modified: head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Sun Aug 7 12:51:13 2016 (r303813) +++ head/sys/powerpc/powerpc/busdma_machdep.c Sun Aug 7 15:50:08 2016 (r303814) @@ -87,7 +87,8 @@ struct bounce_page { vm_offset_t vaddr; /* kva of bounce buffer */ bus_addr_t busaddr; /* Physical address */ vm_offset_t datavaddr; /* kva of client data */ - bus_addr_t dataaddr; /* client physical address */ + vm_page_t datapage; /* physical page of client data */ + vm_offset_t dataoffs; /* page offset of client data */ bus_size_t datacount; /* client data count */ STAILQ_ENTRY(bounce_page) links; }; @@ -585,7 +586,8 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma while (buflen != 0) { sgsize = MIN(buflen, dmat->maxsegsz); if (run_filter(dmat, curaddr) != 0) { - sgsize = MIN(sgsize, PAGE_SIZE); + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); map->pagesneeded++; } curaddr += sgsize; @@ -736,7 +738,7 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat curaddr = buf; sgsize = MIN(buflen, dmat->maxsegsz); if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) { - sgsize = MIN(sgsize, PAGE_SIZE); + sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); curaddr = add_bounce_page(dmat, map, 0, curaddr, sgsize); } @@ -779,7 +781,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm { bus_size_t sgsize; bus_addr_t curaddr; - vm_offset_t vaddr; + vm_offset_t kvaddr, vaddr; int error; if (segs == NULL) @@ -802,20 +804,23 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm /* * Get the physical address for this segment. */ - if (pmap == kernel_pmap) + if (pmap == kernel_pmap) { curaddr = pmap_kextract(vaddr); - else + kvaddr = vaddr; + } else { curaddr = pmap_extract(pmap, vaddr); + kvaddr = 0; + } /* * Compute the segment size, and adjust counts. */ max_sgsize = MIN(buflen, dmat->maxsegsz); - sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) { sgsize = roundup2(sgsize, dmat->alignment); sgsize = MIN(sgsize, max_sgsize); - curaddr = add_bounce_page(dmat, map, vaddr, curaddr, + curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, sgsize); } else { sgsize = MIN(sgsize, max_sgsize); @@ -893,8 +898,10 @@ void _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) { struct bounce_page *bpage; + vm_offset_t datavaddr, tempvaddr; if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + /* * Handle data bouncing. We might also * want to add support for invalidating @@ -905,14 +912,20 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (op & BUS_DMASYNC_PREWRITE) { while (bpage != NULL) { - if (bpage->datavaddr != 0) - bcopy((void *)bpage->datavaddr, - (void *)bpage->vaddr, - bpage->datacount); - else - physcopyout(bpage->dataaddr, - (void *)bpage->vaddr, - bpage->datacount); + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | + bpage->dataoffs; + } + + bcopy((void *)datavaddr, + (void *)bpage->vaddr, bpage->datacount); + + if (tempvaddr != 0) + pmap_quick_remove_page(tempvaddr); bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -920,13 +933,20 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { - if (bpage->datavaddr != 0) - bcopy((void *)bpage->vaddr, - (void *)bpage->datavaddr, - bpage->datacount); - else - physcopyin((void *)bpage->vaddr, - bpage->dataaddr, bpage->datacount); + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | + bpage->dataoffs; + } + + bcopy((void *)bpage->vaddr, + (void *)datavaddr, bpage->datacount); + + if (tempvaddr != 0) + pmap_quick_remove_page(tempvaddr); bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -1125,7 +1145,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - bpage->dataaddr = addr; + bpage->datapage = PHYS_TO_VM_PAGE(addr); + bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); return (bpage->busaddr); From owner-svn-src-head@freebsd.org Sun Aug 7 16:14:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59AA3BB1540; Sun, 7 Aug 2016 16:14:25 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2702E1283; Sun, 7 Aug 2016 16:14:25 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4E0FA2022D; Sun, 7 Aug 2016 12:14:17 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 12:14:17 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=R4UWS4UcY12hc4fpvebIgNhgdxI=; b=iUGybr 7ZdGKELJ3/UYW9dn/zXmfOxhbtnBFBD5dg25LJrHW8VqmZ5r8XCQxZwkI04JaIeH rKGhV0IDDiFMLkDVxA+YhHKLuWK0XplS+NbsMk+Aho3PADQtx5gDs4hbVQYPGyrD +yzb2kejXPZjc0Lygmb7TFgvVgjb5UvFtF46Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=R4UWS4UcY12hc4f pvebIgNhgdxI=; b=tx+PDhF51xDSp0G7zH3r9ayWCFUN9PE9wUQzWvz6xdPiCQe 2/wTYzum2SmcJSYfnl73AQV3H7oXNgZs0EbBywSO5xRtwb1aVkoepGlFUmsvhAkc f4WupAuCqD7Ve2VmCvZAXHKk7eUvtXrn+vmjlCDLEJu3eSbb7f92pAh3b4U0= X-Sasl-enc: VTb6u1rVUCDuMGcJOgk/PTnim0p7YyesBVa/q2h3RHSn 1470586456 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id E15C3CC07A; Sun, 7 Aug 2016 12:14:15 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Warner Losh , Andrey Chernov References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Cc: Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Bruce Simpson Message-ID: Date: Sun, 7 Aug 2016 17:14:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 16:14:25 -0000 On 07/08/16 15:40, Warner Losh wrote: > That’s a cop-out answer. We, as a project, need to articulate to our > users, whom we care about, why this rather obnoxious hit to usability > was taken. The answer must be more complete than “We just disabled > it because upstream disabled it for reasons we’re too lazy to explain > or document how to work around" Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which accepted the upstream change, workaround no-go) [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX group out of range From owner-svn-src-head@freebsd.org Sun Aug 7 17:33:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E42D1BB1939 for ; Sun, 7 Aug 2016 17:33:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4AA1C6B for ; Sun, 7 Aug 2016 17:33:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f46.google.com with SMTP id b199so233610534lfe.0 for ; Sun, 07 Aug 2016 10:33:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=vd8wMVs4NuFwDqDhT5BGbyx2o1CLgrdDLcG0s0sJI+A=; b=GHfmvJdlAMoG7wmQA5geBOphcECtNoS+ZUo2pUB3zDLRRmrIgivoD2Kgi3xFKmoG1g sHAb9EAvKXMEYeFkoK81FRkPfksXUek1BQBen2iDY6q3I3BEv5idn4GXIlgrYDrgI7/q Gjnl378ziBi8XSG5tBGFKZDjlZ/ypsnppNlwZQJaNX1YOmLSMNWiEVZLKs3ZXENyo43d knOa9Q3fYZKN3WLD7iS0fWv3FrvkUCtjY6h07iDPWqnOIl2zmrCBXqhjRQNNupS6HRjT mkxdwk24zRvNogIH9SzNZOVXkFEqBz/pqyMkSdLZtck6tmbCyXv/LhMRFVJl0Fuy61L2 uykw== X-Gm-Message-State: AEkoouvOZD+3e56R1DoSnC2QHW2wT67dVeMVZ6/fmIZkT0Yul+R+DXFq0k7Ze1wXWS6rvw== X-Received: by 10.25.158.140 with SMTP id h134mr22503750lfe.0.1470591236796; Sun, 07 Aug 2016 10:33:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id b71sm4975542lfb.42.2016.08.07.10.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 10:33:56 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Bruce Simpson , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> Cc: Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: Date: Sun, 7 Aug 2016 20:33:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 17:34:00 -0000 On 07.08.2016 20:31, Andrey Chernov wrote: > On 07.08.2016 19:14, Bruce Simpson wrote: >> On 07/08/16 15:40, Warner Losh wrote: >>> That’s a cop-out answer. We, as a project, need to articulate to our >>> users, whom we care about, why this rather obnoxious hit to usability >>> was taken. The answer must be more complete than “We just disabled >>> it because upstream disabled it for reasons we’re too lazy to explain >>> or document how to work around" >> >> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >> accepted the upstream change, workaround no-go) >> >> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >> group out of range >> > > DH prime size must be at least 2048, openssh now refuse lower values. > Commonly used DH size 1024 can be easily broken. See https://weakdh.org > From owner-svn-src-head@freebsd.org Sun Aug 7 17:34:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B31BB1995 for ; Sun, 7 Aug 2016 17:34:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA591DE2 for ; Sun, 7 Aug 2016 17:34:58 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id b199so233618192lfe.0 for ; Sun, 07 Aug 2016 10:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=YtwISGETgTz5eTWFzDs2H8Iptt/KFvuUHL84MKQS+zI=; b=TMMaFPbXjvJark3jvei6U48QBnSRk2Yk8JW+nrAozeZr4/LUZlzGNV9hLh+YwhPFg9 5QhxfStn7NdnJaLjvX0hqpyIxBjcv4H9+jjmrvJrZFIuhik2lj8BhlecjHwweFzaUXPL El3YAkuQ7MwmOvoKpgQKDD2RjfhYSgKAEN/K0pVjMLOXpBET6mbrT+dmhVcOx9ZP0dhV jbkmrExp1P8rC8yiOPrhJLVJGLrA1cJO/ZXzr1SbnZEcH7Mba7ETkiYGOw1z/u2NPtk/ J+JKI8UdgTxzla2YPWLYjXK1pLlOvPiAT4JiPUQB41q5fMHZorfJ0dbAP1bPp+p9pFet rQFw== X-Gm-Message-State: AEkoouvVKnBjpmBOd9ZvCJg3FPnlkWWMTK90nUMsco2vjLFXmwRMabMgl4OWCIakt2msZw== X-Received: by 10.25.38.207 with SMTP id m198mr28715848lfm.201.1470591296418; Sun, 07 Aug 2016 10:34:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id s85sm1662616lfg.8.2016.08.07.10.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 10:34:55 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Bruce Simpson , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> Cc: Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> Date: Sun, 7 Aug 2016 20:34:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 17:34:59 -0000 On 07.08.2016 20:31, Andrey Chernov wrote: > On 07.08.2016 19:14, Bruce Simpson wrote: >> On 07/08/16 15:40, Warner Losh wrote: >>> That’s a cop-out answer. We, as a project, need to articulate to our >>> users, whom we care about, why this rather obnoxious hit to usability >>> was taken. The answer must be more complete than “We just disabled >>> it because upstream disabled it for reasons we’re too lazy to explain >>> or document how to work around" >> >> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >> accepted the upstream change, workaround no-go) >> >> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >> group out of range >> > > DH prime size must be at least 2048, openssh now refuse lower values. > Commonly used DH size 1024 can be easily broken. See https://weakdh.org > diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. From owner-svn-src-head@freebsd.org Sun Aug 7 17:37:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 520A4BB1ADB; Sun, 7 Aug 2016 17:37:36 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20DED11EC; Sun, 7 Aug 2016 17:37:35 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D618120373; Sun, 7 Aug 2016 13:37:34 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 13:37:35 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=WMXx16J6fepqXYFazWbqA7fWDhc=; b=KbZqQM r0So2S21UBcwk5dmGOBjjnjatubvZPLxPJBdIX8ym6TyYT/HFSKkXXuY+WsXPyEH sBqgbFlgrp5TY5kp+3fgjfb2A0H7Y+XHDS6x3i/G5QSwnUzL0sYfguKWrYaHt/GM 3WiDeDgPS0eEW0M/aqt3HO3nWLceU61Ytrb9k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=WMXx16J6fepqXYF azWbqA7fWDhc=; b=YE4M1Zy/y27i/2SDpQzrqvlfSBZoPkIhClHSJsYQ+wxHxZc OwL7ZYGCan2lQYBvRhfNi1cGEfTsEpUbGsqVi9ZfykwRrXlw482drU1LiJAUa3Xx u+hbBVTS0isPiTqEW48tZa0uZ+GMS9J4T7q/2YACLa7bimc/M0aHYvz9StD4= X-Sasl-enc: gh6d/ACeXjbznhKO2S5a2O5Z/1yA6Wo5XWzBvnr7t0Yy 1470591454 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 6F162CCD83; Sun, 7 Aug 2016 13:37:33 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Andrey Chernov , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> Cc: Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Bruce Simpson Message-ID: <950021bd-a6d3-7b6d-73fb-74fd9900b306@fastmail.net> Date: Sun, 7 Aug 2016 18:37:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <0740b662-4a36-f834-229a-d16a5a6dde14@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.22 Precedence: list List-Id: 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, 07 Aug 2016 17:37:36 -0000 On 07/08/16 18:34, Andrey Chernov wrote: >>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >>> accepted the upstream change, workaround no-go) >>> >>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >>> group out of range >> DH prime size must be at least 2048, openssh now refuse lower values. >> Commonly used DH size 1024 can be easily broken. See https://weakdh.org >> > diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. > I appreciate that, but what do I as a user do about it? My distribution has changed behaviour I rely on in an operational setting. My initial reaction is likely to be one of confusion, and general dismay. I appreciate that this is done for security reasons, but it could take an arbitrarily long time for a lot of deployed hardware in current use to be updated. (On the other hand, the introduction of, say ED25519 has been more gradual, and has tended to see uptake in e.g. Linux-based ARM products.) From owner-svn-src-head@freebsd.org Sun Aug 7 17:37:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2204BB1AF2; Sun, 7 Aug 2016 17:37:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 921AF11F0; Sun, 7 Aug 2016 17:37:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWS10-000P1N-Vf; Sun, 07 Aug 2016 20:37:34 +0300 Date: Sun, 7 Aug 2016 20:37:34 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: Bruce Simpson , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , svn-src-head@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807173734.GD22212@zxy.spb.ru> References: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 17:37:38 -0000 On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: > On 07.08.2016 20:31, Andrey Chernov wrote: > > On 07.08.2016 19:14, Bruce Simpson wrote: > >> On 07/08/16 15:40, Warner Losh wrote: > >>> That’s a cop-out answer. We, as a project, need to articulate to our > >>> users, whom we care about, why this rather obnoxious hit to usability > >>> was taken. The answer must be more complete than “We just disabled > >>> it because upstream disabled it for reasons we’re too lazy to explain > >>> or document how to work around" > >> > >> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which > >> accepted the upstream change, workaround no-go) > >> > >> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin > >> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX > >> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX > >> group out of range > >> > > > > DH prime size must be at least 2048, openssh now refuse lower values. > > Commonly used DH size 1024 can be easily broken. See https://weakdh.org > > > diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. IMHO, this is wrong choise: totaly lost of control now vs teoretical compromise of control in the future. From owner-svn-src-head@freebsd.org Sun Aug 7 17:38:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 304EABB1BBE for ; Sun, 7 Aug 2016 17:38:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6C821536 for ; Sun, 7 Aug 2016 17:38:36 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id g62so233051278lfe.3 for ; Sun, 07 Aug 2016 10:38:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6xIvvamnTEjHnNdrktDqOcIzkAzTKtamQtT4bzgw5IE=; b=GCKB9WwjMhCOD+/KdaPgDeJ3rOszEKt7I7t2M0E0WfXwnD9u3KIpSr0zfqog2YTEuO fu9nm7X57Dzz7M6+W9LjAvk+aZZy6S55oYDtCf1iUTWxv4OQhxe0qRRKX9C2b6S21KMX 0P026siiEGW/R3EyBjmEp69oz5DY2mfZQQFix0GF/cc7BMfFTx8YI3277Ilrf2g8Py0N metxY4gR57hkG2RClWVSwNzXRyxDk/pjd0qQ9uCLugcqQyYYNI/oLiD8ACL3aOGHnIlT h3W50HrPkjR6miDO9Snmr7GcVjpHDlS+e+xksOOxcK7xwLzwttP5INk9Aid+v5MvodAm b53Q== X-Gm-Message-State: AEkoouuuYOV03SL1sc1dDxIvrHrx8iCI2jc76UxyCfcugfrca5iZS+nAGK7cTCJqoBFygA== X-Received: by 10.46.5.23 with SMTP id 23mr26111845ljf.64.1470591065736; Sun, 07 Aug 2016 10:31:05 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n128sm4954033lfb.45.2016.08.07.10.31.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 10:31:05 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Bruce Simpson , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Cc: Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> Date: Sun, 7 Aug 2016 20:31:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 17:38:37 -0000 On 07.08.2016 19:14, Bruce Simpson wrote: > On 07/08/16 15:40, Warner Losh wrote: >> That’s a cop-out answer. We, as a project, need to articulate to our >> users, whom we care about, why this rather obnoxious hit to usability >> was taken. The answer must be more complete than “We just disabled >> it because upstream disabled it for reasons we’re too lazy to explain >> or document how to work around" > > Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which > accepted the upstream change, workaround no-go) > > [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin > -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX > Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX > group out of range > DH prime size must be at least 2048, openssh now refuse lower values. Commonly used DH size 1024 can be easily broken. See https://weakdh.org From owner-svn-src-head@freebsd.org Sun Aug 7 17:43:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DBABB1D0B for ; Sun, 7 Aug 2016 17:43:10 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C11FE192A for ; Sun, 7 Aug 2016 17:43:09 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id l69so233193813lfg.1 for ; Sun, 07 Aug 2016 10:43:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zW1+kVCToGshrjsOlHWzqWZyyjL0sU+q+dAxfO9Bk/k=; b=l71RvWg0MkoxgMXYvVymi1sSZLVafKBMrFITaGmyjKM66UPHcWvXzUWgL/3TS6HoEM SXcalLFbBdn2BFGKx/Hf8H+UHuE6/LmK3vAp+44JSYZuO7OAEIJSdvNItR2VrftZ2GJg RgGmbOfffHQKgOLSExnUUtnyDudskhzgpT4ZD99JvgWVfB0fWi0vRWrkfgcgfYajE6Tp apb6xvZKio/A9B+Fi0nEFlbA6dHjuZBiysDiK7FDssg3IbUV6XTIMrSaVTwAJ4FKnNmq G+pj8WhvFK1FZgF38X+KxyAmyX+wlRQzKlYjl+PUjuNT6lwsqgQ1nSTR9DijrQoJr5Ld meqw== X-Gm-Message-State: AEkoousW8oXyu2XNx8mb5KGfpiVQiU5yAl4xEsQ8EDLrn7hGSs8d+Vf+aj8R2dN/rd6a6Q== X-Received: by 10.46.1.149 with SMTP id f21mr25278706lji.25.1470591782146; Sun, 07 Aug 2016 10:43:02 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id p21sm4930784lfp.4.2016.08.07.10.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 10:43:01 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> Cc: Bruce Simpson , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> Date: Sun, 7 Aug 2016 20:43:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807173734.GD22212@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 17:43:10 -0000 On 07.08.2016 20:37, Slawa Olhovchenkov wrote: > On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: > >> On 07.08.2016 20:31, Andrey Chernov wrote: >>> On 07.08.2016 19:14, Bruce Simpson wrote: >>>> On 07/08/16 15:40, Warner Losh wrote: >>>>> That’s a cop-out answer. We, as a project, need to articulate to our >>>>> users, whom we care about, why this rather obnoxious hit to usability >>>>> was taken. The answer must be more complete than “We just disabled >>>>> it because upstream disabled it for reasons we’re too lazy to explain >>>>> or document how to work around" >>>> >>>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >>>> accepted the upstream change, workaround no-go) >>>> >>>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >>>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >>>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >>>> group out of range >>>> >>> >>> DH prime size must be at least 2048, openssh now refuse lower values. >>> Commonly used DH size 1024 can be easily broken. See https://weakdh.org >>> >> diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. > > IMHO, this is wrong choise: totaly lost of control now vs teoretical > compromise of control in the future. Please note that it was not my choice and I can't answer what to do with non-upgradeable hardware question, address it to the author. I just tell you _why_ it happens. From owner-svn-src-head@freebsd.org Sun Aug 7 18:06:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A67FBBB1229 for ; Sun, 7 Aug 2016 18:06:41 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30D2E1439 for ; Sun, 7 Aug 2016 18:06:41 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id f93so233534408lfi.2 for ; Sun, 07 Aug 2016 11:06:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=EfzbBeqcyW4OYGb2wpX5auDIHI2ELukLi0za1nAu458=; b=THKAE8+at+Rf7ZR3Gvp9z6jhiYTuWWyAqhW41Dn7zoWLq3Tgb8V89dTweAw7IV54bB Ax3JsfU3TvwerNgjJGmUNU+XLlUGwNwvDssgBdQoqSEK3ftepnbeq/IcniWH95RQNBLf 2955sXITzJF7Y0F3pDtJ3WQYT7z7HDnzCP+ORt9OJfWpozAw2RwGQfsx+SUzQJueI23S E7QlHkl5ulWC2UpXsFyhs5122iNpibpGUHs5e2mChKbrxzwOWEhpLPXnG8tdgKjFLEoK QGI9eBDmlaLBQOUdr8ie6uVA2nI0s8Avi/OD7B3e126O4FWWjApSL0tS+OLQ/bRHmuwU 4WUA== X-Gm-Message-State: AEkoouslsMo21ttx5mfgogEEBnJjC50Nj+5o0yMwhplHn4zlZ/N25Han5aPHYPW8TKEHyA== X-Received: by 10.46.1.69 with SMTP id 66mr25467931ljb.27.1470593199138; Sun, 07 Aug 2016 11:06:39 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 142sm5052086ljf.9.2016.08.07.11.06.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 11:06:38 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> Cc: Bruce Simpson , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: Date: Sun, 7 Aug 2016 21:06:37 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:06:41 -0000 On 07.08.2016 20:43, Andrey Chernov wrote: > On 07.08.2016 20:37, Slawa Olhovchenkov wrote: >> On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: >> >>> On 07.08.2016 20:31, Andrey Chernov wrote: >>>> On 07.08.2016 19:14, Bruce Simpson wrote: >>>>> On 07/08/16 15:40, Warner Losh wrote: >>>>>> That’s a cop-out answer. We, as a project, need to articulate to our >>>>>> users, whom we care about, why this rather obnoxious hit to usability >>>>>> was taken. The answer must be more complete than “We just disabled >>>>>> it because upstream disabled it for reasons we’re too lazy to explain >>>>>> or document how to work around" >>>>> >>>>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >>>>> accepted the upstream change, workaround no-go) >>>>> >>>>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >>>>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >>>>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >>>>> group out of range >>>>> >>>> >>>> DH prime size must be at least 2048, openssh now refuse lower values. >>>> Commonly used DH size 1024 can be easily broken. See https://weakdh.org >>>> >>> diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. >> >> IMHO, this is wrong choise: totaly lost of control now vs teoretical >> compromise of control in the future. > > Please note that it was not my choice and I can't answer what to do with > non-upgradeable hardware question, address it to the author. I just tell > you _why_ it happens. > BTW, compromise is practical enough. From https://weakdh.org/ "A close reading of published NSA leaks shows that the agency's attacks on VPNs are consistent with having achieved such a break." From owner-svn-src-head@freebsd.org Sun Aug 7 18:12:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA0DBB15F3; Sun, 7 Aug 2016 18:12:38 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 207E51B07; Sun, 7 Aug 2016 18:12:37 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77ICbFK052237; Sun, 7 Aug 2016 18:12:37 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77ICaBI052231; Sun, 7 Aug 2016 18:12:36 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608071812.u77ICaBI052231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 7 Aug 2016 18:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303816 - in head/sys: conf dev/ixl modules/ixl modules/ixlv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:12:38 -0000 Author: sbruno Date: Sun Aug 7 18:12:36 2016 New Revision: 303816 URL: https://svnweb.freebsd.org/changeset/base/303816 Log: ixl(4): Update to ixl-1.6.6-k. Submitted by: erj Reviewed by: jeffrey.e.pieper@intel.com MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D7391 Added: head/sys/dev/ixl/ixl_pf_iov.c (contents, props changed) head/sys/dev/ixl/ixl_pf_iov.h - copied, changed from r303815, head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/ixl_pf_main.c - copied, changed from r303815, head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_pf_qmgr.c (contents, props changed) head/sys/dev/ixl/ixl_pf_qmgr.h (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c head/sys/modules/ixl/Makefile head/sys/modules/ixlv/Makefile (contents, props changed) Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Aug 7 17:07:53 2016 (r303815) +++ head/sys/conf/files.amd64 Sun Aug 7 18:12:36 2016 (r303816) @@ -216,6 +216,12 @@ dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux32 dev/ixl/if_ixl.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_pf_main.c optional ixl pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_pf_qmgr.c optional ixl pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_pf_iov.c optional ixl pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/if_ixlv.c optional ixlv pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixlvc.c optional ixlv pci \ Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Sun Aug 7 17:07:53 2016 (r303815) +++ head/sys/dev/ixl/i40e_adminq.c Sun Aug 7 18:12:36 2016 (r303816) @@ -39,16 +39,6 @@ #include "i40e_prototype.h" /** - * i40e_is_nvm_update_op - return TRUE if this is an NVM update operation - * @desc: API request descriptor - **/ -static INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) -{ - return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase)) || - (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); -} - -/** * i40e_adminq_init_regs - Initialize AdminQ registers * @hw: pointer to the hardware structure * @@ -661,13 +651,9 @@ enum i40e_status_code i40e_init_adminq(s /* pre-emptive resource lock release */ i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL); - hw->aq.nvm_release_on_done = FALSE; + hw->nvm_release_on_done = FALSE; hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; - ret_code = i40e_aq_set_hmc_resource_profile(hw, - I40E_HMC_PROFILE_DEFAULT, - 0, - NULL); ret_code = I40E_SUCCESS; /* success! */ @@ -1081,26 +1067,7 @@ enum i40e_status_code i40e_clean_arq_ele hw->aq.arq.next_to_clean = ntc; hw->aq.arq.next_to_use = ntu; - if (i40e_is_nvm_update_op(&e->desc)) { - if (hw->aq.nvm_release_on_done) { - i40e_release_nvm(hw); - hw->aq.nvm_release_on_done = FALSE; - } - - switch (hw->nvmupd_state) { - case I40E_NVMUPD_STATE_INIT_WAIT: - hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; - break; - - case I40E_NVMUPD_STATE_WRITE_WAIT: - hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING; - break; - - default: - break; - } - } - + i40e_nvmupd_check_wait_event(hw, LE16_TO_CPU(e->desc.opcode)); clean_arq_element_out: /* Set pending if needed, unlock and return */ if (pending != NULL) Modified: head/sys/dev/ixl/i40e_adminq.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq.h Sun Aug 7 17:07:53 2016 (r303815) +++ head/sys/dev/ixl/i40e_adminq.h Sun Aug 7 18:12:36 2016 (r303816) @@ -105,7 +105,6 @@ struct i40e_adminq_info { u32 fw_build; /* firmware build number */ u16 api_maj_ver; /* api major version */ u16 api_min_ver; /* api minor version */ - bool nvm_release_on_done; struct i40e_spinlock asq_spinlock; /* Send queue spinlock */ struct i40e_spinlock arq_spinlock; /* Receive queue spinlock */ Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Sun Aug 7 17:07:53 2016 (r303815) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Sun Aug 7 18:12:36 2016 (r303816) @@ -140,6 +140,10 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, + /* Proxy commands */ + i40e_aqc_opc_set_proxy_config = 0x0104, + i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, + /* LAA */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -147,6 +151,10 @@ enum i40e_admin_queue_opc { /* PXE */ i40e_aqc_opc_clear_pxe_mode = 0x0110, + /* WoL commands */ + i40e_aqc_opc_set_wol_filter = 0x0120, + i40e_aqc_opc_get_wake_reason = 0x0121, + /* internal switch commands */ i40e_aqc_opc_get_switch_config = 0x0200, i40e_aqc_opc_add_statistics = 0x0201, @@ -185,6 +193,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_remove_control_packet_filter = 0x025B, i40e_aqc_opc_add_cloud_filters = 0x025C, i40e_aqc_opc_remove_cloud_filters = 0x025D, + i40e_aqc_opc_clear_wol_switch_filters = 0x025E, i40e_aqc_opc_add_mirror_rule = 0x0260, i40e_aqc_opc_delete_mirror_rule = 0x0261, @@ -212,7 +221,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_suspend_port_tx = 0x041B, i40e_aqc_opc_resume_port_tx = 0x041C, i40e_aqc_opc_configure_partition_bw = 0x041D, - /* hmc */ i40e_aqc_opc_query_hmc_resource_profile = 0x0500, i40e_aqc_opc_set_hmc_resource_profile = 0x0501, @@ -271,6 +279,10 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, + i40e_aqc_opc_set_rss_key = 0x0B02, + i40e_aqc_opc_set_rss_lut = 0x0B03, + i40e_aqc_opc_get_rss_key = 0x0B04, + i40e_aqc_opc_get_rss_lut = 0x0B05, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -433,6 +445,7 @@ struct i40e_aqc_list_capabilities_elemen #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 +#define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 @@ -457,13 +470,15 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_conf /* Set ARP Proxy command / response (indirect 0x0104) */ struct i40e_aqc_arp_proxy_data { __le16 command_flags; -#define I40E_AQ_ARP_INIT_IPV4 0x0008 -#define I40E_AQ_ARP_UNSUP_CTL 0x0010 -#define I40E_AQ_ARP_ENA 0x0020 -#define I40E_AQ_ARP_ADD_IPV4 0x0040 -#define I40E_AQ_ARP_DEL_IPV4 0x0080 +#define I40E_AQ_ARP_INIT_IPV4 0x0800 +#define I40E_AQ_ARP_UNSUP_CTL 0x1000 +#define I40E_AQ_ARP_ENA 0x2000 +#define I40E_AQ_ARP_ADD_IPV4 0x4000 +#define I40E_AQ_ARP_DEL_IPV4 0x8000 __le16 table_id; - __le32 pfpm_proxyfc; + __le32 enabled_offloads; +#define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE 0x00000020 +#define I40E_AQ_ARP_OFFLOAD_ENABLE 0x00000800 __le32 ip_addr; u8 mac_addr[6]; u8 reserved[2]; @@ -478,17 +493,19 @@ struct i40e_aqc_ns_proxy_data { __le16 table_idx_ipv6_0; __le16 table_idx_ipv6_1; __le16 control; -#define I40E_AQ_NS_PROXY_ADD_0 0x0100 -#define I40E_AQ_NS_PROXY_DEL_0 0x0200 -#define I40E_AQ_NS_PROXY_ADD_1 0x0400 -#define I40E_AQ_NS_PROXY_DEL_1 0x0800 -#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x1000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x2000 -#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x4000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x8000 -#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001 -#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002 -#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004 +#define I40E_AQ_NS_PROXY_ADD_0 0x0001 +#define I40E_AQ_NS_PROXY_DEL_0 0x0002 +#define I40E_AQ_NS_PROXY_ADD_1 0x0004 +#define I40E_AQ_NS_PROXY_DEL_1 0x0008 +#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x0010 +#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x0020 +#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x0040 +#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x0080 +#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0100 +#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0200 +#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0400 +#define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE 0x0800 +#define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE 0x1000 u8 mac_addr_0[6]; u8 mac_addr_1[6]; u8 local_mac_addr[6]; @@ -538,6 +555,7 @@ I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_a /* Manage MAC Address Write Command (0x0108) */ struct i40e_aqc_mac_address_write { __le16 command_flags; +#define I40E_AQC_MC_MAG_EN 0x0100 #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 @@ -561,6 +579,56 @@ struct i40e_aqc_clear_pxe { I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe); +/* Set WoL Filter (0x0120) */ + +struct i40e_aqc_set_wol_filter { + __le16 filter_index; +#define I40E_AQC_MAX_NUM_WOL_FILTERS 8 +#define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT 15 +#define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_MASK (0x1 << \ + I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT) + +#define I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT 0 +#define I40E_AQC_SET_WOL_FILTER_INDEX_MASK (0x7 << \ + I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT) + __le16 cmd_flags; +#define I40E_AQC_SET_WOL_FILTER 0x8000 +#define I40E_AQC_SET_WOL_FILTER_NO_TCO_WOL 0x4000 +#define I40E_AQC_SET_WOL_FILTER_ACTION_CLEAR 0 +#define I40E_AQC_SET_WOL_FILTER_ACTION_SET 1 + __le16 valid_flags; +#define I40E_AQC_SET_WOL_FILTER_ACTION_VALID 0x8000 +#define I40E_AQC_SET_WOL_FILTER_NO_TCO_ACTION_VALID 0x4000 + u8 reserved[2]; + __le32 address_high; + __le32 address_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_set_wol_filter); + +struct i40e_aqc_set_wol_filter_data { + u8 filter[128]; + u8 mask[16]; +}; + +I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data); + +/* Get Wake Reason (0x0121) */ + +struct i40e_aqc_get_wake_reason_completion { + u8 reserved_1[2]; + __le16 wake_reason; +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT 0 +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_MASK (0xFF << \ + I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT) +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT 8 +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_MASK (0xFF << \ + I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT) + u8 reserved_2[12]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion); + /* Switch configuration commands (0x02xx) */ /* Used by many indirect commands that only pass an seid and a buffer in the @@ -643,6 +711,8 @@ struct i40e_aqc_set_port_parameters { #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS 2 /* must set! */ #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA 4 __le16 bad_frame_vsi; +#define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_SHIFT 0x0 +#define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_MASK 0x3FF __le16 default_seid; /* reserved for command */ u8 reserved[10]; }; @@ -694,6 +764,7 @@ I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_swi /* Set Switch Configuration (direct 0x0205) */ struct i40e_aqc_set_switch_config { __le16 flags; +/* flags used for both fields below */ #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 __le16 valid_flags; @@ -862,8 +933,12 @@ struct i40e_aqc_vsi_properties_data { I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) /* queueing option section */ u8 queueing_opt_flags; +#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 +#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 u8 queueing_opt_reserved[3]; /* scheduler section */ u8 up_enable_bits; @@ -1597,15 +1672,12 @@ struct i40e_aq_get_set_hmc_resource_prof I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile); enum i40e_aq_hmc_profile { - /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ + /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ I40E_HMC_PROFILE_DEFAULT = 1, I40E_HMC_PROFILE_FAVOR_VF = 2, I40E_HMC_PROFILE_EQUAL = 3, }; -#define I40E_AQ_GET_HMC_RESOURCE_PROFILE_PM_MASK 0xF -#define I40E_AQ_GET_HMC_RESOURCE_PROFILE_COUNT_MASK 0x3F - /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ /* set in param0 for get phy abilities to report qualified modules */ @@ -1641,6 +1713,10 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_1000BASE_LX = 0x1C, I40E_PHY_TYPE_1000BASE_T_OPTICAL = 0x1D, I40E_PHY_TYPE_20GBASE_KR2 = 0x1E, + I40E_PHY_TYPE_25GBASE_KR = 0x1F, + I40E_PHY_TYPE_25GBASE_CR = 0x20, + I40E_PHY_TYPE_25GBASE_SR = 0x21, + I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_MAX }; @@ -1649,6 +1725,7 @@ enum i40e_aq_phy_type { #define I40E_LINK_SPEED_10GB_SHIFT 0x3 #define I40E_LINK_SPEED_40GB_SHIFT 0x4 #define I40E_LINK_SPEED_20GB_SHIFT 0x5 +#define I40E_LINK_SPEED_25GB_SHIFT 0x6 enum i40e_aq_link_speed { I40E_LINK_SPEED_UNKNOWN = 0, @@ -1656,7 +1733,8 @@ enum i40e_aq_link_speed { I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT), I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT), I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT), - I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT) + I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT), + I40E_LINK_SPEED_25GB = (1 << I40E_LINK_SPEED_25GB_SHIFT), }; struct i40e_aqc_module_desc { @@ -1689,7 +1767,13 @@ struct i40e_aq_get_phy_abilities_resp { __le32 eeer_val; u8 d3_lpan; #define I40E_AQ_SET_PHY_D3_LPAN_ENA 0x01 - u8 reserved[3]; + u8 phy_type_ext; +#define I40E_AQ_PHY_TYPE_EXT_25G_KR 0X01 +#define I40E_AQ_PHY_TYPE_EXT_25G_CR 0X02 +#define I40E_AQ_PHY_TYPE_EXT_25G_SR 0x04 +#define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 + u8 mod_type_ext; + u8 ext_comp_code; u8 phy_id[4]; u8 module_type[3]; u8 qualified_module_count; @@ -1711,7 +1795,12 @@ struct i40e_aq_set_phy_config { /* same __le16 eee_capability; __le32 eeer; u8 low_power_ctrl; - u8 reserved[3]; + u8 phy_type_ext; +#define I40E_AQ_PHY_TYPE_EXT_25G_KR 0X01 +#define I40E_AQ_PHY_TYPE_EXT_25G_CR 0X02 +#define I40E_AQ_PHY_TYPE_EXT_25G_SR 0x04 +#define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 + u8 reserved[2]; }; I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); @@ -1791,16 +1880,24 @@ struct i40e_aqc_get_link_status { #define I40E_AQ_LINK_TX_DRAINED 0x01 #define I40E_AQ_LINK_TX_FLUSHED 0x03 #define I40E_AQ_LINK_FORCED_40G 0x10 +/* 25G Error Codes */ +#define I40E_AQ_25G_NO_ERR 0X00 +#define I40E_AQ_25G_NOT_PRESENT 0X01 +#define I40E_AQ_25G_NVM_CRC_ERR 0X02 +#define I40E_AQ_25G_SBUS_UCODE_ERR 0X03 +#define I40E_AQ_25G_SERDES_UCODE_ERR 0X04 +#define I40E_AQ_25G_NIMB_UCODE_ERR 0X05 u8 loopback; /* use defines from i40e_aqc_set_lb_mode */ __le16 max_frame_size; u8 config; #define I40E_AQ_CONFIG_CRC_ENA 0x04 #define I40E_AQ_CONFIG_PACING_MASK 0x78 - u8 external_power_ability; + u8 power_desc; #define I40E_AQ_LINK_POWER_CLASS_1 0x00 #define I40E_AQ_LINK_POWER_CLASS_2 0x01 #define I40E_AQ_LINK_POWER_CLASS_3 0x02 #define I40E_AQ_LINK_POWER_CLASS_4 0x03 +#define I40E_AQ_PWR_CLASS_MASK 0x03 u8 reserved[4]; }; @@ -1857,7 +1954,10 @@ struct i40e_aqc_set_phy_debug { #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_NONE 0x00 #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_HARD 0x01 #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SOFT 0x02 +/* Disable link manageability on a single port */ #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW 0x10 +/* Disable link manageability on all ports needs both bits 4 and 5 */ +#define I40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW 0x20 u8 reserved[15]; }; @@ -2296,6 +2396,46 @@ struct i40e_aqc_del_udp_tunnel_completio I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); +struct i40e_aqc_get_set_rss_key { +#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) + __le16 vsi_id; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); + +struct i40e_aqc_get_set_rss_key_data { + u8 standard_rss_key[0x28]; + u8 extended_hash_key[0xc]; +}; + +I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); + +struct i40e_aqc_get_set_rss_lut { +#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) + __le16 vsi_id; +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) + +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 + __le16 flags; + u8 reserved[4]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); + /* tunnel key structure 0x0B10 */ struct i40e_aqc_tunnel_key_structure { Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Sun Aug 7 17:07:53 2016 (r303815) +++ head/sys/dev/ixl/i40e_common.c Sun Aug 7 18:12:36 2016 (r303816) @@ -64,8 +64,24 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_10G_BASE_T4: case I40E_DEV_ID_20G_KR2: case I40E_DEV_ID_20G_KR2_A: + case I40E_DEV_ID_25G_B: + case I40E_DEV_ID_25G_SFP28: hw->mac.type = I40E_MAC_XL710; break; + case I40E_DEV_ID_X722_A0: + case I40E_DEV_ID_KX_X722: + case I40E_DEV_ID_QSFP_X722: + case I40E_DEV_ID_SFP_X722: + case I40E_DEV_ID_1G_BASE_T_X722: + case I40E_DEV_ID_10G_BASE_T_X722: + case I40E_DEV_ID_SFP_I_X722: + hw->mac.type = I40E_MAC_X722; + break; + case I40E_DEV_ID_X722_VF: + case I40E_DEV_ID_X722_VF_HV: + case I40E_DEV_ID_X722_A0_VF: + hw->mac.type = I40E_MAC_X722_VF; + break; case I40E_DEV_ID_VF: case I40E_DEV_ID_VF_HV: hw->mac.type = I40E_MAC_VF; @@ -341,14 +357,15 @@ void i40e_debug_aq(struct i40e_hw *hw, e /* the most we could have left is 16 bytes, pad with zeros */ if (i < len) { char d_buf[16]; - int j; + int j, i_sav; + i_sav = i; memset(d_buf, 0, sizeof(d_buf)); for (j = 0; i < len; j++, i++) d_buf[j] = buf[i]; i40e_debug(hw, mask, "\t0x%04X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", - i, d_buf[0], d_buf[1], d_buf[2], d_buf[3], + i_sav, d_buf[0], d_buf[1], d_buf[2], d_buf[3], d_buf[4], d_buf[5], d_buf[6], d_buf[7], d_buf[8], d_buf[9], d_buf[10], d_buf[11], d_buf[12], d_buf[13], d_buf[14], d_buf[15]); @@ -400,6 +417,164 @@ enum i40e_status_code i40e_aq_queue_shut return status; } +/** + * i40e_aq_get_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * @set: set TRUE to set the table, FALSE to get the table + * + * Internal function to get or set RSS look up table + **/ +static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, + u16 vsi_id, bool pf_lut, + u8 *lut, u16 lut_size, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_lut *cmd_resp = + (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_lut); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_lut); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); + + if (pf_lut) + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + else + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + + status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * get the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, + FALSE); +} + +/** + * i40e_aq_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * set the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE); +} + +/** + * i40e_aq_get_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * @set: set TRUE to set the key, FALSE to get the key + * + * get the RSS key per VSI + **/ +static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_key *cmd_resp = + (struct i40e_aqc_get_set_rss_key *)&desc.params.raw; + u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_key); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_key); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); + + status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + **/ +enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); +} + +/** + * i40e_aq_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + * set the RSS key per VSI + **/ +enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); +} + /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the * hardware to a bit-field that can be used by SW to more easily determine the * packet type. @@ -563,7 +738,7 @@ struct i40e_rx_ptype_decoded i40e_ptype_ /* Non Tunneled IPv6 */ I40E_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3), I40E_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3), - I40E_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY3), + I40E_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY4), I40E_PTT_UNUSED_ENTRY(91), I40E_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP, PAY4), I40E_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4), @@ -813,6 +988,7 @@ enum i40e_status_code i40e_init_shared_c switch (hw->mac.type) { case I40E_MAC_XL710: + case I40E_MAC_X722: break; default: return I40E_ERR_DEVICE_NOT_SUPPORTED; @@ -832,6 +1008,9 @@ enum i40e_status_code i40e_init_shared_c else hw->pf_id = (u8)(func_rid & 0x7); + if (hw->mac.type == I40E_MAC_X722) + hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE; + status = i40e_init_nvm(hw); return status; } @@ -1104,8 +1283,7 @@ enum i40e_status_code i40e_pf_reset(stru I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - /* It can take upto 15 secs for GRST steady state */ - grst_del = grst_del * 20; /* bump it to 16 secs max to be safe */ + grst_del = grst_del * 20; for (cnt = 0; cnt < grst_del; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); @@ -1452,8 +1630,10 @@ enum i40e_status_code i40e_aq_get_phy_ca if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) status = I40E_ERR_UNKNOWN_PHY; - if (report_init) + if (report_init) { hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type); + hw->phy.phy_types |= ((u64)abilities->phy_type_ext << 32); + } return status; } @@ -1997,15 +2177,45 @@ enum i40e_status_code i40e_aq_set_defaul } /** + * i40e_aq_clear_default_vsi + * @hw: pointer to the hw struct + * @seid: vsi number + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_clear_default_vsi(struct i40e_hw *hw, + u16 seid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *) + &desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + cmd->promiscuous_flags = CPU_TO_LE16(0); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_DEFAULT); + cmd->seid = CPU_TO_LE16(seid); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_set_vsi_unicast_promiscuous * @hw: pointer to the hw struct * @seid: vsi number * @set: set unicast promiscuous enable/disable * @cmd_details: pointer to command details structure or NULL + * @rx_only_promisc: flag to decide if egress traffic gets mirrored in promisc **/ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 seid, bool set, - struct i40e_asq_cmd_details *cmd_details) + struct i40e_asq_cmd_details *cmd_details, + bool rx_only_promisc) { struct i40e_aq_desc desc; struct i40e_aqc_set_vsi_promiscuous_modes *cmd = @@ -2018,8 +2228,9 @@ enum i40e_status_code i40e_aq_set_vsi_un if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) + if (rx_only_promisc && + (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || + (hw->aq.api_maj_ver > 1))) flags |= I40E_AQC_SET_VSI_PROMISC_TX; } @@ -2192,7 +2403,7 @@ enum i40e_status_code i40e_aq_set_vsi_vl i40e_aqc_opc_set_vsi_promiscuous_modes); if (enable) flags |= I40E_AQC_SET_VSI_PROMISC_VLAN; - + cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_VLAN); cmd->seid = CPU_TO_LE16(seid); @@ -2826,10 +3037,7 @@ enum i40e_status_code i40e_aq_delete_mir u16 *rules_used, u16 *rules_free) { /* Rule ID has to be valid except rule_type: INGRESS VLAN mirroring */ - if (rule_type != I40E_AQC_MIRROR_RULE_TYPE_VLAN) { - if (!rule_id) - return I40E_ERR_PARAM; - } else { + if (rule_type == I40E_AQC_MIRROR_RULE_TYPE_VLAN) { /* count and mr_list shall be valid for rule_type INGRESS VLAN * mirroring. For other rule_type, count and rule_type should * not matter. @@ -3026,67 +3234,6 @@ enum i40e_status_code i40e_aq_debug_writ } /** - * i40e_aq_get_hmc_resource_profile - * @hw: pointer to the hw struct - * @profile: type of profile the HMC is to be set as - * @pe_vf_enabled_count: the number of PE enabled VFs the system has - * @cmd_details: pointer to command details structure or NULL - * - * query the HMC profile of the device. - **/ -enum i40e_status_code i40e_aq_get_hmc_resource_profile(struct i40e_hw *hw, - enum i40e_aq_hmc_profile *profile, - u8 *pe_vf_enabled_count, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aq_get_set_hmc_resource_profile *resp = - (struct i40e_aq_get_set_hmc_resource_profile *)&desc.params.raw; - enum i40e_status_code status; - - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_query_hmc_resource_profile); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - - *profile = (enum i40e_aq_hmc_profile)(resp->pm_profile & - I40E_AQ_GET_HMC_RESOURCE_PROFILE_PM_MASK); - *pe_vf_enabled_count = resp->pe_vf_enabled & - I40E_AQ_GET_HMC_RESOURCE_PROFILE_COUNT_MASK; - - return status; -} - -/** - * i40e_aq_set_hmc_resource_profile - * @hw: pointer to the hw struct - * @profile: type of profile the HMC is to be set as - * @pe_vf_enabled_count: the number of PE enabled VFs the system has - * @cmd_details: pointer to command details structure or NULL - * - * set the HMC profile of the device. - **/ -enum i40e_status_code i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw, - enum i40e_aq_hmc_profile profile, - u8 pe_vf_enabled_count, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aq_get_set_hmc_resource_profile *cmd = - (struct i40e_aq_get_set_hmc_resource_profile *)&desc.params.raw; - enum i40e_status_code status; - - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_set_hmc_resource_profile); - - cmd->pm_profile = (u8)profile; - cmd->pe_vf_enabled = pe_vf_enabled_count; - - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - - return status; -} - -/** * i40e_aq_request_resource * @hw: pointer to the hw struct * @resource: resource id @@ -3603,6 +3750,26 @@ static void i40e_parse_discover_capabili "HW Capability: wr_csr_prot = 0x%llX\n\n", (p->wr_csr_prot & 0xffff)); break; + case I40E_AQ_CAP_ID_NVM_MGMT: + if (number & I40E_NVM_MGMT_SEC_REV_DISABLED) + p->sec_rev_disabled = TRUE; + if (number & I40E_NVM_MGMT_UPDATE_DISABLED) + p->update_disabled = TRUE; + break; + case I40E_AQ_CAP_ID_WOL_AND_PROXY: + hw->num_wol_proxy_filters = (u16)number; + hw->wol_proxy_vsi_seid = (u16)logical_id; + p->apm_wol_support = phys_id & I40E_WOL_SUPPORT_MASK; + if (phys_id & I40E_ACPI_PROGRAMMING_METHOD_MASK) + p->acpi_prog_method = I40E_ACPI_PROGRAMMING_METHOD_AQC_FPK; + else + p->acpi_prog_method = I40E_ACPI_PROGRAMMING_METHOD_HW_FVL; + p->proxy_support = (phys_id & I40E_PROXY_SUPPORT_MASK) ? 1 : 0; + p->proxy_support = p->proxy_support; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: WOL proxy filters = %d\n", + hw->num_wol_proxy_filters); + break; default: break; } @@ -5211,6 +5378,35 @@ void i40e_add_filter_to_drop_tx_flow_con } /** + * i40e_fix_up_geneve_vni - adjust Geneve VNI for HW issue + * @filters: list of cloud filters + * @filter_count: length of list + * + * There's an issue in the device where the Geneve VNI layout needs + * to be shifted 1 byte over from the VxLAN VNI + **/ +static void i40e_fix_up_geneve_vni( + struct i40e_aqc_add_remove_cloud_filters_element_data *filters, + u8 filter_count) +{ + struct i40e_aqc_add_remove_cloud_filters_element_data *f = filters; + int i; + + for (i = 0; i < filter_count; i++) { + u16 tnl_type; + u32 ti; + + tnl_type = (LE16_TO_CPU(f[i].flags) & + I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK) >> + I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT; + if (tnl_type == I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE) { + ti = LE32_TO_CPU(f[i].tenant_id); + f[i].tenant_id = CPU_TO_LE32(ti << 8); + } + } +} + +/** * i40e_aq_add_cloud_filters * @hw: pointer to the hardware structure * @seid: VSI seid to add cloud filters from @@ -5230,8 +5426,8 @@ enum i40e_status_code i40e_aq_add_cloud_ struct i40e_aq_desc desc; struct i40e_aqc_add_remove_cloud_filters *cmd = (struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw; - u16 buff_len; enum i40e_status_code status; + u16 buff_len; i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_cloud_filters); @@ -5242,6 +5438,8 @@ enum i40e_status_code i40e_aq_add_cloud_ cmd->num_filters = filter_count; cmd->seid = CPU_TO_LE16(seid); + i40e_fix_up_geneve_vni(filters, filter_count); + status = i40e_asq_send_command(hw, &desc, filters, buff_len, NULL); return status; @@ -5279,6 +5477,8 @@ enum i40e_status_code i40e_aq_remove_clo cmd->num_filters = filter_count; cmd->seid = CPU_TO_LE16(seid); + i40e_fix_up_geneve_vni(filters, filter_count); + status = i40e_asq_send_command(hw, &desc, filters, buff_len, NULL); return status; @@ -6263,3 +6463,158 @@ enum i40e_status_code i40e_vf_reset(stru return i40e_aq_send_msg_to_pf(hw, I40E_VIRTCHNL_OP_RESET_VF, I40E_SUCCESS, NULL, 0, NULL); } + +/** + * i40e_aq_set_arp_proxy_config + * @hw: pointer to the HW structure + * @proxy_config - pointer to proxy config command table struct + * @cmd_details: pointer to command details + * + * Set ARP offload parameters from pre-populated + * i40e_aqc_arp_proxy_data struct + **/ +enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, + struct i40e_aqc_arp_proxy_data *proxy_config, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + enum i40e_status_code status; + + if (!proxy_config) + return I40E_ERR_PARAM; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_proxy_config); + + desc.params.external.addr_high = + CPU_TO_LE32(I40E_HI_DWORD((u64)proxy_config)); + desc.params.external.addr_low = + CPU_TO_LE32(I40E_LO_DWORD((u64)proxy_config)); + + status = i40e_asq_send_command(hw, &desc, proxy_config, + sizeof(struct i40e_aqc_arp_proxy_data), + cmd_details); + + return status; +} + +/** + * i40e_aq_opc_set_ns_proxy_table_entry + * @hw: pointer to the HW structure + * @ns_proxy_table_entry: pointer to NS table entry command struct + * @cmd_details: pointer to command details + * + * Set IPv6 Neighbor Solicitation (NS) protocol offload parameters + * from pre-populated i40e_aqc_ns_proxy_data struct + **/ +enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw, + struct i40e_aqc_ns_proxy_data *ns_proxy_table_entry, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 7 18:21:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB274BB192F for ; Sun, 7 Aug 2016 18:21:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8D441EE5 for ; Sun, 7 Aug 2016 18:21:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x234.google.com with SMTP id m101so340332187ioi.2 for ; Sun, 07 Aug 2016 11:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I4swwjiA+e9wpEDqwLFWu+5/jqDKZUQUFEX8SrWBPqw=; b=mAz2+LSIgSI2yVLwTKA7Bk/HGtMZS/BMVDYloBhc4OSycplovWDrqc8/ZfPBlh63Qc C+rfaOVenVv0QwQe7cbwYgh3A84yvPiY0YpXYFJuvJx0UT65+Q0IiRodMthheHxypSzU b42kg+Gz/AkO1oUgH4eImD1QT8M56O/WHH4M4U+ddtVyhs4uCL2Ed636lPUoHfQtJHB7 4ZbH7I9Gkq7hIHH4nA4Zc15OZk30TVHyyQuLZi58vB+NrWDynlcybO3+s9X5oZuyXmKm DBb/rpfDyrcXRfQby3CEAwbIl5kNItHTv08OPiQ7hX1wMOA9HPyhsPy5H1PsWRAAn6QZ LNIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=I4swwjiA+e9wpEDqwLFWu+5/jqDKZUQUFEX8SrWBPqw=; b=MsXyhxR36QWYQqUxqi+QMBcdAOBOShP/kXbcCNP4WQWFHF8Sqa55+HcIeNjuxFLxLP 9PY1TN41bsTG3V+BEy1A7oZYmN5w6aapP2Bvdu/SSPlunOigRHCrUoDMlFII50FzA3D3 65d7HiJhTbNEiKgeCTMiIBjAeQ2IRegsFsKdg8TiePcWp0G4qoOBYIzAxz1/wv2ForWU UJ1BrwA0JxuprBm5Zw1kIAhtEvoK030tHDPof+1Pa8Li5BVVbBN8ZE5CRDhiZM0TArPr 45QpLtiiVJRMyZv10Zl+lgT/7iFZ7SZhvuez4cvg3d8tcpBDDUGF8TU2tAqX6IF65ewe uuEA== X-Gm-Message-State: AEkoouvOm4hnUFJr6U1Wu76Du7bdEtYlk0insjXx+3u4lpjZhDvtP27JbtaoJqa08NGhgA== X-Received: by 10.107.59.20 with SMTP id i20mr92382268ioa.145.1470594064141; Sun, 07 Aug 2016 11:21:04 -0700 (PDT) Received: from zhabar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id j129sm12590151iof.35.2016.08.07.11.20.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Aug 2016 11:20:57 -0700 (PDT) Sender: Justin Hibbits Date: Sun, 7 Aug 2016 13:19:20 -0500 From: Justin Hibbits To: Mark Millard Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r303797 - head/contrib/binutils/bfd Message-ID: <20160807131920.402b3cec@zhabar.knownspace> In-Reply-To: References: X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; powerpc64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:21:05 -0000 On Sat, 6 Aug 2016 23:52:58 -0700 Mark Millard wrote: > Is there to be an MFC for the below? > > > Author: jhibbits > > Date: Sat Aug 6 15:10:14 2016 > > New Revision: 303797 > > URL: > > https://svnweb.freebsd.org/changeset/base/303797 > > > > > > Log: > > Check the first byte of the array for NUL, instead of the array > > as a NULL pointer > > The partition_name field is an array, so can never be NULL > > itself. Check only the first byte instead. > > > > This was found when test building with clang, but I'm not sure > > how it passes gcc's warnings either. > > MFC After: 11-RELEASE - Justin From owner-svn-src-head@freebsd.org Sun Aug 7 18:23:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77626BB1965; Sun, 7 Aug 2016 18:23:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317C51246; Sun, 7 Aug 2016 18:23:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWSjF-0000II-Tg; Sun, 07 Aug 2016 21:23:17 +0300 Date: Sun, 7 Aug 2016 21:23:17 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807182317.GE22212@zxy.spb.ru> References: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:23:20 -0000 On Sun, Aug 07, 2016 at 09:06:37PM +0300, Andrey Chernov wrote: > On 07.08.2016 20:43, Andrey Chernov wrote: > > On 07.08.2016 20:37, Slawa Olhovchenkov wrote: > >> On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: > >> > >>> On 07.08.2016 20:31, Andrey Chernov wrote: > >>>> On 07.08.2016 19:14, Bruce Simpson wrote: > >>>>> On 07/08/16 15:40, Warner Losh wrote: > >>>>>> That’s a cop-out answer. We, as a project, need to articulate to our > >>>>>> users, whom we care about, why this rather obnoxious hit to usability > >>>>>> was taken. The answer must be more complete than “We just disabled > >>>>>> it because upstream disabled it for reasons we’re too lazy to explain > >>>>>> or document how to work around" > >>>>> > >>>>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which > >>>>> accepted the upstream change, workaround no-go) > >>>>> > >>>>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin > >>>>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX > >>>>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX > >>>>> group out of range > >>>>> > >>>> > >>>> DH prime size must be at least 2048, openssh now refuse lower values. > >>>> Commonly used DH size 1024 can be easily broken. See https://weakdh.org > >>>> > >>> diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. > >> > >> IMHO, this is wrong choise: totaly lost of control now vs teoretical > >> compromise of control in the future. > > > > Please note that it was not my choice and I can't answer what to do with > > non-upgradeable hardware question, address it to the author. I just tell > > you _why_ it happens. > > > > BTW, compromise is practical enough. From https://weakdh.org/ "A close > reading of published NSA leaks shows that the agency's attacks on VPNs > are consistent with having achieved such a break." For this compromise need 1) NSA interesed to me 2) NSA must be able to access to weak device for traffic intercept This is imposible at this time. Also, if NSA can be able to intercept such traffic weak crypto will be last resort of my trouble. From owner-svn-src-head@freebsd.org Sun Aug 7 18:34:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE72BB1C15 for ; Sun, 7 Aug 2016 18:34:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDDF61788 for ; Sun, 7 Aug 2016 18:34:55 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id b199so234106303lfe.0 for ; Sun, 07 Aug 2016 11:34:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=BapGLFyrfrFA5vIrJ6CqIwoCcVCvMvizYHsMtlrKHq0=; b=X1Ahn7QWqiZzN7FJtoTVRq3eq4OmpZVJKCV5L9VpXlTbU28zT4dmTD4xb/RzB6hhva 4eqIcH82ZmqCtsNfpxudF60qs97TbXAgN87h7SRePyEC6VRYIPUjb1OI7992+o0ZNlEo LOU1EeFzwr/t5EiTbwpJqzTxJcP/phgSSdpxM4sfyINM5kd8ks9rGBqa5id3gok9S/Ub nLFXdUvGHuw8Wh7EbwQvzEOkn5OtxKtYoOKwdeW3rvlxkp2l1shWQ5jHacjXpYLKG+jW bF50aiX+0Qa2JnD1WFvE/bhU7o352mYaw9pNTKby9uBdpnvb1xDY38nDPihpzvl2xNXr R2hg== X-Gm-Message-State: AEkoousfTv7VEixg6lAM3+gOYYaMN0KJQTJ8W+smzWCsvf55E9acBM7KcLMdqHUqcQhPNA== X-Received: by 10.25.165.71 with SMTP id o68mr22087668lfe.95.1470594893403; Sun, 07 Aug 2016 11:34:53 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id l19sm5000996lfi.24.2016.08.07.11.34.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 11:34:52 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: Date: Sun, 7 Aug 2016 21:34:51 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807182317.GE22212@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:34:56 -0000 On 07.08.2016 21:23, Slawa Olhovchenkov wrote: > On Sun, Aug 07, 2016 at 09:06:37PM +0300, Andrey Chernov wrote: > >> On 07.08.2016 20:43, Andrey Chernov wrote: >>> On 07.08.2016 20:37, Slawa Olhovchenkov wrote: >>>> On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: >>>> >>>>> On 07.08.2016 20:31, Andrey Chernov wrote: >>>>>> On 07.08.2016 19:14, Bruce Simpson wrote: >>>>>>> On 07/08/16 15:40, Warner Losh wrote: >>>>>>>> That’s a cop-out answer. We, as a project, need to articulate to our >>>>>>>> users, whom we care about, why this rather obnoxious hit to usability >>>>>>>> was taken. The answer must be more complete than “We just disabled >>>>>>>> it because upstream disabled it for reasons we’re too lazy to explain >>>>>>>> or document how to work around" >>>>>>> >>>>>>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which >>>>>>> accepted the upstream change, workaround no-go) >>>>>>> >>>>>>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin >>>>>>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX >>>>>>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX >>>>>>> group out of range >>>>>>> >>>>>> >>>>>> DH prime size must be at least 2048, openssh now refuse lower values. >>>>>> Commonly used DH size 1024 can be easily broken. See https://weakdh.org >>>>>> >>>>> diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. >>>> >>>> IMHO, this is wrong choise: totaly lost of control now vs teoretical >>>> compromise of control in the future. >>> >>> Please note that it was not my choice and I can't answer what to do with >>> non-upgradeable hardware question, address it to the author. I just tell >>> you _why_ it happens. >>> >> >> BTW, compromise is practical enough. From https://weakdh.org/ "A close >> reading of published NSA leaks shows that the agency's attacks on VPNs >> are consistent with having achieved such a break." > > For this compromise need > > 1) NSA interesed to me This particular condition is not necessary, they can decrypt all traffic with weak DH primes passed through main channels in USA and perhaps partially in Europe (depends on mutual agreement), then find interesting keywords to spy more closely afterwards. > 2) NSA must be able to access to weak device for traffic > intercept > > This is imposible at this time. > > Also, if NSA can be able to intercept such traffic weak crypto will be > last resort of my trouble. About the rest, I am not the person to argue with. Why you still not send your opinion to the author? From owner-svn-src-head@freebsd.org Sun Aug 7 18:52:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38574BB1F4F; Sun, 7 Aug 2016 18:52:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB6E1EC5; Sun, 7 Aug 2016 18:52:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWTBd-00015y-P2; Sun, 07 Aug 2016 21:52:37 +0300 Date: Sun, 7 Aug 2016 21:52:37 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807185237.GV8192@zxy.spb.ru> References: <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 18:52:41 -0000 On Sun, Aug 07, 2016 at 09:34:51PM +0300, Andrey Chernov wrote: > On 07.08.2016 21:23, Slawa Olhovchenkov wrote: > > On Sun, Aug 07, 2016 at 09:06:37PM +0300, Andrey Chernov wrote: > > > >> On 07.08.2016 20:43, Andrey Chernov wrote: > >>> On 07.08.2016 20:37, Slawa Olhovchenkov wrote: > >>>> On Sun, Aug 07, 2016 at 08:34:55PM +0300, Andrey Chernov wrote: > >>>> > >>>>> On 07.08.2016 20:31, Andrey Chernov wrote: > >>>>>> On 07.08.2016 19:14, Bruce Simpson wrote: > >>>>>>> On 07/08/16 15:40, Warner Losh wrote: > >>>>>>>> That’s a cop-out answer. We, as a project, need to articulate to our > >>>>>>>> users, whom we care about, why this rather obnoxious hit to usability > >>>>>>>> was taken. The answer must be more complete than “We just disabled > >>>>>>>> it because upstream disabled it for reasons we’re too lazy to explain > >>>>>>>> or document how to work around" > >>>>>>> > >>>>>>> Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which > >>>>>>> accepted the upstream change, workaround no-go) > >>>>>>> > >>>>>>> [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin > >>>>>>> -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.XXX > >>>>>>> Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH GEX > >>>>>>> group out of range > >>>>>>> > >>>>>> > >>>>>> DH prime size must be at least 2048, openssh now refuse lower values. > >>>>>> Commonly used DH size 1024 can be easily broken. See https://weakdh.org > >>>>>> > >>>>> diffie-hellman-group1-sha1 use DH 1024 and insecure sha1 both. > >>>> > >>>> IMHO, this is wrong choise: totaly lost of control now vs teoretical > >>>> compromise of control in the future. > >>> > >>> Please note that it was not my choice and I can't answer what to do with > >>> non-upgradeable hardware question, address it to the author. I just tell > >>> you _why_ it happens. > >>> > >> > >> BTW, compromise is practical enough. From https://weakdh.org/ "A close > >> reading of published NSA leaks shows that the agency's attacks on VPNs > >> are consistent with having achieved such a break." > > > > For this compromise need > > > > 1) NSA interesed to me > > This particular condition is not necessary, they can decrypt all traffic > with weak DH primes passed through main channels in USA and perhaps > partially in Europe (depends on mutual agreement), then find interesting > keywords to spy more closely afterwards. My interraction with weak devices don't cross EU/USA borders. I am assume Bruce's interraction with weak devices don't cross server room. Yes, I am know about 'security in depth'. But PCI-DSS don't be need at any places. > > 2) NSA must be able to access to weak device for traffic > > intercept > > > > This is imposible at this time. > > > > Also, if NSA can be able to intercept such traffic weak crypto will be > > last resort of my trouble. > > About the rest, I am not the person to argue with. Why you still not I am not convince you. I am also just talk my opinion (as you). > send your opinion to the author? > I am not sure about suitable response from autor. May be project [FreeBSD] choise some compromise. Last time I am have only two devices with weak crypto. One device can be accept only DES. Other accept only rsa/dss (if not hanged). I am able to create ssh client with support this weak ciphers for access to this devices. I am will be sad about causeless enforcing strong crypto. From owner-svn-src-head@freebsd.org Sun Aug 7 19:02:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B985BB1162 for ; Sun, 7 Aug 2016 19:02:57 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAAD014EB for ; Sun, 7 Aug 2016 19:02:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f42.google.com with SMTP id l69so233846302lfg.1 for ; Sun, 07 Aug 2016 12:02:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=yzU8Wzat0BucjfI01lGOMDbKgGgnkEUFcECAoHOxw5w=; b=h2XByfUsaqeCewiV4cGCnOoS/L+ntzmK480RsxmsVs641EcsiiYnKOY9E8GUTSVzNd 0qmdpg4utYYFiZxhKU6pm7qz4N+8Y5U1XmwmWfECmWlhHG730f9AdldGEX1c4CfbhSPZ VtFk281Kihbsz3l/DcsWoz/68/COXuwIwg3Rk6bdLszQwGf0M2z2jiO1aW2gGQCJvw1H AFMRoiEr9C4+12cOuXNkeSr7JhBUcshVVl7ryN3FSqw1Ppm+D1/Y0Wh+8MadeV5C8a/c 17N7S8G2b3cv1DYVPBHd8nbqg6ghJg0VRSvJnQ/jJ+lJKIaicGDtSbwAtHsVaBCSdBiv Wb1w== X-Gm-Message-State: AEkoouur6lJcSmkweeFEHwfXDcNm3u8NXgv1BfXQI+R1dLh5nTEA2z+o4NQjR0PfySM0RQ== X-Received: by 10.25.41.142 with SMTP id p136mr27970379lfp.32.1470596574413; Sun, 07 Aug 2016 12:02:54 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 136sm5036143ljj.0.2016.08.07.12.02.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 12:02:53 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> <20160807185237.GV8192@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: Date: Sun, 7 Aug 2016 22:02:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807185237.GV8192@zxy.spb.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 19:02:57 -0000 On 07.08.2016 21:52, Slawa Olhovchenkov wrote: >> Why you still not >> send your opinion to the author? >> > > I am not sure about suitable response from autor. > May be project [FreeBSD] choise some compromise. IMHO blindly choosing some compromise without asking author's opinion first will be unwise. I will be glad in case someone from secteam@ discuss that with the author. Moreover, careless attempt to stay compatible by any price can weak connections passed out of the server room. From owner-svn-src-head@freebsd.org Sun Aug 7 19:09:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB8CBB1250; Sun, 7 Aug 2016 19:09:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB15170E; Sun, 7 Aug 2016 19:09:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77J9vcZ070498; Sun, 7 Aug 2016 19:09:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77J9vX1070497; Sun, 7 Aug 2016 19:09:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608071909.u77J9vX1070497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 7 Aug 2016 19:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303817 - 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.22 Precedence: list List-Id: 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, 07 Aug 2016 19:09:58 -0000 Author: jhibbits Date: Sun Aug 7 19:09:56 2016 New Revision: 303817 URL: https://svnweb.freebsd.org/changeset/base/303817 Log: Set EN_MAS7_UPDATE HID0 bit for e500 core. Without enabling this bit, tlbre and tlbsx don't update the MAS7 register, resulting in garbage in the register after a read (rather, the previous setting of it for a tlbwe). This can result in mmu_booke_mapdev_attr() thinking mappings that should match actually don't, because tlb1_read_entry() can't determine the correct address of a given entry. MFC after: 11-RELEASE Modified: head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/include/hid.h ============================================================================== --- head/sys/powerpc/include/hid.h Sun Aug 7 18:12:36 2016 (r303816) +++ head/sys/powerpc/include/hid.h Sun Aug 7 19:09:56 2016 (r303817) @@ -208,7 +208,8 @@ #define HID1_E500_ASTME 0x00002000 /* Address bus streaming mode enable */ #define HID1_E500_RFXE 0x00020000 /* Read fault exception enable */ -#define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN) +#define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN | \ + HID0_E500_MAS7UPDEN) #define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME) #define HID0_E500MC_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD | \ HID0_E500_MAS7UPDEN) From owner-svn-src-head@freebsd.org Sun Aug 7 19:10:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC71BB12B5; Sun, 7 Aug 2016 19:10:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C26B18B3; Sun, 7 Aug 2016 19:10:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWTT7-0001iS-4w; Sun, 07 Aug 2016 22:10:41 +0300 Date: Sun, 7 Aug 2016 22:10:41 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807191041.GW8192@zxy.spb.ru> References: <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> <20160807185237.GV8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 19:10:43 -0000 On Sun, Aug 07, 2016 at 10:02:52PM +0300, Andrey Chernov wrote: > On 07.08.2016 21:52, Slawa Olhovchenkov wrote: > >> Why you still not > >> send your opinion to the author? > >> > > > > I am not sure about suitable response from autor. > > May be project [FreeBSD] choise some compromise. > > IMHO blindly choosing some compromise without asking author's opinion > first will be unwise. I will be glad in case someone from secteam@ > discuss that with the author. Moreover, careless attempt to stay > compatible by any price can weak connections passed out of the server room. > In generaly I am accept this. For this specific case enforcing strong crypo like Internet filtering from suicide. From owner-svn-src-head@freebsd.org Sun Aug 7 19:31:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C65BB174A; Sun, 7 Aug 2016 19:31:06 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAD411F5; Sun, 7 Aug 2016 19:31:05 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id u77JNeN2061333 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Aug 2016 05:23:50 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id u77JNYTN067240 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 8 Aug 2016 05:23:34 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id u77JNXF0067239; Mon, 8 Aug 2016 05:23:33 +1000 (AEST) (envelope-from peter) Date: Mon, 8 Aug 2016 05:23:33 +1000 From: Peter Jeremy To: Hans Petter Selasky Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303811 - in head/sys: net net80211 Message-ID: <20160807192333.GA79784@server.rulingia.com> References: <201608070348.u773mXXt030939@repo.freebsd.org> <46183559-343f-401b-6471-3822e3383a50@selasky.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <46183559-343f-401b-6471-3822e3383a50@selasky.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 19:31:06 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016-Aug-07 11:03:23 +0200, Hans Petter Selasky wrote: >On 08/07/16 05:48, Adrian Chadd wrote: >> +#define ETHER_IS_BROADCAST(addr) \ >> + (((addr)[0] & (addr)[1] & (addr)[2] & \ >> + (addr)[3] & (addr)[4] & (addr)[5]) =3D=3D 0xff) >> >The compiler might be able to produce more optimal code if you use "+"=20 >instead of "&", because there are instructions on x86, that can add=20 >multiple variables at the same time. With "&" you need to process every=20 >one as a single instructions usually I think. > > > +#define ETHER_IS_BROADCAST(addr) \ > > + (((addr)[0] + (addr)[1] + (addr)[2] + \ > > + (addr)[3] + (addr)[4] + (addr)[5]) =3D=3D (6*0xff)) IMHO, Adrian's code is clearer and micro-optimisations like this belong in the complier, not the code. There are lots of alternative ways you could write the macro and, unless you can demonstrate that the micro- optimisation is worthwhile, you should pick the one that is clearer to the software maintainer. If you want to make a few more assumptions (64-bit unaligned little-endian architecture with at least 2 accessible bytes beyond the address), the following has the added advantage of only referencing (addr) once. (I'm not suggesting it as a replacement though). #define ETHER_IS_BROADCAST(addr) \ ((*(const long *)(addr) & 0x00ffffffl) =3D=3D 0x00ffffffl) --=20 Peter Jeremy --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXp4q1XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0a4YP/jMIA7H+af/LRfWjZDnxNyRq Kk0nMu+H4yfXmmYrw42UW4MqM2YkNpjw9cJ/x1fb9Vm1hKK9y7Z3Yx23QlX/Ffd5 g7YQrlTDBgtbmtzMknyJ4yWO6Z5fESMj3Kndxcwg1fUBppow/Zzri2j0mkWSKlHb b8jXecifM1QqxBfVz3ePhHJ5I7GtNmYn3mDO29TqLsjRTto5jp9jGnKDOQkyBcV0 kc6wICXZ8PcIuteHmxQcoNXEktYzhoTxJWd/pS01pMZK6ZcvIzZQKEayCmVVML0Y jLzrLcTzLYK/+z54e4XW77uPNPNj1CuEUOvTO4hUeMM/HJ3GwbZxG8hZnO4hMBdx hhQzTqIeNv3irlI5lJKrU6Ezf7N3Q5Zpf+X33D6uiEJ631380SID/e23ExzO5C8G uTirWxZrEAAyN+puyAJDz4Bzoo87U4VwsdbHBPlD4k6rSwz/PSdjVDBQZjoK0uKI cN+Fnw3YZImrgj/UDMtDlXpmgBvjpxzp9ycejZ+ejhg9cnv1bC57jNcgAua2aH5a 6gmYcWfkiUJ1Fx8KHxMy4yMqgX+UPmVLtR0i9h3F/Qk3wEsrhOqc7bolsw/gAIAT w3N4IJw+go8Kdao+Yxt6GO+hBBcOixxuS2Q1hlC5IwfISxUUwv0sPFWBUJJu6w84 iv/5Y3ILXpBievwymsIB =7NB+ -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-svn-src-head@freebsd.org Sun Aug 7 19:43:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 892E3BB19E9 for ; Sun, 7 Aug 2016 19:43:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40412183C for ; Sun, 7 Aug 2016 19:43:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f41.google.com with SMTP id f93so234312733lfi.2 for ; Sun, 07 Aug 2016 12:42:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=h6O9VqMnDL9HcUqHGRBnKPtJDzwPmOFJC17ysW4qsMs=; b=KC/FL1L4PJ4scanKTHhs0yxKSTUxKwu86XJaHRWvfmi7QC0sKZLR3JMv9nEBOf4zBw RcYF2PqG8R1tkR6PGIgFJuUDs8P/c5WCmL5ywivtQuwc845r2WWbAnu6AdIAlE3KLnkB SePdP7FK0gDWbwq+BYsESw6d8R5Sx5FJmM+eNoe81yJQtYJefWk5e7Y1tMq7fGYNeCO0 QlJwwwZi9IjrsjtdhafIA+fS1jJ6emBAAIhHOHTypqHl9ZFkS1vsgZFs4phUb+Wfsybm 8YCEigvG4uecHGCckYvRRfgG/Ue+x4MKEBB7jQGVLgiOXrYRE0uh2YcqyYcB69WWcr93 HBww== X-Gm-Message-State: AEkooutjOAlujOW/jGgqy1FF+BTMBWWDzOHA2nJiV58i+qk3oiKygJXfMLXkLAvd5yn83g== X-Received: by 10.25.16.212 with SMTP id 81mr23807049lfq.174.1470598978057; Sun, 07 Aug 2016 12:42:58 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f4sm5047522lji.41.2016.08.07.12.42.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 12:42:57 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <32b82f9f-7f78-6358-030a-90aed54bb8a8@freebsd.org> <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> <20160807185237.GV8192@zxy.spb.ru> <20160807191041.GW8192@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <0cb2bd75-3086-fb72-c902-a05354536fc4@freebsd.org> Date: Sun, 7 Aug 2016 22:42:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807191041.GW8192@zxy.spb.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 19:43:00 -0000 On 07.08.2016 22:10, Slawa Olhovchenkov wrote: > On Sun, Aug 07, 2016 at 10:02:52PM +0300, Andrey Chernov wrote: > >> On 07.08.2016 21:52, Slawa Olhovchenkov wrote: >>>> Why you still not >>>> send your opinion to the author? >>>> >>> >>> I am not sure about suitable response from autor. >>> May be project [FreeBSD] choise some compromise. >> >> IMHO blindly choosing some compromise without asking author's opinion >> first will be unwise. I will be glad in case someone from secteam@ >> discuss that with the author. Moreover, careless attempt to stay >> compatible by any price can weak connections passed out of the server room. >> > > In generaly I am accept this. > For this specific case enforcing strong crypo like Internet filtering > from suicide. > BTW, there is at least one alternative. F.e. security/putty from ports still support weak min DH 1024, diffie-hellman-group1-sha1 and even des you need. I don't check others because I am too lazy. From owner-svn-src-head@freebsd.org Sun Aug 7 19:56:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E392BB1C48; Sun, 7 Aug 2016 19:56:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F40C1D5E; Sun, 7 Aug 2016 19:56:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bWUBZ-00035j-UN; Sun, 07 Aug 2016 22:56:37 +0300 Date: Sun, 7 Aug 2016 22:56:37 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, Dag-Erling =?utf-8?B?U23DuHJncmF2?= Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807195637.GX8192@zxy.spb.ru> References: <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> <20160807185237.GV8192@zxy.spb.ru> <20160807191041.GW8192@zxy.spb.ru> <0cb2bd75-3086-fb72-c902-a05354536fc4@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0cb2bd75-3086-fb72-c902-a05354536fc4@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 19:56:42 -0000 On Sun, Aug 07, 2016 at 10:42:56PM +0300, Andrey Chernov wrote: > On 07.08.2016 22:10, Slawa Olhovchenkov wrote: > > On Sun, Aug 07, 2016 at 10:02:52PM +0300, Andrey Chernov wrote: > > > >> On 07.08.2016 21:52, Slawa Olhovchenkov wrote: > >>>> Why you still not > >>>> send your opinion to the author? > >>>> > >>> > >>> I am not sure about suitable response from autor. > >>> May be project [FreeBSD] choise some compromise. > >> > >> IMHO blindly choosing some compromise without asking author's opinion > >> first will be unwise. I will be glad in case someone from secteam@ > >> discuss that with the author. Moreover, careless attempt to stay > >> compatible by any price can weak connections passed out of the server room. > >> > > > > In generaly I am accept this. > > For this specific case enforcing strong crypo like Internet filtering > > from suicide. > > > > BTW, there is at least one alternative. F.e. security/putty from ports > still support weak min DH 1024, diffie-hellman-group1-sha1 and even des > you need. I don't check others because I am too lazy. Last time I am see (over six years ago) putty just don't work (my coworker try on Linux). I am to lazy check now. From owner-svn-src-head@freebsd.org Sun Aug 7 20:40:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35A09BB154D for ; Sun, 7 Aug 2016 20:40:58 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D58CC1F26; Sun, 7 Aug 2016 20:40:57 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id u77KekJG061628 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Aug 2016 06:40:52 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id u77KeeqJ067518 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 8 Aug 2016 06:40:40 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id u77Ked6Q067517; Mon, 8 Aug 2016 06:40:39 +1000 (AEST) (envelope-from peter) Date: Mon, 8 Aug 2016 06:40:39 +1000 From: Peter Jeremy To: Andrey Chernov Cc: Bruce Simpson , Oliver Pinter , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160807204039.GB79784@server.rulingia.com> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v9Ux+11Zm5mwPlX6" Content-Disposition: inline In-Reply-To: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 20:40:58 -0000 --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016-Aug-07 15:25:54 +0300, Andrey Chernov wrote: >You should address your complains to original openssh author instead, it >was his decision to get rid of weak algos. No. It's up to the person who imported the code into FreeBSD to understand why the change was made and to be able to justify it to the FreeBSD community. Firstly, security is not absolute - it's always a cost-benefit tradeoff and different communities may make different tradeoffs. Secondly, the importer needs to be confident that the code is actually an improvement, not an attempt by a bad actor to undermine security. > In my personal opinion, if >your hardware is outdated, just drop it out. This is part of the cost-benefit analysis. Replacing hardware has a real cost. If it's inside a datacentre, where the management LAN is isolated =66rom the rest of the world, there may be virtually no benefit to disabling "weak" ciphers. >We can't turn our security >team into compatibility team, by constantly restoring removed code, such >code quickly becomes outdated and may add new security holes even being >inactive. OTOH, FreeBSD has a documented deprecation process that says things will continue working for a major release after being formally deprecated. I don't believe there was any mention about DSA being deprecated before now so I would expect there to be a clearly documented process to restore the ability for a FreeBSD-11 ssh client to talk to a server using 1024-bit DSA. Note that the handbook still talks about using DSA - that needs updating as well. --=20 Peter Jeremy --v9Ux+11Zm5mwPlX6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXp5zHXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0riEP/jyZzo/92LevADLenanKryEd iEoqO2qhnQW7iNh/+3nDM2tnV0jh3nhAE+47crlRas0ssBXc22OfkWUdpcx47iWR s2Y97WA7SovbzVawuDpxcWpMbZ5/XZfcibN7lFPCABZYPvFMf3XvLKLZWFy0qGFY YzXao4TNd+Kz6YnkIuoBEb04/Y9+bg7GnFbKPUVoCoeabMwuxCfpn4pq+nm7DvsI kF5Fkuzjl6zYDBygYgwDPXYQ9YGBod1QyJrZwBp4AjGPBCp4WboQSO/aK0eXXaXb 23Of4NiLW9sXYtfOTZ2fc2TldVe/+fCjIFsmcl+quFi7DZiEMvMM7u9O9g3hwLuP 3XaIvOsEMy24gpp/hEHVJyy4poPpqbgSVsMTo4xnJ0o+4bhCD768/VvHh2X4/YSe YbfgRwFv5/0kqVoVHO5YzurHtmeHgKNTWl/tn08XsgM4+0SkU1fkS4YAALL4Ehg4 a1HTAKOp7TEHb/0Lsks0k8VAI4PD7kXhLLVHVTqe1fCRGK9Dbn/MjUC+FDai2oPE QwujuQhKKwuvpjsT4SzJeRnDlI+tTuraKCUyLcVYKWEua775RQ3Y5+yBPA/vp0re 0sdD34BxS8/qocn01MkNBCQZLTL+vWIHSi0L2QD1Ue2THn3hE44SNXlOFAWX+osY vg6Mx+oxWyWM4Hy7Jf0z =bWRc -----END PGP SIGNATURE----- --v9Ux+11Zm5mwPlX6-- From owner-svn-src-head@freebsd.org Sun Aug 7 20:48:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78557BB1850 for ; Sun, 7 Aug 2016 20:48:10 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0467D15DC for ; Sun, 7 Aug 2016 20:48:09 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id b199so235175540lfe.0 for ; Sun, 07 Aug 2016 13:48:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/4COVAfzFPRDJMpfJOe0hC0hQaJWoi7lloZJHsdK03M=; b=LUm+lWdMDUlOrBA3IAQw7ZNJeSNtqmIaxiSmpllO7bz2z2OlVCC9rkzJocOmZ7DJiZ 3Hn2YpZFe5Wb6Yzt/tQwLer6D3mM5k4/gSSkkvXVEgjR65EjF3JHeX2vH/NErgA+KB5a jC0vDuQFD0oLNtGCzILoZBlKZKXmhSu+XGzfXYeDaVEWfICNwMiX7D2kmWOa8zCtQNa/ +IiypLiDQ+HjESSETbEaweCwAk5vl0ds5LLGgOJNhYDrxlFHbyEBqWiv5RPEfMV3TH0B QTvgwWsFF4yhcspwvcKNpxXT7rXxwwdr8/ZUwP0WH9V0JpUauk9iEZzWtBzahCzmR7L3 y4Hg== X-Gm-Message-State: AEkooutjRc4zwObacrfkWSqoiWkJS+4wrjU9wgCvl5A04RuPZO5fl7Yk3IBvT6bFJ07VZA== X-Received: by 10.46.9.22 with SMTP id 22mr25272385ljj.63.1470602887642; Sun, 07 Aug 2016 13:48:07 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g42sm5151918lji.40.2016.08.07.13.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 13:48:07 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Slawa Olhovchenkov References: <0740b662-4a36-f834-229a-d16a5a6dde14@freebsd.org> <20160807173734.GD22212@zxy.spb.ru> <2dd7e952-ca28-57cb-ac8a-39d895b51d06@freebsd.org> <20160807182317.GE22212@zxy.spb.ru> <20160807185237.GV8192@zxy.spb.ru> <20160807191041.GW8192@zxy.spb.ru> <0cb2bd75-3086-fb72-c902-a05354536fc4@freebsd.org> <20160807195637.GX8192@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Oliver Pinter , Bruce Simpson , Warner Losh , svn-src-head@freebsd.org, =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= From: Andrey Chernov Message-ID: <95a63572-2d0c-2809-dc38-3ab480432a16@freebsd.org> Date: Sun, 7 Aug 2016 23:48:05 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807195637.GX8192@zxy.spb.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 20:48:10 -0000 On 07.08.2016 22:56, Slawa Olhovchenkov wrote: > On Sun, Aug 07, 2016 at 10:42:56PM +0300, Andrey Chernov wrote: > >> On 07.08.2016 22:10, Slawa Olhovchenkov wrote: >>> On Sun, Aug 07, 2016 at 10:02:52PM +0300, Andrey Chernov wrote: >>> >>>> On 07.08.2016 21:52, Slawa Olhovchenkov wrote: >>>>>> Why you still not >>>>>> send your opinion to the author? >>>>>> >>>>> >>>>> I am not sure about suitable response from autor. >>>>> May be project [FreeBSD] choise some compromise. >>>> >>>> IMHO blindly choosing some compromise without asking author's opinion >>>> first will be unwise. I will be glad in case someone from secteam@ >>>> discuss that with the author. Moreover, careless attempt to stay >>>> compatible by any price can weak connections passed out of the server room. >>>> >>> >>> In generaly I am accept this. >>> For this specific case enforcing strong crypo like Internet filtering >>> from suicide. >>> >> >> BTW, there is at least one alternative. F.e. security/putty from ports >> still support weak min DH 1024, diffie-hellman-group1-sha1 and even des >> you need. I don't check others because I am too lazy. > > Last time I am see (over six years ago) putty just don't work (my > coworker try on Linux). I am to lazy check now. > Good news: I just try it and it works. From owner-svn-src-head@freebsd.org Sun Aug 7 21:11:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98E81BB1E41 for ; Sun, 7 Aug 2016 21:11:38 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD9312BA for ; Sun, 7 Aug 2016 21:11:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f42.google.com with SMTP id l69so234879010lfg.1 for ; Sun, 07 Aug 2016 14:11:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=BJ++VKbQBpKv3brKwEJPHWDEkN79xDUShGA8GQ1Up6w=; b=LwPWZO/8PqUNNJuCO3of3aILHhT/ofuyTHzs0MXLvlyeuGE61QZuyTdJrZqmUO21qk QR6e7bEsrtnNz1ttmYNrhgypoq+AkpIWOFr4FTllJDVm73DXQR2xjSsi52lAfG2VcN4U yWSAjYVVnKQyZZK/d1VsygKH/Rnl6+6MFNk0Ja2MyO8QVZxpB14CBZM3JC8k4jBwHPpz q7LFPU2jZgjclXPNFPtguZf//HdaqRXldQrH0sNHLf89tg8GR78jTggPv60mH0/7z5RT G87lTprrMYlNH8RaG2zc1KqJpZJXaIdn5OVu0dBf7pK3VnlLqSHXS+RHIGrwJUDQGZbW tUnw== X-Gm-Message-State: AEkoous5f8iLUVTl+bxP75B8UJdx58fIgLjzqa/kzdLArbyHVgvqJVO1awdUXSYgz88nmw== X-Received: by 10.25.15.84 with SMTP id e81mr23675322lfi.3.1470604295460; Sun, 07 Aug 2016 14:11:35 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id i80sm5118133lfg.6.2016.08.07.14.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 14:11:34 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Peter Jeremy References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> Cc: Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 8 Aug 2016 00:11:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807204039.GB79784@server.rulingia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aq5tQTJDQPqTVkuo3Idh06QWij5JJhC9n" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 21:11:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aq5tQTJDQPqTVkuo3Idh06QWij5JJhC9n Content-Type: multipart/mixed; boundary="DuUP55Chnn5sHuICVuLRK6Ts8tTioVprw" From: Andrey Chernov To: Peter Jeremy Cc: Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> In-Reply-To: <20160807204039.GB79784@server.rulingia.com> --DuUP55Chnn5sHuICVuLRK6Ts8tTioVprw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07.08.2016 23:40, Peter Jeremy wrote: > On 2016-Aug-07 15:25:54 +0300, Andrey Chernov wrote:= >> You should address your complains to original openssh author instead, = it >> was his decision to get rid of weak algos. >=20 > No. It's up to the person who imported the code into FreeBSD to unders= tand > why the change was made and to be able to justify it to the FreeBSD > community. Firstly, security is not absolute - it's always a cost-bene= fit > tradeoff and different communities may make different tradeoffs. Secon= dly, > the importer needs to be confident that the code is actually an improve= ment, > not an attempt by a bad actor to undermine security. It is pretty clear for everybody who interested in security why this change is made and why it is actually an improvement. Tuning it (or not) to different obsoleted environment and how to do it (if yes) is completely another question which, IMHO will be better resolved consulting with the author and not by mechanically restoring removed weak stuff with each new openssh release. >> In my personal opinion, if >> your hardware is outdated, just drop it out. >=20 > This is part of the cost-benefit analysis. Replacing hardware has a re= al > cost. If it's inside a datacentre, where the management LAN is isolate= d > from the rest of the world, there may be virtually no benefit to disabl= ing > "weak" ciphers. As I already say in this discussion twice, it is just my personal opinion and I am not insisting on it. Just ignore it if you like. > OTOH, FreeBSD has a documented deprecation process that says things wil= l > continue working for a major release after being formally deprecated. FreeBSD 11 is not released yet (betas are not counted), stable-10 too, so it is right time to deprecate for them. --DuUP55Chnn5sHuICVuLRK6Ts8tTioVprw-- --aq5tQTJDQPqTVkuo3Idh06QWij5JJhC9n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXp6QFAAoJEKUckv0MjfbKug4H/R9PT5JrMPjn3I5EQuSFPXDo Kv60LR67YdChWzlh3mzXch0Op2Rp7GBec+xtgS7ImivMCypcFceiRH9B3ApF9oOQ avHIQdrHy2wnp15dcEGJPVoRrMENPou3ON0Ww/sZEjkb4rPUmqcscKCuOG9gGudq VS5u34xjXCgGi/Zlrzk0Bg/hdgVHjp9SxiigrxkSoVOew8hj6FWCzsPws/j4UswN 7aSWXXqCItBxOnuWJfISLiMcW7nvnvxkKlQrYpHTaS7IGSZxyj7eenpQoTgp3ipW GTlJ3Gs3FjGtFEOcSAyr87kX/Kt4fVFg/N4eabLJZcpPaYHRvVqs52wZvl3aQU8= =tdOF -----END PGP SIGNATURE----- --aq5tQTJDQPqTVkuo3Idh06QWij5JJhC9n-- From owner-svn-src-head@freebsd.org Sun Aug 7 21:23:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1F4FBB1254; Sun, 7 Aug 2016 21:23:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 893A11B93; Sun, 7 Aug 2016 21:23:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77LNtV1021390; Sun, 7 Aug 2016 21:23:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77LNtR4021389; Sun, 7 Aug 2016 21:23:55 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608072123.u77LNtR4021389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 7 Aug 2016 21:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303818 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 21:23:56 -0000 Author: ed Date: Sun Aug 7 21:23:55 2016 New Revision: 303818 URL: https://svnweb.freebsd.org/changeset/base/303818 Log: Sync in the latest CloudABI constants and data types. The only change is the addition of AT_SYSINFO_EHDR, which can be used for providing a vDSO. Obtained from: https://github.com/NuxiNL/cloudabi Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Sun Aug 7 19:09:56 2016 (r303817) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Sun Aug 7 21:23:55 2016 (r303818) @@ -29,7 +29,7 @@ #define CLOUDABI_TYPES_COMMON_H #if defined(__FreeBSD__) && defined(_KERNEL) -#include +#include #elif defined(__linux__) && defined(__KERNEL__) #include #else @@ -46,17 +46,18 @@ typedef uint8_t cloudabi_advice_t; #define CLOUDABI_ADVICE_WILLNEED 6 typedef uint32_t cloudabi_auxtype_t; -#define CLOUDABI_AT_ARGDATA 256 -#define CLOUDABI_AT_ARGDATALEN 257 -#define CLOUDABI_AT_BASE 7 -#define CLOUDABI_AT_CANARY 258 -#define CLOUDABI_AT_CANARYLEN 259 -#define CLOUDABI_AT_NCPUS 260 -#define CLOUDABI_AT_NULL 0 -#define CLOUDABI_AT_PAGESZ 6 -#define CLOUDABI_AT_PHDR 3 -#define CLOUDABI_AT_PHNUM 4 -#define CLOUDABI_AT_TID 261 +#define CLOUDABI_AT_ARGDATA 256 +#define CLOUDABI_AT_ARGDATALEN 257 +#define CLOUDABI_AT_BASE 7 +#define CLOUDABI_AT_CANARY 258 +#define CLOUDABI_AT_CANARYLEN 259 +#define CLOUDABI_AT_NCPUS 260 +#define CLOUDABI_AT_NULL 0 +#define CLOUDABI_AT_PAGESZ 6 +#define CLOUDABI_AT_PHDR 3 +#define CLOUDABI_AT_PHNUM 4 +#define CLOUDABI_AT_SYSINFO_EHDR 262 +#define CLOUDABI_AT_TID 261 typedef uint32_t cloudabi_backlog_t; From owner-svn-src-head@freebsd.org Sun Aug 7 23:04:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE412BADBF7; Sun, 7 Aug 2016 23:04:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C94A1172A; Sun, 7 Aug 2016 23:04:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u77N4lg7058117; Sun, 7 Aug 2016 23:04:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u77N4kFT058115; Sun, 7 Aug 2016 23:04:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608072304.u77N4kFT058115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 7 Aug 2016 23:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303819 - 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.22 Precedence: list List-Id: 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, 07 Aug 2016 23:04:48 -0000 Author: tuexen Date: Sun Aug 7 23:04:46 2016 New Revision: 303819 URL: https://svnweb.freebsd.org/changeset/base/303819 Log: Consistently check for unsent data on the stream queues. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 7 21:23:55 2016 (r303818) +++ head/sys/netinet/sctp_input.c Sun Aug 7 23:04:46 2016 (r303819) @@ -221,18 +221,18 @@ sctp_is_there_unsent_data(struct sctp_tc #endif ) { - int unsent_data = 0; + int unsent_data; unsigned int i; struct sctp_stream_queue_pending *sp; struct sctp_association *asoc; /* - * This function returns the number of streams that have true unsent - * data on them. Note that as it looks through it will clean up any - * places that have old data that has been sent but left at top of - * stream queue. + * This function returns if any stream has true unsent data on it. + * Note that as it looks through it will clean up any places that + * have old data that has been sent but left at top of stream queue. */ asoc = &stcb->asoc; + unsent_data = 0; SCTP_TCB_SEND_LOCK(stcb); if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { /* Check to see if some data queued */ @@ -270,8 +270,13 @@ sctp_is_there_unsent_data(struct sctp_tc sp->data = NULL; } sctp_free_a_strmoq(stcb, sp, so_locked); + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + unsent_data++; + } } else { unsent_data++; + } + if (unsent_data > 0) { break; } } @@ -1049,7 +1054,7 @@ sctp_handle_shutdown_ack(struct sctp_shu #ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { panic("Queues are not empty when handling SHUTDOWN-ACK"); } #endif @@ -3215,7 +3220,7 @@ sctp_handle_shutdown_complete(struct sct #ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); } #endif Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Aug 7 21:23:55 2016 (r303818) +++ head/sys/netinet/sctp_output.c Sun Aug 7 23:04:46 2016 (r303819) @@ -6687,13 +6687,9 @@ sctp_sendall_iterator(struct sctp_inpcb asoc = &stcb->asoc; if (ca->sndrcv.sinfo_flags & SCTP_EOF) { /* shutdown this assoc */ - int cnt; - - cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); - if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && - (cnt == 0)) { + sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED) == 0) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { goto abort_anyway; } @@ -7902,7 +7898,7 @@ sctp_med_chunk_output(struct sctp_inpcb (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + sctp_is_there_unsent_data(stcb, so_locked) == 0) { nothing_to_send: *reason_code = 9; return (0); @@ -10185,7 +10181,7 @@ do_it_again: } if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + sctp_is_there_unsent_data(stcb, so_locked) == 0) { /* Nothing left to send */ break; } @@ -13455,18 +13451,15 @@ dataless_eof: /* EOF thing ? */ if ((srcv->sinfo_flags & SCTP_EOF) && (got_all_of_the_send == 1)) { - int cnt; - SCTP_STAT_INCR(sctps_sends_with_eof); error = 0; if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && - (cnt == 0)) { + sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED) == 0) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { goto abort_anyway; } From owner-svn-src-head@freebsd.org Sun Aug 7 23:59:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00A1DBB0AE0; Sun, 7 Aug 2016 23:59:38 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA56211F1; Sun, 7 Aug 2016 23:59:37 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4116320217; Sun, 7 Aug 2016 19:59:36 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 07 Aug 2016 19:59:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=iPrj1CJasb0lrDrS2nNpqrBEIDA=; b=Gh/Bg1 yuJtQ/KlD6cxW/tKa2jk0pKJD+k4ARen7YHQqw6pOgPWeRZ5/d4PCZWNHqQRc7EX o4RKOvynrzp8m362yquUrHdCcDFz0e4SmcY5+HPNgNIkQQ3ACv0+uS9Et+pcv0+S NCq4/4aLBnff4iG9WHCep2vBsTUac0U7EiWKE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=iPrj1CJasb0lrDr S2nNpqrBEIDA=; b=eFybnineg9/Y0QFK+lWXzKYN7aGz3eECl5p6Ks5QmaevCsh YBAd7IbXNJYQtQEuTfgSGGVRIqoYCVw5Bywa58t6U9WVXJAn1xNjvx2xl1XFcuJ0 kFD/vtS2SBgnRI9JjXduEDQhKidEDkOwOr7t5XvSYBKIifXkHjhcT0+8+4Sg= X-Sasl-enc: beaUMMjeWqyRC9WVC28hGkyOAs5/BqjalX9J5yqKNBmJ 1470614375 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D2CCF2985; Sun, 7 Aug 2016 19:59:34 -0400 (EDT) Subject: Re: svn commit: r303811 - in head/sys: net net80211 To: Peter Jeremy , Hans Petter Selasky References: <201608070348.u773mXXt030939@repo.freebsd.org> <46183559-343f-401b-6471-3822e3383a50@selasky.org> <20160807192333.GA79784@server.rulingia.com> Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bruce Simpson Message-ID: <32531e89-85fa-6012-6a3e-1e6a42843dc0@fastmail.net> Date: Mon, 8 Aug 2016 00:59:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160807192333.GA79784@server.rulingia.com> 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.22 Precedence: list List-Id: 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, 07 Aug 2016 23:59:38 -0000 On 07/08/16 20:23, Peter Jeremy wrote: >> On 08/07/16 05:48, Adrian Chadd wrote: >>> +#define ETHER_IS_BROADCAST(addr) \ ... > IMHO, Adrian's code is clearer and micro-optimisations like this belong > in the complier, not the code. *cough* *cough* 2007 wants its patch back. https://people.freebsd.org/~bms/dump/old/latest-8021p.diff The whole point of using bcmp() was to allow it to be inlined by the compiler for the target arch, rather than forcing it to play guessing games with (lowest-common-denominator machine-word-size) integer accesses. ETHER_IS_MULTICAST(), by contrast, only needs to check a single bit in the 48-bit MAC. From owner-svn-src-head@freebsd.org Mon Aug 8 02:23:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E70BB02B4; Mon, 8 Aug 2016 02:23:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id B9DBF1AA5; Mon, 8 Aug 2016 02:23:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 02732D54DFC; Mon, 8 Aug 2016 12:21:20 +1000 (AEST) Date: Mon, 8 Aug 2016 12:21:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Simpson cc: Peter Jeremy , Hans Petter Selasky , Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303811 - in head/sys: net net80211 In-Reply-To: <32531e89-85fa-6012-6a3e-1e6a42843dc0@fastmail.net> Message-ID: <20160808114333.Y957@besplex.bde.org> References: <201608070348.u773mXXt030939@repo.freebsd.org> <46183559-343f-401b-6471-3822e3383a50@selasky.org> <20160807192333.GA79784@server.rulingia.com> <32531e89-85fa-6012-6a3e-1e6a42843dc0@fastmail.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=PSdEe_fNmYwNOnY0NXsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 02:23:01 -0000 On Mon, 8 Aug 2016, Bruce Simpson wrote: > On 07/08/16 20:23, Peter Jeremy wrote: >>> On 08/07/16 05:48, Adrian Chadd wrote: >>>> +#define ETHER_IS_BROADCAST(addr) \ > ... >> IMHO, Adrian's code is clearer and micro-optimisations like this belong >> in the complier, not the code. Both are unclear micro-optimizations. >> If you want to make a few more assumptions (64-bit unaligned little-endian >> architecture with at least 2 accessible bytes beyond the address), the >> following has the added advantage of only referencing (addr) once. (I'm >> not suggesting it as a replacement though). >> >> #define ETHER_IS_BROADCAST(addr) \ >> ((*(const long *)(addr) & 0x00ffffffl) =3D=3D 0x00ffffffl) That is only 24 bits :-). Machines with uint48_t and data with good alignment allow the nicest wat to express this and probably to execute it: #define ETHER_IS_BROADCAST(addr) \ (*(uint48_t *)(addr) == 0xFFFFFFFFFFFF) Otherwise, we have to use uintmax_t and worry about padding as well as alignment, and pessimizations from it being very large. > *cough* *cough* 2007 wants its patch back. > > https://people.freebsd.org/~bms/dump/old/latest-8021p.diff > > The whole point of using bcmp() was to allow it to be inlined by the compiler > for the target arch, rather than forcing it to play guessing games with > (lowest-common-denominator machine-word-size) integer accesses. The compiler can't possibly inline bcmp() since it is nonstandard and we don't implement it as a special nonstandard inline. The compiler can't possibly inline memcmp() since it is nonstandard in in -ffreestanding mode and we don't implement it as a special nonstandard inline. __builtin_memcmp() might work. The data would need to be in a header so that it can be replaced by the immediate constant 0xffff* if that is better. But FreeBSD doesn't bother with optimizations like this. It uses memcpy() instead of bcopy() in some places to get the builtin memcpy(), but this was broken and turned into just a style bug long ago by -freestanding. -ffreestanding turns off almost all builtins since most builtins are for standard functions. FreeBSD doesn't bother to replace even memcpy() by __builtin_memcpy() so that it works as intended again. I do this in some versions, but it makes little difference. Perhaps doing this for hundreds of functions would make a difference of more like 1% than 0.01% (on average, or maybe 10% for a micro-benchmark). Someone pessimized struct ethernet by declaring it as __packed (without declaring it as __aligned). It must be packed, and probably ends up misaligned in some cases. Thus declaration ensures that the compiler treats it as misaligned in all cases unless it can prove otherwise. On x86, the compiler can just generate possibly-misaligned word-sized accesses. On other arches, it might have to generate 6 1-byte loads and combine the results, as expressed in the unobfuscated comparison. > ETHER_IS_MULTICAST(), by contrast, only needs to check a single bit in the > 48-bit MAC. Also blame the ethernet designers for bad data formats :-). Bruce From owner-svn-src-head@freebsd.org Mon Aug 8 02:48:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 480A0BB0972; Mon, 8 Aug 2016 02:48:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 149921689; Mon, 8 Aug 2016 02:48:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id 38so346491694iol.0; Sun, 07 Aug 2016 19:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Eips0/b+o/560cfUDUmLPo7V3uD8DqCujeDMXu1LUVg=; b=WhOMI6y+TPQt5JZxWVH0D2bgkTSP69Vj0/oKJ/EfG7aL5FNVZyVPla9mJNEojXlUsP rbIiU5Tm0QOfNlB2MQANk0JqDwWM/DHZTdWW96FT7/VCydYrwyqcm+goxrvmX34gP1Ra n6OoGBDJCRgVVAFDWA2+On0zrO0dnka6jewv9XqJC8UV46n3nwJLMRCghz0szMsSvCot KpDk4kQFnTNks9arzKcNxxX6XXGnCCcHbBDwLOoDLXXdN853gm2RIHN+peuIl8xUHTQo PvRnL8IS7EbdJp/UevrUCc7dFBhUp8olrA2NDLW0/ZVgRRXP0cdH5eFSzSt8Bg61fPW/ P0ig== 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; bh=Eips0/b+o/560cfUDUmLPo7V3uD8DqCujeDMXu1LUVg=; b=nOOVXJPNdInkja3zYn7kOPapRJmphpRBjIMLWPdj5T3VxdaQIT+ghJYx2nOIsvCa3n aLbNg8FhRk2i4XqvFI+B4VeM5RgpIFnDykUT9ym5a5gYmuRqxx9MMEwIQ6rcniueYXvv QkV5i65nNYT4JubD3bsbFMEKI9NhUoZ9aGDFKsQgC8a+1dZnEeaTu1WCq0pED2qKvzO5 LLuwN76D2BSfnUjcrdBe8Unmz6IowDOq10Bo9WoO/0x1wN7RIw1fl0eMl8/aoQCteBoe 91OPgl3FEMHRufOkOh2kyPIpC88kOSgNhfMrW+yJ/yY3LkjVieJLPdDaqxCizuFbSBO8 A+ag== X-Gm-Message-State: AEkoousYo5b9wqpLorZ2F8ixlDrDdCG67yeuYq4pvZALlChSOY/50MMD4GEF1tODdbM/5Pgosdo44OCIBRSStQ== X-Received: by 10.107.136.138 with SMTP id s10mr35365363ioi.75.1470624501514; Sun, 07 Aug 2016 19:48:21 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sun, 7 Aug 2016 19:48:20 -0700 (PDT) In-Reply-To: <20160808114333.Y957@besplex.bde.org> References: <201608070348.u773mXXt030939@repo.freebsd.org> <46183559-343f-401b-6471-3822e3383a50@selasky.org> <20160807192333.GA79784@server.rulingia.com> <32531e89-85fa-6012-6a3e-1e6a42843dc0@fastmail.net> <20160808114333.Y957@besplex.bde.org> From: Adrian Chadd Date: Sun, 7 Aug 2016 19:48:20 -0700 X-Google-Sender-Auth: eHUVj2emUfRBi8gWSSq_t3bV3qI Message-ID: Subject: Re: svn commit: r303811 - in head/sys: net net80211 To: Bruce Evans Cc: Bruce Simpson , Peter Jeremy , Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 02:48:22 -0000 [snip everything] uuuuuuuuuuuuuugh. Someone please solve this by writing ETHER_ADDR_COMPARE() so it can be overridden per architecture. :) I committed Ryan's work. If someone has a better thingy, please do feel free to review and commit the thingy. :-P -adrian (woo, first bikeshed in a while!) From owner-svn-src-head@freebsd.org Sun Aug 7 21:20:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0A63BB1112 for ; Sun, 7 Aug 2016 21:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E51517ED for ; Sun, 7 Aug 2016 21:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id u186so60431548ita.0 for ; Sun, 07 Aug 2016 14:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VJuVB+aaKsuMoTRHBA3yQrom9CMo6hkQEqEIPk8bqV4=; b=mvzt1MSHF7JNlCgTq6BWQQi8qYht9NIaaGWuQBUqgb6L+mjwRlFaeOtb1gR0t8dsiB /qEAEYY2JwSamQXteRAz0LdoYTbbxZQhiurM+ExTK9kNaN4Qfd3y0236UGnWqzFqkE+7 dg7vtd6xLp9b3J1AMaytwTtJQRZVRVG4BKp8dqKkCVXpYhdJAFVPq6E/YskcktObU0Sn vE3anRv1ZWELQvKxYJbFj3VbOyGGAZ+h2BssFzNl2DniAL+XmuejssVfYWCEiP0SAk8K QLK2cpb/TOxWh2hx3ME3fhOGcOqymGefxzq48BfqHB3sYFt/9KIVNwOEHT6XjNUDhZbT Lhvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VJuVB+aaKsuMoTRHBA3yQrom9CMo6hkQEqEIPk8bqV4=; b=bpzg3eD4Cnw7ymrMOYJGldXFC0snw0L17WdZofx4sefeqk2+DbL7eLu6PozNzQ6Gx6 XjHUMjLzE2uET+FSwWUDo/Q6j3i4yGeqJwjlS+t07TCHukNguIIEzthmLx+k5zmgN3B6 obPe7vC1geIZ3veXL8wKK6k37P37efMNc84EGPdEd8t7ywa/CviPmw7i3cu4amqOTokC eVfQ5IeCYepPloM3Kk10asiHof21w7v4C/vonCsK2rGP6ry9VGxrPwetTl0fIDJlX2j6 VDB1UFQGAh8UDyiwhCRnX/4nxJZir6REggpWFU+bc0kd0SlOjIPQOAUULL0/CoSluriz /Glw== X-Gm-Message-State: AEkoout3IDL308h/kCZadTaktEDp8SPVoYE6n/kptrKAxnEK+NCpQlE007KnXna3i8ek6g== X-Received: by 10.36.13.203 with SMTP id 194mr14102876itx.79.1470604807868; Sun, 07 Aug 2016 14:20:07 -0700 (PDT) Received: from mac.nflx.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id h99sm12916611iod.9.2016.08.07.14.20.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Aug 2016 14:20:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r303716 - head/crypto/openssh From: Warner Losh In-Reply-To: Date: Sun, 7 Aug 2016 15:20:05 -0600 Cc: Peter Jeremy , Bruce Simpson , Oliver Pinter , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Content-Transfer-Encoding: quoted-printable Message-Id: <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> To: Andrey Chernov X-Mailer: Apple Mail (2.3124) X-Mailman-Approved-At: Mon, 08 Aug 2016 04:19:33 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 21:20:08 -0000 > On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: >=20 >> OTOH, FreeBSD has a documented deprecation process that says things = will >> continue working for a major release after being formally deprecated. >=20 > FreeBSD 11 is not released yet (betas are not counted), stable-10 too, > so it is right time to deprecate for them. Nice try, but feature freeze was months ago. Have you got buy in from = the security officer and the release engineer? I didn=E2=80=99t think so... Warner From owner-svn-src-head@freebsd.org Sun Aug 7 21:28:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35689BB1397 for ; Sun, 7 Aug 2016 21:28:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46E81E52 for ; Sun, 7 Aug 2016 21:28:05 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f54.google.com with SMTP id l69so235004585lfg.1 for ; Sun, 07 Aug 2016 14:28:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=h1Mt1oLzU/CmVrGtgfdQEpRMCdDPH6sACr89rxWaKGU=; b=aijK+tQPgk2YG8oCzPuxqiV5Kknq3MM1HfDghh/KzKBOXVmiIJdM3mUoOtiNi6AAlZ hP2SwWMlfZaEqV1ZEDO6Kn39SX5Wyx+6P3weRyh+uzMPZ5uKiXaMv5IuAyiX7jzf13M+ HljcO9UGdo0+MXLgTyHf9X5pWhLbwcAWZmB33R+rr4IfGiXvw77HRLMhGxRIENBMrX2A TgfLbrjaObj/Nsz3/6wntwnORnrIMiLdVg9I4tvuW4Jykg4VtrdbTNG3cHsmdHF2GghK etXizvkLSvK/Af2ovGcdaGNCFs1LspdWkwTs4r1FuMMb2U4Ek03eF1I17B19ly7ABp7i f18A== X-Gm-Message-State: AEkoouuYyci7Tur50S+acjTYOno7x5PJDDN+9HXune+jtR6jJSv9mwYx6H7Ak35RkLJThg== X-Received: by 10.25.147.193 with SMTP id v184mr27299853lfd.43.1470605283718; Sun, 07 Aug 2016 14:28:03 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id p82sm5158136lfd.15.2016.08.07.14.28.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 14:28:03 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> Cc: Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team From: Andrey Chernov Message-ID: <801f5d02-357a-c137-9bf7-0e0429da0742@freebsd.org> Date: Mon, 8 Aug 2016 00:28:02 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 08 Aug 2016 05:03:32 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 21:28:06 -0000 On 08.08.2016 0:20, Warner Losh wrote: > >> On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: >> >>> OTOH, FreeBSD has a documented deprecation process that says things will >>> continue working for a major release after being formally deprecated. >> >> FreeBSD 11 is not released yet (betas are not counted), stable-10 too, >> so it is right time to deprecate for them. > > Nice try, but feature freeze was months ago. Have you got buy in from the > security officer and the release engineer? > > I didn’t think so... I must confess I don't track when feature freeze happens, so this is upon to re@ team to decide for 11. I am still right about stable-10 at least. From owner-svn-src-head@freebsd.org Sun Aug 7 22:31:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8D6BAD2B6 for ; Sun, 7 Aug 2016 22:31:44 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50F86173A for ; Sun, 7 Aug 2016 22:31:44 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f43.google.com with SMTP id b199so235950357lfe.0 for ; Sun, 07 Aug 2016 15:31:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=7j8ql0o652YFKHKB/KjyXkBUy4F0dXNdGurvY519TKM=; b=LtvvbLZlb6FXGPiZM9XfxZIBqysPTRvOyVjQRU9C81PcI+EKaL1XMIl3hUeFPM75oh II/UM0hCfVLd7s5+QxS2ID2j/ZT/mc0OYfbClZDjE0ZPAjXrk0KgCFE841I2yXeFMqsD 1XX6ah3JLMCMcMskI0cGXvsXfBA/OmLMJ0Ii+zfhO96uIL/nqKYHXTNed/ax1m3OtOht vSVF3+nRYCVabbnppLg4+t8Gn0ZU5xDEPXV7GeT9Hl3SxewsSxP2011mGYuyFwMdMfGC obOEZ0i5iO98AFywuY5i8JhVPjtYVwFBzPx/M3mffgDzAeSAKFmFLufhumF1ha0XZO9q kf1A== X-Gm-Message-State: AEkoouvLzq3+JMdt4lp+avfW4ixJaRkQKuB5A30YzSkwr+n1ZU1B0op3/Ikto6On7JEi/Q== X-Received: by 10.46.0.39 with SMTP id 39mr25835005lja.48.1470609101965; Sun, 07 Aug 2016 15:31:41 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id u14sm5031141lja.11.2016.08.07.15.31.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 15:31:41 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <801f5d02-357a-c137-9bf7-0e0429da0742@freebsd.org> Cc: Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team From: Andrey Chernov Message-ID: <677fd718-67d8-1ef3-4e50-f541a6b572b7@freebsd.org> Date: Mon, 8 Aug 2016 01:31:40 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <801f5d02-357a-c137-9bf7-0e0429da0742@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 08 Aug 2016 05:03:45 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 22:31:44 -0000 On 08.08.2016 0:28, Andrey Chernov wrote: > On 08.08.2016 0:20, Warner Losh wrote: >> >>> On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: >>> >>>> OTOH, FreeBSD has a documented deprecation process that says things will >>>> continue working for a major release after being formally deprecated. >>> >>> FreeBSD 11 is not released yet (betas are not counted), stable-10 too, >>> so it is right time to deprecate for them. >> >> Nice try, but feature freeze was months ago. Have you got buy in from the >> security officer and the release engineer? >> >> I didn’t think so... > > I must confess I don't track when feature freeze happens, so this is > upon to re@ team to decide for 11. I am still right about stable-10 at > least. BTW, as I just check, commit for stable-11 drop SSH1 support, disable DSA by default was Approved by: re (gjb) You may ask re@ is it intentional or overlook. Minimum DH size increased to 2048 and turning off DH 1024 diffie-hellman-group1-sha1 happens much earlier, about year ago. From owner-svn-src-head@freebsd.org Sun Aug 7 22:48:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D56BAD502; Sun, 7 Aug 2016 22:48:50 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72D931CE2; Sun, 7 Aug 2016 22:48:50 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (unknown [IPv6:2601:646:8880:a197:bd5c:bf39:ad46:d68d]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 7B2141C58C; Sun, 7 Aug 2016 15:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1470610129; x=1470624529; bh=Agf7F6VHC0knlli2KoRrcajsTmvP2DdMwpItinenRRk=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=yExgRrFCcQmtce9VfqfZ3rgLgiucU0MvvBsHLZpzM9lDdNWJhTeDLKXuvZOCZuAi1 lKdlmxEUpQ116Kduv8SU2A6Bl/MFFAkR+DQIl8ulOEzt0MrsnKhzrTrYPgjKzxQ0bF TeNPhG2yb+iz4vtg+cQ8agkGdHUWcM/N02Joldi8= Subject: Re: svn commit: r303716 - head/crypto/openssh To: Warner Losh , Andrey Chernov References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team From: Xin Li Message-ID: <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> Date: Sun, 7 Aug 2016 15:48:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3d78VBmIxkAQRj73p1wlE1j1d2G4PgUvw" X-Mailman-Approved-At: Mon, 08 Aug 2016 05:04:36 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 22:48:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3d78VBmIxkAQRj73p1wlE1j1d2G4PgUvw Content-Type: multipart/mixed; boundary="jJTbphxxRs7DIQRLHkNT5rFT7Q8E05Rps" From: Xin Li To: Warner Losh , Andrey Chernov Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Message-ID: <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> In-Reply-To: <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> --jJTbphxxRs7DIQRLHkNT5rFT7Q8E05Rps Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/7/16 14:20, Warner Losh wrote: >=20 >> On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: >> >>> OTOH, FreeBSD has a documented deprecation process that says things w= ill >>> continue working for a major release after being formally deprecated.= >> >> FreeBSD 11 is not released yet (betas are not counted), stable-10 too,= >> so it is right time to deprecate for them. >=20 > Nice try, but feature freeze was months ago. Have you got buy in from t= he > security officer and the release engineer? Well, despite the fact that I have to admit that I get locked out from my own storage box too, however (even without wearing any hat) I am for the change and would blame myself for being lazy in adopting the change when the upstream have announced it earlier about a year ago. Compatibility with legacy software/hardware, sure, but if we don't stop at some point, it would be like SSL 2.0 which people have pointed out several flaws in 1995 and take 16 years to get deprecated and still bite people in 2014. We should do something like what OpenSSH have done by creating a page describing the motivation, the impact, the temporary but discouraged workaround, etc., and mention it in the release notes to prevent people from being bite. Cheers, --jJTbphxxRs7DIQRLHkNT5rFT7Q8E05Rps-- --3d78VBmIxkAQRj73p1wlE1j1d2G4PgUvw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJXp7rQAAoJEJW2GBstM+nsbgwQAIHa97OqlQAaqGr9sSqyQ6wf +CLA9pVIVxbU5A6IT4UWI4wOtIaBWygERVb1pe+68hvGHWnb9Sg7tZwBNISDyhzg o9Mk5aiAna0PXIO6cHwkVpVVgpzRVUSoHlLP5Az7377vnB0q6M2kO1C3O6Bf8w9q 8Tb3UlrX58cQVGO6WglzV/O3eh1lCVaLEh4lSFsjpz8qC3XkhXYdNy4yM65ARUuc g3BxjUWfPHbjBRaMViTo5jf5zdfYAeed5GS2ux4F1WjRTmiUw+qhxraha8NqBOTI ciMC6884aBL/Dc0/klcB4L24Jkw0h8cpNx77LIo6NLtboiflzBsL4y5OTA4gwsXD Igaxa5c3PvXJDIjljj4PEobT2AVgfzzjYcVG0vodzJu62Oc8C5Z0VLEz3aJkSihy OrIs4K7rv1xeuttc884b2Ui2ChJ2nmbX6rcYjZRc0WKgwa247kXHtRuc+GDfrcEV XAx8VOwES24Z1GV3JkGfYHhap/Lr4sb4ECBpxGtR2D7jKSvVh/f6htTDaOrbARFr Ghln4nEB2l6ONoVcPNEJ4iunz4lKpTovyVmu7MNawmAw3so5i6UqV6oRvOBdV+zz feHaujnjrFIez5SA6MvW1nqHz7GoGTGPuafcSP18vi5p+LsaS0ZXfNAItifI4dbr ShzVnSq4KYxLNk02GTrt =T6rm -----END PGP SIGNATURE----- --3d78VBmIxkAQRj73p1wlE1j1d2G4PgUvw-- From owner-svn-src-head@freebsd.org Sun Aug 7 23:02:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C802BBADA64 for ; Sun, 7 Aug 2016 23:02:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 439871474 for ; Sun, 7 Aug 2016 23:02:03 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id l69so235685459lfg.1 for ; Sun, 07 Aug 2016 16:02:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=Yij5wGo7VHVoCzs1foec9HkVdqbzugeirXAyaHLLKCQ=; b=GQutlybNGfWSYrnrpXet+cgK6l/sfxSLFPiF4OCgKVGhSSk01EkWSNdKu+Zf0GHuIN O8LxOxGzslwtEpSPQ5B/69KU/Bk4KIwFRwRbMGOc1EzbM+b4Njt+X/f71IkR2YbhToBa OPABDS59CoUehCIPbhROxCUeKB57/1NMUZiVH9jyKAeiCWHYrpUTDH79/NlCdVfTVVmZ yzQSlqagotzpboRokDBqFcN03ZfEndEgchGWTY0jaq/b3cDUmdxHCuoOi/Nd6MdT+jz5 U1f7k/j6ZVwI0RgxFXcNHhDbinlJwPgGmZtf1kPafmcGSR4YfciTUVBbsZjj1UD07r7d WRhw== X-Gm-Message-State: AEkoouu+eUN+m1J4AVZPg3J4BqZe+FzL3dvQVgyT4LAgrnMxUoTd5kM0akcnwgGVpJ0blw== X-Received: by 10.46.32.203 with SMTP id g72mr23694238lji.30.1470610921642; Sun, 07 Aug 2016 16:02:01 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id s85sm1882575lfg.8.2016.08.07.16.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 16:02:00 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Xin Li , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team From: Andrey Chernov Message-ID: Date: Mon, 8 Aug 2016 02:01:59 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ou0T40MaJO018CH2KE6QQuxv7NHR429Uo" X-Mailman-Approved-At: Mon, 08 Aug 2016 05:05:02 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 23:02:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ou0T40MaJO018CH2KE6QQuxv7NHR429Uo Content-Type: multipart/mixed; boundary="otttudCs9iVdX8SVdBwf7koGVdsJb3sjd" From: Andrey Chernov To: Xin Li , Warner Losh Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> In-Reply-To: <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> --otttudCs9iVdX8SVdBwf7koGVdsJb3sjd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08.08.2016 1:48, Xin Li wrote: > Well, despite the fact that I have to admit that I get locked out from > my own storage box too, however (even without wearing any hat) I am for= > the change and would blame myself for being lazy in adopting the change= > when the upstream have announced it earlier about a year ago. >=20 > Compatibility with legacy software/hardware, sure, but if we don't stop= > at some point, it would be like SSL 2.0 which people have pointed out > several flaws in 1995 and take 16 years to get deprecated and still bit= e > people in 2014. >=20 > We should do something like what OpenSSH have done by creating a page > describing the motivation, the impact, the temporary but discouraged > workaround, etc., and mention it in the release notes to prevent people= > from being bite. I agree. I am not seeking hardly, stopping after first solution, but at least one workaround found: using security/putty port. It still supports all obsoleted stuff. One disadvantage: in terminal mode it requires X11. --otttudCs9iVdX8SVdBwf7koGVdsJb3sjd-- --ou0T40MaJO018CH2KE6QQuxv7NHR429Uo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXp73nAAoJEKUckv0MjfbKtDIIAJGiXu7uWF/PIURrq90dH7Ge XiI/DmDIh0EkCCTSH3nVWRUpZtIMxr4xidFP99BbTD2c043jAVCOsZrNNiDOKN8+ UZFBrWyLtGGDKlxZ4AcEQmEVcp/9UBgPKceD0VgPL8jxXkyq9cprzoQpLJihdXdq k78E2Nn3hE13pp28KK7uAmJ6kRmgjRnsVkMbe9OnH+BWzp1S+i6ze1MwcCF0KAFi G3uceRbzo46tjTq+oEmPQasKSja4bj/fAIdD1val+YdbS880CUVlKK3EMXpo9Tag b8HbJNH/53TMy0b5iCJSg14sRA5I8Yu7nt7kAW/zKIqZD5w/NnVuo5UBa0QGbqc= =obPi -----END PGP SIGNATURE----- --ou0T40MaJO018CH2KE6QQuxv7NHR429Uo-- From owner-svn-src-head@freebsd.org Sun Aug 7 23:33:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DCE6BB02E3 for ; Sun, 7 Aug 2016 23:33:21 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880731600 for ; Sun, 7 Aug 2016 23:33:20 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f41.google.com with SMTP id l69so235917725lfg.1 for ; Sun, 07 Aug 2016 16:33:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=AZ5PXyT1p63jShgDtmKkraWmoj2xPwBDY0VbjhQYKVo=; b=jXCzAo7fGjVM2whZx2yEQdGqvctqHfzyz3huCMhWuoKcQnq622gz/kY2ljdh9WVwXV TBiNSs1NqdyTpUf0kXYosn/ZkRDsbsg2/JY/2ko3Uj31RaNvHYMF2BXO/BjOO8QaTEuY YXvloY1uCcGLvJKgQ01fsPDSkvhPm8MiyFNoLHMQybYKB6VTT7aAmiWaGcgF+kduq7us FiYcPJz4Lcar/O1a0yJcrfAsB3R1912faVfjyHk+3HhnVCpRd8/vbY7q/dfQdDKZmzsg g6p6OOaTHp+bZiYeo4/G3qr+P5GlrI0JanRlYM+rM5L6ehDB7c0JafYCjNnI7U/vui1x cKXA== X-Gm-Message-State: AEkoouu2ZvSD9Tm3TyNuZwEMEL62BusQEyfJ/Lgf+WwgImPUVqL7zJn4CJ68HQz/3WGb6A== X-Received: by 10.25.27.70 with SMTP id b67mr23254245lfb.218.1470612798026; Sun, 07 Aug 2016 16:33:18 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f40sm5218385lji.46.2016.08.07.16.33.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 16:33:17 -0700 (PDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: Xin Li , Warner Losh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team From: Andrey Chernov Message-ID: <3aad1c34-03a0-b97e-bb95-2bcbb5df2f9e@freebsd.org> Date: Mon, 8 Aug 2016 02:33:16 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hsFCEF5sKEnE0XlvMjMk68AlXd5sdtLag" X-Mailman-Approved-At: Mon, 08 Aug 2016 05:05:45 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 07 Aug 2016 23:33:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hsFCEF5sKEnE0XlvMjMk68AlXd5sdtLag Content-Type: multipart/mixed; boundary="n39Qpeuhu73MSasssDFSvkxCPpwEXot48" From: Andrey Chernov To: Xin Li , Warner Losh Cc: d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Message-ID: <3aad1c34-03a0-b97e-bb95-2bcbb5df2f9e@freebsd.org> Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> In-Reply-To: --n39Qpeuhu73MSasssDFSvkxCPpwEXot48 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08.08.2016 2:01, Andrey Chernov wrote: > On 08.08.2016 1:48, Xin Li wrote: >> Well, despite the fact that I have to admit that I get locked out from= >> my own storage box too, however (even without wearing any hat) I am fo= r >> the change and would blame myself for being lazy in adopting the chang= e >> when the upstream have announced it earlier about a year ago. >> >> Compatibility with legacy software/hardware, sure, but if we don't sto= p >> at some point, it would be like SSL 2.0 which people have pointed out >> several flaws in 1995 and take 16 years to get deprecated and still bi= te >> people in 2014. >> >> We should do something like what OpenSSH have done by creating a page >> describing the motivation, the impact, the temporary but discouraged >> workaround, etc., and mention it in the release notes to prevent peopl= e >> from being bite. >=20 > I agree. I am not seeking hardly, stopping after first solution, but at= > least one workaround found: using security/putty port. It still support= s > all obsoleted stuff. One disadvantage: in terminal mode it requires X11= =2E Forgot to mention: openssh keys must be converted to putty keys format first using puttygen. --n39Qpeuhu73MSasssDFSvkxCPpwEXot48-- --hsFCEF5sKEnE0XlvMjMk68AlXd5sdtLag Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXp8U8AAoJEKUckv0MjfbKoZwH/RUDS43FOLZDwZfr9IXEa7Ou cU1hysI/Z+9+nOL3RqKQvR1E1iQFWX9k1Qz41kHdq3Yqhtgj+VKy5VAZht8Trmte 3tABAfv3A6pQ/7zHE9H6cmU5ODpZeSSnV2dT72+hWUdRsxIQoBHr1RRwE7Wnwt85 vtNW4bjKJqrIG556o85KTtu2Uc53XUgATinEeQNPxwh01Yyi2xMPlk2oKFIgrsPI 31wIY1IU40MtHM6Ae4ajkJpNO1rAZU3EZmlf0WrHKOqUE/x7u+AOZXKSunHc3LFa 9uLsu3DGFXR0TItamWyGAEZ8SM4i1a8LdP5dyktcYsSv91MgcZ7f1ygeKwxkGsM= =d9l6 -----END PGP SIGNATURE----- --hsFCEF5sKEnE0XlvMjMk68AlXd5sdtLag-- From owner-svn-src-head@freebsd.org Mon Aug 8 05:57:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F302CBB1CF5; Mon, 8 Aug 2016 05:57:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9DA1BD6; Mon, 8 Aug 2016 05:57:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u785v4Ow012277; Mon, 8 Aug 2016 05:57:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u785v4fV012276; Mon, 8 Aug 2016 05:57:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608080557.u785v4fV012276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 8 Aug 2016 05:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303821 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 05:57:06 -0000 Author: sephe Date: Mon Aug 8 05:57:04 2016 New Revision: 303821 URL: https://svnweb.freebsd.org/changeset/base/303821 Log: etherswitch: Unbreak LINT build Sponsored by: Microsoft Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Aug 8 01:01:05 2016 (r303820) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Aug 8 05:57:04 2016 (r303821) @@ -232,7 +232,8 @@ arswitch_modifyreg(device_t dev, int add int value; uint16_t phy, reg; - ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + ARSWITCH_LOCK_ASSERT((struct arswitch_softc *)device_get_softc(dev), + MA_OWNED); arswitch_split_setpage(dev, addr, &phy, ®); From owner-svn-src-head@freebsd.org Mon Aug 8 05:57:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E5CBB1D4D; Mon, 8 Aug 2016 05:57:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B9B1D46; Mon, 8 Aug 2016 05:57:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u785vdh1012340; Mon, 8 Aug 2016 05:57:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u785vcZI012335; Mon, 8 Aug 2016 05:57:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608080557.u785vcZI012335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 8 Aug 2016 05:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303822 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 05:57:40 -0000 Author: sephe Date: Mon Aug 8 05:57:38 2016 New Revision: 303822 URL: https://svnweb.freebsd.org/changeset/base/303822 Log: hyperv/ic: Remove never used second parameter of hv_negotiate_version() MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7422 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 05:57:04 2016 (r303821) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 05:57:38 2016 (r303822) @@ -75,8 +75,7 @@ hv_heartbeat_cb(struct vmbus_channel *ch &buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, NULL, buf); - + hv_negotiate_version(icmsghdrp, buf); } else { heartbeat_msg = (struct hv_vmbus_heartbeat_msg_data *) Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 05:57:04 2016 (r303821) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 05:57:38 2016 (r303822) @@ -79,8 +79,7 @@ hv_shutdown_cb(struct vmbus_channel *cha &buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, NULL, buf); - + hv_negotiate_version(icmsghdrp, buf); } else { shutdown_msg = (struct hv_vmbus_shutdown_msg_data *) Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 05:57:04 2016 (r303821) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 05:57:38 2016 (r303822) @@ -155,7 +155,7 @@ hv_timesync_cb(struct vmbus_channel *cha sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, NULL, time_buf); + hv_negotiate_version(icmsghdrp, time_buf); } else { timedatap = (struct hv_ictimesync_data *) &time_buf[ sizeof(struct hv_vmbus_pipe_hdr) + Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 05:57:04 2016 (r303821) +++ head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 05:57:38 2016 (r303822) @@ -45,11 +45,10 @@ #include "hv_util.h" void -hv_negotiate_version( - struct hv_vmbus_icmsg_hdr* icmsghdrp, - struct hv_vmbus_icmsg_negotiate* negop, - uint8_t* buf) +hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) { + struct hv_vmbus_icmsg_negotiate *negop; + icmsghdrp->icmsgsize = 0x10; negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 05:57:04 2016 (r303821) +++ head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 05:57:38 2016 (r303822) @@ -43,11 +43,9 @@ typedef struct hv_util_sc { uint8_t *receive_buffer; } hv_util_sc; -void hv_negotiate_version( - struct hv_vmbus_icmsg_hdr* icmsghdrp, - struct hv_vmbus_icmsg_negotiate* negop, - uint8_t* buf); +void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); int hv_util_attach(device_t dev); int hv_util_detach(device_t dev); + #endif From owner-svn-src-head@freebsd.org Mon Aug 8 06:11:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4589BB11B0; Mon, 8 Aug 2016 06:11:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 663C919BE; Mon, 8 Aug 2016 06:11:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u786BTCl016308; Mon, 8 Aug 2016 06:11:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u786BTRl016302; Mon, 8 Aug 2016 06:11:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608080611.u786BTRl016302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 8 Aug 2016 06:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303823 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 06:11:30 -0000 Author: sephe Date: Mon Aug 8 06:11:28 2016 New Revision: 303823 URL: https://svnweb.freebsd.org/changeset/base/303823 Log: hyperv/ic: Expose the receive buffer length for callers to use. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7423 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 06:11:28 2016 (r303823) @@ -64,7 +64,7 @@ hv_heartbeat_cb(struct vmbus_channel *ch softc = (hv_util_sc*)context; buf = softc->receive_buffer; - recvlen = PAGE_SIZE; + recvlen = softc->ic_buflen; ret = vmbus_chan_recv(channel, buf, &recvlen, &requestid); KASSERT(ret != ENOBUFS, ("hvheartbeat recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 8 06:11:28 2016 (r303823) @@ -629,7 +629,7 @@ hv_kvp_process_request(void *context, in kvp_buf = sc->util_sc.receive_buffer; channel = vmbus_get_channel(sc->dev); - recvlen = 2 * PAGE_SIZE; + recvlen = sc->util_sc.ic_buflen; ret = vmbus_chan_recv(channel, kvp_buf, &recvlen, &requestid); KASSERT(ret != ENOBUFS, ("hvkvp recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ @@ -696,7 +696,7 @@ hv_kvp_process_request(void *context, in /* * Try reading next buffer */ - recvlen = 2 * PAGE_SIZE; + recvlen = sc->util_sc.ic_buflen; ret = vmbus_chan_recv(channel, kvp_buf, &recvlen, &requestid); KASSERT(ret != ENOBUFS, ("hvkvp recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 06:11:28 2016 (r303823) @@ -68,7 +68,7 @@ hv_shutdown_cb(struct vmbus_channel *cha softc = (hv_util_sc*)context; buf = softc->receive_buffer; - recv_len = PAGE_SIZE; + recv_len = softc->ic_buflen; ret = vmbus_chan_recv(channel, buf, &recv_len, &request_id); KASSERT(ret != ENOBUFS, ("hvshutdown recvbuf is not large enough")); /* XXX check recv_len to make sure that it contains enough data */ Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 06:11:28 2016 (r303823) @@ -145,7 +145,7 @@ hv_timesync_cb(struct vmbus_channel *cha softc = (hv_timesync_sc*)context; time_buf = softc->util_sc.receive_buffer; - recvlen = PAGE_SIZE; + recvlen = softc->util_sc.ic_buflen; ret = vmbus_chan_recv(channel, time_buf, &recvlen, &requestId); KASSERT(ret != ENOBUFS, ("hvtimesync recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 06:11:28 2016 (r303823) @@ -44,6 +44,8 @@ #include #include "hv_util.h" +#define VMBUS_IC_BRSIZE (4 * PAGE_SIZE) + void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) { @@ -75,14 +77,13 @@ hv_negotiate_version(struct hv_vmbus_icm int hv_util_attach(device_t dev) { - struct hv_util_sc* softc; - struct vmbus_channel *chan; - int ret; - - softc = device_get_softc(dev); - softc->receive_buffer = - malloc(4 * PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); - chan = vmbus_get_channel(dev); + struct hv_util_sc *sc = device_get_softc(dev); + struct vmbus_channel *chan = vmbus_get_channel(dev); + int error; + + sc->ic_buflen = VMBUS_IC_BRSIZE; + sc->receive_buffer = malloc(VMBUS_IC_BRSIZE, M_DEVBUF, + M_WAITOK | M_ZERO); /* * These services are not performance critical and do not need @@ -93,17 +94,13 @@ hv_util_attach(device_t dev) */ vmbus_chan_set_readbatch(chan, false); - ret = vmbus_chan_open(chan, 4 * PAGE_SIZE, 4 * PAGE_SIZE, NULL, 0, - softc->callback, softc); - - if (ret) - goto error0; - + error = vmbus_chan_open(chan, VMBUS_IC_BRSIZE, VMBUS_IC_BRSIZE, NULL, 0, + sc->callback, sc); + if (error) { + free(sc->receive_buffer, M_DEVBUF); + return (error); + } return (0); - -error0: - free(softc->receive_buffer, M_DEVBUF); - return (ret); } int Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 05:57:38 2016 (r303822) +++ head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 06:11:28 2016 (r303823) @@ -41,6 +41,7 @@ typedef struct hv_util_sc { */ void (*callback)(struct vmbus_channel *, void *); uint8_t *receive_buffer; + int ic_buflen; } hv_util_sc; void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); From owner-svn-src-head@freebsd.org Mon Aug 8 06:18:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F95BB1308; Mon, 8 Aug 2016 06:18:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73AB1DDA; Mon, 8 Aug 2016 06:18:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u786IsLv019992; Mon, 8 Aug 2016 06:18:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u786Isxf019986; Mon, 8 Aug 2016 06:18:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608080618.u786Isxf019986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 8 Aug 2016 06:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303824 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 06:18:56 -0000 Author: sephe Date: Mon Aug 8 06:18:54 2016 New Revision: 303824 URL: https://svnweb.freebsd.org/changeset/base/303824 Log: hyperv/ic: Pass the channel callback to hv_util_attach() The saved channel callback in util softc is actually never used. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7424 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Aug 8 06:18:54 2016 (r303824) @@ -109,11 +109,7 @@ hv_heartbeat_probe(device_t dev) static int hv_heartbeat_attach(device_t dev) { - hv_util_sc *softc = (hv_util_sc*)device_get_softc(dev); - - softc->callback = hv_heartbeat_cb; - - return hv_util_attach(dev); + return hv_util_attach(dev, hv_heartbeat_cb); } static device_method_t heartbeat_methods[] = { Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Mon Aug 8 06:18:54 2016 (r303824) @@ -892,7 +892,6 @@ hv_kvp_attach(device_t dev) hv_kvp_sc *sc = (hv_kvp_sc*)device_get_softc(dev); - sc->util_sc.callback = hv_kvp_callback; sc->dev = dev; sema_init(&sc->dev_sema, 0, "hv_kvp device semaphore"); mtx_init(&sc->pending_mutex, "hv-kvp pending mutex", @@ -920,7 +919,7 @@ hv_kvp_attach(device_t dev) return (error); sc->hv_kvp_dev->si_drv1 = sc; - return hv_util_attach(dev); + return hv_util_attach(dev, hv_kvp_callback); } static int Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Mon Aug 8 06:18:54 2016 (r303824) @@ -131,11 +131,7 @@ hv_shutdown_probe(device_t dev) static int hv_shutdown_attach(device_t dev) { - hv_util_sc *softc = (hv_util_sc*)device_get_softc(dev); - - softc->callback = hv_shutdown_cb; - - return hv_util_attach(dev); + return hv_util_attach(dev, hv_shutdown_cb); } static device_method_t shutdown_methods[] = { Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Mon Aug 8 06:18:54 2016 (r303824) @@ -189,18 +189,16 @@ hv_timesync_attach(device_t dev) { hv_timesync_sc *softc = device_get_softc(dev); - softc->util_sc.callback = hv_timesync_cb; TASK_INIT(&softc->task, 1, hv_set_host_time, softc); - - return hv_util_attach(dev); + return hv_util_attach(dev, hv_timesync_cb); } static int hv_timesync_detach(device_t dev) { hv_timesync_sc *softc = device_get_softc(dev); - taskqueue_drain(taskqueue_thread, &softc->task); + taskqueue_drain(taskqueue_thread, &softc->task); return hv_util_detach(dev); } Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_util.c Mon Aug 8 06:18:54 2016 (r303824) @@ -75,7 +75,7 @@ hv_negotiate_version(struct hv_vmbus_icm } int -hv_util_attach(device_t dev) +hv_util_attach(device_t dev, vmbus_chan_callback_t cb) { struct hv_util_sc *sc = device_get_softc(dev); struct vmbus_channel *chan = vmbus_get_channel(dev); @@ -95,7 +95,7 @@ hv_util_attach(device_t dev) vmbus_chan_set_readbatch(chan, false); error = vmbus_chan_open(chan, VMBUS_IC_BRSIZE, VMBUS_IC_BRSIZE, NULL, 0, - sc->callback, sc); + cb, sc); if (error) { free(sc->receive_buffer, M_DEVBUF); return (error); Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 06:11:28 2016 (r303823) +++ head/sys/dev/hyperv/utilities/hv_util.h Mon Aug 8 06:18:54 2016 (r303824) @@ -31,22 +31,20 @@ #ifndef _HVUTIL_H_ #define _HVUTIL_H_ +#include + /** * hv_util related structures * */ typedef struct hv_util_sc { - /* - * function to process Hyper-V messages - */ - void (*callback)(struct vmbus_channel *, void *); uint8_t *receive_buffer; int ic_buflen; } hv_util_sc; void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); -int hv_util_attach(device_t dev); +int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); int hv_util_detach(device_t dev); #endif From owner-svn-src-head@freebsd.org Mon Aug 8 07:19:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B2ABB143D; Mon, 8 Aug 2016 07:19:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4E7C1782; Mon, 8 Aug 2016 07:19:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u787JUaD044027; Mon, 8 Aug 2016 07:19:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u787JUq5044025; Mon, 8 Aug 2016 07:19:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608080719.u787JUq5044025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 8 Aug 2016 07:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303830 - head/usr.bin/getconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 07:19:32 -0000 Author: ngie Date: Mon Aug 8 07:19:30 2016 New Revision: 303830 URL: https://svnweb.freebsd.org/changeset/base/303830 Log: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] MFC after: 1 week PR: 211300 [*] Submitted by: Sevan Janiyan [*] Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/getconf/getconf.1 head/usr.bin/getconf/progenv.gperf Modified: head/usr.bin/getconf/getconf.1 ============================================================================== --- head/usr.bin/getconf/getconf.1 Mon Aug 8 07:16:13 2016 (r303829) +++ head/usr.bin/getconf/getconf.1 Mon Aug 8 07:19:30 2016 (r303830) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2002 +.Dd August 8, 2016 .Dt GETCONF 1 .Os .Sh NAME @@ -122,7 +122,7 @@ Exactly 32-bit integer, long, and pointe .It Li POSIX_V6_LP64_OFF64 Exactly 32-bit integer; exactly 64-bit long, pointer, and file offset. .Sy Supported platforms : -.Tn Alpha , +.Tn AMD64 , .Tn SPARC64 . .It Li POSIX_V6_LPBIG_OFFBIG At least 32-bit integer; at least 64-bit long, pointer, and file offset. Modified: head/usr.bin/getconf/progenv.gperf ============================================================================== --- head/usr.bin/getconf/progenv.gperf Mon Aug 8 07:16:13 2016 (r303829) +++ head/usr.bin/getconf/progenv.gperf Mon Aug 8 07:19:30 2016 (r303830) @@ -30,7 +30,7 @@ static const struct map *in_word_set(con * be updated. (We cheat here and define the supported environments * statically.) */ -#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) +#if defined(__sparc64__) || defined(__amd64__) #define have_LP64_OFF64 NULL #endif From owner-svn-src-head@freebsd.org Mon Aug 8 08:20:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FC73BB1FC7; Mon, 8 Aug 2016 08:20:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202441D2E; Mon, 8 Aug 2016 08:20:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u788KAIO067068; Mon, 8 Aug 2016 08:20:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u788KAHX067067; Mon, 8 Aug 2016 08:20:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608080820.u788KAHX067067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 8 Aug 2016 08:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303831 - 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.22 Precedence: list List-Id: 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, 08 Aug 2016 08:20:11 -0000 Author: tuexen Date: Mon Aug 8 08:20:10 2016 New Revision: 303831 URL: https://svnweb.freebsd.org/changeset/base/303831 Log: Fix a locking issue found by stress testing with tsctp. The inp read lock neeeds to be held when considering control->do_not_ref_stcb. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Aug 8 07:19:30 2016 (r303830) +++ head/sys/netinet/sctputil.c Mon Aug 8 08:20:10 2016 (r303831) @@ -5497,20 +5497,16 @@ restart_nosblocks: } /* Clear the held length since there is something to read */ control->held_length = 0; - if (hold_rlock) { - SCTP_INP_READ_UNLOCK(inp); - hold_rlock = 0; - } found_one: /* * If we reach here, control has a some data for us to read off. * Note that stcb COULD be NULL. */ - control->some_taken++; - if (hold_sblock) { - SOCKBUF_UNLOCK(&so->so_rcv); - hold_sblock = 0; + if (hold_rlock == 0) { + hold_rlock = 1; + SCTP_INP_READ_LOCK(inp); } + control->some_taken++; stcb = control->stcb; if (stcb) { if ((control->do_not_ref_stcb == 0) && @@ -5684,6 +5680,14 @@ found_one: } #endif } + if (hold_rlock) { + SCTP_INP_READ_UNLOCK(inp); + hold_rlock = 0; + } + if (hold_sblock) { + SOCKBUF_UNLOCK(&so->so_rcv); + hold_sblock = 0; + } /* now copy out what data we can */ if (mp == NULL) { /* copy out each mbuf in the chain up to length */ From owner-svn-src-head@freebsd.org Mon Aug 8 10:35:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F17BB2D05; Mon, 8 Aug 2016 10:35:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D03EA1546; Mon, 8 Aug 2016 10:35:57 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 5F07D276F; Mon, 8 Aug 2016 10:26:36 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 5C4A54C91; Mon, 8 Aug 2016 12:25:46 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrey Chernov Cc: Bruce Simpson , Oliver Pinter , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> Date: Mon, 08 Aug 2016 12:25:46 +0200 In-Reply-To: <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> (Andrey Chernov's message of "Sun, 7 Aug 2016 15:25:54 +0300") Message-ID: <867fbrwo9h.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:35:58 -0000 Andrey Chernov writes: > You should address your complains to original openssh author instead, it > was his decision to get rid of weak algos. In my personal opinion, if > your hardware is outdated, just drop it out. We can't turn our security > team into compatibility team, by constantly restoring removed code, such > code quickly becomes outdated and may add new security holes even being > inactive. This. It's bad enough that we will never be able to upgrade OpenSSH past 7.3 in 10 because some of the deprecated code that we re-enabled is scheduled to be removed entirely. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Mon Aug 8 10:37:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F39DBB2DD6; Mon, 8 Aug 2016 10:37:35 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E78591822; Mon, 8 Aug 2016 10:37:34 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 7B15927D1; Mon, 8 Aug 2016 10:37:33 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 82F004C96; Mon, 8 Aug 2016 12:36:43 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Simpson Cc: Warner Losh , Andrey Chernov , Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> Date: Mon, 08 Aug 2016 12:36:43 +0200 In-Reply-To: (Bruce Simpson's message of "Sun, 7 Aug 2016 17:14:12 +0100") Message-ID: <86zionv96s.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:37:35 -0000 Bruce Simpson writes: > Alcatel-Lucent OmniSwitch 6800 login broken (pfSense 2.3.2 which > accepted the upstream change, workaround no-go) > > [2.3.2-RELEASE][root@gw.lab]/root: ssh -l admin > -oKexAlgorithms=3D+diffie-hellman-group1-sha1 192.168.1.XXX > Fssh_ssh_dispatch_run_fatal: Connection to 192.168.1.XXX port 22: DH > GEX group out of range This patch did not remove weak DH groups. That happened in 7.0p1 back in January. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Mon Aug 8 10:41:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3766FBB2E72; Mon, 8 Aug 2016 10:41:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0943F1A30; Mon, 8 Aug 2016 10:41:01 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A024A20559; Mon, 8 Aug 2016 06:41:00 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Mon, 08 Aug 2016 06:41:00 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/l57hXfRUL5s5G7Oa5yQlr5uHk4=; b=kyaT2v lbtPy9d958GzeB+oNrpChpPQnOOwPpXnseIiXtV4FBXuNloGKXTCXS+h8UHULqCJ nCa0hKPRXZdEeEtGtgaflH+UjSliJ6Ckq1qzoV3jMxkRmwnOa4qA8tAgqoOrh1CY +WWFAuJwDruxtMI6oMt9+uPkQEofgw9mdF6Lk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/l57hXfRUL5s5G7 Oa5yQlr5uHk4=; b=pAXNlSMCtWRYPrO6dYQjIegtdKXLiO+Pp669oWftKWzVJsG YIbwLCB+ZfzNOBtUCMBTZY/fvCjjrNfAfrwjg5NXqA45xXi7+fTZfQPdOsHvNnj8 1vpC2Fh9B2M0IcGknIleiPaPJdVMDreUL+KDP9vkJPG7NDjDaxd3qwkRcomU= X-Sasl-enc: PznuKUwDQS13nC70tc1w96IEnrGZBiFvey6K6PI/vBN2 1470652860 Received: from pion.local (5751ac42.skybroadband.com [87.81.172.66]) by mail.messagingengine.com (Postfix) with ESMTPA id F1F40CCE66; Mon, 8 Aug 2016 06:40:58 -0400 (EDT) Subject: Re: svn commit: r303716 - head/crypto/openssh To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <86zionv96s.fsf@desk.des.no> Cc: Warner Losh , Andrey Chernov , Slawa Olhovchenkov , Oliver Pinter , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Bruce Simpson Message-ID: <208bd6bd-ec11-b9f6-ecb8-6b3fb772c331@fastmail.net> Date: Mon, 8 Aug 2016 11:40:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <86zionv96s.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:41:02 -0000 On 08/08/16 11:36, Dag-Erling Smørgrav wrote: > Bruce Simpson writes: >> Alcatel-Lucent OmniSwitch 6800 login broken ... > This patch did not remove weak DH groups. That happened in 7.0p1 back > in January. So my reading of this is that PuTTy may be the best workaround for end-users who have to speak to older SSH implementations. That's what I ended up using to get around some of the SSH interop mess with the Proxim AP4000, although much of that was not directly related to the cipher suite! (But ideally it should support X11-headless operation. To my knowledge, and as others have mentioned, it is currently believed to require it.) From owner-svn-src-head@freebsd.org Mon Aug 8 10:46:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5670ABB20C6; Mon, 8 Aug 2016 10:46:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FAE31170; Mon, 8 Aug 2016 10:46:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78AkINm023624; Mon, 8 Aug 2016 10:46:18 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78AkImJ023623; Mon, 8 Aug 2016 10:46:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201608081046.u78AkImJ023623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 8 Aug 2016 10:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303832 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:46:19 -0000 Author: des Date: Mon Aug 8 10:46:18 2016 New Revision: 303832 URL: https://svnweb.freebsd.org/changeset/base/303832 Log: Try to check whether each key file exists before adding it, and bail out if we didn't find any of them. This reduces log spam about key files for deprecated algorithms, which we look for but don't generate. PR: 208254 MFC after: 3 days Modified: head/crypto/openssh/servconf.c Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Mon Aug 8 08:20:10 2016 (r303831) +++ head/crypto/openssh/servconf.c Mon Aug 8 10:46:18 2016 (r303832) @@ -22,6 +22,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #include #include @@ -206,24 +207,28 @@ fill_default_server_options(ServerOption /* Standard Options */ if (options->protocol == SSH_PROTO_UNKNOWN) options->protocol = SSH_PROTO_2; +#define add_host_key_file(path) \ + do { \ + if (access((path), O_RDONLY) == 0) \ + options->host_key_files \ + [options->num_host_key_files++] = (path); \ + } while (0) if (options->num_host_key_files == 0) { /* fill default hostkeys for protocols */ if (options->protocol & SSH_PROTO_1) - options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_KEY_FILE; + add_host_key_file(_PATH_HOST_KEY_FILE); if (options->protocol & SSH_PROTO_2) { - options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_RSA_KEY_FILE; - options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_DSA_KEY_FILE; + add_host_key_file(_PATH_HOST_RSA_KEY_FILE); + add_host_key_file(_PATH_HOST_DSA_KEY_FILE); #ifdef OPENSSL_HAS_ECC - options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_ECDSA_KEY_FILE; + add_host_key_file(_PATH_HOST_ECDSA_KEY_FILE); #endif - options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_ED25519_KEY_FILE; + add_host_key_file(_PATH_HOST_ED25519_KEY_FILE); } } +#undef add_host_key_file + if (options->num_host_key_files == 0) + fatal("No host key files found"); /* No certificates by default */ if (options->num_ports == 0) options->ports[options->num_ports++] = SSH_DEFAULT_PORT; From owner-svn-src-head@freebsd.org Mon Aug 8 10:47:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD7FDBB21B6; Mon, 8 Aug 2016 10:47:18 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780051306; Mon, 8 Aug 2016 10:47:18 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id o80so129908692wme.1; Mon, 08 Aug 2016 03:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aY3Q/MZc/xyJs4MJWSEkDCwuBDqzTZFw3L+lDgMnQUY=; b=vPQSjKkEj8Svi2KgSOzMocHBtre2ypXYmScN1wb390VK5KDMEPn+wZmRib1VMoWFJ8 vWPioQ8QZsmN8Ay9lZWQcRospKeSd+3XMC+Tn0VGZ7qHeHOjHAF1acsbVm6RJ0Xn8NEl kggVynbWmBscSubVZbwHUc/cXFwX6jnj/nKZhvCq+fdCw8ihba3iMrGjKNvuxxRj9Mc4 3lIcT5z52PokCF+VQskSTmhcFi8laA0Odg6S82T3ZP1WpUG6uzjAYGePLc97qV1K+xR9 +7ftRLzSA9olkhAHw6c0xvUlr8gAhX7l+qdu61RDrni0/XhNfbi3xIEM1ck6kMDiPQSt fCUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=aY3Q/MZc/xyJs4MJWSEkDCwuBDqzTZFw3L+lDgMnQUY=; b=U6bXDQYqtMOuX59As26ijzaBjXlt99fKRf++Oz2zFW/WiAjyRaw3ZNYmeUuRnd2TFz GXnaLlXdCFSI3j0PEWz6ZDTbTsYwzLZcEsUstHH5vxI+Q/tAxOe6eubFDuDvqSswknIn rbPOCMlag5R5ba5EJAg/FMcCUVcr0xXHk77y6KHEFHQZ9+krQ+RjagYuNe96Gab8ndlq OVmZ3xhBJzkgTsz0yRaC3sJOtnyEv2URTzdzfd+85n/ktPtLlF0/qJ1roR6hgMv8Duhj Xu6ahmVmLhzQdpH/c2HHhHfooEpeKP/VFYOrzH6slbsgSMRcvjPZD1T93XE7irKYb/3t 47cw== X-Gm-Message-State: AEkoouuUxmXxThIzecCuEPhP8HJpA34sFQJpdLKfhpd4Ol3XwVZSdHu+nE+Wa/DjrdB0nw== X-Received: by 10.28.167.144 with SMTP id q138mr14822886wme.83.1470653236521; Mon, 08 Aug 2016 03:47:16 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id x133sm23116882wmf.16.2016.08.08.03.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 03:47:15 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 8 Aug 2016 12:47:15 +0200 From: Baptiste Daroussin To: Bruce Simpson Cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, Oliver Pinter , Warner Losh , Slawa Olhovchenkov , svn-src-head@freebsd.org Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160808104714.2grjjeuezzvdakgk@ivaldir.etoilebsd.net> References: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807125227.GC22212@zxy.spb.ru> <7237f5e6-fd65-a7e5-7751-4ed1c464b39a@freebsd.org> <4D28752C-0584-4294-9250-FA88B0C6E805@bsdimp.com> <86zionv96s.fsf@desk.des.no> <208bd6bd-ec11-b9f6-ecb8-6b3fb772c331@fastmail.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k4zxpags6xjhag4o" Content-Disposition: inline In-Reply-To: <208bd6bd-ec11-b9f6-ecb8-6b3fb772c331@fastmail.net> User-Agent: Mutt/1.6.2-neo (2016-07-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:47:19 -0000 --k4zxpags6xjhag4o Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 08, 2016 at 11:40:55AM +0100, Bruce Simpson wrote: > On 08/08/16 11:36, Dag-Erling Sm=F8rgrav wrote: > > Bruce Simpson writes: > > > Alcatel-Lucent OmniSwitch 6800 login broken > ... > > This patch did not remove weak DH groups. That happened in 7.0p1 back > > in January. >=20 > So my reading of this is that PuTTy may be the best workaround for end-us= ers > who have to speak to older SSH implementations. >=20 > That's what I ended up using to get around some of the SSH interop mess w= ith > the Proxim AP4000, although much of that was not directly related to the > cipher suite! >=20 > (But ideally it should support X11-headless operation. To my knowledge, a= nd > as others have mentioned, it is currently believed to require it.) putty comes with cli tools: plink being the cli ssh client, just use that one. You can also rebuild putty disabling the GTK2 option if you want the packag= e not to drag in all the X11 related stuff --k4zxpags6xjhag4o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXqGMxAAoJEGOJi9zxtz5ab+wP/j6qMumcWHkQrbz3qpV+IpBW bTmiTtx/i9/VMYncsjJHPNnbiFhdGfZYJpssFbIeuNuekIKj0F1Oj416YJYaDrst VvFeRYVz2HOSVBXkBwnEC53bzkLWVXuK6zxpI7+1ebhMJbUm4sUjEePhayDSyun9 LgrRVZG69/0Y04f8dPC1W7pmO/hManmQtn7PFC6sAON6z7od9H1ZWTmNqYR0P8cJ 7l58QVAtdJTIQtl86bihzBPGgMghbEbW5XNmZMUB0q5zVdQh+L1DD35K2Jg6sK5+ HaHeGz0sTkHL0QroWhYMidALKyU10W/A7aoUNIg2a2N30vywkUrw+4LO77RnE4j6 8eL54kePMxb/7L5Ak42zhbMKM17ZSeRwBfie1VlsFYOK1TaxWBbGugSoxw/FGOlp gOoHQM4izFqMK3bgvZBLaGXcMbYG8Adw6wbfVn4lAlwLUmG6jG6M4XEtF9ezyeFv DVBuVSMte3b8XlBYFs8wgpM9M0ElH2z/nLCFWJHS7VrXTOVo0y5aAKAsKH+4UP6X DPBoVIgL+2UifL9L3w1t3hUtoYjR5Mv7RdLk+FNxWYVOnRxBIRhV9YrNrgRhepx/ dF7V0z9R2R1pYisHvXWvEGlvZVlGZtWYPBoXkwX4DXcM5wNkUxmY08vVkKPSd5nu l5YEj1zhziDFAInS/e8H =1pw2 -----END PGP SIGNATURE----- --k4zxpags6xjhag4o-- From owner-svn-src-head@freebsd.org Mon Aug 8 07:25:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8CCBB1835; Mon, 8 Aug 2016 07:25:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15A21C93; Mon, 8 Aug 2016 07:25:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D54105A9F2A; Mon, 8 Aug 2016 07:25:47 +0000 (UTC) Date: Mon, 8 Aug 2016 07:25:47 +0000 From: Brooks Davis To: Xin Li Cc: Warner Losh , Andrey Chernov , d@delphij.net, Peter Jeremy , Bruce Simpson , Oliver Pinter , Dag-Erling Sm??rgrav , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Subject: Re: svn commit: r303716 - head/crypto/openssh Message-ID: <20160808072547.GA19715@spindle.one-eyed-alien.net> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> User-Agent: Mutt/1.6.1 (2016-04-27) X-Mailman-Approved-At: Mon, 08 Aug 2016 11:11:57 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 07:25:50 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 07, 2016 at 03:48:44PM -0700, Xin Li wrote: >=20 >=20 > On 8/7/16 14:20, Warner Losh wrote: > >=20 > >> On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: > >> > >>> OTOH, FreeBSD has a documented deprecation process that says things w= ill > >>> continue working for a major release after being formally deprecated. > >> > >> FreeBSD 11 is not released yet (betas are not counted), stable-10 too, > >> so it is right time to deprecate for them. > >=20 > > Nice try, but feature freeze was months ago. Have you got buy in from t= he > > security officer and the release engineer? >=20 > Well, despite the fact that I have to admit that I get locked out from > my own storage box too, however (even without wearing any hat) I am for > the change and would blame myself for being lazy in adopting the change > when the upstream have announced it earlier about a year ago. While the timing sucks, I don't see any way around this change given our experience with the HPN patches and that upstream plans to kill this feature, we must not ship 11 with support enabled. There's just no practical way to keep adding back a feature for 4-5 years. -- Brooks --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXqDP7AAoJEKzQXbSebgfAGvsH/0LBO+VI9zzcdokhypu3CT9A 1TXQ2yATfgp4/JluAlpePm23EwtJIIoDUWUN1nCH6UemAR9nqgtiPgA36Y+FRBRI sBid+Hn7xxKBIUf/D/7PTLeC+X35ZS7wxoy+Vs9NXid/OAR82AlnlMrPmWIYhwAO x3nSloxwwk3aOQTkoxB+CxWaZqQpvMr166yJBKKcx46Nu5nhxK12iKQRUBhqjP4N XB2yBNa+qnrjdDJoCcx562nQyv5AyDhJeWgrZnouD7rU5gAKMWcQ3U0Ke8KEm8Uz LAq5EUlSz6bcnEEUE9l02eaOabFq4CmSCl35V5Db6CT01XMPg4JkHuri0NjKT7k= =n60g -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP-- From owner-svn-src-head@freebsd.org Mon Aug 8 10:42:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F165ABB2F91; Mon, 8 Aug 2016 10:42:21 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B21441D85; Mon, 8 Aug 2016 10:42:21 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id ADA4927E3; Mon, 8 Aug 2016 10:42:20 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id B3FCC4C98; Mon, 8 Aug 2016 12:41:30 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh Cc: Andrey Chernov , Peter Jeremy , Bruce Simpson , Oliver Pinter , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, FreeBSD Security Team , FreeBSD Release Engineering Team Subject: Re: svn commit: r303716 - head/crypto/openssh References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> Date: Mon, 08 Aug 2016 12:41:30 +0200 In-Reply-To: <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> (Warner Losh's message of "Sun, 7 Aug 2016 15:20:05 -0600") Message-ID: <86shufv8yt.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Mon, 08 Aug 2016 11:12:09 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 10:42:22 -0000 Warner Losh writes: > Andrey Chernov writes: > > FreeBSD 11 is not released yet (betas are not counted), stable-10 too, > > so it is right time to deprecate for them. > Nice try, but feature freeze was months ago. Have you got buy in from the > security officer and the release engineer? > > I didn=E2=80=99t think so... You have absolutely *no* basis for this claim, and I would like you to retract it. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Mon Aug 8 13:15:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D8A2BB04B4; Mon, 8 Aug 2016 13:15:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA16131C; Mon, 8 Aug 2016 13:15:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78DFcTt082152; Mon, 8 Aug 2016 13:15:38 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78DFc1r082149; Mon, 8 Aug 2016 13:15:38 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608081315.u78DFc1r082149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 8 Aug 2016 13:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303833 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 13:15:39 -0000 Author: ed Date: Mon Aug 8 13:15:37 2016 New Revision: 303833 URL: https://svnweb.freebsd.org/changeset/base/303833 Log: Import vDSO-related source files from the CloudABI repository. CloudABI executables that are emulated on Mac OS X do not invoke system calls through "syscall". Instead, they make use of a vDSO that is provided by the emulator that provides symbols for all of the system call routines. The emulator can implement these any way it likes. At some point in time we want to do this for native execution as well, so that CloudABI executables are entirely oblivious of how system calls need to be performed. They will simply call into functions and let that deal with all of the details. These source files can be used to generate a simple vDSO that does nothing more than invoke "syscall". All we need to do now is map it into the processes. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/cloudabi_types.h (contents, props changed) head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c (contents, props changed) head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.c (contents, props changed) Added: head/sys/contrib/cloudabi/cloudabi_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_types.h Mon Aug 8 13:15:37 2016 (r303833) @@ -0,0 +1,273 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// 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. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#ifndef CLOUDABI_TYPES_H +#define CLOUDABI_TYPES_H + +#include "cloudabi_types_common.h" + +typedef struct { + _Alignas(4) cloudabi_auxtype_t a_type; + union { + size_t a_val; + void *a_ptr; + }; +} cloudabi_auxv_t; +_Static_assert(offsetof(cloudabi_auxv_t, a_type) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_val) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_val) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_ptr) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_ptr) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_auxv_t) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_auxv_t) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_auxv_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_auxv_t) == 8, "Incorrect layout"); + +typedef struct { + const void *iov_base; + size_t iov_len; +} cloudabi_ciovec_t; +_Static_assert(offsetof(cloudabi_ciovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_ciovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_ciovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_ciovec_t) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_ciovec_t) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_ciovec_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_ciovec_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + } clock; + struct { + _Atomic(cloudabi_condvar_t) *condvar; + } condvar; + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Atomic(cloudabi_lock_t) *lock; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; +} cloudabi_event_t; +_Static_assert(offsetof(cloudabi_event_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, error) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.signal) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(sizeof(cloudabi_event_t) == 32, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi_event_t) == 8, "Incorrect layout"); + +typedef struct { + void *iov_base; + size_t iov_len; +} cloudabi_iovec_t; +_Static_assert(offsetof(cloudabi_iovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_iovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_iovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_iovec_t) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_iovec_t) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_iovec_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_iovec_t) == 8, "Incorrect layout"); + +typedef void cloudabi_processentry_t(const cloudabi_auxv_t *auxv); + +typedef struct { + const cloudabi_iovec_t *ri_data; + size_t ri_datalen; + cloudabi_fd_t *ri_fds; + size_t ri_fdslen; + _Alignas(2) cloudabi_msgflags_t ri_flags; +} cloudabi_recv_in_t; +_Static_assert(offsetof(cloudabi_recv_in_t, ri_data) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_datalen) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_datalen) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_fds) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_fds) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_fdslen) == 12, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_fdslen) == 24, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_flags) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_flags) == 32, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_in_t) == 20, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_in_t) == 40, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_in_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_in_t) == 8, "Incorrect layout"); + +typedef struct { + const cloudabi_ciovec_t *si_data; + size_t si_datalen; + const cloudabi_fd_t *si_fds; + size_t si_fdslen; + _Alignas(2) cloudabi_msgflags_t si_flags; +} cloudabi_send_in_t; +_Static_assert(offsetof(cloudabi_send_in_t, si_data) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_datalen) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_datalen) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_fds) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_fds) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_fdslen) == 12, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_fdslen) == 24, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_flags) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_flags) == 32, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_in_t) == 20, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_in_t) == 40, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_in_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_in_t) == 8, "Incorrect layout"); + +typedef struct { + size_t so_datalen; +} cloudabi_send_out_t; +_Static_assert(offsetof(cloudabi_send_out_t, so_datalen) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_out_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_out_t) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_out_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_out_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_subflags_t flags; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + _Alignas(4) cloudabi_clockid_t clock_id; + _Alignas(8) cloudabi_timestamp_t timeout; + _Alignas(8) cloudabi_timestamp_t precision; + _Alignas(2) cloudabi_subclockflags_t flags; + } clock; + struct { + _Atomic(cloudabi_condvar_t) *condvar; + _Atomic(cloudabi_lock_t) *lock; + _Alignas(1) cloudabi_scope_t condvar_scope; + _Alignas(1) cloudabi_scope_t lock_scope; + } condvar; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_subrwflags_t flags; + } fd_readwrite; + struct { + _Atomic(cloudabi_lock_t) *lock; + _Alignas(1) cloudabi_scope_t lock_scope; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + } proc_terminate; + }; +} cloudabi_subscription_t; +_Static_assert(offsetof(cloudabi_subscription_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, flags) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, clock.clock_id) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, clock.timeout) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, clock.precision) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, clock.flags) == 48, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.lock) == 20, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.lock) == 24, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.condvar_scope) == 24, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.lock_scope) == 25, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.lock_scope) == 33, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, lock.lock_scope) == 20, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, lock.lock_scope) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_subscription_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(sizeof(cloudabi_subscription_t) == 56, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi_subscription_t) == 8, "Incorrect layout"); + +typedef struct { + void *parent; +} cloudabi_tcb_t; +_Static_assert(offsetof(cloudabi_tcb_t, parent) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_tcb_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_tcb_t) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_tcb_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_tcb_t) == 8, "Incorrect layout"); + +typedef void cloudabi_threadentry_t(cloudabi_tid_t tid, void *aux); + +typedef struct { + size_t ro_datalen; + size_t ro_fdslen; + _Alignas(2) cloudabi_sockaddr_t ro_sockname; + _Alignas(2) cloudabi_sockaddr_t ro_peername; + _Alignas(2) cloudabi_msgflags_t ro_flags; +} cloudabi_recv_out_t; +_Static_assert(offsetof(cloudabi_recv_out_t, ro_datalen) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_fdslen) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_fdslen) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_sockname) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_sockname) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_peername) == 28, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_peername) == 36, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_flags) == 48, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_flags) == 56, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_out_t) == 52, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_out_t) == 64, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_out_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_out_t) == 8, "Incorrect layout"); + +typedef struct { + cloudabi_threadentry_t *entry_point; + void *stack; + size_t stack_size; + void *argument; +} cloudabi_threadattr_t; +_Static_assert(offsetof(cloudabi_threadattr_t, entry_point) == 0, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, stack) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, stack) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, stack_size) == 8, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, stack_size) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, argument) == 12, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, argument) == 24, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_threadattr_t) == 16, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_threadattr_t) == 32, "Incorrect layout"); +_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_threadattr_t) == 4, "Incorrect layout"); +_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_threadattr_t) == 8, "Incorrect layout"); + +#endif Added: head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c Mon Aug 8 13:15:37 2016 (r303833) @@ -0,0 +1,1610 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// 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. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#include + +cloudabi_errno_t +cloudabi_sys_clock_res_get( + cloudabi_clockid_t clock_id, + cloudabi_timestamp_t *resolution +) { + register uint64_t reg_x8 asm("x8") = 0; + register uint64_t reg_x0 asm("x0") = (uint64_t)clock_id; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *resolution = (cloudabi_timestamp_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_clock_time_get( + cloudabi_clockid_t clock_id, + cloudabi_timestamp_t precision, + cloudabi_timestamp_t *time +) { + register uint64_t reg_x8 asm("x8") = 1; + register uint64_t reg_x0 asm("x0") = (uint64_t)clock_id; + register uint64_t reg_x1 asm("x1") = (uint64_t)precision; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *time = (cloudabi_timestamp_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_condvar_signal( + _Atomic(cloudabi_condvar_t) *condvar, + cloudabi_scope_t scope, + cloudabi_nthreads_t nwaiters +) { + register uint64_t reg_x8 asm("x8") = 2; + register uint64_t reg_x0 asm("x0") = (uint64_t)condvar; + register uint64_t reg_x1 asm("x1") = (uint64_t)scope; + register uint64_t reg_x2 asm("x2") = (uint64_t)nwaiters; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_close( + cloudabi_fd_t fd +) { + register uint64_t reg_x8 asm("x8") = 3; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_create1( + cloudabi_filetype_t type, + cloudabi_fd_t *fd +) { + register uint64_t reg_x8 asm("x8") = 4; + register uint64_t reg_x0 asm("x0") = (uint64_t)type; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *fd = (cloudabi_fd_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_create2( + cloudabi_filetype_t type, + cloudabi_fd_t *fd1, + cloudabi_fd_t *fd2 +) { + register uint64_t reg_x8 asm("x8") = 5; + register uint64_t reg_x0 asm("x0") = (uint64_t)type; + register uint64_t reg_x1 asm("x1"); + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + , "=r"(reg_x1) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *fd1 = (cloudabi_fd_t)reg_x0; + *fd2 = (cloudabi_fd_t)reg_x1; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_datasync( + cloudabi_fd_t fd +) { + register uint64_t reg_x8 asm("x8") = 6; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_dup( + cloudabi_fd_t from, + cloudabi_fd_t *fd +) { + register uint64_t reg_x8 asm("x8") = 7; + register uint64_t reg_x0 asm("x0") = (uint64_t)from; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *fd = (cloudabi_fd_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_pread( + cloudabi_fd_t fd, + const cloudabi_iovec_t *iov, + size_t iovcnt, + cloudabi_filesize_t offset, + size_t *nread +) { + register uint64_t reg_x8 asm("x8") = 8; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)iov; + register uint64_t reg_x2 asm("x2") = (uint64_t)iovcnt; + register uint64_t reg_x3 asm("x3") = (uint64_t)offset; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *nread = (size_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_pwrite( + cloudabi_fd_t fd, + const cloudabi_ciovec_t *iov, + size_t iovcnt, + cloudabi_filesize_t offset, + size_t *nwritten +) { + register uint64_t reg_x8 asm("x8") = 9; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)iov; + register uint64_t reg_x2 asm("x2") = (uint64_t)iovcnt; + register uint64_t reg_x3 asm("x3") = (uint64_t)offset; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *nwritten = (size_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_read( + cloudabi_fd_t fd, + const cloudabi_iovec_t *iov, + size_t iovcnt, + size_t *nread +) { + register uint64_t reg_x8 asm("x8") = 10; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)iov; + register uint64_t reg_x2 asm("x2") = (uint64_t)iovcnt; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *nread = (size_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_replace( + cloudabi_fd_t from, + cloudabi_fd_t to +) { + register uint64_t reg_x8 asm("x8") = 11; + register uint64_t reg_x0 asm("x0") = (uint64_t)from; + register uint64_t reg_x1 asm("x1") = (uint64_t)to; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_seek( + cloudabi_fd_t fd, + cloudabi_filedelta_t offset, + cloudabi_whence_t whence, + cloudabi_filesize_t *newoffset +) { + register uint64_t reg_x8 asm("x8") = 12; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)offset; + register uint64_t reg_x2 asm("x2") = (uint64_t)whence; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *newoffset = (cloudabi_filesize_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_stat_get( + cloudabi_fd_t fd, + cloudabi_fdstat_t *buf +) { + register uint64_t reg_x8 asm("x8") = 13; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)buf; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_stat_put( + cloudabi_fd_t fd, + const cloudabi_fdstat_t *buf, + cloudabi_fdsflags_t flags +) { + register uint64_t reg_x8 asm("x8") = 14; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)buf; + register uint64_t reg_x2 asm("x2") = (uint64_t)flags; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_sync( + cloudabi_fd_t fd +) { + register uint64_t reg_x8 asm("x8") = 15; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_fd_write( + cloudabi_fd_t fd, + const cloudabi_ciovec_t *iov, + size_t iovcnt, + size_t *nwritten +) { + register uint64_t reg_x8 asm("x8") = 16; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)iov; + register uint64_t reg_x2 asm("x2") = (uint64_t)iovcnt; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *nwritten = (size_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_advise( + cloudabi_fd_t fd, + cloudabi_filesize_t offset, + cloudabi_filesize_t len, + cloudabi_advice_t advice +) { + register uint64_t reg_x8 asm("x8") = 17; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)offset; + register uint64_t reg_x2 asm("x2") = (uint64_t)len; + register uint64_t reg_x3 asm("x3") = (uint64_t)advice; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_allocate( + cloudabi_fd_t fd, + cloudabi_filesize_t offset, + cloudabi_filesize_t len +) { + register uint64_t reg_x8 asm("x8") = 18; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)offset; + register uint64_t reg_x2 asm("x2") = (uint64_t)len; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_create( + cloudabi_fd_t fd, + const char *path, + size_t pathlen, + cloudabi_filetype_t type +) { + register uint64_t reg_x8 asm("x8") = 19; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)path; + register uint64_t reg_x2 asm("x2") = (uint64_t)pathlen; + register uint64_t reg_x3 asm("x3") = (uint64_t)type; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_link( + cloudabi_lookup_t fd1, + const char *path1, + size_t path1len, + cloudabi_fd_t fd2, + const char *path2, + size_t path2len +) { + register uint64_t reg_x8 asm("x8") = 20; + register uint64_t reg_x0 asm("x0") = *(uint64_t *)&fd1; + register uint64_t reg_x1 asm("x1") = (uint64_t)path1; + register uint64_t reg_x2 asm("x2") = (uint64_t)path1len; + register uint64_t reg_x3 asm("x3") = (uint64_t)fd2; + register uint64_t reg_x4 asm("x4") = (uint64_t)path2; + register uint64_t reg_x5 asm("x5") = (uint64_t)path2len; + asm volatile ( + "\tsvc 0\n" + : "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + , "r"(reg_x4) + , "r"(reg_x5) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_open( + cloudabi_lookup_t dirfd, + const char *path, + size_t pathlen, + cloudabi_oflags_t oflags, + const cloudabi_fdstat_t *fds, + cloudabi_fd_t *fd +) { + register uint64_t reg_x8 asm("x8") = 21; + register uint64_t reg_x0 asm("x0") = *(uint64_t *)&dirfd; + register uint64_t reg_x1 asm("x1") = (uint64_t)path; + register uint64_t reg_x2 asm("x2") = (uint64_t)pathlen; + register uint64_t reg_x3 asm("x3") = (uint64_t)oflags; + register uint64_t reg_x4 asm("x4") = (uint64_t)fds; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + , "r"(reg_x4) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *fd = (cloudabi_fd_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_readdir( + cloudabi_fd_t fd, + void *buf, + size_t nbyte, + cloudabi_dircookie_t cookie, + size_t *bufused +) { + register uint64_t reg_x8 asm("x8") = 22; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)buf; + register uint64_t reg_x2 asm("x2") = (uint64_t)nbyte; + register uint64_t reg_x3 asm("x3") = (uint64_t)cookie; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *bufused = (size_t)reg_x0; + return 0; + } + return reg_x0; +} + +cloudabi_errno_t +cloudabi_sys_file_readlink( + cloudabi_fd_t fd, + const char *path, + size_t pathlen, + char *buf, + size_t bufsize, + size_t *bufused +) { + register uint64_t reg_x8 asm("x8") = 23; + register uint64_t reg_x0 asm("x0") = (uint64_t)fd; + register uint64_t reg_x1 asm("x1") = (uint64_t)path; + register uint64_t reg_x2 asm("x2") = (uint64_t)pathlen; + register uint64_t reg_x3 asm("x3") = (uint64_t)buf; + register uint64_t reg_x4 asm("x4") = (uint64_t)bufsize; + register uint64_t okay; + asm volatile ( + "\tsvc 0\n" + "\tcset %0, cc\n" + : "=r"(okay) + , "=r"(reg_x0) + : "r"(reg_x8) + , "r"(reg_x0) + , "r"(reg_x1) + , "r"(reg_x2) + , "r"(reg_x3) + , "r"(reg_x4) + : "memory" + , "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7" + , "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15" + , "x16", "x17", "x18" + , "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); + if (okay) { + *bufused = (size_t)reg_x0; + return 0; + } + return reg_x0; +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 8 13:52:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76B3BB1233; Mon, 8 Aug 2016 13:52:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CBC11996; Mon, 8 Aug 2016 13:52:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78DqIen098789; Mon, 8 Aug 2016 13:52:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78DqIo4098788; Mon, 8 Aug 2016 13:52:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608081352.u78DqIo4098788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 8 Aug 2016 13:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303834 - 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.22 Precedence: list List-Id: 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, 08 Aug 2016 13:52:19 -0000 Author: tuexen Date: Mon Aug 8 13:52:18 2016 New Revision: 303834 URL: https://svnweb.freebsd.org/changeset/base/303834 Log: Fix the sending of FORWARD-TSN and I-FORWARD-TSN chunks. The last SID/SSN pair wasn't filled in. Thanks to Julian Cordes for providing a packetdrill script triggering the issue and making me aware of the bug. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Aug 8 13:15:37 2016 (r303833) +++ head/sys/netinet/sctp_output.c Mon Aug 8 13:52:18 2016 (r303834) @@ -10258,9 +10258,14 @@ void send_forward_tsn(struct sctp_tcb *stcb, struct sctp_association *asoc) { - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *at, *tp1, *last; struct sctp_forward_tsn_chunk *fwdtsn; + struct sctp_strseq *strseq; + struct sctp_strseq_mid *strseq_m; uint32_t advance_peer_ack_point; + unsigned int cnt_of_space, i, ovh; + unsigned int space_needed; + unsigned int cnt_of_skipped = 0; int old; if (asoc->idata_supported) { @@ -10315,165 +10320,155 @@ sctp_fill_in_rest: * stream/seq of the ones we skip. */ SCTP_BUF_LEN(chk->data) = 0; - { - struct sctp_tmit_chunk *at, *tp1, *last; - struct sctp_strseq *strseq; - struct sctp_strseq_mid *strseq_m; - unsigned int cnt_of_space, i, ovh; - unsigned int space_needed; - unsigned int cnt_of_skipped = 0; - - TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { - if ((at->sent != SCTP_FORWARD_TSN_SKIP) && - (at->sent != SCTP_DATAGRAM_NR_ACKED)) { - /* no more to look at */ - break; - } - if ((at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) && old) { - /* We don't report these */ - continue; - } - cnt_of_skipped++; + TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { + if ((at->sent != SCTP_FORWARD_TSN_SKIP) && + (at->sent != SCTP_DATAGRAM_NR_ACKED)) { + /* no more to look at */ + break; } - if (old) { - space_needed = (sizeof(struct sctp_forward_tsn_chunk) + - (cnt_of_skipped * sizeof(struct sctp_strseq))); - } else { - space_needed = (sizeof(struct sctp_forward_tsn_chunk) + - (cnt_of_skipped * sizeof(struct sctp_strseq_mid))); + if (old && (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* We don't report these */ + continue; } - cnt_of_space = (unsigned int)M_TRAILINGSPACE(chk->data); + cnt_of_skipped++; + } + if (old) { + space_needed = (sizeof(struct sctp_forward_tsn_chunk) + + (cnt_of_skipped * sizeof(struct sctp_strseq))); + } else { + space_needed = (sizeof(struct sctp_forward_tsn_chunk) + + (cnt_of_skipped * sizeof(struct sctp_strseq_mid))); + } + cnt_of_space = (unsigned int)M_TRAILINGSPACE(chk->data); - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ovh = SCTP_MIN_OVERHEAD; - } else { - ovh = SCTP_MIN_V4_OVERHEAD; - } - if (cnt_of_space > (asoc->smallest_mtu - ovh)) { - /* trim to a mtu size */ - cnt_of_space = asoc->smallest_mtu - ovh; - } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ovh = SCTP_MIN_OVERHEAD; + } else { + ovh = SCTP_MIN_V4_OVERHEAD; + } + if (cnt_of_space > (asoc->smallest_mtu - ovh)) { + /* trim to a mtu size */ + cnt_of_space = asoc->smallest_mtu - ovh; + } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { + sctp_misc_ints(SCTP_FWD_TSN_CHECK, + 0xff, 0, cnt_of_skipped, + asoc->advanced_peer_ack_point); + } + advance_peer_ack_point = asoc->advanced_peer_ack_point; + if (cnt_of_space < space_needed) { + /*- + * ok we must trim down the chunk by lowering the + * advance peer ack point. + */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, - 0xff, 0, cnt_of_skipped, - asoc->advanced_peer_ack_point); - + 0xff, 0xff, cnt_of_space, + space_needed); } - advance_peer_ack_point = asoc->advanced_peer_ack_point; - if (cnt_of_space < space_needed) { - /*- - * ok we must trim down the chunk by lowering the - * advance peer ack point. - */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { - sctp_misc_ints(SCTP_FWD_TSN_CHECK, - 0xff, 0xff, cnt_of_space, - space_needed); - } - if (old) { - cnt_of_skipped = cnt_of_space - sizeof(struct sctp_forward_tsn_chunk); - cnt_of_skipped /= sizeof(struct sctp_strseq); - } else { - cnt_of_skipped = cnt_of_space - sizeof(struct sctp_forward_tsn_chunk); - cnt_of_skipped /= sizeof(struct sctp_strseq_mid); - } - /*- - * Go through and find the TSN that will be the one - * we report. - */ - at = TAILQ_FIRST(&asoc->sent_queue); - if (at != NULL) { - for (i = 0; i < cnt_of_skipped; i++) { - tp1 = TAILQ_NEXT(at, sctp_next); - if (tp1 == NULL) { - break; - } - at = tp1; + if (old) { + cnt_of_skipped = cnt_of_space - sizeof(struct sctp_forward_tsn_chunk); + cnt_of_skipped /= sizeof(struct sctp_strseq); + } else { + cnt_of_skipped = cnt_of_space - sizeof(struct sctp_forward_tsn_chunk); + cnt_of_skipped /= sizeof(struct sctp_strseq_mid); + } + /*- + * Go through and find the TSN that will be the one + * we report. + */ + at = TAILQ_FIRST(&asoc->sent_queue); + if (at != NULL) { + for (i = 0; i < cnt_of_skipped; i++) { + tp1 = TAILQ_NEXT(at, sctp_next); + if (tp1 == NULL) { + break; } - } - if (at && SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { - sctp_misc_ints(SCTP_FWD_TSN_CHECK, - 0xff, cnt_of_skipped, at->rec.data.TSN_seq, - asoc->advanced_peer_ack_point); - } - last = at; - /*- - * last now points to last one I can report, update - * peer ack point - */ - if (last) - advance_peer_ack_point = last->rec.data.TSN_seq; - if (old) { - space_needed = sizeof(struct sctp_forward_tsn_chunk) + - cnt_of_skipped * sizeof(struct sctp_strseq); - } else { - space_needed = sizeof(struct sctp_forward_tsn_chunk) + - cnt_of_skipped * sizeof(struct sctp_strseq_mid); + at = tp1; } } - chk->send_size = space_needed; - /* Setup the chunk */ - fwdtsn = mtod(chk->data, struct sctp_forward_tsn_chunk *); - fwdtsn->ch.chunk_length = htons(chk->send_size); - fwdtsn->ch.chunk_flags = 0; - if (old) { - fwdtsn->ch.chunk_type = SCTP_FORWARD_CUM_TSN; - } else { - fwdtsn->ch.chunk_type = SCTP_IFORWARD_CUM_TSN; + if (at && SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { + sctp_misc_ints(SCTP_FWD_TSN_CHECK, + 0xff, cnt_of_skipped, at->rec.data.TSN_seq, + asoc->advanced_peer_ack_point); } - fwdtsn->new_cumulative_tsn = htonl(advance_peer_ack_point); - SCTP_BUF_LEN(chk->data) = chk->send_size; - fwdtsn++; + last = at; /*- - * Move pointer to after the fwdtsn and transfer to the - * strseq pointer. + * last now points to last one I can report, update + * peer ack point */ + if (last) { + advance_peer_ack_point = last->rec.data.TSN_seq; + } if (old) { - strseq = (struct sctp_strseq *)fwdtsn; + space_needed = sizeof(struct sctp_forward_tsn_chunk) + + cnt_of_skipped * sizeof(struct sctp_strseq); } else { - strseq_m = (struct sctp_strseq_mid *)fwdtsn; + space_needed = sizeof(struct sctp_forward_tsn_chunk) + + cnt_of_skipped * sizeof(struct sctp_strseq_mid); } - /*- - * Now populate the strseq list. This is done blindly - * without pulling out duplicate stream info. This is - * inefficent but won't harm the process since the peer will - * look at these in sequence and will thus release anything. - * It could mean we exceed the PMTU and chop off some that - * we could have included.. but this is unlikely (aka 1432/4 - * would mean 300+ stream seq's would have to be reported in - * one FWD-TSN. With a bit of work we can later FIX this to - * optimize and pull out duplcates.. but it does add more - * overhead. So for now... not! - */ - at = TAILQ_FIRST(&asoc->sent_queue); - for (i = 0; i < cnt_of_skipped; i++) { - tp1 = TAILQ_NEXT(at, sctp_next); - if (tp1 == NULL) - break; - if (old && (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { - /* We don't report these */ - i--; - at = tp1; - continue; - } - if (at->rec.data.TSN_seq == advance_peer_ack_point) { - at->rec.data.fwd_tsn_cnt = 0; - } - if (old) { - strseq->stream = ntohs(at->rec.data.stream_number); - strseq->sequence = ntohs(at->rec.data.stream_seq); - strseq++; + } + chk->send_size = space_needed; + /* Setup the chunk */ + fwdtsn = mtod(chk->data, struct sctp_forward_tsn_chunk *); + fwdtsn->ch.chunk_length = htons(chk->send_size); + fwdtsn->ch.chunk_flags = 0; + if (old) { + fwdtsn->ch.chunk_type = SCTP_FORWARD_CUM_TSN; + } else { + fwdtsn->ch.chunk_type = SCTP_IFORWARD_CUM_TSN; + } + fwdtsn->new_cumulative_tsn = htonl(advance_peer_ack_point); + SCTP_BUF_LEN(chk->data) = chk->send_size; + fwdtsn++; + /*- + * Move pointer to after the fwdtsn and transfer to the + * strseq pointer. + */ + if (old) { + strseq = (struct sctp_strseq *)fwdtsn; + } else { + strseq_m = (struct sctp_strseq_mid *)fwdtsn; + } + /*- + * Now populate the strseq list. This is done blindly + * without pulling out duplicate stream info. This is + * inefficent but won't harm the process since the peer will + * look at these in sequence and will thus release anything. + * It could mean we exceed the PMTU and chop off some that + * we could have included.. but this is unlikely (aka 1432/4 + * would mean 300+ stream seq's would have to be reported in + * one FWD-TSN. With a bit of work we can later FIX this to + * optimize and pull out duplicates.. but it does add more + * overhead. So for now... not! + */ + i = 0; + TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { + if (i >= cnt_of_skipped) { + break; + } + if (old && (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* We don't report these */ + continue; + } + if (at->rec.data.TSN_seq == advance_peer_ack_point) { + at->rec.data.fwd_tsn_cnt = 0; + } + if (old) { + strseq->stream = htons(at->rec.data.stream_number); + strseq->sequence = htons((uint16_t) at->rec.data.stream_seq); + strseq++; + } else { + strseq_m->stream = htons(at->rec.data.stream_number); + if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) { + strseq_m->flags = htons(PR_SCTP_UNORDERED_FLAG); } else { - strseq_m->stream = ntohs(at->rec.data.stream_number); - strseq_m->msg_id = ntohl(at->rec.data.stream_seq); - if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) - strseq_m->flags = ntohs(PR_SCTP_UNORDERED_FLAG); - else - strseq_m->flags = 0; - strseq_m++; + strseq_m->flags = 0; } - at = tp1; + strseq_m->msg_id = htonl(at->rec.data.stream_seq); + strseq_m++; } + i++; } return; } From owner-svn-src-head@freebsd.org Mon Aug 8 16:19:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 662C5BB122D; Mon, 8 Aug 2016 16:19:25 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 374BD1CDA; Mon, 8 Aug 2016 16:19:25 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78GJOV0052764; Mon, 8 Aug 2016 16:19:24 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78GJOCk052763; Mon, 8 Aug 2016 16:19:24 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608081619.u78GJOCk052763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 8 Aug 2016 16:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303836 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 16:19:25 -0000 Author: rstone Date: Mon Aug 8 16:19:24 2016 New Revision: 303836 URL: https://svnweb.freebsd.org/changeset/base/303836 Log: Don't enqueue NULL on a drbr In one corner case in the bxe TX path, a NULL mbuf could be enqueued onto a drbr queue. This could case a KASSERT to fire with INVARIANTS enabled, or the processing of packets from the queue to be prematurely ended later on. Submitted by: Matt Joras (matt.joras AT isilon.com) Reviewed by: davidcs MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7041 Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Aug 8 15:07:38 2016 (r303835) +++ head/sys/dev/bxe/bxe.c Mon Aug 8 16:19:24 2016 (r303836) @@ -5624,7 +5624,8 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - rc = drbr_enqueue(ifp, tx_br, m); + if (m != NULL) + rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } From owner-svn-src-head@freebsd.org Mon Aug 8 16:22:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D16BB14B8; Mon, 8 Aug 2016 16:22:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C9A1145D; Mon, 8 Aug 2016 16:22:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78GMH2B056479; Mon, 8 Aug 2016 16:22:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78GMHLT056474; Mon, 8 Aug 2016 16:22:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608081622.u78GMHLT056474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Aug 2016 16:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303837 - in head/sys: dev/mlx5/mlx5_en modules/mlx5en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 16:22:18 -0000 Author: hselasky Date: Mon Aug 8 16:22:16 2016 New Revision: 303837 URL: https://svnweb.freebsd.org/changeset/base/303837 Log: Switch to the new block based LRO input function for the mlx5en driver. This change significantly increases the overall RX aggregation ratio for heavily loaded networks handling 10-80 thousand simultaneous connections. Remove the turbo LRO code and all references to it which has now been superceeded by the tcp_lro_queue_mbuf() function. Tested by: Netflix Sponsored by: Mellanox Technologies MFC after: 1 week Deleted: head/sys/dev/mlx5/mlx5_en/tcp_tlro.c head/sys/dev/mlx5/mlx5_en/tcp_tlro.h Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/modules/mlx5en/Makefile Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Aug 8 16:19:24 2016 (r303836) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Aug 8 16:22:16 2016 (r303837) @@ -59,10 +59,6 @@ #include -#ifdef HAVE_TURBO_LRO -#include "tcp_tlro.h" -#endif - #include #include #include @@ -460,11 +456,7 @@ struct mlx5e_rq { struct ifnet *ifp; struct mlx5e_rq_stats stats; struct mlx5e_cq cq; -#ifdef HAVE_TURBO_LRO - struct tlro_ctrl lro; -#else struct lro_ctrl lro; -#endif volatile int enabled; int ix; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 8 16:19:24 2016 (r303836) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 8 16:22:16 2016 (r303837) @@ -666,10 +666,15 @@ mlx5e_create_rq(struct mlx5e_channel *c, } wq_sz = mlx5_wq_ll_get_size(&rq->wq); + + err = -tcp_lro_init_args(&rq->lro, c->ifp, TCP_LRO_ENTRIES, wq_sz); + if (err) + goto err_rq_wq_destroy; + rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); if (rq->mbuf == NULL) { err = -ENOMEM; - goto err_rq_wq_destroy; + goto err_lro_init; } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); @@ -694,20 +699,12 @@ mlx5e_create_rq(struct mlx5e_channel *c, mlx5e_create_stats(&rq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_rq_stats_desc, MLX5E_RQ_STATS_NUM, rq->stats.arg); - -#ifdef HAVE_TURBO_LRO - if (tcp_tlro_init(&rq->lro, c->ifp, MLX5E_BUDGET_MAX) != 0) - rq->lro.mbuf = NULL; -#else - if (tcp_lro_init(&rq->lro)) - rq->lro.lro_cnt = 0; - else - rq->lro.ifp = c->ifp; -#endif return (0); err_rq_mbuf_free: free(rq->mbuf, M_MLX5EN); +err_lro_init: + tcp_lro_free(&rq->lro); err_rq_wq_destroy: mlx5_wq_destroy(&rq->wq_ctrl); err_free_dma_tag: @@ -726,11 +723,8 @@ mlx5e_destroy_rq(struct mlx5e_rq *rq) sysctl_ctx_free(&rq->stats.ctx); /* free leftover LRO packets, if any */ -#ifdef HAVE_TURBO_LRO - tcp_tlro_free(&rq->lro); -#else tcp_lro_free(&rq->lro); -#endif + wq_sz = mlx5_wq_ll_get_size(&rq->wq); for (i = 0; i != wq_sz; i++) { if (rq->mbuf[i].mbuf != NULL) { Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Aug 8 16:19:24 2016 (r303836) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Aug 8 16:22:16 2016 (r303837) @@ -369,15 +369,9 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, in mlx5e_build_rx_mbuf(cqe, rq, mb, byte_cnt); rq->stats.packets++; -#ifdef HAVE_TURBO_LRO - if (mb->m_pkthdr.csum_flags == 0 || - (rq->ifp->if_capenable & IFCAP_LRO) == 0 || - rq->lro.mbuf == NULL) { - /* normal input */ - rq->ifp->if_input(rq->ifp, mb); - } else { - tcp_tlro_rx(&rq->lro, mb); - } + +#if !defined(HAVE_TCP_LRO_RX) + tcp_lro_queue_mbuf(&rq->lro, mb); #else if (mb->m_pkthdr.csum_flags == 0 || (rq->ifp->if_capenable & IFCAP_LRO) == 0 || @@ -395,9 +389,6 @@ wq_ll_pop: /* ensure cq space is freed before enabling more cqes */ wmb(); -#ifndef HAVE_TURBO_LRO - tcp_lro_flush_all(&rq->lro); -#endif return (i); } @@ -437,8 +428,6 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mc } mlx5e_post_rx_wqes(rq); mlx5e_cq_arm(&rq->cq); -#ifdef HAVE_TURBO_LRO - tcp_tlro_flush(&rq->lro, 1); -#endif + tcp_lro_flush_all(&rq->lro); mtx_unlock(&rq->mtx); } Modified: head/sys/modules/mlx5en/Makefile ============================================================================== --- head/sys/modules/mlx5en/Makefile Mon Aug 8 16:19:24 2016 (r303836) +++ head/sys/modules/mlx5en/Makefile Mon Aug 8 16:22:16 2016 (r303837) @@ -12,15 +12,14 @@ mlx5_en_txrx.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ opt_inet.h opt_inet6.h opt_rss.h -.if defined(HAVE_TURBO_LRO) -CFLAGS+= -DHAVE_TURBO_LRO -SRCS+= tcp_tlro.c -.endif - .if defined(HAVE_PER_CQ_EVENT_PACKET) CFLAGS+= -DHAVE_PER_CQ_EVENT_PACKET .endif +.if defined(HAVE_TCP_LRO_RX) +CFLAGS+= -DHAVE_TCP_LRO_RX +.endif + CFLAGS+= -I${.CURDIR}/../../ofed/include CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include From owner-svn-src-head@freebsd.org Mon Aug 8 17:57:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E6EBB390F; Mon, 8 Aug 2016 17:57:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEE1E13D5; Mon, 8 Aug 2016 17:57:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78HvPFg091477; Mon, 8 Aug 2016 17:57:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78HvPb0091476; Mon, 8 Aug 2016 17:57:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608081757.u78HvPb0091476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Aug 2016 17:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303840 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 17:57:28 -0000 Author: jhb Date: Mon Aug 8 17:57:25 2016 New Revision: 303840 URL: https://svnweb.freebsd.org/changeset/base/303840 Log: Add timer_settime tests using SIGEV_THREAD. Note that these tests should work fine on NetBSD and other systems as SIGEV_THREAD is POSIX. Differential Revision: https://reviews.freebsd.org/D7121 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c Mon Aug 8 17:53:51 2016 (r303839) +++ head/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c Mon Aug 8 17:57:25 2016 (r303840) @@ -116,6 +116,61 @@ timer_signal_create(clockid_t cid, bool ATF_REQUIRE(timer_delete(t) == 0); } +#ifdef __FreeBSD__ +static void +timer_callback(union sigval value) +{ + timer_t *tp; + + tp = value.sival_ptr; + + if (*tp == t) + fail = false; +} + +static void +timer_thread_create(clockid_t cid, bool expire) +{ + struct itimerspec tim; + struct sigevent evt; + + t = 0; + fail = true; + + (void)memset(&evt, 0, sizeof(struct sigevent)); + (void)memset(&tim, 0, sizeof(struct itimerspec)); + + /* + * Create the timer (SIGEV_THREAD). + */ + evt.sigev_notify_function = timer_callback; + evt.sigev_value.sival_ptr = &t; + evt.sigev_notify = SIGEV_THREAD; + + ATF_REQUIRE(timer_create(cid, &evt, &t) == 0); + + /* + * Start the timer. + */ + tim.it_value.tv_sec = expire ? 5 : 1; + tim.it_value.tv_nsec = 0; + + ATF_REQUIRE(timer_settime(t, 0, &tim, NULL) == 0); + + (void)sleep(2); + + if (expire) { + if (!fail) + atf_tc_fail("timer fired too soon"); + } else { + if (fail) + atf_tc_fail("timer failed to fire"); + } + + ATF_REQUIRE(timer_delete(t) == 0); +} +#endif + ATF_TC(timer_create_err); ATF_TC_HEAD(timer_create_err, tc) { @@ -198,6 +253,64 @@ ATF_TC_BODY(timer_create_mono_expire, tc timer_signal_create(CLOCK_MONOTONIC, true); } +ATF_TC(timer_thread_create_real); +ATF_TC_HEAD(timer_thread_create_real, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Checks timer_create(2) with CLOCK_REALTIME and sigevent(3), " + "SIGEV_THREAD"); +} + +#ifdef __FreeBSD__ +ATF_TC_BODY(timer_thread_create_real, tc) +{ + timer_thread_create(CLOCK_REALTIME, false); +} + +ATF_TC(timer_thread_create_mono); +ATF_TC_HEAD(timer_thread_create_mono, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Checks timer_create(2) with CLOCK_MONOTONIC and sigevent(3), " + "SIGEV_THREAD"); +} + +ATF_TC_BODY(timer_thread_create_mono, tc) +{ + timer_thread_create(CLOCK_MONOTONIC, false); +} + +ATF_TC(timer_thread_create_real_expire); +ATF_TC_HEAD(timer_thread_create_real_expire, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Checks timer_create(2) with CLOCK_REALTIME and sigevent(3), " + "SIGEV_THREAD, with expiration"); +} + +ATF_TC_BODY(timer_thread_create_real_expire, tc) +{ + timer_thread_create(CLOCK_REALTIME, true); +} + +ATF_TC(timer_thread_create_mono_expire); +ATF_TC_HEAD(timer_thread_create_mono_expire, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Checks timer_create(2) with CLOCK_MONOTONIC and sigevent(3), " + "SIGEV_THREAD, with expiration"); +} + +ATF_TC_BODY(timer_thread_create_mono_expire, tc) +{ + timer_thread_create(CLOCK_MONOTONIC, true); +} +#endif + ATF_TP_ADD_TCS(tp) { @@ -206,6 +319,12 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, timer_create_mono); ATF_TP_ADD_TC(tp, timer_create_real_expire); ATF_TP_ADD_TC(tp, timer_create_mono_expire); +#ifdef __FreeBSD__ + ATF_TP_ADD_TC(tp, timer_thread_create_real); + ATF_TP_ADD_TC(tp, timer_thread_create_mono); + ATF_TP_ADD_TC(tp, timer_thread_create_real_expire); + ATF_TP_ADD_TC(tp, timer_thread_create_mono_expire); +#endif return atf_no_error(); } From owner-svn-src-head@freebsd.org Mon Aug 8 18:00:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F86BB3BBA; Mon, 8 Aug 2016 18:00:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77B9D1960; Mon, 8 Aug 2016 18:00:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78HxxgE091606; Mon, 8 Aug 2016 17:59:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78Hxx3Z091605; Mon, 8 Aug 2016 17:59:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608081759.u78Hxx3Z091605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 8 Aug 2016 17:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303841 - head/lib/msun/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.22 Precedence: list List-Id: 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, 08 Aug 2016 18:00:00 -0000 Author: bdrewery Date: Mon Aug 8 17:59:59 2016 New Revision: 303841 URL: https://svnweb.freebsd.org/changeset/base/303841 Log: Revert r298434 which should be fixed by r301287, r301394, and r301403. PR: 208703, 208963 Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Mon Aug 8 17:57:25 2016 (r303840) +++ head/lib/msun/tests/Makefile Mon Aug 8 17:59:59 2016 (r303841) @@ -50,15 +50,9 @@ TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test TAP_TESTS_C+= fma_test # clang 3.8.0 fails always fails this test. See: bug 208703 -# -# XXX: depending on this compiler version check doesn't work at -# buildworld/installworld time, which results in jenkins failures (bug 208963) -# because the build is run on a 10.x instance, which has an older clang -# compiler. -# -#.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800) -#TAP_TESTS_C+= fmaxmin_test -#.endif +.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800) +TAP_TESTS_C+= fmaxmin_test +.endif TAP_TESTS_C+= ilogb_test TAP_TESTS_C+= invtrig_test TAP_TESTS_C+= invctrig_test From owner-svn-src-head@freebsd.org Mon Aug 8 18:03:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC4C9BB3D4C; Mon, 8 Aug 2016 18:03:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE00E1E7A; Mon, 8 Aug 2016 18:03:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AD5D3B922; Mon, 8 Aug 2016 14:03:43 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303840 - head/contrib/netbsd-tests/lib/libc/sys Date: Mon, 08 Aug 2016 11:03:34 -0700 Message-ID: <2108671.UOctzx3g6b@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608081757.u78HvPb0091476@repo.freebsd.org> References: <201608081757.u78HvPb0091476@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 08 Aug 2016 14:03:43 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 18:03:44 -0000 On Monday, August 08, 2016 05:57:25 PM John Baldwin wrote: > Author: jhb > Date: Mon Aug 8 17:57:25 2016 > New Revision: 303840 > URL: https://svnweb.freebsd.org/changeset/base/303840 > > Log: > Add timer_settime tests using SIGEV_THREAD. > > Note that these tests should work fine on NetBSD and other systems as > SIGEV_THREAD is POSIX. I primarily cared about this as a I needed a program that used SIGEV_THREAD to test SIGLIBRT changes to gdb (we had a patch in the port to pass SIGLIBRT by default, now it is uptreamed). It was simplest to extend this test to add SIGEV_THREAD tests (and now we have some sort of basic testing for SIGEV_THREAD as a bonus). -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 8 18:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A746BB3E9E; Mon, 8 Aug 2016 18:10:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8B614EA; Mon, 8 Aug 2016 18:10:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78IAUPH096095; Mon, 8 Aug 2016 18:10:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78IAUQ4096094; Mon, 8 Aug 2016 18:10:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608081810.u78IAUQ4096094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 8 Aug 2016 18:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303842 - head/sbin/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.22 Precedence: list List-Id: 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, 08 Aug 2016 18:10:31 -0000 Author: ae Date: Mon Aug 8 18:10:30 2016 New Revision: 303842 URL: https://svnweb.freebsd.org/changeset/base/303842 Log: Fix constructing of setdscp opcode with tablearg keyword. setdscp's argument can have zero value that conflicts with IP_FW_TARG value. Always set high-order bit if parser doesn't find tablearg keyword. MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Aug 8 17:59:59 2016 (r303841) +++ head/sbin/ipfw/ipfw2.c Mon Aug 8 18:10:30 2016 (r303842) @@ -3957,15 +3957,19 @@ chkarg: NEED1("missing DSCP code"); if (_substrcmp(*av, "tablearg") == 0) { action->arg1 = IP_FW_TARG; - } else if (isalpha(*av[0])) { - if ((code = match_token(f_ipdscp, *av)) == -1) - errx(EX_DATAERR, "Unknown DSCP code"); - action->arg1 = code; - } else - action->arg1 = strtoul(*av, NULL, 10); - /* Add high-order bit to DSCP to make room for tablearg */ - if (action->arg1 != IP_FW_TARG) + } else { + if (isalpha(*av[0])) { + if ((code = match_token(f_ipdscp, *av)) == -1) + errx(EX_DATAERR, "Unknown DSCP code"); + action->arg1 = code; + } else + action->arg1 = strtoul(*av, NULL, 10); + /* + * Add high-order bit to DSCP to make room + * for tablearg + */ action->arg1 |= 0x8000; + } av++; break; } From owner-svn-src-head@freebsd.org Mon Aug 8 18:13:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C662EBB22E0; Mon, 8 Aug 2016 18:13:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966E71B83; Mon, 8 Aug 2016 18:13:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78ID3Y9099513; Mon, 8 Aug 2016 18:13:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78ID3JL099512; Mon, 8 Aug 2016 18:13:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608081813.u78ID3JL099512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 8 Aug 2016 18:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303844 - 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.22 Precedence: list List-Id: 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, 08 Aug 2016 18:13:04 -0000 Author: bdrewery Date: Mon Aug 8 18:13:03 2016 New Revision: 303844 URL: https://svnweb.freebsd.org/changeset/base/303844 Log: make world: Allow installworld to be ran in parallel. This has been safe for a while. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Aug 8 18:10:59 2016 (r303843) +++ head/Makefile Mon Aug 8 18:13:03 2016 (r303844) @@ -315,7 +315,7 @@ world: upgrade_checks .PHONY ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world .endif ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld - ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld + ${_+_}@cd ${.CURDIR}; ${_MAKE} installworld MK_META_MODE=no .if target(post-world) @echo @echo "--------------------------------------------------------------" From owner-svn-src-head@freebsd.org Mon Aug 8 18:30:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DADABB2BD1; Mon, 8 Aug 2016 18:30:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30AD51E7D; Mon, 8 Aug 2016 18:30:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78IUo3U003862; Mon, 8 Aug 2016 18:30:50 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78IUowZ003861; Mon, 8 Aug 2016 18:30:50 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608081830.u78IUowZ003861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 8 Aug 2016 18:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303845 - head/sbin/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.22 Precedence: list List-Id: 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, 08 Aug 2016 18:30:51 -0000 Author: ae Date: Mon Aug 8 18:30:50 2016 New Revision: 303845 URL: https://svnweb.freebsd.org/changeset/base/303845 Log: Fix formatting of setfib opcode. Zero fib is correct value and it conflicts with IP_FW_TARG. Use bprint_uint_arg() only when opcode contains IP_FW_TARG, otherwise just print numeric value with cleared high-order bit. MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Aug 8 18:13:03 2016 (r303844) +++ head/sbin/ipfw/ipfw2.c Mon Aug 8 18:30:50 2016 (r303845) @@ -1590,8 +1590,11 @@ show_static_rule(struct cmdline_opts *co break; case O_SETFIB: - bprint_uint_arg(bp, "setfib ", cmd->arg1 & 0x7FFF); - break; + if (cmd->arg1 == IP_FW_TARG) + bprint_uint_arg(bp, "setfib ", cmd->arg1); + else + bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); + break; case O_EXTERNAL_ACTION: { /* From owner-svn-src-head@freebsd.org Mon Aug 8 18:36:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7CDBB2EDD for ; Mon, 8 Aug 2016 18:36:14 +0000 (UTC) (envelope-from profipers@vh54.sweb.ru) Received: from vh54.sweb.ru (unknown [IPv6:2a02:408:7722:1:77:222:61:154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1673163F for ; Mon, 8 Aug 2016 18:36:12 +0000 (UTC) (envelope-from profipers@vh54.sweb.ru) Received: from profipers by vh54.sweb.ru with local (Exim 4.85_2) (envelope-from ) id 1bWpPE-002Ao0-Le for svn-src-head@freebsd.org; Mon, 08 Aug 2016 21:36:08 +0300 To: svn-src-head@freebsd.org Subject: Problem with parcel shipping, ID:0000631904 X-PHP-Originating-Script: 11140:post.php(4) : regexp code(1) : eval()'d code(17) : eval()'d code Date: Mon, 8 Aug 2016 21:36:08 +0300 From: "FedEx International Next Flight" Reply-To: "FedEx International Next Flight" Message-ID: X-Priority: 3 MIME-Version: 1.0 X-Sender-Uid: 11140 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 18:36:14 -0000 Dear Customer, Courier was unable to deliver the parcel to you. Delivery Label is attached to this email. Sincerely, Jack Carr, FedEx Operation Agent. From owner-svn-src-head@freebsd.org Mon Aug 8 18:36:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 475BCBB2F08; Mon, 8 Aug 2016 18:36:37 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp9.server.rpi.edu (gateway.canit.rpi.edu [128.113.2.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "canit.localdomain", Issuer "canit.localdomain" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0C51670; Mon, 8 Aug 2016 18:36:36 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp-auth1.server.rpi.edu (route.canit.rpi.edu [128.113.2.231]) by smtp9.server.rpi.edu (8.14.4/8.14.4/Debian-8) with ESMTP id u78IVMH2020646 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 Aug 2016 14:31:22 -0400 Received: from smtp-auth1.server.rpi.edu (localhost [127.0.0.1]) by smtp-auth1.server.rpi.edu (Postfix) with ESMTP id 321E0580E0; Mon, 8 Aug 2016 14:31:22 -0400 (EDT) Received: from [128.113.24.47] (gilead-qc124.netel.rpi.edu [128.113.124.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: drosih) by smtp-auth1.server.rpi.edu (Postfix) with ESMTPSA id 1CA79580AD; Mon, 8 Aug 2016 14:31:22 -0400 (EDT) From: "Garance A Drosehn" To: "Bruce Simpson" Cc: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303716 - head/crypto/openssh Date: Mon, 08 Aug 2016 14:31:21 -0400 Message-ID: <34A651B4-CFE1-4AAF-89D2-8A66F2EC8F27@rpi.edu> In-Reply-To: <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> MIME-Version: 1.0 X-Mailer: MailMate (1.9.4r5234) X-Virus-Scanned: ClamAV using ClamSMTP X-Bayes-Prob: 0.0001 (Score 0, tokens from: outgoing, @@RPTN) X-Spam-Score: 0.00 () [Hold at 10.10] X-CanIt-Incident-Id: 02RsGvmQg X-CanIt-Geo: ip=128.113.124.17; country=US; region=New York; city=Troy; latitude=42.7495; longitude=-73.5951; http://maps.google.com/maps?q=42.7495,-73.5951&z=6 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.229 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 18:36:37 -0000 On 7 Aug 2016, at 7:40, Bruce Simpson wrote: > On 07/08/16 11:58, Bruce Simpson wrote: >> Is there a way to revert this change, at least on an ongoing >> operational basis (e.g. configuration file) for those of us who >> use FreeBSD to connect directly to such devices? > > I was able to override this (somewhat unilateral, to my mind) > deprecation of the DH key exchange by using this option: > -oKexAlgorithms=+diffie-hellman-group1-sha1 If I understand the issues, the biggest concern with this change is for people who need ssh clients to connect to ancient hardware. Perhaps we could reduce the pain of this change by creating a special port for ssh. One which installs a version of openssh that does not include this change, and which also does not include sshd. In addition, it could install ssh/scp under some alternate names, such that people would have to explicitly request 'ssh-2015' (instead of 'ssh') to execute this older version of ssh. (I suspect that we should not call the binaries 'ssh-old' and 'scp-old', as those names will not work well for a long-term option). *That* port would remain frozen in time, and would (probably) not import any updates from future versions of openssh. The only goal of this port is to give people a way to access hardware that they cannot access with the newer version of openssh. It is not some new fork of ssh which will track future improvements to openssh. This ssh-2015 version might need some updates of it's own, but only wrt default configuration settings, and maybe so it will recognize some special configuration options that the main ssh will ignore. [aside: we have some machines here at RPI which are old enough that I already have an alternate-version of ssh to connect to them, so this tactic is nothing new to me! Kinda sad, really...] -- Garance Alistair Drosehn = drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA From owner-svn-src-head@freebsd.org Mon Aug 8 18:57:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6340ABB3381; Mon, 8 Aug 2016 18:57:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19AD0128B; Mon, 8 Aug 2016 18:57:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78Ivpq9014526; Mon, 8 Aug 2016 18:57:51 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78IvpcX014523; Mon, 8 Aug 2016 18:57:51 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608081857.u78IvpcX014523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 8 Aug 2016 18:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303847 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 18:57:52 -0000 Author: sbruno Date: Mon Aug 8 18:57:50 2016 New Revision: 303847 URL: https://svnweb.freebsd.org/changeset/base/303847 Log: Fixup ixl(4) options parsing to actually compile when using RSS/PCBGROUP in GENERIC. Fixup #ifdef RSS code blocks so that they build and add/delete variables that were missesd during the creation of this code. This code is untested and should have a big red warning on it. Reported by: npn@ MFC after: 2 days Modified: head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Mon Aug 8 18:31:28 2016 (r303846) +++ head/sys/dev/ixl/ixl.h Mon Aug 8 18:57:50 2016 (r303847) @@ -36,6 +36,10 @@ #ifndef _IXL_H_ #define _IXL_H_ +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_rss.h" + #include #include #include @@ -93,12 +97,9 @@ #ifdef RSS #include +#include #endif -#include "opt_inet.h" -#include "opt_inet6.h" -#include "opt_rss.h" - #include "i40e_type.h" #include "i40e_prototype.h" Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Mon Aug 8 18:31:28 2016 (r303846) +++ head/sys/dev/ixl/ixl_pf_main.c Mon Aug 8 18:57:50 2016 (r303847) @@ -1155,6 +1155,10 @@ ixl_setup_queue_tqs(struct ixl_vsi *vsi) { struct ixl_queue *que = vsi->queues; device_t dev = vsi->dev; +#ifdef RSS + int cpu_id = 0; + cpuset_t cpu_mask; +#endif /* Create queue tasks and start queue taskqueues */ for (int i = 0; i < vsi->num_queues; i++, que++) { @@ -1246,9 +1250,6 @@ ixl_setup_queue_msix(struct ixl_vsi *vsi struct ixl_queue *que = vsi->queues; struct tx_ring *txr; int error, rid, vector = 1; -#ifdef RSS - cpuset_t cpu_mask; -#endif /* Queue interrupt vector numbers start at 1 (adminq intr is 0) */ for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { Modified: head/sys/dev/ixl/ixlvc.c ============================================================================== --- head/sys/dev/ixl/ixlvc.c Mon Aug 8 18:31:28 2016 (r303846) +++ head/sys/dev/ixl/ixlvc.c Mon Aug 8 18:57:50 2016 (r303847) @@ -836,13 +836,10 @@ ixlv_config_rss_key(struct ixlv_sc *sc) struct i40e_virtchnl_rss_key *rss_key_msg; int msg_len, key_length; u8 rss_seed[IXL_RSS_KEY_SIZE]; -#ifdef RSS - u32 rss_hash_config; -#endif #ifdef RSS /* Fetch the configured RSS key */ - rss_getkey(&rss_seed); + rss_getkey((uint8_t *) &rss_seed); #else ixl_get_default_rss_key((u32 *)rss_seed); #endif From owner-svn-src-head@freebsd.org Mon Aug 8 19:31:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B4FBB3FE7; Mon, 8 Aug 2016 19:31:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4C411D3C; Mon, 8 Aug 2016 19:31:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78JV1IJ026578; Mon, 8 Aug 2016 19:31:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78JV1Ve026577; Mon, 8 Aug 2016 19:31:01 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608081931.u78JV1Ve026577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 8 Aug 2016 19:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303848 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 19:31:03 -0000 Author: sbruno Date: Mon Aug 8 19:31:01 2016 New Revision: 303848 URL: https://svnweb.freebsd.org/changeset/base/303848 Log: Avoid panic from ng_uncallout when unpluggin ethernet cable with active PPTP VPN connection. Submitted by: Michael Zhilin Reviewed by: ngie MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7209 Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Mon Aug 8 18:57:50 2016 (r303847) +++ head/sys/netgraph/ng_base.c Mon Aug 8 19:31:01 2016 (r303848) @@ -3815,7 +3815,7 @@ ng_uncallout(struct callout *c, node_p n item = c->c_arg; /* Do an extra check */ if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && - (NGI_NODE(item) == node)) { + (item != NULL) && (NGI_NODE(item) == node)) { /* * We successfully removed it from the queue before it ran * So now we need to unreference everything that was From owner-svn-src-head@freebsd.org Mon Aug 8 20:25:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAA3BB3024; Mon, 8 Aug 2016 20:25:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD3E1143A; Mon, 8 Aug 2016 20:25:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78KP5ZS048793; Mon, 8 Aug 2016 20:25:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78KP4aE048791; Mon, 8 Aug 2016 20:25:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608082025.u78KP4aE048791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Aug 2016 20:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303855 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 20:25:06 -0000 Author: markj Date: Mon Aug 8 20:25:04 2016 New Revision: 303855 URL: https://svnweb.freebsd.org/changeset/base/303855 Log: Handle races with listening socket close when connecting a unix socket. If the listening socket is closed while sonewconn() is executing, the nascent child socket is aborted, which results in recursion on the unp_link lock when the child's pru_detach method is invoked. Fix this by using a flag to mark such sockets, and skip a part of the socket's teardown during detach. Reported by: Raviprakash Darbha Tested by: pho MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D7398 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Aug 8 20:23:11 2016 (r303854) +++ head/sys/kern/uipc_usrreq.c Mon Aug 8 20:25:04 2016 (r303855) @@ -430,6 +430,8 @@ uipc_attach(struct socket *so, int proto unp->unp_socket = so; so->so_pcb = unp; unp->unp_refcount = 1; + if (so->so_head != NULL) + unp->unp_flags |= UNP_NASCENT; UNP_LIST_LOCK(); unp->unp_gencnt = ++unp_gencnt; @@ -652,14 +654,22 @@ uipc_detach(struct socket *so) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); - UNP_LINK_WLOCK(); + vp = NULL; + local_unp_rights = 0; + UNP_LIST_LOCK(); - UNP_PCB_LOCK(unp); LIST_REMOVE(unp, unp_link); unp->unp_gencnt = ++unp_gencnt; --unp_count; UNP_LIST_UNLOCK(); + if ((unp->unp_flags & UNP_NASCENT) != 0) { + UNP_PCB_LOCK(unp); + goto teardown; + } + UNP_LINK_WLOCK(); + UNP_PCB_LOCK(unp); + /* * XXXRW: Should assert vp->v_socket == so. */ @@ -687,6 +697,7 @@ uipc_detach(struct socket *so) } local_unp_rights = unp_rights; UNP_LINK_WUNLOCK(); +teardown: unp->unp_socket->so_pcb = NULL; saved_unp_addr = unp->unp_addr; unp->unp_addr = NULL; @@ -1473,6 +1484,7 @@ unp_connect2(struct socket *so, struct s if (so2->so_type != so->so_type) return (EPROTOTYPE); + unp2->unp_flags &= ~UNP_NASCENT; unp->unp_conn = unp2; switch (so->so_type) { Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Mon Aug 8 20:23:11 2016 (r303854) +++ head/sys/sys/unpcb.h Mon Aug 8 20:25:04 2016 (r303855) @@ -103,11 +103,6 @@ struct unpcb { #define UNP_WANTCRED 0x004 /* credentials wanted */ #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ -#define UNPGC_REF 0x1 /* unpcb has external ref. */ -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ - /* * These flags are used to handle non-atomicity in connect() and bind() * operations on a socket: in particular, to avoid races between multiple @@ -115,6 +110,15 @@ struct unpcb { */ #define UNP_CONNECTING 0x010 /* Currently connecting. */ #define UNP_BINDING 0x020 /* Currently binding. */ +#define UNP_NASCENT 0x040 /* Newborn child socket. */ + +/* + * Flags in unp_gcflag. + */ +#define UNPGC_REF 0x1 /* unpcb has external ref. */ +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ +#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) From owner-svn-src-head@freebsd.org Mon Aug 8 21:22:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F963BB3EA2 for ; Mon, 8 Aug 2016 21:22:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7EA1ABC for ; Mon, 8 Aug 2016 21:22:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x241.google.com with SMTP id j124so7028231ith.3 for ; Mon, 08 Aug 2016 14:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oY/7eCcSJRc8uGhjgAQEV06l9P2AqlYTMkw+08TeJn4=; b=fxFDOI+y14l19ii6s9hXOFPPZ5oMJtA164k5tvuKFkdXrhxIDq99+nvI20aA03X9AY d+BvHQch764Rnu7QdZNXadLA/rKPFGh5pQMBm2aV6UCsWlC6mctNqbl76hGEMJ1Tf4k1 xXjxsJxcimrq0GxPUPd5UgdEh4mCEk0bO8gI4ZeiOxGtBpSlv2vaQ+Y4qaRIlpoYwhaI A/DHaGJzJVCU1zlQN9r1RKmhhFW559y0bIL5XTOtN1QuV5IdzXXmdfmPDimWsS7Yu+/9 uJwyBtc4K4OibkegDtoj2J75CE4jKoImcHmjjo+XL4KY6a/UBOtVZJ6wLu8l20KDdgWm PCkQ== 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; bh=oY/7eCcSJRc8uGhjgAQEV06l9P2AqlYTMkw+08TeJn4=; b=m9rOqEs/wqBOwOoxZ3rTRl8qN7GN2EHFcf9zEEEnFNQGRWVWQm4qkQMSnL8vU/3iSz 8PCFiXy0O5Sys2N8NdAyjBoi1FZjQuS349VONsuScV+D/XhlcVScxceF1ZKJC6qyYVK4 mLVrknunyh1lfWWfM10k+vePShLCqVWQlwRz7j35s0gNOH6ipq0fwo/rC6GQ51Bi2rUE 8Y0PcHoedJ31mnu2zDYVlqRipn+rVJTMNRywJhBwNM2rkdC+0elEdQFbVQ9t7rE3xNeM WWsxFTyZbhKDDPWhiNMAFr1EO5i6i98/SOvu3fdv2L2BPJ1j8VDIOAadgcGvALAyrxss Je7g== X-Gm-Message-State: AEkoouvIOzAm+uucp5cQmkX6TJ50WM2P1eUhQImCTgvecEFlkxq/3JedN9C1Aygt62l6KpZhyx2jQ5fBmEvjag== X-Received: by 10.36.213.131 with SMTP id a125mr20467862itg.14.1470691351445; Mon, 08 Aug 2016 14:22:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Mon, 8 Aug 2016 14:22:30 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <20160807085128.GD88936@spindle.one-eyed-alien.net> References: <201608061848.u76ImlqK030395@repo.freebsd.org> <20160807085128.GD88936@spindle.one-eyed-alien.net> From: Warner Losh Date: Mon, 8 Aug 2016 15:22:30 -0600 X-Google-Sender-Auth: ayAP8Fg3maWTwTwtww7gaaBRNjo Message-ID: Subject: Re: svn commit: r303803 - in head/sys/dev: fdt ofw To: Brooks Davis Cc: "Stephen J. Kiernan" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 21:22:32 -0000 On Sun, Aug 7, 2016 at 2:51 AM, Brooks Davis wrote: > On Sat, Aug 06, 2016 at 06:48:47PM +0000, Stephen J. Kiernan wrote: >> Author: stevek >> Date: Sat Aug 6 18:48:47 2016 >> New Revision: 303803 >> URL: https://svnweb.freebsd.org/changeset/base/303803 >> >> Log: >> Add hw.fdt sysctl node. >> Make FDT blob available via opaque hw.fdt.dtb sysctl, if a DTB has been >> installed by the time sysctls are registered. > > Thanks! This has been on my todo list for ages. Now all we need to do is make it writable with overlay support like we have in the loader :) Warner From owner-svn-src-head@freebsd.org Mon Aug 8 21:28:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AED7BB3F6F; Mon, 8 Aug 2016 21:28:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC3331D80; Mon, 8 Aug 2016 21:28:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78LS3AW070803; Mon, 8 Aug 2016 21:28:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78LS3QV070802; Mon, 8 Aug 2016 21:28:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608082128.u78LS3QV070802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Aug 2016 21:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303859 - 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.22 Precedence: list List-Id: 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, 08 Aug 2016 21:28:04 -0000 Author: jhb Date: Mon Aug 8 21:28:02 2016 New Revision: 303859 URL: https://svnweb.freebsd.org/changeset/base/303859 Log: Fix a typo. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 8 21:19:57 2016 (r303858) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 8 21:28:02 2016 (r303859) @@ -590,7 +590,7 @@ t4_tweak_chip_settings(struct adapter *s /* * SGE wants the buffer to be at least 64B and then a multiple of 16. If - * padding is is use the buffer's start and end need to be aligned to the pad + * padding is in use, the buffer's start and end need to be aligned to the pad * boundary as well. We'll just make sure that the size is a multiple of the * boundary here, it is up to the buffer allocation code to make sure the start * of the buffer is aligned as well. From owner-svn-src-head@freebsd.org Mon Aug 8 21:45:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FD71BB3373; Mon, 8 Aug 2016 21:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1304317A6; Mon, 8 Aug 2016 21:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78LjdEh078188; Mon, 8 Aug 2016 21:45:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78LjdaT078187; Mon, 8 Aug 2016 21:45:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608082145.u78LjdaT078187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Aug 2016 21:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303860 - 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.22 Precedence: list List-Id: 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, 08 Aug 2016 21:45:40 -0000 Author: jhb Date: Mon Aug 8 21:45:39 2016 New Revision: 303860 URL: https://svnweb.freebsd.org/changeset/base/303860 Log: Reserve an adapter flag IS_VF to mark VF devices vs PF devices. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Aug 8 21:28:02 2016 (r303859) +++ head/sys/dev/cxgbe/adapter.h Mon Aug 8 21:45:39 2016 (r303860) @@ -195,6 +195,7 @@ enum { ADAP_SYSCTL_CTX = (1 << 4), /* TOM_INIT_DONE= (1 << 5), No longer used */ BUF_PACKING_OK = (1 << 6), + IS_VF = (1 << 7), CXGBE_BUSY = (1 << 9), From owner-svn-src-head@freebsd.org Mon Aug 8 22:53:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21A2BB3173 for ; Mon, 8 Aug 2016 22:53:50 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4142418E2 for ; Mon, 8 Aug 2016 22:53:50 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x234.google.com with SMTP id o80so169443419wme.1 for ; Mon, 08 Aug 2016 15:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0RV2NvziXDZiFxu/HHuifNjn5Pp1sM5NfYO9xQ8wYoM=; b=YnZRVujk5L6vJx81jRi3bh6BZvdWFxoWJLraa4GzGPx6icwnyynbC/fRVbvYtTARsb 8aHMiXSC8oI+rBe/c5k4niL1l6nOxUPYlOHRCheJQy8i3qKDARx4ZipwfkxCMrjwTBKE Gkml1v2L1CCr6xNW7WGFA1c2UcN0qxUA3thtN8DA4oKDm3lVqTSta3osPGbr4ytLRpzT djJrXn4w4iVYJRFzOyqqmnqSB94SUIIsstljCF1QfgRxPkBBrYDjj38BJtC7glGb0F3w ok/HYdvn76H+pbsdY45YPqZV6T/eVhQmo2um0eYBI3tHCtVtaUq4KdnuQN3Kxe4TQ40h WfZw== 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; bh=0RV2NvziXDZiFxu/HHuifNjn5Pp1sM5NfYO9xQ8wYoM=; b=HJ00/7+fPMGmVKFkeO6hosNRtFfG3MoEvJHjvAkiIIaQyElOkR6WPOqMPCGJeohAIP /0s9Pv/uQPqPIi3gzyqRk50Rr0rTsXqFNUdlBEmp7gcMlBlB6nvnszLN+9dXtovP3Mpj QhCnlRhvfP4Tiy8XrbZxVM+/GetsOf5U6yEQwPM8pU5l67jaGR+JgRiecgetvsKI1YfL f9cXVO0v/v8HBIT5jb2BoGh6YAxC46LyuWzH1j/FTqFhOsN6FnUXKqUe0+tlNmaQCXXY HFYIoaANSJB2+ErsiPV3FiVC3+0cSoCbwQOG4JdkSLu/BsMgHFZ0lvlYXtipZyvJUcH1 R/4A== X-Gm-Message-State: AEkoout+FRY3efaRyQS2Ut5tb3T4Mr2XCuCMGM6Qn8Jxp4YfE5JPJed3Pa0AJcm+u4hcyz8brk+0WnOcsbrXj4jw X-Received: by 10.194.185.202 with SMTP id fe10mr82435832wjc.93.1470696828554; Mon, 08 Aug 2016 15:53:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Mon, 8 Aug 2016 15:53:47 -0700 (PDT) In-Reply-To: <201608082025.u78KP4aE048791@repo.freebsd.org> References: <201608082025.u78KP4aE048791@repo.freebsd.org> From: Oliver Pinter Date: Tue, 9 Aug 2016 00:53:47 +0200 Message-ID: Subject: Re: svn commit: r303855 - in head/sys: kern sys To: Mark Johnston Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 22:53:50 -0000 Hi! Can you please MFC back this change 10-STABLE together with the following: https://github.com/HardenedBSD/hardenedBSD/commit/576619e564618bca3675db57580d8e1f76bd2ac7 This issue is still exists on 10-STABLE, as you can test with the linked program from phabricator: https://people.freebsd.org/~mjg/reproducers/unp-gc-panic.c On Mon, Aug 8, 2016 at 10:25 PM, Mark Johnston wrote: > Author: markj > Date: Mon Aug 8 20:25:04 2016 > New Revision: 303855 > URL: https://svnweb.freebsd.org/changeset/base/303855 > > Log: > Handle races with listening socket close when connecting a unix socket. > > If the listening socket is closed while sonewconn() is executing, the > nascent child socket is aborted, which results in recursion on the > unp_link lock when the child's pru_detach method is invoked. Fix this > by using a flag to mark such sockets, and skip a part of the socket's > teardown during detach. > > Reported by: Raviprakash Darbha > Tested by: pho > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D7398 > > Modified: > head/sys/kern/uipc_usrreq.c > head/sys/sys/unpcb.h > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Mon Aug 8 20:23:11 2016 (r303854) > +++ head/sys/kern/uipc_usrreq.c Mon Aug 8 20:25:04 2016 (r303855) > @@ -430,6 +430,8 @@ uipc_attach(struct socket *so, int proto > unp->unp_socket = so; > so->so_pcb = unp; > unp->unp_refcount = 1; > + if (so->so_head != NULL) > + unp->unp_flags |= UNP_NASCENT; > > UNP_LIST_LOCK(); > unp->unp_gencnt = ++unp_gencnt; > @@ -652,14 +654,22 @@ uipc_detach(struct socket *so) > unp = sotounpcb(so); > KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); > > - UNP_LINK_WLOCK(); > + vp = NULL; > + local_unp_rights = 0; > + > UNP_LIST_LOCK(); > - UNP_PCB_LOCK(unp); > LIST_REMOVE(unp, unp_link); > unp->unp_gencnt = ++unp_gencnt; > --unp_count; > UNP_LIST_UNLOCK(); > > + if ((unp->unp_flags & UNP_NASCENT) != 0) { > + UNP_PCB_LOCK(unp); > + goto teardown; > + } > + UNP_LINK_WLOCK(); > + UNP_PCB_LOCK(unp); > + > /* > * XXXRW: Should assert vp->v_socket == so. > */ > @@ -687,6 +697,7 @@ uipc_detach(struct socket *so) > } > local_unp_rights = unp_rights; > UNP_LINK_WUNLOCK(); > +teardown: > unp->unp_socket->so_pcb = NULL; > saved_unp_addr = unp->unp_addr; > unp->unp_addr = NULL; > @@ -1473,6 +1484,7 @@ unp_connect2(struct socket *so, struct s > > if (so2->so_type != so->so_type) > return (EPROTOTYPE); > + unp2->unp_flags &= ~UNP_NASCENT; > unp->unp_conn = unp2; > > switch (so->so_type) { > > Modified: head/sys/sys/unpcb.h > ============================================================================== > --- head/sys/sys/unpcb.h Mon Aug 8 20:23:11 2016 (r303854) > +++ head/sys/sys/unpcb.h Mon Aug 8 20:25:04 2016 (r303855) > @@ -103,11 +103,6 @@ struct unpcb { > #define UNP_WANTCRED 0x004 /* credentials wanted */ > #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ > > -#define UNPGC_REF 0x1 /* unpcb has external ref. */ > -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ > -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ > -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ > - > /* > * These flags are used to handle non-atomicity in connect() and bind() > * operations on a socket: in particular, to avoid races between multiple > @@ -115,6 +110,15 @@ struct unpcb { > */ > #define UNP_CONNECTING 0x010 /* Currently connecting. */ > #define UNP_BINDING 0x020 /* Currently binding. */ > +#define UNP_NASCENT 0x040 /* Newborn child socket. */ > + > +/* > + * Flags in unp_gcflag. > + */ > +#define UNPGC_REF 0x1 /* unpcb has external ref. */ > +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ > +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ > +#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ > > #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Aug 8 23:38:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B40BB3A78; Mon, 8 Aug 2016 23:38:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1A0611F6; Mon, 8 Aug 2016 23:38:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id i6so25824778pfe.0; Mon, 08 Aug 2016 16:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9rwyVtGn8TQuZU5A2Qa50Ps+xDxZU1opk0qRGRaraiA=; b=WXiEMmbRaewS3dUMWI2GxxN+D5GD8ByyU7EJ9Gqh8zkku40Hccnry7JRHEgaIf7Qjc Izw2XFhwlQ5Wv2XnSfhxncnMtUXFaqal9XC1rw5uIHMLGKK8x/4RT6QIFr3pcfaGs33O 77GcRno/5KECKQGeT2Ju5L1XJf2w44OaNjW5AFuypvcXSEfNqVEQvauigVUtstvo5sTL ol3gYMDej7fYnKOn9GgOydjOaCzDwJTIuh1DbPwm9ejeaeBNaJ7+dcaXlQIlNWW+kvTt vXUZXVLOF0WdKZuDPhpsbiOXxvxW/HsRZwyHrrK7XEVGUEkjSUsx3hnLiY2J6YBIA6tv P22A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=9rwyVtGn8TQuZU5A2Qa50Ps+xDxZU1opk0qRGRaraiA=; b=FNa09grv4A7aXSmCLy1fxsco9Y7+1+2tonxxHZCsy9y753wJaNqkF2lY6ydHulvBBA w6uwzdOdnkLo8DYGK+out0rNTqc3Vwa+h4l851F14d+BJsv0jhWVxJQMqvLyq24ThkIP J3AJePB0+j8waVBpHZi107vNJxCrgkUbZV7lAujJJbQZPsp28XOSdBNXMOLxvHf8XK+p 21FHik5tULsh+oZaEzzWhNCnGC0abjBhq1yT+0qP+tmYGv911Uy7qVu4lm6z8Q0bdLeA ZsFvRhxuJZHAhks35odHkk6BSmSO7xBiddkuh1qL4qde7CpDgkeXkjq6pWyntnAaMgHn 6IOQ== X-Gm-Message-State: AEkoout5Ec8OUSgoBtoqJVKdk1i1SgwzJrxT2LFkhxhPw8mubUCcxlTk8m7xawZLWYrRkg== X-Received: by 10.98.213.130 with SMTP id d124mr167013863pfg.118.1470699518212; Mon, 08 Aug 2016 16:38:38 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id h1sm50756607pay.48.2016.08.08.16.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 16:38:37 -0700 (PDT) Sender: Mark Johnston Date: Mon, 8 Aug 2016 16:43:32 -0700 From: Mark Johnston To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r303855 - in head/sys: kern sys Message-ID: <20160808234332.GA22449@wkstn-mjohnston.west.isilon.com> References: <201608082025.u78KP4aE048791@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 23:38:39 -0000 On Tue, Aug 09, 2016 at 12:53:47AM +0200, Oliver Pinter wrote: > Hi! > > Can you please MFC back this change 10-STABLE together with the > following: https://github.com/HardenedBSD/hardenedBSD/commit/576619e564618bca3675db57580d8e1f76bd2ac7 > > This issue is still exists on 10-STABLE, as you can test with the > linked program from phabricator: > https://people.freebsd.org/~mjg/reproducers/unp-gc-panic.c Hm, I don't think this could be MFCed directly. It changes the kernel ABI by modifying the argument of dom_dispose(). This could be fixed in stable/10 with a hack to call the unix domain socket code directly when appropriate, which I think is preferable to the current state of things. I'll look into it further. > > On Mon, Aug 8, 2016 at 10:25 PM, Mark Johnston wrote: > > Author: markj > > Date: Mon Aug 8 20:25:04 2016 > > New Revision: 303855 > > URL: https://svnweb.freebsd.org/changeset/base/303855 > > > > Log: > > Handle races with listening socket close when connecting a unix socket. > > > > If the listening socket is closed while sonewconn() is executing, the > > nascent child socket is aborted, which results in recursion on the > > unp_link lock when the child's pru_detach method is invoked. Fix this > > by using a flag to mark such sockets, and skip a part of the socket's > > teardown during detach. > > > > Reported by: Raviprakash Darbha > > Tested by: pho > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D7398 > > > > Modified: > > head/sys/kern/uipc_usrreq.c > > head/sys/sys/unpcb.h > > > > Modified: head/sys/kern/uipc_usrreq.c > > ============================================================================== > > --- head/sys/kern/uipc_usrreq.c Mon Aug 8 20:23:11 2016 (r303854) > > +++ head/sys/kern/uipc_usrreq.c Mon Aug 8 20:25:04 2016 (r303855) > > @@ -430,6 +430,8 @@ uipc_attach(struct socket *so, int proto > > unp->unp_socket = so; > > so->so_pcb = unp; > > unp->unp_refcount = 1; > > + if (so->so_head != NULL) > > + unp->unp_flags |= UNP_NASCENT; > > > > UNP_LIST_LOCK(); > > unp->unp_gencnt = ++unp_gencnt; > > @@ -652,14 +654,22 @@ uipc_detach(struct socket *so) > > unp = sotounpcb(so); > > KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); > > > > - UNP_LINK_WLOCK(); > > + vp = NULL; > > + local_unp_rights = 0; > > + > > UNP_LIST_LOCK(); > > - UNP_PCB_LOCK(unp); > > LIST_REMOVE(unp, unp_link); > > unp->unp_gencnt = ++unp_gencnt; > > --unp_count; > > UNP_LIST_UNLOCK(); > > > > + if ((unp->unp_flags & UNP_NASCENT) != 0) { > > + UNP_PCB_LOCK(unp); > > + goto teardown; > > + } > > + UNP_LINK_WLOCK(); > > + UNP_PCB_LOCK(unp); > > + > > /* > > * XXXRW: Should assert vp->v_socket == so. > > */ > > @@ -687,6 +697,7 @@ uipc_detach(struct socket *so) > > } > > local_unp_rights = unp_rights; > > UNP_LINK_WUNLOCK(); > > +teardown: > > unp->unp_socket->so_pcb = NULL; > > saved_unp_addr = unp->unp_addr; > > unp->unp_addr = NULL; > > @@ -1473,6 +1484,7 @@ unp_connect2(struct socket *so, struct s > > > > if (so2->so_type != so->so_type) > > return (EPROTOTYPE); > > + unp2->unp_flags &= ~UNP_NASCENT; > > unp->unp_conn = unp2; > > > > switch (so->so_type) { > > > > Modified: head/sys/sys/unpcb.h > > ============================================================================== > > --- head/sys/sys/unpcb.h Mon Aug 8 20:23:11 2016 (r303854) > > +++ head/sys/sys/unpcb.h Mon Aug 8 20:25:04 2016 (r303855) > > @@ -103,11 +103,6 @@ struct unpcb { > > #define UNP_WANTCRED 0x004 /* credentials wanted */ > > #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ > > > > -#define UNPGC_REF 0x1 /* unpcb has external ref. */ > > -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ > > -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ > > -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ > > - > > /* > > * These flags are used to handle non-atomicity in connect() and bind() > > * operations on a socket: in particular, to avoid races between multiple > > @@ -115,6 +110,15 @@ struct unpcb { > > */ > > #define UNP_CONNECTING 0x010 /* Currently connecting. */ > > #define UNP_BINDING 0x020 /* Currently binding. */ > > +#define UNP_NASCENT 0x040 /* Newborn child socket. */ > > + > > +/* > > + * Flags in unp_gcflag. > > + */ > > +#define UNPGC_REF 0x1 /* unpcb has external ref. */ > > +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ > > +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ > > +#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ > > > > #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) > > > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Aug 8 23:48:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14697BB3CEE; Mon, 8 Aug 2016 23:48:37 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C13A017C6; Mon, 8 Aug 2016 23:48:36 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id x25so211513267qtx.2; Mon, 08 Aug 2016 16:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=LGUunRkbNxM8TI4w9E/tthN6g+H8GMmCZmpjIodfU2E=; b=sEbnXK+LroE91I+7a1Z2adjRoz6HAdRDk+PwjFh4fJeM87a3AQcs6dW9A8n4y4TZ7d wy3pbTKkk46IDJRmKBkV8JBSurbBGPelpdK1t3FY1o/Zh157GgJ57B9sj6WygsfW8W9e AnKjq3oF4lsFsf3FBnRveXN0Y0CWouBIzrb2lulVZsBneGDX13N71mCX/TQQGSvCpKWe Dtzdl/FoSTLOfJcWm5GBrxUBBc1WlqAHdLo0U0PLsNTfAssp/a0Js/gkjZTE4mxYDt+L ntpIdVG7B3DZ2FaCV+Kiu5Z6mFtUKoJ2NubcHVfOEVoZ6ZQuLZA+glEOV8w0COZ4Uc3/ cDIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=LGUunRkbNxM8TI4w9E/tthN6g+H8GMmCZmpjIodfU2E=; b=OZuO3l1yMrBJ5yICkOy+S+uT5Z/eJE4BOPkuIAnH2C8uWCTrOHaSSUZBmz5r/yceH6 vX/EoUvYDT5Y4rpasRVcJqeNofoypEcem1D/SPf/ckb0Qixw8HshAGn6Ht1XdfwbtKTW uTgQNiAx+f1hLt218ohSjrJqE/X3CWu9jFifinjCtnjjShgY2xxi5MaohBY8zxvqg61j yS/AKpVta/L0/r28zv6oXR4oL6oZS5/qARK0jqx2t9qusaJD8Hy1fWyk+txssleZiFrt rfnh2b8yiUNxBX2eY9OvCWOjyvnAoi2nxoAOccmByW5QPQTHXjMPLWJPH7L1tHnq9F8G 76Xg== X-Gm-Message-State: AEkoouul4ozLjntLdeAVNLy9K+fwAfGupCeJO//aDTqpEXstTUZdB2dtEaZFhmbPI/oyMQ== X-Received: by 10.200.43.105 with SMTP id 38mr31581708qtv.73.1470700115566; Mon, 08 Aug 2016 16:48:35 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id k20sm18815801qkl.2.2016.08.08.16.48.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 16:48:34 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608050623.u756N695018889@repo.freebsd.org> From: Navdeep Parhar Message-ID: Date: Mon, 8 Aug 2016 16:48:32 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608050623.u756N695018889@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 23:48:37 -0000 Hello Andriy, I'm at r303837 and have had two panics today in zfs_rename. I have a core for a kernel built with -O0. Let me know if you think it's related to this commit and need more information. This is the stack: (also available at https://people.freebsd.org/~np/rename_panic.txt in case the wide lines are hard to read in email). (kgdb) bt #0 doadump (textdump=0) at /root/ws/head/sys/kern/kern_shutdown.c:298 #1 0xffffffff803f8692 in db_dump (dummy=-2100833195, dummy2=false, dummy3=-1, dummy4=0xfffffe08604c6810 "") at /root/ws/head/sys/ddb/db_command.c:533 #2 0xffffffff803f847e in db_command (last_cmdp=0xffffffff821d40d8 , cmd_table=0x0, dopager=1) at /root/ws/head/sys/ddb/db_command.c:440 #3 0xffffffff803f801e in db_command_loop () at /root/ws/head/sys/ddb/db_command.c:493 #4 0xffffffff803fcf13 in db_trap (type=12, code=0) at /root/ws/head/sys/ddb/db_main.c:251 #5 0xffffffff8100116f in kdb_trap (type=12, code=0, tf=0xfffffe08604c6fe0) at /root/ws/head/sys/kern/subr_kdb.c:654 #6 0xffffffff8163df24 in trap_fatal (frame=0xfffffe08604c6fe0, eva=18446744069414584336) at /root/ws/head/sys/amd64/amd64/trap.c:836 #7 0xffffffff8163e53b in trap_pfault (frame=0xfffffe08604c6fe0, usermode=0) at /root/ws/head/sys/amd64/amd64/trap.c:763 #8 0xffffffff8163d1e2 in trap (frame=0xfffffe08604c6fe0) at /root/ws/head/sys/amd64/amd64/trap.c:442 #9 0xffffffff8163e63a in trap_check (frame=0xfffffe08604c6fe0) at /root/ws/head/sys/amd64/amd64/trap.c:635 #10 #11 0xffffffff82c7d455 in zfs_rename (sdvp=0xfffff80016e331d8, svpp=0xfffffe08604c7318, scnp=0xfffffe08604c7750, tdvp=0xfffff80156440000, tvpp=0xfffffe08604c7308, tcnp=0xfffffe08604c7688, cr=0xfffff8001612e600) at /root/ws/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:3959 #12 0xffffffff82c6f6a9 in zfs_freebsd_rename (ap=0xfffffe08604c73c8) at /root/ws/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:5275 #13 0xffffffff8187d484 in VOP_RENAME_APV (vop=0xffffffff82d19bb0 , a=0xfffffe08604c73c8) at vnode_if.c:1547 #14 0xffffffff810e5d41 in VOP_RENAME (fdvp=0xfffff80016e331d8, fvp=0xfffff80174c02588, fcnp=0xfffffe08604c7750, tdvp=0xfffff80156440000, tvp=0xfffff8017d7d1ce8, tcnp=0xfffffe08604c7688) at ./vnode_if.h:636 #15 0xffffffff810e5b17 in kern_renameat (td=0xfffff8010b855a40, oldfd=-100, old=0x800a121a0 , newfd=-100, new=0x7fffffffcfee , pathseg=UIO_USERSPACE) at /root/ws/head/sys/kern/vfs_syscalls.c:3553 #16 0xffffffff810e53d7 in sys_rename (td=0xfffff8010b855a40, uap=0xfffffe08604c7a58) at /root/ws/head/sys/kern/vfs_syscalls.c:3427 #17 0xffffffff83ce244d in filemon_wrapper_rename (td=0xfffff8010b855a40, uap=0xfffffe08604c7a58) at /root/ws/head/sys/modules/filemon/../../dev/filemon/filemon_wrapper.c:240 #18 0xffffffff8163f1a9 in syscallenter (td=0xfffff8010b855a40, sa=0xfffffe08604c7a48) at /root/ws/head/sys/amd64/amd64/../../kern/subr_syscall.c:135 #19 0xffffffff8163e9ea in amd64_syscall (td=0xfffff8010b855a40, traced=0) at /root/ws/head/sys/amd64/amd64/trap.c:942 Regards, Navdeep On 08/04/2016 23:23, Andriy Gapon wrote: > Author: avg > Date: Fri Aug 5 06:23:06 2016 > New Revision: 303763 > URL: https://svnweb.freebsd.org/changeset/base/303763 > > Log: > zfs: honour and make use of vfs vnode locking protocol > > ZFS POSIX Layer is originally written for Solaris VFS which is very > different from FreeBSD VFS. Most importantly many things that FreeBSD VFS > manages on behalf of all filesystems are implemented in ZPL in a different > way. > Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS > functionality or, in the worst cases, badly interacts / interferes > with VFS. > > The most prominent problem is a deadlock caused by the lock order reversal > of vnode locks that may happen with concurrent zfs_rename() and lookup(). > The deadlock is a result of zfs_rename() not observing the vnode locking > contract expected by VFS. > > This commit removes all ZPL internal locking that protects parent-child > relationships of filesystem nodes. These relationships are protected > by vnode locks and the code is changed to take advantage of that fact > and to properly interact with VFS. > > Removal of the internal locking allowed all ZPL dmu_tx_assign calls to > use TXG_WAIT mode. > > Another victim, disputable perhaps, is ZFS support for filesystems with > mixed case sensitivity. That support is not provided by the OS anyway, > so in ZFS it was a buch of dead code. > > To do: > - replace ZFS_ENTER mechanism with VFS managed / visible mechanism > - replace zfs_zget with zfs_vget[f] as much as possible > - get rid of not really useful now zfs_freebsd_* adapters > - more cleanups of unneeded / unused code > - fix / replace .zfs support > > PR: 209158 > Reported by: many > Tested by: many (thank you all!) > MFC after: 5 days > Sponsored by: HybridCluster / ClusterHQ > Differential Revision: https://reviews.freebsd.org/D6533 > > Modified: > head/sys/cddl/compat/opensolaris/sys/vnode.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c > From owner-svn-src-head@freebsd.org Mon Aug 8 23:51:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06994BB3E3E for ; Mon, 8 Aug 2016 23:51:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89BFB1B19 for ; Mon, 8 Aug 2016 23:51:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22c.google.com with SMTP id o80so171267596wme.1 for ; Mon, 08 Aug 2016 16:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZcFZzA7RfwJVoXalhaf5EPqM7mbNgg+uW33FofACogw=; b=rkBQD5fypVy4K/OvBYs9RZ2tGT6wbCn6MoOVKVJieT0l/1qB9wfD1l44zzJqMYHYqE uHenhhTzoRMWrvpaTc5ZFZuK8dspWR7qY9fAQvpiripKEDdeV3UA3QQT096lr6rn/Cre Sywa3X1/7JCYU9YHwwdpHPBkj3lWuXPaqw0a0R7eJydK04DqeLE4g0SC0iewSQzze1eU nuPhSkcl35SmUDH9ilzQQKHrbnwImlb9bbjsjcfIQDQ53Cipm9OpIrF7uY8hd+fOPLCg KJJ2VmVRTzbBraOWcQfd0K9hLqg7z8xdObfpd/TRrv/9Yb2x6nSwQBY1LyIS/f9vpJEI T/Gg== 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; bh=ZcFZzA7RfwJVoXalhaf5EPqM7mbNgg+uW33FofACogw=; b=DBaLwOyGnZ/oSe1wrpXyc3FfZqG5sRHEsQwClwQxaSJuVo4K1Ix8OG1P2y4ERUPJ1+ iVvNgsGh4vL01rZgV99p/ZFM2k+Xb0B1L3dG/uerxLAZLP95sbxIxYLX2K1BWNP/JA73 q1zWix7A9PwhTryxw3gbGsaGyHCqE7uRRygl7XyNr6ZmUTmJgLkFQQARnJO6zbb+/nhH CCf7+vU53Z0AxLIkbkvQfS2rB5fxLp9Bnfk2UmLAMGGEx+TZaiViTKkjlwmF/pdtSKy6 CYju0WPCDueGIms+vujvSZaTMyBAqGsDf989Hx9cKJi6NViUgseEnmYZ9AAgDdD2nptB QpRg== X-Gm-Message-State: AEkoouvkjnBFgrjoDh2cHPoIMYcbRA/xyuID9rnnCf+qD5bYCQ7NJ/HKVQ/C3geLYKmyBTWZJ/RzdwSwqk7P87b1 X-Received: by 10.28.17.138 with SMTP id 132mr17651800wmr.81.1470700295900; Mon, 08 Aug 2016 16:51:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.73.99 with HTTP; Mon, 8 Aug 2016 16:51:35 -0700 (PDT) In-Reply-To: <20160808234332.GA22449@wkstn-mjohnston.west.isilon.com> References: <201608082025.u78KP4aE048791@repo.freebsd.org> <20160808234332.GA22449@wkstn-mjohnston.west.isilon.com> From: Oliver Pinter Date: Tue, 9 Aug 2016 01:51:35 +0200 Message-ID: Subject: Re: svn commit: r303855 - in head/sys: kern sys To: Mark Johnston Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Bryan Drewery Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 08 Aug 2016 23:51:38 -0000 (Added bdrewery to CC, since I'm talking with him on IRC.) On Tue, Aug 9, 2016 at 1:43 AM, Mark Johnston wrote: > On Tue, Aug 09, 2016 at 12:53:47AM +0200, Oliver Pinter wrote: >> Hi! >> >> Can you please MFC back this change 10-STABLE together with the >> following: https://github.com/HardenedBSD/hardenedBSD/commit/576619e564618bca3675db57580d8e1f76bd2ac7 >> >> This issue is still exists on 10-STABLE, as you can test with the >> linked program from phabricator: >> https://people.freebsd.org/~mjg/reproducers/unp-gc-panic.c > > Hm, I don't think this could be MFCed directly. It changes the kernel > ABI by modifying the argument of dom_dispose(). This could be fixed in > stable/10 with a hack to call the unix domain socket code directly when > appropriate, which I think is preferable to the current state of things. > I'll look into it further. The question is how much external / out of tree components would use this ABI or how acceptable to break this ABI. I just grepped through the src tree for internal uses, and I found only these: op@opn hardenedBSD.git> git grep dom_dispose share/doc/smm/18.net/6.t: int (*dom_dispose)(); /* dispose of internalized rights */ share/man/man9/domain.9: void (*dom_dispose) /* dispose of internalized rights */ sys/kern/uipc_debug.c: db_printf("dom_dispose: %p\n", d->dom_dispose); sys/kern/uipc_socket.c: if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) sys/kern/uipc_socket.c: (*pr->pr_domain->dom_dispose)(so); sys/kern/uipc_socket.c: * dom_dispose() and sbrelease_internal() are an inlining of what was sys/kern/uipc_socket.c: * In order to avoid calling dom_dispose with the socket buffer mutex sys/kern/uipc_socket.c: if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) sys/kern/uipc_socket.c: (*pr->pr_domain->dom_dispose)(&aso); sys/kern/uipc_usrreq.c: .dom_dispose = unp_dispose_so, sys/sys/domain.h: void (*dom_dispose) /* dispose of internalized rights */ > >> >> On Mon, Aug 8, 2016 at 10:25 PM, Mark Johnston wrote: >> > Author: markj >> > Date: Mon Aug 8 20:25:04 2016 >> > New Revision: 303855 >> > URL: https://svnweb.freebsd.org/changeset/base/303855 >> > >> > Log: >> > Handle races with listening socket close when connecting a unix socket. >> > >> > If the listening socket is closed while sonewconn() is executing, the >> > nascent child socket is aborted, which results in recursion on the >> > unp_link lock when the child's pru_detach method is invoked. Fix this >> > by using a flag to mark such sockets, and skip a part of the socket's >> > teardown during detach. >> > >> > Reported by: Raviprakash Darbha >> > Tested by: pho >> > MFC after: 2 weeks >> > Differential Revision: https://reviews.freebsd.org/D7398 >> > >> > Modified: >> > head/sys/kern/uipc_usrreq.c >> > head/sys/sys/unpcb.h >> > >> > Modified: head/sys/kern/uipc_usrreq.c >> > ============================================================================== >> > --- head/sys/kern/uipc_usrreq.c Mon Aug 8 20:23:11 2016 (r303854) >> > +++ head/sys/kern/uipc_usrreq.c Mon Aug 8 20:25:04 2016 (r303855) >> > @@ -430,6 +430,8 @@ uipc_attach(struct socket *so, int proto >> > unp->unp_socket = so; >> > so->so_pcb = unp; >> > unp->unp_refcount = 1; >> > + if (so->so_head != NULL) >> > + unp->unp_flags |= UNP_NASCENT; >> > >> > UNP_LIST_LOCK(); >> > unp->unp_gencnt = ++unp_gencnt; >> > @@ -652,14 +654,22 @@ uipc_detach(struct socket *so) >> > unp = sotounpcb(so); >> > KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); >> > >> > - UNP_LINK_WLOCK(); >> > + vp = NULL; >> > + local_unp_rights = 0; >> > + >> > UNP_LIST_LOCK(); >> > - UNP_PCB_LOCK(unp); >> > LIST_REMOVE(unp, unp_link); >> > unp->unp_gencnt = ++unp_gencnt; >> > --unp_count; >> > UNP_LIST_UNLOCK(); >> > >> > + if ((unp->unp_flags & UNP_NASCENT) != 0) { >> > + UNP_PCB_LOCK(unp); >> > + goto teardown; >> > + } >> > + UNP_LINK_WLOCK(); >> > + UNP_PCB_LOCK(unp); >> > + >> > /* >> > * XXXRW: Should assert vp->v_socket == so. >> > */ >> > @@ -687,6 +697,7 @@ uipc_detach(struct socket *so) >> > } >> > local_unp_rights = unp_rights; >> > UNP_LINK_WUNLOCK(); >> > +teardown: >> > unp->unp_socket->so_pcb = NULL; >> > saved_unp_addr = unp->unp_addr; >> > unp->unp_addr = NULL; >> > @@ -1473,6 +1484,7 @@ unp_connect2(struct socket *so, struct s >> > >> > if (so2->so_type != so->so_type) >> > return (EPROTOTYPE); >> > + unp2->unp_flags &= ~UNP_NASCENT; >> > unp->unp_conn = unp2; >> > >> > switch (so->so_type) { >> > >> > Modified: head/sys/sys/unpcb.h >> > ============================================================================== >> > --- head/sys/sys/unpcb.h Mon Aug 8 20:23:11 2016 (r303854) >> > +++ head/sys/sys/unpcb.h Mon Aug 8 20:25:04 2016 (r303855) >> > @@ -103,11 +103,6 @@ struct unpcb { >> > #define UNP_WANTCRED 0x004 /* credentials wanted */ >> > #define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ >> > >> > -#define UNPGC_REF 0x1 /* unpcb has external ref. */ >> > -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ >> > -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ >> > -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ >> > - >> > /* >> > * These flags are used to handle non-atomicity in connect() and bind() >> > * operations on a socket: in particular, to avoid races between multiple >> > @@ -115,6 +110,15 @@ struct unpcb { >> > */ >> > #define UNP_CONNECTING 0x010 /* Currently connecting. */ >> > #define UNP_BINDING 0x020 /* Currently binding. */ >> > +#define UNP_NASCENT 0x040 /* Newborn child socket. */ >> > + >> > +/* >> > + * Flags in unp_gcflag. >> > + */ >> > +#define UNPGC_REF 0x1 /* unpcb has external ref. */ >> > +#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ >> > +#define UNPGC_SCANNED 0x4 /* Has been scanned. */ >> > +#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ >> > >> > #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) >> > >> > _______________________________________________ >> > svn-src-head@freebsd.org mailing list >> > https://lists.freebsd.org/mailman/listinfo/svn-src-head >> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Aug 9 01:05:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92018BB3A83; Tue, 9 Aug 2016 01:05:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61EA316A5; Tue, 9 Aug 2016 01:05:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7915Tce051814; Tue, 9 Aug 2016 01:05:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7915TPi051813; Tue, 9 Aug 2016 01:05:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608090105.u7915TPi051813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 9 Aug 2016 01:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303862 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 01:05:30 -0000 Author: adrian Date: Tue Aug 9 01:05:29 2016 New Revision: 303862 URL: https://svnweb.freebsd.org/changeset/base/303862 Log: [ar9300] don't program a negative readytime. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Mon Aug 8 23:18:27 2016 (r303861) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Tue Aug 9 01:05:29 2016 (r303862) @@ -447,6 +447,8 @@ ar9300_reset_tx_queue(struct ath_hal *ah */ if (value < 10) value = 10; + if (value < 0) + value = 10; HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: defaulting to rdytime = %d uS\n", __func__, value); From owner-svn-src-head@freebsd.org Tue Aug 9 02:16:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23731BB20D7; Tue, 9 Aug 2016 02:16:23 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F5F1D60; Tue, 9 Aug 2016 02:16:22 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u792GMII077535; Tue, 9 Aug 2016 02:16:22 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u792GMn7077531; Tue, 9 Aug 2016 02:16:22 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201608090216.u792GMn7077531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Tue, 9 Aug 2016 02:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303863 - in head/sys: conf kern netinet netinet6 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.22 Precedence: list List-Id: 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, 09 Aug 2016 02:16:23 -0000 Author: stevek Date: Tue Aug 9 02:16:21 2016 New Revision: 303863 URL: https://svnweb.freebsd.org/changeset/base/303863 Log: Move IPv4-specific jail functions to new file netinet/in_jail.c _prison_check_ip4 renamed to prison_check_ip4_locked Move IPv6-specific jail functions to new file netinet6/in6_jail.c _prison_check_ip6 renamed to prison_check_ip6_locked Add appropriate prototypes to sys/sys/jail.h Adjust kern_jail.c to call prison_check_ip4_locked and prison_check_ip6_locked accordingly. Add netinet/in_jail.c and netinet6/in6_jail.c to the list of files that need to be built when INET and INET6, respectively, are configured in the kernel configuration file. Reviewed by: jtl Approved by: sjg (mentor) Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D6799 Added: head/sys/netinet/in_jail.c (contents, props changed) head/sys/netinet6/in6_jail.c (contents, props changed) Modified: head/sys/conf/files head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 9 01:05:29 2016 (r303862) +++ head/sys/conf/files Tue Aug 9 02:16:21 2016 (r303863) @@ -3748,6 +3748,7 @@ netinet/in_fib.c optional inet netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet +netinet/in_jail.c optional inet netinet/in_mcast.c optional inet netinet/in_pcb.c optional inet | inet6 netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup @@ -3816,6 +3817,7 @@ netinet6/in6_cksum.c optional inet6 netinet6/in6_fib.c optional inet6 netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 +netinet6/in6_jail.c optional inet6 netinet6/in6_mcast.c optional inet6 netinet6/in6_pcb.c optional inet6 netinet6/in6_pcbgroup.c optional inet6 pcbgroup Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Aug 9 01:05:29 2016 (r303862) +++ head/sys/kern/kern_jail.c Tue Aug 9 02:16:21 2016 (r303863) @@ -130,14 +130,6 @@ static void prison_racct_attach(struct p static void prison_racct_modify(struct prison *pr); static void prison_racct_detach(struct prison *pr); #endif -#ifdef INET -static int _prison_check_ip4(const struct prison *, const struct in_addr *); -static int prison_restrict_ip4(struct prison *pr, struct in_addr *newip4); -#endif -#ifdef INET6 -static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6); -static int prison_restrict_ip6(struct prison *pr, struct in6_addr *newip6); -#endif /* Flags for prison_deref */ #define PD_DEREF 0x01 @@ -252,54 +244,6 @@ prison0_init(void) strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); } -#ifdef INET -static int -qcmp_v4(const void *ip1, const void *ip2) -{ - in_addr_t iaa, iab; - - /* - * We need to compare in HBO here to get the list sorted as expected - * by the result of the code. Sorting NBO addresses gives you - * interesting results. If you do not understand, do not try. - */ - iaa = ntohl(((const struct in_addr *)ip1)->s_addr); - iab = ntohl(((const struct in_addr *)ip2)->s_addr); - - /* - * Do not simply return the difference of the two numbers, the int is - * not wide enough. - */ - if (iaa > iab) - return (1); - else if (iaa < iab) - return (-1); - else - return (0); -} -#endif - -#ifdef INET6 -static int -qcmp_v6(const void *ip1, const void *ip2) -{ - const struct in6_addr *ia6a, *ia6b; - int i, rc; - - ia6a = (const struct in6_addr *)ip1; - ia6b = (const struct in6_addr *)ip2; - - rc = 0; - for (i = 0; rc == 0 && i < sizeof(struct in6_addr); i++) { - if (ia6a->s6_addr[i] > ia6b->s6_addr[i]) - rc = 1; - else if (ia6a->s6_addr[i] < ia6b->s6_addr[i]) - rc = -1; - } - return (rc); -} -#endif - /* * struct jail_args { * struct jail *jail; @@ -845,7 +789,8 @@ kern_jail_set(struct thread *td, struct * address to connect from. */ if (ip4s > 1) - qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), qcmp_v4); + qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), + prison_qcmp_v4); /* * Check for duplicate addresses and do some simple * zero and broadcast checks. If users give other bogus @@ -893,7 +838,8 @@ kern_jail_set(struct thread *td, struct ip6 = malloc(ip6s * sizeof(*ip6), M_PRISON, M_WAITOK); bcopy(op, ip6, ip6s * sizeof(*ip6)); if (ip6s > 1) - qsort(ip6 + 1, ip6s - 1, sizeof(*ip6), qcmp_v6); + qsort(ip6 + 1, ip6s - 1, sizeof(*ip6), + prison_qcmp_v6); for (ii = 0; ii < ip6s; ii++) { if (IN6_IS_ADDR_UNSPECIFIED(&ip6[ii])) { error = EINVAL; @@ -1486,7 +1432,8 @@ kern_jail_set(struct thread *td, struct (ip4s == 1 && tpr->pr_ip4s == 1)) continue; for (ii = 0; ii < ip4s; ii++) { - if (_prison_check_ip4(tpr, &ip4[ii]) == 0) { + if (prison_check_ip4_locked(tpr, &ip4[ii]) == + 0) { error = EADDRINUSE; vfs_opterror(opts, "IPv4 addresses clash"); @@ -1552,7 +1499,8 @@ kern_jail_set(struct thread *td, struct (ip6s == 1 && tpr->pr_ip6s == 1)) continue; for (ii = 0; ii < ip6s; ii++) { - if (_prison_check_ip6(tpr, &ip6[ii]) == 0) { + if (prison_check_ip6_locked(tpr, &ip6[ii]) == + 0) { error = EADDRINUSE; vfs_opterror(opts, "IPv6 addresses clash"); @@ -2770,684 +2718,6 @@ prison_proc_free(struct prison *pr) mtx_unlock(&pr->pr_mtx); } - -#ifdef INET -/* - * Restrict a prison's IP address list with its parent's, possibly replacing - * it. Return true if the replacement buffer was used (or would have been). - */ -static int -prison_restrict_ip4(struct prison *pr, struct in_addr *newip4) -{ - int ii, ij, used; - struct prison *ppr; - - ppr = pr->pr_parent; - if (!(pr->pr_flags & PR_IP4_USER)) { - /* This has no user settings, so just copy the parent's list. */ - if (pr->pr_ip4s < ppr->pr_ip4s) { - /* - * There's no room for the parent's list. Use the - * new list buffer, which is assumed to be big enough - * (if it was passed). If there's no buffer, try to - * allocate one. - */ - used = 1; - if (newip4 == NULL) { - newip4 = malloc(ppr->pr_ip4s * sizeof(*newip4), - M_PRISON, M_NOWAIT); - if (newip4 != NULL) - used = 0; - } - if (newip4 != NULL) { - bcopy(ppr->pr_ip4, newip4, - ppr->pr_ip4s * sizeof(*newip4)); - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = newip4; - pr->pr_ip4s = ppr->pr_ip4s; - } - return (used); - } - pr->pr_ip4s = ppr->pr_ip4s; - if (pr->pr_ip4s > 0) - bcopy(ppr->pr_ip4, pr->pr_ip4, - pr->pr_ip4s * sizeof(*newip4)); - else if (pr->pr_ip4 != NULL) { - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = NULL; - } - } else if (pr->pr_ip4s > 0) { - /* Remove addresses that aren't in the parent. */ - for (ij = 0; ij < ppr->pr_ip4s; ij++) - if (pr->pr_ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) - break; - if (ij < ppr->pr_ip4s) - ii = 1; - else { - bcopy(pr->pr_ip4 + 1, pr->pr_ip4, - --pr->pr_ip4s * sizeof(*pr->pr_ip4)); - ii = 0; - } - for (ij = 1; ii < pr->pr_ip4s; ) { - if (pr->pr_ip4[ii].s_addr == ppr->pr_ip4[0].s_addr) { - ii++; - continue; - } - switch (ij >= ppr->pr_ip4s ? -1 : - qcmp_v4(&pr->pr_ip4[ii], &ppr->pr_ip4[ij])) { - case -1: - bcopy(pr->pr_ip4 + ii + 1, pr->pr_ip4 + ii, - (--pr->pr_ip4s - ii) * sizeof(*pr->pr_ip4)); - break; - case 0: - ii++; - ij++; - break; - case 1: - ij++; - break; - } - } - if (pr->pr_ip4s == 0) { - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = NULL; - } - } - return (0); -} - -/* - * Pass back primary IPv4 address of this jail. - * - * If not restricted return success but do not alter the address. Caller has - * to make sure to initialize it correctly (e.g. INADDR_ANY). - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. - * Address returned in NBO. - */ -int -prison_get_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour - * of the primary jail IPv4 address. Only in this case *ia will be updated and - * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv4. - */ -int -prison_saddrsel_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - struct in_addr lia; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - if (!jailed(cred)) - return (1); - - pr = cred->cr_prison; - if (pr->pr_flags & PR_IP4_SADDRSEL) - return (1); - - lia.s_addr = INADDR_ANY; - error = prison_get_ip4(cred, &lia); - if (error) - return (error); - if (lia.s_addr == INADDR_ANY) - return (1); - - ia->s_addr = lia.s_addr; - return (0); -} - -/* - * Return true if pr1 and pr2 have the same IPv4 address restrictions. - */ -int -prison_equal_ip4(struct prison *pr1, struct prison *pr2) -{ - - if (pr1 == pr2) - return (1); - - /* - * No need to lock since the PR_IP4_USER flag can't be altered for - * existing prisons. - */ - while (pr1 != &prison0 && -#ifdef VIMAGE - !(pr1->pr_flags & PR_VNET) && -#endif - !(pr1->pr_flags & PR_IP4_USER)) - pr1 = pr1->pr_parent; - while (pr2 != &prison0 && -#ifdef VIMAGE - !(pr2->pr_flags & PR_VNET) && -#endif - !(pr2->pr_flags & PR_IP4_USER)) - pr2 = pr2->pr_parent; - return (pr1 == pr2); -} - -/* - * Make sure our (source) address is set to something meaningful to this - * jail. - * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO and returned in NBO. - */ -int -prison_local_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - struct in_addr ia0; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - ia0.s_addr = ntohl(ia->s_addr); - if (ia0.s_addr == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - if (ia0.s_addr == INADDR_ANY) { - /* - * In case there is only 1 IPv4 address, bind directly. - */ - if (pr->pr_ip4s == 1) - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - error = _prison_check_ip4(pr, ia); - mtx_unlock(&pr->pr_mtx); - return (error); -} - -/* - * Rewrite destination address in case we will connect to loopback address. - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. - * Address passed in in NBO and returned in NBO. - */ -int -prison_remote_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (ntohl(ia->s_addr) == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - /* - * Return success because nothing had to be changed. - */ - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Check if given address belongs to the jail referenced by cred/prison. - * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO. - */ -static int -_prison_check_ip4(const struct prison *pr, const struct in_addr *ia) -{ - int i, a, z, d; - - /* - * Check the primary IP. - */ - if (pr->pr_ip4[0].s_addr == ia->s_addr) - return (0); - - /* - * All the other IPs are sorted so we can do a binary search. - */ - a = 0; - z = pr->pr_ip4s - 2; - while (a <= z) { - i = (a + z) / 2; - d = qcmp_v4(&pr->pr_ip4[i+1], ia); - if (d > 0) - z = i - 1; - else if (d < 0) - a = i + 1; - else - return (0); - } - - return (EADDRNOTAVAIL); -} - -int -prison_check_ip4(const struct ucred *cred, const struct in_addr *ia) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - error = _prison_check_ip4(pr, ia); - mtx_unlock(&pr->pr_mtx); - return (error); -} -#endif - -#ifdef INET6 -static int -prison_restrict_ip6(struct prison *pr, struct in6_addr *newip6) -{ - int ii, ij, used; - struct prison *ppr; - - ppr = pr->pr_parent; - if (!(pr->pr_flags & PR_IP6_USER)) { - /* This has no user settings, so just copy the parent's list. */ - if (pr->pr_ip6s < ppr->pr_ip6s) { - /* - * There's no room for the parent's list. Use the - * new list buffer, which is assumed to be big enough - * (if it was passed). If there's no buffer, try to - * allocate one. - */ - used = 1; - if (newip6 == NULL) { - newip6 = malloc(ppr->pr_ip6s * sizeof(*newip6), - M_PRISON, M_NOWAIT); - if (newip6 != NULL) - used = 0; - } - if (newip6 != NULL) { - bcopy(ppr->pr_ip6, newip6, - ppr->pr_ip6s * sizeof(*newip6)); - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = newip6; - pr->pr_ip6s = ppr->pr_ip6s; - } - return (used); - } - pr->pr_ip6s = ppr->pr_ip6s; - if (pr->pr_ip6s > 0) - bcopy(ppr->pr_ip6, pr->pr_ip6, - pr->pr_ip6s * sizeof(*newip6)); - else if (pr->pr_ip6 != NULL) { - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = NULL; - } - } else if (pr->pr_ip6s > 0) { - /* Remove addresses that aren't in the parent. */ - for (ij = 0; ij < ppr->pr_ip6s; ij++) - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], - &ppr->pr_ip6[ij])) - break; - if (ij < ppr->pr_ip6s) - ii = 1; - else { - bcopy(pr->pr_ip6 + 1, pr->pr_ip6, - --pr->pr_ip6s * sizeof(*pr->pr_ip6)); - ii = 0; - } - for (ij = 1; ii < pr->pr_ip6s; ) { - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[ii], - &ppr->pr_ip6[0])) { - ii++; - continue; - } - switch (ij >= ppr->pr_ip6s ? -1 : - qcmp_v6(&pr->pr_ip6[ii], &ppr->pr_ip6[ij])) { - case -1: - bcopy(pr->pr_ip6 + ii + 1, pr->pr_ip6 + ii, - (--pr->pr_ip6s - ii) * sizeof(*pr->pr_ip6)); - break; - case 0: - ii++; - ij++; - break; - case 1: - ij++; - break; - } - } - if (pr->pr_ip6s == 0) { - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = NULL; - } - } - return 0; -} - -/* - * Pass back primary IPv6 address for this jail. - * - * If not restricted return success but do not alter the address. Caller has - * to make sure to initialize it correctly (e.g. IN6ADDR_ANY_INIT). - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. - */ -int -prison_get_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour - * of the primary jail IPv6 address. Only in this case *ia will be updated and - * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv6. - */ -int -prison_saddrsel_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - struct in6_addr lia6; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - if (!jailed(cred)) - return (1); - - pr = cred->cr_prison; - if (pr->pr_flags & PR_IP6_SADDRSEL) - return (1); - - lia6 = in6addr_any; - error = prison_get_ip6(cred, &lia6); - if (error) - return (error); - if (IN6_IS_ADDR_UNSPECIFIED(&lia6)) - return (1); - - bcopy(&lia6, ia6, sizeof(struct in6_addr)); - return (0); -} - -/* - * Return true if pr1 and pr2 have the same IPv6 address restrictions. - */ -int -prison_equal_ip6(struct prison *pr1, struct prison *pr2) -{ - - if (pr1 == pr2) - return (1); - - while (pr1 != &prison0 && -#ifdef VIMAGE - !(pr1->pr_flags & PR_VNET) && -#endif - !(pr1->pr_flags & PR_IP6_USER)) - pr1 = pr1->pr_parent; - while (pr2 != &prison0 && -#ifdef VIMAGE - !(pr2->pr_flags & PR_VNET) && -#endif - !(pr2->pr_flags & PR_IP6_USER)) - pr2 = pr2->pr_parent; - return (pr1 == pr2); -} - -/* - * Make sure our (source) address is set to something meaningful to this jail. - * - * v6only should be set based on (inp->inp_flags & IN6P_IPV6_V6ONLY != 0) - * when needed while binding. - * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. - */ -int -prison_local_ip6(struct ucred *cred, struct in6_addr *ia6, int v6only) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - if (IN6_IS_ADDR_UNSPECIFIED(ia6)) { - /* - * In case there is only 1 IPv6 address, and v6only is true, - * then bind directly. - */ - if (v6only != 0 && pr->pr_ip6s == 1) - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - error = _prison_check_ip6(pr, ia6); - mtx_unlock(&pr->pr_mtx); - return (error); -} - -/* - * Rewrite destination address in case we will connect to loopback address. - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. - */ -int -prison_remote_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - /* - * Return success because nothing had to be changed. - */ - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Check if given address belongs to the jail referenced by cred/prison. - * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. - */ -static int -_prison_check_ip6(struct prison *pr, struct in6_addr *ia6) -{ - int i, a, z, d; - - /* - * Check the primary IP. - */ - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], ia6)) - return (0); - - /* - * All the other IPs are sorted so we can do a binary search. - */ - a = 0; - z = pr->pr_ip6s - 2; - while (a <= z) { - i = (a + z) / 2; - d = qcmp_v6(&pr->pr_ip6[i+1], ia6); - if (d > 0) - z = i - 1; - else if (d < 0) - a = i + 1; - else - return (0); - } - - return (EADDRNOTAVAIL); -} - -int -prison_check_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - error = _prison_check_ip6(pr, ia6); - mtx_unlock(&pr->pr_mtx); - return (error); -} -#endif - /* * Check if a jail supports the given address family. * Added: head/sys/netinet/in_jail.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_jail.c Tue Aug 9 02:16:21 2016 (r303863) @@ -0,0 +1,432 @@ +/*- + * Copyright (c) 1999 Poul-Henning Kamp. + * Copyright (c) 2008 Bjoern A. Zeeb. + * Copyright (c) 2009 James Gritton. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" +#include "opt_ddb.h" +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +int +prison_qcmp_v4(const void *ip1, const void *ip2) +{ + in_addr_t iaa, iab; + + /* + * We need to compare in HBO here to get the list sorted as expected + * by the result of the code. Sorting NBO addresses gives you + * interesting results. If you do not understand, do not try. + */ + iaa = ntohl(((const struct in_addr *)ip1)->s_addr); + iab = ntohl(((const struct in_addr *)ip2)->s_addr); + + /* + * Do not simply return the difference of the two numbers, the int is + * not wide enough. + */ + if (iaa > iab) + return (1); + else if (iaa < iab) + return (-1); + else + return (0); +} + +/* + * Restrict a prison's IP address list with its parent's, possibly replacing + * it. Return true if the replacement buffer was used (or would have been). + */ +int +prison_restrict_ip4(struct prison *pr, struct in_addr *newip4) +{ + int ii, ij, used; + struct prison *ppr; + + ppr = pr->pr_parent; + if (!(pr->pr_flags & PR_IP4_USER)) { + /* This has no user settings, so just copy the parent's list. */ + if (pr->pr_ip4s < ppr->pr_ip4s) { + /* + * There's no room for the parent's list. Use the + * new list buffer, which is assumed to be big enough + * (if it was passed). If there's no buffer, try to + * allocate one. + */ + used = 1; + if (newip4 == NULL) { + newip4 = malloc(ppr->pr_ip4s * sizeof(*newip4), + M_PRISON, M_NOWAIT); + if (newip4 != NULL) + used = 0; + } + if (newip4 != NULL) { + bcopy(ppr->pr_ip4, newip4, + ppr->pr_ip4s * sizeof(*newip4)); + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = newip4; + pr->pr_ip4s = ppr->pr_ip4s; + } + return (used); + } + pr->pr_ip4s = ppr->pr_ip4s; + if (pr->pr_ip4s > 0) + bcopy(ppr->pr_ip4, pr->pr_ip4, + pr->pr_ip4s * sizeof(*newip4)); + else if (pr->pr_ip4 != NULL) { + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = NULL; + } + } else if (pr->pr_ip4s > 0) { + /* Remove addresses that aren't in the parent. */ + for (ij = 0; ij < ppr->pr_ip4s; ij++) + if (pr->pr_ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) + break; + if (ij < ppr->pr_ip4s) + ii = 1; + else { + bcopy(pr->pr_ip4 + 1, pr->pr_ip4, + --pr->pr_ip4s * sizeof(*pr->pr_ip4)); + ii = 0; + } + for (ij = 1; ii < pr->pr_ip4s; ) { + if (pr->pr_ip4[ii].s_addr == ppr->pr_ip4[0].s_addr) { + ii++; + continue; + } + switch (ij >= ppr->pr_ip4s ? -1 : + prison_qcmp_v4(&pr->pr_ip4[ii], &ppr->pr_ip4[ij])) { + case -1: + bcopy(pr->pr_ip4 + ii + 1, pr->pr_ip4 + ii, + (--pr->pr_ip4s - ii) * sizeof(*pr->pr_ip4)); + break; + case 0: + ii++; + ij++; + break; + case 1: + ij++; + break; + } + } + if (pr->pr_ip4s == 0) { + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = NULL; + } + } + return (0); +} + +/* + * Pass back primary IPv4 address of this jail. + * + * If not restricted return success but do not alter the address. Caller has + * to make sure to initialize it correctly (e.g. INADDR_ANY). *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 9 04:50:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7F8BB25FB; Tue, 9 Aug 2016 04:50:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39D2F170D; Tue, 9 Aug 2016 04:50:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u794oL20033702; Tue, 9 Aug 2016 04:50:21 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u794oKZL033698; Tue, 9 Aug 2016 04:50:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608090450.u794oKZL033698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 9 Aug 2016 04:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303867 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 04:50:22 -0000 Author: sephe Date: Tue Aug 9 04:50:20 2016 New Revision: 303867 URL: https://svnweb.freebsd.org/changeset/base/303867 Log: hyperv/hn: Move gpa array out of netvsc_packet. Prepare to deprecate the netvsc_packet. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7436 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 9 04:41:33 2016 (r303866) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 9 04:50:20 2016 (r303867) @@ -799,7 +799,8 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct vmbus_channel *chan, netvsc_packet *pkt) +hv_nv_on_send(struct vmbus_channel *chan, + netvsc_packet *pkt, struct vmbus_gpa *gpa, int gpa_cnt) { nvsp_msg send_msg; int ret; @@ -818,8 +819,8 @@ hv_nv_on_send(struct vmbus_channel *chan send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_size = pkt->send_buf_section_size; - if (pkt->gpa_cnt) { - ret = vmbus_chan_send_sglist(chan, pkt->gpa, pkt->gpa_cnt, + if (gpa_cnt) { + ret = vmbus_chan_send_sglist(chan, gpa, gpa_cnt, &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); } else { ret = vmbus_chan_send(chan, Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 9 04:41:33 2016 (r303866) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 9 04:50:20 2016 (r303867) @@ -1137,8 +1137,6 @@ typedef struct netvsc_packet_ { void *rndis_mesg; uint32_t tot_data_buf_len; void *data; - uint32_t gpa_cnt; - struct vmbus_gpa gpa[NETVSC_PACKET_MAXPAGE]; } netvsc_packet; typedef struct { @@ -1216,6 +1214,9 @@ struct hn_tx_ring { bus_dma_tag_t hn_tx_data_dtag; uint64_t hn_csum_assist; + int hn_gpa_cnt; + struct vmbus_gpa hn_gpa[NETVSC_PACKET_MAXPAGE]; + u_long hn_no_txdescs; u_long hn_send_failed; u_long hn_txdma_failed; @@ -1275,7 +1276,8 @@ netvsc_dev *hv_nv_on_device_add(struct h void *additional_info, struct hn_rx_ring *rxr); int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); -int hv_nv_on_send(struct vmbus_channel *chan, netvsc_packet *pkt); +int hv_nv_on_send(struct vmbus_channel *chan, netvsc_packet *pkt, + struct vmbus_gpa *gpa, int gpa_cnt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); void hv_nv_subchan_attach(struct vmbus_channel *chan, struct hn_rx_ring *rxr); Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 9 04:41:33 2016 (r303866) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 9 04:50:20 2016 (r303867) @@ -993,7 +993,7 @@ hn_encap(struct hn_tx_ring *txr, struct packet->send_buf_section_idx = send_buf_section_idx; packet->send_buf_section_size = packet->tot_data_buf_len; - packet->gpa_cnt = 0; + txr->hn_gpa_cnt = 0; txr->hn_tx_chimney++; goto done; } @@ -1019,19 +1019,19 @@ hn_encap(struct hn_tx_ring *txr, struct } *m_head0 = m_head; - packet->gpa_cnt = nsegs + HV_RF_NUM_TX_RESERVED_PAGE_BUFS; + txr->hn_gpa_cnt = nsegs + HV_RF_NUM_TX_RESERVED_PAGE_BUFS; /* send packet with page buffer */ - packet->gpa[0].gpa_page = atop(txd->rndis_msg_paddr); - packet->gpa[0].gpa_ofs = txd->rndis_msg_paddr & PAGE_MASK; - packet->gpa[0].gpa_len = rndis_msg_size; + txr->hn_gpa[0].gpa_page = atop(txd->rndis_msg_paddr); + txr->hn_gpa[0].gpa_ofs = txd->rndis_msg_paddr & PAGE_MASK; + txr->hn_gpa[0].gpa_len = rndis_msg_size; /* * Fill the page buffers with mbuf info starting at index * HV_RF_NUM_TX_RESERVED_PAGE_BUFS. */ for (i = 0; i < nsegs; ++i) { - struct vmbus_gpa *gpa = &packet->gpa[ + struct vmbus_gpa *gpa = &txr->hn_gpa[ i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS]; gpa->gpa_page = atop(segs[i].ds_addr); @@ -1068,7 +1068,8 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(txr->hn_chan, &txd->netvsc_pkt); + error = hv_nv_on_send(txr->hn_chan, &txd->netvsc_pkt, + txr->hn_gpa, txr->hn_gpa_cnt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 9 04:41:33 2016 (r303866) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 9 04:50:20 2016 (r303867) @@ -238,33 +238,31 @@ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type) { - int ret; netvsc_packet *packet; netvsc_dev *net_dev = device->net_dev; int send_buf_section_idx; + struct vmbus_gpa gpa[2]; + int gpa_cnt; /* Set up the packet to send it */ packet = &request->pkt; packet->is_data_pkt = FALSE; packet->tot_data_buf_len = request->request_msg.msg_len; - packet->gpa_cnt = 1; - packet->gpa[0].gpa_page = - hv_get_phys_addr(&request->request_msg) >> PAGE_SHIFT; - packet->gpa[0].gpa_len = request->request_msg.msg_len; - packet->gpa[0].gpa_ofs = - (unsigned long)&request->request_msg & (PAGE_SIZE - 1); - - if (packet->gpa[0].gpa_ofs + packet->gpa[0].gpa_len > PAGE_SIZE) { - packet->gpa_cnt = 2; - packet->gpa[0].gpa_len = PAGE_SIZE - packet->gpa[0].gpa_ofs; - packet->gpa[1].gpa_page = - hv_get_phys_addr((char*)&request->request_msg + - packet->gpa[0].gpa_len) >> PAGE_SHIFT; - packet->gpa[1].gpa_ofs = 0; - packet->gpa[1].gpa_len = request->request_msg.msg_len - - packet->gpa[0].gpa_len; + gpa_cnt = 1; + gpa[0].gpa_page = hv_get_phys_addr(&request->request_msg) >> PAGE_SHIFT; + gpa[0].gpa_len = request->request_msg.msg_len; + gpa[0].gpa_ofs = (unsigned long)&request->request_msg & (PAGE_SIZE - 1); + + if (gpa[0].gpa_ofs + gpa[0].gpa_len > PAGE_SIZE) { + gpa_cnt = 2; + gpa[0].gpa_len = PAGE_SIZE - gpa[0].gpa_ofs; + gpa[1].gpa_page = + hv_get_phys_addr((char*)&request->request_msg + + gpa[0].gpa_len) >> PAGE_SHIFT; + gpa[1].gpa_ofs = 0; + gpa[1].gpa_len = request->request_msg.msg_len - gpa[0].gpa_len; } packet->compl.send.send_completion_context = request; /* packet */ @@ -286,7 +284,7 @@ hv_rf_send_request(rndis_device *device, memcpy(dest, &request->request_msg, request->request_msg.msg_len); packet->send_buf_section_idx = send_buf_section_idx; packet->send_buf_section_size = packet->tot_data_buf_len; - packet->gpa_cnt = 0; + gpa_cnt = 0; goto sendit; } /* Failed to allocate chimney send buffer; move on */ @@ -295,9 +293,8 @@ hv_rf_send_request(rndis_device *device, packet->send_buf_section_size = 0; sendit: - ret = hv_nv_on_send(device->net_dev->sc->hn_prichan, packet); - - return (ret); + return hv_nv_on_send(device->net_dev->sc->hn_prichan, packet, + gpa, gpa_cnt); } /* From owner-svn-src-head@freebsd.org Tue Aug 9 05:11:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD3CBB2ACA; Tue, 9 Aug 2016 05:11:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2D89213B7; Tue, 9 Aug 2016 05:11:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA06554; Tue, 09 Aug 2016 08:11:49 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bWzKP-0005d8-8k; Tue, 09 Aug 2016 08:11:49 +0300 Subject: Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: Navdeep Parhar , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201608050623.u756N695018889@repo.freebsd.org> From: Andriy Gapon Message-ID: <1b2fa1c4-d219-7b0c-bea4-94ae325565e0@FreeBSD.org> Date: Tue, 9 Aug 2016 08:10:53 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 05:11:53 -0000 On 09/08/2016 02:48, Navdeep Parhar wrote: > Hello Andriy, > > I'm at r303837 and have had two panics today in zfs_rename. I have a > core for a kernel built with -O0. Let me know if you think it's related > to this commit and need more information. This is the stack: > > (also available at https://people.freebsd.org/~np/rename_panic.txt in > case the wide lines are hard to read in email). Thank you very much for the report. More details are required for analysis. In frame 11 I would like to see objects pointed to by all arguments and additionally local variables tdzp, sdzp, zfsvfs and zilog. > (kgdb) bt > #0 doadump (textdump=0) at /root/ws/head/sys/kern/kern_shutdown.c:298 > #1 0xffffffff803f8692 in db_dump (dummy=-2100833195, dummy2=false, > dummy3=-1, dummy4=0xfffffe08604c6810 "") at > /root/ws/head/sys/ddb/db_command.c:533 > #2 0xffffffff803f847e in db_command (last_cmdp=0xffffffff821d40d8 > , cmd_table=0x0, dopager=1) at > /root/ws/head/sys/ddb/db_command.c:440 > #3 0xffffffff803f801e in db_command_loop () at > /root/ws/head/sys/ddb/db_command.c:493 > #4 0xffffffff803fcf13 in db_trap (type=12, code=0) at > /root/ws/head/sys/ddb/db_main.c:251 > #5 0xffffffff8100116f in kdb_trap (type=12, code=0, > tf=0xfffffe08604c6fe0) at /root/ws/head/sys/kern/subr_kdb.c:654 > #6 0xffffffff8163df24 in trap_fatal (frame=0xfffffe08604c6fe0, > eva=18446744069414584336) at /root/ws/head/sys/amd64/amd64/trap.c:836 > #7 0xffffffff8163e53b in trap_pfault (frame=0xfffffe08604c6fe0, > usermode=0) at /root/ws/head/sys/amd64/amd64/trap.c:763 > #8 0xffffffff8163d1e2 in trap (frame=0xfffffe08604c6fe0) at > /root/ws/head/sys/amd64/amd64/trap.c:442 > #9 0xffffffff8163e63a in trap_check (frame=0xfffffe08604c6fe0) at > /root/ws/head/sys/amd64/amd64/trap.c:635 > #10 > #11 0xffffffff82c7d455 in zfs_rename (sdvp=0xfffff80016e331d8, > svpp=0xfffffe08604c7318, scnp=0xfffffe08604c7750, > tdvp=0xfffff80156440000, tvpp=0xfffffe08604c7308, > tcnp=0xfffffe08604c7688, cr=0xfffff8001612e600) > at > /root/ws/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:3959 > #12 0xffffffff82c6f6a9 in zfs_freebsd_rename (ap=0xfffffe08604c73c8) at > /root/ws/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:5275 > #13 0xffffffff8187d484 in VOP_RENAME_APV (vop=0xffffffff82d19bb0 > , a=0xfffffe08604c73c8) at vnode_if.c:1547 > #14 0xffffffff810e5d41 in VOP_RENAME (fdvp=0xfffff80016e331d8, > fvp=0xfffff80174c02588, fcnp=0xfffffe08604c7750, > tdvp=0xfffff80156440000, tvp=0xfffff8017d7d1ce8, > tcnp=0xfffffe08604c7688) at ./vnode_if.h:636 > #15 0xffffffff810e5b17 in kern_renameat (td=0xfffff8010b855a40, > oldfd=-100, old=0x800a121a0 0x800a121a0>, newfd=-100, new=0x7fffffffcfee memory at address 0x7fffffffcfee>, > pathseg=UIO_USERSPACE) at /root/ws/head/sys/kern/vfs_syscalls.c:3553 > #16 0xffffffff810e53d7 in sys_rename (td=0xfffff8010b855a40, > uap=0xfffffe08604c7a58) at /root/ws/head/sys/kern/vfs_syscalls.c:3427 > #17 0xffffffff83ce244d in filemon_wrapper_rename (td=0xfffff8010b855a40, > uap=0xfffffe08604c7a58) at > /root/ws/head/sys/modules/filemon/../../dev/filemon/filemon_wrapper.c:240 > #18 0xffffffff8163f1a9 in syscallenter (td=0xfffff8010b855a40, > sa=0xfffffe08604c7a48) at > /root/ws/head/sys/amd64/amd64/../../kern/subr_syscall.c:135 > #19 0xffffffff8163e9ea in amd64_syscall (td=0xfffff8010b855a40, > traced=0) at /root/ws/head/sys/amd64/amd64/trap.c:942 > > Regards, > Navdeep > > > On 08/04/2016 23:23, Andriy Gapon wrote: >> Author: avg >> Date: Fri Aug 5 06:23:06 2016 >> New Revision: 303763 >> URL: https://svnweb.freebsd.org/changeset/base/303763 >> >> Log: >> zfs: honour and make use of vfs vnode locking protocol >> >> ZFS POSIX Layer is originally written for Solaris VFS which is very >> different from FreeBSD VFS. Most importantly many things that FreeBSD VFS >> manages on behalf of all filesystems are implemented in ZPL in a different >> way. >> Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS >> functionality or, in the worst cases, badly interacts / interferes >> with VFS. >> >> The most prominent problem is a deadlock caused by the lock order reversal >> of vnode locks that may happen with concurrent zfs_rename() and lookup(). >> The deadlock is a result of zfs_rename() not observing the vnode locking >> contract expected by VFS. >> >> This commit removes all ZPL internal locking that protects parent-child >> relationships of filesystem nodes. These relationships are protected >> by vnode locks and the code is changed to take advantage of that fact >> and to properly interact with VFS. >> >> Removal of the internal locking allowed all ZPL dmu_tx_assign calls to >> use TXG_WAIT mode. >> >> Another victim, disputable perhaps, is ZFS support for filesystems with >> mixed case sensitivity. That support is not provided by the OS anyway, >> so in ZFS it was a buch of dead code. >> >> To do: >> - replace ZFS_ENTER mechanism with VFS managed / visible mechanism >> - replace zfs_zget with zfs_vget[f] as much as possible >> - get rid of not really useful now zfs_freebsd_* adapters >> - more cleanups of unneeded / unused code >> - fix / replace .zfs support >> >> PR: 209158 >> Reported by: many >> Tested by: many (thank you all!) >> MFC after: 5 days >> Sponsored by: HybridCluster / ClusterHQ >> Differential Revision: https://reviews.freebsd.org/D6533 >> >> Modified: >> head/sys/cddl/compat/opensolaris/sys/vnode.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c >> > -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Aug 9 06:00:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E041ABB365D; Tue, 9 Aug 2016 06:00:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A67841877; Tue, 9 Aug 2016 06:00:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA06752; Tue, 09 Aug 2016 09:00:01 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bX053-0005fx-GH; Tue, 09 Aug 2016 09:00:01 +0300 Subject: Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: Navdeep Parhar , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201608050623.u756N695018889@repo.freebsd.org> <1b2fa1c4-d219-7b0c-bea4-94ae325565e0@FreeBSD.org> From: Andriy Gapon Message-ID: <92ce3274-916e-db48-04eb-aecd21c65aeb@FreeBSD.org> Date: Tue, 9 Aug 2016 08:59:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1b2fa1c4-d219-7b0c-bea4-94ae325565e0@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 06:00:05 -0000 On 09/08/2016 08:10, Andriy Gapon wrote: > On 09/08/2016 02:48, Navdeep Parhar wrote: >> Hello Andriy, >> >> I'm at r303837 and have had two panics today in zfs_rename. I have a >> core for a kernel built with -O0. Let me know if you think it's related >> to this commit and need more information. This is the stack: >> >> (also available at https://people.freebsd.org/~np/rename_panic.txt in >> case the wide lines are hard to read in email). > > Thank you very much for the report. > More details are required for analysis. In frame 11 I would like to see objects > pointed to by all arguments and additionally local variables tdzp, sdzp, zfsvfs > and zilog. Navdeep, thank you for the debugging information (provided out-of-band). The problem seems to be with leaving a variable uninitialized when a cross-device rename is detected and then accessing that variable before checking the error code. Also, thank you for testing a fix. I'll commit it very soon. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Aug 9 06:11:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30728BB399A; Tue, 9 Aug 2016 06:11:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F259B1E97; Tue, 9 Aug 2016 06:11:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u796BPxM064575; Tue, 9 Aug 2016 06:11:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u796BP4S064574; Tue, 9 Aug 2016 06:11:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608090611.u796BP4S064574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 9 Aug 2016 06:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303869 - 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.22 Precedence: list List-Id: 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, 09 Aug 2016 06:11:26 -0000 Author: avg Date: Tue Aug 9 06:11:24 2016 New Revision: 303869 URL: https://svnweb.freebsd.org/changeset/base/303869 Log: fix a zfs cross-device rename crash introduced in r303763 The problem was that 'zfsvfs' variable was not initialized if the error was detected, but in the exit path the variable was dereferenced before the error code was checked. Reported by: np MFC after: 3 days X-MFC with: r303763 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 Aug 9 04:59:55 2016 (r303868) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 9 06:11:24 2016 (r303869) @@ -3956,7 +3956,7 @@ unlockout: /* all 4 vnodes are locked, VOP_UNLOCK(sdvp, 0); out: /* original two vnodes are locked */ - if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS && error == 0) + if (error == 0 && zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, 0); if (*tvpp != NULL) From owner-svn-src-head@freebsd.org Tue Aug 9 07:43:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7782BB3E20; Tue, 9 Aug 2016 07:43:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD6E1E1D; Tue, 9 Aug 2016 07:43:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u797hFmC000217; Tue, 9 Aug 2016 07:43:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u797hF8l000216; Tue, 9 Aug 2016 07:43:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608090743.u797hF8l000216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 9 Aug 2016 07:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303870 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 07:43:17 -0000 Author: hselasky Date: Tue Aug 9 07:43:15 2016 New Revision: 303870 URL: https://svnweb.freebsd.org/changeset/base/303870 Log: Fix for use after free. Clear the device description to avoid use after free because the bsddev is not destroyed when the mlx5en module is unloaded. Only when the parent mlx5 module is unloaded the bsddev is destroyed. This fixes a panic on listing sysctls which refer strings in the bsddev after the mlx5en module has been unloaded. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 9 06:11:24 2016 (r303869) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 9 07:43:15 2016 (r303870) @@ -3108,6 +3108,13 @@ mlx5e_destroy_ifp(struct mlx5_core_dev * /* don't allow more IOCTLs */ priv->gone = 1; + /* + * Clear the device description to avoid use after free, + * because the bsddev is not destroyed when this module is + * unloaded: + */ + device_set_desc(mdev->pdev->dev.bsddev, NULL); + /* XXX wait a bit to allow IOCTL handlers to complete */ pause("W", hz); From owner-svn-src-head@freebsd.org Tue Aug 9 04:43:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 833D8BB2440 for ; Tue, 9 Aug 2016 04:43:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFBE1380 for ; Tue, 9 Aug 2016 04:43:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id q83so1711984iod.1 for ; Mon, 08 Aug 2016 21:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gmzklx7Nwiqy1R4fU/m0OEJCevSlaDktBJFVUAJmdqo=; b=O7gCJC3x/YvKBnE97ckHnK/SjkBp/eBdk0fzQi0THa+g1yhpONdrHVIgB2cXxk3V7S zTk75mw8Q42NVi6Hat4W3JyNLS3tRxRNRglkNPyIYLds3N3DQtBbLy7o1tDXQv7T6D1u jxpN8lj/gsw35xFNGI4Jwx8XijO1BlygJoiooaL6bUgfYCkeqwrjjvyflM9BwfVkD+cd akaaffTZ5Vd8JtgrTCdCTev/ic+pqo3e65AGgYYJr5UISaHZCwNLuzhdDjTs27w5Nos3 zeTwvRyO/nnwsedlTChXxvR5uuE1Ehq1mirR9M5tp/nsClO8IgyibsYpny2q0CBVX5Qd AZGQ== 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; bh=gmzklx7Nwiqy1R4fU/m0OEJCevSlaDktBJFVUAJmdqo=; b=ddjs7WwElt5jDa/hTezNKWCSq9Y76UdqdlYUpBJcYJtbJBpjD5tKO1SjlxXYHmGzuo ANJuKf/0Iw0yZA9ErhTAuY+i7hHzf9wSidYtOo0YNwmQgChe8/HtfaZCc8pdJ/HuLFjE iJAwpePmscCBhMRb6CcU+Rrnq2VN6UcBPbykkHBtQg4jAN6ivtVkZ2DqlVFlvx/ma/rM zDf0HPa+qBvJrCtZkLB3N91nqxuij5GblDm9T08zBIxsUoBbxvAyVEHP+DdvYefmdVZV nsT8eCqoaEnWqf0nC69XA+xDx46TGM0ZizJ32kLnR4+NLFfrpXBbyUwlHr2yZN43yxg1 5JEw== X-Gm-Message-State: AEkooutkbDswv6kVx9XUSjOjoPWyzc9MxeTpr1i8k6gQD8fElLrZ5cWTTN0ldfbvPrP9LK4Kd+xKqKN4Pnvv3g== X-Received: by 10.107.145.214 with SMTP id t205mr92931224iod.135.1470717823586; Mon, 08 Aug 2016 21:43:43 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Mon, 8 Aug 2016 21:43:42 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <20160808072547.GA19715@spindle.one-eyed-alien.net> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <226b9a3c-8ca8-af31-7665-86d51365fc81@delphij.net> <20160808072547.GA19715@spindle.one-eyed-alien.net> From: Warner Losh Date: Mon, 8 Aug 2016 22:43:42 -0600 X-Google-Sender-Auth: Wfuis-qjVyv_isoZJ5DHgyAvSUg Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh To: Brooks Davis Cc: Xin Li , Andrey Chernov , Xin LI , Peter Jeremy , Bruce Simpson , Oliver Pinter , "Dag-Erling Sm??rgrav" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , FreeBSD Security Team , FreeBSD Release Engineering Team Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Tue, 09 Aug 2016 10:56:39 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 04:43:44 -0000 On Mon, Aug 8, 2016 at 1:25 AM, Brooks Davis wrote: > On Sun, Aug 07, 2016 at 03:48:44PM -0700, Xin Li wrote: >> >> >> On 8/7/16 14:20, Warner Losh wrote: >> > >> >> On Aug 7, 2016, at 3:11 PM, Andrey Chernov wrote: >> >> >> >>> OTOH, FreeBSD has a documented deprecation process that says things will >> >>> continue working for a major release after being formally deprecated. >> >> >> >> FreeBSD 11 is not released yet (betas are not counted), stable-10 too, >> >> so it is right time to deprecate for them. >> > >> > Nice try, but feature freeze was months ago. Have you got buy in from the >> > security officer and the release engineer? >> >> Well, despite the fact that I have to admit that I get locked out from >> my own storage box too, however (even without wearing any hat) I am for >> the change and would blame myself for being lazy in adopting the change >> when the upstream have announced it earlier about a year ago. > > While the timing sucks, I don't see any way around this change given our > experience with the HPN patches and that upstream plans to kill this > feature, we must not ship 11 with support enabled. There's just no > practical way to keep adding back a feature for 4-5 years. Then we should put http://www.openssh.com/legacy.html in the release notes, UPDATING and maybe the man page. Warner From owner-svn-src-head@freebsd.org Tue Aug 9 04:45:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34400BB24B0 for ; Tue, 9 Aug 2016 04:45:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAAC2151F for ; Tue, 9 Aug 2016 04:45:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id b62so1681745iod.3 for ; Mon, 08 Aug 2016 21:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=qyhMu+0vL6S1iFy4AniBArfSVw7ZuBccg98i2/g2vxI=; b=DC39rrQcHB25jPoRMVhsYvwpRiWR5cLaiTsUyJExsSHpqp7a0PkNh6d6iuRS3smjil yyYUyw4/3li09XSmSyNvho8ALbEq6B/2VGf36K1sDSG9GIcWk4sOo7wRz8BNmzQs2gC9 gNi4O6UP28MJ/HoVXPQCz9qGG/HQkdZNUEB4xUSYqnfKjuzf8MciC2Kwv3XdNJgKaymb Y+Il6AOUfQByPip9I21GAxR97QJybnk/TkJrWDj9b7e0xGlqBLOlTyuGdJc6jhbEyZo6 CKB2f7quVlB5saDRqDWD8fe9BSriyrFG/7/4cHj3SFZpMYiIO18sNqgLTgzwift70OAM 2L5g== 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-transfer-encoding; bh=qyhMu+0vL6S1iFy4AniBArfSVw7ZuBccg98i2/g2vxI=; b=QEkb5oS/EDEassRFjJyQV+RyG5XH/1R7Ih5w09LXtO4YUT6mPkGujxLWoq2scZK3N8 GWF+L5v+wJGgG3z86XHIALZCw5Xk34KRfU+pN7KVjU5c5uTLZuedCDfxym4lZWpmFjvu YCmU3DsTd6IyqB17hwWxcoDagniSXsgITKHINIwkIlWoT1RrDlrpvMaiOObeYXc20EdO gH4xqXAD5j9DJpTOak7flhZcFtRndVArYmM74JgDNFGMhv8heI8fdzk5YOanCboGqoGp GCH+Kt2n2ycJSaQaOTLY996UuVGLcwMS5wwFCZsFLuESLByGZqhK1hCqCylt34IVZOMA AFrw== X-Gm-Message-State: AEkoout1rYdrmLun12oCGpbYeaSg13qb0OiLUZYmXMqBtMibES/fM51LfginPiKxslAc2QC2rXZD44df4LPmaQ== X-Received: by 10.107.9.39 with SMTP id j39mr95638531ioi.73.1470717916395; Mon, 08 Aug 2016 21:45:16 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Mon, 8 Aug 2016 21:45:15 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <86shufv8yt.fsf@desk.des.no> References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <86shufv8yt.fsf@desk.des.no> From: Warner Losh Date: Mon, 8 Aug 2016 22:45:15 -0600 X-Google-Sender-Auth: uFk9_lTf9heXw1NwNHjkSx3KO28 Message-ID: Subject: Re: svn commit: r303716 - head/crypto/openssh To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Andrey Chernov , Peter Jeremy , Bruce Simpson , Oliver Pinter , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , FreeBSD Security Team , FreeBSD Release Engineering Team Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 09 Aug 2016 10:56:39 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 04:45:17 -0000 On Mon, Aug 8, 2016 at 4:41 AM, Dag-Erling Sm=C3=B8rgrav wrote= : > Warner Losh writes: >> Andrey Chernov writes: >> > FreeBSD 11 is not released yet (betas are not counted), stable-10 too, >> > so it is right time to deprecate for them. >> Nice try, but feature freeze was months ago. Have you got buy in from th= e >> security officer and the release engineer? >> >> I didn=E2=80=99t think so... > > You have absolutely *no* basis for this claim, and I would like you to > retract it. Why do I need to retract anything? He provided pointers to the re@ approval= . Come on DES. Warner From owner-svn-src-head@freebsd.org Tue Aug 9 05:09:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1300BB297E for ; Tue, 9 Aug 2016 05:09:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77E9B119F for ; Tue, 9 Aug 2016 05:09:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-pa0-x236.google.com with SMTP id pp5so1690159pac.3 for ; Mon, 08 Aug 2016 22:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ca+ZCrgdcBFaco7GNz9H/TIlYn6Z8ckBSTPP4barkKo=; b=Rqv/UncdLsFrs5VVlVPuU651b4FpwXiqFnqB9DnnNUn32jwrNvbh+4MlWJl8mwQbL1 CCPY195dbDsSFj+bBcoWLpBtXuEgpc689MMb4PfYWUaA0hCXAfF2jWcnDBBBvpIrXFKN 3xyVuWSCojIGIFR3Z3KwqRhMgSr3stHGCVqSNwPK5ki74V0t3cAVIkg7Fq6m/NDIho/w xnL0wbC1zWt5Xbbxo8OsBlkXUUlvytnZSQ01WMlhqEymzDINlABwNmvGPTJ0Gt5EdwzY MnyoQITWMvKj/8E92n3MFAvjrvo5j0pqqxCjLIuEbmrLbyxI5q/qPErHdIn7ZgYPO2EA T8TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ca+ZCrgdcBFaco7GNz9H/TIlYn6Z8ckBSTPP4barkKo=; b=MwRS5v5DTSbEoyxgdtzEzWFZHPzgusbPg1c8sNwIrnw7zyPm2qAkoBf4rYSQOk/Zmr sADCqLCmvn7cGTBQiRhq0Ksa46VoShpsaQEZhZuzbfjiqrVDuSKTgPZxGVsLnb7Bo6ES nI1RTqvPIFKg7YmtQ5qQt3Hjf0P838iWPEqCwY9h4agT3x9lVXzWLtAsFmu4muBXWEJd NCxu41OIG2es+w6KpqELVhXF5UY9jSyHMVnbswwNWBH4EKhhFi50RqYqScVvNx+K33Nx c9qVlcJ0v9lO3GWEUXWUsjHIiNhKn3Sa7V1+7Uz8mJYwNunOla1Oi/gOp6qARUMbA25K OLQQ== X-Gm-Message-State: AEkoouvYhEkWOpehy/tpgUcgwHyyB44STStqbEjsAwsecNbSS8zndvYKNtjJGdFUzw3Obw== X-Received: by 10.66.43.7 with SMTP id s7mr170467069pal.27.1470719383939; Mon, 08 Aug 2016 22:09:43 -0700 (PDT) Received: from [100.127.71.224] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id wp4sm52066309pab.15.2016.08.08.22.09.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Aug 2016 22:09:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r303716 - head/crypto/openssh From: Warner Losh In-Reply-To: Date: Mon, 8 Aug 2016 23:09:39 -0600 Cc: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , Andrey Chernov , Peter Jeremy , Bruce Simpson , Oliver Pinter , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , FreeBSD Security Team , FreeBSD Release Engineering Team Content-Transfer-Encoding: quoted-printable Message-Id: References: <201608031608.u73G8Mjq055909@repo.freebsd.org> <9a01870a-d99d-13a2-54bd-01d32616263c@fastmail.net> <30e655d1-1df7-5e2a-fccb-269e3cea4684@freebsd.org> <20160807204039.GB79784@server.rulingia.com> <8371434C-86F6-4DCB-82D4-F236BBC2F9A2@bsdimp.com> <86shufv8yt.fsf@desk.des.no> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-Mailman-Approved-At: Tue, 09 Aug 2016 11:20:11 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 05:09:44 -0000 > On Aug 8, 2016, at 10:45 PM, Warner Losh wrote: >=20 > On Mon, Aug 8, 2016 at 4:41 AM, Dag-Erling Sm=C3=B8rgrav = wrote: >> Warner Losh writes: >>> Andrey Chernov writes: >>>> FreeBSD 11 is not released yet (betas are not counted), stable-10 = too, >>>> so it is right time to deprecate for them. >>> Nice try, but feature freeze was months ago. Have you got buy in = from the >>> security officer and the release engineer? >>>=20 >>> I didn=E2=80=99t think so... >>=20 >> You have absolutely *no* basis for this claim, and I would like you = to >> retract it. >=20 > Why do I need to retract anything? He provided pointers to the re@ = approval. >=20 > Come on DES. Actually, you=E2=80=99re right. My defensive reaction was wrong. I=E2=80=99m sorry DES. What I said was in the heat of the moment, and = isn=E2=80=99t supported by the facts. I was wrong to say it like I did, especially since I = didn=E2=80=99t check into it first. Please forgive my outbursts. Warner= From owner-svn-src-head@freebsd.org Tue Aug 9 14:55:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E55BB40F8; Tue, 9 Aug 2016 14:55:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9541A1F; Tue, 9 Aug 2016 14:55:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f48.google.com with SMTP id u186so14550642ita.0; Tue, 09 Aug 2016 07:55:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=cHtD8xSWS1O8gvojkWIJ17yb3DZ3LmT9QbmGFx0jV18=; b=LSxwx3/q6gRLBJlVvzcednvpfvC6O5SHKgJtLK5rmUOE/7RJWpdMbLrAsfoj2Fz5Op MQxULNoMmyYHexydWMPAqWKl0oKN18j8cdAgzMfCrnGWqPjMctjNYnzpZzh5kzjCUyoR HgSlDtz5BqmDze7aP7Vx1jYbjHAo8/atehwzdjrCTSWHrWpvlY8pEWry48X7REf6X6mg AkDOnRP2pxkPWK4QUyvX34vWwchMf9CiS9zQXH0eAsrvlz82G+4CPEa53Uq8RlEo35IC Aokf7yraOFf63fw2ErBIojRmSOznf2EkefhC/C/aKa42X6gz77uaaknJ7tCivrhoYrbO 3VCQ== X-Gm-Message-State: AEkoouupdivU1r/yUF0R7WES+Ypxm2ygOTmyz+fdNL5B6fyhLm/++4HzjMMV3L3Gr+QzdA== X-Received: by 10.36.190.137 with SMTP id i131mr5617505itf.0.1470754495675; Tue, 09 Aug 2016 07:54:55 -0700 (PDT) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id e196sm16727473ioe.3.2016.08.09.07.54.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Aug 2016 07:54:55 -0700 (PDT) Received: by mail-io0-f173.google.com with SMTP id b62so13732830iod.3; Tue, 09 Aug 2016 07:54:55 -0700 (PDT) X-Received: by 10.107.28.11 with SMTP id c11mr117110107ioc.7.1470754494861; Tue, 09 Aug 2016 07:54:54 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Tue, 9 Aug 2016 07:54:54 -0700 (PDT) In-Reply-To: <201608090611.u796BP4S064574@repo.freebsd.org> References: <201608090611.u796BP4S064574@repo.freebsd.org> From: Conrad Meyer Date: Tue, 9 Aug 2016 07:54:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r303869 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Andriy Gapon Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 14:55:02 -0000 This was detected by Coverity as CID 1361483, for what it's worth. Best, Conrad On Mon, Aug 8, 2016 at 11:11 PM, Andriy Gapon wrote: > Author: avg > Date: Tue Aug 9 06:11:24 2016 > New Revision: 303869 > URL: https://svnweb.freebsd.org/changeset/base/303869 > > Log: > fix a zfs cross-device rename crash introduced in r303763 > > The problem was that 'zfsvfs' variable was not initialized if the error > was detected, but in the exit path the variable was dereferenced before > the error code was checked. > > Reported by: np > MFC after: 3 days > X-MFC with: r303763 > > 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 Aug 9 04:59:55 2016 (r303868) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 9 06:11:24 2016 (r303869) > @@ -3956,7 +3956,7 @@ unlockout: /* all 4 vnodes are locked, > VOP_UNLOCK(sdvp, 0); > > out: /* original two vnodes are locked */ > - if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS && error == 0) > + if (error == 0 && zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) > zil_commit(zilog, 0); > > if (*tvpp != NULL) > From owner-svn-src-head@freebsd.org Tue Aug 9 15:50:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF07BB2654; Tue, 9 Aug 2016 15:50:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8F021647; Tue, 9 Aug 2016 15:50:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Fo37W080795; Tue, 9 Aug 2016 15:50:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79Fo3iU080794; Tue, 9 Aug 2016 15:50:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091550.u79Fo3iU080794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303872 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 15:50:05 -0000 Author: trasz Date: Tue Aug 9 15:50:03 2016 New Revision: 303872 URL: https://svnweb.freebsd.org/changeset/base/303872 Log: Remove NULL checks after M_WAITOK allocations from tws(4). MFC after: 1 month Modified: head/sys/dev/tws/tws.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Tue Aug 9 11:37:08 2016 (r303871) +++ head/sys/dev/tws/tws.c Tue Aug 9 15:50:03 2016 (r303872) @@ -606,21 +606,9 @@ tws_init(struct tws_softc *sc) sc->reqs = malloc(sizeof(struct tws_request) * tws_queue_depth, M_TWS, M_WAITOK | M_ZERO); - if ( sc->reqs == NULL ) { - TWS_TRACE_DEBUG(sc, "malloc failed", 0, sc->is64bit); - return(ENOMEM); - } sc->sense_bufs = malloc(sizeof(struct tws_sense) * tws_queue_depth, M_TWS, M_WAITOK | M_ZERO); - if ( sc->sense_bufs == NULL ) { - TWS_TRACE_DEBUG(sc, "sense malloc failed", 0, sc->is64bit); - return(ENOMEM); - } sc->scan_ccb = malloc(sizeof(union ccb), M_TWS, M_WAITOK | M_ZERO); - if ( sc->scan_ccb == NULL ) { - TWS_TRACE_DEBUG(sc, "ccb malloc failed", 0, sc->is64bit); - return(ENOMEM); - } if (bus_dmamem_alloc(sc->data_tag, (void **)&sc->ioctl_data_mem, (BUS_DMA_NOWAIT | BUS_DMA_ZERO), &sc->ioctl_data_map)) { device_printf(sc->tws_dev, "Cannot allocate ioctl data mem\n"); @@ -668,8 +656,6 @@ tws_init_aen_q(struct tws_softc *sc) sc->aen_q.overflow=0; sc->aen_q.q = malloc(sizeof(struct tws_event_packet)*sc->aen_q.depth, M_TWS, M_WAITOK | M_ZERO); - if ( ! sc->aen_q.q ) - return(FAILURE); return(SUCCESS); } @@ -682,8 +668,6 @@ tws_init_trace_q(struct tws_softc *sc) sc->trace_q.overflow=0; sc->trace_q.q = malloc(sizeof(struct tws_trace_rec)*sc->trace_q.depth, M_TWS, M_WAITOK | M_ZERO); - if ( ! sc->trace_q.q ) - return(FAILURE); return(SUCCESS); } From owner-svn-src-head@freebsd.org Tue Aug 9 15:51:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D045BB26CC; Tue, 9 Aug 2016 15:51:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8221859; Tue, 9 Aug 2016 15:51:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79FpBHa083505; Tue, 9 Aug 2016 15:51:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FpBBH083504; Tue, 9 Aug 2016 15:51:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091551.u79FpBBH083504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303873 - head/sys/dev/msk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 15:51:12 -0000 Author: trasz Date: Tue Aug 9 15:51:11 2016 New Revision: 303873 URL: https://svnweb.freebsd.org/changeset/base/303873 Log: Remove NULL checks after M_WAITOK allocations from msk(4). MFC after: 1 month Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Aug 9 15:50:03 2016 (r303872) +++ head/sys/dev/msk/if_msk.c Tue Aug 9 15:51:11 2016 (r303873) @@ -1953,12 +1953,6 @@ mskc_attach(device_t dev) goto fail; } mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); - if (mmd == NULL) { - device_printf(dev, "failed to allocate memory for " - "ivars of PORT_A\n"); - error = ENXIO; - goto fail; - } mmd->port = MSK_PORT_A; mmd->pmd = sc->msk_pmd; mmd->mii_flags |= MIIF_DOPAUSE; @@ -1977,12 +1971,6 @@ mskc_attach(device_t dev) } mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); - if (mmd == NULL) { - device_printf(dev, "failed to allocate memory for " - "ivars of PORT_B\n"); - error = ENXIO; - goto fail; - } mmd->port = MSK_PORT_B; mmd->pmd = sc->msk_pmd; if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') From owner-svn-src-head@freebsd.org Tue Aug 9 15:52:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA00BB27F0; Tue, 9 Aug 2016 15:52:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF071B96; Tue, 9 Aug 2016 15:52:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79FqHBF084167; Tue, 9 Aug 2016 15:52:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FqHgM084166; Tue, 9 Aug 2016 15:52:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091552.u79FqHgM084166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303874 - head/sys/dev/mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 15:52:18 -0000 Author: trasz Date: Tue Aug 9 15:52:17 2016 New Revision: 303874 URL: https://svnweb.freebsd.org/changeset/base/303874 Log: Remove NULL check after M_WAITOK allocation from mpt(4). MFC after: 1 month Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Tue Aug 9 15:51:11 2016 (r303873) +++ head/sys/dev/mpt/mpt_pci.c Tue Aug 9 15:52:17 2016 (r303874) @@ -654,10 +654,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) len = sizeof (request_t) * MPT_MAX_REQUESTS(mpt); mpt->request_pool = (request_t *)malloc(len, M_DEVBUF, M_WAITOK|M_ZERO); - if (mpt->request_pool == NULL) { - mpt_prt(mpt, "cannot allocate request pool\n"); - return (1); - } /* * Create a parent dma tag for this device. From owner-svn-src-head@freebsd.org Tue Aug 9 15:55:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D41FEBB28E7; Tue, 9 Aug 2016 15:55:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85E251DC9; Tue, 9 Aug 2016 15:55:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79FtEdK084328; Tue, 9 Aug 2016 15:55:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FtEBL084326; Tue, 9 Aug 2016 15:55:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091555.u79FtEBL084326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303875 - head/sys/dev/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.22 Precedence: list List-Id: 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, 09 Aug 2016 15:55:15 -0000 Author: trasz Date: Tue Aug 9 15:55:14 2016 New Revision: 303875 URL: https://svnweb.freebsd.org/changeset/base/303875 Log: Remove NULL checks after M_WAITOK allocations from sys/dev/ofw/. MFC after: 1 month Modified: head/sys/dev/ofw/openfirmio.c head/sys/dev/ofw/openpromio.c Modified: head/sys/dev/ofw/openfirmio.c ============================================================================== --- head/sys/dev/ofw/openfirmio.c Tue Aug 9 15:52:17 2016 (r303874) +++ head/sys/dev/ofw/openfirmio.c Tue Aug 9 15:55:14 2016 (r303875) @@ -100,8 +100,6 @@ openfirm_getstr(int len, const char *use return (ENAMETOOLONG); *cpp = cp = malloc(len + 1, M_TEMP, M_WAITOK); - if (cp == NULL) - return (ENOMEM); error = copyin(user, cp, len); cp[len] = '\0'; return (error); @@ -173,10 +171,6 @@ openfirm_ioctl(struct cdev *dev, u_long if (len <= 0) break; value = malloc(len, M_TEMP, M_WAITOK); - if (value == NULL) { - error = ENOMEM; - break; - } len = OF_getprop(node, name, (void *)value, len); error = copyout(value, of->of_buf, len); break; @@ -199,10 +193,6 @@ openfirm_ioctl(struct cdev *dev, u_long if (error) break; value = malloc(of->of_buflen, M_TEMP, M_WAITOK); - if (value == NULL) { - error = ENOMEM; - break; - } error = copyin(of->of_buf, value, of->of_buflen); if (error) break; Modified: head/sys/dev/ofw/openpromio.c ============================================================================== --- head/sys/dev/ofw/openpromio.c Tue Aug 9 15:52:17 2016 (r303874) +++ head/sys/dev/ofw/openpromio.c Tue Aug 9 15:55:14 2016 (r303875) @@ -151,18 +151,10 @@ openprom_ioctl(struct cdev *dev, u_long break; } prop = malloc(len, M_TEMP, M_WAITOK | M_ZERO); - if (prop == NULL) { - error = ENOMEM; - break; - } error = copyinstr(&oprom->oprom_array, prop, len, &done); if (error != 0) break; buf = malloc(OPROMMAXPARAM, M_TEMP, M_WAITOK | M_ZERO); - if (buf == NULL) { - error = ENOMEM; - break; - } node = openprom_node; switch (cmd) { case OPROMGETPROP: From owner-svn-src-head@freebsd.org Tue Aug 9 15:56:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075EFBB2986; Tue, 9 Aug 2016 15:56:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B10E51F6E; Tue, 9 Aug 2016 15:56:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79FuXfQ084411; Tue, 9 Aug 2016 15:56:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FuX86084409; Tue, 9 Aug 2016 15:56:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091556.u79FuX86084409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303876 - 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.22 Precedence: list List-Id: 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, 09 Aug 2016 15:56:35 -0000 Author: trasz Date: Tue Aug 9 15:56:33 2016 New Revision: 303876 URL: https://svnweb.freebsd.org/changeset/base/303876 Log: Remove NULL checks after M_WAITOK allocations from nand(4). MFC after: 1 month Modified: head/sys/dev/nand/nand_generic.c head/sys/dev/nand/nandsim_chip.c Modified: head/sys/dev/nand/nand_generic.c ============================================================================== --- head/sys/dev/nand/nand_generic.c Tue Aug 9 15:55:14 2016 (r303875) +++ head/sys/dev/nand/nand_generic.c Tue Aug 9 15:56:33 2016 (r303876) @@ -228,8 +228,6 @@ generic_nand_attach(device_t dev) if (ivar->is_onfi) { onfi_chip_params = malloc(sizeof(struct onfi_chip_params), M_NAND, M_WAITOK | M_ZERO); - if (onfi_chip_params == NULL) - return (ENOMEM); if (onfi_read_parameter(chip, onfi_chip_params)) { nand_debug(NDBG_GEN,"Could not read parameter page!\n"); @@ -741,10 +739,6 @@ onfi_is_blk_bad(device_t device, uint32_ chip = device_get_softc(device); oob = malloc(chip->chip_geom.oob_size, M_NAND, M_WAITOK); - if (!oob) { - device_printf(device, "%s: cannot allocate oob\n", __func__); - return (ENOMEM); - } page_number = block_number * chip->chip_geom.pgs_per_blk; *bad = 0; @@ -1001,10 +995,6 @@ generic_is_blk_bad(device_t dev, uint32_ chip = device_get_softc(dev); oob = malloc(chip->chip_geom.oob_size, M_NAND, M_WAITOK); - if (!oob) { - device_printf(dev, "%s: cannot allocate OOB\n", __func__); - return (ENOMEM); - } page_number = block * chip->chip_geom.pgs_per_blk; *bad = 0; Modified: head/sys/dev/nand/nandsim_chip.c ============================================================================== --- head/sys/dev/nand/nandsim_chip.c Tue Aug 9 15:55:14 2016 (r303875) +++ head/sys/dev/nand/nandsim_chip.c Tue Aug 9 15:56:33 2016 (r303876) @@ -90,8 +90,6 @@ nandsim_chip_init(struct nandsim_softc* int error; chip = malloc(sizeof(*chip), M_NANDSIM, M_WAITOK | M_ZERO); - if (!chip) - return (NULL); mtx_init(&chip->ns_lock, "nandsim lock", NULL, MTX_DEF); callout_init(&chip->ns_callout, 1); @@ -206,9 +204,6 @@ nandsim_blk_state_init(struct nandsim_ch chip->blk_state = malloc(size * sizeof(struct nandsim_block_state), M_NANDSIM, M_WAITOK | M_ZERO); - if (!chip->blk_state) { - return (-1); - } for (i = 0; i < size; i++) { if (wear_lev) From owner-svn-src-head@freebsd.org Tue Aug 9 15:57:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65984BB2A81; Tue, 9 Aug 2016 15:57:38 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3F11327; Tue, 9 Aug 2016 15:57:38 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Fvb43084486; Tue, 9 Aug 2016 15:57:37 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FvbOq084485; Tue, 9 Aug 2016 15:57:37 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201608091557.u79FvbOq084485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 9 Aug 2016 15:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303877 - head/usr.sbin/bsdinstall/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.22 Precedence: list List-Id: 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, 09 Aug 2016 15:57:38 -0000 Author: skreuzer (doc,ports committer) Date: Tue Aug 9 15:57:37 2016 New Revision: 303877 URL: https://svnweb.freebsd.org/changeset/base/303877 Log: Write kern.randompid to /etc/sysctl.conf PR: 211471 Reported by: survo@protonmail.com Reviewed by: robak@ Approved by: allanjude@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7440 Modified: head/usr.sbin/bsdinstall/scripts/hardening Modified: head/usr.sbin/bsdinstall/scripts/hardening ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hardening Tue Aug 9 15:56:33 2016 (r303876) +++ head/usr.sbin/bsdinstall/scripts/hardening Tue Aug 9 15:57:37 2016 (r303877) @@ -29,6 +29,7 @@ : ${DIALOG_OK=0} echo -n > $BSDINSTALL_TMPETC/rc.conf.hardening +echo -n > $BSDINSTALL_TMPETC/sysctl.conf.hardening exec 3>&1 FEATURES=$( dialog --backtitle "FreeBSD Installer" \ @@ -39,7 +40,7 @@ FEATURES=$( dialog --backtitle "FreeBSD "hide_gids" "Hide processes running as other groups" ${hide_gids:-off} \ "read_msgbuf" "Disable reading kernel message buffer for unprivileged users" ${read_msgbuf:-off} \ "proc_debug" "Disable process debugging facilities for unprivileged users" ${proc_debug:-off} \ - "random_pid" "Randomize the PID of newly created processes" ${random_id:-off} \ + "random_pid" "Randomize the PID of newly created processes" ${random_pid:-off} \ "stack_guard" "Insert stack guard page ahead of the growable segments" ${stack_guard:-off} \ "clear_tmp" "Clean the /tmp filesystem on system startup" ${clear_tmp:-off} \ "disable_syslogd" "Disable opening Syslogd network socket (disables remote logging)" ${disable_syslogd:-off} \ @@ -60,7 +61,7 @@ for feature in $FEATURES; do if [ "$feature" = "proc_debug" ]; then echo security.bsd.unprivileged_proc_debug=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi - if [ "$feature" = "random_id" ]; then + if [ "$feature" = "random_pid" ]; then echo kern.randompid=$(jot -r 1 9999) >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi if [ "$feature" = "stack_guard" ]; then From owner-svn-src-head@freebsd.org Tue Aug 9 16:02:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B525FBB2D69; Tue, 9 Aug 2016 16:02:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1071985; Tue, 9 Aug 2016 16:02:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79G2ZHf088196; Tue, 9 Aug 2016 16:02:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79G2Zik088193; Tue, 9 Aug 2016 16:02:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091602.u79G2Zik088193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 16:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303879 - in head/sys/arm: broadcom/bcm2835 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.22 Precedence: list List-Id: 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, 09 Aug 2016 16:02:36 -0000 Author: trasz Date: Tue Aug 9 16:02:35 2016 New Revision: 303879 URL: https://svnweb.freebsd.org/changeset/base/303879 Log: Remove some NULL checks after M_WAITOK allocations from sys/arm/. MFC after: 1 month Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcio.c head/sys/arm/xscale/pxa/pxa_smi.c head/sys/arm/xscale/pxa/pxa_space.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcio.c Tue Aug 9 15:59:57 2016 (r303878) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcio.c Tue Aug 9 16:02:35 2016 (r303879) @@ -68,10 +68,6 @@ vcio_ioctl(struct cdev *dev, u_long cmd, if (error != 0) break; property = malloc(size, M_VCIO, M_WAITOK); - if (property == NULL) { - error = ENOMEM; - break; - } error = copyin(ptr, property, size); if (error) { Modified: head/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_smi.c Tue Aug 9 15:59:57 2016 (r303878) +++ head/sys/arm/xscale/pxa/pxa_smi.c Tue Aug 9 16:02:35 2016 (r303879) @@ -322,8 +322,6 @@ pxa_smi_add_device(device_t dev, const c ivars = (struct smi_ivars *)malloc( sizeof(struct smi_ivars), M_PXASMI, M_WAITOK); - if (ivars == NULL) - return; child = device_add_child(dev, name, unit); if (child == NULL) { Modified: head/sys/arm/xscale/pxa/pxa_space.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_space.c Tue Aug 9 15:59:57 2016 (r303878) +++ head/sys/arm/xscale/pxa/pxa_space.c Tue Aug 9 16:02:35 2016 (r303879) @@ -191,9 +191,6 @@ pxa_bus_tag_alloc(bus_addr_t offset) tag = (struct bus_space *)malloc(sizeof(struct bus_space), M_PXATAG, M_WAITOK); - if (tag == NULL) { - return (NULL); - } bcopy(&_base_tag, tag, sizeof(struct bus_space)); tag->bs_privdata = (void *)offset; From owner-svn-src-head@freebsd.org Tue Aug 9 17:31:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4576BB3073; Tue, 9 Aug 2016 17:31:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B2E61DCF; Tue, 9 Aug 2016 17:31:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 94B82B922; Tue, 9 Aug 2016 13:31:07 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303870 - head/sys/dev/mlx5/mlx5_en Date: Tue, 09 Aug 2016 10:25:45 -0700 Message-ID: <1815980.zoyFBGqzV5@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608090743.u797hF8l000216@repo.freebsd.org> References: <201608090743.u797hF8l000216@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 09 Aug 2016 13:31:08 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 17:31:10 -0000 On Tuesday, August 09, 2016 07:43:15 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Aug 9 07:43:15 2016 > New Revision: 303870 > URL: https://svnweb.freebsd.org/changeset/base/303870 > > Log: > Fix for use after free. > > Clear the device description to avoid use after free because the > bsddev is not destroyed when the mlx5en module is unloaded. Only when > the parent mlx5 module is unloaded the bsddev is destroyed. This fixes > a panic on listing sysctls which refer strings in the bsddev after the > mlx5en module has been unloaded. > > Sponsored by: Mellanox Technologies > MFC after: 1 week Hmmm, this seems like it is working around a bug somewhere else. device_detach() calls device_set_driver(dev, NULL) which in turn calls device_set_desc(dev, NULL) which should be clearing the description. You can only be leaking a desc pointer if you aren't detaching the device. Not detaching a device but unloading the module containing part (but apparently not all) of its driver would seem to be fraught with peril. Why are you not detaching the mlx5en0 device when unloading this module? -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 9 17:49:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9627BB36D3; Tue, 9 Aug 2016 17:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9EC19CD; Tue, 9 Aug 2016 17:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79HngGi027184; Tue, 9 Aug 2016 17:49:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79HngAJ027182; Tue, 9 Aug 2016 17:49:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608091749.u79HngAJ027182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Aug 2016 17:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303880 - 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.22 Precedence: list List-Id: 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, 09 Aug 2016 17:49:43 -0000 Author: jhb Date: Tue Aug 9 17:49:42 2016 New Revision: 303880 URL: https://svnweb.freebsd.org/changeset/base/303880 Log: Track the base absolute ID of ingress and egress queues. Use this to map an absolute queue ID to a logical queue ID in interrupt handlers. For the regular cxgbe/cxl drivers this should be a no-op as the base absolute ID should be zero. VF devices have a non-zero base absolute ID and require this change. While here, export the absolute ID of egress queues via a sysctl. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7446 Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Aug 9 16:02:35 2016 (r303879) +++ head/sys/dev/cxgbe/adapter.h Tue Aug 9 17:49:42 2016 (r303880) @@ -430,6 +430,7 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB struct sge_eq { unsigned int flags; /* MUST be first */ unsigned int cntxt_id; /* SGE context id for the eq */ + unsigned int abs_id; /* absolute SGE id for the eq */ struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -738,8 +739,10 @@ struct sge { struct sge_nm_txq *nm_txq; /* netmap tx queues */ struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ - uint16_t iq_start; - int eq_start; + uint16_t iq_start; /* first cntxt_id */ + uint16_t iq_base; /* first abs_id */ + int eq_start; /* first cntxt_id */ + int eq_base; /* first abs_id */ struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Aug 9 16:02:35 2016 (r303879) +++ head/sys/dev/cxgbe/t4_sge.c Tue Aug 9 17:49:42 2016 (r303880) @@ -1444,7 +1444,8 @@ service_iq(struct sge_iq *iq, int budget break; } - q = sc->sge.iqmap[lq - sc->sge.iq_start]; + q = sc->sge.iqmap[lq - sc->sge.iq_start - + sc->sge.iq_base]; if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { if (service_iq(q, q->qsize / 16) == 0) { @@ -2972,6 +2973,7 @@ alloc_rxq(struct vi_info *vi, struct sge struct sysctl_oid *oid) { int rc; + struct adapter *sc = vi->pi->adapter; struct sysctl_oid_list *children; char name[16]; @@ -2980,12 +2982,20 @@ alloc_rxq(struct vi_info *vi, struct sge if (rc != 0) return (rc); + if (idx == 0) + sc->sge.iq_base = rxq->iq.abs_id - rxq->iq.cntxt_id; + else + KASSERT(rxq->iq.cntxt_id + sc->sge.iq_base == rxq->iq.abs_id, + ("iq_base mismatch")); + KASSERT(sc->sge.iq_base == 0 || sc->flags & IS_VF, + ("PF with non-zero iq_base")); + /* * The freelist is just barely above the starvation threshold right now, * fill it up a bit more. */ FL_LOCK(&rxq->fl); - refill_fl(vi->pi->adapter, &rxq->fl, 128); + refill_fl(sc, &rxq->fl, 128); FL_UNLOCK(&rxq->fl); #if defined(INET) || defined(INET6) @@ -3317,6 +3327,7 @@ eth_eq_alloc(struct adapter *sc, struct eq->flags |= EQ_ALLOCATED; eq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd)); + eq->abs_id = G_FW_EQ_ETH_CMD_PHYSEQID(be32toh(c.physeqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; if (cntxt_id >= sc->sge.neq) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, @@ -3557,6 +3568,14 @@ alloc_txq(struct vi_info *vi, struct sge /* Can't fail after this point. */ + if (idx == 0) + sc->sge.eq_base = eq->abs_id - eq->cntxt_id; + else + KASSERT(eq->cntxt_id + sc->sge.eq_base == eq->abs_id, + ("eq_base mismatch")); + KASSERT(sc->sge.eq_base == 0 || sc->flags & IS_VF, + ("PF with non-zero eq_base")); + TASK_INIT(&txq->tx_reclaim_task, 0, tx_reclaim, eq); txq->ifp = vi->ifp; txq->gl = sglist_alloc(TX_SGL_SEGS, M_WAITOK); @@ -3572,6 +3591,8 @@ alloc_txq(struct vi_info *vi, struct sge NULL, "tx queue"); children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "abs_id", CTLFLAG_RD, + &eq->abs_id, 0, "absolute id of the queue"); SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &eq->cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", @@ -4755,7 +4776,7 @@ handle_sge_egr_update(struct sge_iq *iq, KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - eq = s->eqmap[qid - s->eq_start]; + eq = s->eqmap[qid - s->eq_start - s->eq_base]; (*h[eq->flags & EQ_TYPEMASK])(sc, eq); return (0); From owner-svn-src-head@freebsd.org Tue Aug 9 17:57:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759D4BB39EB; Tue, 9 Aug 2016 17:57:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA4C1328; Tue, 9 Aug 2016 17:57:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79HvBdd030939; Tue, 9 Aug 2016 17:57:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79HvBk2030937; Tue, 9 Aug 2016 17:57:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608091757.u79HvBk2030937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Aug 2016 17:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303881 - in head: share/man/man4 sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 17:57:12 -0000 Author: jhb Date: Tue Aug 9 17:57:11 2016 New Revision: 303881 URL: https://svnweb.freebsd.org/changeset/base/303881 Log: Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF. Previously the loop in PCIIOCGETCONF would terminate as soon as it found enough matches. Now it will continue iterating through the PCI device list and only terminate if it finds another matching device for which it has no room to store a conf structure. This means that PCI_GETCONF_LAST_DEVICE is reliably returned when the number of matching devices is equal to the number of slots in the matches buffer. For example, if a program requests the conf structure for a single PCI function with a specified domain/bus/slot/function it will now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS. While here, simplify the loop conditional a bit more by explicitly breaking out of the loop if copyout() fails and removing a redundant i < pci_numdevs check. Reviewed by: vangyzen, imp MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7445 Modified: head/share/man/man4/pci.4 head/sys/dev/pci/pci_user.c Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Tue Aug 9 17:49:42 2016 (r303880) +++ head/share/man/man4/pci.4 Tue Aug 9 17:57:11 2016 (r303881) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2008 +.Dd August 9, 2016 .Dt PCI 4 .Os .Sh NAME @@ -229,7 +229,8 @@ The status tells the user the dispositio The possible status values are: .Bl -ohang .It PCI_GETCONF_LAST_DEVICE -This means that there are no more devices in the PCI device list after the +This means that there are no more devices in the PCI device list matching +the specified criteria after the ones returned in the .Va matches buffer. @@ -245,9 +246,7 @@ and to zero to start over at the beginning of the list. .It PCI_GETCONF_MORE_DEVS This tells the user that his buffer was not large enough to hold all of the -remaining devices in the device list that possibly match his criteria. -It is possible for this status to be returned, even when none of the remaining -devices in the list would match the user's criteria. +remaining devices in the device list that match his criteria. .It PCI_GETCONF_ERROR This indicates a general error while servicing the user's request. If the Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Tue Aug 9 17:49:42 2016 (r303880) +++ head/sys/dev/pci/pci_user.c Tue Aug 9 17:57:11 2016 (r303881) @@ -708,10 +708,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, * Go through the list of devices and copy out the devices * that match the user's criteria. */ - for (cio->num_matches = 0, error = 0, i = 0, + for (cio->num_matches = 0, i = 0, dinfo = STAILQ_FIRST(devlist_head); - (dinfo != NULL) && (cio->num_matches < ionum) && - (error == 0) && (i < pci_numdevs); + dinfo != NULL; dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { if (i < cio->offset) @@ -833,11 +832,12 @@ pci_ioctl(struct cdev *dev, u_long cmd, } else #endif /* PRE7_COMPAT */ confdata = &dinfo->conf; - /* Only if we can copy it out do we count it. */ - if (!(error = copyout(confdata, + error = copyout(confdata, (caddr_t)cio->matches + - confsz * cio->num_matches, confsz))) - cio->num_matches++; + confsz * cio->num_matches, confsz); + if (error) + break; + cio->num_matches++; } } From owner-svn-src-head@freebsd.org Tue Aug 9 18:25:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A0BBB443C; Tue, 9 Aug 2016 18:25:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC6A1E37; Tue, 9 Aug 2016 18:25:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pa0-x242.google.com with SMTP id ez1so1324842pab.3; Tue, 09 Aug 2016 11:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=h0dFd1o+LX9g2K1g+6ObQRSPL0sRBRm1xIu1sKuw5eM=; b=dqL/Pn23IpxNjWutolyungQyskF+2+OszuWkNGnpQdUwukuNw8vwpZjgHELyULL0ns BhJj5Fbyrbs0jeYaw2Kx8LHzJ96QwgpW9gPbaJdnrczNyOFFSSb71QqB8Ad5hTqpPbzt 4FkR5TvNDYndOQspzk2VOqt47aLD2Brg4wJCDXltRNrL2ZaQPOgDznbKy4FDRrXqkSGn Iy80xhyoSO2X7OZiY/qYOgC/s/Oy0dzOhCd5vR3lPtMV2eHXNuP3GSimyqgLYWf9bUVt Ho5ihBgSHABtshg9X6C/QXhtcMg0frMW4IDPe8a3/k8FdN0uMLG8s2D1lC7+SjpT9cY6 16wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=h0dFd1o+LX9g2K1g+6ObQRSPL0sRBRm1xIu1sKuw5eM=; b=BHvJ1LTFYfgMXqBRYkC6XOrc5m9S1QldkRdDiriejc5UUn5/w99QlXf/XsglWx7Aek CgBmi1+ZDwzaoeBHzxZ7aAszQkPhaMFn6Tb4pnIM3vlTMCDVMBo2b6tKl6HKFwAoPAB/ Z4SrOas2+82FcKieC289kCcK+asdK3/zCcZjRXBMgXuBEskY82m9VMNDYbdl5Rd28z+4 MmWLeZMbNPeDIdm2sRuKOZKnf64iGaUkGzGxTW7XQ5wFvGSNdY3Dm41y92PfgXhc83qQ ikUuGCeEiHrks/j8y2TcKcoju9Rr9Zz2hz+3u7E13oHB+NkuhdEVeTGeoj+mQEQ9W2rF lbmg== X-Gm-Message-State: AEkoouvBDiVG3H6MUWD6j270QeLIwHxXgwyRRWvGJtB895qd3gLJBRYYKvjwkvvlWfOBJQ== X-Received: by 10.66.189.104 with SMTP id gh8mr173149898pac.125.1470767105544; Tue, 09 Aug 2016 11:25:05 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id m78sm57681375pfj.66.2016.08.09.11.25.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Aug 2016 11:25:05 -0700 (PDT) Sender: Mark Johnston Date: Tue, 9 Aug 2016 11:29:56 -0700 From: Mark Johnston To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Bryan Drewery Subject: Re: svn commit: r303855 - in head/sys: kern sys Message-ID: <20160809182956.GA91785@wkstn-mjohnston.west.isilon.com> References: <201608082025.u78KP4aE048791@repo.freebsd.org> <20160808234332.GA22449@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 18:25:06 -0000 On Tue, Aug 09, 2016 at 01:51:35AM +0200, Oliver Pinter wrote: > (Added bdrewery to CC, since I'm talking with him on IRC.) > > On Tue, Aug 9, 2016 at 1:43 AM, Mark Johnston wrote: > > On Tue, Aug 09, 2016 at 12:53:47AM +0200, Oliver Pinter wrote: > >> Hi! > >> > >> Can you please MFC back this change 10-STABLE together with the > >> following: https://github.com/HardenedBSD/hardenedBSD/commit/576619e564618bca3675db57580d8e1f76bd2ac7 > >> > >> This issue is still exists on 10-STABLE, as you can test with the > >> linked program from phabricator: > >> https://people.freebsd.org/~mjg/reproducers/unp-gc-panic.c > > > > Hm, I don't think this could be MFCed directly. It changes the kernel > > ABI by modifying the argument of dom_dispose(). This could be fixed in > > stable/10 with a hack to call the unix domain socket code directly when > > appropriate, which I think is preferable to the current state of things. > > I'll look into it further. > > The question is how much external / out of tree components would use > this ABI or how acceptable to break this ABI. > I just grepped through the src tree for internal uses, and I found only these: I don't think it's acceptable. This could be side-stepped with a hack: if (pr->pr_domain->dom_family == AF_LOCAL) unp_dispose_wrapper(so); else if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) (*pr->pr_domain->dom_dispose)(so->so_rcv.sb_mb); ... So I'm inclined to just do that and avoid the issue. > > op@opn hardenedBSD.git> git grep dom_dispose > share/doc/smm/18.net/6.t: int (*dom_dispose)(); /* > dispose of internalized rights */ > share/man/man9/domain.9: void (*dom_dispose) /* > dispose of internalized rights */ > sys/kern/uipc_debug.c: db_printf("dom_dispose: %p\n", d->dom_dispose); > sys/kern/uipc_socket.c: if (pr->pr_flags & PR_RIGHTS && > pr->pr_domain->dom_dispose != NULL) > sys/kern/uipc_socket.c: (*pr->pr_domain->dom_dispose)(so); > sys/kern/uipc_socket.c: * dom_dispose() and sbrelease_internal() are > an inlining of what was > sys/kern/uipc_socket.c: * In order to avoid calling dom_dispose with > the socket buffer mutex > sys/kern/uipc_socket.c: if (pr->pr_flags & PR_RIGHTS && > pr->pr_domain->dom_dispose != NULL) > sys/kern/uipc_socket.c: (*pr->pr_domain->dom_dispose)(&aso); > sys/kern/uipc_usrreq.c: .dom_dispose = unp_dispose_so, > sys/sys/domain.h: void (*dom_dispose) /* dispose of > internalized rights */ From owner-svn-src-head@freebsd.org Tue Aug 9 19:02:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5FFFBB4F55; Tue, 9 Aug 2016 19:02:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5EF71E4F; Tue, 9 Aug 2016 19:02:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79J2EpQ058112; Tue, 9 Aug 2016 19:02:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79J2EiA058111; Tue, 9 Aug 2016 19:02:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608091902.u79J2EiA058111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Aug 2016 19:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303886 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:02:15 -0000 Author: jhb Date: Tue Aug 9 19:02:14 2016 New Revision: 303886 URL: https://svnweb.freebsd.org/changeset/base/303886 Log: Add additional constants. - Add constants for the fields in the root-entry table address register, namely the root type type (RTT) and root table address (RTA) mask. - Add macros for the bitmask of the domain ID field in the second word of context table entries as well as a helper macro (DMAR_CTX2_GET_DID) to extract the domain ID from a context table entry. Reviewed by: kib MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/x86/iommu/intel_reg.h Modified: head/sys/x86/iommu/intel_reg.h ============================================================================== --- head/sys/x86/iommu/intel_reg.h Tue Aug 9 18:59:16 2016 (r303885) +++ head/sys/x86/iommu/intel_reg.h Tue Aug 9 19:02:14 2016 (r303886) @@ -67,7 +67,9 @@ typedef struct dmar_ctx_entry { #define DMAR_CTX2_AW_4LVL 2 /* 4-level page tables */ #define DMAR_CTX2_AW_5LVL 3 /* 5-level page tables */ #define DMAR_CTX2_AW_6LVL 4 /* 6-level page tables */ +#define DMAR_CTX2_DID_MASK 0xffff0 #define DMAR_CTX2_DID(x) ((x) << 8) /* Domain Identifier */ +#define DMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8) typedef struct dmar_pte { uint64_t pte; @@ -214,6 +216,8 @@ typedef struct dmar_irte { /* Root-Entry Table Address register */ #define DMAR_RTADDR_REG 0x20 +#define DMAR_RTADDR_RTT (1 << 11) /* Root Table Type */ +#define DMAR_RTADDR_RTA_MASK 0xfffffffffffff000 /* Context Command register */ #define DMAR_CCMD_REG 0x28 From owner-svn-src-head@freebsd.org Tue Aug 9 19:06:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4BEBB400B; Tue, 9 Aug 2016 19:06:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F351608; Tue, 9 Aug 2016 19:06:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79J65Yd058285; Tue, 9 Aug 2016 19:06:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79J65Uq058283; Tue, 9 Aug 2016 19:06:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608091906.u79J65Uq058283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Aug 2016 19:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303887 - head/tools/tools/dmardump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:06:06 -0000 Author: jhb Date: Tue Aug 9 19:06:05 2016 New Revision: 303887 URL: https://svnweb.freebsd.org/changeset/base/303887 Log: Add a dmardump utility to dump the VT-d context tables. This tool parses the ACPI DMAR table looking for DMA remapping devices. For each device it walks the root table and any context tables referenced to display mapping info for PCI devices. Note that acpidump -t already parses the info in the ACPI DMAR tables directly. This tool examines some of the data structures the DMAR remapping engines use to translate DMA requests. Reviewed by: kib, grehan MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7444 Added: head/tools/tools/dmardump/ head/tools/tools/dmardump/Makefile (contents, props changed) head/tools/tools/dmardump/dmardump.c (contents, props changed) Added: head/tools/tools/dmardump/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/dmardump/Makefile Tue Aug 9 19:06:05 2016 (r303887) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +PROG= dmardump +SRCS= dmardump.c +MAN= + +# Pull in bits from acpidump +ACPIDUMP=${.CURDIR}/../../../usr.sbin/acpi/acpidump +.PATH: ${ACPIDUMP} +SRCS+= acpi_user.c acpi.c +CFLAGS+= -I${ACPIDUMP} + +CFLAGS+= -I${.CURDIR}/../../../sys + +.include Added: head/tools/tools/dmardump/dmardump.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/dmardump/dmardump.c Tue Aug 9 19:06:05 2016 (r303887) @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "acpidump.h" + +int tflag; +int vflag; + +static uint32_t +read_4(char *regs, size_t offset) +{ + return *(uint32_t *)(regs + offset); +} + +static uint64_t +read_8(char *regs, size_t offset) +{ + return *(uint64_t *)(regs + offset); +} + +static struct pci_conf * +pci_find_conf(int segment, int bus, int slot, int func) +{ + static int pcifd = -1; + static struct pci_conf conf; + struct pci_conf_io pc; + struct pci_match_conf patterns[1]; + + if (pcifd == -1) { + pcifd = open("/dev/pci", O_RDONLY); + if (pcifd < 0) + err(1, "Failed to open /dev/pci"); + } + + bzero(&pc, sizeof(pc)); + pc.match_buf_len = sizeof(conf); + pc.matches = &conf; + bzero(&patterns, sizeof(patterns)); + patterns[0].pc_sel.pc_domain = segment; + patterns[0].pc_sel.pc_bus = bus; + patterns[0].pc_sel.pc_dev = slot; + patterns[0].pc_sel.pc_func = func; + patterns[0].flags = PCI_GETCONF_MATCH_DOMAIN | + PCI_GETCONF_MATCH_BUS | PCI_GETCONF_MATCH_DEV | + PCI_GETCONF_MATCH_FUNC; + pc.num_patterns = 1; + pc.pat_buf_len = sizeof(patterns); + pc.patterns = patterns; + if (ioctl(pcifd, PCIOCGETCONF, &pc) == -1) + err(1, "ioctl(PCIOCGETCONF)"); + + if (pc.status != PCI_GETCONF_LAST_DEVICE || + pc.num_matches == 0) + return (NULL); + + return (&conf); +} + +static void +dump_context_table(int segment, int bus, uint64_t base_addr) +{ + struct dmar_ctx_entry *ctx; + struct pci_conf *conf; + bool printed; + int idx; + + printed = false; + ctx = acpi_map_physical(base_addr, DMAR_PAGE_SIZE); + for (idx = 0; idx < DMAR_CTX_CNT; idx++) { + if (!(ctx[idx].ctx1 & DMAR_CTX1_P)) + continue; + if (!printed) { + printf("\tPCI bus %d:\n", bus); + printed = true; + } + + /* Check for ARI device first. */ + conf = pci_find_conf(segment, bus, 0, idx); + if (conf == NULL) + conf = pci_find_conf(segment, bus, idx >> 3, idx & 7); + if (conf != NULL) { + printf("\t { %d,%d }", conf->pc_sel.pc_dev, + conf->pc_sel.pc_func); + if (conf->pd_name[0] != '\0') + printf(" (%s%lu)", conf->pd_name, + conf->pd_unit); + } else + printf("\t { %d,%d } (absent)", idx >> 3, + idx & 7); + if (ctx[idx].ctx1 & DMAR_CTX1_FPD) + printf(" FPD"); + switch (ctx[idx].ctx1 & 0xc) { + case DMAR_CTX1_T_UNTR: + printf(" UNTR"); + break; + case DMAR_CTX1_T_TR: + printf(" TR"); + break; + case DMAR_CTX1_T_PASS: + printf(" PASS"); + break; + default: + printf(" TT3?"); + break; + } + printf(" SLPT %#jx", (uintmax_t)(ctx[idx].ctx1 & + DMAR_CTX1_ASR_MASK)); + printf(" domain %d", (int)DMAR_CTX2_GET_DID(ctx[idx].ctx2)); + printf("\n"); + } +} + +static void +handle_drhd(int segment, uint64_t base_addr) +{ + struct dmar_root_entry *root_table; + char *regs; + uint64_t rtaddr; + uint32_t gsts, ver; + bool extended; + int bus; + + regs = acpi_map_physical(base_addr, 4096); + + ver = read_4(regs, DMAR_VER_REG); + gsts = read_4(regs, DMAR_GSTS_REG); + printf("drhd @ %#jx (version %d.%d) PCI segment %d%s:\n", + (uintmax_t)base_addr, DMAR_MAJOR_VER(ver), DMAR_MINOR_VER(ver), + segment, gsts & DMAR_GSTS_TES ? "" : " (disabled)"); + if ((gsts & (DMAR_GSTS_TES | DMAR_GSTS_RTPS)) != + (DMAR_GSTS_TES | DMAR_GSTS_RTPS)) + return; + rtaddr = read_8(regs, DMAR_RTADDR_REG); + extended = (rtaddr & DMAR_RTADDR_RTT) != 0; + printf(" %sroot table @ 0x%#jx\n", extended ? "extended " : "", + rtaddr & DMAR_RTADDR_RTA_MASK); + root_table = acpi_map_physical(rtaddr & DMAR_RTADDR_RTA_MASK, 4096); + for (bus = 0; bus < 255; bus++) { + if (extended) { +#ifdef notyet + if (root_table[bus].r1 & DMAR_ROOT_R1_P) + dump_ext_context_table(segment, bus, + root_table[bus].r1 & DMAR_ROOT_R1_CTP_MASK, + false); + if (root_table[bus].r2 & DMAR_ROOT_R1_P) + dump_ext_context_table(segment, bus, + root_table[bus].r2 & DMAR_ROOT_R1_CTP_MASK, + true); +#endif + } else if (root_table[bus].r1 & DMAR_ROOT_R1_P) + dump_context_table(segment, bus, root_table[bus].r1 & + DMAR_ROOT_R1_CTP_MASK); + } +} + +/* Borrowed from acpi.c in acpidump: */ + +static void +acpi_handle_dmar_drhd(ACPI_DMAR_HARDWARE_UNIT *drhd) +{ + + handle_drhd(drhd->Segment, drhd->Address); +} + +static int +acpi_handle_dmar_remapping_structure(void *addr, int remaining) +{ + ACPI_DMAR_HEADER *hdr = addr; + + if (remaining < (int)sizeof(ACPI_DMAR_HEADER)) + return (-1); + + if (remaining < hdr->Length) + return (-1); + + switch (hdr->Type) { + case ACPI_DMAR_TYPE_HARDWARE_UNIT: + acpi_handle_dmar_drhd(addr); + break; + } + return (hdr->Length); +} + +static void +acpi_handle_dmar(ACPI_TABLE_HEADER *sdp) +{ + char *cp; + int remaining, consumed; + ACPI_TABLE_DMAR *dmar; + + dmar = (ACPI_TABLE_DMAR *)sdp; + remaining = sdp->Length - sizeof(ACPI_TABLE_DMAR); + while (remaining > 0) { + cp = (char *)sdp + sdp->Length - remaining; + consumed = acpi_handle_dmar_remapping_structure(cp, remaining); + if (consumed <= 0) + break; + else + remaining -= consumed; + } +} + +static ACPI_TABLE_HEADER * +acpi_map_sdt(vm_offset_t pa) +{ + ACPI_TABLE_HEADER *sp; + + sp = acpi_map_physical(pa, sizeof(ACPI_TABLE_HEADER)); + sp = acpi_map_physical(pa, sp->Length); + return (sp); +} + +static void +walk_rsdt(ACPI_TABLE_HEADER *rsdp) +{ + ACPI_TABLE_HEADER *sdp; + ACPI_TABLE_RSDT *rsdt; + ACPI_TABLE_XSDT *xsdt; + vm_offset_t addr; + int addr_size, entries, i; + + if (memcmp(rsdp->Signature, "RSDT", 4) != 0) + addr_size = sizeof(uint32_t); + else + addr_size = sizeof(uint64_t); + rsdt = (ACPI_TABLE_RSDT *)rsdp; + xsdt = (ACPI_TABLE_XSDT *)rsdp; + entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size; + for (i = 0; i < entries; i++) { + if (addr_size == 4) + addr = le32toh(rsdt->TableOffsetEntry[i]); + else + addr = le64toh(xsdt->TableOffsetEntry[i]); + if (addr == 0) + continue; + sdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(addr); + if (acpi_checksum(sdp, sdp->Length)) { + continue; + } + if (!memcmp(sdp->Signature, ACPI_SIG_DMAR, 4)) + acpi_handle_dmar(sdp); + } +} + +int +main(int argc __unused, char *argv[] __unused) +{ + ACPI_TABLE_HEADER *rsdt; + + rsdt = sdt_load_devmem(); + walk_rsdt(rsdt); + return 0; +} From owner-svn-src-head@freebsd.org Tue Aug 9 19:20:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4E8BBB439D; Tue, 9 Aug 2016 19:20:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B70F71E36; Tue, 9 Aug 2016 19:20:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79JKrpu062147; Tue, 9 Aug 2016 19:20:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79JKrKo062146; Tue, 9 Aug 2016 19:20:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608091920.u79JKrKo062146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Aug 2016 19:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303889 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:20:55 -0000 Author: pfg Date: Tue Aug 9 19:20:53 2016 New Revision: 303889 URL: https://svnweb.freebsd.org/changeset/base/303889 Log: libc/rpc: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Modified: head/lib/libc/rpc/svc_vc.c Modified: head/lib/libc/rpc/svc_vc.c ============================================================================== --- head/lib/libc/rpc/svc_vc.c Tue Aug 9 19:20:53 2016 (r303888) +++ head/lib/libc/rpc/svc_vc.c Tue Aug 9 19:20:53 2016 (r303889) @@ -700,7 +700,7 @@ svc_vc_rendezvous_ops(SVCXPRT *xprt) ops.xp_reply = (bool_t (*)(SVCXPRT *, struct rpc_msg *))abort; ops.xp_freeargs = - (bool_t (*)(SVCXPRT *, xdrproc_t, void *))abort, + (bool_t (*)(SVCXPRT *, xdrproc_t, void *))abort; ops.xp_destroy = svc_vc_destroy; ops2.xp_control = svc_vc_rendezvous_control; } From owner-svn-src-head@freebsd.org Tue Aug 9 19:32:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37774BB46DC; Tue, 9 Aug 2016 19:32:10 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3FDF276D; Tue, 9 Aug 2016 19:32:09 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79JW9oS069476; Tue, 9 Aug 2016 19:32:09 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79JW6Y6069448; Tue, 9 Aug 2016 19:32:06 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201608091932.u79JW6Y6069448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Tue, 9 Aug 2016 19:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303890 - in head/sys: contrib/ncsw/user/env contrib/octeon-sdk dev/auxio dev/bktr dev/e1000 dev/ixgb dev/ixgbe dev/ixl dev/netmap dev/pci dev/sound/sbus dev/tpm kern mips/nlm/dev/net m... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:32:10 -0000 Author: dumbbell Date: Tue Aug 9 19:32:06 2016 New Revision: 303890 URL: https://svnweb.freebsd.org/changeset/base/303890 Log: Consistently use `device_t` Several files use the internal name of `struct device` instead of `device_t` which is part of the public API. This patch changes all `struct device *` to `device_t`. The remaining occurrences of `struct device` are those referring to the Linux or OpenBSD version of the structure, or the code is not built on FreeBSD and it's unclear what to do. Submitted by: Matthew Macy (previous version) Approved by: emaste, jhibbits, sbruno MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7447 Modified: head/sys/contrib/ncsw/user/env/xx.c head/sys/contrib/octeon-sdk/cvmx-twsi.c head/sys/dev/auxio/auxio.c head/sys/dev/bktr/bktr_os.c head/sys/dev/bktr/bktr_reg.h head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.h head/sys/dev/ixgb/if_ixgb.h head/sys/dev/ixgb/if_ixgb_osdep.h head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixlv.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/pci/pcivar.h head/sys/dev/sound/sbus/cs4231.c head/sys/dev/tpm/tpm.c head/sys/kern/subr_bus.c head/sys/mips/nlm/dev/net/xlpge.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/powerpc/include/bus_dma.h head/sys/powerpc/powerpc/busdma_machdep.c head/sys/sparc64/fhc/clkbrd.c head/sys/sys/pcpu.h head/sys/sys/rman.h Modified: head/sys/contrib/ncsw/user/env/xx.c ============================================================================== --- head/sys/contrib/ncsw/user/env/xx.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/contrib/ncsw/user/env/xx.c Tue Aug 9 19:32:06 2016 (r303890) @@ -406,7 +406,7 @@ XX_DeallocIntr(int irq) t_Error XX_SetIntr(int irq, t_Isr *f_Isr, t_Handle handle) { - struct device *dev; + device_t dev; struct resource *r; unsigned int flags; int err; @@ -455,7 +455,7 @@ finish: t_Error XX_FreeIntr(int irq) { - struct device *dev; + device_t dev; struct resource *r; r = (struct resource *)irq; Modified: head/sys/contrib/octeon-sdk/cvmx-twsi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-twsi.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/contrib/octeon-sdk/cvmx-twsi.c Tue Aug 9 19:32:06 2016 (r303890) @@ -85,7 +85,7 @@ static struct i2c_adapter *__cvmx_twsix_ resource_size_t twsi_phys; void __iomem *twsi_base; resource_size_t regsize; - struct device *dev; + device_t dev; int broken_irq_mode; }; struct i2c_adapter *adapter; Modified: head/sys/dev/auxio/auxio.c ============================================================================== --- head/sys/dev/auxio/auxio.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/auxio/auxio.c Tue Aug 9 19:32:06 2016 (r303890) @@ -98,7 +98,7 @@ __FBSDID("$FreeBSD$"); #define AUXIO_PCIO_NREG 5 struct auxio_softc { - struct device *sc_dev; + device_t sc_dev; int sc_nauxio; struct resource *sc_res[AUXIO_PCIO_NREG]; Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/bktr/bktr_os.c Tue Aug 9 19:32:06 2016 (r303890) @@ -889,10 +889,11 @@ vm_offset_t vm_page_alloc_contig(vm_offs #if defined(__OpenBSD__) static int bktr_probe(struct device *, void *, void *); +static void bktr_attach(struct device *, struct device *, void *); #else -static int bktr_probe(struct device *, struct cfdata *, void *); +static int bktr_probe(device_t, struct cfdata *, void *); +static void bktr_attach(device_t, device_t, void *); #endif -static void bktr_attach(struct device *, struct device *, void *); struct cfattach bktr_ca = { sizeof(struct bktr_softc), bktr_probe, bktr_attach @@ -908,10 +909,11 @@ struct cfdriver bktr_cd = { int bktr_probe(parent, match, aux) - struct device *parent; #if defined(__OpenBSD__) + struct device *parent; void *match; #else + device_t parent; struct cfdata *match; #endif void *aux; @@ -933,7 +935,15 @@ bktr_probe(parent, match, aux) * the attach routine. */ static void -bktr_attach(struct device *parent, struct device *self, void *aux) +bktr_attach(parent, self, aux) +#if defined(__OpenBSD__) + struct device *parent; + struct device *self; +#else + device_t parent; + device_t self; +#endif + void *aux; { bktr_ptr_t bktr; u_long latency; Modified: head/sys/dev/bktr/bktr_reg.h ============================================================================== --- head/sys/dev/bktr/bktr_reg.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/bktr/bktr_reg.h Tue Aug 9 19:32:06 2016 (r303890) @@ -35,7 +35,7 @@ */ #ifdef __NetBSD__ -#include /* struct device */ +#include /* device_t */ #include #include /* struct selinfo */ # ifdef DEBUG Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/e1000/e1000_osdep.h Tue Aug 9 19:32:06 2016 (r303890) @@ -134,7 +134,7 @@ struct e1000_osdep bus_space_handle_t io_bus_space_handle; bus_space_tag_t flash_bus_space_tag; bus_space_handle_t flash_bus_space_handle; - struct device *dev; + device_t dev; }; #define E1000_REGISTER(hw, reg) (((hw)->mac.type >= e1000_82543) \ Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/e1000/if_em.h Tue Aug 9 19:32:06 2016 (r303890) @@ -394,7 +394,7 @@ struct adapter { /* FreeBSD operating-system-specific structures. */ struct e1000_osdep osdep; - struct device *dev; + device_t dev; struct cdev *led_dev; struct resource *memory; Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/e1000/if_igb.h Tue Aug 9 19:32:06 2016 (r303890) @@ -429,7 +429,7 @@ struct adapter { struct e1000_hw hw; struct e1000_osdep osdep; - struct device *dev; + device_t dev; struct cdev *led_dev; struct resource *pci_mem; Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/e1000/if_lem.h Tue Aug 9 19:32:06 2016 (r303890) @@ -298,7 +298,7 @@ struct adapter { /* FreeBSD operating-system-specific structures. */ struct e1000_osdep osdep; - struct device *dev; + device_t dev; struct cdev *led_dev; struct resource *memory; Modified: head/sys/dev/ixgb/if_ixgb.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixgb/if_ixgb.h Tue Aug 9 19:32:06 2016 (r303890) @@ -277,7 +277,7 @@ struct adapter { /* FreeBSD operating-system-specific structures */ struct ixgb_osdep osdep; - struct device *dev; + device_t dev; struct resource *res_memory; struct resource *res_ioport; struct resource *res_interrupt; Modified: head/sys/dev/ixgb/if_ixgb_osdep.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb_osdep.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixgb/if_ixgb_osdep.h Tue Aug 9 19:32:06 2016 (r303890) @@ -90,7 +90,7 @@ struct ixgb_osdep { bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; - struct device *dev; + device_t dev; }; #define IXGB_WRITE_FLUSH(a) IXGB_READ_REG(a, STATUS) Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixgbe/ixgbe.h Tue Aug 9 19:32:06 2016 (r303890) @@ -458,7 +458,7 @@ struct adapter { struct ixgbe_hw hw; struct ixgbe_osdep osdep; - struct device *dev; + device_t dev; struct ifnet *ifp; struct resource *pci_mem; Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixl/i40e_osdep.h Tue Aug 9 19:32:06 2016 (r303890) @@ -151,7 +151,7 @@ struct i40e_osdep { bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; uint32_t flush_reg; - struct device *dev; + device_t dev; }; struct i40e_dma_mem { Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixl/ixl.h Tue Aug 9 19:32:06 2016 (r303890) @@ -512,7 +512,7 @@ SLIST_HEAD(ixl_ftl_head, ixl_mac_filter) struct ixl_vsi { void *back; struct ifnet *ifp; - struct device *dev; + device_t dev; struct i40e_hw *hw; struct ifmedia media; enum i40e_vsi_type type; Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixl/ixl_pf.h Tue Aug 9 19:32:06 2016 (r303890) @@ -63,7 +63,7 @@ struct ixl_vf { struct ixl_pf { struct i40e_hw hw; struct i40e_osdep osdep; - struct device *dev; + device_t dev; struct ixl_vsi vsi; struct resource *pci_mem; Modified: head/sys/dev/ixl/ixlv.h ============================================================================== --- head/sys/dev/ixl/ixlv.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/ixl/ixlv.h Tue Aug 9 19:32:06 2016 (r303890) @@ -115,7 +115,7 @@ SLIST_HEAD(vlan_list, ixlv_vlan_filter); struct ixlv_sc { struct i40e_hw hw; struct i40e_osdep osdep; - struct device *dev; + device_t dev; struct resource *pci_mem; struct resource *msix_mem; Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/netmap/netmap_mem2.c Tue Aug 9 19:32:06 2016 (r303890) @@ -201,7 +201,7 @@ NMD_DEFNACB(void, rings_delete); static int netmap_mem_map(struct netmap_obj_pool *, struct netmap_adapter *); static int netmap_mem_unmap(struct netmap_obj_pool *, struct netmap_adapter *); -static int nm_mem_assign_group(struct netmap_mem_d *, struct device *); +static int nm_mem_assign_group(struct netmap_mem_d *, device_t); #define NMA_LOCK_INIT(n) NM_MTX_INIT((n)->nm_mtx) #define NMA_LOCK_DESTROY(n) NM_MTX_DESTROY((n)->nm_mtx) @@ -456,7 +456,7 @@ nm_mem_release_id(struct netmap_mem_d *n } static int -nm_mem_assign_group(struct netmap_mem_d *nmd, struct device *dev) +nm_mem_assign_group(struct netmap_mem_d *nmd, device_t dev) { int err = 0, id; id = nm_iommu_group_id(dev); Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/pci/pcivar.h Tue Aug 9 19:32:06 2016 (r303890) @@ -174,7 +174,7 @@ struct pcicfg_ea { /* config header information common to all header types */ typedef struct pcicfg { - struct device *dev; /* device which owns this */ + device_t dev; /* device which owns this */ STAILQ_HEAD(, pci_map) maps; /* BARs */ Modified: head/sys/dev/sound/sbus/cs4231.c ============================================================================== --- head/sys/dev/sound/sbus/cs4231.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/sound/sbus/cs4231.c Tue Aug 9 19:32:06 2016 (r303890) @@ -113,7 +113,7 @@ struct cs4231_channel { #define CS4231_RES_MEM_MAX 4 #define CS4231_RES_IRQ_MAX 2 struct cs4231_softc { - struct device *sc_dev; + device_t sc_dev; int sc_rid[CS4231_RES_MEM_MAX]; struct resource *sc_res[CS4231_RES_MEM_MAX]; bus_space_handle_t sc_regh[CS4231_RES_MEM_MAX]; Modified: head/sys/dev/tpm/tpm.c ============================================================================== --- head/sys/dev/tpm/tpm.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/dev/tpm/tpm.c Tue Aug 9 19:32:06 2016 (r303890) @@ -175,8 +175,8 @@ struct cfdriver tpm_cd = { NULL, "tpm", DV_DULL }; -int tpm_match(struct device *, void *, void *); -void tpm_attach(struct device *, struct device *, void *); +int tpm_match(device_t , void *, void *); +void tpm_attach(device_t , device_t , void *); struct cfattach tpm_ca = { sizeof(struct tpm_softc), tpm_match, tpm_attach @@ -337,7 +337,7 @@ tpm_detach(device_t dev) * OpenBSD specific code for probing and attaching TPM to device tree. */ int -tpm_match(struct device *parent, void *match, void *aux) +tpm_match(device_t parent, void *match, void *aux) { struct isa_attach_args *ia = aux; struct cfdata *cf = match; @@ -370,7 +370,7 @@ tpm_match(struct device *parent, void *m } void -tpm_attach(struct device *parent, struct device *self, void *aux) +tpm_attach(device_t parent, device_t self, void *aux) { struct tpm_softc *sc = (struct tpm_softc *)self; struct isa_attach_args *ia = aux; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/kern/subr_bus.c Tue Aug 9 19:32:06 2016 (r303890) @@ -1794,7 +1794,7 @@ make_device(device_t parent, const char dc = NULL; } - dev = malloc(sizeof(struct device), M_BUS, M_NOWAIT|M_ZERO); + dev = malloc(sizeof(*dev), M_BUS, M_NOWAIT|M_ZERO); if (!dev) return (NULL); @@ -5278,7 +5278,7 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1; u_int namelen = arg2; int index; - struct device *dev; + device_t dev; struct u_device udev; /* XXX this is a bit big */ int error; Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/mips/nlm/dev/net/xlpge.c Tue Aug 9 19:32:06 2016 (r303890) @@ -175,8 +175,8 @@ static int nlm_xlpge_resume(device_t); static int nlm_xlpge_shutdown(device_t); /* mii override functions */ -static int nlm_xlpge_mii_read(struct device *, int, int); -static int nlm_xlpge_mii_write(struct device *, int, int, int); +static int nlm_xlpge_mii_read(device_t, int, int); +static int nlm_xlpge_mii_write(device_t, int, int, int); static void nlm_xlpge_mii_statchg(device_t); static device_method_t nlm_xlpge_methods[] = { @@ -1290,7 +1290,7 @@ nlm_xlpge_shutdown(device_t dev) * miibus function with custom implementation */ static int -nlm_xlpge_mii_read(struct device *dev, int phyaddr, int regidx) +nlm_xlpge_mii_read(device_t dev, int phyaddr, int regidx) { struct nlm_xlpge_softc *sc; int val; @@ -1306,7 +1306,7 @@ nlm_xlpge_mii_read(struct device *dev, i } static int -nlm_xlpge_mii_write(struct device *dev, int phyaddr, int regidx, int val) +nlm_xlpge_mii_write(device_t dev, int phyaddr, int regidx, int val) { struct nlm_xlpge_softc *sc; Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Aug 9 19:32:06 2016 (r303890) @@ -140,8 +140,8 @@ static int nlge_ioctl(struct ifnet *, u_ static int nlge_tx(struct ifnet *ifp, struct mbuf *m); static void nlge_rx(struct nlge_softc *sc, vm_paddr_t paddr, int len); -static int nlge_mii_write(struct device *, int, int, int); -static int nlge_mii_read(struct device *, int, int); +static int nlge_mii_write(device_t, int, int, int); +static int nlge_mii_read(device_t, int, int); static void nlge_mac_mii_statchg(device_t); static int nlge_mediachange(struct ifnet *ifp); static void nlge_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); @@ -831,7 +831,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ } static int -nlge_mii_write(struct device *dev, int phyaddr, int regidx, int regval) +nlge_mii_write(device_t dev, int phyaddr, int regidx, int regval) { struct nlge_softc *sc; @@ -843,7 +843,7 @@ nlge_mii_write(struct device *dev, int p } static int -nlge_mii_read(struct device *dev, int phyaddr, int regidx) +nlge_mii_read(device_t dev, int phyaddr, int regidx) { struct nlge_softc *sc; int val; Modified: head/sys/powerpc/include/bus_dma.h ============================================================================== --- head/sys/powerpc/include/bus_dma.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/powerpc/include/bus_dma.h Tue Aug 9 19:32:06 2016 (r303890) @@ -30,8 +30,6 @@ #include -struct device; - -int bus_dma_tag_set_iommu(bus_dma_tag_t, struct device *iommu, void *cookie); +int bus_dma_tag_set_iommu(bus_dma_tag_t, device_t iommu, void *cookie); #endif /* _POWERPC_BUS_DMA_H_ */ Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/powerpc/powerpc/busdma_machdep.c Tue Aug 9 19:32:06 2016 (r303890) @@ -1210,7 +1210,7 @@ busdma_swi(void) } int -bus_dma_tag_set_iommu(bus_dma_tag_t tag, struct device *iommu, void *cookie) +bus_dma_tag_set_iommu(bus_dma_tag_t tag, device_t iommu, void *cookie) { tag->iommu = iommu; tag->iommu_cookie = cookie; Modified: head/sys/sparc64/fhc/clkbrd.c ============================================================================== --- head/sys/sparc64/fhc/clkbrd.c Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/sparc64/fhc/clkbrd.c Tue Aug 9 19:32:06 2016 (r303890) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #define CLKBRD_CLKVER 2 struct clkbrd_softc { - struct device *sc_dev; + device_t sc_dev; struct resource *sc_res[CLKBRD_NREG]; int sc_rid[CLKBRD_NREG]; bus_space_tag_t sc_bt[CLKBRD_NREG]; Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/sys/pcpu.h Tue Aug 9 19:32:06 2016 (r303890) @@ -160,7 +160,7 @@ struct pcpu { struct lock_list_entry *pc_spinlocks; struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ - struct device *pc_device; + device_t pc_device; void *pc_netisr; /* netisr SWI cookie */ int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Tue Aug 9 19:20:53 2016 (r303889) +++ head/sys/sys/rman.h Tue Aug 9 19:32:06 2016 (r303890) @@ -127,7 +127,7 @@ int rman_first_free_region(struct rman * bus_space_handle_t rman_get_bushandle(struct resource *); bus_space_tag_t rman_get_bustag(struct resource *); rman_res_t rman_get_end(struct resource *); -struct device *rman_get_device(struct resource *); +device_t rman_get_device(struct resource *); u_int rman_get_flags(struct resource *); void rman_get_mapping(struct resource *, struct resource_map *); int rman_get_rid(struct resource *); @@ -145,13 +145,13 @@ int rman_is_region_manager(struct resour int rman_release_resource(struct resource *r); struct resource *rman_reserve_resource(struct rman *rm, rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags, struct device *dev); + u_int flags, device_t dev); struct resource *rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end, rman_res_t count, rman_res_t bound, - u_int flags, struct device *dev); + u_int flags, device_t dev); void rman_set_bushandle(struct resource *_r, bus_space_handle_t _h); void rman_set_bustag(struct resource *_r, bus_space_tag_t _t); -void rman_set_device(struct resource *_r, struct device *_dev); +void rman_set_device(struct resource *_r, device_t _dev); void rman_set_end(struct resource *_r, rman_res_t _end); void rman_set_mapping(struct resource *, struct resource_map *); void rman_set_rid(struct resource *_r, int _rid); From owner-svn-src-head@freebsd.org Tue Aug 9 19:41:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB81ABB4AB8; Tue, 9 Aug 2016 19:41:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA4D2ED0; Tue, 9 Aug 2016 19:41:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Jfkt7072692; Tue, 9 Aug 2016 19:41:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79JfkZV072686; Tue, 9 Aug 2016 19:41:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608091941.u79JfkZV072686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Aug 2016 19:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303891 - in head/sys/dev: aic7xxx ath/ath_hal/ar5212 ath/ath_hal/ar5416 bxe etherswitch/ip17x usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:41:48 -0000 Author: pfg Date: Tue Aug 9 19:41:46 2016 New Revision: 303891 URL: https://svnweb.freebsd.org/changeset/base/303891 Log: sys/dev: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Modified: head/sys/dev/aic7xxx/aic7xxx_osm.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/bxe/bxe.c head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/usb/controller/ehci_ixp4xx.c Modified: head/sys/dev/aic7xxx/aic7xxx_osm.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_osm.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/aic7xxx/aic7xxx_osm.c Tue Aug 9 19:41:46 2016 (r303891) @@ -130,7 +130,7 @@ aic7770_map_registers(struct ahc_softc * return ENOMEM; } ahc->platform_data->regs_res_type = SYS_RES_IOPORT; - ahc->platform_data->regs_res_id = rid, + ahc->platform_data->regs_res_id = rid; ahc->platform_data->regs = regs; ahc->tag = rman_get_bustag(regs); ahc->bsh = rman_get_bushandle(regs); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue Aug 9 19:41:46 2016 (r303891) @@ -270,8 +270,8 @@ ar5212InitState(struct ath_hal_5212 *ahp ahp->ah_acktimeout = (u_int) -1; ahp->ah_ctstimeout = (u_int) -1; ahp->ah_sifstime = (u_int) -1; - ahp->ah_txTrigLev = INIT_TX_FIFO_THRESHOLD, - ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD, + ahp->ah_txTrigLev = INIT_TX_FIFO_THRESHOLD; + ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD; OS_MEMCPY(&ahp->ah_bssidmask, defbssidmask, IEEE80211_ADDR_LEN); #undef N Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Aug 9 19:41:46 2016 (r303891) @@ -103,8 +103,8 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_configPCIE = ar5416ConfigPCIE; ah->ah_disablePCIE = ar5416DisablePCIE; ah->ah_perCalibration = ar5416PerCalibration; - ah->ah_perCalibrationN = ar5416PerCalibrationN, - ah->ah_resetCalValid = ar5416ResetCalValid, + ah->ah_perCalibrationN = ar5416PerCalibrationN; + ah->ah_resetCalValid = ar5416ResetCalValid; ah->ah_setTxPowerLimit = ar5416SetTxPowerLimit; ah->ah_setTxPower = ar5416SetTransmitPower; ah->ah_setBoardValues = ar5416SetBoardValues; Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/bxe/bxe.c Tue Aug 9 19:41:46 2016 (r303891) @@ -13332,7 +13332,7 @@ bxe_get_shmem_info(struct bxe_softc *sc) /* get the port feature config */ sc->port.config = - SHMEM_RD(sc, dev_info.port_feature_config[port].config), + SHMEM_RD(sc, dev_info.port_feature_config[port].config); /* get the link params */ sc->link_params.speed_cap_mask[0] = Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Tue Aug 9 19:41:46 2016 (r303891) @@ -84,7 +84,7 @@ ip17x_probe(device_t dev) phy_id1 = MDIO_READREG(device_get_parent(dev), 0, MII_PHYIDR1); phy_id2 = MDIO_READREG(device_get_parent(dev), 0, MII_PHYIDR2); - oui = MII_OUI(phy_id1, phy_id2), + oui = MII_OUI(phy_id1, phy_id2); model = MII_MODEL(phy_id2); /* We only care about IC+ devices. */ if (oui != IP17X_OUI) { Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Tue Aug 9 19:32:06 2016 (r303890) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Tue Aug 9 19:41:46 2016 (r303891) @@ -147,13 +147,13 @@ ehci_ixp_attach(device_t self) isc->iot = rman_get_bustag(sc->sc_io_res); isc->tag.bs_privdata = isc->iot; /* read single */ - isc->tag.bs_r_1 = ehci_bs_r_1, - isc->tag.bs_r_2 = ehci_bs_r_2, - isc->tag.bs_r_4 = ehci_bs_r_4, + isc->tag.bs_r_1 = ehci_bs_r_1; + isc->tag.bs_r_2 = ehci_bs_r_2; + isc->tag.bs_r_4 = ehci_bs_r_4; /* write (single) */ - isc->tag.bs_w_1 = ehci_bs_w_1, - isc->tag.bs_w_2 = ehci_bs_w_2, - isc->tag.bs_w_4 = ehci_bs_w_4, + isc->tag.bs_w_1 = ehci_bs_w_1; + isc->tag.bs_w_2 = ehci_bs_w_2; + isc->tag.bs_w_4 = ehci_bs_w_4; sc->sc_io_tag = &isc->tag; sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); From owner-svn-src-head@freebsd.org Tue Aug 9 19:42:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E268BB4B28; Tue, 9 Aug 2016 19:42:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8A711B2; Tue, 9 Aug 2016 19:42:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79JgLqc073418; Tue, 9 Aug 2016 19:42:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79JgKT1073409; Tue, 9 Aug 2016 19:42:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608091942.u79JgKT1073409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Aug 2016 19:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303892 - in head/sys: arm/xscale/ixp425 boot/i386/zfsboot cam/ata cam/scsi net80211 sparc64/pci x86/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:42:22 -0000 Author: pfg Date: Tue Aug 9 19:42:20 2016 New Revision: 303892 URL: https://svnweb.freebsd.org/changeset/base/303892 Log: sys: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Modified: head/sys/arm/xscale/ixp425/avila_ata.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/cam/ata/ata_all.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_da.c head/sys/net80211/ieee80211_crypto_wep.c head/sys/sparc64/pci/fire.c head/sys/x86/cpufreq/powernow.c Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/arm/xscale/ixp425/avila_ata.c Tue Aug 9 19:42:20 2016 (r303892) @@ -202,17 +202,17 @@ ata_avila_attach(device_t dev) */ sc->sc_expbus_tag.bs_privdata = sc; /* NB: backpointer */ /* read single */ - sc->sc_expbus_tag.bs_r_1 = ata_bs_r_1, - sc->sc_expbus_tag.bs_r_2 = ata_bs_r_2, + sc->sc_expbus_tag.bs_r_1 = ata_bs_r_1; + sc->sc_expbus_tag.bs_r_2 = ata_bs_r_2; /* read multiple */ - sc->sc_expbus_tag.bs_rm_2 = ata_bs_rm_2, - sc->sc_expbus_tag.bs_rm_2_s = ata_bs_rm_2_s, + sc->sc_expbus_tag.bs_rm_2 = ata_bs_rm_2; + sc->sc_expbus_tag.bs_rm_2_s = ata_bs_rm_2_s; /* write (single) */ - sc->sc_expbus_tag.bs_w_1 = ata_bs_w_1, - sc->sc_expbus_tag.bs_w_2 = ata_bs_w_2, + sc->sc_expbus_tag.bs_w_1 = ata_bs_w_1; + sc->sc_expbus_tag.bs_w_2 = ata_bs_w_2; /* write multiple */ - sc->sc_expbus_tag.bs_wm_2 = ata_bs_wm_2, - sc->sc_expbus_tag.bs_wm_2_s = ata_bs_wm_2_s, + sc->sc_expbus_tag.bs_wm_2 = ata_bs_wm_2; + sc->sc_expbus_tag.bs_wm_2_s = ata_bs_wm_2_s; rman_set_bustag(&sc->sc_ata, &sc->sc_expbus_tag); rman_set_bustag(&sc->sc_alt_ata, &sc->sc_expbus_tag); Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/boot/i386/zfsboot/zfsboot.c Tue Aug 9 19:42:20 2016 (r303892) @@ -576,7 +576,7 @@ main(void) bootinfo.bi_bios_dev = dsk->drive; bootdev = MAKEBOOTDEV(dev_maj[dsk->type], - dsk->slice, dsk->unit, dsk->part), + dsk->slice, dsk->unit, dsk->part); /* Process configuration file */ Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/cam/ata/ata_all.c Tue Aug 9 19:42:20 2016 (r303892) @@ -1075,7 +1075,7 @@ ata_zac_mgmt_in(struct ccb_ataio *ataio, } else { command_out = ATA_RECV_FPDMA_QUEUED; sectors_out = ATA_RFPDMA_ZAC_MGMT_IN << 8; - auxiliary = (zm_action & 0xf) | (zone_flags << 8), + auxiliary = (zm_action & 0xf) | (zone_flags << 8); ata_flags = CAM_ATAIO_FPDMA; /* * For RECEIVE FPDMA QUEUED, the transfer length is Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/cam/scsi/scsi_all.c Tue Aug 9 19:42:20 2016 (r303892) @@ -8691,7 +8691,7 @@ scsi_read_attribute(struct ccb_scsiio *c bzero(scsi_cmd, sizeof(*scsi_cmd)); scsi_cmd->opcode = READ_ATTRIBUTE; - scsi_cmd->service_action = service_action, + scsi_cmd->service_action = service_action; scsi_ulto2b(element, scsi_cmd->element); scsi_cmd->elem_type = elem_type; scsi_cmd->logical_volume = logical_volume; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/cam/scsi/scsi_da.c Tue Aug 9 19:42:20 2016 (r303892) @@ -5718,7 +5718,7 @@ scsi_ata_zac_mgmt_out(struct ccb_scsiio if (use_ncq == 0) { command_out = ATA_ZAC_MANAGEMENT_OUT; - features_out = (zm_action & 0xf) | (zone_flags << 8), + features_out = (zm_action & 0xf) | (zone_flags << 8); ata_flags = AP_FLAG_BYT_BLOK_BLOCKS; if (dxfer_len == 0) { protocol = AP_PROTO_NON_DATA; @@ -5833,8 +5833,8 @@ scsi_ata_zac_mgmt_in(struct ccb_scsiio * if (use_ncq == 0) { command_out = ATA_ZAC_MANAGEMENT_IN; /* XXX KDM put a macro here */ - features_out = (zm_action & 0xf) | (zone_flags << 8), - sectors_out = dxfer_len >> 9, /* XXX KDM macro*/ + features_out = (zm_action & 0xf) | (zone_flags << 8); + sectors_out = dxfer_len >> 9; /* XXX KDM macro */ protocol = AP_PROTO_DMA; ata_flags |= AP_FLAG_TLEN_SECT_CNT; auxiliary = 0; Modified: head/sys/net80211/ieee80211_crypto_wep.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_wep.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/net80211/ieee80211_crypto_wep.c Tue Aug 9 19:42:20 2016 (r303892) @@ -433,7 +433,7 @@ wep_decrypt(struct ieee80211_key *key, s } off = hdrlen + wep.ic_header; - data_len = m->m_pkthdr.len - (off + wep.ic_trailer), + data_len = m->m_pkthdr.len - (off + wep.ic_trailer); /* Compute CRC32 over unencrypted data and apply RC4 to data */ crc = ~0; Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/sparc64/pci/fire.c Tue Aug 9 19:42:20 2016 (r303892) @@ -740,11 +740,11 @@ fire_attach(device_t dev) "DLU/TLU correctable errors"); FIRE_SYSCTL_ADD_UINT("tlu_oe_non_fatal", &sc->sc_stats_tlu_oe_non_fatal, - "DLU/TLU other event non-fatal errors summary"), + "DLU/TLU other event non-fatal errors summary"); FIRE_SYSCTL_ADD_UINT("tlu_oe_rx_err", &sc->sc_stats_tlu_oe_rx_err, - "DLU/TLU receive other event errors"), + "DLU/TLU receive other event errors"); FIRE_SYSCTL_ADD_UINT("tlu_oe_tx_err", &sc->sc_stats_tlu_oe_tx_err, - "DLU/TLU transmit other event errors"), + "DLU/TLU transmit other event errors"); FIRE_SYSCTL_ADD_UINT("ubc_dmardue", &sc->sc_stats_ubc_dmardue, "UBC DMARDUE erros"); Modified: head/sys/x86/cpufreq/powernow.c ============================================================================== --- head/sys/x86/cpufreq/powernow.c Tue Aug 9 19:41:46 2016 (r303891) +++ head/sys/x86/cpufreq/powernow.c Tue Aug 9 19:42:20 2016 (r303892) @@ -700,9 +700,9 @@ pn_decode_pst(device_t dev) if (sc->pn_type != PN8_TYPE) return (EINVAL); sc->vst = psb->settlingtime; - sc->rvo = PN8_PSB_TO_RVO(psb->res1), - sc->irt = PN8_PSB_TO_IRT(psb->res1), - sc->mvs = PN8_PSB_TO_MVS(psb->res1), + sc->rvo = PN8_PSB_TO_RVO(psb->res1); + sc->irt = PN8_PSB_TO_IRT(psb->res1); + sc->mvs = PN8_PSB_TO_MVS(psb->res1); sc->low = PN8_PSB_TO_BATT(psb->res1); if (bootverbose) { device_printf(dev, "PSB: VST: %d\n", From owner-svn-src-head@freebsd.org Tue Aug 9 19:44:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5459DBB4D25; Tue, 9 Aug 2016 19:44:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26830178D; Tue, 9 Aug 2016 19:44:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79JiX5f073768; Tue, 9 Aug 2016 19:44:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79JiXqM073767; Tue, 9 Aug 2016 19:44:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608091944.u79JiXqM073767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Aug 2016 19:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303893 - head/lib/libpcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:44:34 -0000 Author: pfg Date: Tue Aug 9 19:44:33 2016 New Revision: 303893 URL: https://svnweb.freebsd.org/changeset/base/303893 Log: libpcap: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Modified: head/lib/libpcap/pcap-netmap.c Modified: head/lib/libpcap/pcap-netmap.c ============================================================================== --- head/lib/libpcap/pcap-netmap.c Tue Aug 9 19:42:20 2016 (r303892) +++ head/lib/libpcap/pcap-netmap.c Tue Aug 9 19:44:33 2016 (r303893) @@ -240,7 +240,7 @@ pcap_netmap_activate(pcap_t *p) p->linktype = DLT_EN10MB; p->selectable_fd = p->fd; p->read_op = pcap_netmap_dispatch; - p->inject_op = pcap_netmap_inject, + p->inject_op = pcap_netmap_inject; p->setfilter_op = install_bpf_program; p->setdirection_op = NULL; p->set_datalink_op = NULL; From owner-svn-src-head@freebsd.org Tue Aug 9 19:46:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1772EBB4E80; Tue, 9 Aug 2016 19:46:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDC501AA4; Tue, 9 Aug 2016 19:46:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Jk6YT073869; Tue, 9 Aug 2016 19:46:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79Jk6q7073868; Tue, 9 Aug 2016 19:46:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608091946.u79Jk6q7073868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Aug 2016 19:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303894 - head/usr.sbin/ancontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 19:46:07 -0000 Author: pfg Date: Tue Aug 9 19:46:05 2016 New Revision: 303894 URL: https://svnweb.freebsd.org/changeset/base/303894 Log: ancontrol(8): replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Modified: head/usr.sbin/ancontrol/ancontrol.c Modified: head/usr.sbin/ancontrol/ancontrol.c ============================================================================== --- head/usr.sbin/ancontrol/ancontrol.c Tue Aug 9 19:44:33 2016 (r303893) +++ head/usr.sbin/ancontrol/ancontrol.c Tue Aug 9 19:46:05 2016 (r303894) @@ -573,9 +573,9 @@ an_dumpstats(const char *iface) printf("Management frames transmitted:\t\t\t[ %u ]\n", stats->an_tx_mgmt_pkts); printf("Refresh frames received:\t\t\t[ %u ]\n", - stats->an_rx_refresh_pkts), + stats->an_rx_refresh_pkts); printf("Refresh frames transmitted:\t\t\t[ %u ]\n", - stats->an_tx_refresh_pkts), + stats->an_tx_refresh_pkts); printf("Poll frames received:\t\t\t\t[ %u ]\n", stats->an_rx_poll_pkts); printf("Poll frames transmitted:\t\t\t[ %u ]\n", From owner-svn-src-head@freebsd.org Tue Aug 9 21:25:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5941BB4FCC; Tue, 9 Aug 2016 21:25:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD3201234; Tue, 9 Aug 2016 21:25:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 83BBBB985; Tue, 9 Aug 2016 17:25:25 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303887 - head/tools/tools/dmardump Date: Tue, 09 Aug 2016 14:22:36 -0700 Message-ID: <73543582.oU1jbu7riv@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608091906.u79J65Uq058283@repo.freebsd.org> References: <201608091906.u79J65Uq058283@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 09 Aug 2016 17:25:25 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 21:25:26 -0000 On Tuesday, August 09, 2016 07:06:05 PM John Baldwin wrote: > Author: jhb > Date: Tue Aug 9 19:06:05 2016 > New Revision: 303887 > URL: https://svnweb.freebsd.org/changeset/base/303887 > > Log: > Add a dmardump utility to dump the VT-d context tables. > > This tool parses the ACPI DMAR table looking for DMA remapping devices. > For each device it walks the root table and any context tables > referenced to display mapping info for PCI devices. > > Note that acpidump -t already parses the info in the ACPI DMAR tables > directly. This tool examines some of the data structures the DMAR > remapping engines use to translate DMA requests. > > Reviewed by: kib, grehan > MFC after: 1 month > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D7444 I should have mentioned that this tool only supports "normal" context entry tables. It does not (yet) support extended context entry tables. However, neither bhyve nor ACPI_DMAR create extended context entry tables. Sample output from a machine where ppt0 is passed through to a bhyve guest: # ./dmardump drhd @ 0xfbffc000 (version 1.0) PCI segment 0: root table @ 0x0x13823f000 PCI bus 0: { 0,0 } (hostb0) TR SLPT 0x139e41000 domain 1 { 1,0 } (pcib2) TR SLPT 0x139e41000 domain 1 { 2,0 } (pcib3) TR SLPT 0x139e41000 domain 1 { 3,0 } (pcib4) TR SLPT 0x139e41000 domain 1 { 3,2 } (pcib5) TR SLPT 0x139e41000 domain 1 { 3,3 } (pcib6) TR SLPT 0x139e41000 domain 1 { 4,0 } TR SLPT 0x139e41000 domain 1 { 4,1 } TR SLPT 0x139e41000 domain 1 { 4,2 } TR SLPT 0x139e41000 domain 1 { 4,3 } TR SLPT 0x139e41000 domain 1 { 4,4 } TR SLPT 0x139e41000 domain 1 { 4,5 } TR SLPT 0x139e41000 domain 1 { 4,6 } TR SLPT 0x139e41000 domain 1 { 4,7 } TR SLPT 0x139e41000 domain 1 { 5,0 } TR SLPT 0x139e41000 domain 1 { 5,1 } TR SLPT 0x139e41000 domain 1 { 5,2 } TR SLPT 0x139e41000 domain 1 { 5,4 } (ioapic0) TR SLPT 0x139e41000 domain 1 { 17,0 } TR SLPT 0x139e41000 domain 1 { 17,4 } (ahci0) TR SLPT 0x139e41000 domain 1 { 20,0 } (xhci0) TR SLPT 0x139e41000 domain 1 { 22,0 } TR SLPT 0x139e41000 domain 1 { 22,1 } TR SLPT 0x139e41000 domain 1 { 26,0 } (ehci0) TR SLPT 0x139e41000 domain 1 { 28,0 } (pcib7) TR SLPT 0x139e41000 domain 1 { 28,6 } (pcib8) TR SLPT 0x139e41000 domain 1 { 29,0 } (ehci1) TR SLPT 0x139e41000 domain 1 { 31,0 } (isab0) TR SLPT 0x139e41000 domain 1 { 31,2 } (ahci1) TR SLPT 0x139e41000 domain 1 { 31,3 } TR SLPT 0x139e41000 domain 1 { 31,6 } TR SLPT 0x139e41000 domain 1 PCI bus 3: { 0,0 } (t5iov0) TR SLPT 0x139e41000 domain 1 { 0,1 } (t5iov1) TR SLPT 0x139e41000 domain 1 { 0,2 } (t5iov2) TR SLPT 0x139e41000 domain 1 { 0,3 } (t5iov3) TR SLPT 0x139e41000 domain 1 { 0,4 } (t5nex0) TR SLPT 0x139e41000 domain 1 { 0,5 } TR SLPT 0x139e41000 domain 1 { 0,6 } TR SLPT 0x139e41000 domain 1 { 0,8 } (ppt0) TR SLPT 0x1a157b000 domain 2 PCI bus 5: { 0,0 } (igb0) TR SLPT 0x139e41000 domain 1 { 0,1 } (igb1) TR SLPT 0x139e41000 domain 1 PCI bus 7: { 0,0 } (pcib9) TR SLPT 0x139e41000 domain 1 PCI bus 8: { 0,0 } (vgapci0) TR SLPT 0x139e41000 domain 1 -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 9 21:45:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0DDBB4714; Tue, 9 Aug 2016 21:45:48 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F340613A8; Tue, 9 Aug 2016 21:45:47 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Ljl96018468; Tue, 9 Aug 2016 21:45:47 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79Ljlrq018467; Tue, 9 Aug 2016 21:45:47 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201608092145.u79Ljlrq018467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Tue, 9 Aug 2016 21:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303895 - 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.22 Precedence: list List-Id: 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, 09 Aug 2016 21:45:48 -0000 Author: dumbbell Date: Tue Aug 9 21:45:47 2016 New Revision: 303895 URL: https://svnweb.freebsd.org/changeset/base/303895 Log: sys/pcpu.h: Revert change introduced in r303890 `device_t` is not defined outside the kernel but this header is used by eg. libkvm or vmstat(8). Thus, r303890 broke the build. So let's restore `struct device` here until a longer term solution is found. Reported by: Michael Butler , Jenkins MFC after: 3 days MFC with: r303890 Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Aug 9 19:46:05 2016 (r303894) +++ head/sys/sys/pcpu.h Tue Aug 9 21:45:47 2016 (r303895) @@ -160,7 +160,7 @@ struct pcpu { struct lock_list_entry *pc_spinlocks; struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ - device_t pc_device; + struct device *pc_device; void *pc_netisr; /* netisr SWI cookie */ int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ From owner-svn-src-head@freebsd.org Tue Aug 9 22:10:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E54CBB4CE0; Tue, 9 Aug 2016 22:10:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1C461D32; Tue, 9 Aug 2016 22:10:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79MAelC026011; Tue, 9 Aug 2016 22:10:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79MAeUC026010; Tue, 9 Aug 2016 22:10:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608092210.u79MAeUC026010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Aug 2016 22:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303896 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 22:10:42 -0000 Author: jhb Date: Tue Aug 9 22:10:40 2016 New Revision: 303896 URL: https://svnweb.freebsd.org/changeset/base/303896 Log: Remove obsolete manpage that is not currently installed. Deleted: head/lib/libc/sys/kse.2 From owner-svn-src-head@freebsd.org Tue Aug 9 22:48:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9080BB43E0; Tue, 9 Aug 2016 22:48:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A981175; Tue, 9 Aug 2016 22:48:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Mmk5T040964; Tue, 9 Aug 2016 22:48:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79Mmkfj040963; Tue, 9 Aug 2016 22:48:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201608092248.u79Mmkfj040963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 9 Aug 2016 22:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303897 - 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.22 Precedence: list List-Id: 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, 09 Aug 2016 22:48:47 -0000 Author: gjb Date: Tue Aug 9 22:48:46 2016 New Revision: 303897 URL: https://svnweb.freebsd.org/changeset/base/303897 Log: Pass overrides to make(1) when building ports for arm/armv6 targets, similar to what is done for the run-autotools-fixup override for non-arm targets. MFC after: 3 days Tested on: 12-CURRENT building 10-STABLE Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue Aug 9 22:10:40 2016 (r303896) +++ head/release/release.sh Tue Aug 9 22:48:46 2016 (r303897) @@ -287,9 +287,15 @@ extra_chroot_setup() { fi if [ ! -z "${EMBEDDEDPORTS}" ]; then + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" + PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" for _PORT in ${EMBEDDEDPORTS}; do eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ - BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + FORCE_PKG_REGISTER=1 ${PBUILD_FLAGS} install clean distclean done fi From owner-svn-src-head@freebsd.org Tue Aug 9 23:45:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E87D6BB4F48; Tue, 9 Aug 2016 23:45:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95FE51C0F; Tue, 9 Aug 2016 23:45:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x234.google.com with SMTP id t7so28748981qkh.0; Tue, 09 Aug 2016 16:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZcwLx/p4wxXNqHQAbezh01GNTSNsM7mbJmfuk0USljw=; b=boxuSTvuRca5z/Dgssgz5+S6kw0HBmmkMBaWFAYTUAjAzOc84X5aak1dJXWZ6abMa/ dlneQ0OgSSJtBVcDpVCQ3tKHbMzS0K08Xxs17Mp3cHTm+fLWiOb6/IpnOTkshEWfwvUi h+/JZis3M+tFMizY4+tk9t41a3hnzLg/xfV7p3YeyPOIVyauDOookaU9V7F0IkM0SaW8 gKvkxg+0rKFK+Q2COd+NOKHz03rscAHFxvz+yHLMP+HN1UK9498zASuvo2aP+w1uYQKh BBDmt3SBX/3TRvde4jHgoV7a4LKEC7vu9WOEf9Hff4mv2EkHGRt40D7jqpadji36O/fZ fInw== 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-transfer-encoding; bh=ZcwLx/p4wxXNqHQAbezh01GNTSNsM7mbJmfuk0USljw=; b=hgmXhvRzTNecP5GhknhTmC4t4DbP7ZsMtvuOK62JhJFfVeg0PstOvvI5dGRc3qvjFA obzqw1jk23blE7EzH1egpVjckJoVQGYwGPe0xFOpSbKcCWQTdbJFWWIQ6uZvUQ80+6U6 Aq2og2mMSpxAdPfAOmsucNxa944PG24KeTF97Y7g0oj8k2SVXZq+VKTdohUm8GGuUcUK f5H95d/lIni11lTZdsaBi3+jUQ5JIo3uYjeOGUjtJiGfS09njvm/muytmb7ZrXRkgUcn k3KFU5oKcg2t56NWomGJaJkPqDR+kfcJZ25MWTQ45dOA0opzwMF+v2XnwUJbUdAGyPB9 8zjg== X-Gm-Message-State: AEkoouuSREZwYPWHF/fgSVh/JfcdSceuSHQKX5k0YmIo3EUlX5eNkjuJYHQdQuEuwrRsB46Hm5/X+NKwcXiDYg== X-Received: by 10.55.164.205 with SMTP id n196mr1251149qke.0.1470786350430; Tue, 09 Aug 2016 16:45:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.233.216.2 with HTTP; Tue, 9 Aug 2016 16:45:49 -0700 (PDT) In-Reply-To: <201608092145.u79Ljlrq018467@repo.freebsd.org> References: <201608092145.u79Ljlrq018467@repo.freebsd.org> From: Ngie Cooper Date: Tue, 9 Aug 2016 16:45:49 -0700 Message-ID: Subject: Re: svn commit: r303895 - head/sys/sys To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 23:45:52 -0000 On Tue, Aug 9, 2016 at 2:45 PM, Jean-S=C3=A9bastien P=C3=A9dron wrote: > Author: dumbbell > Date: Tue Aug 9 21:45:47 2016 > New Revision: 303895 > URL: https://svnweb.freebsd.org/changeset/base/303895 > > Log: > sys/pcpu.h: Revert change introduced in r303890 > > `device_t` is not defined outside the kernel but this header is used by > eg. libkvm or vmstat(8). Thus, r303890 broke the build. > > So let's restore `struct device` here until a longer term solution is > found. > > Reported by: Michael Butler , Jenkins > MFC after: 3 days > MFC with: r303890 This is the second time this has happened in the last few months (last time was per mmacy's request IIRC for some linuxkpi stuff). Seems like this warrants a comment at least. Thanks, -Ngie From owner-svn-src-head@freebsd.org Tue Aug 9 23:48:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4578FBB405F; Tue, 9 Aug 2016 23:48:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 011B31EC8; Tue, 9 Aug 2016 23:48:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x234.google.com with SMTP id w38so13574038qtb.0; Tue, 09 Aug 2016 16:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CgxgXGnlgk4gmN7BnXtTJc4otW5YIk+UHA2ZSThNOMA=; b=bfS2RGvgsKaswZ3WiiANP+9OX9G+AZSfPg+OeHperAs3TEthUlhWvs7mpmyGXFR55k hY5Wr5TweWddmTC8BOCxIlxpDs0EbqtoXwkdAQZeS/HZM4Xp09KuAd2Mlmk1Zgk06mOJ 31pRbA7kTNVISeluEfdTVr2vc+ry/2bVwHHcTimo1KJIgTx1DWQeLZ3nrHDMgX3YqrpF 286v61McCo5BwisR+d7Nydl0T8W4HHY4kumA7Iii01fb2otWtgRydreDWoI1Cx5VpDR/ V4q4an9NL47B6AZRRutJtyR3Z6ypCgaxr/8kcaBPHoBXy/wXHoA6MwHIGAuTsyLiHXzv diLQ== 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; bh=CgxgXGnlgk4gmN7BnXtTJc4otW5YIk+UHA2ZSThNOMA=; b=kopx0dLlqzf5g0Rsthovgzgi6NoAP7cHzd3NO8kqEOJgFsKcuK+vkYgjSf89EVl99s b7Fo3KZI8OhXnD6wIiw+bSZau0AykTp0uOP8J6+HALaBovdT3E1EBSmi7INM7gwFyeHO R+tMa8frw+uh+IXzXCy8bt8CX5JHehGONzzmSRz3ZowNU2ltwTzfKT5bmHAj2CyKxbLy 8ZfAfSNvhzm6dte+BAc3BJxuI7rsb8o8fDk9Invd6rbEJ77EDPsm5tkLubsNN72Y4SxH /Fxe1OtMW0FayUBEbHp0y+DazHiEQXjcQniFRArdixuSkMjHK8FJayxpU5KIOTYnv2jL fOpA== X-Gm-Message-State: AEkoouvolm1U/urCSoT6VIUS9JtjNOzRsqwLPaUfFLLNV2mDu3FdGWTSSphKoEIqXliiAi2WEJ8piQTiCzKOWw== X-Received: by 10.200.53.214 with SMTP id l22mr1167232qtb.117.1470786487975; Tue, 09 Aug 2016 16:48:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.233.216.2 with HTTP; Tue, 9 Aug 2016 16:48:07 -0700 (PDT) In-Reply-To: References: <201608092145.u79Ljlrq018467@repo.freebsd.org> From: Ngie Cooper Date: Tue, 9 Aug 2016 16:48:07 -0700 Message-ID: Subject: Re: svn commit: r303895 - head/sys/sys To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 09 Aug 2016 23:48:09 -0000 On Tue, Aug 9, 2016 at 4:45 PM, Ngie Cooper wrote: .. > This is the second time this has happened in the last few months (last > time was per mmacy's request IIRC for some linuxkpi stuff). Seems like > this warrants a comment at least. I just saw the culprit... yeah... same thing as before. Some extra care needs to be used when dealing with this in/out of _KERNEL space... especially because libkvm and a handful of other tools violate the _KERNEL vs !_KERNEL boundary for "reasons". Thanks, -Ngie From owner-svn-src-head@freebsd.org Wed Aug 10 02:08:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C557BBB3725; Wed, 10 Aug 2016 02:08:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2E915B6; Wed, 10 Aug 2016 02:08:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-149.carlnfd1.nsw.optusnet.com.au [110.21.100.149]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id B9BD7D43CE8; Wed, 10 Aug 2016 12:08:43 +1000 (AEST) Date: Wed, 10 Aug 2016 12:08:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303890 - in head/sys: contrib/ncsw/user/env contrib/octeon-sdk dev/auxio dev/bktr dev/e1000 dev/ixgb dev/ixgbe dev/ixl dev/netmap dev/pci dev/sound/sbus dev/tpm kern mips/nlm/dev/net m... In-Reply-To: <201608091932.u79JW6Y6069448@repo.freebsd.org> Message-ID: <20160810114337.A1075@besplex.bde.org> References: <201608091932.u79JW6Y6069448@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=XDAe9YG+7EcdVXYrgT+/UQ==:117 a=XDAe9YG+7EcdVXYrgT+/UQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=_k9ViUNNPggPLhyTfaIA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 02:08:54 -0000 On Tue, 9 Aug 2016, [UTF-8] Jean-S=C3=A9bastien P=C3=A9dron wrote: > Log: > Consistently use `device_t` > > Several files use the internal name of `struct device` instead of > `device_t` which is part of the public API. This patch changes all > `struct device *` to `device_t`. device_t is properly opque, yet it still causes namespace problems and is harder to use, especially in userland where it doesn't exist. Headers now have namespace pollution/dependencies on where they carefully used 'struct device' before. Many kernel .c files probably depend on magic ordering to compile now. Alphabetical ordering mostly works accidentally since b < [c-z]. Bruce From owner-svn-src-head@freebsd.org Wed Aug 10 03:10:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04AA5BB48E1; Wed, 10 Aug 2016 03:10:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6411813; Wed, 10 Aug 2016 03:10:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7A3AYoI038809; Wed, 10 Aug 2016 03:10:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7A3AYYf038805; Wed, 10 Aug 2016 03:10:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608100310.u7A3AYYf038805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 10 Aug 2016 03:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303900 - in head/cddl/usr.sbin/dtrace/tests: common/raise common/safety 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.22 Precedence: list List-Id: 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, 10 Aug 2016 03:10:36 -0000 Author: ngie Date: Wed Aug 10 03:10:34 2016 New Revision: 303900 URL: https://svnweb.freebsd.org/changeset/base/303900 Log: Highball memory requirement (4GB) with common/{raise,safety} Both test suites require more memory than my amd64 VM using GENERIC-NODEBUG can provide and reliably panic it with OOM issues in dtrace(4). Some of the testcases fail, but this at least bypasses the panic behavior on platforms that don't have enough resources MFC after: 2 weeks Discussed with: markj Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/dtrace/tests/common/raise/Makefile head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Modified: head/cddl/usr.sbin/dtrace/tests/common/raise/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Wed Aug 10 02:44:46 2016 (r303899) +++ head/cddl/usr.sbin/dtrace/tests/common/raise/Makefile Wed Aug 10 03:10:34 2016 (r303900) @@ -20,4 +20,6 @@ CFILES= \ tst.raise3.c \ +TEST_METADATA.t_dtrace_contrib+= required_memory="4g" + .include "../../dtrace.test.mk" Modified: head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Wed Aug 10 02:44:46 2016 (r303899) +++ head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Wed Aug 10 03:10:34 2016 (r303900) @@ -53,4 +53,6 @@ CFILES= \ +TEST_METADATA.t_dtrace_contrib+= required_memory="4g" + .include "../../dtrace.test.mk" Modified: head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed Aug 10 02:44:46 2016 (r303899) +++ head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed Aug 10 03:10:34 2016 (r303900) @@ -34,15 +34,28 @@ genmakefile() # One-off variable definitions. local special - if [ "$basedir" = proc ]; then + case "$basedir" in + proc) special=" LIBADD.tst.sigwait.exe+= rt " - elif [ "$basedir" = uctf ]; then + ;; + raise) + special=" +TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" +" + ;; + safety) + special=" +TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" +" + ;; + uctf) special=" WITH_CTF=YES " - fi + ;; + esac local makefile=$(mktemp) cat <<__EOF__ > $makefile From owner-svn-src-head@freebsd.org Wed Aug 10 03:11:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB029BB493C; Wed, 10 Aug 2016 03:11:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33A819CE; Wed, 10 Aug 2016 03:11:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7A3B7Uu039484; Wed, 10 Aug 2016 03:11:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7A3B70h039478; Wed, 10 Aug 2016 03:11:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608100311.u7A3B70h039478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 10 Aug 2016 03:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303901 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 03:11:09 -0000 Author: sephe Date: Wed Aug 10 03:11:07 2016 New Revision: 303901 URL: https://svnweb.freebsd.org/changeset/base/303901 Log: hyperv/hn: Reorganize send done callback. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7450 Added: head/sys/dev/hyperv/netvsc/if_hnvar.h (contents, props changed) Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 10 03:10:34 2016 (r303900) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 10 03:11:07 2016 (r303901) @@ -68,6 +68,12 @@ static void hv_nv_on_receive_completion( static void hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); +static void hn_nvs_sent_none(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + const struct nvsp_msg_ *msg); + +static struct hn_send_ctx hn_send_ctx_none = + HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); /* * @@ -141,6 +147,7 @@ hv_nv_get_next_send_section(netvsc_dev * static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) { + struct hn_send_ctx sndc; netvsc_dev *net_dev; nvsp_msg *init_pkt; int ret = 0; @@ -189,9 +196,10 @@ hv_nv_init_rx_buffer_with_net_vsp(struct /* Send the gpadl notification request */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); if (ret != 0) { goto cleanup; } @@ -240,6 +248,7 @@ exit: static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) { + struct hn_send_ctx sndc; netvsc_dev *net_dev; nvsp_msg *init_pkt; int ret = 0; @@ -287,9 +296,10 @@ hv_nv_init_send_buffer_with_net_vsp(stru /* Send the gpadl notification request */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); if (ret != 0) { goto cleanup; } @@ -348,8 +358,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ ret = vmbus_chan_send(net_dev->sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)revoke_pkt); - + (uint64_t)(uintptr_t)&hn_send_ctx_none); /* * If we failed here, we might as well return and have a leak * rather than continue and a bugchk @@ -414,9 +423,8 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne NETVSC_SEND_BUFFER_ID; ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, - revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)revoke_pkt); + VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), + (uint64_t)(uintptr_t)&hn_send_ctx_none); /* * If we failed here, we might as well return and have a leak * rather than continue and a bugchk @@ -466,6 +474,7 @@ static int hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev, uint32_t nvsp_ver) { + struct hn_send_ctx sndc; nvsp_msg *init_pkt; int ret; @@ -480,9 +489,10 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ init_pkt->msgs.init_msgs.init.protocol_version_2 = nvsp_ver; /* Send the init request */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); if (ret != 0) return (-1); @@ -524,7 +534,7 @@ hv_nv_send_ndis_config(struct hn_softc * /* Send the configuration packet */ ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&hn_send_ctx_none); if (ret != 0) return (-EINVAL); @@ -602,7 +612,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc /* Send the init request */ ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&hn_send_ctx_none); if (ret != 0) { goto cleanup; } @@ -731,6 +741,43 @@ hv_nv_on_device_remove(struct hn_softc * return (0); } +void +hn_nvs_sent_wakeup(struct hn_send_ctx *sndc __unused, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan __unused, + const struct nvsp_msg_ *msg) +{ + /* Copy the response back */ + memcpy(&net_dev->channel_init_packet, msg, sizeof(nvsp_msg)); + sema_post(&net_dev->channel_init_sema); +} + +static void +hn_nvs_sent_none(struct hn_send_ctx *sndc __unused, + struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, + const struct nvsp_msg_ *msg __unused) +{ + /* EMPTY */ +} + +void +hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx) +{ + u_long mask; + uint32_t idx; + + idx = chim_idx / BITS_PER_LONG; + KASSERT(idx < net_dev->bitsmap_words, + ("invalid chimney index 0x%x", chim_idx)); + + mask = 1UL << (chim_idx % BITS_PER_LONG); + KASSERT(net_dev->send_section_bitsmap[idx] & mask, + ("index bitmap 0x%lx, chimney index %u, " + "bitmap idx %d, bitmask 0x%lx", + net_dev->send_section_bitsmap[idx], chim_idx, idx, mask)); + + atomic_clear_long(&net_dev->send_section_bitsmap[idx], mask); +} + /* * Net VSC on send completion */ @@ -738,59 +785,15 @@ static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt) { - const nvsp_msg *nvsp_msg_pkt; - netvsc_packet *net_vsc_pkt; + struct hn_send_ctx *sndc; - nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkt); - - if (nvsp_msg_pkt->hdr.msg_type == nvsp_msg_type_init_complete - || nvsp_msg_pkt->hdr.msg_type - == nvsp_msg_1_type_send_rx_buf_complete - || nvsp_msg_pkt->hdr.msg_type - == nvsp_msg_1_type_send_send_buf_complete - || nvsp_msg_pkt->hdr.msg_type - == nvsp_msg5_type_subchannel) { - /* Copy the response back */ - memcpy(&net_dev->channel_init_packet, nvsp_msg_pkt, - sizeof(nvsp_msg)); - sema_post(&net_dev->channel_init_sema); - } else if (nvsp_msg_pkt->hdr.msg_type == - nvsp_msg_1_type_send_rndis_pkt_complete) { - /* Get the send context */ - net_vsc_pkt = - (netvsc_packet *)(unsigned long)pkt->cph_xactid; - if (NULL != net_vsc_pkt) { - if (net_vsc_pkt->send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - u_long mask; - int idx; - - idx = net_vsc_pkt->send_buf_section_idx / - BITS_PER_LONG; - KASSERT(idx < net_dev->bitsmap_words, - ("invalid section index %u", - net_vsc_pkt->send_buf_section_idx)); - mask = 1UL << - (net_vsc_pkt->send_buf_section_idx % - BITS_PER_LONG); - - KASSERT(net_dev->send_section_bitsmap[idx] & - mask, - ("index bitmap 0x%lx, section index %u, " - "bitmap idx %d, bitmask 0x%lx", - net_dev->send_section_bitsmap[idx], - net_vsc_pkt->send_buf_section_idx, - idx, mask)); - atomic_clear_long( - &net_dev->send_section_bitsmap[idx], mask); - } - - /* Notify the layer above us */ - net_vsc_pkt->compl.send.on_send_completion(chan, - net_vsc_pkt->compl.send.send_completion_context); - - } - } + sndc = (struct hn_send_ctx *)(uintptr_t)pkt->cph_xactid; + sndc->hn_cb(sndc, net_dev, chan, VMBUS_CHANPKT_CONST_DATA(pkt)); + /* + * NOTE: + * 'sndc' CAN NOT be accessed anymore, since it can be freed by + * its callback. + */ } /* @@ -799,14 +802,14 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct vmbus_channel *chan, - netvsc_packet *pkt, struct vmbus_gpa *gpa, int gpa_cnt) +hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, + struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) { nvsp_msg send_msg; int ret; send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; - if (pkt->is_data_pkt) { + if (is_data_pkt) { /* 0 is RMC_DATA */ send_msg.msgs.vers_1_msgs.send_rndis_pkt.chan_type = 0; } else { @@ -815,17 +818,17 @@ hv_nv_on_send(struct vmbus_channel *chan } send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_idx = - pkt->send_buf_section_idx; + sndc->hn_chim_idx; send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_size = - pkt->send_buf_section_size; + sndc->hn_chim_sz; if (gpa_cnt) { ret = vmbus_chan_send_sglist(chan, gpa, gpa_cnt, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); } else { ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); } return (ret); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 10 03:10:34 2016 (r303900) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 10 03:11:07 2016 (r303901) @@ -1112,29 +1112,8 @@ typedef void (*pfn_on_send_rx_completion #endif typedef struct netvsc_packet_ { - uint8_t is_data_pkt; /* One byte */ - uint16_t vlan_tci; - uint32_t status; - - /* Completion */ - union { - struct { - uint64_t rx_completion_tid; - void *rx_completion_context; - /* This is no longer used */ - pfn_on_send_rx_completion on_rx_completion; - } rx; - struct { - uint64_t send_completion_tid; - void *send_completion_context; - /* Still used in netvsc and filter code */ - pfn_on_send_rx_completion on_send_completion; - } send; - } compl; - uint32_t send_buf_section_idx; - uint32_t send_buf_section_size; - - void *rndis_mesg; + uint16_t vlan_tci; + uint32_t status; uint32_t tot_data_buf_len; void *data; } netvsc_packet; @@ -1270,14 +1249,15 @@ typedef struct hn_softc { * Externs */ extern int hv_promisc_mode; +struct hn_send_ctx; void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); netvsc_dev *hv_nv_on_device_add(struct hn_softc *sc, void *additional_info, struct hn_rx_ring *rxr); int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); -int hv_nv_on_send(struct vmbus_channel *chan, netvsc_packet *pkt, - struct vmbus_gpa *gpa, int gpa_cnt); +int hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, + struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); void hv_nv_subchan_attach(struct vmbus_channel *chan, struct hn_rx_ring *rxr); Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 10 03:10:34 2016 (r303900) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 10 03:11:07 2016 (r303901) @@ -166,7 +166,7 @@ struct hn_txdesc { struct hn_tx_ring *txr; int refs; uint32_t flags; /* HN_TXD_FLAG_ */ - netvsc_packet netvsc_pkt; /* XXX to be removed */ + struct hn_send_ctx send_ctx; bus_dmamap_t data_dmap; @@ -781,14 +781,14 @@ hn_txeof(struct hn_tx_ring *txr) } static void -hn_tx_done(struct vmbus_channel *chan, void *xpkt) +hn_tx_done(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, + struct vmbus_channel *chan, const struct nvsp_msg_ *msg __unused) { - netvsc_packet *packet = xpkt; - struct hn_txdesc *txd; + struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; - txd = (struct hn_txdesc *)(uintptr_t) - packet->compl.send.send_completion_tid; + if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + hn_chim_free(net_dev, sndc->hn_chim_idx); txr = txd->txr; KASSERT(txr->hn_chan == chan, @@ -835,16 +835,14 @@ hn_encap(struct hn_tx_ring *txr, struct bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i; struct mbuf *m_head = *m_head0; - netvsc_packet *packet; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; rndis_per_packet_info *rppi; struct rndis_hash_value *hash_value; - uint32_t rndis_msg_size; + uint32_t rndis_msg_size, tot_data_buf_len, send_buf_section_idx; + int send_buf_section_size; - packet = &txd->netvsc_pkt; - packet->is_data_pkt = TRUE; - packet->tot_data_buf_len = m_head->m_pkthdr.len; + tot_data_buf_len = m_head->m_pkthdr.len; /* * extension points to the area reserved for the @@ -859,7 +857,7 @@ hn_encap(struct hn_tx_ring *txr, struct rndis_pkt = &rndis_mesg->msg.packet; rndis_pkt->data_offset = sizeof(rndis_packet); - rndis_pkt->data_length = packet->tot_data_buf_len; + rndis_pkt->data_length = tot_data_buf_len; rndis_pkt->per_pkt_info_offset = sizeof(rndis_packet); rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); @@ -967,15 +965,14 @@ hn_encap(struct hn_tx_ring *txr, struct } } - rndis_mesg->msg_len = packet->tot_data_buf_len + rndis_msg_size; - packet->tot_data_buf_len = rndis_mesg->msg_len; + rndis_mesg->msg_len = tot_data_buf_len + rndis_msg_size; + tot_data_buf_len = rndis_mesg->msg_len; /* * Chimney send, if the packet could fit into one chimney buffer. */ - if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { + if (tot_data_buf_len < txr->hn_tx_chimney_size) { netvsc_dev *net_dev = txr->hn_sc->net_dev; - uint32_t send_buf_section_idx; txr->hn_tx_chimney_tried++; send_buf_section_idx = @@ -990,9 +987,7 @@ hn_encap(struct hn_tx_ring *txr, struct dest += rndis_msg_size; m_copydata(m_head, 0, m_head->m_pkthdr.len, dest); - packet->send_buf_section_idx = send_buf_section_idx; - packet->send_buf_section_size = - packet->tot_data_buf_len; + send_buf_section_size = tot_data_buf_len; txr->hn_gpa_cnt = 0; txr->hn_tx_chimney++; goto done; @@ -1039,16 +1034,14 @@ hn_encap(struct hn_tx_ring *txr, struct gpa->gpa_len = segs[i].ds_len; } - packet->send_buf_section_idx = - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; - packet->send_buf_section_size = 0; + send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_size = 0; done: txd->m = m_head; /* Set the completion routine */ - packet->compl.send.on_send_completion = hn_tx_done; - packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)txd; + hn_send_ctx_init(&txd->send_ctx, hn_tx_done, txd, + send_buf_section_idx, send_buf_section_size); return 0; } @@ -1068,7 +1061,7 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(txr->hn_chan, &txd->netvsc_pkt, + error = hv_nv_on_send(txr->hn_chan, true, &txd->send_ctx, txr->hn_gpa, txr->hn_gpa_cnt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 10 03:10:34 2016 (r303900) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 10 03:11:07 2016 (r303901) @@ -85,11 +85,17 @@ static int hv_rf_set_packet_filter(rndi static int hv_rf_init_device(rndis_device *device); static int hv_rf_open_device(rndis_device *device); static int hv_rf_close_device(rndis_device *device); -static void hv_rf_on_send_request_completion(struct vmbus_channel *, void *context); -static void hv_rf_on_send_request_halt_completion(struct vmbus_channel *, void *context); int hv_rf_send_offload_request(struct hn_softc *sc, rndis_offload_params *offloads); + +static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + const struct nvsp_msg_ *msg); +static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + const struct nvsp_msg_ *msg); + /* * Set the Per-Packet-Info with the specified type */ @@ -238,17 +244,14 @@ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type) { - netvsc_packet *packet; netvsc_dev *net_dev = device->net_dev; - int send_buf_section_idx; + uint32_t send_buf_section_idx, tot_data_buf_len; struct vmbus_gpa gpa[2]; - int gpa_cnt; + int gpa_cnt, send_buf_section_size; + hn_sent_callback_t cb; /* Set up the packet to send it */ - packet = &request->pkt; - - packet->is_data_pkt = FALSE; - packet->tot_data_buf_len = request->request_msg.msg_len; + tot_data_buf_len = request->request_msg.msg_len; gpa_cnt = 1; gpa[0].gpa_page = hv_get_phys_addr(&request->request_msg) >> PAGE_SHIFT; @@ -265,16 +268,12 @@ hv_rf_send_request(rndis_device *device, gpa[1].gpa_len = request->request_msg.msg_len - gpa[0].gpa_len; } - packet->compl.send.send_completion_context = request; /* packet */ - if (message_type != REMOTE_NDIS_HALT_MSG) { - packet->compl.send.on_send_completion = - hv_rf_on_send_request_completion; - } else { - packet->compl.send.on_send_completion = - hv_rf_on_send_request_halt_completion; - } - packet->compl.send.send_completion_tid = (unsigned long)device; - if (packet->tot_data_buf_len < net_dev->send_section_size) { + if (message_type != REMOTE_NDIS_HALT_MSG) + cb = hn_rndis_sent_cb; + else + cb = hn_rndis_sent_halt; + + if (tot_data_buf_len < net_dev->send_section_size) { send_buf_section_idx = hv_nv_get_next_send_section(net_dev); if (send_buf_section_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { @@ -282,19 +281,20 @@ hv_rf_send_request(rndis_device *device, send_buf_section_idx * net_dev->send_section_size); memcpy(dest, &request->request_msg, request->request_msg.msg_len); - packet->send_buf_section_idx = send_buf_section_idx; - packet->send_buf_section_size = packet->tot_data_buf_len; + send_buf_section_size = tot_data_buf_len; gpa_cnt = 0; goto sendit; } /* Failed to allocate chimney send buffer; move on */ } - packet->send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; - packet->send_buf_section_size = 0; + send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_size = 0; sendit: - return hv_nv_on_send(device->net_dev->sc->hn_prichan, packet, - gpa, gpa_cnt); + hn_send_ctx_init(&request->send_ctx, cb, request, + send_buf_section_idx, send_buf_section_size); + return hv_nv_on_send(device->net_dev->sc->hn_prichan, false, + &request->send_ctx, gpa, gpa_cnt); } /* @@ -1056,6 +1056,7 @@ int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int nchan, struct hn_rx_ring *rxr) { + struct hn_send_ctx sndc; int ret; netvsc_dev *net_dev; rndis_device *rndis_dev; @@ -1162,9 +1163,10 @@ hv_rf_on_device_add(struct hn_softc *sc, init_pkt->msgs.vers_5_msgs.subchannel_request.num_subchannels = net_dev->num_channel - 1; + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); if (ret != 0) { device_printf(dev, "Fail to allocate subchannel\n"); goto out; @@ -1235,23 +1237,22 @@ hv_rf_on_close(struct hn_softc *sc) return (hv_rf_close_device((rndis_device *)net_dev->extension)); } -/* - * RNDIS filter on send request completion callback - */ -static void -hv_rf_on_send_request_completion(struct vmbus_channel *chan __unused, - void *context __unused) +static void +hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, + struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused) { + if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + hn_chim_free(net_dev, sndc->hn_chim_idx); } -/* - * RNDIS filter on send request (halt only) completion callback - */ -static void -hv_rf_on_send_request_halt_completion(struct vmbus_channel *chan __unused, - void *context) +static void +hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, + struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused) { - rndis_request *request = context; + rndis_request *request = sndc->hn_cbarg; + + if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + hn_chim_free(net_dev, sndc->hn_chim_idx); /* * Notify hv_rf_halt_device() about halt completion. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Aug 10 03:10:34 2016 (r303900) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Aug 10 03:11:07 2016 (r303901) @@ -33,6 +33,7 @@ #include #include +#include /* * Defines @@ -75,7 +76,7 @@ typedef struct rndis_request_ { uint8_t buf_resp[PAGE_SIZE]; /* Simplify allocation by having a netvsc packet inline */ - netvsc_packet pkt; + struct hn_send_ctx send_ctx; /* * The max request size is sizeof(rndis_msg) + PAGE_SIZE. Added: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 10 03:11:07 2016 (r303901) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _IF_HNVAR_H_ +#define _IF_HNVAR_H_ + +#include +#include + +struct netvsc_dev_; +struct nvsp_msg_; + +struct vmbus_channel; +struct hn_send_ctx; + +typedef void (*hn_sent_callback_t) + (struct hn_send_ctx *, struct netvsc_dev_ *, + struct vmbus_channel *, const struct nvsp_msg_ *); + +struct hn_send_ctx { + hn_sent_callback_t hn_cb; + void *hn_cbarg; + uint32_t hn_chim_idx; + int hn_chim_sz; +}; + +#define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ +{ \ + .hn_cb = cb, \ + .hn_cbarg = cbarg, \ + .hn_chim_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, \ + .hn_chim_sz = 0 \ +} + +static __inline void +hn_send_ctx_init(struct hn_send_ctx *sndc, hn_sent_callback_t cb, + void *cbarg, uint32_t chim_idx, int chim_sz) +{ + sndc->hn_cb = cb; + sndc->hn_cbarg = cbarg; + sndc->hn_chim_idx = chim_idx; + sndc->hn_chim_sz = chim_sz; +} + +static __inline void +hn_send_ctx_init_simple(struct hn_send_ctx *sndc, hn_sent_callback_t cb, + void *cbarg) +{ + hn_send_ctx_init(sndc, cb, cbarg, + NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); +} + +void hn_nvs_sent_wakeup(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + const struct nvsp_msg_ *msg); +void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); + +#endif /* !_IF_HNVAR_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 10 07:43:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BD0EBB4BA2; Wed, 10 Aug 2016 07:43:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EAE14B3; Wed, 10 Aug 2016 07:43:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7A7h3Z6051567 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 10 Aug 2016 10:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7A7h3Z6051567 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7A7h3B5051566; Wed, 10 Aug 2016 10:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Aug 2016 10:43:03 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303887 - head/tools/tools/dmardump Message-ID: <20160810074303.GC83214@kib.kiev.ua> References: <201608091906.u79J65Uq058283@repo.freebsd.org> <73543582.oU1jbu7riv@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73543582.oU1jbu7riv@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 07:43:09 -0000 On Tue, Aug 09, 2016 at 02:22:36PM -0700, John Baldwin wrote: > On Tuesday, August 09, 2016 07:06:05 PM John Baldwin wrote: > > Author: jhb > > Date: Tue Aug 9 19:06:05 2016 > > New Revision: 303887 > > URL: https://svnweb.freebsd.org/changeset/base/303887 > > > > Log: > > Add a dmardump utility to dump the VT-d context tables. > > > > This tool parses the ACPI DMAR table looking for DMA remapping devices. > > For each device it walks the root table and any context tables > > referenced to display mapping info for PCI devices. > > > > Note that acpidump -t already parses the info in the ACPI DMAR tables > > directly. This tool examines some of the data structures the DMAR > > remapping engines use to translate DMA requests. > > > > Reviewed by: kib, grehan > > MFC after: 1 month > > Sponsored by: Chelsio Communications > > Differential Revision: https://reviews.freebsd.org/D7444 > > I should have mentioned that this tool only supports "normal" context > entry tables. It does not (yet) support extended context entry > tables. However, neither bhyve nor ACPI_DMAR create extended context > entry tables. I am not aware of existence of hardware supporting the extended context entries. Even Skykale E3 v5 Xeons report ECS == 0. From owner-svn-src-head@freebsd.org Wed Aug 10 09:15:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A590FBB20A6; Wed, 10 Aug 2016 09:15:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC351778; Wed, 10 Aug 2016 09:15:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F29F21FE024; Wed, 10 Aug 2016 11:15:21 +0200 (CEST) Subject: Re: svn commit: r303870 - head/sys/dev/mlx5/mlx5_en To: John Baldwin References: <201608090743.u797hF8l000216@repo.freebsd.org> <1815980.zoyFBGqzV5@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <4c9444ab-2278-1ae2-d15b-bd9dd8bfe27d@selasky.org> Date: Wed, 10 Aug 2016 11:19:46 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1815980.zoyFBGqzV5@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 09:15:25 -0000 On 08/09/16 19:25, John Baldwin wrote: > On Tuesday, August 09, 2016 07:43:15 AM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Aug 9 07:43:15 2016 >> New Revision: 303870 >> URL: https://svnweb.freebsd.org/changeset/base/303870 >> >> Log: >> Fix for use after free. >> >> Clear the device description to avoid use after free because the >> bsddev is not destroyed when the mlx5en module is unloaded. Only when >> the parent mlx5 module is unloaded the bsddev is destroyed. This fixes >> a panic on listing sysctls which refer strings in the bsddev after the >> mlx5en module has been unloaded. >> >> Sponsored by: Mellanox Technologies >> MFC after: 1 week > > Hmmm, this seems like it is working around a bug somewhere else. > device_detach() calls device_set_driver(dev, NULL) which in turn calls > device_set_desc(dev, NULL) which should be clearing the description. You can > only be leaking a desc pointer if you aren't detaching the device. Not > detaching a device but unloading the module containing part (but apparently > not all) of its driver would seem to be fraught with peril. Why are you not > detaching the mlx5en0 device when unloading this module? > Hi John, It is not a bug in the kernel. When mlx5en is unloaded, device_detach() is not called, and that is expected. The mlx5 and mlx4 family of drivers have their own one-level bus subsystem. mlx5.ko will call LINUXKPI's pci_register_driver() and then probe mlx5en internally. When mlx5en is detached, mlx5 will detach the mlx5en driver, but it will not call "pci_unregister_driver()" which calls the device_detach(). This will only happen when the mlx5.ko is unloaded. Because the mlx5, mlx5en and mlx5ib (coming) modules are separated we can end up in this situation. I hope you understand and that my explanation was not too complicated. For other in-kernel drivers, this is not a problem. Like you write device_detach() will take care of device_set_driver(dev, NULL) and that will clear the device description. --HPS From owner-svn-src-head@freebsd.org Wed Aug 10 10:13:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8FEFBB361B; Wed, 10 Aug 2016 10:13:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 895E31D84; Wed, 10 Aug 2016 10:13:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AADY2v097854; Wed, 10 Aug 2016 10:13:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AADYit097853; Wed, 10 Aug 2016 10:13:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608101013.u7AADYit097853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Aug 2016 10:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303903 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 10:13:35 -0000 Author: andrew Date: Wed Aug 10 10:13:34 2016 New Revision: 303903 URL: https://svnweb.freebsd.org/changeset/base/303903 Log: Implement pmap_align_superpage on arm64 based on the amd64 implementation. This will be needed when superpage support is added. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Aug 10 08:05:48 2016 (r303902) +++ head/sys/arm64/arm64/pmap.c Wed Aug 10 10:13:34 2016 (r303903) @@ -3490,6 +3490,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 < L2_SIZE) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & L2_OFFSET; + if (size - ((L2_SIZE - superpage_offset) & L2_OFFSET) < L2_SIZE || + (*addr & L2_OFFSET) == superpage_offset) + return; + if ((*addr & L2_OFFSET) < superpage_offset) + *addr = (*addr & ~L2_OFFSET) + superpage_offset; + else + *addr = ((*addr + L2_OFFSET) & ~L2_OFFSET) + superpage_offset; } /** From owner-svn-src-head@freebsd.org Wed Aug 10 10:36:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01DFCBB3ABF; Wed, 10 Aug 2016 10:36:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C616A18DF; Wed, 10 Aug 2016 10:36:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AAaBkh005791; Wed, 10 Aug 2016 10:36:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AAaBJU005790; Wed, 10 Aug 2016 10:36:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608101036.u7AAaBJU005790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 10 Aug 2016 10:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303904 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 10:36:13 -0000 Author: andrew Date: Wed Aug 10 10:36:11 2016 New Revision: 303904 URL: https://svnweb.freebsd.org/changeset/base/303904 Log: Uncomment the vm.kvm_size and vm.kvm_free sysctls. These work as expected so there is no reason to leave them commented out. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Aug 10 10:13:34 2016 (r303903) +++ head/sys/arm64/arm64/pmap.c Wed Aug 10 10:36:11 2016 (r303904) @@ -1574,7 +1574,6 @@ pmap_release(pmap_t pmap) vm_page_free_zero(m); } -#if 0 static int kvm_size(SYSCTL_HANDLER_ARGS) { @@ -1594,7 +1593,6 @@ kvm_free(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 0, 0, kvm_free, "LU", "Amount of KVM free"); -#endif /* 0 */ /* * grow the number of kernel page table entries, if needed From owner-svn-src-head@freebsd.org Wed Aug 10 11:02:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA44BB4257; Wed, 10 Aug 2016 11:02:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95AB616A5; Wed, 10 Aug 2016 11:02:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7AB2TTD099305 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 10 Aug 2016 14:02:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7AB2TTD099305 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7AB2TjB099304; Wed, 10 Aug 2016 14:02:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Aug 2016 14:02:29 +0300 From: Konstantin Belousov To: Jean-S??bastien P??dron Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303890 - in head/sys: contrib/ncsw/user/env contrib/octeon-sdk dev/auxio dev/bktr dev/e1000 dev/ixgb dev/ixgbe dev/ixl dev/netmap dev/pci dev/sound/sbus dev/tpm kern mips/nlm/dev/net m... Message-ID: <20160810110229.GK83214@kib.kiev.ua> References: <201608091932.u79JW6Y6069448@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608091932.u79JW6Y6069448@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 11:02:40 -0000 On Tue, Aug 09, 2016 at 07:32:06PM +0000, Jean-S??bastien P??dron wrote: > Author: dumbbell > Date: Tue Aug 9 19:32:06 2016 > New Revision: 303890 > URL: https://svnweb.freebsd.org/changeset/base/303890 > > Log: > Consistently use `device_t` > > Several files use the internal name of `struct device` instead of > `device_t` which is part of the public API. This patch changes all > `struct device *` to `device_t`. > > The remaining occurrences of `struct device` are those referring to the > Linux or OpenBSD version of the structure, or the code is not built on > FreeBSD and it's unclear what to do. > > Submitted by: Matthew Macy (previous version) > Approved by: emaste, jhibbits, sbruno > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D7447 On powerpc and powerpc64, at r303902, I got ===> usr.sbin/camdd (all) In file included from /scratch/tmp/kib/obj/powerpc.powerpc64/scratch/tmp/kib/src /tmp/usr/include/machine/bus.h:463, from /scratch/tmp/kib/src/usr.sbin/camdd/camdd.c:54: /scratch/tmp/kib/obj/powerpc.powerpc64/scratch/tmp/kib/src/tmp/usr/include/machi ne/bus_dma.h:33: error: expected declaration specifiers or '...' before 'device_ t' --- camdd.o --- *** [camdd.o] Error code 1 From owner-svn-src-head@freebsd.org Wed Aug 10 12:41:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3656BB38C3; Wed, 10 Aug 2016 12:41:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EEAF1588; Wed, 10 Aug 2016 12:41:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ACfc8o050912; Wed, 10 Aug 2016 12:41:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ACfaZ9050891; Wed, 10 Aug 2016 12:41:36 GMT (envelope-from br@FreeBSD.org) Message-Id: <201608101241.u7ACfaZ9050891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 10 Aug 2016 12:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303908 - in head/sys: boot/fdt/dts/riscv conf riscv/conf riscv/htif riscv/include riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 12:41:40 -0000 Author: br Date: Wed Aug 10 12:41:36 2016 New Revision: 303908 URL: https://svnweb.freebsd.org/changeset/base/303908 Log: o Remove operation in machine mode. Machine privilege level was specially designed to use in vendor's firmware or bootloader. We have implemented operation in machine mode in FreeBSD as part of understanding RISC-V ISA, but it is time to remove it. We now use BBL (Berkeley Boot Loader) -- standard RISC-V firmware, which provides operation in machine mode for us. We now use standard SBI calls to machine mode, instead of handmade 'syscalls'. o Remove HTIF bus. HTIF bus is now legacy and no longer exists in RISC-V specification. HTIF code still exists in Spike simulator, but BBL do not provide raw interface to it. Memory disk is only choice for now to have multiuser booted in Spike, until Spike has implemented more devices (e.g. Virtio, etc). Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/riscv/include/sbi.h (contents, props changed) head/sys/riscv/riscv/riscv_console.c (contents, props changed) head/sys/riscv/riscv/sbi.S (contents, props changed) Deleted: head/sys/riscv/htif/ Modified: head/sys/boot/fdt/dts/riscv/qemu.dts head/sys/boot/fdt/dts/riscv/rocket.dts head/sys/boot/fdt/dts/riscv/spike.dts head/sys/conf/files.riscv head/sys/conf/ldscript.riscv head/sys/riscv/conf/GENERIC head/sys/riscv/conf/QEMU head/sys/riscv/conf/ROCKET head/sys/riscv/conf/SPIKE head/sys/riscv/include/cpufunc.h head/sys/riscv/include/pcpu.h head/sys/riscv/include/riscvreg.h head/sys/riscv/include/vmparam.h head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/identcpu.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/timer.c head/sys/riscv/riscv/vm_machdep.c Modified: head/sys/boot/fdt/dts/riscv/qemu.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/qemu.dts Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/boot/fdt/dts/riscv/qemu.dts Wed Aug 10 12:41:36 2016 (r303908) @@ -72,15 +72,11 @@ clock-frequency = < 400000000 >; }; - htif0: htif@0 { - compatible = "riscv,htif"; - interrupts = < 0 >; + console0: console@0 { + compatible = "riscv,console"; + status = "okay"; + interrupts = < 1 >; interrupt-parent = < &pic0 >; - - console0: console@0 { - compatible = "htif,console"; - status = "okay"; - }; }; }; Modified: head/sys/boot/fdt/dts/riscv/rocket.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/rocket.dts Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/boot/fdt/dts/riscv/rocket.dts Wed Aug 10 12:41:36 2016 (r303908) @@ -83,15 +83,11 @@ clock-frequency = < 1000000 >; }; - htif0: htif@0 { - compatible = "riscv,htif"; - interrupts = < 0 >; + console0: console@0 { + compatible = "riscv,console"; + status = "okay"; + interrupts = < 1 >; interrupt-parent = < &pic0 >; - - console0: console@0 { - compatible = "htif,console"; - status = "okay"; - }; }; }; Modified: head/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/spike.dts Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/boot/fdt/dts/riscv/spike.dts Wed Aug 10 12:41:36 2016 (r303908) @@ -65,6 +65,10 @@ }; memory { + /* + * This is not used currently. + * We take information from sbi_query_memory. + */ device_type = "memory"; reg = <0x80000000 0x40000000>; /* 1GB at 0x80000000 */ }; @@ -90,15 +94,11 @@ clock-frequency = < 1000000 >; }; - htif0: htif@0 { - compatible = "riscv,htif"; + console0: console@0 { + compatible = "riscv,console"; + status = "okay"; interrupts = < 1 >; interrupt-parent = < &pic0 >; - - console0: console@0 { - compatible = "htif,console"; - status = "okay"; - }; }; }; Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/conf/files.riscv Wed Aug 10 12:41:36 2016 (r303908) @@ -19,9 +19,6 @@ libkern/flsl.c standard libkern/flsll.c standard libkern/memmove.c standard libkern/memset.c standard -riscv/htif/htif.c optional htif -riscv/htif/htif_block.c optional htif -riscv/htif/htif_console.c optional htif riscv/riscv/autoconf.c standard riscv/riscv/bcopy.c standard riscv/riscv/bus_machdep.c standard @@ -36,6 +33,7 @@ riscv/riscv/db_interface.c optional ddb riscv/riscv/db_trace.c optional ddb riscv/riscv/dump_machdep.c standard riscv/riscv/elf_machdep.c standard +riscv/riscv/exception.S standard riscv/riscv/intr_machdep.c standard riscv/riscv/in_cksum.c optional inet | inet6 riscv/riscv/identcpu.c standard @@ -47,6 +45,8 @@ riscv/riscv/mem.c standard riscv/riscv/nexus.c standard riscv/riscv/ofw_machdep.c optional fdt riscv/riscv/pmap.c standard +riscv/riscv/riscv_console.c optional rcons +riscv/riscv/sbi.S standard riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard riscv/riscv/swtch.S standard Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/conf/ldscript.riscv Wed Aug 10 12:41:36 2016 (r303908) @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + 0x80000000 /* KERNENTRY */; + . = kernbase; .text : AT(ADDR(.text) - kernbase) { *(.text) Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/conf/GENERIC Wed Aug 10 12:41:36 2016 (r303908) @@ -76,7 +76,7 @@ options SMP # Uncomment for memory disk # options MD_ROOT -# options MD_ROOT_SIZE=8192 # 8MB ram disk +# options MD_ROOT_SIZE=32768 # 32MB ram disk # makeoptions MFS_IMAGE=/path/to/img # options ROOTDEVNAME=\"ufs:/dev/md0\" Modified: head/sys/riscv/conf/QEMU ============================================================================== --- head/sys/riscv/conf/QEMU Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/conf/QEMU Wed Aug 10 12:41:36 2016 (r303908) @@ -21,8 +21,8 @@ include GENERIC ident QEMU -device htif -options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" +device rcons +options ROOTDEVNAME=\"ufs:/dev/md0\" # RISCVTODO: This needs to be done via loader (when it's available). options FDT_DTB_STATIC Modified: head/sys/riscv/conf/ROCKET ============================================================================== --- head/sys/riscv/conf/ROCKET Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/conf/ROCKET Wed Aug 10 12:41:36 2016 (r303908) @@ -21,8 +21,8 @@ include GENERIC ident ROCKET -device htif -options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" +device rcons +options ROOTDEVNAME=\"ufs:/dev/md0\" # RISCVTODO: This needs to be done via loader (when it's available). options FDT_DTB_STATIC Modified: head/sys/riscv/conf/SPIKE ============================================================================== --- head/sys/riscv/conf/SPIKE Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/conf/SPIKE Wed Aug 10 12:41:36 2016 (r303908) @@ -21,8 +21,8 @@ include GENERIC ident SPIKE -device htif -options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" +device rcons +options ROOTDEVNAME=\"ufs:/dev/md0\" # RISCVTODO: This needs to be done via loader (when it's available). options FDT_DTB_STATIC Modified: head/sys/riscv/include/cpufunc.h ============================================================================== --- head/sys/riscv/include/cpufunc.h Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/include/cpufunc.h Wed Aug 10 12:41:36 2016 (r303908) @@ -81,21 +81,6 @@ intr_enable(void) ); } -static __inline register_t -machine_command(uint64_t cmd, uint64_t arg) -{ - uint64_t res; - - __asm __volatile( - "mv t5, %2\n" - "mv t6, %1\n" - "ecall\n" - "mv %0, t6" : "=&r"(res) : "r"(arg), "r"(cmd) - ); - - return (res); -} - #define cpu_nullop() riscv_nullop() #define cpufunc_nullop() riscv_nullop() #define cpu_setttb(a) riscv_setttb(a) Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/include/pcpu.h Wed Aug 10 12:41:36 2016 (r303908) @@ -46,8 +46,7 @@ #define PCPU_MD_FIELDS \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ - uint64_t pc_reg; /* CPU MMIO base (PA) */ \ - char __pad[117] + char __pad[125] #ifdef _KERNEL Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/include/riscvreg.h Wed Aug 10 12:41:36 2016 (r303908) @@ -37,19 +37,6 @@ #ifndef _MACHINE_RISCVREG_H_ #define _MACHINE_RISCVREG_H_ -/* Machine mode requests */ -#define ECALL_MTIMECMP 0x01 -#define ECALL_HTIF_GET_ENTRY 0x02 -#define ECALL_MCPUID_GET 0x03 -#define ECALL_MIMPID_GET 0x04 -#define ECALL_SEND_IPI 0x05 -#define ECALL_CLEAR_IPI 0x06 -#define ECALL_MIE_SET 0x07 -#define ECALL_IO_IRQ_MASK 0x08 -#define ECALL_HTIF_CMD 0x09 -#define ECALL_HTIF_CMD_REQ 0x0a -#define ECALL_HTIF_CMD_RESP 0x0b - #define EXCP_SHIFT 0 #define EXCP_MASK (0xf << EXCP_SHIFT) #define EXCP_MISALIGNED_FETCH 0 @@ -65,9 +52,6 @@ #define EXCP_HYPERVISOR_ECALL 10 #define EXCP_MACHINE_ECALL 11 #define EXCP_INTR (1ul << 63) -#define EXCP_INTR_SOFTWARE 0 -#define EXCP_INTR_TIMER 1 -#define EXCP_INTR_HTIF 2 #define SSTATUS_UIE (1 << 0) #define SSTATUS_SIE (1 << 1) Added: head/sys/riscv/include/sbi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/sbi.h Wed Aug 10 12:41:36 2016 (r303908) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SBI_H_ +#define _MACHINE_SBI_H_ + +typedef struct { + uint64_t base; + uint64_t size; + uint64_t node_id; +} memory_block_info; + +uint64_t sbi_query_memory(uint64_t id, memory_block_info *p); +uint64_t sbi_hart_id(void); +uint64_t sbi_num_harts(void); +uint64_t sbi_timebase(void); +void sbi_set_timer(uint64_t stime_value); +void sbi_send_ipi(uint64_t hart_id); +uint64_t sbi_clear_ipi(void); +void sbi_shutdown(void); + +void sbi_console_putchar(unsigned char ch); +int sbi_console_getchar(void); + +void sbi_remote_sfence_vm(uint64_t hart_mask_ptr, uint64_t asid); +void sbi_remote_sfence_vm_range(uint64_t hart_mask_ptr, uint64_t asid, uint64_t start, uint64_t size); +void sbi_remote_fence_i(uint64_t hart_mask_ptr); + +uint64_t sbi_mask_interrupt(uint64_t which); +uint64_t sbi_unmask_interrupt(uint64_t which); + +#endif /* !_MACHINE_SBI_H_ */ Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/include/vmparam.h Wed Aug 10 12:41:36 2016 (r303908) @@ -156,26 +156,26 @@ #define VM_MIN_KERNEL_ADDRESS (0xffffffc000000000UL) #define VM_MAX_KERNEL_ADDRESS (0xffffffc800000000UL) -/* Direct Map for 128 GiB of PA: 0x0 - 0x1fffffffff */ +/* 128 GiB maximum for the direct map region */ #define DMAP_MIN_ADDRESS (0xffffffd000000000UL) -#define DMAP_MAX_ADDRESS (0xffffffefffffffffUL) +#define DMAP_MAX_ADDRESS (0xfffffff000000000UL) -#define DMAP_MIN_PHYSADDR (0x0000000000000000UL) -#define DMAP_MAX_PHYSADDR (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) +#define DMAP_MIN_PHYSADDR (dmap_phys_base) +#define DMAP_MAX_PHYSADDR (dmap_phys_max) /* True if pa is in the dmap range */ #define PHYS_IN_DMAP(pa) ((pa) >= DMAP_MIN_PHYSADDR && \ - (pa) <= DMAP_MAX_PHYSADDR) + (pa) < DMAP_MAX_PHYSADDR) /* True if va is in the dmap range */ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ - (va) <= DMAP_MAX_ADDRESS) + (va) < (dmap_max_addr)) #define PHYS_TO_DMAP(pa) \ ({ \ KASSERT(PHYS_IN_DMAP(pa), \ ("%s: PA out of range, PA: 0x%lx", __func__, \ (vm_paddr_t)(pa))); \ - (pa) | DMAP_MIN_ADDRESS; \ + ((pa) - dmap_phys_base) + DMAP_MIN_ADDRESS; \ }) #define DMAP_TO_PHYS(va) \ @@ -183,7 +183,7 @@ KASSERT(VIRT_IN_DMAP(va), \ ("%s: VA out of range, VA: 0x%lx", __func__, \ (vm_offset_t)(va))); \ - (va) & ~DMAP_MIN_ADDRESS; \ + ((va) - DMAP_MIN_ADDRESS) + dmap_phys_base; \ }) #define VM_MIN_USER_ADDRESS (0x0000000000000000UL) @@ -196,7 +196,7 @@ #define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) #define USRSTACK SHAREDPAGE -#define KERNENTRY (0x80000000) +#define KERNENTRY (0) /* * How many physical pages per kmem arena virtual page. @@ -233,9 +233,14 @@ * #define UMA_MD_SMALL_ALLOC */ +#ifndef LOCORE +extern vm_paddr_t dmap_phys_base; +extern vm_paddr_t dmap_phys_max; +extern vm_offset_t dmap_max_addr; extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; extern vm_offset_t init_pt_va; +#endif #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/riscv/exception.S Wed Aug 10 12:41:36 2016 (r303908) @@ -235,388 +235,3 @@ ENTRY(cpu_exception_handler_user) csrrw sp, sscratch, sp sret END(cpu_exception_handler_user) - -/* - * Trap handlers - */ - .text -bad_trap: - j bad_trap - -machine_trap: - /* Save state */ - csrrw sp, mscratch, sp - addi sp, sp, -64 - sd t0, (8 * 0)(sp) - sd t1, (8 * 1)(sp) - sd t2, (8 * 2)(sp) - sd t3, (8 * 3)(sp) - sd t4, (8 * 4)(sp) - sd t5, (8 * 5)(sp) - sd a0, (8 * 7)(sp) - - csrr t3, mstatus /* Required for debug */ - csrr t0, mcause - bltz t0, machine_interrupt - - li t1, EXCP_SUPERVISOR_ECALL - beq t0, t1, supervisor_call -4: - /* NOT REACHED */ - j 4b - -machine_interrupt: - /* Type of interrupt ? */ - csrr t0, mcause - andi t0, t0, EXCP_MASK -#if 0 - /* lowRISC TODO */ - li t1, 4 - beq t1, t0, io_interrupt /* lowRISC only */ -#endif - li t1, 1 - beq t1, t0, supervisor_software_interrupt - li t1, 3 - beq t1, t0, machine_software_interrupt - li t1, 5 - beq t1, t0, supervisor_timer_interrupt - li t1, 7 - beq t1, t0, machine_timer_interrupt - - /* NOT REACHED */ -1: - j 1b - -#if 0 - /* lowRISC TODO */ -io_interrupt: - /* Disable IO interrupts so we can go to supervisor mode */ - csrwi CSR_IO_IRQ, 0 - - /* Handle the trap in supervisor mode */ - j exit_mrts -#endif - -supervisor_software_interrupt: -1: - /* Nothing here as we are using mideleg feature */ - j 1b - -machine_software_interrupt: - /* Clear IPI */ - li t0, 0x40001000 - csrr t2, mhartid - li t3, 0x1000 - mul t2, t2, t3 - add t0, t0, t2 - li t2, 0 - sd t2, 0(t0) - - /* Clear machine software pending bit */ - li t0, MIP_MSIP - csrc mip, t0 - - /* Post supervisor software interrupt */ - li t0, MIP_SSIP - csrs mip, t0 - - j exit - -supervisor_timer_interrupt: -1: - /* Nothing here as we are using mideleg feature */ - j 1b - -machine_timer_interrupt: - /* Disable machine timer interrupts */ - li t0, MIE_MTIE - csrc mie, t0 - - /* Clear machine timer interrupt pending */ - li t0, MIP_MTIP - csrc mip, t0 - - /* Post supervisor timer interrupt */ - li t0, MIP_STIP - csrs mip, t0 - - /* - * Check for HTIF interrupts. - * The only interrupt expected here is key press. - */ - la t0, htif_lock - li t2, 1 - amoswap.d t3, t2, 0(t0) - bnez t3, 5f /* Another operation in progress, give up */ - - /* We have lock */ - la t1, fromhost - ld t5, 0(t1) - beqz t5, 4f - - /* Console GET intr ? */ - mv t1, t5 - li t0, 0x100 - srli t1, t1, 48 - beq t1, t0, 2f -1: - /* There is no interrupts except keypress */ - j 1b - -2: - /* Save entry */ - la t0, htif_ring - li t4, (HTIF_RING_SIZE) - add t0, t0, t4 /* t0 == htif_ring_cursor */ - - ld t1, 0(t0) /* load ptr to cursor */ - sd t5, 0(t1) /* put entry */ - li t4, 1 - sd t4, 8(t1) /* mark used */ - ld t4, 16(t1) /* take next */ - /* Update cursor */ - sd t4, 0(t0) - - /* Post supervisor software interrupt */ - li t0, MIP_SSIP - csrs mip, t0 - -3: - la t1, fromhost - li t5, 0 - sd t5, 0(t1) - -4: - /* Release lock */ - la t0, htif_lock - li t2, 0 - amoswap.d t3, t2, 0(t0) - -5: - j exit - -supervisor_call: - csrr t1, mepc - addi t1, t1, 4 /* Next instruction in t1 */ - li t4, ECALL_HTIF_CMD - beq t5, t4, htif_cmd - li t4, ECALL_HTIF_CMD_REQ - beq t5, t4, htif_cmd_req - li t4, ECALL_HTIF_CMD_RESP - beq t5, t4, htif_cmd_resp - li t4, ECALL_HTIF_GET_ENTRY - beq t5, t4, htif_get_entry - li t4, ECALL_MTIMECMP - beq t5, t4, set_mtimecmp - li t4, ECALL_MCPUID_GET - beq t5, t4, mcpuid_get - li t4, ECALL_MIMPID_GET - beq t5, t4, mimpid_get - li t4, ECALL_SEND_IPI - beq t5, t4, send_ipi - li t4, ECALL_CLEAR_IPI - beq t5, t4, clear_ipi - li t4, ECALL_MIE_SET - beq t5, t4, mie_set -#if 0 - /* lowRISC TODO */ - li t4, ECALL_IO_IRQ_MASK - beq t5, t4, io_irq_mask -#endif - j exit_next_instr - -#if 0 - /* lowRISC TODO */ -io_irq_mask: - csrw CSR_IO_IRQ, t6 - j exit_next_instr -#endif - -mie_set: - csrs mie, t6 - j exit_next_instr - -mcpuid_get: - csrr t6, misa - j exit_next_instr - -mimpid_get: - csrr t6, mimpid - j exit_next_instr - -send_ipi: - /* CPU ipi MMIO register in t6 */ - mv t0, t6 - li t2, 1 - sd t2, 0(t0) - j exit_next_instr - -clear_ipi: - /* Do only clear if there are no new entries in HTIF ring */ - la t0, htif_ring - li t4, (HTIF_RING_SIZE) - add t0, t0, t4 /* t0 == ptr to htif_ring_cursor */ - ld t2, 8(t0) /* load htif_ring_last */ - ld t2, 8(t2) /* load used */ - bnez t2, 1f - - /* Clear supervisor software interrupt pending bit */ - li t0, MIP_SSIP - csrc mip, t0 - -1: - j exit_next_instr - -htif_get_entry: - /* Get a htif_ring for current core */ - la t0, htif_ring - li t4, (HTIF_RING_SIZE + 8) - add t0, t0, t4 /* t0 == htif_ring_last */ - - /* Check for new entries */ - li t6, 0 /* preset return value */ - ld t2, 0(t0) /* load ptr to last */ - ld t4, 8(t2) /* get used */ - beqz t4, 1f /* No new entries. Exit */ - - /* Get one */ - ld t6, 0(t2) /* get entry */ - li t4, 0 - sd t4, 8(t2) /* mark free */ - sd t4, 0(t2) /* free entry, just in case */ - ld t4, 16(t2) /* take next */ - sd t4, 0(t0) /* update ptr to last */ -1: - /* Exit. Result is stored in t6 */ - j exit_next_instr - -htif_cmd_resp: - la t0, htif_lock - li t2, 1 -1: - amoswap.d t3, t2, 0(t0) - bnez t3, 1b - - /* We have lock. Read for data */ - la t4, fromhost - ld t6, 0(t4) - beqz t6, 2f - - /* Clear event */ - li t5, 0 - sd t5, 0(t4) - -2: - /* Release lock */ - la t0, htif_lock - li t2, 0 - amoswap.d t3, t2, 0(t0) - - j exit_next_instr - -htif_cmd_req: - la t0, htif_lock - li t2, 1 -1: - amoswap.d t3, t2, 0(t0) - bnez t3, 1b - - /* We have lock. Store new request */ - la t4, tohost - sd t6, 0(t4) - - /* Release lock */ - la t0, htif_lock - li t2, 0 - amoswap.d t3, t2, 0(t0) - - j exit_next_instr - -htif_cmd: - la t0, htif_lock - li t2, 1 -1: - amoswap.d t3, t2, 0(t0) - bnez t3, 1b - - mv t3, t6 - - /* We have lock. Store new request */ - la t4, tohost - sd t6, 0(t4) -2: - /* Poll for result */ - la t4, fromhost - ld t6, 0(t4) - beqz t6, 2b - - /* Check for unexpected event */ - srli t0, t6, 48 - srli t2, t3, 48 - beq t2, t0, 3f - - /* - * We have something unexpected (e.g. keyboard keypress) - * Save entry. - */ - la t0, htif_ring - li t4, (HTIF_RING_SIZE) - add t0, t0, t4 /* t0 == htif_ring_cursor */ - - ld t2, 0(t0) /* load ptr to cursor */ - sd t6, 0(t2) /* put entry */ - li t4, 1 - sd t4, 8(t2) /* mark used */ - ld t4, 16(t2) /* take next */ - /* Update cursor */ - sd t4, 0(t0) - - /* Post supervisor software interrupt */ - li t0, MIP_SSIP - csrs mip, t0 - - /* Clear and look for response again */ - la t2, fromhost - li t5, 0 - sd t5, 0(t2) - j 2b - -3: - la t2, fromhost - li t5, 0 - sd t5, 0(t2) - - /* Release lock */ - la t0, htif_lock - li t2, 0 - amoswap.d t3, t2, 0(t0) - - j exit_next_instr - -set_mtimecmp: - /* Enable interrupts */ - li t0, (MIE_MTIE | MIE_STIE) - csrs mie, t0 - j exit_next_instr - -/* - * Trap exit functions - */ -exit_next_instr: - /* Next instruction is in t1 */ - csrw mepc, t1 -exit: - /* Restore state */ - ld t0, (8 * 0)(sp) - ld t1, (8 * 1)(sp) - ld t2, (8 * 2)(sp) - ld t3, (8 * 3)(sp) - ld t4, (8 * 4)(sp) - ld t5, (8 * 5)(sp) - ld a0, (8 * 7)(sp) - addi sp, sp, 64 - csrrw sp, mscratch, sp - mret - -exit_mrts: - j exit_mrts Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/riscv/genassym.c Wed Aug 10 12:41:36 2016 (r303908) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include ASSYM(KERNBASE, KERNBASE); -ASSYM(KERNENTRY, KERNENTRY); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); Modified: head/sys/riscv/riscv/identcpu.c ============================================================================== --- head/sys/riscv/riscv/identcpu.c Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/riscv/identcpu.c Wed Aug 10 12:41:36 2016 (r303908) @@ -101,8 +101,9 @@ identify_cpu(void) cpu_partsp = NULL; - mimpid = machine_command(ECALL_MIMPID_GET, 0); - misa = machine_command(ECALL_MCPUID_GET, 0); + /* TODO: can we get mimpid and misa somewhere ? */ + mimpid = 0; + misa = 0; cpu = PCPU_GET(cpuid); Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/riscv/intr_machdep.c Wed Aug 10 12:41:36 2016 (r303908) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SMP #include @@ -267,7 +268,7 @@ ipi_send(struct pcpu *pc, int ipi) CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); - machine_command(ECALL_SEND_IPI, pc->pc_reg); + sbi_send_ipi(pc->pc_cpuid); CTR1(KTR_SMP, "%s: sent", __func__); } Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Wed Aug 10 12:36:54 2016 (r303907) +++ head/sys/riscv/riscv/locore.S Wed Aug 10 12:41:36 2016 (r303908) @@ -43,118 +43,47 @@ #include #include -#define HTIF_RING_NENTRIES (512) -#define HTIF_RING_ENTRY_SZ (24) -#define HTIF_RING_SIZE (HTIF_RING_ENTRY_SZ * HTIF_RING_NENTRIES) -#define HW_STACK_SIZE (96) - -/* - * Event queue: - * - * struct htif_ring { - * uint64_t data; - * uint64_t used; - * uint64_t next; - * } htif_ring[HTIF_RING_NENTRIES]; - * uint64_t htif_ring_cursor; - * uint64_t htif_ring_last; - */ - -.macro build_ring - la t0, htif_ring - li t1, 0 - sd t1, 0(t0) /* zero data */ - sd t1, 8(t0) /* zero used */ - mv t2, t0 - mv t3, t0 - li t5, (HTIF_RING_SIZE) - li t6, 0 - add t4, t0, t5 -1: - addi t3, t3, HTIF_RING_ENTRY_SZ /* pointer to next */ - beq t3, t4, 2f /* finish */ - sd t3, 16(t2) /* store pointer */ - addi t2, t2, HTIF_RING_ENTRY_SZ /* next entry */ - addi t6, t6, 1 /* counter */ - j 1b -2: - addi t3, t3, -HTIF_RING_ENTRY_SZ - sd t0, 16(t3) /* last -> first */ - - li t2, (HTIF_RING_SIZE) - add s0, t0, t2 - sd t0, 0(s0) /* cursor */ - sd t0, 8(s0) /* last */ - /* finish building ring */ -.endm - .globl kernbase .set kernbase, KERNBASE /* Trap entries */ .text -mentry: - /* Vectors */ - j _start /* reset */ - j bad_trap /* NMI (non-maskable interrupt) */ - j machine_trap - /* Reset vector */ .text .globl _start _start: - /* Setup machine trap vector */ - la t0, machine_trap - csrw mtvec, t0 - - /* Delegate interrupts to supervisor mode */ - li t0, (MIP_SSIP | MIP_STIP | MIP_SEIP) - csrw mideleg, t0 - - /* Delegate exceptions to supervisor mode */ - li t0, (1 << EXCP_MISALIGNED_FETCH) | \ - (1 << EXCP_FAULT_FETCH) | \ - (1 << EXCP_ILLEGAL_INSTRUCTION) | \ - (1 << EXCP_FAULT_LOAD) | \ - (1 << EXCP_FAULT_STORE) | \ - (1 << EXCP_BREAKPOINT) | \ - (1 << EXCP_USER_ECALL) - csrw medeleg, t0 - + /* Setup supervisor trap vector */ la t0, cpu_exception_handler - li t1, KERNBASE - add t0, t0, t1 csrw stvec, t0 - /* Direct secondary cores to mpentry */ - csrr a0, mhartid - bnez a0, mpentry - - li t1, 0 - la t0, tohost - sd t1, 0(t0) - la t0, fromhost - sd t1, 0(t0) - - /* Build event queue for current core */ - build_ring - - /* Setup machine-mode stack for CPU 0 */ - la t0, hardstack_end - csrw mscratch, t0 - + /* Ensure sscratch is zero */ li t0, 0 csrw sscratch, t0 - li s10, PAGE_SIZE - li s9, (PAGE_SIZE * KSTACK_PAGES) + /* Load physical memory information */ + li a0, 0 + la a1, memory_info + call sbi_query_memory + + /* Store base to s6 */ + la s6, memory_info + ld s6, 0(s6) /* s6 = physmem base */ - /* Page tables */ + /* Direct secondary cores to mpentry */ + call sbi_hart_id + bnez a0, mpentry + + /* + * Page tables + */ /* Create an L1 page for early devmap */ la s1, pagetable_l1 la s2, pagetable_l2_devmap /* Link to next level PN */ + li t0, KERNBASE + sub s2, s2, t0 + add s2, s2, s6 srli s2, s2, PAGE_SHIFT li a5, (VM_MAX_KERNEL_ADDRESS - L2_SIZE) @@ -170,19 +99,74 @@ _start: add t0, s1, a5 sd t6, (t0) - /* Add single Level 1 entry for kernel */ + /* Create an L1 page for SBI */ + la s1, pagetable_l1 + la s2, pagetable_l2_sbi /* Link to next level PN */ + li t0, KERNBASE + sub s2, s2, t0 + add s2, s2, s6 + srli s2, s2, PAGE_SHIFT + li a5, 511 + li t4, PTE_V + slli t5, s2, PTE_PPN0_S /* (s2 << PTE_PPN0_S) */ + or t6, t4, t5 + + /* Store SBI L1 PTE entry to position */ + li a6, PTE_SIZE + mulw a5, a5, a6 + add t0, s1, a5 + sd t6, (t0) + + /* Create an L2 page for SBI */ + la s1, pagetable_l2_sbi + la s2, pagetable_l3_sbi /* Link to next level PN */ + li t0, KERNBASE + sub s2, s2, t0 + add s2, s2, s6 + srli s2, s2, PAGE_SHIFT + li a5, 511 + li t4, PTE_V + slli t5, s2, PTE_PPN0_S /* (s2 << PTE_PPN0_S) */ + or t6, t4, t5 + + /* Store SBI L2 PTE entry to position */ + li a6, PTE_SIZE + mulw a5, a5, a6 + add t0, s1, a5 + sd t6, (t0) + + /* Create an L3 page for SBI */ + la s1, pagetable_l3_sbi + li s2, 0x80009000 + srli s2, s2, PAGE_SHIFT + li a5, 511 + li t4, PTE_V | PTE_RX | PTE_W + slli t5, s2, PTE_PPN0_S /* (s2 << PTE_PPN0_S) */ + or t6, t4, t5 + + /* Store SBI L3 PTE entry to position */ + li a6, PTE_SIZE + mulw a5, a5, a6 + add t0, s1, a5 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 10 13:32:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF615BB4095; Wed, 10 Aug 2016 13:32:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF94C1B36; Wed, 10 Aug 2016 13:32:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ADWRXI072305; Wed, 10 Aug 2016 13:32:27 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ADWRld072303; Wed, 10 Aug 2016 13:32:27 GMT (envelope-from br@FreeBSD.org) Message-Id: <201608101332.u7ADWRld072303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 10 Aug 2016 13:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303911 - in head: share/mk sys/modules/dtrace/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.22 Precedence: list List-Id: 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, 10 Aug 2016 13:32:29 -0000 Author: br Date: Wed Aug 10 13:32:27 2016 New Revision: 303911 URL: https://svnweb.freebsd.org/changeset/base/303911 Log: Remove extra -msoft-float flags settings. This helps to build firmware modules. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/share/mk/bsd.cpu.mk head/sys/modules/dtrace/dtrace/Makefile Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Aug 10 12:56:01 2016 (r303910) +++ head/share/mk/bsd.cpu.mk Wed Aug 10 13:32:27 2016 (r303911) @@ -327,11 +327,6 @@ CFLAGS += -mfloat-abi=softfp .endif .endif -.if ${MACHINE_CPUARCH} == "riscv" -CFLAGS += -msoft-float -ACFLAGS += -msoft-float -.endif - # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Wed Aug 10 12:56:01 2016 (r303910) +++ head/sys/modules/dtrace/dtrace/Makefile Wed Aug 10 13:32:27 2016 (r303911) @@ -58,11 +58,6 @@ assym.o: assym.s ${AS} -meabi=5 -o assym.o assym.s .endif -.if ${MACHINE_CPUARCH} == "riscv" -assym.o: assym.s - ${AS} -msoft-float -o assym.o assym.s -.endif - .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-head@freebsd.org Wed Aug 10 13:44:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817C5BB44FA; Wed, 10 Aug 2016 13:44:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51A961528; Wed, 10 Aug 2016 13:44:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ADi3fj076141; Wed, 10 Aug 2016 13:44:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ADi3J0076139; Wed, 10 Aug 2016 13:44:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608101344.u7ADi3J0076139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Aug 2016 13:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303913 - in head/sys: amd64/amd64 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.22 Precedence: list List-Id: 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, 10 Aug 2016 13:44:04 -0000 Author: kib Date: Wed Aug 10 13:44:03 2016 New Revision: 303913 URL: https://svnweb.freebsd.org/changeset/base/303913 Log: Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode. There are third-party modules which trigger the issue, and since the problem causes usermode state corruption at least, panic in production kernels as well. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Aug 10 13:38:44 2016 (r303912) +++ head/sys/amd64/amd64/trap.c Wed Aug 10 13:44:03 2016 (r303913) @@ -443,8 +443,8 @@ trap(struct trapframe *frame) goto out; case T_DNA: - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); fpudna(); goto out; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Aug 10 13:38:44 2016 (r303912) +++ head/sys/i386/i386/trap.c Wed Aug 10 13:44:03 2016 (r303913) @@ -540,8 +540,8 @@ trap(struct trapframe *frame) case T_DNA: #ifdef DEV_NPX - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; #endif From owner-svn-src-head@freebsd.org Wed Aug 10 13:47:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F78BB45A6; Wed, 10 Aug 2016 13:47:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C05DE175D; Wed, 10 Aug 2016 13:47:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ADlDed076299; Wed, 10 Aug 2016 13:47:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ADlD8U076298; Wed, 10 Aug 2016 13:47:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608101347.u7ADlD8U076298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Aug 2016 13:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303914 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 13:47:14 -0000 Author: kib Date: Wed Aug 10 13:47:12 2016 New Revision: 303914 URL: https://svnweb.freebsd.org/changeset/base/303914 Log: Re-schedule signals after kthread exits, since apparently there are processes which combine kernel and non-kernel threads, e.g. nfsd. For such processes, termination of a kthread must recheck signal delivery among other threads according to masks. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Wed Aug 10 13:44:03 2016 (r303913) +++ head/sys/kern/kern_kthread.c Wed Aug 10 13:47:12 2016 (r303914) @@ -320,11 +320,13 @@ void kthread_exit(void) { struct proc *p; + struct thread *td; - p = curthread->td_proc; + td = curthread; + p = td->td_proc; /* A module may be waiting for us to exit. */ - wakeup(curthread); + wakeup(td); /* * The last exiting thread in a kernel process must tear down @@ -337,9 +339,10 @@ kthread_exit(void) rw_wunlock(&tidhash_lock); kproc_exit(0); } - LIST_REMOVE(curthread, td_hash); + LIST_REMOVE(td, td_hash); rw_wunlock(&tidhash_lock); - umtx_thread_exit(curthread); + umtx_thread_exit(td); + tdsigcleanup(td); PROC_SLOCK(p); thread_exit(); } From owner-svn-src-head@freebsd.org Wed Aug 10 13:49:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8B8BB4658; Wed, 10 Aug 2016 13:49:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4BB1916; Wed, 10 Aug 2016 13:49:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ADnHDK076410; Wed, 10 Aug 2016 13:49:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ADnH0V076409; Wed, 10 Aug 2016 13:49:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201608101349.u7ADnH0V076409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 10 Aug 2016 13:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303915 - head/sys/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 13:49:18 -0000 Author: br Date: Wed Aug 10 13:49:17 2016 New Revision: 303915 URL: https://svnweb.freebsd.org/changeset/base/303915 Log: Consider CROSS_BINUTILS_PREFIX environment variable so we use correct objdump. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Wed Aug 10 13:47:12 2016 (r303914) +++ head/sys/tools/embed_mfs.sh Wed Aug 10 13:49:17 2016 (r303915) @@ -36,7 +36,7 @@ mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 -sec_info=`objdump -h $1 2> /dev/null | grep " oldmfs "` +sec_info=`${CROSS_BINUTILS_PREFIX}objdump -h $1 2> /dev/null | grep " oldmfs "` # If we can't find the mfs section within the given kernel - bail. [ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 From owner-svn-src-head@freebsd.org Wed Aug 10 13:50:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E7DBBB46CF; Wed, 10 Aug 2016 13:50:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3161B05; Wed, 10 Aug 2016 13:50:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ADoLxg076511; Wed, 10 Aug 2016 13:50:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ADoLlA076510; Wed, 10 Aug 2016 13:50:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608101350.u7ADoLlA076510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Aug 2016 13:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303916 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 13:50:22 -0000 Author: kib Date: Wed Aug 10 13:50:21 2016 New Revision: 303916 URL: https://svnweb.freebsd.org/changeset/base/303916 Log: Convert another tmpfs assert into runtime check. The offset of the directory file, passed to getdirentries(2) syscall, is user-controllable. The value of the offset must not be asserted, instead the invalid value should be checked and rejected if invalid. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 10 13:49:17 2016 (r303915) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 10 13:50:21 2016 (r303916) @@ -819,10 +819,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod goto out; } - MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie); - dekey.td_hash = cookie; - /* Recover if direntry for cookie was removed */ - de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) { + de = NULL; + } else { + dekey.td_hash = cookie; + /* Recover if direntry for cookie was removed */ + de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + } dc->tdc_tree = de; dc->tdc_current = de; if (de != NULL && tmpfs_dirent_duphead(de)) { From owner-svn-src-head@freebsd.org Wed Aug 10 14:27:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34309BB4980; Wed, 10 Aug 2016 14:27:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1DD0188A; Wed, 10 Aug 2016 14:27:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6C67B1FE024; Wed, 10 Aug 2016 16:27:18 +0200 (CEST) Subject: Re: svn commit: r303425 - in head: share/man/man9 sys/kern sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607280857.u6S8v1w3062722@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Wed, 10 Aug 2016 16:31:42 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201607280857.u6S8v1w3062722@repo.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.22 Precedence: list List-Id: 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, 10 Aug 2016 14:27:21 -0000 On 07/28/16 10:57, Konstantin Belousov wrote: > + if ((flags & C_HARDCLOCK) == 0) > + to_sbt += tick_sbt; > + } else > + to_sbt = sbinuptime(); ^^^ looks like two whitespaces sneaked in here. > + if (SBT_MAX - to_sbt < sbt) > + to_sbt = SBT_MAX; > + else Else looks good. --HPS From owner-svn-src-head@freebsd.org Wed Aug 10 14:41:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E56BB541F; Wed, 10 Aug 2016 14:41:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E97E1975; Wed, 10 Aug 2016 14:41:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AEfrI1099555; Wed, 10 Aug 2016 14:41:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AEfrL6099554; Wed, 10 Aug 2016 14:41:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608101441.u7AEfrL6099554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Aug 2016 14:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303919 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 14:41:56 -0000 Author: kib Date: Wed Aug 10 14:41:53 2016 New Revision: 303919 URL: https://svnweb.freebsd.org/changeset/base/303919 Log: Fix indentation. Reported by: hselasky MFC after: 17 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Wed Aug 10 14:31:32 2016 (r303918) +++ head/sys/kern/kern_timeout.c Wed Aug 10 14:41:53 2016 (r303919) @@ -984,7 +984,7 @@ callout_when(sbintime_t sbt, sbintime_t if ((flags & C_HARDCLOCK) == 0) to_sbt += tick_sbt; } else - to_sbt = sbinuptime(); + to_sbt = sbinuptime(); if (SBT_MAX - to_sbt < sbt) to_sbt = SBT_MAX; else From owner-svn-src-head@freebsd.org Wed Aug 10 15:16:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7108BB5007; Wed, 10 Aug 2016 15:16:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9201B134B; Wed, 10 Aug 2016 15:16:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AFGTDL012189; Wed, 10 Aug 2016 15:16:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AFGSib012177; Wed, 10 Aug 2016 15:16:28 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608101516.u7AFGSib012177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 10 Aug 2016 15:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303920 - in head: include lib/libcrypt secure/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 15:16:30 -0000 Author: ed Date: Wed Aug 10 15:16:28 2016 New Revision: 303920 URL: https://svnweb.freebsd.org/changeset/base/303920 Log: Make libcrypt thread-safe. Add crypt_r(3). glibc has a pretty nice function called crypt_r(3), which is nothing more than crypt(3), but thread-safe. It accomplishes this by introducing a 'struct crypt_data' structure that contains a buffer that is large enough to hold the resulting string. Let's go ahead and also add this function. It would be a shame if a useful function like this wouldn't be usable in multithreaded apps. Refactor crypt.c and all of the backends to no longer declare static arrays, but write their output in a provided buffer. There is no need to do any buffer length computation here, as we'll just need to ensure that 'struct crypt_data' is large enough, which it is. _PASSWORD_LEN is defined to 128 bytes, but in this case I'm picking 256, as this is going to be part of the actual ABI. Differential Revision: https://reviews.freebsd.org/D7306 Modified: head/include/unistd.h head/lib/libcrypt/Makefile head/lib/libcrypt/crypt-md5.c head/lib/libcrypt/crypt-nthash.c head/lib/libcrypt/crypt-sha256.c head/lib/libcrypt/crypt-sha512.c head/lib/libcrypt/crypt.3 head/lib/libcrypt/crypt.c head/lib/libcrypt/crypt.h head/lib/libcrypt/misc.c head/secure/lib/libcrypt/crypt-blowfish.c head/secure/lib/libcrypt/crypt-des.c Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Wed Aug 10 14:41:53 2016 (r303919) +++ head/include/unistd.h Wed Aug 10 15:16:28 2016 (r303920) @@ -484,11 +484,18 @@ pid_t vfork(void) __returns_twice; #if __BSD_VISIBLE struct timeval; /* select(2) */ + +struct crypt_data { + int initialized; /* For compatibility with glibc. */ + char __buf[256]; /* Buffer returned by crypt_r(). */ +}; + int acct(const char *); int async_daemon(void); int check_utility_compat(const char *); const char * crypt_get_format(void); +char *crypt_r(const char *, const char *, struct crypt_data *); int crypt_set_format(const char *); int des_cipher(const char *, char *, long, int); int des_setkey(const char *key); Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/Makefile Wed Aug 10 15:16:28 2016 (r303920) @@ -17,7 +17,8 @@ SRCS= crypt.c misc.c \ crypt-sha256.c sha256c.c \ crypt-sha512.c sha512c.c MAN= crypt.3 -MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3 +MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \ + crypt.3 crypt_set_format.3 CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \ -I${.CURDIR}/../../sys/crypto/sha2 Modified: head/lib/libcrypt/crypt-md5.c ============================================================================== --- head/lib/libcrypt/crypt-md5.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt-md5.c Wed Aug 10 15:16:28 2016 (r303920) @@ -41,31 +41,27 @@ __FBSDID("$FreeBSD$"); * UNIX password */ -char * -crypt_md5(const char *pw, const char *salt) +int +crypt_md5(const char *pw, const char *salt, char *buffer) { MD5_CTX ctx,ctx1; unsigned long l; int sl, pl; u_int i; u_char final[MD5_SIZE]; - static const char *sp, *ep; - static char passwd[120], *p; + const char *ep; static const char *magic = "$1$"; - /* Refine the Salt first */ - sp = salt; - - /* If it starts with the magic string, then skip that */ - if(!strncmp(sp, magic, strlen(magic))) - sp += strlen(magic); + /* If the salt starts with the magic string, skip that. */ + if (!strncmp(salt, magic, strlen(magic))) + salt += strlen(magic); /* It stops at the first '$', max 8 chars */ - for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++) + for (ep = salt; *ep && *ep != '$' && ep < salt + 8; ep++) continue; /* get the length of the true salt */ - sl = ep - sp; + sl = ep - salt; MD5Init(&ctx); @@ -76,12 +72,12 @@ crypt_md5(const char *pw, const char *sa MD5Update(&ctx, (const u_char *)magic, strlen(magic)); /* Then the raw salt */ - MD5Update(&ctx, (const u_char *)sp, (u_int)sl); + MD5Update(&ctx, (const u_char *)salt, (u_int)sl); /* Then just as many characters of the MD5(pw,salt,pw) */ MD5Init(&ctx1); MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); + MD5Update(&ctx1, (const u_char *)salt, (u_int)sl); MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); MD5Final(final, &ctx1); for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) @@ -99,9 +95,9 @@ crypt_md5(const char *pw, const char *sa MD5Update(&ctx, (const u_char *)pw, 1); /* Now make the output string */ - strcpy(passwd, magic); - strncat(passwd, sp, (u_int)sl); - strcat(passwd, "$"); + buffer = stpcpy(buffer, magic); + buffer = stpncpy(buffer, salt, (u_int)sl); + *buffer++ = '$'; MD5Final(final, &ctx); @@ -118,7 +114,7 @@ crypt_md5(const char *pw, const char *sa MD5Update(&ctx1, (const u_char *)final, MD5_SIZE); if(i % 3) - MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); + MD5Update(&ctx1, (const u_char *)salt, (u_int)sl); if(i % 7) MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); @@ -130,24 +126,22 @@ crypt_md5(const char *pw, const char *sa MD5Final(final, &ctx1); } - p = passwd + strlen(passwd); - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; - _crypt_to64(p, l, 4); p += 4; + _crypt_to64(buffer, l, 4); buffer += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; - _crypt_to64(p, l, 4); p += 4; + _crypt_to64(buffer, l, 4); buffer += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; - _crypt_to64(p, l, 4); p += 4; + _crypt_to64(buffer, l, 4); buffer += 4; l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; - _crypt_to64(p, l, 4); p += 4; + _crypt_to64(buffer, l, 4); buffer += 4; l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; - _crypt_to64(p, l, 4); p += 4; + _crypt_to64(buffer, l, 4); buffer += 4; l = final[11]; - _crypt_to64(p, l, 2); p += 2; - *p = '\0'; + _crypt_to64(buffer, l, 2); buffer += 2; + *buffer = '\0'; /* Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); - return (passwd); + return (0); } Modified: head/lib/libcrypt/crypt-nthash.c ============================================================================== --- head/lib/libcrypt/crypt-nthash.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt-nthash.c Wed Aug 10 15:16:28 2016 (r303920) @@ -46,16 +46,14 @@ __FBSDID("$FreeBSD$"); */ /* ARGSUSED */ -char * -crypt_nthash(const char *pw, const char *salt __unused) +int +crypt_nthash(const char *pw, const char *salt __unused, char *buffer) { size_t unipwLen; - int i, j; - static char hexconvtab[] = "0123456789abcdef"; + int i; + static const char hexconvtab[] = "0123456789abcdef"; static const char *magic = "$3$"; - static char passwd[120]; u_int16_t unipw[128]; - char final[MD4_SIZE*2 + 1]; u_char hash[MD4_SIZE]; const char *s; MD4_CTX ctx; @@ -70,19 +68,14 @@ crypt_nthash(const char *pw, const char MD4Init(&ctx); MD4Update(&ctx, (u_char *)unipw, unipwLen*sizeof(u_int16_t)); MD4Final(hash, &ctx); - - for (i = j = 0; i < MD4_SIZE; i++) { - final[j++] = hexconvtab[hash[i] >> 4]; - final[j++] = hexconvtab[hash[i] & 15]; - } - final[j] = '\0'; - - strcpy(passwd, magic); - strcat(passwd, "$"); - strncat(passwd, final, MD4_SIZE*2); - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); + buffer = stpcpy(buffer, magic); + *buffer++ = '$'; + for (i = 0; i < MD4_SIZE; i++) { + *buffer++ = hexconvtab[hash[i] >> 4]; + *buffer++ = hexconvtab[hash[i] & 15]; + } + *buffer = '\0'; - return (passwd); + return (0); } Modified: head/lib/libcrypt/crypt-sha256.c ============================================================================== --- head/lib/libcrypt/crypt-sha256.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt-sha256.c Wed Aug 10 15:16:28 2016 (r303920) @@ -59,11 +59,10 @@ static const char sha256_rounds_prefix[] /* Maximum number of rounds. */ #define ROUNDS_MAX 999999999 -static char * -crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen) +int +crypt_sha256(const char *key, const char *salt, char *buffer) { u_long srounds; - int n; uint8_t alt_result[32], temp_result[32]; SHA256_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; @@ -210,42 +209,27 @@ crypt_sha256_r(const char *key, const ch /* Now we can construct the result string. It consists of three * parts. */ - cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen)); - buflen -= sizeof(sha256_salt_prefix) - 1; + cp = stpcpy(buffer, sha256_salt_prefix); - if (rounds_custom) { - n = snprintf(cp, MAX(0, buflen), "%s%zu$", - sha256_rounds_prefix, rounds); + if (rounds_custom) + cp += sprintf(cp, "%s%zu$", sha256_rounds_prefix, rounds); - cp += n; - buflen -= n; - } + cp = stpncpy(cp, salt, salt_len); - cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len)); - buflen -= MIN((size_t)MAX(0, buflen), salt_len); + *cp++ = '$'; - if (buflen > 0) { - *cp++ = '$'; - --buflen; - } - - b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp); - b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp); - b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp); - b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp); - b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp); - b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp); - b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp); - b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp); - b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp); - b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp); - b64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp); - if (buflen <= 0) { - errno = ERANGE; - buffer = NULL; - } - else - *cp = '\0'; /* Terminate the string. */ + b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &cp); + b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &cp); + b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &cp); + b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &cp); + b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &cp); + b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &cp); + b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &cp); + b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &cp); + b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &cp); + b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &cp); + b64_from_24bit(0, alt_result[31], alt_result[30], 3, &cp); + *cp = '\0'; /* Terminate the string. */ /* Clear the buffer for the intermediate result so that people * attaching to processes or reading core dumps cannot get any @@ -263,37 +247,7 @@ crypt_sha256_r(const char *key, const ch if (copied_salt != NULL) memset(copied_salt, '\0', salt_len); - return buffer; -} - -/* This entry point is equivalent to crypt(3). */ -char * -crypt_sha256(const char *key, const char *salt) -{ - /* We don't want to have an arbitrary limit in the size of the - * password. We can compute an upper bound for the size of the - * result in advance and so we can prepare the buffer we pass to - * `crypt_sha256_r'. */ - static char *buffer; - static int buflen; - int needed; - char *new_buffer; - - needed = (sizeof(sha256_salt_prefix) - 1 - + sizeof(sha256_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); - - if (buflen < needed) { - new_buffer = (char *)realloc(buffer, needed); - - if (new_buffer == NULL) - return NULL; - - buffer = new_buffer; - buflen = needed; - } - - return crypt_sha256_r(key, salt, buffer, buflen); + return (0); } #ifdef TEST Modified: head/lib/libcrypt/crypt-sha512.c ============================================================================== --- head/lib/libcrypt/crypt-sha512.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt-sha512.c Wed Aug 10 15:16:28 2016 (r303920) @@ -59,11 +59,10 @@ static const char sha512_rounds_prefix[] /* Maximum number of rounds. */ #define ROUNDS_MAX 999999999 -static char * -crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen) +int +crypt_sha512(const char *key, const char *salt, char *buffer) { u_long srounds; - int n; uint8_t alt_result[64], temp_result[64]; SHA512_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; @@ -210,54 +209,39 @@ crypt_sha512_r(const char *key, const ch /* Now we can construct the result string. It consists of three * parts. */ - cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen)); - buflen -= sizeof(sha512_salt_prefix) - 1; + cp = stpcpy(buffer, sha512_salt_prefix); - if (rounds_custom) { - n = snprintf(cp, MAX(0, buflen), "%s%zu$", - sha512_rounds_prefix, rounds); + if (rounds_custom) + cp += sprintf(cp, "%s%zu$", sha512_rounds_prefix, rounds); - cp += n; - buflen -= n; - } + cp = stpncpy(cp, salt, salt_len); - cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len)); - buflen -= MIN((size_t)MAX(0, buflen), salt_len); + *cp++ = '$'; - if (buflen > 0) { - *cp++ = '$'; - --buflen; - } + b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &cp); + b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &cp); + b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &cp); + b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &cp); + b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &cp); + b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &cp); + b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &cp); + b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &cp); + b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &cp); + b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &cp); + b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &cp); + b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &cp); + b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &cp); + b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &cp); + b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &cp); + b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &cp); + b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &cp); + b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &cp); + b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &cp); + b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &cp); + b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &cp); + b64_from_24bit(0, 0, alt_result[63], 2, &cp); - b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp); - b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp); - b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp); - b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp); - b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp); - b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp); - b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp); - b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp); - b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp); - b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp); - b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp); - b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp); - b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp); - b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp); - b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp); - b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp); - b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp); - b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp); - b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp); - b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp); - b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp); - b64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp); - - if (buflen <= 0) { - errno = ERANGE; - buffer = NULL; - } - else - *cp = '\0'; /* Terminate the string. */ + *cp = '\0'; /* Terminate the string. */ /* Clear the buffer for the intermediate result so that people * attaching to processes or reading core dumps cannot get any @@ -275,37 +259,7 @@ crypt_sha512_r(const char *key, const ch if (copied_salt != NULL) memset(copied_salt, '\0', salt_len); - return buffer; -} - -/* This entry point is equivalent to crypt(3). */ -char * -crypt_sha512(const char *key, const char *salt) -{ - /* We don't want to have an arbitrary limit in the size of the - * password. We can compute an upper bound for the size of the - * result in advance and so we can prepare the buffer we pass to - * `crypt_sha512_r'. */ - static char *buffer; - static int buflen; - int needed; - char *new_buffer; - - needed = (sizeof(sha512_salt_prefix) - 1 - + sizeof(sha512_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 86 + 1); - - if (buflen < needed) { - new_buffer = (char *)realloc(buffer, needed); - - if (new_buffer == NULL) - return NULL; - - buffer = new_buffer; - buflen = needed; - } - - return crypt_sha512_r(key, salt, buffer, buflen); + return (0); } #ifdef TEST Modified: head/lib/libcrypt/crypt.3 ============================================================================== --- head/lib/libcrypt/crypt.3 Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt.3 Wed Aug 10 15:16:28 2016 (r303920) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2014 +.Dd August 10, 2016 .Dt CRYPT 3 .Os .Sh NAME @@ -41,6 +41,8 @@ .In unistd.h .Ft char * .Fn crypt "const char *key" "const char *salt" +.Ft char * +.Fn crypt_r "const char *key" "const char *salt" "struct crypt_data *data" .Ft const char * .Fn crypt_get_format "void" .Ft int @@ -246,10 +248,20 @@ The .Fn crypt_set_format function sets the default encoding format according to the supplied .Fa string . +.Pp +The +.Fn crypt_r +function behaves identically to +.Fn crypt , +except that the resulting string is stored in +.Fa data , +making it thread-safe. .Sh RETURN VALUES The .Fn crypt -function returns a pointer to the encrypted value on success, and NULL on +and +.Fn crypt_r +functions return a pointer to the encrypted value on success, and NULL on failure. Note: this is not a standard behaviour, AT&T .Fn crypt @@ -280,6 +292,11 @@ section of the code (FreeSec 1.0) was de States of America as an unencumbered replacement for the U.S.-only .Nx libcrypt encryption library. +.Pp +The +.Fn crypt_r +function was added in +.Fx 12.0 . .Sh AUTHORS .An -nosplit Originally written by Modified: head/lib/libcrypt/crypt.c ============================================================================== --- head/lib/libcrypt/crypt.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt.c Wed Aug 10 15:16:28 2016 (r303920) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); * and it needs to be the default for backward compatibility. */ static const struct crypt_format { - const char *const name; - char *(*const func)(const char *, const char *); - const char *const magic; + const char *name; + int (*func)(const char *, const char *, char *); + const char *magic; } crypt_formats[] = { { "md5", crypt_md5, "$1$" }, #ifdef HAS_BLOWFISH @@ -104,20 +104,37 @@ crypt_set_format(const char *format) * otherwise, the currently selected format is used. */ char * -crypt(const char *passwd, const char *salt) +crypt_r(const char *passwd, const char *salt, struct crypt_data *data) { const struct crypt_format *cf; + int (*func)(const char *, const char *, char *); #ifdef HAS_DES int len; #endif for (cf = crypt_formats; cf->name != NULL; ++cf) - if (cf->magic != NULL && strstr(salt, cf->magic) == salt) - return (cf->func(passwd, salt)); + if (cf->magic != NULL && strstr(salt, cf->magic) == salt) { + func = cf->func; + goto match; + } #ifdef HAS_DES len = strlen(salt); - if ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) - return (crypt_des(passwd, salt)); + if ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) { + func = crypt_des; + goto match; + } #endif - return (crypt_format->func(passwd, salt)); + func = crypt_format->func; +match: + if (func(passwd, salt, data->__buf) != 0) + return (NULL); + return (data->__buf); +} + +char * +crypt(const char *passwd, const char *salt) +{ + static struct crypt_data data; + + return (crypt_r(passwd, salt, &data)); } Modified: head/lib/libcrypt/crypt.h ============================================================================== --- head/lib/libcrypt/crypt.h Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/crypt.h Wed Aug 10 15:16:28 2016 (r303920) @@ -32,12 +32,12 @@ #define MD4_SIZE 16 #define MD5_SIZE 16 -char *crypt_des(const char *pw, const char *salt); -char *crypt_md5(const char *pw, const char *salt); -char *crypt_nthash(const char *pw, const char *salt); -char *crypt_blowfish(const char *pw, const char *salt); -char *crypt_sha256 (const char *pw, const char *salt); -char *crypt_sha512 (const char *pw, const char *salt); +int crypt_des(const char *pw, const char *salt, char *buf); +int crypt_md5(const char *pw, const char *salt, char *buf); +int crypt_nthash(const char *pw, const char *salt, char *buf); +int crypt_blowfish(const char *pw, const char *salt, char *buf); +int crypt_sha256 (const char *pw, const char *salt, char *buf); +int crypt_sha512 (const char *pw, const char *salt, char *buf); extern void _crypt_to64(char *s, u_long v, int n); -extern void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp); +extern void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, char **cp); Modified: head/lib/libcrypt/misc.c ============================================================================== --- head/lib/libcrypt/misc.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/lib/libcrypt/misc.c Wed Aug 10 15:16:28 2016 (r303920) @@ -47,7 +47,7 @@ _crypt_to64(char *s, u_long v, int n) } void -b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp) +b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, char **cp) { uint32_t w; int i; @@ -56,8 +56,6 @@ b64_from_24bit(uint8_t B2, uint8_t B1, u for (i = 0; i < n; i++) { **cp = itoa64[w&0x3f]; (*cp)++; - if ((*buflen)-- < 0) - break; w >>= 6; } } Modified: head/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- head/secure/lib/libcrypt/crypt-blowfish.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/secure/lib/libcrypt/crypt-blowfish.c Wed Aug 10 15:16:28 2016 (r303920) @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t); static void decode_base64(u_int8_t *, u_int16_t, const u_int8_t *); -static char encrypted[_PASSWORD_LEN]; - const static u_int8_t Base64Code[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; @@ -135,8 +133,8 @@ decode_base64(u_int8_t *buffer, u_int16_ /* We handle $Vers$log2(NumRounds)$salt+passwd$ i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ -char * -crypt_blowfish(const char *key, const char *salt) +int +crypt_blowfish(const char *key, const char *salt, char *buffer) { blf_ctx state; u_int32_t rounds, i, k; @@ -157,10 +155,8 @@ crypt_blowfish(const char *key, const ch /* Discard "$" identifier */ salt++; - if (*salt > BCRYPT_VERSION) { - /* How do I handle errors ? Return NULL */ - return NULL; - } + if (*salt > BCRYPT_VERSION) + return (-1); /* Check for minor versions */ if (salt[1] != '$') { @@ -174,7 +170,7 @@ crypt_blowfish(const char *key, const ch salt++; break; default: - return NULL; + return (-1); } } else minr = 0; @@ -184,15 +180,15 @@ crypt_blowfish(const char *key, const ch if (salt[2] != '$') /* Out of sync with passwd entry */ - return NULL; + return (-1); memcpy(arounds, salt, sizeof(arounds)); if (arounds[sizeof(arounds) - 1] != '$') - return NULL; + return (-1); arounds[sizeof(arounds) - 1] = 0; logr = strtonum(arounds, BCRYPT_MINLOGROUNDS, 31, NULL); if (logr == 0) - return NULL; + return (-1); /* Computer power doesn't increase linearly, 2^x should be fine */ rounds = 1U << logr; @@ -201,7 +197,7 @@ crypt_blowfish(const char *key, const ch } if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT) - return NULL; + return (-1); /* We dont want the base64 salt but the raw data */ decode_base64(csalt, BCRYPT_MAXSALT, (const u_int8_t *) salt); @@ -248,23 +244,23 @@ crypt_blowfish(const char *key, const ch } - i = 0; - encrypted[i++] = '$'; - encrypted[i++] = BCRYPT_VERSION; + *buffer++ = '$'; + *buffer++ = BCRYPT_VERSION; if (minr) - encrypted[i++] = minr; - encrypted[i++] = '$'; + *buffer++ = minr; + *buffer++ = '$'; - snprintf(encrypted + i, 4, "%2.2u$", logr); + snprintf(buffer, 4, "%2.2u$", logr); + buffer += 3; - encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT); - encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext, - 4 * BCRYPT_BLOCKS - 1); + encode_base64((u_int8_t *)buffer, csalt, BCRYPT_MAXSALT); + buffer += strlen(buffer); + encode_base64((u_int8_t *)buffer, ciphertext, 4 * BCRYPT_BLOCKS - 1); memset(&state, 0, sizeof(state)); memset(ciphertext, 0, sizeof(ciphertext)); memset(csalt, 0, sizeof(csalt)); memset(cdata, 0, sizeof(cdata)); - return encrypted; + return (0); } static void Modified: head/secure/lib/libcrypt/crypt-des.c ============================================================================== --- head/secure/lib/libcrypt/crypt-des.c Wed Aug 10 14:41:53 2016 (r303919) +++ head/secure/lib/libcrypt/crypt-des.c Wed Aug 10 15:16:28 2016 (r303920) @@ -588,13 +588,12 @@ des_cipher(const char *in, char *out, u_ return(retval); } -char * -crypt_des(const char *key, const char *setting) +int +crypt_des(const char *key, const char *setting, char *buffer) { int i; u_int32_t count, salt, l, r0, r1, keybuf[2]; - u_char *p, *q; - static char output[21]; + u_char *q; if (!des_initialised) des_init(); @@ -610,7 +609,7 @@ crypt_des(const char *key, const char *s key++; } if (des_setkey((char *)keybuf)) - return(NULL); + return (-1); if (*setting == _PASSWORD_EFMT1) { /* @@ -629,7 +628,7 @@ crypt_des(const char *key, const char *s * Encrypt the key with itself. */ if (des_cipher((char *)keybuf, (char *)keybuf, 0L, 1)) - return(NULL); + return (-1); /* * And XOR with the next 8 characters of the key. */ @@ -638,19 +637,9 @@ crypt_des(const char *key, const char *s *q++ ^= *key++ << 1; if (des_setkey((char *)keybuf)) - return(NULL); + return (-1); } - strncpy(output, setting, 9); - - /* - * Double check that we weren't given a short setting. - * If we were, the above code will probably have created - * wierd values for count and salt, but we don't really care. - * Just make sure the output string doesn't have an extra - * NUL in it. - */ - output[9] = '\0'; - p = (u_char *)output + strlen(output); + buffer = stpncpy(buffer, setting, 9); } else { /* * "old"-style: @@ -662,43 +651,41 @@ crypt_des(const char *key, const char *s salt = (ascii_to_bin(setting[1]) << 6) | ascii_to_bin(setting[0]); - output[0] = setting[0]; + *buffer++ = setting[0]; /* * If the encrypted password that the salt was extracted from * is only 1 character long, the salt will be corrupted. We * need to ensure that the output string doesn't have an extra * NUL in it! */ - output[1] = setting[1] ? setting[1] : output[0]; - - p = (u_char *)output + 2; + *buffer++ = setting[1] ? setting[1] : setting[0]; } setup_salt(salt); /* * Do it. */ if (do_des(0L, 0L, &r0, &r1, (int)count)) - return(NULL); + return (-1); /* * Now encode the result... */ l = (r0 >> 8); - *p++ = ascii64[(l >> 18) & 0x3f]; - *p++ = ascii64[(l >> 12) & 0x3f]; - *p++ = ascii64[(l >> 6) & 0x3f]; - *p++ = ascii64[l & 0x3f]; + *buffer++ = ascii64[(l >> 18) & 0x3f]; + *buffer++ = ascii64[(l >> 12) & 0x3f]; + *buffer++ = ascii64[(l >> 6) & 0x3f]; + *buffer++ = ascii64[l & 0x3f]; l = (r0 << 16) | ((r1 >> 16) & 0xffff); - *p++ = ascii64[(l >> 18) & 0x3f]; - *p++ = ascii64[(l >> 12) & 0x3f]; - *p++ = ascii64[(l >> 6) & 0x3f]; - *p++ = ascii64[l & 0x3f]; + *buffer++ = ascii64[(l >> 18) & 0x3f]; + *buffer++ = ascii64[(l >> 12) & 0x3f]; + *buffer++ = ascii64[(l >> 6) & 0x3f]; + *buffer++ = ascii64[l & 0x3f]; l = r1 << 2; - *p++ = ascii64[(l >> 12) & 0x3f]; - *p++ = ascii64[(l >> 6) & 0x3f]; - *p++ = ascii64[l & 0x3f]; - *p = 0; + *buffer++ = ascii64[(l >> 12) & 0x3f]; + *buffer++ = ascii64[(l >> 6) & 0x3f]; + *buffer++ = ascii64[l & 0x3f]; + *buffer = '\0'; - return(output); + return (0); } From owner-svn-src-head@freebsd.org Wed Aug 10 15:24:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0EECBB53DA; Wed, 10 Aug 2016 15:24:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A12081D97; Wed, 10 Aug 2016 15:24:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AFOG4D015922; Wed, 10 Aug 2016 15:24:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AFOGW7015920; Wed, 10 Aug 2016 15:24:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608101524.u7AFOGW7015920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 10 Aug 2016 15:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303921 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 15:24:17 -0000 Author: mjg Date: Wed Aug 10 15:24:15 2016 New Revision: 303921 URL: https://svnweb.freebsd.org/changeset/base/303921 Log: sigio: do a lockless check in funsetownlist There is no need to grab the lock first to see if sigio is used, and it typically is not. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Aug 10 15:16:28 2016 (r303920) +++ head/sys/kern/kern_descrip.c Wed Aug 10 15:24:15 2016 (r303921) @@ -942,6 +942,8 @@ funsetown(struct sigio **sigiop) { struct sigio *sigio; + if (*sigiop == NULL) + return; SIGIO_LOCK(); sigio = *sigiop; if (sigio == NULL) { From owner-svn-src-head@freebsd.org Wed Aug 10 15:25:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C001BB54B9; Wed, 10 Aug 2016 15:25:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD29A1F74; Wed, 10 Aug 2016 15:25:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AFPjuA016022; Wed, 10 Aug 2016 15:25:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AFPjdH016021; Wed, 10 Aug 2016 15:25:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608101525.u7AFPjdH016021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 10 Aug 2016 15:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303922 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 15:25:46 -0000 Author: mjg Date: Wed Aug 10 15:25:44 2016 New Revision: 303922 URL: https://svnweb.freebsd.org/changeset/base/303922 Log: ktrace: do a lockless check on fork to see if tracing is enabled This saves 2 lock acquisitions in the common case. Modified: head/sys/kern/kern_ktrace.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Wed Aug 10 15:24:15 2016 (r303921) +++ head/sys/kern/kern_ktrace.c Wed Aug 10 15:25:44 2016 (r303922) @@ -572,9 +572,14 @@ void ktrprocfork(struct proc *p1, struct proc *p2) { + MPASS(p2->p_tracevp == NULL); + MPASS(p2->p_traceflag == 0); + + if (p1->p_traceflag == 0) + return; + PROC_LOCK(p1); mtx_lock(&ktrace_mtx); - KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); if (p1->p_traceflag & KTRFAC_INHERIT) { p2->p_traceflag = p1->p_traceflag; if ((p2->p_tracevp = p1->p_tracevp) != NULL) { From owner-svn-src-head@freebsd.org Wed Aug 10 15:45:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C193BB5B31; Wed, 10 Aug 2016 15:45:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF8B1E38; Wed, 10 Aug 2016 15:45:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AFjPs3023638; Wed, 10 Aug 2016 15:45:25 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AFjPge023637; Wed, 10 Aug 2016 15:45:25 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608101545.u7AFjPge023637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 10 Aug 2016 15:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303923 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 15:45:26 -0000 Author: ed Date: Wed Aug 10 15:45:25 2016 New Revision: 303923 URL: https://svnweb.freebsd.org/changeset/base/303923 Log: Make cpu_set_user_tls() work when called on the running thread. On all the other architectures, this function can also be called on the currently running thread. In this case, we shouldn't fix up the address in the PCB, but also patch up the register itself. Otherwise it will not become active and will simply become overwritten by the next switch. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7437 Modified: head/sys/arm64/arm64/vm_machdep.c Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Aug 10 15:25:44 2016 (r303922) +++ head/sys/arm64/arm64/vm_machdep.c Wed Aug 10 15:45:25 2016 (r303923) @@ -201,6 +201,8 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); return (0); } From owner-svn-src-head@freebsd.org Wed Aug 10 15:55:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BF0BB40E9; Wed, 10 Aug 2016 15:55:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E66DB16B7; Wed, 10 Aug 2016 15:55:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9510D1FE024; Wed, 10 Aug 2016 17:55:09 +0200 (CEST) Subject: Re: svn commit: r303426 - in head/sys: ddb kern sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607280909.u6S99t01066655@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <73c3a522-b83e-46b2-6bc7-1987f8ebb449@selasky.org> Date: Wed, 10 Aug 2016 17:59:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201607280909.u6S99t01066655@repo.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.22 Precedence: list List-Id: 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, 10 Aug 2016 15:55:42 -0000 On 07/28/16 11:09, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 28 09:09:55 2016 > New Revision: 303426 > URL: https://svnweb.freebsd.org/changeset/base/303426 > > Log: > Rewrite subr_sleepqueue.c use of callouts to not depend on the > specifics of callout KPI. Esp., do not depend on the exact interface > of callout_stop(9) return values. > > The main change is that instead of requiring precise callouts, code > maintains absolute time to wake up. Callouts now should ensure that a > wake occurs at the requested moment, but we can tolerate both run-away > callout, and callout_stop(9) lying about running callout either way. > > As consequence, it removes the constant source of the bugs where > sleepq_check_timeout() causes uninterruptible thread state where the > thread is detached from CPU, see e.g. r234952 and r296320. > > Patch also removes dual meaning of the TDF_TIMEOUT flag, making code > (IMO much) simpler to reason about. > > Tested by: pho > Reviewed by: jhb > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > Differential revision: https://reviews.freebsd.org/D7137 > > Modified: > head/sys/ddb/db_ps.c > head/sys/kern/kern_thread.c > head/sys/kern/subr_sleepqueue.c > head/sys/sys/proc.h > Hi, I think that: #define SWT_SLEEPQTIMO 5 /* Sleepq timeout wait. */ in sys/proc.h can also be marked "available" after this change. --HPS From owner-svn-src-head@freebsd.org Wed Aug 10 16:12:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28501BB4530; Wed, 10 Aug 2016 16:12:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDF721014; Wed, 10 Aug 2016 16:12:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AGCXgr034376; Wed, 10 Aug 2016 16:12:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AGCVXL034364; Wed, 10 Aug 2016 16:12:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608101612.u7AGCVXL034364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 10 Aug 2016 16:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303924 - in head/sys: fs/smbfs fs/unionfs kern sys ufs/ffs ufs/ufs 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.22 Precedence: list List-Id: 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, 10 Aug 2016 16:12:34 -0000 Author: trasz Date: Wed Aug 10 16:12:31 2016 New Revision: 303924 URL: https://svnweb.freebsd.org/changeset/base/303924 Log: Replace all remaining calls to vprint(9) with vn_printf(9), and remove the old macro. MFC after: 1 month Modified: head/sys/fs/smbfs/smbfs_node.c head/sys/fs/unionfs/union_vnops.c head/sys/kern/vfs_default.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_quota.c head/sys/vm/vm_object.c Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/fs/smbfs/smbfs_node.c Wed Aug 10 16:12:31 2016 (r303924) @@ -132,7 +132,7 @@ smbfs_node_alloc(struct mount *mp, struc } dnp = dvp ? VTOSMB(dvp) : NULL; if (dnp == NULL && dvp != NULL) { - vprint("smbfs_node_alloc: dead parent vnode", dvp); + vn_printf(dvp, "smbfs_node_alloc: dead parent vnode "); return EINVAL; } error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/fs/unionfs/union_vnops.c Wed Aug 10 16:12:31 2016 (r303924) @@ -1753,9 +1753,9 @@ unionfs_print(struct vop_print_args *ap) */ if (unp->un_uppervp != NULLVP) - vprint("unionfs: upper", unp->un_uppervp); + vn_printf(unp->un_uppervp, "unionfs: upper "); if (unp->un_lowervp != NULLVP) - vprint("unionfs: lower", unp->un_lowervp); + vn_printf(unp->un_lowervp, "unionfs: lower "); return (0); } Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/kern/vfs_default.c Wed Aug 10 16:12:31 2016 (r303924) @@ -256,7 +256,7 @@ static int vop_nostrategy (struct vop_strategy_args *ap) { printf("No strategy for buffer at %p\n", ap->a_bp); - vprint("vnode", ap->a_vp); + vn_printf(ap->a_vp, "vnode "); ap->a_bp->b_ioflags |= BIO_ERROR; ap->a_bp->b_error = EOPNOTSUPP; bufdone(ap->a_bp); @@ -722,7 +722,7 @@ loop2: } BO_UNLOCK(bo); if (error == EAGAIN) - vprint("fsync: giving up on dirty", vp); + vn_printf(vp, "fsync: giving up on dirty "); return (error); } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/kern/vfs_lookup.c Wed Aug 10 16:12:31 2016 (r303924) @@ -721,7 +721,7 @@ unionlookup: if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags)) cnp->cn_lkflags = LK_EXCLUSIVE; #ifdef NAMEI_DIAGNOSTIC - vprint("lookup in", dp); + vn_printf(dp, "lookup in "); #endif lkflags_save = cnp->cn_lkflags; cnp->cn_lkflags = compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags, @@ -1007,7 +1007,7 @@ relookup(struct vnode *dvp, struct vnode * We now have a segment name to search for, and a directory to search. */ #ifdef NAMEI_DIAGNOSTIC - vprint("search in:", dp); + vn_printf(dp, "search in "); #endif if ((error = VOP_LOOKUP(dp, vpp, cnp)) != 0) { KASSERT(*vpp == NULL, ("leaf should be empty")); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/kern/vfs_mount.c Wed Aug 10 16:12:31 2016 (r303924) @@ -510,7 +510,7 @@ vfs_mount_destroy(struct mount *mp) struct vnode *vp; TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) - vprint("", vp); + vn_printf(vp, "dangling vnode "); panic("unmount: dangling vnode"); } KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers")); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/kern/vfs_subr.c Wed Aug 10 16:12:31 2016 (r303924) @@ -2645,7 +2645,7 @@ vputx(struct vnode *vp, int func) error = 0; if (vp->v_usecount != 0) { - vprint("vputx: usecount not zero", vp); + vn_printf(vp, "vputx: usecount not zero for vnode "); panic("vputx: usecount not zero"); } @@ -3036,7 +3036,7 @@ loop: busy++; #ifdef DIAGNOSTIC if (busyprt) - vprint("vflush: busy vnode", vp); + vn_printf(vp, "vflush: busy vnode "); #endif } VOP_UNLOCK(vp, 0); @@ -3409,7 +3409,7 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnode TAILQ_FOREACH(mp, &mountlist, mnt_list) { TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { if (vp->v_type != VMARKER && VOP_ISLOCKED(vp)) - vprint("", vp); + vn_printf(vp, "vnode "); } } } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/sys/vnode.h Wed Aug 10 16:12:31 2016 (r303924) @@ -655,7 +655,6 @@ int vtruncbuf(struct vnode *vp, struct u int blksize); void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); -#define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp); int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/ufs/ffs/ffs_snapshot.c Wed Aug 10 16:12:31 2016 (r303924) @@ -558,7 +558,7 @@ loop: } VI_UNLOCK(xvp); if (snapdebug) - vprint("ffs_snapshot: busy vnode", xvp); + vn_printf(xvp, "ffs_snapshot: busy vnode "); if (VOP_GETATTR(xvp, &vat, td->td_ucred) == 0 && vat.va_nlink > 0) { VOP_UNLOCK(xvp, 0); Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/ufs/ffs/ffs_vnops.c Wed Aug 10 16:12:31 2016 (r303924) @@ -342,7 +342,7 @@ next: goto loop; #ifdef INVARIANTS if (!vn_isdisk(vp, NULL)) - vprint("ffs_fsync: dirty", vp); + vn_printf(vp, "ffs_fsync: dirty "); #endif } BO_UNLOCK(bo); Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/ufs/ufs/ufs_lookup.c Wed Aug 10 16:12:31 2016 (r303924) @@ -1136,7 +1136,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) - vprint("ufs_direnter: failed to truncate", dvp); + vn_printf(dvp, "ufs_direnter: failed to truncate "); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/ufs/ufs/ufs_quota.c Wed Aug 10 16:12:31 2016 (r303924) @@ -469,7 +469,7 @@ chkdquot(struct inode *ip) continue; if (ip->i_dquot[i] == NODQUOT) { UFS_UNLOCK(ump); - vprint("chkdquot: missing dquot", ITOV(ip)); + vn_printf(ITOV(ip), "chkdquot: missing dquot "); panic("chkdquot: missing dquot"); } } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Aug 10 15:45:25 2016 (r303923) +++ head/sys/vm/vm_object.c Wed Aug 10 16:12:31 2016 (r303924) @@ -471,7 +471,7 @@ vm_object_vndeallocate(vm_object_t objec KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); #ifdef INVARIANTS if (object->ref_count == 0) { - vprint("vm_object_vndeallocate", vp); + vn_printf(vp, "vm_object_vndeallocate "); panic("vm_object_vndeallocate: bad object reference count"); } #endif From owner-svn-src-head@freebsd.org Wed Aug 10 16:24:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B97BB4904; Wed, 10 Aug 2016 16:24:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96DE91712; Wed, 10 Aug 2016 16:24:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 50793B94B; Wed, 10 Aug 2016 12:24:17 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303887 - head/tools/tools/dmardump Date: Wed, 10 Aug 2016 06:44:13 -0700 Message-ID: <1854803.Mj8doirhqg@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160810074303.GC83214@kib.kiev.ua> References: <201608091906.u79J65Uq058283@repo.freebsd.org> <73543582.oU1jbu7riv@ralph.baldwin.cx> <20160810074303.GC83214@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 10 Aug 2016 12:24:17 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 16:24:18 -0000 On Wednesday, August 10, 2016 10:43:03 AM Konstantin Belousov wrote: > On Tue, Aug 09, 2016 at 02:22:36PM -0700, John Baldwin wrote: > > On Tuesday, August 09, 2016 07:06:05 PM John Baldwin wrote: > > > Author: jhb > > > Date: Tue Aug 9 19:06:05 2016 > > > New Revision: 303887 > > > URL: https://svnweb.freebsd.org/changeset/base/303887 > > > > > > Log: > > > Add a dmardump utility to dump the VT-d context tables. > > > > > > This tool parses the ACPI DMAR table looking for DMA remapping devices. > > > For each device it walks the root table and any context tables > > > referenced to display mapping info for PCI devices. > > > > > > Note that acpidump -t already parses the info in the ACPI DMAR tables > > > directly. This tool examines some of the data structures the DMAR > > > remapping engines use to translate DMA requests. > > > > > > Reviewed by: kib, grehan > > > MFC after: 1 month > > > Sponsored by: Chelsio Communications > > > Differential Revision: https://reviews.freebsd.org/D7444 > > > > I should have mentioned that this tool only supports "normal" context > > entry tables. It does not (yet) support extended context entry > > tables. However, neither bhyve nor ACPI_DMAR create extended context > > entry tables. > > I am not aware of existence of hardware supporting the extended context > entries. Even Skykale E3 v5 Xeons report ECS == 0. That's completely fair, I was just going by what was in the recent spec. I don't think it's worth implementing until anything actually uses it certainly. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Aug 10 17:19:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C1FBB5BE0; Wed, 10 Aug 2016 17:19:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09A21994; Wed, 10 Aug 2016 17:19:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AHJXaU056919; Wed, 10 Aug 2016 17:19:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AHJXYI056918; Wed, 10 Aug 2016 17:19:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608101719.u7AHJXYI056918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 10 Aug 2016 17:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303927 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 17:19:35 -0000 Author: tuexen Date: Wed Aug 10 17:19:33 2016 New Revision: 303927 URL: https://svnweb.freebsd.org/changeset/base/303927 Log: Improve a consistency check to not detect valid cases for unordered user messages using DATA chunks as invalid ones. While there, ensure that error causes are provided when sending ABORT chunks in case of reassembly problems detected. Thanks to Taylor Brandstetter for making me aware of this problem. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Aug 10 17:11:12 2016 (r303926) +++ head/sys/netinet/sctp_indata.c Wed Aug 10 17:19:33 2016 (r303927) @@ -1747,21 +1747,27 @@ sctp_process_a_data_chunk(struct sctp_tc * If its a fragmented message, lets see if we can find the control * on the reassembly queues. */ - if ((chtype == SCTP_IDATA) && ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && (fsn == 0)) { + if ((chtype == SCTP_IDATA) && + ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && + (fsn == 0)) { /* * The first *must* be fsn 0, and other (middle/end) pieces - * can *not* be fsn 0. + * can *not* be fsn 0. XXX: This can happen in case of a + * wrap around. Ignore is for now. */ + snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", + msg_id, chunk_flags); goto err_out; } + control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", + chunk_flags, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) { /* See if we can find the re-assembly entity */ - control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", - chunk_flags, control); - if (control) { + if (control != NULL) { /* We found something, does it belong? */ if (ordered && (msg_id != control->sinfo_ssn)) { + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", msg_id); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; @@ -1774,6 +1780,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched order with an * unordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1781,6 +1789,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched unordered with a * ordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } } @@ -1790,14 +1800,21 @@ sctp_process_a_data_chunk(struct sctp_tc * re-assembly going on with the same Stream/Seq (for * ordered) or in the same Stream for unordered. */ - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for msg in case we have dup\n", - chunk_flags); - if (sctp_find_reasm_entry(strm, msg_id, ordered, old_data)) { - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", - chunk_flags, - msg_id); - - goto err_out; + if (control != NULL) { + if (ordered || (old_data == 0)) { + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", + chunk_flags, msg_id); + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", msg_id); + goto err_out; + } else { + if ((tsn == control->fsn_included + 1) && + (control->end_added == 0)) { + snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + goto err_out; + } else { + control = NULL; + } + } } } /* now do the tests */ From owner-svn-src-head@freebsd.org Wed Aug 10 18:18:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C88C5BB501C; Wed, 10 Aug 2016 18:18:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC8C12D0; Wed, 10 Aug 2016 18:18:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIIql2079302; Wed, 10 Aug 2016 18:18:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIIqHZ079301; Wed, 10 Aug 2016 18:18:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101818.u7AIIqHZ079301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303928 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:18:53 -0000 Author: bdrewery Date: Wed Aug 10 18:18:51 2016 New Revision: 303928 URL: https://svnweb.freebsd.org/changeset/base/303928 Log: Trim out excessive / with -v when target directory ends with a trailing '/'. This is a minor nit after r289391 made all installations to a directory always end in a trailing '/'. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 17:19:33 2016 (r303927) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:18:51 2016 (r303928) @@ -749,8 +749,9 @@ install(const char *from_name, const cha } /* Build the target path. */ if (flags & DIRECTORY) { - (void)snprintf(pathbuf, sizeof(pathbuf), "%s/%s", + (void)snprintf(pathbuf, sizeof(pathbuf), "%s%s%s", to_name, + to_name[strlen(to_name) - 1] == '/' ? "" : "/", (p = strrchr(from_name, '/')) ? ++p : from_name); to_name = pathbuf; } From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D5ABB504A; Wed, 10 Aug 2016 18:19:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93EE31472; Wed, 10 Aug 2016 18:19:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJ2Ba079358; Wed, 10 Aug 2016 18:19:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJ2HE079357; Wed, 10 Aug 2016 18:19:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJ2HE079357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303929 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:03 -0000 Author: bdrewery Date: Wed Aug 10 18:19:02 2016 New Revision: 303929 URL: https://svnweb.freebsd.org/changeset/base/303929 Log: Fix -S with -b not atomically updating the destination file. With both of these flags, the backup was created via rename(dest, backup) followed by rename(tmp, dest). This left the destination file missing for a moment which contradicts the point of -S. This fixes a race with installworld where PRECIOUSPROG and PRECIOUSLIB files (which use -S for installation) would briefly be missing. In the case of installing rtld with parallel installworld it could render an error due to not having rtld present to run install/cp in another process. Reported by: jhb Reviewed by: jhb MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7451 Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:18:51 2016 (r303928) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:02 2016 (r303929) @@ -892,11 +892,17 @@ install(const char *from_name, const cha } if (verbose) (void)printf("install: %s -> %s\n", to_name, backup); - if (rename(to_name, backup) < 0) { + if (unlink(backup) < 0 && errno != ENOENT) { serrno = errno; unlink(tempfile); errno = serrno; - err(EX_OSERR, "rename: %s to %s", to_name, + err(EX_OSERR, "unlink: %s", backup); + } + if (link(to_name, backup) < 0) { + serrno = errno; + unlink(tempfile); + errno = serrno; + err(EX_OSERR, "link: %s to %s", to_name, backup); } } From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF7A6BB506F; Wed, 10 Aug 2016 18:19:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7CE147B; Wed, 10 Aug 2016 18:19:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJ5lr079404; Wed, 10 Aug 2016 18:19:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJ5nm079403; Wed, 10 Aug 2016 18:19:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJ5nm079403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303930 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:06 -0000 Author: bdrewery Date: Wed Aug 10 18:19:05 2016 New Revision: 303930 URL: https://svnweb.freebsd.org/changeset/base/303930 Log: Support -v for -l. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:02 2016 (r303929) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:05 2016 (r303930) @@ -533,6 +533,9 @@ do_link(const char *from_name, const cha if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); unlink(to_name); ret = rename(tmpl, to_name); /* @@ -543,8 +546,12 @@ do_link(const char *from_name, const cha (void)unlink(tmpl); } return (ret); - } else + } else { + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); return (link(from_name, to_name)); + } } /* @@ -575,12 +582,18 @@ do_symlink(const char *from_name, const ~NOCHANGEBITS); unlink(to_name); + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (rename(tmpl, to_name) == -1) { /* Remove temporary link before exiting. */ (void)unlink(tmpl); err(EX_OSERR, "%s: rename", to_name); } } else { + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (symlink(from_name, to_name) == -1) err(EX_OSERR, "symlink %s -> %s", from_name, to_name); } From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30195BB5090; Wed, 10 Aug 2016 18:19:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C844015B4; Wed, 10 Aug 2016 18:19:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJ8T5079449; Wed, 10 Aug 2016 18:19:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJ8TT079448; Wed, 10 Aug 2016 18:19:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJ8TT079448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303931 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:10 -0000 Author: bdrewery Date: Wed Aug 10 18:19:08 2016 New Revision: 303931 URL: https://svnweb.freebsd.org/changeset/base/303931 Log: Fix -S with -l not being atomic. It was unlinking the target even though it uses rename(2) which already effectively does that. -S is intended to not unlink(2) the target first. MFC after: 1 week Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7452 Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:05 2016 (r303930) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:08 2016 (r303931) @@ -536,7 +536,6 @@ do_link(const char *from_name, const cha if (verbose) printf("install: link %s -> %s\n", from_name, to_name); - unlink(to_name); ret = rename(tmpl, to_name); /* * If rename has posix semantics, then the temporary @@ -580,8 +579,6 @@ do_symlink(const char *from_name, const if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); - if (verbose) printf("install: symlink %s -> %s\n", from_name, to_name); From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16F56BB50E3; Wed, 10 Aug 2016 18:19:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A70161757; Wed, 10 Aug 2016 18:19:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJEdH079544; Wed, 10 Aug 2016 18:19:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJEZ8079543; Wed, 10 Aug 2016 18:19:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJEZ8079543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303933 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:16 -0000 Author: bdrewery Date: Wed Aug 10 18:19:14 2016 New Revision: 303933 URL: https://svnweb.freebsd.org/changeset/base/303933 Log: Squelch a false-positive Clang static analyzer warning. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:11 2016 (r303932) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:14 2016 (r303933) @@ -149,6 +149,7 @@ main(int argc, char *argv[]) char *p; const char *to_name; + fset = 0; iflags = 0; group = owner = NULL; while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 253E9BB50BC; Wed, 10 Aug 2016 18:19:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6971670; Wed, 10 Aug 2016 18:19:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJBlJ079499; Wed, 10 Aug 2016 18:19:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJBvU079498; Wed, 10 Aug 2016 18:19:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJBvU079498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303932 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:13 -0000 Author: bdrewery Date: Wed Aug 10 18:19:11 2016 New Revision: 303932 URL: https://svnweb.freebsd.org/changeset/base/303932 Log: Fix -b failure not restoring flags on the destination file. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:08 2016 (r303931) +++ head/usr.bin/xinstall/xinstall.c Wed Aug 10 18:19:11 2016 (r303932) @@ -904,6 +904,8 @@ install(const char *from_name, const cha (void)printf("install: %s -> %s\n", to_name, backup); if (unlink(backup) < 0 && errno != ENOENT) { serrno = errno; + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); unlink(tempfile); errno = serrno; err(EX_OSERR, "unlink: %s", backup); @@ -911,6 +913,8 @@ install(const char *from_name, const cha if (link(to_name, backup) < 0) { serrno = errno; unlink(tempfile); + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); errno = serrno; err(EX_OSERR, "link: %s to %s", to_name, backup); @@ -1133,16 +1137,26 @@ create_newfile(const char *path, int tar if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", - path, suffix) != strlen(path) + strlen(suffix)) + path, suffix) != strlen(path) + strlen(suffix)) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; errx(EX_OSERR, "%s: backup filename too long", path); + } (void)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix); if (verbose) (void)printf("install: %s -> %s\n", path, backup); - if (rename(path, backup) < 0) + if (rename(path, backup) < 0) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; err(EX_OSERR, "rename: %s to %s", path, backup); + } } else if (unlink(path) < 0) saved_errno = errno; From owner-svn-src-head@freebsd.org Wed Aug 10 18:19:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38798BB5101; Wed, 10 Aug 2016 18:19:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEE9D185C; Wed, 10 Aug 2016 18:19:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIJHbx079590; Wed, 10 Aug 2016 18:19:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIJHIh079589; Wed, 10 Aug 2016 18:19:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101819.u7AIJHIh079589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303934 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:19:19 -0000 Author: bdrewery Date: Wed Aug 10 18:19:17 2016 New Revision: 303934 URL: https://svnweb.freebsd.org/changeset/base/303934 Log: Support rmdir(2). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 10 18:19:14 2016 (r303933) +++ head/usr.bin/truss/syscalls.c Wed Aug 10 18:19:17 2016 (r303934) @@ -279,6 +279,8 @@ static struct syscall decoded_syscalls[] .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, From owner-svn-src-head@freebsd.org Wed Aug 10 18:22:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BDCBBB5367; Wed, 10 Aug 2016 18:22:43 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C43C11EA; Wed, 10 Aug 2016 18:22:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIMgJC083014; Wed, 10 Aug 2016 18:22:42 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIMgsx083013; Wed, 10 Aug 2016 18:22:42 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201608101822.u7AIMgsx083013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 10 Aug 2016 18:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303935 - 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.22 Precedence: list List-Id: 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, 10 Aug 2016 18:22:43 -0000 Author: lwhsu (ports committer) Date: Wed Aug 10 18:22:42 2016 New Revision: 303935 URL: https://svnweb.freebsd.org/changeset/base/303935 Log: Only remove empty directories before packaging. This preserves files are intentionally empty, most of them are in tests.txz Reviewed by: bdrewery MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Aug 10 18:19:17 2016 (r303934) +++ head/Makefile.inc1 Wed Aug 10 18:22:42 2016 (r303935) @@ -1013,7 +1013,7 @@ distributeworld installworld stageworld: ${IMAKEENV} rm -rf ${INSTALLTMP} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} - find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete + find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete .endfor .if defined(NO_ROOT) .for dist in base ${EXTRA_DISTRIBUTIONS} From owner-svn-src-head@freebsd.org Wed Aug 10 18:23:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BB0DBB53C7; Wed, 10 Aug 2016 18:23:24 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E74B137A; Wed, 10 Aug 2016 18:23:24 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AINNai083081; Wed, 10 Aug 2016 18:23:23 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AINNgx083080; Wed, 10 Aug 2016 18:23:23 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201608101823.u7AINNgx083080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 10 Aug 2016 18:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303936 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:23:24 -0000 Author: stevek Date: Wed Aug 10 18:23:23 2016 New Revision: 303936 URL: https://svnweb.freebsd.org/changeset/base/303936 Log: Add kernel environment variables under smbios.system for the following SMBIOS Type 1 fields: smbios.system.sku - SKU Number (SMBIOS 2.4 and above) smbios.system.family - Family (SMBIOS 2.4 and above) Add kernel environment variables under smbios.planar for the following SMBIOS Type 2 fields: smbios.planar.tag - Asset Tag smbios.planar.location - Location in Chassis Reviewed by: jhb, grembo Approved by: sjg (mentor) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D7453 Modified: head/sys/boot/i386/libi386/smbios.c Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Wed Aug 10 18:22:42 2016 (r303935) +++ head/sys/boot/i386/libi386/smbios.c Wed Aug 10 18:23:23 2016 (r303936) @@ -238,6 +238,10 @@ smbios_parse_table(const caddr_t addr) smbios_setenv("smbios.system.serial", addr, 0x07); smbios_setuuid("smbios.system.uuid", addr + 0x08, smbios.ver); #endif + if (smbios.major >= 2 && smbios.minor >= 4) { + smbios_setenv("smbios.system.sku", addr, 0x19); + smbios_setenv("smbios.system.family", addr, 0x1a); + } break; case 2: /* 3.3.3 Base Board (or Module) Information (Type 2) */ @@ -246,7 +250,9 @@ smbios_parse_table(const caddr_t addr) smbios_setenv("smbios.planar.version", addr, 0x06); #ifdef SMBIOS_SERIAL_NUMBERS smbios_setenv("smbios.planar.serial", addr, 0x07); + smbios_setenv("smbios.planar.tag", addr, 0x08); #endif + smbios_setenv("smbios.planar.location", addr, 0x0a); break; case 3: /* 3.3.4 System Enclosure or Chassis (Type 3) */ From owner-svn-src-head@freebsd.org Wed Aug 10 18:41:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF03BB587B; Wed, 10 Aug 2016 18:41:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D639B1D39; Wed, 10 Aug 2016 18:41:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7AIf27M009541 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 10 Aug 2016 21:41:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7AIf27M009541 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7AIf2xo009540; Wed, 10 Aug 2016 21:41:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Aug 2016 21:41:02 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303934 - head/usr.bin/truss Message-ID: <20160810184102.GW83214@kib.kiev.ua> References: <201608101819.u7AIJHIh079589@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608101819.u7AIJHIh079589@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:41:13 -0000 On Wed, Aug 10, 2016 at 06:19:17PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Aug 10 18:19:17 2016 > New Revision: 303934 > URL: https://svnweb.freebsd.org/changeset/base/303934 > > Log: > Support rmdir(2). > > MFC after: 3 days > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.bin/truss/syscalls.c > > Modified: head/usr.bin/truss/syscalls.c > ============================================================================== > --- head/usr.bin/truss/syscalls.c Wed Aug 10 18:19:14 2016 (r303933) > +++ head/usr.bin/truss/syscalls.c Wed Aug 10 18:19:17 2016 (r303934) > @@ -279,6 +279,8 @@ static struct syscall decoded_syscalls[] > .args = { { Name, 0 }, { Name, 1 } } }, > { .name = "renameat", .ret_type = 1, .nargs = 4, > .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, > + { .name = "rmdir", .ret_type = 1, .nargs = 2, > + .args = { { Name, 0 }, { Octal, 1 } } }, I do not quite follow this. The table format is that nargs is the number of arguments to the syscall, and args describe each syscall' argument, are my assumptions right ? If yes, what is the second rmdir(2) argument for ? > { .name = "rfork", .ret_type = 1, .nargs = 1, > .args = { { Rforkflags, 0 } } }, > { .name = "select", .ret_type = 1, .nargs = 5, From owner-svn-src-head@freebsd.org Wed Aug 10 18:44:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF35ABB59F8; Wed, 10 Aug 2016 18:44:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1E113BC; Wed, 10 Aug 2016 18:44:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 87B561CBE; Wed, 10 Aug 2016 18:44:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4C8C223D8B; Wed, 10 Aug 2016 18:44:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id kE1WfGJNEmuE; Wed, 10 Aug 2016 18:44:48 +0000 (UTC) Subject: Re: svn commit: r303934 - head/usr.bin/truss DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6783623D83 To: Konstantin Belousov References: <201608101819.u7AIJHIh079589@repo.freebsd.org> <20160810184102.GW83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <1114effc-e527-923d-b6fe-c6dda2f8407c@FreeBSD.org> Date: Wed, 10 Aug 2016 11:44:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160810184102.GW83214@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CcR3ANKfps1DDAGP0FkL6XVmlX6iSR5Og" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:44:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CcR3ANKfps1DDAGP0FkL6XVmlX6iSR5Og Content-Type: multipart/mixed; boundary="T0EUKiFDXB7gxSunFUGudXqBwc8tp8FDp" From: Bryan Drewery To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1114effc-e527-923d-b6fe-c6dda2f8407c@FreeBSD.org> Subject: Re: svn commit: r303934 - head/usr.bin/truss References: <201608101819.u7AIJHIh079589@repo.freebsd.org> <20160810184102.GW83214@kib.kiev.ua> In-Reply-To: <20160810184102.GW83214@kib.kiev.ua> --T0EUKiFDXB7gxSunFUGudXqBwc8tp8FDp Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/10/16 11:41 AM, Konstantin Belousov wrote: > On Wed, Aug 10, 2016 at 06:19:17PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Wed Aug 10 18:19:17 2016 >> New Revision: 303934 >> URL: https://svnweb.freebsd.org/changeset/base/303934 >> >> Log: >> Support rmdir(2). >> =20 >> MFC after: 3 days >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/usr.bin/truss/syscalls.c >> >> Modified: head/usr.bin/truss/syscalls.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/usr.bin/truss/syscalls.c Wed Aug 10 18:19:14 2016 (r303933) >> +++ head/usr.bin/truss/syscalls.c Wed Aug 10 18:19:17 2016 (r303934) >> @@ -279,6 +279,8 @@ static struct syscall decoded_syscalls[] >> .args =3D { { Name, 0 }, { Name, 1 } } }, >> { .name =3D "renameat", .ret_type =3D 1, .nargs =3D 4, >> .args =3D { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }= , >> + { .name =3D "rmdir", .ret_type =3D 1, .nargs =3D 2, >> + .args =3D { { Name, 0 }, { Octal, 1 } } }, > I do not quite follow this. The table format is that nargs is the numb= er > of arguments to the syscall, and args describe each syscall' argument, > are my assumptions right ? >=20 > If yes, what is the second rmdir(2) argument for ? You're right, it's a bug. I had copied the wrong syscall and missed this= =2E Fixing it, thanks. >=20 >> { .name =3D "rfork", .ret_type =3D 1, .nargs =3D 1, >> .args =3D { { Rforkflags, 0 } } }, >> { .name =3D "select", .ret_type =3D 1, .nargs =3D 5, --=20 Regards, Bryan Drewery --T0EUKiFDXB7gxSunFUGudXqBwc8tp8FDp-- --CcR3ANKfps1DDAGP0FkL6XVmlX6iSR5Og Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXq3YeAAoJEDXXcbtuRpfPPXcIAJ3kNKJN+EJVrxYL3Q4a2Mnm qrx0vo1YMRf6gv0Rjn8jR3WlBeGQHQu8G2EgOhw898ryAriGBzwomPx5UTMYFcbU X9JC8ySksL42cE3K+L5knSXwsjbNU0OFsCIWsLf/8iyYkdheHRd5xvqk0PusTQGO mcZEAXdqdknp/ryRW6og87xl88j8LpPgmUWd/tYfQLf7YKOXOzGZxAu/Fe2Mlf38 7LTWqi2JnhKDHFJ/hkC2WL1Mjy3/6X1yrcE9vZvDB5rN/A0wLbGMPw6yJ9+tiZa5 TD61LjFMBbWHCBfQiMDTSHvcHkuf8rSYpXX+tglwq7ZmA4H86O6DRNhh4EHVIgs= =kwuD -----END PGP SIGNATURE----- --CcR3ANKfps1DDAGP0FkL6XVmlX6iSR5Og-- From owner-svn-src-head@freebsd.org Wed Aug 10 18:45:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41960BB5A4E; Wed, 10 Aug 2016 18:45:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E65815B7; Wed, 10 Aug 2016 18:45:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AIjRCw090698; Wed, 10 Aug 2016 18:45:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AIjRYq090697; Wed, 10 Aug 2016 18:45:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608101845.u7AIjRYq090697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 18:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303937 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 18:45:28 -0000 Author: bdrewery Date: Wed Aug 10 18:45:26 2016 New Revision: 303937 URL: https://svnweb.freebsd.org/changeset/base/303937 Log: Use proper argument length for rmdir(2) for r303934. Reported by: kib X-MFC-With: r303934 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 10 18:23:23 2016 (r303936) +++ head/usr.bin/truss/syscalls.c Wed Aug 10 18:45:26 2016 (r303937) @@ -279,8 +279,8 @@ static struct syscall decoded_syscalls[] .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, - { .name = "rmdir", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 }, { Octal, 1 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 1, + .args = { { Name, 0 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, From owner-svn-src-head@freebsd.org Wed Aug 10 21:02:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28BE3BB54C6; Wed, 10 Aug 2016 21:02:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E74DD1838; Wed, 10 Aug 2016 21:02:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7AL2hMN042911; Wed, 10 Aug 2016 21:02:43 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7AL2grL042900; Wed, 10 Aug 2016 21:02:42 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608102102.u7AL2grL042900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 10 Aug 2016 21:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303941 - in head/sys: amd64/cloudabi64 arm64/cloudabi64 compat/cloudabi compat/cloudabi64 conf modules/cloudabi modules/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 21:02:44 -0000 Author: ed Date: Wed Aug 10 21:02:41 2016 New Revision: 303941 URL: https://svnweb.freebsd.org/changeset/base/303941 Log: Provide the CloudABI vDSO to its executables. CloudABI executables already provide support for passing in vDSOs. This functionality is used by the emulator for OS X to inject system call handlers. On FreeBSD, we could use it to optimize calls to gettimeofday(), etc. Though I don't have any plans to optimize any system calls right now, let's go ahead and already pass in a vDSO. This will allow us to simplify the executables, as the traditional "syscall" shims can be removed entirely. It also means that we gain more flexibility with regards to adding and removing system calls. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D7438 Added: head/sys/compat/cloudabi/cloudabi_vdso.c (contents, props changed) head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s - copied, changed from r303816, head/sys/amd64/linux/linux_vdso.lds.s Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/cloudabi/cloudabi_util.h head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm64 head/sys/modules/cloudabi/Makefile head/sys/modules/cloudabi64/Makefile Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 10 21:02:41 2016 (r303941) @@ -196,7 +196,6 @@ static struct sysentvec cloudabi64_elf_s .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi64_copyout_strings, .sv_setregs = cloudabi64_proc_setregs, Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 10 21:02:41 2016 (r303941) @@ -165,7 +165,6 @@ static struct sysentvec cloudabi64_elf_s .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi64_copyout_strings, .sv_setregs = cloudabi64_proc_setregs, Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/compat/cloudabi/cloudabi_util.h Wed Aug 10 21:02:41 2016 (r303941) @@ -33,6 +33,7 @@ #include struct file; +struct sysentvec; struct thread; struct timespec; @@ -76,4 +77,8 @@ int cloudabi_futex_lock_wrlock(struct th cloudabi_scope_t, cloudabi_clockid_t, cloudabi_timestamp_t, cloudabi_timestamp_t); +/* vDSO setup and teardown. */ +void cloudabi_vdso_init(struct sysentvec *, char *, char *); +void cloudabi_vdso_destroy(struct sysentvec *); + #endif Added: head/sys/compat/cloudabi/cloudabi_vdso.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi/cloudabi_vdso.c Wed Aug 10 21:02:41 2016 (r303941) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2016 Nuxi, https://nuxi.nl/ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +void +cloudabi_vdso_init(struct sysentvec *sv, char *begin, char *end) +{ + vm_page_t m; + vm_object_t obj; + vm_offset_t addr; + size_t i, pages, pages_length, vdso_length; + + /* Determine the number of pages needed to store the vDSO. */ + vdso_length = end - begin; + pages = howmany(vdso_length, PAGE_SIZE); + pages_length = pages * PAGE_SIZE; + + /* Allocate a VM object and fill it with the vDSO. */ + obj = vm_pager_allocate(OBJT_PHYS, 0, pages_length, + VM_PROT_DEFAULT, 0, NULL); + addr = kva_alloc(PAGE_SIZE); + for (i = 0; i < pages; ++i) { + VM_OBJECT_WLOCK(obj); + m = vm_page_grab(obj, i, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO); + m->valid = VM_PAGE_BITS_ALL; + VM_OBJECT_WUNLOCK(obj); + + pmap_qenter(addr, &m, 1); + memcpy((void *)addr, begin + i * PAGE_SIZE, + MIN(vdso_length - i * PAGE_SIZE, PAGE_SIZE)); + pmap_qremove(addr, 1); + } + kva_free(addr, PAGE_SIZE); + + /* + * Place the vDSO at the top of the address space. The user + * stack can start right below it. + */ + sv->sv_shared_page_base = sv->sv_maxuser - pages_length; + sv->sv_shared_page_len = pages_length; + sv->sv_shared_page_obj = obj; + sv->sv_usrstack = sv->sv_shared_page_base; +} + +void +cloudabi_vdso_destroy(struct sysentvec *sv) +{ + + vm_object_deallocate(sv->sv_shared_page_obj); +} Modified: head/sys/compat/cloudabi64/cloudabi64_module.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/compat/cloudabi64/cloudabi64_module.c Wed Aug 10 21:02:41 2016 (r303941) @@ -38,8 +38,13 @@ __FBSDID("$FreeBSD$"); #include +#include + #include +extern char _binary_cloudabi64_vdso_o_start[]; +extern char _binary_cloudabi64_vdso_o_end[]; + register_t * cloudabi64_copyout_strings(struct image_params *imgp) { @@ -107,6 +112,8 @@ cloudabi64_fixup(register_t **stack_base PTR(CLOUDABI_AT_PHDR, args->phdr), VAL(CLOUDABI_AT_PHNUM, args->phnum), VAL(CLOUDABI_AT_TID, td->td_tid), + PTR(CLOUDABI_AT_SYSINFO_EHDR, + imgp->proc->p_sysent->sv_shared_page_base), #undef VAL #undef PTR { .a_type = CLOUDABI_AT_NULL }, @@ -127,6 +134,9 @@ cloudabi64_modevent(module_t mod, int ty switch (type) { case MOD_LOAD: + cloudabi_vdso_init(cloudabi64_brand.sysvec, + _binary_cloudabi64_vdso_o_start, + _binary_cloudabi64_vdso_o_end); if (elf64_insert_brand_entry(&cloudabi64_brand) < 0) { printf("Failed to add CloudABI ELF brand handler\n"); return (EINVAL); @@ -139,6 +149,7 @@ cloudabi64_modevent(module_t mod, int ty printf("Failed to remove CloudABI ELF brand handler\n"); return (EINVAL); } + cloudabi_vdso_destroy(cloudabi64_brand.sysvec); return (0); default: return (EOPNOTSUPP); Copied and modified: head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s (from r303816, head/sys/amd64/linux/linux_vdso.lds.s) ============================================================================== --- head/sys/amd64/linux/linux_vdso.lds.s Sun Aug 7 18:12:36 2016 (r303816, copy source) +++ head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s Wed Aug 10 21:02:41 2016 (r303941) @@ -1,6 +1,6 @@ /* - * Linker script for 64-bit vDSO. - * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S + * Linker script for 64-bit vDSO for CloudABI. + * Based on sys/amd64/linux/linux_vdso.lds.s * * $FreeBSD$ */ @@ -49,21 +49,3 @@ PHDRS note PT_NOTE FLAGS(4); /* PF_R */ eh_frame_hdr PT_GNU_EH_FRAME; } - -VERSION -{ - LINUX_2.6 { - global: - time; - __vdso_time; - gettimeofday; - __vdso_gettimeofday; - getcpu; - __vdso_getcpu; - clock_gettime; - __vdso_clock_gettime; - linux_rt_sigcode; - linux_platform; - local: *; - }; -} Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/conf/files Wed Aug 10 21:02:41 2016 (r303941) @@ -284,6 +284,7 @@ compat/cloudabi/cloudabi_proc.c optiona compat/cloudabi/cloudabi_random.c optional compat_cloudabi64 compat/cloudabi/cloudabi_sock.c optional compat_cloudabi64 compat/cloudabi/cloudabi_thread.c optional compat_cloudabi64 +compat/cloudabi/cloudabi_vdso.c optional compat_cloudabi64 compat/cloudabi64/cloudabi64_fd.c optional compat_cloudabi64 compat/cloudabi64/cloudabi64_module.c optional compat_cloudabi64 compat/cloudabi64/cloudabi64_poll.c optional compat_cloudabi64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/conf/files.amd64 Wed Aug 10 21:02:41 2016 (r303941) @@ -8,6 +8,18 @@ # dependency lines other than the first are silently ignored. # # +cloudabi64_vdso.o optional compat_cloudabi64 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.c" \ + compile-with "${CC} -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s -D_KERNEL -I. -I$S -I$S/contrib/cloudabi -O2 -fomit-frame-pointer $S/contrib/cloudabi/cloudabi_vdso_x86_64.c -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi64_vdso.o" +# +cloudabi64_vdso_blob.o optional compat_cloudabi64 \ + dependency "cloudabi64_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 cloudabi64_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi64_vdso_blob.o" +# linux32_genassym.o optional compat_linux32 \ dependency "$S/amd64/linux32/linux32_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/conf/files.arm64 Wed Aug 10 21:02:41 2016 (r303941) @@ -1,4 +1,16 @@ # $FreeBSD$ +cloudabi64_vdso.o optional compat_cloudabi64 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_aarch64.c" \ + compile-with "${CC} -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s -D_KERNEL -I. -I$S -I$S/contrib/cloudabi -O2 -fomit-frame-pointer $S/contrib/cloudabi/cloudabi_vdso_aarch64.c -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi64_vdso.o" +# +cloudabi64_vdso_blob.o optional compat_cloudabi64 \ + dependency "cloudabi64_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi64_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi64_vdso_blob.o" +# arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt Modified: head/sys/modules/cloudabi/Makefile ============================================================================== --- head/sys/modules/cloudabi/Makefile Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/modules/cloudabi/Makefile Wed Aug 10 21:02:41 2016 (r303941) @@ -5,6 +5,6 @@ KMOD= cloudabi SRCS= cloudabi_clock.c cloudabi_errno.c cloudabi_fd.c cloudabi_file.c \ cloudabi_futex.c cloudabi_mem.c cloudabi_proc.c cloudabi_random.c \ - cloudabi_sock.c cloudabi_thread.c vnode_if.h + cloudabi_sock.c cloudabi_thread.c cloudabi_vdso.c vnode_if.h .include Modified: head/sys/modules/cloudabi64/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Wed Aug 10 20:34:25 2016 (r303940) +++ head/sys/modules/cloudabi64/Makefile Wed Aug 10 21:02:41 2016 (r303941) @@ -1,11 +1,39 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../compat/cloudabi64 -.PATH: ${.CURDIR}/../../${MACHINE}/cloudabi64 +SYSDIR?=${.CURDIR}/../.. + +.PATH: ${SYSDIR}/compat/cloudabi64 +.PATH: ${SYSDIR}/${MACHINE}/cloudabi64 KMOD= cloudabi64 SRCS= cloudabi64_fd.c cloudabi64_module.c cloudabi64_poll.c \ cloudabi64_sock.c cloudabi64_syscalls.c cloudabi64_sysent.c \ cloudabi64_sysvec.c cloudabi64_thread.c +OBJS= cloudabi64_vdso_blob.o +CLEANFILES=cloudabi64_vdso.o + +.if ${MACHINE_CPUARCH} == "aarch64" +VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_aarch64.c +OUTPUT_TARGET=elf64-littleaarch64 +BINARY_ARCHITECTURE=aarch64 +.elif ${MACHINE_CPUARCH} == "amd64" +VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_x86_64.c +OUTPUT_TARGET=elf64-x86-64-freebsd +BINARY_ARCHITECTURE=i386 +.endif + +cloudabi64_vdso.o: ${VDSO_SRCS} + ${CC} -shared -nostdinc -nostdlib \ + -Wl,-T${SYSDIR}/compat/cloudabi64/cloudabi64_vdso.lds.s \ + -D_KERNEL -I. -I${SYSDIR} -I${SYSDIR}/contrib/cloudabi \ + -O2 -fomit-frame-pointer \ + ${VDSO_SRCS} -o ${.TARGET} + +cloudabi64_vdso_blob.o: cloudabi64_vdso.o + ${OBJCOPY} --input-target binary \ + --output-target ${OUTPUT_TARGET} \ + --binary-architecture ${BINARY_ARCHITECTURE} \ + cloudabi64_vdso.o ${.TARGET} + .include From owner-svn-src-head@freebsd.org Wed Aug 10 22:00:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64626BB5049; Wed, 10 Aug 2016 22:00:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34842143C; Wed, 10 Aug 2016 22:00:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ALxxVh061555; Wed, 10 Aug 2016 21:59:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ALxxv6061554; Wed, 10 Aug 2016 21:59:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608102159.u7ALxxv6061554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Aug 2016 21:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303942 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 22:00:00 -0000 Author: bdrewery Date: Wed Aug 10 21:59:59 2016 New Revision: 303942 URL: https://svnweb.freebsd.org/changeset/base/303942 Log: Fix sorting in r303934. Reported by: jhb X-MFC-With: r303934 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 10 21:02:41 2016 (r303941) +++ head/usr.bin/truss/syscalls.c Wed Aug 10 21:59:59 2016 (r303942) @@ -279,10 +279,10 @@ static struct syscall decoded_syscalls[] .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, - { .name = "rmdir", .ret_type = 1, .nargs = 1, - .args = { { Name, 0 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 1, + .args = { { Name, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, From owner-svn-src-head@freebsd.org Wed Aug 10 23:24:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6712BB5071; Wed, 10 Aug 2016 23:24:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 797E11808; Wed, 10 Aug 2016 23:24:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ANOLRA094158; Wed, 10 Aug 2016 23:24:21 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ANOLZ1094157; Wed, 10 Aug 2016 23:24:21 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201608102324.u7ANOLZ1094157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 10 Aug 2016 23:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303943 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 10 Aug 2016 23:24:22 -0000 Author: dteske Date: Wed Aug 10 23:24:21 2016 New Revision: 303943 URL: https://svnweb.freebsd.org/changeset/base/303943 Log: Allow enforce_statfs (see jail(8)) to be set per jail Reviewed by: jelischer MFC after: 3 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Aug 10 21:59:59 2016 (r303942) +++ head/etc/rc.d/jail Wed Aug 10 23:24:21 2016 (r303943) @@ -260,6 +260,7 @@ parse_options() extract_var $_jv set_hostname_allow allow.set_hostname YN NO extract_var $_jv sysvipc_allow allow.sysvipc YN NO + extract_var $_jv enforce_statfs enforce_statfs - 2 extract_var $_jv osreldate osreldate extract_var $_jv osrelease osrelease for _p in $_parameters; do From owner-svn-src-head@freebsd.org Thu Aug 11 03:12:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 109F5BB579A; Thu, 11 Aug 2016 03:12:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF0E6188D; Thu, 11 Aug 2016 03:12:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B3CvmO080219; Thu, 11 Aug 2016 03:12:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B3CvpQ080218; Thu, 11 Aug 2016 03:12:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608110312.u7B3CvpQ080218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 11 Aug 2016 03:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303944 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 03:12:58 -0000 Author: sephe Date: Thu Aug 11 03:12:56 2016 New Revision: 303944 URL: https://svnweb.freebsd.org/changeset/base/303944 Log: cam/da: Add quirk for I-O Data USB Flash Disk PR: 211716 Submitted by: Jun Su Reported by: Jun Su MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Aug 10 23:24:21 2016 (r303943) +++ head/sys/cam/scsi/scsi_da.c Thu Aug 11 03:12:56 2016 (r303944) @@ -814,6 +814,14 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*", "*"}, /*quirks*/ DA_Q_NO_RC16 }, + { + /* + * I-O Data USB Flash Disk + * PR: usb/211716 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "I-O DATA", "USB Flash Disk*", + "*"}, /*quirks*/ DA_Q_NO_RC16 + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ From owner-svn-src-head@freebsd.org Thu Aug 11 03:20:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B856CBB5ADF; Thu, 11 Aug 2016 03:20:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0731C58; Thu, 11 Aug 2016 03:20:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B3KcDZ081261; Thu, 11 Aug 2016 03:20:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B3KcAE081260; Thu, 11 Aug 2016 03:20:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608110320.u7B3KcAE081260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 11 Aug 2016 03:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303945 - head/sys/dev/hyperv/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.22 Precedence: list List-Id: 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, 11 Aug 2016 03:20:39 -0000 Author: sephe Date: Thu Aug 11 03:20:38 2016 New Revision: 303945 URL: https://svnweb.freebsd.org/changeset/base/303945 Log: hyperv/vmbus: Add macro to get channel packet data length. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7455 Modified: head/sys/dev/hyperv/include/vmbus.h Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Thu Aug 11 03:12:56 2016 (r303944) +++ head/sys/dev/hyperv/include/vmbus.h Thu Aug 11 03:20:38 2016 (r303945) @@ -89,6 +89,11 @@ struct vmbus_chanpkt_hdr { (const void *)((const uint8_t *)(pkt) + \ VMBUS_CHANPKT_GETLEN((pkt)->cph_hlen)) +/* Include padding */ +#define VMBUS_CHANPKT_DATALEN(pkt) \ + (VMBUS_CHANPKT_GETLEN((pkt)->cph_tlen) -\ + VMBUS_CHANPKT_GETLEN((pkt)->cph_hlen)) + struct vmbus_rxbuf_desc { uint32_t rb_len; uint32_t rb_ofs; From owner-svn-src-head@freebsd.org Thu Aug 11 05:18:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8ADBB5B5E; Thu, 11 Aug 2016 05:18:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830921624; Thu, 11 Aug 2016 05:18:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B5I9bY024438; Thu, 11 Aug 2016 05:18:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B5I93w024437; Thu, 11 Aug 2016 05:18:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608110518.u7B5I93w024437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Aug 2016 05:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303946 - in head/usr.bin: kdump truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 05:18:10 -0000 Author: jhb Date: Thu Aug 11 05:18:09 2016 New Revision: 303946 URL: https://svnweb.freebsd.org/changeset/base/303946 Log: Remove files unused after pulling system call names from libsysdecode. Deleted: head/usr.bin/kdump/linux32_syscalls.conf head/usr.bin/kdump/linux_syscalls.conf head/usr.bin/truss/makesyscallsconf.sh From owner-svn-src-head@freebsd.org Thu Aug 11 05:49:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF3EBB61C2; Thu, 11 Aug 2016 05:49:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6A9815E2; Thu, 11 Aug 2016 05:49:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B5noo2035771; Thu, 11 Aug 2016 05:49:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B5nnLc035766; Thu, 11 Aug 2016 05:49:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608110549.u7B5nnLc035766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 11 Aug 2016 05:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303947 - in head/sys: conf dev/hyperv/include dev/hyperv/vmbus modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 05:49:51 -0000 Author: sephe Date: Thu Aug 11 05:49:49 2016 New Revision: 303947 URL: https://svnweb.freebsd.org/changeset/base/303947 Log: hyperv/vmbus: Add APIs for various types of transactions. Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7456 Added: head/sys/dev/hyperv/include/vmbus_xact.h (contents, props changed) head/sys/dev/hyperv/vmbus/vmbus_xact.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Aug 11 05:18:09 2016 (r303946) +++ head/sys/conf/files.amd64 Thu Aug 11 05:49:49 2016 (r303947) @@ -294,6 +294,7 @@ dev/hyperv/vmbus/vmbus_br.c optional dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/vmbus_if.m optional hyperv +dev/hyperv/vmbus/vmbus_xact.c optional hyperv dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Aug 11 05:18:09 2016 (r303946) +++ head/sys/conf/files.i386 Thu Aug 11 05:49:49 2016 (r303947) @@ -253,6 +253,7 @@ dev/hyperv/vmbus/vmbus_br.c optional dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/vmbus_if.m optional hyperv +dev/hyperv/vmbus/vmbus_xact.c optional hyperv dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd Added: head/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/include/vmbus_xact.h Thu Aug 11 05:49:49 2016 (r303947) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMBUS_XACT_H_ +#define _VMBUS_XACT_H_ + +#include +#include + +struct vmbus_xact; +struct vmbus_xact_ctx; + +struct vmbus_xact_ctx *vmbus_xact_ctx_create(bus_dma_tag_t dtag, + size_t req_size, size_t resp_size); +void vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx); +struct vmbus_xact *vmbus_xact_get(struct vmbus_xact_ctx *ctx, + size_t req_len); +void vmbus_xact_put(struct vmbus_xact *xact); + +void *vmbus_xact_req_data(const struct vmbus_xact *xact); +bus_addr_t vmbus_xact_req_paddr(const struct vmbus_xact *xact); +void vmbus_xact_activate(struct vmbus_xact *xact); +void vmbus_xact_deactivate(struct vmbus_xact *xact); +const void *vmbus_xact_wait(struct vmbus_xact *xact, + size_t *resp_len); +void vmbus_xact_wakeup(struct vmbus_xact *xact, + const void *data, size_t dlen); + +#endif /* !_VMBUS_XACT_H_ */ Added: head/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Aug 11 05:49:49 2016 (r303947) @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +struct vmbus_xact { + struct vmbus_xact_ctx *x_ctx; + + void *x_req; + struct hyperv_dma x_req_dma; + + const void *x_resp; + size_t x_resp_len; + void *x_resp0; +}; + +struct vmbus_xact_ctx { + uint32_t xc_flags; + size_t xc_req_size; + size_t xc_resp_size; + + struct vmbus_xact *xc_free; + struct mtx xc_free_lock; + + struct vmbus_xact *xc_active; + struct mtx xc_active_lock; +}; + +#define VMBUS_XACT_CTXF_DESTROY 0x0001 + +static struct vmbus_xact *vmbus_xact_alloc(struct vmbus_xact_ctx *, + bus_dma_tag_t); +static void vmbus_xact_free(struct vmbus_xact *); +static struct vmbus_xact *vmbus_xact_get1(struct vmbus_xact_ctx *, + uint32_t); + +static struct vmbus_xact * +vmbus_xact_alloc(struct vmbus_xact_ctx *ctx, bus_dma_tag_t parent_dtag) +{ + struct vmbus_xact *xact; + + xact = malloc(sizeof(*xact), M_DEVBUF, M_WAITOK | M_ZERO); + xact->x_ctx = ctx; + + /* XXX assume that page aligned is enough */ + xact->x_req = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + ctx->xc_req_size, &xact->x_req_dma, BUS_DMA_WAITOK); + if (xact->x_req == NULL) { + free(xact, M_DEVBUF); + return (NULL); + } + xact->x_resp0 = malloc(ctx->xc_resp_size, M_DEVBUF, M_WAITOK); + + return (xact); +} + +static void +vmbus_xact_free(struct vmbus_xact *xact) +{ + + hyperv_dmamem_free(&xact->x_req_dma, xact->x_req); + free(xact->x_resp0, M_DEVBUF); + free(xact, M_DEVBUF); +} + +static struct vmbus_xact * +vmbus_xact_get1(struct vmbus_xact_ctx *ctx, uint32_t dtor_flag) +{ + struct vmbus_xact *xact; + + mtx_lock(&ctx->xc_free_lock); + + while ((ctx->xc_flags & dtor_flag) == 0 && ctx->xc_free == NULL) + mtx_sleep(&ctx->xc_free, &ctx->xc_free_lock, 0, "gxact", 0); + if (ctx->xc_flags & dtor_flag) { + /* Being destroyed */ + xact = NULL; + } else { + xact = ctx->xc_free; + KASSERT(xact != NULL, ("no free xact")); + KASSERT(xact->x_resp == NULL, ("xact has pending response")); + ctx->xc_free = NULL; + } + + mtx_unlock(&ctx->xc_free_lock); + + return (xact); +} + +struct vmbus_xact_ctx * +vmbus_xact_ctx_create(bus_dma_tag_t dtag, size_t req_size, size_t resp_size) +{ + struct vmbus_xact_ctx *ctx; + + ctx = malloc(sizeof(*ctx), M_DEVBUF, M_WAITOK | M_ZERO); + ctx->xc_req_size = req_size; + ctx->xc_resp_size = resp_size; + + ctx->xc_free = vmbus_xact_alloc(ctx, dtag); + if (ctx->xc_free == NULL) { + free(ctx, M_DEVBUF); + return (NULL); + } + + mtx_init(&ctx->xc_free_lock, "vmbus xact free", NULL, MTX_DEF); + mtx_init(&ctx->xc_active_lock, "vmbus xact active", NULL, MTX_DEF); + + return (ctx); +} + +void +vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx) +{ + struct vmbus_xact *xact; + + mtx_lock(&ctx->xc_free_lock); + ctx->xc_flags |= VMBUS_XACT_CTXF_DESTROY; + mtx_unlock(&ctx->xc_free_lock); + wakeup(&ctx->xc_free); + + xact = vmbus_xact_get1(ctx, 0); + if (xact == NULL) + panic("can't get xact"); + + vmbus_xact_free(xact); + mtx_destroy(&ctx->xc_free_lock); + mtx_destroy(&ctx->xc_active_lock); + free(ctx, M_DEVBUF); +} + +struct vmbus_xact * +vmbus_xact_get(struct vmbus_xact_ctx *ctx, size_t req_len) +{ + struct vmbus_xact *xact; + + if (req_len > ctx->xc_req_size) + panic("invalid request size %zu", req_len); + + xact = vmbus_xact_get1(ctx, VMBUS_XACT_CTXF_DESTROY); + if (xact == NULL) + return (NULL); + + memset(xact->x_req, 0, req_len); + return (xact); +} + +void +vmbus_xact_put(struct vmbus_xact *xact) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + + KASSERT(ctx->xc_active == NULL, ("pending active xact")); + xact->x_resp = NULL; + + mtx_lock(&ctx->xc_free_lock); + KASSERT(ctx->xc_free == NULL, ("has free xact")); + ctx->xc_free = xact; + mtx_unlock(&ctx->xc_free_lock); + wakeup(&ctx->xc_free); +} + +void * +vmbus_xact_req_data(const struct vmbus_xact *xact) +{ + + return (xact->x_req); +} + +bus_addr_t +vmbus_xact_req_paddr(const struct vmbus_xact *xact) +{ + + return (xact->x_req_dma.hv_paddr); +} + +void +vmbus_xact_activate(struct vmbus_xact *xact) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + + KASSERT(xact->x_resp == NULL, ("xact has pending response")); + + mtx_lock(&ctx->xc_active_lock); + KASSERT(ctx->xc_active == NULL, ("pending active xact")); + ctx->xc_active = xact; + mtx_unlock(&ctx->xc_active_lock); +} + +void +vmbus_xact_deactivate(struct vmbus_xact *xact) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + + mtx_lock(&ctx->xc_active_lock); + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + ctx->xc_active = NULL; + mtx_unlock(&ctx->xc_active_lock); +} + +const void * +vmbus_xact_wait(struct vmbus_xact *xact, size_t *resp_len) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_active_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + while (xact->x_resp == NULL) { + mtx_sleep(&ctx->xc_active, &ctx->xc_active_lock, 0, + "wxact", 0); + } + ctx->xc_active = NULL; + + resp = xact->x_resp; + *resp_len = xact->x_resp_len; + + mtx_unlock(&ctx->xc_active_lock); + + return (resp); +} + +void +vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + size_t cplen = dlen; + + if (cplen > ctx->xc_resp_size) { + printf("vmbus: xact response truncated %zu -> %zu\n", + cplen, ctx->xc_resp_size); + cplen = ctx->xc_resp_size; + } + + mtx_lock(&ctx->xc_active_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + memcpy(xact->x_resp0, data, cplen); + xact->x_resp_len = cplen; + xact->x_resp = xact->x_resp0; + + mtx_unlock(&ctx->xc_active_lock); + wakeup(&ctx->xc_active); +} Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Thu Aug 11 05:18:09 2016 (r303946) +++ head/sys/modules/hyperv/vmbus/Makefile Thu Aug 11 05:49:49 2016 (r303947) @@ -10,7 +10,8 @@ SRCS= hyperv.c \ vmbus.c \ vmbus_br.c \ vmbus_chan.c \ - vmbus_et.c + vmbus_et.c \ + vmbus_xact.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h # XXX: for assym.s From owner-svn-src-head@freebsd.org Thu Aug 11 06:14:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF027BB6824; Thu, 11 Aug 2016 06:14:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9271702; Thu, 11 Aug 2016 06:14:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B6Etun046460; Thu, 11 Aug 2016 06:14:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B6EtIS046453; Thu, 11 Aug 2016 06:14:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608110614.u7B6EtIS046453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 11 Aug 2016 06:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303948 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 06:14:56 -0000 Author: sephe Date: Thu Aug 11 06:14:54 2016 New Revision: 303948 URL: https://svnweb.freebsd.org/changeset/base/303948 Log: hyperv/hn: Switch to vmbus xact APIs for NVS initialization Reviewed by: Jun Su MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7457 Added: head/sys/dev/hyperv/netvsc/if_hnreg.h (contents, props changed) Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 11 05:49:49 2016 (r303947) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 11 06:14:54 2016 (r303948) @@ -45,9 +45,11 @@ #include #include -#include "hv_net_vsc.h" -#include "hv_rndis.h" -#include "hv_rndis_filter.h" +#include +#include +#include +#include +#include MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper-V netvsc driver"); @@ -70,7 +72,10 @@ static void hv_nv_on_receive(netvsc_dev const struct vmbus_chanpkt_hdr *pkt); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg); + const struct nvsp_msg_ *msg, int); +static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + const struct nvsp_msg_ *msg, int dlen); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -462,45 +467,64 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne return (ret); } - -/* - * Attempt to negotiate the caller-specified NVSP version - * - * For NVSP v2, Server 2008 R2 does not set - * init_pkt->msgs.init_msgs.init_compl.negotiated_prot_vers - * to the negotiated version, so we cannot rely on that. - */ static int hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev, - uint32_t nvsp_ver) + uint32_t nvs_ver) { struct hn_send_ctx sndc; - nvsp_msg *init_pkt; - int ret; - - init_pkt = &net_dev->channel_init_packet; - memset(init_pkt, 0, sizeof(nvsp_msg)); - init_pkt->hdr.msg_type = nvsp_msg_type_init; + struct vmbus_xact *xact; + struct hn_nvs_init *init; + const struct hn_nvs_init_resp *resp; + size_t resp_len; + uint32_t status; + int error; + + xact = vmbus_xact_get(sc->hn_xact, sizeof(*init)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs init\n"); + return (ENXIO); + } + + init = vmbus_xact_req_data(xact); + init->nvs_type = HN_NVS_TYPE_INIT; + init->nvs_ver_min = nvs_ver; + init->nvs_ver_max = nvs_ver; - /* - * Specify parameter as the only acceptable protocol version - */ - init_pkt->msgs.init_msgs.init.p1.protocol_version = nvsp_ver; - init_pkt->msgs.init_msgs.init.protocol_version_2 = nvsp_ver; + vmbus_xact_activate(xact); + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - /* Send the init request */ - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); - ret = vmbus_chan_send(sc->hn_prichan, + error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); - if (ret != 0) - return (-1); - - sema_wait(&net_dev->channel_init_sema); + init, sizeof(*init), (uint64_t)(uintptr_t)&sndc); + if (error) { + if_printf(sc->hn_ifp, "send nvs init failed: %d\n", error); + vmbus_xact_deactivate(xact); + vmbus_xact_put(xact); + return (error); + } - if (init_pkt->msgs.init_msgs.init_compl.status != nvsp_status_success) + resp = vmbus_xact_wait(xact, &resp_len); + if (resp_len < sizeof(*resp)) { + if_printf(sc->hn_ifp, "invalid init resp length %zu\n", + resp_len); + vmbus_xact_put(xact); return (EINVAL); + } + if (resp->nvs_type != HN_NVS_TYPE_INIT_RESP) { + if_printf(sc->hn_ifp, "not init resp, type %u\n", + resp->nvs_type); + vmbus_xact_put(xact); + return (EINVAL); + } + + status = resp->nvs_status; + vmbus_xact_put(xact); + if (status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "nvs init failed for ver 0x%x\n", + nvs_ver); + return (EINVAL); + } return (0); } @@ -744,7 +768,7 @@ hv_nv_on_device_remove(struct hn_softc * void hn_nvs_sent_wakeup(struct hn_send_ctx *sndc __unused, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg) + const struct nvsp_msg_ *msg, int dlen __unused) { /* Copy the response back */ memcpy(&net_dev->channel_init_packet, msg, sizeof(nvsp_msg)); @@ -752,9 +776,18 @@ hn_nvs_sent_wakeup(struct hn_send_ctx *s } static void +hn_nvs_sent_xact(struct hn_send_ctx *sndc, + struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, + const struct nvsp_msg_ *msg, int dlen) +{ + + vmbus_xact_wakeup(sndc->hn_cbarg, msg, dlen); +} + +static void hn_nvs_sent_none(struct hn_send_ctx *sndc __unused, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg __unused) + const struct nvsp_msg_ *msg __unused, int dlen __unused) { /* EMPTY */ } @@ -788,7 +821,8 @@ hv_nv_on_send_completion(netvsc_dev *net struct hn_send_ctx *sndc; sndc = (struct hn_send_ctx *)(uintptr_t)pkt->cph_xactid; - sndc->hn_cb(sndc, net_dev, chan, VMBUS_CHANPKT_CONST_DATA(pkt)); + sndc->hn_cb(sndc, net_dev, chan, VMBUS_CHANPKT_CONST_DATA(pkt), + VMBUS_CHANPKT_DATALEN(pkt)); /* * NOTE: * 'sndc' CAN NOT be accessed anymore, since it can be freed by Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 11 05:49:49 2016 (r303947) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 11 06:14:54 2016 (r303948) @@ -1243,6 +1243,7 @@ typedef struct hn_softc { struct taskqueue *hn_tx_taskq; struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; + struct vmbus_xact_ctx *hn_xact; } hn_softc_t; /* Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 11 05:49:49 2016 (r303947) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 11 06:14:54 2016 (r303948) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_net_vsc.h" #include "hv_rndis.h" @@ -124,6 +125,9 @@ __FBSDID("$FreeBSD$"); /* Short for Hyper-V network interface */ #define NETVSC_DEVNAME "hn" +#define HN_XACT_REQ_SIZE (2 * PAGE_SIZE) +#define HN_XACT_RESP_SIZE (2 * PAGE_SIZE) + /* * It looks like offset 0 of buf is reserved to hold the softc pointer. * The sc pointer evidently not needed, and is not presently populated. @@ -542,6 +546,11 @@ netvsc_attach(device_t dev) IFCAP_LRO; ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; + sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), + HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE); + if (sc->hn_xact == NULL) + goto failed; + error = hv_rf_on_device_add(sc, &device_info, ring_cnt, &sc->hn_rx_ring[0]); if (error) @@ -643,6 +652,7 @@ netvsc_detach(device_t dev) if (sc->hn_tx_taskq != hn_tx_taskq) taskqueue_free(sc->hn_tx_taskq); + vmbus_xact_ctx_destroy(sc->hn_xact); return (0); } @@ -782,7 +792,8 @@ hn_txeof(struct hn_tx_ring *txr) static void hn_tx_done(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan, const struct nvsp_msg_ *msg __unused) + struct vmbus_channel *chan, const struct nvsp_msg_ *msg __unused, + int dlen __unused) { struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 11 05:49:49 2016 (r303947) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 11 06:14:54 2016 (r303948) @@ -91,10 +91,10 @@ hv_rf_send_offload_request(struct hn_sof static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg); + const struct nvsp_msg_ *msg, int dlen); static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg); + const struct nvsp_msg_ *msg, int dlen); /* * Set the Per-Packet-Info with the specified type @@ -1239,7 +1239,8 @@ hv_rf_on_close(struct hn_softc *sc) static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused) + struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + int dlen __unused) { if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) hn_chim_free(net_dev, sndc->hn_chim_idx); @@ -1247,7 +1248,8 @@ hn_rndis_sent_cb(struct hn_send_ctx *snd static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused) + struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + int dlen __unused) { rndis_request *request = sndc->hn_cbarg; Added: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Thu Aug 11 06:14:54 2016 (r303948) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _IF_HNREG_H_ +#define _IF_HNREG_H_ + +#include +#include + +#define HN_NVS_STATUS_OK 1 + +#define HN_NVS_TYPE_INIT 1 +#define HN_NVS_TYPE_INIT_RESP 2 + +/* + * Any size less than this one will _not_ work, e.g. hn_nvs_init + * only has 12B valid data, however, if only 12B data were sent, + * Hypervisor would never reply. + */ +#define HN_NVS_REQSIZE_MIN 32 + +struct hn_nvs_init { + uint32_t nvs_type; /* HN_NVS_TYPE_INIT */ + uint32_t nvs_ver_min; + uint32_t nvs_ver_max; + uint8_t nvs_rsvd[20]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_init) >= HN_NVS_REQSIZE_MIN); + +struct hn_nvs_init_resp { + uint32_t nvs_type; /* HN_NVS_TYPE_INIT_RESP */ + uint32_t nvs_ver; /* deprecated */ + uint32_t nvs_rsvd; + uint32_t nvs_status; /* HN_NVS_STATUS_ */ +} __packed; + +#endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 11 05:49:49 2016 (r303947) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 11 06:14:54 2016 (r303948) @@ -40,7 +40,7 @@ struct hn_send_ctx; typedef void (*hn_sent_callback_t) (struct hn_send_ctx *, struct netvsc_dev_ *, - struct vmbus_channel *, const struct nvsp_msg_ *); + struct vmbus_channel *, const struct nvsp_msg_ *, int); struct hn_send_ctx { hn_sent_callback_t hn_cb; @@ -77,7 +77,7 @@ hn_send_ctx_init_simple(struct hn_send_c void hn_nvs_sent_wakeup(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg); + const struct nvsp_msg_ *msg, int dlen); void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); #endif /* !_IF_HNVAR_H_ */ From owner-svn-src-head@freebsd.org Thu Aug 11 06:24:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C6D2BB6A59; Thu, 11 Aug 2016 06:24:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 162791C0D; Thu, 11 Aug 2016 06:24:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B6OIa7050067; Thu, 11 Aug 2016 06:24:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B6OHl6050062; Thu, 11 Aug 2016 06:24:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608110624.u7B6OHl6050062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 11 Aug 2016 06:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303949 - in head/sys/dev/hyperv: include netvsc vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 06:24:19 -0000 Author: sephe Date: Thu Aug 11 06:24:17 2016 New Revision: 303949 URL: https://svnweb.freebsd.org/changeset/base/303949 Log: hyperv/vmbus: Use xact APIs to implement post message Hypercall APIs Avoid code duplication. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7458 Modified: head/sys/dev/hyperv/include/vmbus_xact.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h head/sys/dev/hyperv/vmbus/vmbus_xact.c Modified: head/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus_xact.h Thu Aug 11 06:14:54 2016 (r303948) +++ head/sys/dev/hyperv/include/vmbus_xact.h Thu Aug 11 06:24:17 2016 (r303949) @@ -36,7 +36,8 @@ struct vmbus_xact; struct vmbus_xact_ctx; struct vmbus_xact_ctx *vmbus_xact_ctx_create(bus_dma_tag_t dtag, - size_t req_size, size_t resp_size); + size_t req_size, size_t resp_size, + size_t priv_size); void vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx); struct vmbus_xact *vmbus_xact_get(struct vmbus_xact_ctx *ctx, size_t req_len); @@ -44,11 +45,15 @@ void vmbus_xact_put(struct vmbus_xact void *vmbus_xact_req_data(const struct vmbus_xact *xact); bus_addr_t vmbus_xact_req_paddr(const struct vmbus_xact *xact); +void *vmbus_xact_priv(const struct vmbus_xact *xact, + size_t priv_len); void vmbus_xact_activate(struct vmbus_xact *xact); void vmbus_xact_deactivate(struct vmbus_xact *xact); const void *vmbus_xact_wait(struct vmbus_xact *xact, size_t *resp_len); void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen); +void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, + const void *data, size_t dlen); #endif /* !_VMBUS_XACT_H_ */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 11 06:14:54 2016 (r303948) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 11 06:24:17 2016 (r303949) @@ -547,7 +547,7 @@ netvsc_attach(device_t dev) ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), - HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE); + HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); if (sc->hn_xact == NULL) goto failed; Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Aug 11 06:14:54 2016 (r303948) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Aug 11 06:24:17 2016 (r303949) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,25 +63,10 @@ __FBSDID("$FreeBSD$"); #define VMBUS_GPADL_START 0xe1e10 struct vmbus_msghc { - struct hypercall_postmsg_in *mh_inprm; + struct vmbus_xact *mh_xact; struct hypercall_postmsg_in mh_inprm_save; - struct hyperv_dma mh_inprm_dma; - - struct vmbus_message *mh_resp; - struct vmbus_message mh_resp0; -}; - -struct vmbus_msghc_ctx { - struct vmbus_msghc *mhc_free; - struct mtx mhc_free_lock; - uint32_t mhc_flags; - - struct vmbus_msghc *mhc_active; - struct mtx mhc_active_lock; }; -#define VMBUS_MSGHC_CTXF_DESTROY 0x0001 - static int vmbus_probe(device_t); static int vmbus_attach(device_t); static int vmbus_detach(device_t); @@ -116,15 +102,6 @@ static int vmbus_doattach(struct vmbus static void vmbus_event_proc_dummy(struct vmbus_softc *, int); -static struct vmbus_msghc_ctx *vmbus_msghc_ctx_create(bus_dma_tag_t); -static void vmbus_msghc_ctx_destroy( - struct vmbus_msghc_ctx *); -static void vmbus_msghc_ctx_free(struct vmbus_msghc_ctx *); -static struct vmbus_msghc *vmbus_msghc_alloc(bus_dma_tag_t); -static void vmbus_msghc_free(struct vmbus_msghc *); -static struct vmbus_msghc *vmbus_msghc_get1(struct vmbus_msghc_ctx *, - uint32_t); - static struct vmbus_softc *vmbus_sc; extern inthand_t IDTVEC(vmbus_isr); @@ -182,85 +159,6 @@ vmbus_get_softc(void) return vmbus_sc; } -static struct vmbus_msghc * -vmbus_msghc_alloc(bus_dma_tag_t parent_dtag) -{ - struct vmbus_msghc *mh; - - mh = malloc(sizeof(*mh), M_DEVBUF, M_WAITOK | M_ZERO); - - mh->mh_inprm = hyperv_dmamem_alloc(parent_dtag, - HYPERCALL_PARAM_ALIGN, 0, HYPERCALL_POSTMSGIN_SIZE, - &mh->mh_inprm_dma, BUS_DMA_WAITOK); - if (mh->mh_inprm == NULL) { - free(mh, M_DEVBUF); - return NULL; - } - return mh; -} - -static void -vmbus_msghc_free(struct vmbus_msghc *mh) -{ - hyperv_dmamem_free(&mh->mh_inprm_dma, mh->mh_inprm); - free(mh, M_DEVBUF); -} - -static void -vmbus_msghc_ctx_free(struct vmbus_msghc_ctx *mhc) -{ - KASSERT(mhc->mhc_active == NULL, ("still have active msg hypercall")); - KASSERT(mhc->mhc_free == NULL, ("still have hypercall msg")); - - mtx_destroy(&mhc->mhc_free_lock); - mtx_destroy(&mhc->mhc_active_lock); - free(mhc, M_DEVBUF); -} - -static struct vmbus_msghc_ctx * -vmbus_msghc_ctx_create(bus_dma_tag_t parent_dtag) -{ - struct vmbus_msghc_ctx *mhc; - - mhc = malloc(sizeof(*mhc), M_DEVBUF, M_WAITOK | M_ZERO); - mtx_init(&mhc->mhc_free_lock, "vmbus msghc free", NULL, MTX_DEF); - mtx_init(&mhc->mhc_active_lock, "vmbus msghc act", NULL, MTX_DEF); - - mhc->mhc_free = vmbus_msghc_alloc(parent_dtag); - if (mhc->mhc_free == NULL) { - vmbus_msghc_ctx_free(mhc); - return NULL; - } - return mhc; -} - -static struct vmbus_msghc * -vmbus_msghc_get1(struct vmbus_msghc_ctx *mhc, uint32_t dtor_flag) -{ - struct vmbus_msghc *mh; - - mtx_lock(&mhc->mhc_free_lock); - - while ((mhc->mhc_flags & dtor_flag) == 0 && mhc->mhc_free == NULL) { - mtx_sleep(&mhc->mhc_free, &mhc->mhc_free_lock, 0, - "gmsghc", 0); - } - if (mhc->mhc_flags & dtor_flag) { - /* Being destroyed */ - mh = NULL; - } else { - mh = mhc->mhc_free; - KASSERT(mh != NULL, ("no free hypercall msg")); - KASSERT(mh->mh_resp == NULL, - ("hypercall msg has pending response")); - mhc->mhc_free = NULL; - } - - mtx_unlock(&mhc->mhc_free_lock); - - return mh; -} - void vmbus_msghc_reset(struct vmbus_msghc *mh, size_t dsize) { @@ -269,7 +167,7 @@ vmbus_msghc_reset(struct vmbus_msghc *mh if (dsize > HYPERCALL_POSTMSGIN_DSIZE_MAX) panic("invalid data size %zu", dsize); - inprm = mh->mh_inprm; + inprm = vmbus_xact_req_data(mh->mh_xact); memset(inprm, 0, HYPERCALL_POSTMSGIN_SIZE); inprm->hc_connid = VMBUS_CONNID_MESSAGE; inprm->hc_msgtype = HYPERV_MSGTYPE_CHANNEL; @@ -280,63 +178,50 @@ struct vmbus_msghc * vmbus_msghc_get(struct vmbus_softc *sc, size_t dsize) { struct vmbus_msghc *mh; + struct vmbus_xact *xact; if (dsize > HYPERCALL_POSTMSGIN_DSIZE_MAX) panic("invalid data size %zu", dsize); - mh = vmbus_msghc_get1(sc->vmbus_msg_hc, VMBUS_MSGHC_CTXF_DESTROY); - if (mh == NULL) - return NULL; + xact = vmbus_xact_get(sc->vmbus_xc, + dsize + __offsetof(struct hypercall_postmsg_in, hc_data[0])); + if (xact == NULL) + return (NULL); + + mh = vmbus_xact_priv(xact, sizeof(*mh)); + mh->mh_xact = xact; vmbus_msghc_reset(mh, dsize); - return mh; + return (mh); } void -vmbus_msghc_put(struct vmbus_softc *sc, struct vmbus_msghc *mh) +vmbus_msghc_put(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { - struct vmbus_msghc_ctx *mhc = sc->vmbus_msg_hc; - KASSERT(mhc->mhc_active == NULL, ("msg hypercall is active")); - mh->mh_resp = NULL; - - mtx_lock(&mhc->mhc_free_lock); - KASSERT(mhc->mhc_free == NULL, ("has free hypercall msg")); - mhc->mhc_free = mh; - mtx_unlock(&mhc->mhc_free_lock); - wakeup(&mhc->mhc_free); + vmbus_xact_put(mh->mh_xact); } void * vmbus_msghc_dataptr(struct vmbus_msghc *mh) { - return mh->mh_inprm->hc_data; -} - -static void -vmbus_msghc_ctx_destroy(struct vmbus_msghc_ctx *mhc) -{ - struct vmbus_msghc *mh; - - mtx_lock(&mhc->mhc_free_lock); - mhc->mhc_flags |= VMBUS_MSGHC_CTXF_DESTROY; - mtx_unlock(&mhc->mhc_free_lock); - wakeup(&mhc->mhc_free); - - mh = vmbus_msghc_get1(mhc, 0); - if (mh == NULL) - panic("can't get msghc"); + struct hypercall_postmsg_in *inprm; - vmbus_msghc_free(mh); - vmbus_msghc_ctx_free(mhc); + inprm = vmbus_xact_req_data(mh->mh_xact); + return (inprm->hc_data); } int vmbus_msghc_exec_noresult(struct vmbus_msghc *mh) { sbintime_t time = SBT_1MS; + struct hypercall_postmsg_in *inprm; + bus_addr_t inprm_paddr; int i; + inprm = vmbus_xact_req_data(mh->mh_xact); + inprm_paddr = vmbus_xact_req_paddr(mh->mh_xact); + /* * Save the input parameter so that we could restore the input * parameter if the Hypercall failed. @@ -345,7 +230,7 @@ vmbus_msghc_exec_noresult(struct vmbus_m * Is this really necessary?! i.e. Will the Hypercall ever * overwrite the input parameter? */ - memcpy(&mh->mh_inprm_save, mh->mh_inprm, HYPERCALL_POSTMSGIN_SIZE); + memcpy(&mh->mh_inprm_save, inprm, HYPERCALL_POSTMSGIN_SIZE); /* * In order to cope with transient failures, e.g. insufficient @@ -357,7 +242,7 @@ vmbus_msghc_exec_noresult(struct vmbus_m for (i = 0; i < HC_RETRY_MAX; ++i) { uint64_t status; - status = hypercall_post_message(mh->mh_inprm_dma.hv_paddr); + status = hypercall_post_message(inprm_paddr); if (status == HYPERCALL_STATUS_SUCCESS) return 0; @@ -366,8 +251,7 @@ vmbus_msghc_exec_noresult(struct vmbus_m time *= 2; /* Restore input parameter and try again */ - memcpy(mh->mh_inprm, &mh->mh_inprm_save, - HYPERCALL_POSTMSGIN_SIZE); + memcpy(inprm, &mh->mh_inprm_save, HYPERCALL_POSTMSGIN_SIZE); } #undef HC_RETRY_MAX @@ -376,62 +260,30 @@ vmbus_msghc_exec_noresult(struct vmbus_m } int -vmbus_msghc_exec(struct vmbus_softc *sc, struct vmbus_msghc *mh) +vmbus_msghc_exec(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { - struct vmbus_msghc_ctx *mhc = sc->vmbus_msg_hc; int error; - KASSERT(mh->mh_resp == NULL, ("hypercall msg has pending response")); - - mtx_lock(&mhc->mhc_active_lock); - KASSERT(mhc->mhc_active == NULL, ("pending active msg hypercall")); - mhc->mhc_active = mh; - mtx_unlock(&mhc->mhc_active_lock); - + vmbus_xact_activate(mh->mh_xact); error = vmbus_msghc_exec_noresult(mh); - if (error) { - mtx_lock(&mhc->mhc_active_lock); - KASSERT(mhc->mhc_active == mh, ("msghc mismatch")); - mhc->mhc_active = NULL; - mtx_unlock(&mhc->mhc_active_lock); - } + if (error) + vmbus_xact_deactivate(mh->mh_xact); return error; } const struct vmbus_message * -vmbus_msghc_wait_result(struct vmbus_softc *sc, struct vmbus_msghc *mh) +vmbus_msghc_wait_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { - struct vmbus_msghc_ctx *mhc = sc->vmbus_msg_hc; + size_t resp_len; - mtx_lock(&mhc->mhc_active_lock); - - KASSERT(mhc->mhc_active == mh, ("msghc mismatch")); - while (mh->mh_resp == NULL) { - mtx_sleep(&mhc->mhc_active, &mhc->mhc_active_lock, 0, - "wmsghc", 0); - } - mhc->mhc_active = NULL; - - mtx_unlock(&mhc->mhc_active_lock); - - return mh->mh_resp; + return (vmbus_xact_wait(mh->mh_xact, &resp_len)); } void vmbus_msghc_wakeup(struct vmbus_softc *sc, const struct vmbus_message *msg) { - struct vmbus_msghc_ctx *mhc = sc->vmbus_msg_hc; - struct vmbus_msghc *mh; - - mtx_lock(&mhc->mhc_active_lock); - - mh = mhc->mhc_active; - KASSERT(mh != NULL, ("no pending msg hypercall")); - memcpy(&mh->mh_resp0, msg, sizeof(mh->mh_resp0)); - mh->mh_resp = &mh->mh_resp0; - mtx_unlock(&mhc->mhc_active_lock); - wakeup(&mhc->mhc_active); + vmbus_xact_ctx_wakeup(sc->vmbus_xc, msg, sizeof(*msg)); } uint32_t @@ -1187,9 +1039,10 @@ vmbus_doattach(struct vmbus_softc *sc) /* * Create context for "post message" Hypercalls */ - sc->vmbus_msg_hc = vmbus_msghc_ctx_create( - bus_get_dma_tag(sc->vmbus_dev)); - if (sc->vmbus_msg_hc == NULL) { + sc->vmbus_xc = vmbus_xact_ctx_create(bus_get_dma_tag(sc->vmbus_dev), + HYPERCALL_POSTMSGIN_SIZE, VMBUS_MSG_SIZE, + sizeof(struct vmbus_msghc)); + if (sc->vmbus_xc == NULL) { ret = ENXIO; goto cleanup; } @@ -1244,9 +1097,9 @@ vmbus_doattach(struct vmbus_softc *sc) cleanup: vmbus_intr_teardown(sc); vmbus_dma_free(sc); - if (sc->vmbus_msg_hc != NULL) { - vmbus_msghc_ctx_destroy(sc->vmbus_msg_hc); - sc->vmbus_msg_hc = NULL; + if (sc->vmbus_xc != NULL) { + vmbus_xact_ctx_destroy(sc->vmbus_xc); + sc->vmbus_xc = NULL; } free(sc->vmbus_chmap, M_DEVBUF); mtx_destroy(&sc->vmbus_scan_lock); @@ -1305,9 +1158,9 @@ vmbus_detach(device_t dev) vmbus_intr_teardown(sc); vmbus_dma_free(sc); - if (sc->vmbus_msg_hc != NULL) { - vmbus_msghc_ctx_destroy(sc->vmbus_msg_hc); - sc->vmbus_msg_hc = NULL; + if (sc->vmbus_xc != NULL) { + vmbus_xact_ctx_destroy(sc->vmbus_xc); + sc->vmbus_xc = NULL; } free(sc->vmbus_chmap, M_DEVBUF); Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Aug 11 06:14:54 2016 (r303948) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Aug 11 06:24:17 2016 (r303949) @@ -86,7 +86,7 @@ struct vmbus_softc { u_long *vmbus_rx_evtflags; /* compat evtflgs from host */ struct vmbus_channel **vmbus_chmap; - struct vmbus_msghc_ctx *vmbus_msg_hc; + struct vmbus_xact_ctx *vmbus_xc; struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; /* Modified: head/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Aug 11 06:14:54 2016 (r303948) +++ head/sys/dev/hyperv/vmbus/vmbus_xact.c Thu Aug 11 06:24:17 2016 (r303949) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); struct vmbus_xact { struct vmbus_xact_ctx *x_ctx; + void *x_priv; void *x_req; struct hyperv_dma x_req_dma; @@ -52,6 +53,7 @@ struct vmbus_xact_ctx { uint32_t xc_flags; size_t xc_req_size; size_t xc_resp_size; + size_t xc_priv_size; struct vmbus_xact *xc_free; struct mtx xc_free_lock; @@ -83,6 +85,8 @@ vmbus_xact_alloc(struct vmbus_xact_ctx * free(xact, M_DEVBUF); return (NULL); } + if (ctx->xc_priv_size != 0) + xact->x_priv = malloc(ctx->xc_priv_size, M_DEVBUF, M_WAITOK); xact->x_resp0 = malloc(ctx->xc_resp_size, M_DEVBUF, M_WAITOK); return (xact); @@ -94,6 +98,8 @@ vmbus_xact_free(struct vmbus_xact *xact) hyperv_dmamem_free(&xact->x_req_dma, xact->x_req); free(xact->x_resp0, M_DEVBUF); + if (xact->x_priv != NULL) + free(xact->x_priv, M_DEVBUF); free(xact, M_DEVBUF); } @@ -122,13 +128,15 @@ vmbus_xact_get1(struct vmbus_xact_ctx *c } struct vmbus_xact_ctx * -vmbus_xact_ctx_create(bus_dma_tag_t dtag, size_t req_size, size_t resp_size) +vmbus_xact_ctx_create(bus_dma_tag_t dtag, size_t req_size, size_t resp_size, + size_t priv_size) { struct vmbus_xact_ctx *ctx; ctx = malloc(sizeof(*ctx), M_DEVBUF, M_WAITOK | M_ZERO); ctx->xc_req_size = req_size; ctx->xc_resp_size = resp_size; + ctx->xc_priv_size = priv_size; ctx->xc_free = vmbus_xact_alloc(ctx, dtag); if (ctx->xc_free == NULL) { @@ -207,6 +215,15 @@ vmbus_xact_req_paddr(const struct vmbus_ return (xact->x_req_dma.hv_paddr); } +void * +vmbus_xact_priv(const struct vmbus_xact *xact, size_t priv_len) +{ + + if (priv_len > xact->x_ctx->xc_priv_size) + panic("invalid priv size %zu", priv_len); + return (xact->x_priv); +} + void vmbus_xact_activate(struct vmbus_xact *xact) { @@ -254,25 +271,43 @@ vmbus_xact_wait(struct vmbus_xact *xact, return (resp); } -void -vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen) +static void +vmbus_xact_save_resp(struct vmbus_xact *xact, const void *data, size_t dlen) { struct vmbus_xact_ctx *ctx = xact->x_ctx; size_t cplen = dlen; + mtx_assert(&ctx->xc_active_lock, MA_OWNED); + if (cplen > ctx->xc_resp_size) { printf("vmbus: xact response truncated %zu -> %zu\n", cplen, ctx->xc_resp_size); cplen = ctx->xc_resp_size; } - mtx_lock(&ctx->xc_active_lock); - KASSERT(ctx->xc_active == xact, ("xact mismatch")); memcpy(xact->x_resp0, data, cplen); xact->x_resp_len = cplen; xact->x_resp = xact->x_resp0; +} +void +vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + + mtx_lock(&ctx->xc_active_lock); + vmbus_xact_save_resp(xact, data, dlen); + mtx_unlock(&ctx->xc_active_lock); + wakeup(&ctx->xc_active); +} + +void +vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, const void *data, size_t dlen) +{ + mtx_lock(&ctx->xc_active_lock); + KASSERT(ctx->xc_active != NULL, ("no pending xact")); + vmbus_xact_save_resp(ctx->xc_active, data, dlen); mtx_unlock(&ctx->xc_active_lock); wakeup(&ctx->xc_active); } From owner-svn-src-head@freebsd.org Thu Aug 11 07:11:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6639BB646A; Thu, 11 Aug 2016 07:11:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8527C12BA; Thu, 11 Aug 2016 07:11:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B7BF73067636; Thu, 11 Aug 2016 07:11:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B7BFLL067635; Thu, 11 Aug 2016 07:11:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608110711.u7B7BFLL067635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 11 Aug 2016 07:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303950 - 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.22 Precedence: list List-Id: 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, 11 Aug 2016 07:11:16 -0000 Author: trasz Date: Thu Aug 11 07:11:15 2016 New Revision: 303950 URL: https://svnweb.freebsd.org/changeset/base/303950 Log: Remove unused textvp_fullpath() macro. MFC after: 1 month Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Aug 11 06:24:17 2016 (r303949) +++ head/sys/sys/vnode.h Thu Aug 11 07:11:15 2016 (r303950) @@ -618,8 +618,6 @@ u_quad_t init_va_filerev(void); int speedup_syncer(void); int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, u_int *buflen); -#define textvp_fullpath(p, rb, rfb) \ - vn_fullpath(FIRST_THREAD_IN_PROC(p), (p)->p_textvp, rb, rfb) int vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); int vn_fullpath_global(struct thread *td, struct vnode *vn, From owner-svn-src-head@freebsd.org Thu Aug 11 07:58:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B61BBB6EEC; Thu, 11 Aug 2016 07:58:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2965318ED; Thu, 11 Aug 2016 07:58:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B7wOKL083955; Thu, 11 Aug 2016 07:58:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B7wORX083952; Thu, 11 Aug 2016 07:58:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608110758.u7B7wORX083952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Aug 2016 07:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303951 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 07:58:25 -0000 Author: markj Date: Thu Aug 11 07:58:23 2016 New Revision: 303951 URL: https://svnweb.freebsd.org/changeset/base/303951 Log: Remove b_pin_count from struct buf. It was added in r153192 for XFS and doesn't appear to have been used for anything else. XFS was disconnected in r241607 and removed entirely in r247631. Reported by: mlaier Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D7468 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/kern/vfs_bio.c Thu Aug 11 07:58:23 2016 (r303951) @@ -1479,7 +1479,6 @@ buf_alloc(void) bp->b_npages = 0; bp->b_dirtyoff = bp->b_dirtyend = 0; bp->b_bufobj = NULL; - bp->b_pin_count = 0; bp->b_data = bp->b_kvabase = unmapped_buf; bp->b_fsprivate1 = NULL; bp->b_fsprivate2 = NULL; @@ -1908,9 +1907,6 @@ bufwrite(struct buf *bp) BUF_ASSERT_HELD(bp); - if (bp->b_pin_count > 0) - bunpin_wait(bp); - KASSERT(!(bp->b_vflags & BV_BKGRDINPROG), ("FFS background buffer should not get here %p", bp)); @@ -3123,10 +3119,7 @@ flushbufqueues(struct vnode *lvp, int ta mtx_unlock(&bqlocks[queue]); if (error != 0) continue; - if (bp->b_pin_count > 0) { - BUF_UNLOCK(bp); - continue; - } + /* * BKGRDINPROG can only be set with the buf and bufobj * locks both held. We tolerate a race to clear it here. @@ -3546,19 +3539,6 @@ loop: if ((bp->b_flags & B_VMIO) == 0 || (size > bp->b_kvasize)) { if (bp->b_flags & B_DELWRI) { - /* - * If buffer is pinned and caller does - * not want sleep waiting for it to be - * unpinned, bail out - * */ - if (bp->b_pin_count > 0) { - if (flags & GB_LOCK_NOWAIT) { - bqrelse(bp); - return (NULL); - } else { - bunpin_wait(bp); - } - } bp->b_flags |= B_NOCACHE; bwrite(bp); } else { @@ -4632,41 +4612,6 @@ bufobj_wwait(struct bufobj *bo, int slpf return (error); } -void -bpin(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - bp->b_pin_count++; - mtx_unlock(mtxp); -} - -void -bunpin(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - if (--bp->b_pin_count == 0) - wakeup(bp); - mtx_unlock(mtxp); -} - -void -bunpin_wait(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - while (bp->b_pin_count > 0) - msleep(bp, mtxp, PRIBIO, "bwunpin", 0); - mtx_unlock(mtxp); -} - /* * Set bio_data or bio_ma for struct bio from the struct buf. */ Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/kern/vfs_cluster.c Thu Aug 11 07:58:23 2016 (r303951) @@ -836,12 +836,6 @@ cluster_wbuild(struct vnode *vp, long si --len; continue; } - if (tbp->b_pin_count > 0) { - BUF_UNLOCK(tbp); - ++start_lbn; - --len; - continue; - } bremfree(tbp); tbp->b_flags &= ~B_DONE; @@ -954,14 +948,6 @@ cluster_wbuild(struct vnode *vp, long si } /* - * Do not pull in pinned buffers. - */ - if (tbp->b_pin_count > 0) { - BUF_UNLOCK(tbp); - break; - } - - /* * Ok, it's passed all the tests, * so remove it from the free list * and mark it busy. We will use it. Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/sys/buf.h Thu Aug 11 07:58:23 2016 (r303951) @@ -139,7 +139,6 @@ struct buf { void *b_fsprivate1; void *b_fsprivate2; void *b_fsprivate3; - int b_pin_count; }; #define b_object b_bufobj->bo_object From owner-svn-src-head@freebsd.org Thu Aug 11 08:05:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 585A5BB561C for ; Thu, 11 Aug 2016 08:05:40 +0000 (UTC) (envelope-from rusac@diaspora.diasporanews.com) Received: from diaspora.diasporanews.com (unknown [IPv6:2605:9880:0:17d:4e72:b9ff:fe27:2d8e]) by mx1.freebsd.org (Postfix) with ESMTP id 353131ED3 for ; Thu, 11 Aug 2016 08:05:40 +0000 (UTC) (envelope-from rusac@diaspora.diasporanews.com) Received: by diaspora.diasporanews.com (Postfix, from userid 1003) id 463582805F1; Thu, 11 Aug 2016 01:05:33 -0700 (PDT) To: svn-src-head@freebsd.org Subject: Unable to deliver your item, #00672157 X-PHP-Originating-Script: 33:post.php(3) : regexp code(1) : eval()'d code(17) : eval()'d code Date: Thu, 11 Aug 2016 01:05:33 -0700 From: "FedEx International Next Flight" Reply-To: "FedEx International Next Flight" Message-ID: X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 08:05:40 -0000 Dear Customer, Courier was unable to deliver the parcel to you. Delivery Label is attached to this email. Yours trully, Alberto Stout, Delivery Agent. From owner-svn-src-head@freebsd.org Thu Aug 11 10:10:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA21BB5F1A; Thu, 11 Aug 2016 10:10:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38F2C17DE; Thu, 11 Aug 2016 10:10:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BAABbY032501; Thu, 11 Aug 2016 10:10:11 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BAABh3032497; Thu, 11 Aug 2016 10:10:11 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608111010.u7BAABh3032497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 11 Aug 2016 10:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303955 - in head: sbin/ipfw sys/netinet 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.22 Precedence: list List-Id: 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, 11 Aug 2016 10:10:12 -0000 Author: ae Date: Thu Aug 11 10:10:10 2016 New Revision: 303955 URL: https://svnweb.freebsd.org/changeset/base/303955 Log: Restore "nat global" support. Now zero value of arg1 used to specify "tablearg", use the old "tablearg" value for "nat global". Introduce new macro IP_FW_NAT44_GLOBAL to replace hardcoded magic number to specify "nat global". Also replace 65535 magic number with corresponding macro. Fix typo in comments. PR: 211256 Tested by: Victor Chernov MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Aug 11 09:30:25 2016 (r303954) +++ head/sbin/ipfw/ipfw2.c Thu Aug 11 10:10:10 2016 (r303955) @@ -1583,7 +1583,7 @@ show_static_rule(struct cmdline_opts *co break; case O_NAT: - if (cmd->arg1 != 0) + if (cmd->arg1 != IP_FW_NAT44_GLOBAL) bprint_uint_arg(bp, "nat ", cmd->arg1); else bprintf(bp, "nat global"); @@ -3776,7 +3776,7 @@ compile_rule(char *av[], uint32_t *rbuf, action->len = F_INSN_SIZE(ipfw_insn_nat); CHECK_ACTLEN; if (*av != NULL && _substrcmp(*av, "global") == 0) { - action->arg1 = 0; + action->arg1 = IP_FW_NAT44_GLOBAL; av++; break; } else Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Thu Aug 11 09:30:25 2016 (r303954) +++ head/sys/netinet/ip_fw.h Thu Aug 11 10:10:10 2016 (r303955) @@ -60,6 +60,7 @@ #define IPFW_ARG_MAX 65534 #define IP_FW_TABLEARG 65535 /* Compat value for old clients */ #define IP_FW_TARG 0 /* Current tablearg value */ +#define IP_FW_NAT44_GLOBAL 65535 /* arg1 value for "nat global" */ /* * Number of entries in the call stack of the call/return commands. Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Thu Aug 11 09:30:25 2016 (r303954) +++ head/sys/netpfil/ipfw/ip_fw2.c Thu Aug 11 10:10:10 2016 (r303955) @@ -2508,7 +2508,7 @@ do { \ set_match(args, f_pos, chain); /* Check if this is 'global' nat rule */ - if (cmd->arg1 == 0) { + if (cmd->arg1 == IP_FW_NAT44_GLOBAL) { retval = ipfw_nat_ptr(args, NULL, m); break; } Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Aug 11 09:30:25 2016 (r303954) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Aug 11 10:10:10 2016 (r303955) @@ -530,9 +530,11 @@ import_rule0(struct rule_check_info *ci) /* * Alter opcodes: - * 1) convert tablearg value from 65335 to 0 - * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room for targ). + * 1) convert tablearg value from 65535 to 0 + * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room + * for targ). * 3) convert table number in iface opcodes to u16 + * 4) convert old `nat global` into new 65535 */ l = krule->cmd_len; cmd = krule->cmd; @@ -554,19 +556,21 @@ import_rule0(struct rule_check_info *ci) case O_NETGRAPH: case O_NGTEE: case O_NAT: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; + else if (cmd->arg1 == 0) + cmd->arg1 = IP_FW_NAT44_GLOBAL; break; case O_SETFIB: case O_SETDSCP: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; else cmd->arg1 |= 0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; - if (lcmd->conn_limit == 65535) + if (lcmd->conn_limit == IP_FW_TABLEARG) lcmd->conn_limit = IP_FW_TARG; break; /* Interface tables */ @@ -612,7 +616,7 @@ export_rule0(struct ip_fw *krule, struct /* * Alter opcodes: - * 1) convert tablearg value from 0 to 65335 + * 1) convert tablearg value from 0 to 65535 * 2) Remove highest bit from O_SETFIB/O_SETDSCP values. * 3) convert table number in iface opcodes to int */ @@ -637,19 +641,21 @@ export_rule0(struct ip_fw *krule, struct case O_NGTEE: case O_NAT: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; + else if (cmd->arg1 == IP_FW_NAT44_GLOBAL) + cmd->arg1 = 0; break; case O_SETFIB: case O_SETDSCP: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; else cmd->arg1 &= ~0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; if (lcmd->conn_limit == IP_FW_TARG) - lcmd->conn_limit = 65535; + lcmd->conn_limit = IP_FW_TABLEARG; break; /* Interface tables */ case O_XMIT: From owner-svn-src-head@freebsd.org Thu Aug 11 12:37:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C547BB3B32; Thu, 11 Aug 2016 12:37:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B52D141E; Thu, 11 Aug 2016 12:37:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BCbB4r089488; Thu, 11 Aug 2016 12:37:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BCbBcj089487; Thu, 11 Aug 2016 12:37:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608111237.u7BCbBcj089487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Aug 2016 12:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303958 - 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.22 Precedence: list List-Id: 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, 11 Aug 2016 12:37:12 -0000 Author: kib Date: Thu Aug 11 12:37:11 2016 New Revision: 303958 URL: https://svnweb.freebsd.org/changeset/base/303958 Log: The pmap_delayed_invl_wait() function blocks on turnstile, it does not spin, in the committed version. Remove stray '*' in the text. Sponsored by: The FreeBSD Foundation. MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Aug 11 10:41:19 2016 (r303957) +++ head/sys/amd64/amd64/pmap.c Thu Aug 11 12:37:11 2016 (r303958) @@ -561,9 +561,9 @@ pmap_delayed_invl_wait(vm_page_t m) * block to complete before proceeding. * * The function works by setting the DI generation number for m's PV - * list to at least * the number for the current thread. This forces - * a caller to pmap_delayed_invl_wait() to spin until current thread - * calls pmap_delayed_invl_finished(). + * list to at least the DI generation number of the current thread. + * This forces a caller of pmap_delayed_invl_wait() to block until + * current thread calls pmap_delayed_invl_finished(). */ static void pmap_delayed_invl_page(vm_page_t m) From owner-svn-src-head@freebsd.org Thu Aug 11 13:42:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 260DABB5958; Thu, 11 Aug 2016 13:42:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA75D13C7; Thu, 11 Aug 2016 13:42:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BDgWOr016536; Thu, 11 Aug 2016 13:42:32 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BDgWww016534; Thu, 11 Aug 2016 13:42:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <201608111342.u7BDgWww016534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 11 Aug 2016 13:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303959 - in head: share/mk sys/modules/dtrace/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.22 Precedence: list List-Id: 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, 11 Aug 2016 13:42:33 -0000 Author: br Date: Thu Aug 11 13:42:31 2016 New Revision: 303959 URL: https://svnweb.freebsd.org/changeset/base/303959 Log: Revert r303911 "Remove extra -msoft-float flags settings." This was not properly tested. Modified: head/share/mk/bsd.cpu.mk head/sys/modules/dtrace/dtrace/Makefile Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Aug 11 12:37:11 2016 (r303958) +++ head/share/mk/bsd.cpu.mk Thu Aug 11 13:42:31 2016 (r303959) @@ -327,6 +327,11 @@ CFLAGS += -mfloat-abi=softfp .endif .endif +.if ${MACHINE_CPUARCH} == "riscv" +CFLAGS += -msoft-float +ACFLAGS += -msoft-float +.endif + # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Thu Aug 11 12:37:11 2016 (r303958) +++ head/sys/modules/dtrace/dtrace/Makefile Thu Aug 11 13:42:31 2016 (r303959) @@ -58,6 +58,11 @@ assym.o: assym.s ${AS} -meabi=5 -o assym.o assym.s .endif +.if ${MACHINE_CPUARCH} == "riscv" +assym.o: assym.s + ${AS} -msoft-float -o assym.o assym.s +.endif + .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-head@freebsd.org Thu Aug 11 14:27:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BCEDBB68BE; Thu, 11 Aug 2016 14:27:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC971E90; Thu, 11 Aug 2016 14:27:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BERNE8031711; Thu, 11 Aug 2016 14:27:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BERNXs031710; Thu, 11 Aug 2016 14:27:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608111427.u7BERNXs031710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 11 Aug 2016 14:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303961 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 14:27:24 -0000 Author: trasz Date: Thu Aug 11 14:27:23 2016 New Revision: 303961 URL: https://svnweb.freebsd.org/changeset/base/303961 Log: Implement autofs_print(), for improved debugging experience. MFC after: 1 month Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Thu Aug 11 13:54:17 2016 (r303960) +++ head/sys/fs/autofs/autofs_vnops.c Thu Aug 11 14:27:23 2016 (r303961) @@ -329,6 +329,21 @@ autofs_mkdir(struct vop_mkdir_args *ap) return (error); } +static int +autofs_print(struct vop_print_args *ap) +{ + struct vnode *vp; + struct autofs_node *anp; + + vp = ap->a_vp; + anp = vp->v_data; + + printf(" name \"%s\", fileno %d, cached %d, wildcards %d\n", + anp->an_name, anp->an_fileno, anp->an_cached, anp->an_wildcards); + + return (0); +} + /* * Write out a single 'struct dirent', based on 'name' and 'fileno' arguments. */ @@ -529,6 +544,7 @@ struct vop_vector autofs_vnodeops = { .vop_link = VOP_EOPNOTSUPP, .vop_mkdir = autofs_mkdir, .vop_mknod = VOP_EOPNOTSUPP, + .vop_print = autofs_print, .vop_read = VOP_EOPNOTSUPP, .vop_readdir = autofs_readdir, .vop_remove = VOP_EOPNOTSUPP, From owner-svn-src-head@freebsd.org Thu Aug 11 15:00:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9FE9BB5263; Thu, 11 Aug 2016 15:00:56 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 961581174; Thu, 11 Aug 2016 15:00:56 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BF0tDb043195; Thu, 11 Aug 2016 15:00:55 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BF0t65043194; Thu, 11 Aug 2016 15:00:55 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201608111500.u7BF0t65043194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Thu, 11 Aug 2016 15:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303962 - head/sys/boot/i386/btx/btxldr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 15:00:56 -0000 Author: stevek Date: Thu Aug 11 15:00:55 2016 New Revision: 303962 URL: https://svnweb.freebsd.org/changeset/base/303962 Log: Add the missing space between .asciz directive and opening quote for some lines within #ifdef BTXLDR_VERBOSE/#endif Reported by: Kevin Zheng Reviewed by: jhb Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D7464 Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Thu Aug 11 14:27:23 2016 (r303961) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Thu Aug 11 15:00:55 2016 (r303962) @@ -382,12 +382,12 @@ e_fmt: .asciz "Error: Client format not #ifdef BTXLDR_VERBOSE m_mem: .asciz "Starting in protected mode (base mem=\0)\n" m_esp: .asciz "Arguments passed (esp=\0):\n" -m_args: .asciz"\n" +m_args: .asciz "\n" m_rel_bi: .asciz "Relocated bootinfo (size=48) to \0\n" m_rel_args: .asciz "Relocated arguments (size=18) to \0\n" m_rel_btx: .asciz "Relocated kernel (size=\0) to \0\n" From owner-svn-src-head@freebsd.org Thu Aug 11 15:06:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339BDBB54E7; Thu, 11 Aug 2016 15:06:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F06751604; Thu, 11 Aug 2016 15:06:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BF6D9u046654; Thu, 11 Aug 2016 15:06:13 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BF6DX4046653; Thu, 11 Aug 2016 15:06:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608111506.u7BF6DX4046653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 11 Aug 2016 15:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303963 - 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.22 Precedence: list List-Id: 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, 11 Aug 2016 15:06:14 -0000 Author: bz Date: Thu Aug 11 15:06:12 2016 New Revision: 303963 URL: https://svnweb.freebsd.org/changeset/base/303963 Log: Revert r303890 for now here as camdd fails to build on powerpc* due to device_t only being available under _KERNEL. Reported by: bde (_KERNEL in general), kib (build failure) MFC after: 1 day X-MFC with: r303890 Modified: head/sys/powerpc/include/bus_dma.h Modified: head/sys/powerpc/include/bus_dma.h ============================================================================== --- head/sys/powerpc/include/bus_dma.h Thu Aug 11 15:00:55 2016 (r303962) +++ head/sys/powerpc/include/bus_dma.h Thu Aug 11 15:06:12 2016 (r303963) @@ -30,6 +30,8 @@ #include -int bus_dma_tag_set_iommu(bus_dma_tag_t, device_t iommu, void *cookie); +struct device; + +int bus_dma_tag_set_iommu(bus_dma_tag_t, struct device *iommu, void *cookie); #endif /* _POWERPC_BUS_DMA_H_ */ From owner-svn-src-head@freebsd.org Thu Aug 11 15:10:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD1C2BB5660; Thu, 11 Aug 2016 15:10:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E0EE18D1; Thu, 11 Aug 2016 15:10:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D8BB625D389C; Thu, 11 Aug 2016 15:10:18 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E51E7D1F839; Thu, 11 Aug 2016 15:10:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id G824wzfcjfga; Thu, 11 Aug 2016 15:10:16 +0000 (UTC) Received: from [10.248.105.13] (fresh-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4920:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DFA20D1F814; Thu, 11 Aug 2016 15:10:15 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Jean-S??bastien P??dron" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Konstantin Belousov" Subject: Re: svn commit: r303890 - in head/sys: contrib/ncsw/user/env contrib/octeon-sdk dev/auxio dev/bktr dev/e1000 dev/ixgb dev/ixgbe dev/ixl dev/netmap dev/pci dev/sound/sbus dev/tpm kern mips/nlm/dev/net m... Date: Thu, 11 Aug 2016 15:10:13 +0000 Message-ID: <18158D1D-52E7-4894-A606-6672E81A1D45@FreeBSD.org> In-Reply-To: <20160810110229.GK83214@kib.kiev.ua> References: <201608091932.u79JW6Y6069448@repo.freebsd.org> <20160810110229.GK83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (2.0BETAr6047) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 15:10:23 -0000 On 10 Aug 2016, at 11:02, Konstantin Belousov wrote: > On Tue, Aug 09, 2016 at 07:32:06PM +0000, Jean-S??bastien P??dron = > wrote: >> Author: dumbbell >> Date: Tue Aug 9 19:32:06 2016 >> New Revision: 303890 >> URL: https://svnweb.freebsd.org/changeset/base/303890 >> >> Log: >> Consistently use `device_t` >> >> Several files use the internal name of `struct device` instead of >> `device_t` which is part of the public API. This patch changes all >> `struct device *` to `device_t`. >> >> The remaining occurrences of `struct device` are those referring to = >> the >> Linux or OpenBSD version of the structure, or the code is not built = >> on >> FreeBSD and it's unclear what to do. >> >> Submitted by: Matthew Macy (previous version) >> Approved by: emaste, jhibbits, sbruno >> MFC after: 3 days >> Differential Revision: https://reviews.freebsd.org/D7447 > > On powerpc and powerpc64, at r303902, I got > =3D=3D=3D> usr.sbin/camdd (all) > In file included from = > /scratch/tmp/kib/obj/powerpc.powerpc64/scratch/tmp/kib/src > /tmp/usr/include/machine/bus.h:463, > from /scratch/tmp/kib/src/usr.sbin/camdd/camdd.c:54: > /scratch/tmp/kib/obj/powerpc.powerpc64/scratch/tmp/kib/src/tmp/usr/incl= ude/machi > ne/bus_dma.h:33: error: expected declaration specifiers or '...' = > before 'device_ > t' > --- camdd.o --- > *** [camdd.o] Error code 1 > I waited for another day; now just reverted the change on the header = file in order to get a working universe build again hopefully. In case = this will be MFCed please take appropriate care to not break 11. /bz From owner-svn-src-head@freebsd.org Thu Aug 11 16:59:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C87BB68D5; Thu, 11 Aug 2016 16:59:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A3AF180B; Thu, 11 Aug 2016 16:59:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ECEC6B953; Thu, 11 Aug 2016 12:59:55 -0400 (EDT) From: John Baldwin To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303963 - head/sys/powerpc/include Date: Thu, 11 Aug 2016 09:40:12 -0700 Message-ID: <1743387.a2iKJ8FVcJ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608111506.u7BF6DX4046653@repo.freebsd.org> References: <201608111506.u7BF6DX4046653@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 11 Aug 2016 12:59:56 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 16:59:57 -0000 On Thursday, August 11, 2016 03:06:13 PM Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Aug 11 15:06:12 2016 > New Revision: 303963 > URL: https://svnweb.freebsd.org/changeset/base/303963 > > Log: > Revert r303890 for now here as camdd fails to build on powerpc* > due to device_t only being available under _KERNEL. > > Reported by: bde (_KERNEL in general), kib (build failure) > MFC after: 1 day > X-MFC with: r303890 I think the real issue though is exposting this function prototype to userland (I looked at it the other day). camdd only wants bus_dma_segment_t. It also explicitly includes which is a no-no. I think this should be fixed to either define a suitable bus_dma_segment_t explicitly in libcam.h or the bus_dma headers have to all be audited to add appropriate #ifdef _KERNEL guards. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Aug 11 17:06:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3CEBB6C62; Thu, 11 Aug 2016 17:06:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5EC1F98; Thu, 11 Aug 2016 17:06:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BH6mlG093764; Thu, 11 Aug 2016 17:06:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BH6mxr093762; Thu, 11 Aug 2016 17:06:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608111706.u7BH6mxr093762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 11 Aug 2016 17:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303964 - 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.22 Precedence: list List-Id: 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, 11 Aug 2016 17:06:49 -0000 Author: bdrewery Date: Thu Aug 11 17:06:48 2016 New Revision: 303964 URL: https://svnweb.freebsd.org/changeset/base/303964 Log: PROGS: Support INTERNALPROG.prog=yes to not install it. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.README head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu Aug 11 15:06:12 2016 (r303963) +++ head/share/mk/bsd.README Thu Aug 11 17:06:48 2016 (r303964) @@ -331,6 +331,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make - DEBUG_FLAGS - DPADD - DPSRCS + - INTERNALPROG (no installation) - LDADD - LDFLAGS - LIBADD Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Thu Aug 11 15:06:12 2016 (r303963) +++ head/share/mk/bsd.progs.mk Thu Aug 11 17:06:48 2016 (r303964) @@ -24,8 +24,8 @@ PROGS += ${PROGS_CXX} # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS STRIP WARNS -PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \ - LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} +PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ + LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) .if defined(${v}.${PROG}) From owner-svn-src-head@freebsd.org Thu Aug 11 17:53:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99BE0BB5944; Thu, 11 Aug 2016 17:53:55 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7531C21; Thu, 11 Aug 2016 17:53:54 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 96B3C25D3A0E; Thu, 11 Aug 2016 17:53:45 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id DE8B1D1F83C; Thu, 11 Aug 2016 17:53:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id NsSPvcP8cgQz; Thu, 11 Aug 2016 17:53:42 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 75ADAD1F814; Thu, 11 Aug 2016 17:53:42 +0000 (UTC) Date: Thu, 11 Aug 2016 17:53:41 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303963 - head/sys/powerpc/include In-Reply-To: <1743387.a2iKJ8FVcJ@ralph.baldwin.cx> Message-ID: References: <201608111506.u7BF6DX4046653@repo.freebsd.org> <1743387.a2iKJ8FVcJ@ralph.baldwin.cx> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 17:53:55 -0000 On Thu, 11 Aug 2016, John Baldwin wrote: > On Thursday, August 11, 2016 03:06:13 PM Bjoern A. Zeeb wrote: >> Author: bz >> Date: Thu Aug 11 15:06:12 2016 >> New Revision: 303963 >> URL: https://svnweb.freebsd.org/changeset/base/303963 >> >> Log: >> Revert r303890 for now here as camdd fails to build on powerpc* >> due to device_t only being available under _KERNEL. >> >> Reported by: bde (_KERNEL in general), kib (build failure) >> MFC after: 1 day >> X-MFC with: r303890 > > I think the real issue though is exposting this function prototype to > userland (I looked at it the other day). camdd only wants bus_dma_segment_t. > It also explicitly includes which is a no-no. I think this > should be fixed to either define a suitable bus_dma_segment_t explicitly > in libcam.h or the bus_dma headers have to all be audited to add > appropriate #ifdef _KERNEL guards. Oh yes, I agree with you. Having looked at all places I just decided that my first priority was to get builds unbroken and then leave it to others doing the right thing (tm). camdd also has a couple of strange includes, duplicated includes (given things are implicatly included), yaddah. I won't be in the way of a cleanup unless the builds break again :) -- Bjoern A. Zeeb r15:7 From owner-svn-src-head@freebsd.org Thu Aug 11 21:13:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F414BB63B6; Thu, 11 Aug 2016 21:13:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A77C1C6F; Thu, 11 Aug 2016 21:13:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BLDwoc087675; Thu, 11 Aug 2016 21:13:58 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BLDw0c087673; Thu, 11 Aug 2016 21:13:58 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201608112113.u7BLDw0c087673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 11 Aug 2016 21:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303971 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 21:13:59 -0000 Author: smh Date: Thu Aug 11 21:13:58 2016 New Revision: 303971 URL: https://svnweb.freebsd.org/changeset/base/303971 Log: Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS Correctly limit npairs passed to vtnet_ctrl_mq_cmd. This ensures that VQ_ALLOC_INFO_INIT is called with the correct value, preventing the system from hanging when max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS. Add new sysctl requested_vq_pairs which allow the user to configure the requested number of virtqueue pairs. The actual value will still take into account the system limits. Also missing sysctls for the current tunables so their values can be seen. PR: 207446 Reported by: Andy Carrel MFC after: 3 days Relnotes: Yes Sponsored by: Multiplay Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Aug 11 20:48:03 2016 (r303970) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Aug 11 21:13:58 2016 (r303971) @@ -230,18 +230,32 @@ static void vtnet_disable_interrupts(str static int vtnet_tunable_int(struct vtnet_softc *, const char *, int); /* Tunables. */ +static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters"); static int vtnet_csum_disable = 0; TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN, + &vtnet_csum_disable, 0, "Disables receive and send checksum offload"); static int vtnet_tso_disable = 0; TUNABLE_INT("hw.vtnet.tso_disable", &vtnet_tso_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, + 0, "Disables TCP Segmentation Offload"); static int vtnet_lro_disable = 0; TUNABLE_INT("hw.vtnet.lro_disable", &vtnet_lro_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, + 0, "Disables TCP Large Receive Offload"); static int vtnet_mq_disable = 0; TUNABLE_INT("hw.vtnet.mq_disable", &vtnet_mq_disable); -static int vtnet_mq_max_pairs = 0; +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, &vtnet_mq_disable, + 0, "Disables Multi Queue support"); +static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS; TUNABLE_INT("hw.vtnet.mq_max_pairs", &vtnet_mq_max_pairs); +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN, + &vtnet_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs"); static int vtnet_rx_process_limit = 512; TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); +SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &vtnet_rx_process_limit, 0, + "Limits the number RX segments processed in a single pass"); static uma_zone_t vtnet_tx_header_zone; @@ -597,7 +611,6 @@ static void vtnet_setup_features(struct vtnet_softc *sc) { device_t dev; - int max_pairs, max; dev = sc->vtnet_dev; @@ -646,32 +659,31 @@ vtnet_setup_features(struct vtnet_softc if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) && sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) { - max_pairs = virtio_read_dev_config_2(dev, + sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev, offsetof(struct virtio_net_config, max_virtqueue_pairs)); - if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN || - max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) - max_pairs = 1; } else - max_pairs = 1; + sc->vtnet_max_vq_pairs = 1; - if (max_pairs > 1) { + if (sc->vtnet_max_vq_pairs > 1) { /* - * Limit the maximum number of queue pairs to the number of - * CPUs or the configured maximum. The actual number of - * queues that get used may be less. + * Limit the maximum number of queue pairs to the lower of + * the number of CPUs and the configured maximum. + * The actual number of queues that get used may be less. */ + int max; + max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs); - if (max > 0 && max_pairs > max) - max_pairs = max; - if (max_pairs > mp_ncpus) - max_pairs = mp_ncpus; - if (max_pairs > VTNET_MAX_QUEUE_PAIRS) - max_pairs = VTNET_MAX_QUEUE_PAIRS; - if (max_pairs > 1) - sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) { + if (max > mp_ncpus) + max = mp_ncpus; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) + max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; + if (max > 1) { + sc->vtnet_requested_vq_pairs = max; + sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + } + } } - - sc->vtnet_max_vq_pairs = max_pairs; } static int @@ -2982,13 +2994,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s dev = sc->vtnet_dev; if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) { - MPASS(sc->vtnet_max_vq_pairs == 1); sc->vtnet_act_vq_pairs = 1; return; } - /* BMV: Just use the maximum configured for now. */ - npairs = sc->vtnet_max_vq_pairs; + npairs = sc->vtnet_requested_vq_pairs; if (vtnet_ctrl_mq_cmd(sc, npairs) != 0) { device_printf(dev, @@ -3852,6 +3862,9 @@ vtnet_setup_sysctl(struct vtnet_softc *s SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_vq_pairs", CTLFLAG_RD, &sc->vtnet_max_vq_pairs, 0, "Maximum number of supported virtqueue pairs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "requested_vq_pairs", + CTLFLAG_RD, &sc->vtnet_requested_vq_pairs, 0, + "Requested number of virtqueue pairs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "act_vq_pairs", CTLFLAG_RD, &sc->vtnet_act_vq_pairs, 0, "Number of active virtqueue pairs"); Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Thu Aug 11 20:48:03 2016 (r303970) +++ head/sys/dev/virtio/network/if_vtnetvar.h Thu Aug 11 21:13:58 2016 (r303971) @@ -155,6 +155,7 @@ struct vtnet_softc { int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; + int vtnet_requested_vq_pairs; struct virtqueue *vtnet_ctrl_vq; struct vtnet_mac_filter *vtnet_mac_filter; From owner-svn-src-head@freebsd.org Thu Aug 11 23:04:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CA74BB7F62; Thu, 11 Aug 2016 23:04:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D161D26; Thu, 11 Aug 2016 23:04:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BN4QUk029042; Thu, 11 Aug 2016 23:04:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BN4Qbk029040; Thu, 11 Aug 2016 23:04:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608112304.u7BN4Qbk029040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 11 Aug 2016 23:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303974 - in head/sys: boot/fdt/dts/arm modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 11 Aug 2016 23:04:27 -0000 Author: manu Date: Thu Aug 11 23:04:26 2016 New Revision: 303974 URL: https://svnweb.freebsd.org/changeset/base/303974 Log: Rename pcduino3b.dts to pcduino3.dts The only difference between 3 and 3B is the size of the RJ45 port. And now we have a uboot port that expect pcduino3.dts to be present. Reported by: imp Added: head/sys/boot/fdt/dts/arm/pcduino3.dts - copied unchanged from r303973, head/sys/boot/fdt/dts/arm/pcduino3b.dts Deleted: head/sys/boot/fdt/dts/arm/pcduino3b.dts Modified: head/sys/modules/dtb/allwinner/Makefile Copied: head/sys/boot/fdt/dts/arm/pcduino3.dts (from r303973, head/sys/boot/fdt/dts/arm/pcduino3b.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/pcduino3.dts Thu Aug 11 23:04:26 2016 (r303974, copy of r303973, head/sys/boot/fdt/dts/arm/pcduino3b.dts) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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 "sun7i-a20-pcduino3.dts" +#include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" + +/ { + soc@01c00000 { + hdmi@01c16000 { + status = "okay"; + }; + + hdmiaudio { + status = "okay"; + }; + }; +}; + +&gmac { + pinctrl-0 = <&gmac_pins_rgmii_a>; + phy-mode = "rgmii"; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu Aug 11 22:30:16 2016 (r303973) +++ head/sys/modules/dtb/allwinner/Makefile Thu Aug 11 23:04:26 2016 (r303974) @@ -7,7 +7,7 @@ DTS= \ cubieboard2.dts \ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ - pcduino3b.dts \ + pcduino3.dts \ sinovoip-bpi-m3.dts .include From owner-svn-src-head@freebsd.org Thu Aug 11 23:52:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AEFBBB5207; Thu, 11 Aug 2016 23:52:25 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6961736; Thu, 11 Aug 2016 23:52:25 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BNqO55047941; Thu, 11 Aug 2016 23:52:24 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BNqOPG047940; Thu, 11 Aug 2016 23:52:24 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608112352.u7BNqOPG047940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Thu, 11 Aug 2016 23:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303978 - 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.22 Precedence: list List-Id: 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, 11 Aug 2016 23:52:25 -0000 Author: karels Date: Thu Aug 11 23:52:24 2016 New Revision: 303978 URL: https://svnweb.freebsd.org/changeset/base/303978 Log: Fix kernel build with TCP_RFC7413 option The current in_pcb.h includes route.h, which includes sockaddr structures. Including should require ; add it in the appropriate place. PR: 211385 Submitted by: Sergey Kandaurov and iron at mail.ua Reviewed by: gnn Approved by: gnn (mentor) MFC after: 1 day Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Thu Aug 11 23:49:55 2016 (r303977) +++ head/sys/netinet/tcp_fastopen.c Thu Aug 11 23:52:24 2016 (r303978) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Fri Aug 12 00:26:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7CA1BB5D2D; Fri, 12 Aug 2016 00:26:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 906FB17C0; Fri, 12 Aug 2016 00:26:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 838741ABE; Fri, 12 Aug 2016 00:26:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3FC41212DF; Fri, 12 Aug 2016 00:26:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id RcK5y7UOQU9A; Fri, 12 Aug 2016 00:26:13 +0000 (UTC) Subject: Re: svn commit: r303019 - head/sys/geom DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com D4729212DA To: Peter Wemm , svn-src-all@freebsd.org References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Date: Thu, 11 Aug 2016 17:26:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <6198652.UmU69kS6Zt@overcee.wemm.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BJhoLgMkksH5EckaHRAj2DQh0ovuEgcBq" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 00:26:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BJhoLgMkksH5EckaHRAj2DQh0ovuEgcBq Content-Type: multipart/mixed; boundary="p6ApadA0NaQUCkFPEEw0Q9Wi9nIlAKWS5" From: Bryan Drewery To: Peter Wemm , svn-src-all@freebsd.org Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org Message-ID: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> In-Reply-To: <6198652.UmU69kS6Zt@overcee.wemm.org> --p6ApadA0NaQUCkFPEEw0Q9Wi9nIlAKWS5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 7/23/2016 10:27 PM, Peter Wemm wrote: > On Saturday, July 23, 2016 09:39:00 PM Peter Wemm wrote: >> On Tuesday, July 19, 2016 05:36:21 AM Andrey V. Elsukov wrote: >>> Author: ae >>> Date: Tue Jul 19 05:36:21 2016 >>> New Revision: 303019 >>> URL: https://svnweb.freebsd.org/changeset/base/303019 >>> >>> Log: >>> Use g_resize_provider() to change the size of GEOM_DISK provider, >>> when it is being opened. This should fix the possible loss of a res= ize >>> event when disk capacity changed. >> >> Are you sure about this? We have machines in the freebsd.org cluster = that >> now panic on boot: >> >> Trying to mount root from zfs:zroot []... >> GEOM_PART: da0 was automatically resized. >> Use `gpart commit da0` to save changes or `gpart undo da0` to revert= them. >> GEOM_PART: integrity check failed (da0, GPT) >> >> Fatal trap 12: page fault while in kernel mode >> cpuid =3D 1; apic id =3D 01 >> fault virtual address =3D 0x48 >> fault code =3D supervisor read data, page not present >> instruction pointer =3D 0x20:0xffffffff80740005 >> stack pointer =3D 0x28:0xfffffe01f119db10 >> frame pointer =3D 0x28:0xfffffe01f119db30 >> code segment =3D base 0x0, limit 0xfffff, type 0x1b >> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >> processor eflags =3D interrupt enabled, resume, IOPL =3D 0 >> current process =3D 13 (g_event) >> [ thread pid 13 tid 100019 ] >> Stopped at g_part_resize+0x35: testb $0x8,0x48(%rbx) >> >> >> >> db> where >> Tracing pid 13 tid 100019 td 0xfffff8000426fa00 >> g_part_resize() at g_part_resize+0x35/frame 0xfffffe01f119db30 >> g_resize_provider_event() at g_resize_provider_event+0xb5/frame >> 0xfffffe01f119d0 g_run_events() at g_run_events+0x20e/frame >> 0xfffffe01f119dbb0 >> .. >> >> It is exploding here: >> g_part_resize(struct g_consumer *cp) >> { >> struct g_part_table *table; >> >> G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, >> cp->provider->name)); g_topology_assert(); >> >> table =3D cp->geom->softc; >> if (table->gpt_opened =3D=3D 0) { >> ^^^^^^^^^ (table is null) >> >> Are you creating events too soon now? >=20 > Sometimes da0 fails, other times da1 fails.. and sometimes it is comple= tely=20 > fine. There is some sort of race going on with this change during the = very=20 > first moments of bootup. >=20 On r303467 I ran into this: panic @ time 1470916206.652, thread 0xfffff8000412f000: g_resize_provider_event but withered cpuid =3D 0 Panic occurred in module kernel loaded at 0xffffffff80200000: Stack: -------------------------------------------------- kernel:kassert_panic+0x166 kernel:g_resize_provider_event+0x181 kernel:g_run_events+0x186^M^M kernel:fork_exit+0x83^M^M -------------------------------------------------- No further information available unfortunately. --=20 Regards, Bryan Drewery --p6ApadA0NaQUCkFPEEw0Q9Wi9nIlAKWS5-- --BJhoLgMkksH5EckaHRAj2DQh0ovuEgcBq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXrReiAAoJEDXXcbtuRpfPwCcH/jaBBL75tTHMdt/WfkRLfZyq S49GZcoF4WdHcyWa5nvNYtAXHAcLfpNc9MyZsl5Vbjr/e3tv9V8b9KMzyELp3/+5 0Jyxx60NO+1jHHFYJkQs5kR7jiiixVaesIuVa+dspR3qiqJHDinxWmR2+pfFpp4U ggUB3VodjUlLb9Gs2g71WdJ+J+1bupttpLqHAJJTbi5mxVPIrQNQ5gFT0a+txWif 0g5BJuZnB7vrCuCKgnBm50eNnw4tzyAhhzXyRZ2TaV1v7xvAgsN1DlWdpXUWeCBH +WrxnYfdA5+nPCNnTsC8ONtsyUIeEQJQPAYCkmV4T88/NtTijM7rtedFVHKXJSA= =I2Cf -----END PGP SIGNATURE----- --BJhoLgMkksH5EckaHRAj2DQh0ovuEgcBq-- From owner-svn-src-head@freebsd.org Fri Aug 12 00:29:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C68BB5DF0; Fri, 12 Aug 2016 00:29:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9E71D196B; Fri, 12 Aug 2016 00:29:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 91B811C24; Fri, 12 Aug 2016 00:29:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 59176212F2; Fri, 12 Aug 2016 00:29:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id mm0iby2LRfW9; Fri, 12 Aug 2016 00:29:42 +0000 (UTC) Subject: Re: svn commit: r303019 - head/sys/geom DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CAC4F212EB To: Peter Wemm , svn-src-all@freebsd.org References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Thu, 11 Aug 2016 17:29:41 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2kcffhj5W2J6CgSSdv55iWKmGb5JENCdA" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 00:29:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2kcffhj5W2J6CgSSdv55iWKmGb5JENCdA Content-Type: multipart/mixed; boundary="17WHJ3RAvddNgIinO1Obf5qvVSbp4CkOE" From: Bryan Drewery To: Peter Wemm , svn-src-all@freebsd.org Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> In-Reply-To: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> --17WHJ3RAvddNgIinO1Obf5qvVSbp4CkOE Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/11/2016 5:26 PM, Bryan Drewery wrote: > On 7/23/2016 10:27 PM, Peter Wemm wrote: >> On Saturday, July 23, 2016 09:39:00 PM Peter Wemm wrote: >>> On Tuesday, July 19, 2016 05:36:21 AM Andrey V. Elsukov wrote: >>>> Author: ae >>>> Date: Tue Jul 19 05:36:21 2016 >>>> New Revision: 303019 >>>> URL: https://svnweb.freebsd.org/changeset/base/303019 >>>> >>>> Log: >>>> Use g_resize_provider() to change the size of GEOM_DISK provider, >>>> when it is being opened. This should fix the possible loss of a re= size >>>> event when disk capacity changed. >>> >>> Are you sure about this? We have machines in the freebsd.org cluster= that >>> now panic on boot: >>> >>> Trying to mount root from zfs:zroot []... >>> GEOM_PART: da0 was automatically resized. >>> Use `gpart commit da0` to save changes or `gpart undo da0` to rever= t them. >>> GEOM_PART: integrity check failed (da0, GPT) >>> >>> Fatal trap 12: page fault while in kernel mode >>> cpuid =3D 1; apic id =3D 01 >>> fault virtual address =3D 0x48 >>> fault code =3D supervisor read data, page not present >>> instruction pointer =3D 0x20:0xffffffff80740005 >>> stack pointer =3D 0x28:0xfffffe01f119db10 >>> frame pointer =3D 0x28:0xfffffe01f119db30 >>> code segment =3D base 0x0, limit 0xfffff, type 0x1b >>> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >>> processor eflags =3D interrupt enabled, resume, IOPL =3D 0 >>> current process =3D 13 (g_event) >>> [ thread pid 13 tid 100019 ] >>> Stopped at g_part_resize+0x35: testb $0x8,0x48(%rbx) >>> >>> >>> >>> db> where >>> Tracing pid 13 tid 100019 td 0xfffff8000426fa00 >>> g_part_resize() at g_part_resize+0x35/frame 0xfffffe01f119db30 >>> g_resize_provider_event() at g_resize_provider_event+0xb5/frame >>> 0xfffffe01f119d0 g_run_events() at g_run_events+0x20e/frame >>> 0xfffffe01f119dbb0 >>> .. >>> >>> It is exploding here: >>> g_part_resize(struct g_consumer *cp) >>> { >>> struct g_part_table *table; >>> >>> G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, >>> cp->provider->name)); g_topology_assert(); >>> >>> table =3D cp->geom->softc; >>> if (table->gpt_opened =3D=3D 0) { >>> ^^^^^^^^^ (table is null) >>> >>> Are you creating events too soon now? >> >> Sometimes da0 fails, other times da1 fails.. and sometimes it is compl= etely=20 >> fine. There is some sort of race going on with this change during the= very=20 >> first moments of bootup. >> >=20 > On r303467 I ran into this: >=20 > panic @ time 1470916206.652, thread 0xfffff8000412f000: > g_resize_provider_event but withered > cpuid =3D 0 > Panic occurred in module kernel loaded at 0xffffffff80200000: >=20 > Stack: -------------------------------------------------- > kernel:kassert_panic+0x166 > kernel:g_resize_provider_event+0x181 > kernel:g_run_events+0x186^M^M > kernel:fork_exit+0x83^M^M > -------------------------------------------------- >=20 > No further information available unfortunately. >=20 da13 at mps0 bus 0 scbus0 target 14 lun 0^M^M da13: s/n JPW9K0N00LSZYL detached^M^M (da24:mps0: mps0:0:Target 15 supports SSU^M^M 14:mps0: 0): Target 17 supports SSU^M^M UNMAPPED^M^M =2E.. g_access(969): provider da13 has error^M^M da24 at mps0 bus 0 scbus0 target 14 lun 0^M^M g_access(969): provider da13 has error^M^M da24: g_access(969): provider da13 has error^M^M da24: SCSI-6 device^M^= M da24: Serial Number JPW9K0N00LSZYL^M^M da24: 300.000MB/s transfers^M^M da24: Command Queueing enabled^M^M da24: 476940MB (976773168 512 byte sectors)^M^M da24: quirks=3D0x2^M^M (da13:da18 at mps0 bus 0 scbus0 target 12 lun 0^M^M mps0:0:da18: 14:0): s/n JPW9K0N00LT8ELremoving device entry^M^M detached^M^M (da13:da16 at mps0 bus 0 scbus0 target 13 lun 0^M^M mps0:0:da16: 14:0): s/n JPW9K0N00LTB4LPeriph destroyed^M^M detached^M^M da17 at mps0 bus 0 scbus0 target 10 lun 0^M^M da17: s/n JPW9K0N00JZESL detached^M^M da20 at mps0 bus 0 scbus0 target 16 lun 0^M^M da20: s/n JPW9K0N00K2PEL detached^M^M panic @ time 1470916206.652, thread 0xfffff8000412f000: g_resize_provider_event but withered^M^M =2E.. --=20 Regards, Bryan Drewery --17WHJ3RAvddNgIinO1Obf5qvVSbp4CkOE-- --2kcffhj5W2J6CgSSdv55iWKmGb5JENCdA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXrRh1AAoJEDXXcbtuRpfPW8QIAIa/XigCyeKPe6Wpum73+uKw GLqxb4oakDbiqQmJ51bT+zOl9j/mNHKltmbOWK7oj0E1Cbtb1vlb9RqkHrSK/+jI o17yodtPMkp7F1IfL3hui9E/75fbXilKAOMa78b40vOxNwlq6NcLhypv1KbFGezy JTr/WbmOZWveoUgVvFXci4h3uZLHy3JXDXuESxB8/AlTYidxFJBwt2uXp/7+G3Tb AGZabMd3li3ATihwQgTElBs/5Ig9pjAnYy2Oi/cT6KbMRe5e4HPeJ2L9vdaEaR7Z TehvhZ5RErZOo7QnJRB7pPROrw1+kYytk7IJWF4qrHRYu6SxY72svFlMd3vW1Zc= =wik5 -----END PGP SIGNATURE----- --2kcffhj5W2J6CgSSdv55iWKmGb5JENCdA-- From owner-svn-src-head@freebsd.org Fri Aug 12 01:13:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D22BB6D0D; Fri, 12 Aug 2016 01:13:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44FBC1272; Fri, 12 Aug 2016 01:13:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C1DYnC077740; Fri, 12 Aug 2016 01:13:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C1DYiM077739; Fri, 12 Aug 2016 01:13:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608120113.u7C1DYiM077739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 12 Aug 2016 01:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303981 - head/tools/tools/ath/ath_ee_9300_print X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 01:13:35 -0000 Author: adrian Date: Fri Aug 12 01:13:34 2016 New Revision: 303981 URL: https://svnweb.freebsd.org/changeset/base/303981 Log: Print out some more fields. Tested: * AR9331 SoC (Carambola 2) - specifically looking for the tuning caps fields. Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/main.c Fri Aug 12 01:05:07 2016 (r303980) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Fri Aug 12 01:13:34 2016 (r303981) @@ -72,8 +72,10 @@ eeprom_9300_base_print(const uint16_t *b ee_base->device_cap, ee_base->device_type); - printf("| pwrTableOffset: %d dB, feature_enable: 0x%02x MiscConfig: 0x%02x |\n", + printf("| pwrTableOffset: %d dB, TuningCaps=0x%02x 0x%02x feature_enable: 0x%02x MiscConfig: 0x%02x |\n", ee_base->pwrTableOffset, + ee_base->params_for_tuning_caps[0], + ee_base->params_for_tuning_caps[1], ee_base->feature_enable, ee_base->misc_configuration); From owner-svn-src-head@freebsd.org Fri Aug 12 03:23:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4757FBB6736; Fri, 12 Aug 2016 03:23:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1B751925; Fri, 12 Aug 2016 03:22:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C3MxrI025908; Fri, 12 Aug 2016 03:22:59 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C3MxFm025907; Fri, 12 Aug 2016 03:22:59 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608120322.u7C3MxFm025907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 12 Aug 2016 03:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303982 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 03:23:00 -0000 Author: alc Date: Fri Aug 12 03:22:58 2016 New Revision: 303982 URL: https://svnweb.freebsd.org/changeset/base/303982 Log: Correct errors and clean up the comments on the active queue scan. Eliminate some unnecessary blank lines. Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Aug 12 01:13:34 2016 (r303981) +++ head/sys/vm/vm_pageout.c Fri Aug 12 03:22:58 2016 (r303982) @@ -1188,15 +1188,13 @@ relock_queue: /* * Scan the active queue for pages that can be deactivated. Update * the per-page activity counter and use it to identify deactivation - * candidates. + * candidates. Held pages may be deactivated. */ for (m = TAILQ_FIRST(&pq->pq_pl), scanned = 0; m != NULL && (scanned < min_scan || (page_shortage > 0 && scanned < maxscan)); m = next, scanned++) { - KASSERT(m->queue == PQ_ACTIVE, ("vm_pageout_scan: page %p isn't active", m)); - next = TAILQ_NEXT(m, plinks.q); if ((m->flags & PG_MARKER) != 0) continue; @@ -1210,8 +1208,8 @@ relock_queue: } /* - * The count for pagedaemon pages is done after checking the - * page for eligibility... + * The count for page daemon pages is updated after checking + * the page for eligibility. */ PCPU_INC(cnt.v_pdpages); @@ -1225,12 +1223,17 @@ relock_queue: act_delta = 0; /* - * Unlocked object ref count check. Two races are possible. - * 1) The ref was transitioning to zero and we saw non-zero, - * the pmap bits will be checked unnecessarily. - * 2) The ref was transitioning to one and we saw zero. - * The page lock prevents a new reference to this page so - * we need not check the reference bits. + * Perform an unsynchronized object ref count check. While + * the page lock ensures that the page is not reallocated to + * another object, in particular, one with unmanaged mappings + * that cannot support pmap_ts_referenced(), two races are, + * nonetheless, possible: + * 1) The count was transitioning to zero, but we saw a non- + * zero value. pmap_ts_referenced() will return zero + * because the page is not mapped. + * 2) The count was transitioning to one, but we saw zero. + * This race delays the detection of a new reference. At + * worst, we will deactivate and reactivate the page. */ if (m->object->ref_count != 0) act_delta += pmap_ts_referenced(m); From owner-svn-src-head@freebsd.org Fri Aug 12 07:04:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DCD1BB606B; Fri, 12 Aug 2016 07:04:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7D91553; Fri, 12 Aug 2016 07:03:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C73xW4007194; Fri, 12 Aug 2016 07:03:59 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C73whf007189; Fri, 12 Aug 2016 07:03:58 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608120703.u7C73whf007189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 12 Aug 2016 07:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303988 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 07:04:00 -0000 Author: ed Date: Fri Aug 12 07:03:58 2016 New Revision: 303988 URL: https://svnweb.freebsd.org/changeset/base/303988 Log: Reimplement dirname(3) to be thread-safe. Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach. Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning. Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component. Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355 Added: head/lib/libc/gen/dirname_compat.c - copied, changed from r303452, head/lib/libc/gen/dirname.c Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/dirname.3 head/lib/libc/gen/dirname.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Aug 12 06:19:40 2016 (r303987) +++ head/lib/libc/gen/Makefile.inc Fri Aug 12 07:03:58 2016 (r303988) @@ -29,6 +29,7 @@ SRCS+= __getosreldate.c \ devname.c \ dirfd.c \ dirname.c \ + dirname_compat.c \ disklabel.c \ dlfcn.c \ drand48.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Aug 12 06:19:40 2016 (r303987) +++ head/lib/libc/gen/Symbol.map Fri Aug 12 07:03:58 2016 (r303988) @@ -82,7 +82,6 @@ FBSD_1.0 { daemon; devname; devname_r; - dirname; getdiskbyname; dladdr; dlclose; @@ -418,6 +417,10 @@ FBSD_1.4 { stravis; }; +FBSD_1.5 { + dirname; +}; + FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; Modified: head/lib/libc/gen/dirname.3 ============================================================================== --- head/lib/libc/gen/dirname.3 Fri Aug 12 06:19:40 2016 (r303987) +++ head/lib/libc/gen/dirname.3 Fri Aug 12 07:03:58 2016 (r303988) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2016 +.Dd August 12, 2016 .Dt DIRNAME 3 .Os .Sh NAME @@ -37,6 +37,7 @@ Any trailing .Sq \&/ characters are not counted as part of the directory name. +.Sh RETURN VALUES If .Fa path is a null pointer, the empty string, or contains no @@ -46,40 +47,24 @@ characters, returns a pointer to the string .Qq \&. , signifying the current directory. +Otherwise, +it returns a pointer to the parent directory of +.Fa path . .Sh IMPLEMENTATION NOTES -The +This implementation of .Fn dirname -function -returns a pointer to internal storage space allocated on the first call -that will be overwritten -by subsequent calls. +uses the buffer provided by the caller to store the resulting parent +directory. +Other vendor implementations may return a pointer to internal storage +space instead. +The advantage of the former approach is that it ensures thread-safety, +while also placing no upper limit on the supported length of the +pathname. .Pp -Other vendor implementations of -.Fn dirname -may store their result in the input buffer, -making it safe to use in multithreaded applications. -Future versions of -.Fx -will follow this approach as well. -.Sh RETURN VALUES -On successful completion, -.Fn dirname -returns a pointer to the parent directory of -.Fa path . -.Pp -If -.Fn dirname -fails, a null pointer is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The following error codes may be set in -.Va errno : -.Bl -tag -width Er -.It Bq Er ENAMETOOLONG -The path component to be returned was larger than -.Dv MAXPATHLEN . -.El +The algorithm used by this implementation also discards redundant +slashes and +.Qq \&. +pathname components from the pathname string. .Sh SEE ALSO .Xr basename 1 , .Xr dirname 1 , @@ -96,5 +81,10 @@ function first appeared in .Ox 2.2 and .Fx 4.2 . +.Pp +In +.Fx 12.0 , +this function was reimplemented to store its result in the provided +input buffer. .Sh AUTHORS -.An "Todd C. Miller" +.An Nuxi, the Netherlands Modified: head/lib/libc/gen/dirname.c ============================================================================== --- head/lib/libc/gen/dirname.c Fri Aug 12 06:19:40 2016 (r303987) +++ head/lib/libc/gen/dirname.c Fri Aug 12 07:03:58 2016 (r303988) @@ -1,77 +1,90 @@ -/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 espie Exp $ */ - -/* - * Copyright (c) 1997, 2004 Todd C. Miller +/*- + * Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. + * 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. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); -#include #include -#include +#include #include -#include char * dirname(char *path) { - static char *dname = NULL; - size_t len; - const char *endp; - - if (dname == NULL) { - dname = (char *)malloc(MAXPATHLEN); - if (dname == NULL) - return(NULL); - } - - /* Empty or NULL string gets treated as "." */ - if (path == NULL || *path == '\0') { - dname[0] = '.'; - dname[1] = '\0'; - return (dname); + const char *in, *prev, *begin, *end; + char *out; + size_t prevlen; + bool skipslash; + + /* + * If path is a null pointer or points to an empty string, + * dirname() shall return a pointer to the string ".". + */ + if (path == NULL || *path == '\0') + return ((char *)"."); + + /* Retain at least one leading slash character. */ + in = out = *path == '/' ? path + 1 : path; + + skipslash = true; + prev = "."; + prevlen = 1; + for (;;) { + /* Extract the next pathname component. */ + while (*in == '/') + ++in; + begin = in; + while (*in != '/' && *in != '\0') + ++in; + end = in; + if (begin == end) + break; + + /* + * Copy over the previous pathname component, except if + * it's dot. There is no point in retaining those. + */ + if (prevlen != 1 || *prev != '.') { + if (!skipslash) + *out++ = '/'; + skipslash = false; + memmove(out, prev, prevlen); + out += prevlen; + } + + /* Preserve the pathname component for the next iteration. */ + prev = begin; + prevlen = end - begin; } - /* Strip any trailing slashes */ - endp = path + strlen(path) - 1; - while (endp > path && *endp == '/') - endp--; - - /* Find the start of the dir */ - while (endp > path && *endp != '/') - endp--; - - /* Either the dir is "/" or there are no slashes */ - if (endp == path) { - dname[0] = *endp == '/' ? '/' : '.'; - dname[1] = '\0'; - return (dname); - } else { - /* Move forward past the separating slashes */ - do { - endp--; - } while (endp > path && *endp == '/'); - } - - len = endp - path + 1; - if (len >= MAXPATHLEN) { - errno = ENAMETOOLONG; - return (NULL); - } - memcpy(dname, path, len); - dname[len] = '\0'; - return (dname); + /* + * If path does not contain a '/', then dirname() shall return a + * pointer to the string ".". + */ + if (out == path) + *out++ = '.'; + *out = '\0'; + return (path); } Copied and modified: head/lib/libc/gen/dirname_compat.c (from r303452, head/lib/libc/gen/dirname.c) ============================================================================== --- head/lib/libc/gen/dirname.c Thu Jul 28 16:54:12 2016 (r303452, copy source) +++ head/lib/libc/gen/dirname_compat.c Fri Aug 12 07:03:58 2016 (r303988) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); #include char * -dirname(char *path) +__freebsd11_dirname(char *path) { static char *dname = NULL; size_t len; @@ -75,3 +75,5 @@ dirname(char *path) dname[len] = '\0'; return (dname); } + +__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0); From owner-svn-src-head@freebsd.org Fri Aug 12 07:14:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B0E5BB62BB; Fri, 12 Aug 2016 07:14:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FAF31A66; Fri, 12 Aug 2016 07:14:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C7EfdB011024; Fri, 12 Aug 2016 07:14:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C7Efuo011022; Fri, 12 Aug 2016 07:14:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608120714.u7C7Efuo011022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 12 Aug 2016 07:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303989 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 07:14:42 -0000 Author: sephe Date: Fri Aug 12 07:14:40 2016 New Revision: 303989 URL: https://svnweb.freebsd.org/changeset/base/303989 Log: hyperv/hn: Simplify NDIS configuration. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7466 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:03:58 2016 (r303988) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:14:40 2016 (r303989) @@ -536,33 +536,19 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ static int hv_nv_send_ndis_config(struct hn_softc *sc, uint32_t mtu) { - netvsc_dev *net_dev; - nvsp_msg *init_pkt; - int ret; - - net_dev = hv_nv_get_outbound_net_device(sc); - if (!net_dev) - return (-ENODEV); - - /* - * Set up configuration packet, write MTU - * Indicate we are capable of handling VLAN tags - */ - init_pkt = &net_dev->channel_init_packet; - memset(init_pkt, 0, sizeof(nvsp_msg)); - init_pkt->hdr.msg_type = nvsp_msg_2_type_send_ndis_config; - init_pkt->msgs.vers_2_msgs.send_ndis_config.mtu = mtu; - init_pkt-> - msgs.vers_2_msgs.send_ndis_config.capabilities.u1.u2.ieee8021q - = 1; - - /* Send the configuration packet */ - ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&hn_send_ctx_none); - if (ret != 0) - return (-EINVAL); + struct hn_nvs_ndis_conf conf; + int error; - return (0); + memset(&conf, 0, sizeof(conf)); + conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; + conf.nvs_mtu = mtu; + conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; + + error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, + &conf, sizeof(conf), (uint64_t)(uintptr_t)&hn_send_ctx_none); + if (error) + if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); + return (error); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 07:03:58 2016 (r303988) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 07:14:40 2016 (r303989) @@ -36,6 +36,7 @@ #define HN_NVS_TYPE_INIT 1 #define HN_NVS_TYPE_INIT_RESP 2 +#define HN_NVS_TYPE_NDIS_CONF 125 /* * Any size less than this one will _not_ work, e.g. hn_nvs_init @@ -59,4 +60,17 @@ struct hn_nvs_init_resp { uint32_t nvs_status; /* HN_NVS_STATUS_ */ } __packed; +/* No reponse */ +struct hn_nvs_ndis_conf { + uint32_t nvs_type; /* HN_NVS_TYPE_NDIS_CONF */ + uint32_t nvs_mtu; + uint32_t nvs_rsvd; + uint64_t nvs_caps; /* HN_NVS_NDIS_CONF_ */ + uint8_t nvs_rsvd1[12]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_ndis_conf) >= HN_NVS_REQSIZE_MIN); + +#define HN_NVS_NDIS_CONF_SRIOV 0x0004 +#define HN_NVS_NDIS_CONF_VLAN 0x0008 + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Fri Aug 12 07:52:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C83CFBB6E40; Fri, 12 Aug 2016 07:52:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C7A1D93; Fri, 12 Aug 2016 07:52:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C7qDdG024867; Fri, 12 Aug 2016 07:52:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C7qDWC024866; Fri, 12 Aug 2016 07:52:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608120752.u7C7qDWC024866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Aug 2016 07:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303990 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 07:52:14 -0000 Author: kib Date: Fri Aug 12 07:52:13 2016 New Revision: 303990 URL: https://svnweb.freebsd.org/changeset/base/303990 Log: Remove unused prototypes. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Fri Aug 12 07:14:40 2016 (r303989) +++ head/usr.bin/kdump/kdump.c Fri Aug 12 07:52:13 2016 (r303990) @@ -105,8 +105,6 @@ void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktrcsw_old(struct ktr_csw_old *); -void ktruser_malloc(void *); -void ktruser_rtld(int, void *); void ktruser(int, void *); void ktrcaprights(cap_rights_t *); void ktritimerval(struct itimerval *it); From owner-svn-src-head@freebsd.org Fri Aug 12 07:55:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6AC9BB7052; Fri, 12 Aug 2016 07:55:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D12C1F8F; Fri, 12 Aug 2016 07:55:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C7sxtx025638; Fri, 12 Aug 2016 07:54:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C7sxk9025637; Fri, 12 Aug 2016 07:54:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608120754.u7C7sxk9025637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Aug 2016 07:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303991 - head/lib/libsysdecode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 07:55:00 -0000 Author: kib Date: Fri Aug 12 07:54:59 2016 New Revision: 303991 URL: https://svnweb.freebsd.org/changeset/base/303991 Log: Decode 32bit utrace records on the 64bit host. Suppose that ktrace is performed on 32bit binary running on 64bit host. In this case, the kernel records are 64bit, while utrace records from rtld and malloc are 32bit. Make kdump useful to see decoded utrace data in that case. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libsysdecode/utrace.c Modified: head/lib/libsysdecode/utrace.c ============================================================================== --- head/lib/libsysdecode/utrace.c Fri Aug 12 07:52:13 2016 (r303990) +++ head/lib/libsysdecode/utrace.c Fri Aug 12 07:54:59 2016 (r303991) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define UTRACE_DLOPEN_START 1 @@ -59,6 +59,18 @@ struct utrace_rtld { char name[MAXPATHLEN]; }; +#ifdef __LP64__ +struct utrace_rtld32 { + char sig[4]; /* 'RTLD' */ + int event; + uint32_t handle; + uint32_t mapbase; + uint32_t mapsize; + int refcnt; + char name[MAXPATHLEN]; +}; +#endif + static int print_utrace_rtld(FILE *fp, void *p) { @@ -145,6 +157,14 @@ struct utrace_malloc { void *r; }; +#ifdef __LP64__ +struct utrace_malloc32 { + uint32_t p; + uint32_t s; + uint32_t r; +}; +#endif + static void print_utrace_malloc(FILE *fp, void *p) { @@ -163,6 +183,12 @@ print_utrace_malloc(FILE *fp, void *p) int sysdecode_utrace(FILE *fp, void *p, size_t len) { +#ifdef __LP64__ + struct utrace_rtld ur; + struct utrace_rtld32 *pr; + struct utrace_malloc um; + struct utrace_malloc32 *pm; +#endif if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) { return (print_utrace_rtld(fp, p)); @@ -172,6 +198,32 @@ sysdecode_utrace(FILE *fp, void *p, size print_utrace_malloc(fp, p); return (1); } - + +#ifdef __LP64__ + if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) { + pr = p; + memset(&ur, 0, sizeof(ur)); + memcpy(ur.sig, pr->sig, sizeof(ur.sig)); + ur.event = pr->event; + ur.handle = (void *)(uintptr_t)pr->handle; + ur.mapbase = (void *)(uintptr_t)pr->mapbase; + ur.mapsize = pr->mapsize; + ur.refcnt = pr->refcnt; + memcpy(ur.name, pr->name, sizeof(ur.name)); + return (print_utrace_rtld(fp, &ur)); + } + + if (len == sizeof(struct utrace_malloc32)) { + pm = p; + memset(&um, 0, sizeof(um)); + um.p = pm->p == (uint32_t)-1 ? (void *)(intptr_t)-1 : + (void *)(uintptr_t)pm->p; + um.s = pm->s; + um.r = (void *)(uintptr_t)pm->r; + print_utrace_malloc(fp, &um); + return (1); + } +#endif + return (0); } From owner-svn-src-head@freebsd.org Fri Aug 12 07:57:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CFD3BB7118; Fri, 12 Aug 2016 07:57:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27560128B; Fri, 12 Aug 2016 07:57:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C7v47p025794; Fri, 12 Aug 2016 07:57:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C7v4Rh025790; Fri, 12 Aug 2016 07:57:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608120757.u7C7v4Rh025790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 12 Aug 2016 07:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303992 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 07:57:05 -0000 Author: sephe Date: Fri Aug 12 07:57:03 2016 New Revision: 303992 URL: https://svnweb.freebsd.org/changeset/base/303992 Log: hyperv/hn: Simplify NDIS initialization. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7467 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:54:59 2016 (r303991) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 07:57:03 2016 (r303992) @@ -558,8 +558,6 @@ static int hv_nv_connect_to_vsp(struct hn_softc *sc) { netvsc_dev *net_dev; - nvsp_msg *init_pkt; - uint32_t ndis_version; uint32_t protocol_list[] = { NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2, NVSP_PROTOCOL_VERSION_4, @@ -569,6 +567,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc int ret = 0; device_t dev = sc->hn_dev; struct ifnet *ifp = sc->hn_ifp; + struct hn_nvs_ndis_init ndis; net_dev = hv_nv_get_outbound_net_device(sc); @@ -601,37 +600,23 @@ hv_nv_connect_to_vsp(struct hn_softc *sc ret = hv_nv_send_ndis_config(sc, ifp->if_mtu); /* - * Send the NDIS version + * Initialize NDIS. */ - init_pkt = &net_dev->channel_init_packet; - memset(init_pkt, 0, sizeof(nvsp_msg)); - - if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4) { - ndis_version = NDIS_VERSION_6_1; - } else { - ndis_version = NDIS_VERSION_6_30; - } - - init_pkt->hdr.msg_type = nvsp_msg_1_type_send_ndis_vers; - init_pkt->msgs.vers_1_msgs.send_ndis_vers.ndis_major_vers = - (ndis_version & 0xFFFF0000) >> 16; - init_pkt->msgs.vers_1_msgs.send_ndis_vers.ndis_minor_vers = - ndis_version & 0xFFFF; - - /* Send the init request */ + memset(&ndis, 0, sizeof(ndis)); + ndis.nvs_type = HN_NVS_TYPE_NDIS_INIT; + ndis.nvs_ndis_major = NDIS_VERSION_MAJOR_6; + if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4) + ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_1; + else + ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&hn_send_ctx_none); + &ndis, sizeof(ndis), (uint64_t)(uintptr_t)&hn_send_ctx_none); if (ret != 0) { + if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret); goto cleanup; } - /* - * TODO: BUGBUG - We have to wait for the above msg since the netvsp - * uses KMCL which acknowledges packet (completion packet) - * since our Vmbus always set the VMBUS_CHANPKT_FLAG_RC flag - */ - /* sema_wait(&NetVscChannel->channel_init_sema); */ /* Post the big receive buffer to NetVSP */ if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Aug 12 07:54:59 2016 (r303991) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Aug 12 07:57:03 2016 (r303992) @@ -41,6 +41,10 @@ #define NDIS_VERSION_6_1 0x00060001 #define NDIS_VERSION_6_30 0x0006001e +#define NDIS_VERSION_MAJOR_6 6 +#define NDIS_VERSION_MINOR_1 1 +#define NDIS_VERSION_MINOR_30 30 + #define NDIS_VERSION (NDIS_VERSION_5_1) /* Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 07:54:59 2016 (r303991) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 07:57:03 2016 (r303992) @@ -36,6 +36,7 @@ #define HN_NVS_TYPE_INIT 1 #define HN_NVS_TYPE_INIT_RESP 2 +#define HN_NVS_TYPE_NDIS_INIT 100 #define HN_NVS_TYPE_NDIS_CONF 125 /* @@ -73,4 +74,13 @@ CTASSERT(sizeof(struct hn_nvs_ndis_conf) #define HN_NVS_NDIS_CONF_SRIOV 0x0004 #define HN_NVS_NDIS_CONF_VLAN 0x0008 +/* No response */ +struct hn_nvs_ndis_init { + uint32_t nvs_type; /* HN_NVS_TYPE_NDIS_INIT */ + uint32_t nvs_ndis_major; /* NDIS_VERSION_MAJOR_ */ + uint32_t nvs_ndis_minor; /* NDIS_VERSION_MINOR_ */ + uint8_t nvs_rsvd[20]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Fri Aug 12 08:07:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 031C9BB795D; Fri, 12 Aug 2016 08:07:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D27391306; Fri, 12 Aug 2016 08:07:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C87v28029731; Fri, 12 Aug 2016 08:07:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C87uhp029728; Fri, 12 Aug 2016 08:07:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608120807.u7C87uhp029728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 12 Aug 2016 08:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303998 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 08:07:58 -0000 Author: sephe Date: Fri Aug 12 08:07:56 2016 New Revision: 303998 URL: https://svnweb.freebsd.org/changeset/base/303998 Log: hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7469 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:07:19 2016 (r303997) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:07:56 2016 (r303998) @@ -152,10 +152,14 @@ hv_nv_get_next_send_section(netvsc_dev * static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) { + struct vmbus_xact *xact; + struct hn_nvs_rxbuf_conn *conn; + const struct hn_nvs_rxbuf_connresp *resp; + size_t resp_len; struct hn_send_ctx sndc; netvsc_dev *net_dev; - nvsp_msg *init_pkt; - int ret = 0; + uint32_t status; + int error; net_dev = hv_nv_get_outbound_net_device(sc); if (!net_dev) { @@ -167,7 +171,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct BUS_DMA_WAITOK | BUS_DMA_ZERO); if (net_dev->rx_buf == NULL) { device_printf(sc->hn_dev, "allocate rxbuf failed\n"); - return ENOMEM; + return (ENOMEM); } /* @@ -177,74 +181,76 @@ hv_nv_init_rx_buffer_with_net_vsp(struct * Only primary channel has RXBUF connected to it. Sub-channels * just share this RXBUF. */ - ret = vmbus_chan_gpadl_connect(sc->hn_prichan, + error = vmbus_chan_gpadl_connect(sc->hn_prichan, net_dev->rxbuf_dma.hv_paddr, net_dev->rx_buf_size, &net_dev->rx_buf_gpadl_handle); - if (ret != 0) { - device_printf(sc->hn_dev, "rxbuf gpadl connect failed: %d\n", - ret); + if (error) { + if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n", + error); goto cleanup; } - - /* sema_wait(&ext->channel_init_sema); KYS CHECK */ - /* Notify the NetVsp of the gpadl handle */ - init_pkt = &net_dev->channel_init_packet; + /* + * Connect RXBUF to NVS. + */ - memset(init_pkt, 0, sizeof(nvsp_msg)); + xact = vmbus_xact_get(sc->hn_xact, sizeof(*conn)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs rxbuf conn\n"); + error = ENXIO; + goto cleanup; + } - init_pkt->hdr.msg_type = nvsp_msg_1_type_send_rx_buf; - init_pkt->msgs.vers_1_msgs.send_rx_buf.gpadl_handle = - net_dev->rx_buf_gpadl_handle; - init_pkt->msgs.vers_1_msgs.send_rx_buf.id = - NETVSC_RECEIVE_BUFFER_ID; + conn = vmbus_xact_req_data(xact); + conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN; + conn->nvs_gpadl = net_dev->rx_buf_gpadl_handle; + conn->nvs_sig = HN_NVS_RXBUF_SIG; - /* Send the gpadl notification request */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + vmbus_xact_activate(xact); - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); - ret = vmbus_chan_send(sc->hn_prichan, + error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); - if (ret != 0) { + conn, sizeof(*conn), (uint64_t)(uintptr_t)&sndc); + if (error != 0) { + if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n", + error); + vmbus_xact_deactivate(xact); + vmbus_xact_put(xact); goto cleanup; } - sema_wait(&net_dev->channel_init_sema); - - /* Check the response */ - if (init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.status - != nvsp_status_success) { - ret = EINVAL; + resp = vmbus_xact_wait(xact, &resp_len); + if (resp_len < sizeof(*resp)) { + if_printf(sc->hn_ifp, "invalid rxbuf conn resp length %zu\n", + resp_len); + vmbus_xact_put(xact); + error = EINVAL; + goto cleanup; + } + if (resp->nvs_type != HN_NVS_TYPE_RXBUF_CONNRESP) { + if_printf(sc->hn_ifp, "not rxbuf conn resp, type %u\n", + resp->nvs_type); + vmbus_xact_put(xact); + error = EINVAL; goto cleanup; } - net_dev->rx_section_count = - init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.num_sections; - - net_dev->rx_sections = malloc(net_dev->rx_section_count * - sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_WAITOK); - memcpy(net_dev->rx_sections, - init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.sections, - net_dev->rx_section_count * sizeof(nvsp_1_rx_buf_section)); - + status = resp->nvs_status; + vmbus_xact_put(xact); - /* - * For first release, there should only be 1 section that represents - * the entire receive buffer - */ - if (net_dev->rx_section_count != 1 - || net_dev->rx_sections->offset != 0) { - ret = EINVAL; + if (status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status); + error = EINVAL; goto cleanup; } + net_dev->rx_section_count = 1; - goto exit; + return (0); cleanup: hv_nv_destroy_rx_buffer(net_dev); - -exit: - return (ret); + return (error); } /* @@ -371,6 +377,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ if (ret != 0) { return (ret); } + net_dev->rx_section_count = 0; } /* Tear down the gpadl on the vsp end */ @@ -393,12 +400,6 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ net_dev->rx_buf = NULL; } - if (net_dev->rx_sections) { - free(net_dev->rx_sections, M_NETVSC); - net_dev->rx_sections = NULL; - net_dev->rx_section_count = 0; - } - return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 12 08:07:19 2016 (r303997) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 12 08:07:56 2016 (r303998) @@ -1060,7 +1060,6 @@ typedef struct netvsc_dev_ { uint32_t rx_buf_size; uint32_t rx_buf_gpadl_handle; uint32_t rx_section_count; - nvsp_1_rx_buf_section *rx_sections; /* Used for NetVSP initialization protocol */ struct sema channel_init_sema; Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:07:19 2016 (r303997) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:07:56 2016 (r303998) @@ -32,11 +32,15 @@ #include #include +#define HN_NVS_RXBUF_SIG 0xcafe + #define HN_NVS_STATUS_OK 1 #define HN_NVS_TYPE_INIT 1 #define HN_NVS_TYPE_INIT_RESP 2 #define HN_NVS_TYPE_NDIS_INIT 100 +#define HN_NVS_TYPE_RXBUF_CONN 101 +#define HN_NVS_TYPE_RXBUF_CONNRESP 102 #define HN_NVS_TYPE_NDIS_CONF 125 /* @@ -83,4 +87,26 @@ struct hn_nvs_ndis_init { } __packed; CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN); +struct hn_nvs_rxbuf_conn { + uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_CONN */ + uint32_t nvs_gpadl; /* RXBUF vmbus GPADL */ + uint16_t nvs_sig; /* HN_NVS_RXBUF_SIG */ + uint8_t nvs_rsvd[22]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rxbuf_conn) >= HN_NVS_REQSIZE_MIN); + +struct hn_nvs_rxbuf_sect { + uint32_t nvs_start; + uint32_t nvs_slotsz; + uint32_t nvs_slotcnt; + uint32_t nvs_end; +} __packed; + +struct hn_nvs_rxbuf_connresp { + uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_CONNRESP */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint32_t nvs_nsect; /* # of elem in nvs_sect */ + struct hn_nvs_rxbuf_sect nvs_sect[]; +} __packed; + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Fri Aug 12 08:16:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16DABB7CE4; Fri, 12 Aug 2016 08:16:36 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71A8B195D; Fri, 12 Aug 2016 08:16:36 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C8GZbP033563; Fri, 12 Aug 2016 08:16:35 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C8GZFL033562; Fri, 12 Aug 2016 08:16:35 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201608120816.u7C8GZFL033562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Fri, 12 Aug 2016 08:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304000 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 08:16:36 -0000 Author: maxim Date: Fri Aug 12 08:16:35 2016 New Revision: 304000 URL: https://svnweb.freebsd.org/changeset/base/304000 Log: o Move tmpstr varibale initialization out of assert(3) call. This fixes acpidump(8) compiled with "WITHOUT_ASSERT_DEBUG=yes" that removes assert(3)'s from the code. Submitted by: Alexander Nedotsukov Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 12 08:08:29 2016 (r303999) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 12 08:16:35 2016 (r304000) @@ -1494,8 +1494,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, perror("mkdtemp tmp working dir"); return; } - assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname) - <= sizeof(tmpstr) - 1); + len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, iname); + assert(len <= sizeof(tmpstr) - 1); fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) { perror("iasl tmp file"); @@ -1527,8 +1527,8 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, } /* Dump iasl's output to stdout */ - assert((size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname) - <= sizeof(tmpstr) -1); + len = (size_t)snprintf(tmpstr, sizeof(tmpstr), "%s%s", wrkdir, oname); + assert(len <= sizeof(tmpstr) - 1); fp = fopen(tmpstr, "r"); if (unlink(tmpstr) < 0) { perror("unlink"); From owner-svn-src-head@freebsd.org Fri Aug 12 08:21:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8903ABB7D93; Fri, 12 Aug 2016 08:21:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9931BE0; Fri, 12 Aug 2016 08:21:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C8L2S4033763; Fri, 12 Aug 2016 08:21:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C8L2tc033761; Fri, 12 Aug 2016 08:21:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608120821.u7C8L2tc033761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 12 Aug 2016 08:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304001 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 08:21:03 -0000 Author: sephe Date: Fri Aug 12 08:21:02 2016 New Revision: 304001 URL: https://svnweb.freebsd.org/changeset/base/304001 Log: hyperv/hn: Switch to vmbus xact APIs for NVS chimney buffer connection. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7470 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:16:35 2016 (r304000) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:21:02 2016 (r304001) @@ -241,7 +241,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct if (status != HN_NVS_STATUS_OK) { if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status); - error = EINVAL; + error = EIO; goto cleanup; } net_dev->rx_section_count = 1; @@ -260,9 +260,13 @@ static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) { struct hn_send_ctx sndc; + struct vmbus_xact *xact; + struct hn_nvs_chim_conn *chim; + const struct hn_nvs_chim_connresp *resp; + size_t resp_len; + uint32_t status, sectsz; netvsc_dev *net_dev; - nvsp_msg *init_pkt; - int ret = 0; + int error; net_dev = hv_nv_get_outbound_net_device(sc); if (!net_dev) { @@ -274,7 +278,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru BUS_DMA_WAITOK | BUS_DMA_ZERO); if (net_dev->send_buf == NULL) { device_printf(sc->hn_dev, "allocate chimney txbuf failed\n"); - return ENOMEM; + return (ENOMEM); } /* @@ -284,48 +288,77 @@ hv_nv_init_send_buffer_with_net_vsp(stru * Only primary channel has chimney sending buffer connected to it. * Sub-channels just share this chimney sending buffer. */ - ret = vmbus_chan_gpadl_connect(sc->hn_prichan, + error = vmbus_chan_gpadl_connect(sc->hn_prichan, net_dev->txbuf_dma.hv_paddr, net_dev->send_buf_size, &net_dev->send_buf_gpadl_handle); - if (ret != 0) { - device_printf(sc->hn_dev, "chimney sending buffer gpadl " - "connect failed: %d\n", ret); + if (error) { + if_printf(sc->hn_ifp, "chimney sending buffer gpadl " + "connect failed: %d\n", error); goto cleanup; } - /* Notify the NetVsp of the gpadl handle */ - - init_pkt = &net_dev->channel_init_packet; + /* + * Connect chimney sending buffer to NVS + */ - memset(init_pkt, 0, sizeof(nvsp_msg)); + xact = vmbus_xact_get(sc->hn_xact, sizeof(*chim)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs chim conn\n"); + error = ENXIO; + goto cleanup; + } - init_pkt->hdr.msg_type = nvsp_msg_1_type_send_send_buf; - init_pkt->msgs.vers_1_msgs.send_rx_buf.gpadl_handle = - net_dev->send_buf_gpadl_handle; - init_pkt->msgs.vers_1_msgs.send_rx_buf.id = - NETVSC_SEND_BUFFER_ID; + chim = vmbus_xact_req_data(xact); + chim->nvs_type = HN_NVS_TYPE_CHIM_CONN; + chim->nvs_gpadl = net_dev->send_buf_gpadl_handle; + chim->nvs_sig = HN_NVS_CHIM_SIG; - /* Send the gpadl notification request */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + vmbus_xact_activate(xact); - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); - ret = vmbus_chan_send(sc->hn_prichan, + error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); - if (ret != 0) { + chim, sizeof(*chim), (uint64_t)(uintptr_t)&sndc); + if (error) { + if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n", + error); + vmbus_xact_deactivate(xact); + vmbus_xact_put(xact); goto cleanup; } - sema_wait(&net_dev->channel_init_sema); + resp = vmbus_xact_wait(xact, &resp_len); + if (resp_len < sizeof(*resp)) { + if_printf(sc->hn_ifp, "invalid chim conn resp length %zu\n", + resp_len); + vmbus_xact_put(xact); + error = EINVAL; + goto cleanup; + } + if (resp->nvs_type != HN_NVS_TYPE_CHIM_CONNRESP) { + if_printf(sc->hn_ifp, "not chim conn resp, type %u\n", + resp->nvs_type); + vmbus_xact_put(xact); + error = EINVAL; + goto cleanup; + } - /* Check the response */ - if (init_pkt->msgs.vers_1_msgs.send_send_buf_complete.status - != nvsp_status_success) { - ret = EINVAL; + status = resp->nvs_status; + sectsz = resp->nvs_sectsz; + vmbus_xact_put(xact); + + if (status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "chim conn failed: %x\n", status); + error = EIO; goto cleanup; } + if (sectsz == 0) { + if_printf(sc->hn_ifp, "zero chimney sending buffer " + "section size\n"); + return 0; + } - net_dev->send_section_size = - init_pkt->msgs.vers_1_msgs.send_send_buf_complete.section_size; + net_dev->send_section_size = sectsz; net_dev->send_section_count = net_dev->send_buf_size / net_dev->send_section_size; net_dev->bitsmap_words = howmany(net_dev->send_section_count, @@ -334,13 +367,15 @@ hv_nv_init_send_buffer_with_net_vsp(stru malloc(net_dev->bitsmap_words * sizeof(long), M_NETVSC, M_WAITOK | M_ZERO); - goto exit; + if (bootverbose) { + if_printf(sc->hn_ifp, "chimney sending buffer %u/%u\n", + net_dev->send_section_size, net_dev->send_section_count); + } + return 0; cleanup: hv_nv_destroy_send_buffer(net_dev); - -exit: - return (ret); + return (error); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:16:35 2016 (r304000) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:21:02 2016 (r304001) @@ -33,6 +33,7 @@ #include #define HN_NVS_RXBUF_SIG 0xcafe +#define HN_NVS_CHIM_SIG 0xface #define HN_NVS_STATUS_OK 1 @@ -41,6 +42,8 @@ #define HN_NVS_TYPE_NDIS_INIT 100 #define HN_NVS_TYPE_RXBUF_CONN 101 #define HN_NVS_TYPE_RXBUF_CONNRESP 102 +#define HN_NVS_TYPE_CHIM_CONN 104 +#define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_NDIS_CONF 125 /* @@ -109,4 +112,18 @@ struct hn_nvs_rxbuf_connresp { struct hn_nvs_rxbuf_sect nvs_sect[]; } __packed; +struct hn_nvs_chim_conn { + uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_CONN */ + uint32_t nvs_gpadl; /* chimney buf vmbus GPADL */ + uint16_t nvs_sig; /* NDIS_NVS_CHIM_SIG */ + uint8_t nvs_rsvd[22]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_chim_conn) >= HN_NVS_REQSIZE_MIN); + +struct hn_nvs_chim_connresp { + uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_CONNRESP */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint32_t nvs_sectsz; /* section size */ +} __packed; + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Fri Aug 12 08:29:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18789BB60AA; Fri, 12 Aug 2016 08:29:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDCFE12CD; Fri, 12 Aug 2016 08:29:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7C8TRY2037305; Fri, 12 Aug 2016 08:29:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7C8TQoo037303; Fri, 12 Aug 2016 08:29:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608120829.u7C8TQoo037303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 12 Aug 2016 08:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304002 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 08:29:28 -0000 Author: sephe Date: Fri Aug 12 08:29:26 2016 New Revision: 304002 URL: https://svnweb.freebsd.org/changeset/base/304002 Log: hyperv/hn: Simplify RXBUF disconnection. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7472 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:21:02 2016 (r304001) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 12 08:29:26 2016 (r304002) @@ -384,32 +384,24 @@ cleanup: static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev) { - nvsp_msg *revoke_pkt; int ret = 0; - /* - * If we got a section count, it means we received a - * send_rx_buf_complete msg - * (ie sent nvsp_msg_1_type_send_rx_buf msg) therefore, - * we need to send a revoke msg here - */ if (net_dev->rx_section_count) { - /* Send the revoke receive buffer */ - revoke_pkt = &net_dev->revoke_packet; - memset(revoke_pkt, 0, sizeof(nvsp_msg)); + struct hn_nvs_rxbuf_disconn disconn; - revoke_pkt->hdr.msg_type = nvsp_msg_1_type_revoke_rx_buf; - revoke_pkt->msgs.vers_1_msgs.revoke_rx_buf.id = - NETVSC_RECEIVE_BUFFER_ID; + /* + * Disconnect RXBUF from NVS. + */ + memset(&disconn, 0, sizeof(disconn)); + disconn.nvs_type = HN_NVS_TYPE_RXBUF_DISCONN; + disconn.nvs_sig = HN_NVS_RXBUF_SIG; ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), + VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), (uint64_t)(uintptr_t)&hn_send_ctx_none); - /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk - */ if (ret != 0) { + if_printf(net_dev->sc->hn_ifp, + "send rxbuf disconn failed: %d\n", ret); return (ret); } net_dev->rx_section_count = 0; Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:21:02 2016 (r304001) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Aug 12 08:29:26 2016 (r304002) @@ -42,6 +42,7 @@ #define HN_NVS_TYPE_NDIS_INIT 100 #define HN_NVS_TYPE_RXBUF_CONN 101 #define HN_NVS_TYPE_RXBUF_CONNRESP 102 +#define HN_NVS_TYPE_RXBUF_DISCONN 103 #define HN_NVS_TYPE_CHIM_CONN 104 #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_NDIS_CONF 125 @@ -112,6 +113,14 @@ struct hn_nvs_rxbuf_connresp { struct hn_nvs_rxbuf_sect nvs_sect[]; } __packed; +/* No response */ +struct hn_nvs_rxbuf_disconn { + uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_DISCONN */ + uint16_t nvs_sig; /* HN_NVS_RXBUF_SIG */ + uint8_t nvs_rsvd[26]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rxbuf_disconn) >= HN_NVS_REQSIZE_MIN); + struct hn_nvs_chim_conn { uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_CONN */ uint32_t nvs_gpadl; /* chimney buf vmbus GPADL */ From owner-svn-src-head@freebsd.org Fri Aug 12 10:29:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24344BB7F75; Fri, 12 Aug 2016 10:29:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D45AE1608; Fri, 12 Aug 2016 10:29:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CATZIj081481; Fri, 12 Aug 2016 10:29:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CATYcC081478; Fri, 12 Aug 2016 10:29:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608121029.u7CATYcC081478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 12 Aug 2016 10:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304004 - in head/sys/arm64: arm64 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.22 Precedence: list List-Id: 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, 12 Aug 2016 10:29:36 -0000 Author: andrew Date: Fri Aug 12 10:29:34 2016 New Revision: 304004 URL: https://svnweb.freebsd.org/changeset/base/304004 Log: Implement promotions and demotions in the arm64 pmap code. For now we don't promote memory as I am not sure all the demotion cases are handled, however it is useful to implement pmap_page_set_memattr. This is used, for example, when mapping uncached memory for bus_dma(9). pmap_page_set_memattr needs to demote the DMAP region as on ARM we need to ensure all mappings to the same physical address have the same attributes. Reviewed by: kib Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6987 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/trap.c head/sys/arm64/include/pmap.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Aug 12 08:50:05 2016 (r304003) +++ head/sys/arm64/arm64/pmap.c Fri Aug 12 10:29:34 2016 (r304004) @@ -229,6 +229,13 @@ CTASSERT((DMAP_MAX_ADDRESS & ~L0_OFFSET #define DMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> L0_SHIFT) extern pt_entry_t pagetable_dmap[]; +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); + +static int superpages_enabled = 1; +SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &superpages_enabled, 0, + "Are large page mappings enabled?"); + /* * Data for the pv entry allocation mechanism */ @@ -243,6 +250,13 @@ static vm_page_t reclaim_pv_chunk(pmap_t static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); + +static int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); +static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va); +static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, + vm_offset_t va, struct rwlock **lockp); +static pt_entry_t *pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, @@ -422,6 +436,13 @@ pmap_pte(pmap_t pmap, vm_offset_t va, in return (l3); } +static inline bool +pmap_superpages_enabled(void) +{ + + return (superpages_enabled != 0); +} + bool pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l0, pd_entry_t **l1, pd_entry_t **l2, pt_entry_t **l3) @@ -837,6 +858,11 @@ pmap_init(void) int i; /* + * Are large page mappings enabled? + */ + TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", &superpages_enabled); + + /* * Initialize the pv chunk list mutex. */ mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); @@ -2000,6 +2026,15 @@ pmap_remove(pmap_t pmap, vm_offset_t sva l3_paddr = pmap_load(l2); + if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { + KASSERT((l3_paddr & ATTR_SW_MANAGED) == 0, + ("%s: TODO: Demote managed pages", __func__)); + if (pmap_demote_l2_locked(pmap, l2, sva & ~L2_OFFSET, + &lock) == NULL) + continue; + l3_paddr = pmap_load(l2); + } + /* * Weed out invalid mappings. */ @@ -2194,6 +2229,99 @@ pmap_protect(pmap_t pmap, vm_offset_t sv } /* + * Performs a break-before-make update of a pmap entry. This is needed when + * either promoting or demoting pages to ensure the TLB doesn't get into an + * inconsistent state. + */ +static void +pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, + vm_offset_t va) +{ + register_t intr; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + /* + * Ensure we don't get switched out with the page table in an + * inconsistent state. We also need to ensure no interrupts fire + * as they may make use of an address we are about to invalidate. + */ + intr = intr_disable(); + critical_enter(); + + /* Clear the old mapping */ + pmap_load_clear(pte); + PTE_SYNC(pte); + pmap_invalidate_page(pmap, va); + + /* Create the new mapping */ + pmap_load_store(pte, newpte); + PTE_SYNC(pte); + + critical_exit(); + intr_restore(intr); +} + +/* + * Tries to promote the 512, contiguous 4KB page mappings that are within a + * single level 2 table entry to a single 2MB page mapping. For promotion + * to occur, two conditions must be met: (1) the 4KB page mappings must map + * aligned, contiguous physical memory and (2) the 4KB page mappings must have + * identical characteristics. + */ +static void +pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, + struct rwlock **lockp) +{ + pt_entry_t *firstl3, *l3, newl2, oldl3, pa; + register_t intr; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + firstl3 = (pt_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK); + newl2 = pmap_load(firstl3); + /* Ignore managed pages for now */ + if ((newl2 & ATTR_SW_MANAGED) != 0) + return; + + /* Check the alingment is valid */ + if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) + return; + + pa = newl2 + L2_SIZE - PAGE_SIZE; + for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { + oldl3 = pmap_load(l3); + if (oldl3 != pa) + return; + pa -= PAGE_SIZE; + } + + newl2 &= ~ATTR_DESCR_MASK; + newl2 |= L2_BLOCK; + + /* + * Ensure we don't get switched out with the page table in an + * inconsistent state. We also need to ensure no interrupts fire + * as they may make use of an address we are about to invalidate. + */ + intr = intr_disable(); + critical_enter(); + + /* Clear the old mapping */ + pmap_load_clear(l2); + PTE_SYNC(l2); + pmap_invalidate_range(pmap, rounddown2(va, L2_SIZE), + roundup2(va, L2_SIZE)); + + /* Create the new mapping */ + pmap_load_store(l2, newl2); + PTE_SYNC(l2); + + critical_exit(); + intr_restore(intr); +} + +/* * Insert the given physical page (p) at * the specified virtual address (v) in the * target physical map with the protection requested. @@ -2212,7 +2340,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, struct rwlock *lock; pd_entry_t *pde; pt_entry_t new_l3, orig_l3; - pt_entry_t *l3; + pt_entry_t *l2, *l3; pv_entry_t pv; vm_paddr_t opa, pa, l1_pa, l2_pa, l3_pa; vm_page_t mpte, om, l1_m, l2_m, l3_m; @@ -2239,6 +2367,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, lock = NULL; PMAP_LOCK(pmap); + pde = pmap_pde(pmap, va, &lvl); + if (pde != NULL && lvl == 1) { + l2 = pmap_l1_to_l2(pde, va); + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && + (l3 = pmap_demote_l2_locked(pmap, l2, va, &lock)) != NULL) { + if (va < VM_MAXUSER_ADDRESS) { + mpte = PHYS_TO_VM_PAGE( + pmap_load(l2) & ~ATTR_MASK); + mpte->wire_count++; + } + goto havel3; + } + } + if (va < VM_MAXUSER_ADDRESS) { nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; mpte = pmap_alloc_l3(pmap, va, nosleep ? NULL : &lock); @@ -2320,6 +2462,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, l3 = pmap_l2_to_l3(pde, va); pmap_invalidate_page(pmap, va); } +havel3: om = NULL; orig_l3 = pmap_load(l3); @@ -2400,7 +2543,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (orig_l3 != 0) { validate: orig_l3 = pmap_load_store(l3, new_l3); - PTE_SYNC(l3); opa = orig_l3 & ~ATTR_MASK; if (opa != pa) { @@ -2419,12 +2561,24 @@ validate: } } else { pmap_load_store(l3, new_l3); - PTE_SYNC(l3); } + + PTE_SYNC(l3); pmap_invalidate_page(pmap, va); + if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) cpu_icache_sync_range(va, PAGE_SIZE); + /* XXX: Not yet, not all demotions are handled */ +#if 0 + if ((mpte == NULL || mpte->wire_count == NL3PG) && + pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); + pmap_promote_l2(pmap, pde, va, &lock); + } +#endif + if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); @@ -3340,14 +3494,271 @@ pmap_page_set_memattr(vm_page_t m, vm_me m->md.pv_memattr = ma; /* - * ARM64TODO: Implement the below (from the amd64 pmap) * If "m" is a normal page, update its direct mapping. This update * can be relied upon to perform any cache operations that are * required for data coherence. */ if ((m->flags & PG_FICTITIOUS) == 0 && - PHYS_IN_DMAP(VM_PAGE_TO_PHYS(m))) - panic("ARM64TODO: pmap_page_set_memattr"); + pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE, + m->md.pv_memattr) != 0) + panic("memory attribute change on the direct map failed"); +} + +/* + * Changes the specified virtual address range's memory type to that given by + * the parameter "mode". The specified virtual address range must be + * completely contained within either the direct map or the kernel map. If + * the virtual address range is contained within the kernel map, then the + * memory type for each of the corresponding ranges of the direct map is also + * changed. (The corresponding ranges of the direct map are those ranges that + * map the same physical pages as the specified virtual address range.) These + * changes to the direct map are necessary because Intel describes the + * behavior of their processors as "undefined" if two or more mappings to the + * same physical page have different memory types. + * + * Returns zero if the change completed successfully, and either EINVAL or + * ENOMEM if the change failed. Specifically, EINVAL is returned if some part + * of the virtual address range was not mapped, and ENOMEM is returned if + * there was insufficient memory available to complete the change. In the + * latter case, the memory type may have been changed on some part of the + * virtual address range or the direct map. + */ +static int +pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) +{ + int error; + + PMAP_LOCK(kernel_pmap); + error = pmap_change_attr_locked(va, size, mode); + PMAP_UNLOCK(kernel_pmap); + return (error); +} + +static int +pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) +{ + vm_offset_t base, offset, tmpva; + pt_entry_t l3, *pte, *newpte; + int lvl; + + PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); + base = trunc_page(va); + offset = va & PAGE_MASK; + size = round_page(offset + size); + + if (!VIRT_IN_DMAP(base)) + return (EINVAL); + + for (tmpva = base; tmpva < base + size; ) { + pte = pmap_pte(kernel_pmap, va, &lvl); + if (pte == NULL) + return (EINVAL); + + if ((pmap_load(pte) & ATTR_IDX_MASK) == ATTR_IDX(mode)) { + /* + * We already have the correct attribute, + * ignore this entry. + */ + switch (lvl) { + default: + panic("Invalid DMAP table level: %d\n", lvl); + case 1: + tmpva = (tmpva & ~L1_OFFSET) + L1_SIZE; + break; + case 2: + tmpva = (tmpva & ~L2_OFFSET) + L2_SIZE; + break; + case 3: + tmpva += PAGE_SIZE; + break; + } + } else { + /* + * Split the entry to an level 3 table, then + * set the new attribute. + */ + switch (lvl) { + default: + panic("Invalid DMAP table level: %d\n", lvl); + case 1: + newpte = pmap_demote_l1(kernel_pmap, pte, + tmpva & ~L1_OFFSET); + if (newpte == NULL) + return (EINVAL); + pte = pmap_l1_to_l2(pte, tmpva); + case 2: + newpte = pmap_demote_l2(kernel_pmap, pte, + tmpva & ~L2_OFFSET); + if (newpte == NULL) + return (EINVAL); + pte = pmap_l2_to_l3(pte, tmpva); + case 3: + /* Update the entry */ + l3 = pmap_load(pte); + l3 &= ~ATTR_IDX_MASK; + l3 |= ATTR_IDX(mode); + + pmap_update_entry(kernel_pmap, pte, l3, tmpva); + + /* + * If moving to a non-cacheable entry flush + * the cache. + */ + if (mode == VM_MEMATTR_UNCACHEABLE) + cpu_dcache_wbinv_range(tmpva, L3_SIZE); + + break; + } + tmpva += PAGE_SIZE; + } + } + + return (0); +} + +/* + * Create an L2 table to map all addresses within an L1 mapping. + */ +static pt_entry_t * +pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va) +{ + pt_entry_t *l2, newl2, oldl1; + vm_offset_t tmpl1; + vm_paddr_t l2phys, phys; + vm_page_t ml2; + int i; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + oldl1 = pmap_load(l1); + KASSERT((oldl1 & ATTR_DESCR_MASK) == L1_BLOCK, + ("pmap_demote_l1: Demoting a non-block entry")); + KASSERT((va & L1_OFFSET) == 0, + ("pmap_demote_l1: Invalid virtual address %#lx", va)); + + tmpl1 = 0; + if (va <= (vm_offset_t)l1 && va + L1_SIZE > (vm_offset_t)l1) { + tmpl1 = kva_alloc(PAGE_SIZE); + if (tmpl1 == 0) + return (NULL); + } + + if ((ml2 = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + CTR2(KTR_PMAP, "pmap_demote_l1: failure for va %#lx" + " in pmap %p", va, pmap); + return (NULL); + } + + l2phys = VM_PAGE_TO_PHYS(ml2); + l2 = (pt_entry_t *)PHYS_TO_DMAP(l2phys); + + /* Address the range points at */ + phys = oldl1 & ~ATTR_MASK; + /* The attributed from the old l1 table to be copied */ + newl2 = oldl1 & ATTR_MASK; + + /* Create the new entries */ + for (i = 0; i < Ln_ENTRIES; i++) { + l2[i] = newl2 | phys; + phys += L2_SIZE; + } + cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); + + if (tmpl1 != 0) { + pmap_kenter(tmpl1, PAGE_SIZE, + DMAP_TO_PHYS((vm_offset_t)l1) & ~L3_OFFSET, CACHED_MEMORY); + l1 = (pt_entry_t *)(tmpl1 + ((vm_offset_t)l1 & PAGE_MASK)); + } + + pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va); + + if (tmpl1 != 0) { + pmap_kremove(tmpl1); + kva_free(tmpl1, PAGE_SIZE); + } + + return (l2); +} + +/* + * Create an L3 table to map all addresses within an L2 mapping. + */ +static pt_entry_t * +pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, + struct rwlock **lockp) +{ + pt_entry_t *l3, newl3, oldl2; + vm_offset_t tmpl2; + vm_paddr_t l3phys, phys; + vm_page_t ml3; + int i; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + oldl2 = pmap_load(l2); + KASSERT((oldl2 & ATTR_DESCR_MASK) == L2_BLOCK, + ("pmap_demote_l2: Demoting a non-block entry")); + KASSERT((va & L2_OFFSET) == 0, + ("pmap_demote_l2: Invalid virtual address %#lx", va)); + KASSERT((oldl2 & ATTR_SW_MANAGED) == 0, + ("pmap_demote_l2: TODO: Demote managed pages")); + + tmpl2 = 0; + if (va <= (vm_offset_t)l2 && va + L2_SIZE > (vm_offset_t)l2) { + tmpl2 = kva_alloc(PAGE_SIZE); + if (tmpl2 == 0) + return (NULL); + } + + if ((ml3 = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx" + " in pmap %p", va, pmap); + return (NULL); + } + + l3phys = VM_PAGE_TO_PHYS(ml3); + l3 = (pt_entry_t *)PHYS_TO_DMAP(l3phys); + + /* Address the range points at */ + phys = oldl2 & ~ATTR_MASK; + /* The attributed from the old l2 table to be copied */ + newl3 = (oldl2 & (ATTR_MASK & ~ATTR_DESCR_MASK)) | L3_PAGE; + + /* Create the new entries */ + for (i = 0; i < Ln_ENTRIES; i++) { + l3[i] = newl3 | phys; + phys += L3_SIZE; + } + cpu_dcache_wb_range((vm_offset_t)l3, PAGE_SIZE); + + if (tmpl2 != 0) { + pmap_kenter(tmpl2, PAGE_SIZE, + DMAP_TO_PHYS((vm_offset_t)l2) & ~L3_OFFSET, CACHED_MEMORY); + l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK)); + } + + pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va); + + if (tmpl2 != 0) { + pmap_kremove(tmpl2); + kva_free(tmpl2, PAGE_SIZE); + } + + return (l3); + +} + +static pt_entry_t * +pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + struct rwlock *lock; + pt_entry_t *l3; + + lock = NULL; + l3 = pmap_demote_l2_locked(pmap, l2, va, &lock); + if (lock != NULL) + rw_wunlock(lock); + return (l3); } /* @@ -3480,6 +3891,53 @@ pmap_sync_icache(pmap_t pmap, vm_offset_ } } +int +pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far) +{ +#ifdef SMP + uint64_t par; +#endif + + switch (ESR_ELx_EXCEPTION(esr)) { + case EXCP_DATA_ABORT_L: + case EXCP_DATA_ABORT: + break; + default: + return (KERN_FAILURE); + } + +#ifdef SMP + PMAP_LOCK(pmap); + switch (esr & ISS_DATA_DFSC_MASK) { + case ISS_DATA_DFSC_TF_L0: + case ISS_DATA_DFSC_TF_L1: + case ISS_DATA_DFSC_TF_L2: + case ISS_DATA_DFSC_TF_L3: + /* Ask the MMU to check the address */ + if (pmap == kernel_pmap) + par = arm64_address_translate_s1e1r(far); + else + par = arm64_address_translate_s1e0r(far); + + /* + * If the translation was successful the address was invalid + * due to a break-before-make sequence. We can unlock and + * return success to the trap handler. + */ + if (PAR_SUCCESS(par)) { + PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); + } + break; + default: + break; + } + PMAP_UNLOCK(pmap); +#endif + + return (KERN_FAILURE); +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Fri Aug 12 08:50:05 2016 (r304003) +++ head/sys/arm64/arm64/trap.c Fri Aug 12 10:29:34 2016 (r304004) @@ -179,16 +179,6 @@ data_abort(struct trapframe *frame, uint return; } - KASSERT(td->td_md.md_spinlock_count == 0, - ("data abort with spinlock held")); - if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | - WARN_GIANTOK, NULL, "Kernel page fault") != 0) { - print_registers(frame); - printf(" far: %16lx\n", far); - printf(" esr: %.8lx\n", esr); - panic("data abort in critical section or under mutex"); - } - p = td->td_proc; if (lower) map = &p->p_vmspace->vm_map; @@ -200,6 +190,19 @@ data_abort(struct trapframe *frame, uint map = &p->p_vmspace->vm_map; } + if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) + return; + + KASSERT(td->td_md.md_spinlock_count == 0, + ("data abort with spinlock held")); + if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | + WARN_GIANTOK, NULL, "Kernel page fault") != 0) { + print_registers(frame); + printf(" far: %16lx\n", far); + printf(" esr: %.8lx\n", esr); + panic("data abort in critical section or under mutex"); + } + va = trunc_page(far); ftype = ((esr >> 6) & 1) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Fri Aug 12 08:50:05 2016 (r304003) +++ head/sys/arm64/include/pmap.h Fri Aug 12 10:29:34 2016 (r304004) @@ -151,6 +151,8 @@ void pmap_unmap_io_transient(vm_page_t * bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, pd_entry_t **, pt_entry_t **); +int pmap_fault(pmap_t, uint64_t, uint64_t); + #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Fri Aug 12 10:39:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6FEBB7166; Fri, 12 Aug 2016 10:39:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1EC91AB5; Fri, 12 Aug 2016 10:39:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 9D6537110B; Fri, 12 Aug 2016 10:39:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r303019 - head/sys/geom To: Bryan Drewery , Peter Wemm , svn-src-all@freebsd.org, ken References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Cc: svn-src-head@freebsd.org, src-committers@freebsd.org From: "Andrey V. Elsukov" Message-ID: <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> Date: Fri, 12 Aug 2016 13:38:21 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ipk7s7ANCBDOVtgjmR9phXsQSX8EuAXST" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 10:39:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ipk7s7ANCBDOVtgjmR9phXsQSX8EuAXST Content-Type: multipart/mixed; boundary="eMIiNCBMKE6usROB0pDbNDskLpW6v5FNV" From: "Andrey V. Elsukov" To: Bryan Drewery , Peter Wemm , svn-src-all@freebsd.org, ken Cc: svn-src-head@freebsd.org, src-committers@freebsd.org Message-ID: <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> In-Reply-To: <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> --eMIiNCBMKE6usROB0pDbNDskLpW6v5FNV Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12.08.16 03:26, Bryan Drewery wrote: > On r303467 I ran into this: >=20 > panic @ time 1470916206.652, thread 0xfffff8000412f000: > g_resize_provider_event but withered > cpuid =3D 0 > Panic occurred in module kernel loaded at 0xffffffff80200000: >=20 > Stack: -------------------------------------------------- > kernel:kassert_panic+0x166 > kernel:g_resize_provider_event+0x181 > kernel:g_run_events+0x186^M^M > kernel:fork_exit+0x83^M^M > -------------------------------------------------- >=20 > No further information available unfortunately. This one is related to r302087 :) --=20 WBR, Andrey V. Elsukov --eMIiNCBMKE6usROB0pDbNDskLpW6v5FNV-- --Ipk7s7ANCBDOVtgjmR9phXsQSX8EuAXST Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEsBAEBCAAWBQJXraceDxxhZUBmcmVlYnNkLm9yZwAKCRABxeoEEMihemkNB/9M +NxpuCbBWaPbNv31qcrVT2UMAMSAwI4ogI/+pXjdbHSe+LyTgmrl0uMGvnllINI9 JA4CQrVltLeKBiTmIiQbXkGliYMpO4yhzx5XgylZZ4LdOIWrdT4vUZU+A89Nt7Z9 VIzaomDiTOON9AYXZpj6R0rtPamieOULyoGVvYcL6J0+N70YfO3dQufCfgPKx9MF Pxp0fkXoXCNXORhFudx/xsd6Av0OKfyNGda/EWMt9fITP4MKZb1zXSRCRLBoxXC6 bLMLbqcMjn6MkBl+sfJt/y6z68emnetDT+BYnK9p8Jt6Kq93RAsDdZYb5MykWlBx yvursCAGUCIX2H8fdkdo =pLF3 -----END PGP SIGNATURE----- --Ipk7s7ANCBDOVtgjmR9phXsQSX8EuAXST-- From owner-svn-src-head@freebsd.org Fri Aug 12 11:06:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3445BB7B0A; Fri, 12 Aug 2016 11:06:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 828311B9B; Fri, 12 Aug 2016 11:06:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CB6sik096091; Fri, 12 Aug 2016 11:06:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CB6stN096090; Fri, 12 Aug 2016 11:06:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608121106.u7CB6stN096090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Aug 2016 11:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304005 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 11:06:55 -0000 Author: bdrewery Date: Fri Aug 12 11:06:54 2016 New Revision: 304005 URL: https://svnweb.freebsd.org/changeset/base/304005 Log: PORTS_MODULES: Don't leak in CC/CXX/CPP. These may have ccache in them or -target/--sysroot from external compiler or SYSTEM_COMPILER support. Many ports do not support a CC with spaces in it, such as emulators/virtualbox-ose-kmod. Passing --sysroot to ports makes no sense as ports doesn't support --sysroot currently. If these variables need to be overridden for ports then they can be set in make.conf or passed as make arguments. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Aug 12 10:29:34 2016 (r304004) +++ head/sys/conf/kern.post.mk Fri Aug 12 11:06:54 2016 (r304005) @@ -65,6 +65,10 @@ OSRELDATE!= awk '/^\#define[[:space:]]*_ # Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} PORTSMODULESENV=\ + env \ + -u CC \ + -u CXX \ + -u CPP \ PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ SRC_BASE=${SRC_BASE} \ OSVERSION=${OSRELDATE} \ From owner-svn-src-head@freebsd.org Fri Aug 12 13:52:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABC42BB7D7A; Fri, 12 Aug 2016 13:52:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC4F1D6F; Fri, 12 Aug 2016 13:52:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CDqpon058237; Fri, 12 Aug 2016 13:52:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CDqpgL058235; Fri, 12 Aug 2016 13:52:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608121352.u7CDqpgL058235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Aug 2016 13:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304006 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 13:52:52 -0000 Author: bdrewery Date: Fri Aug 12 13:52:51 2016 New Revision: 304006 URL: https://svnweb.freebsd.org/changeset/base/304006 Log: Avoid showing the bootstrap make command for check-old, etc. Reported by: koobs MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Fri Aug 12 11:06:54 2016 (r304005) +++ head/Makefile Fri Aug 12 13:52:51 2016 (r304006) @@ -209,7 +209,8 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${M SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk .endif -_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +_MAKE= PATH=${PATH} MAKE_CMD=${MAKE} ${SUB_MAKE} -f Makefile.inc1 \ + TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST # above. Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 12 11:06:54 2016 (r304005) +++ head/Makefile.inc1 Fri Aug 12 13:52:51 2016 (r304006) @@ -2378,11 +2378,11 @@ check-old-dirs: .PHONY done delete-old: delete-old-files delete-old-dirs .PHONY - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." check-old: check-old-files check-old-libs check-old-dirs .PHONY - @echo "To remove old files and directories run '${MAKE} delete-old'." - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old files and directories run '${MAKE_CMD} delete-old'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." .endif From owner-svn-src-head@freebsd.org Fri Aug 12 14:10:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6229BB712D; Fri, 12 Aug 2016 14:10:12 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9018D1694; Fri, 12 Aug 2016 14:10:12 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CEABH6062351; Fri, 12 Aug 2016 14:10:11 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CEABvT062350; Fri, 12 Aug 2016 14:10:11 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201608121410.u7CEABvT062350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 12 Aug 2016 14:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304007 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 14:10:12 -0000 Author: wblock (doc committer) Date: Fri Aug 12 14:10:11 2016 New Revision: 304007 URL: https://svnweb.freebsd.org/changeset/base/304007 Log: Correct the history of where ps first appeared. PR: 211741 Submitted by: Sevan Janiyan MFC after: 1 week Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri Aug 12 13:52:51 2016 (r304006) +++ head/bin/ps/ps.1 Fri Aug 12 14:10:11 2016 (r304007) @@ -768,7 +768,8 @@ operating systems. The .Nm command appeared in -.At v4 . +.At v3 +in section 8 of the manual. .Sh BUGS Since .Nm From owner-svn-src-head@freebsd.org Fri Aug 12 15:11:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECEBDBB7458; Fri, 12 Aug 2016 15:11:25 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A6D531B48; Fri, 12 Aug 2016 15:11:25 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id u7CFBHBY052486 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Aug 2016 11:11:17 -0400 (EDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id u7CFBHLf052485; Fri, 12 Aug 2016 11:11:17 -0400 (EDT) (envelope-from ken) Date: Fri, 12 Aug 2016 11:11:17 -0400 From: "Kenneth D. Merry" To: "Andrey V. Elsukov" Cc: Bryan Drewery , Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r303019 - head/sys/geom Message-ID: <20160812151117.GA52309@mithlond.kdm.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Fri, 12 Aug 2016 11:11:18 -0400 (EDT) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 15:11:26 -0000 On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote: > On 12.08.16 03:26, Bryan Drewery wrote: > > On r303467 I ran into this: > > > > panic @ time 1470916206.652, thread 0xfffff8000412f000: > > g_resize_provider_event but withered > > cpuid = 0 > > Panic occurred in module kernel loaded at 0xffffffff80200000: > > > > Stack: -------------------------------------------------- > > kernel:kassert_panic+0x166 > > kernel:g_resize_provider_event+0x181 > > kernel:g_run_events+0x186^M^M > > kernel:fork_exit+0x83^M^M > > -------------------------------------------------- > > > > No further information available unfortunately. > > This one is related to r302087 :) It looks like there is a race. I think we need to replace the KASSERT in g_resize_provider_event() with a return in case the provider is withered. I won't be able to work on or test this until sometime next week. So if you guys want to go ahead and make the change, please do. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@freebsd.org Fri Aug 12 15:14:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F56EBB7548 for ; Fri, 12 Aug 2016 15:14:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6BAC1E24 for ; Fri, 12 Aug 2016 15:13:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id m101so27237514ioi.2 for ; Fri, 12 Aug 2016 08:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jyOtopTm7WQds9YgJIqtFVbAHlI8lHvS9RKglH7dWgY=; b=rHR2hLM1l0Wz70JRnDmGkUh5G3MliBjlnARbO+iwURw3RZzrWsTxdPI5IwNy9VFK7c sv6ZeUkJxYhv2qyM1eVmqm4t0hZjFvH918MPsQDZhFpHBk4qBKQ5Cm14/ZebN2RXLCMx gPoNMGvi+lY7qIUYK0jMY2EJCi5FC0zlO0oa2IXs1WgLJTq90BGEsFXp+yM43zxzOMv/ RUxE/+aYKonVQR2vcPUJUDuVHD+T5MS9Uu6L7JjXyyXyk6XEuIoKCRt0IRVLLvPMOy/K WhVdEDv9YU0F39Lw/mPeLXkkNNYBDLSslqsiMfzkM4el3zGDgjhgk0gF1SZMBci/ZN7v 0zYA== 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; bh=jyOtopTm7WQds9YgJIqtFVbAHlI8lHvS9RKglH7dWgY=; b=i4gcfNwO0emG8KEjSQ6tf/BC5B+EgkXXOrKhG3X0dP5EYORL4nhAC+5evNcw9kAZ1I x9lXZ18KmcJEs8FqdSES2+W6p8oKKme9khJR0Jl0FlnhEpErq6SUxgi4p03A8sJ/PIDe xrAIHzUBMTCDcNIsrmnQAn7PsksM9GXIZW5m3fme2nfsP4DnPA+RzLaIK9uBjPyFfMUi lydMFGhVSxiAO4tqxHUeysvDn7Q8TJHXhlSaqh69ICHWuCzxl7xGRTEWk2oaOi9yV81x eaarJyPDJUZUGd90zSOAj6bWdY+C2F2vj2+bDhtoSLHIOzKXaanTH/GZOAVYmZ98pyj3 c+1w== X-Gm-Message-State: AEkooustmlcoubeslc0jICxl8qi13y8lD66oR6WHDc7ZNG8MEr2/i5ZjAl0bsqsJjCFWHBtghMMlu7nrZcw/Aw== X-Received: by 10.107.9.39 with SMTP id j39mr18415005ioi.73.1471014839249; Fri, 12 Aug 2016 08:13:59 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Fri, 12 Aug 2016 08:13:58 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160812151117.GA52309@mithlond.kdm.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> From: Warner Losh Date: Fri, 12 Aug 2016 09:13:58 -0600 X-Google-Sender-Auth: g75ZZPq3X_ggpmGxi7vH7mhRw5c Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom To: "Kenneth D. Merry" Cc: "Andrey V. Elsukov" , Bryan Drewery , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 15:14:00 -0000 On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry wrote: > On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote: >> On 12.08.16 03:26, Bryan Drewery wrote: >> > On r303467 I ran into this: >> > >> > panic @ time 1470916206.652, thread 0xfffff8000412f000: >> > g_resize_provider_event but withered >> > cpuid = 0 >> > Panic occurred in module kernel loaded at 0xffffffff80200000: >> > >> > Stack: -------------------------------------------------- >> > kernel:kassert_panic+0x166 >> > kernel:g_resize_provider_event+0x181 >> > kernel:g_run_events+0x186^M^M >> > kernel:fork_exit+0x83^M^M >> > -------------------------------------------------- >> > >> > No further information available unfortunately. >> >> This one is related to r302087 :) > > It looks like there is a race. I think we need to replace the KASSERT > in g_resize_provider_event() with a return in case the provider is > withered. > > I won't be able to work on or test this until sometime next week. So if > you guys want to go ahead and make the change, please do. But why are we calling g_resize_provider on a withered object? That's the part I don't understand in this thread. Warner From owner-svn-src-head@freebsd.org Fri Aug 12 15:17:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F479BB7632; Fri, 12 Aug 2016 15:17:48 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A90BA117D; Fri, 12 Aug 2016 15:17:47 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id u7CFHjvM052572 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Aug 2016 11:17:45 -0400 (EDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id u7CFHj8e052571; Fri, 12 Aug 2016 11:17:45 -0400 (EDT) (envelope-from ken) Date: Fri, 12 Aug 2016 11:17:45 -0400 From: "Kenneth D. Merry" To: Warner Losh Cc: "Andrey V. Elsukov" , Bryan Drewery , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Subject: Re: svn commit: r303019 - head/sys/geom Message-ID: <20160812151745.GA52527@mithlond.kdm.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Fri, 12 Aug 2016 11:17:45 -0400 (EDT) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 15:17:48 -0000 On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote: > On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry wrote: > > On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote: > >> On 12.08.16 03:26, Bryan Drewery wrote: > >> > On r303467 I ran into this: > >> > > >> > panic @ time 1470916206.652, thread 0xfffff8000412f000: > >> > g_resize_provider_event but withered > >> > cpuid = 0 > >> > Panic occurred in module kernel loaded at 0xffffffff80200000: > >> > > >> > Stack: -------------------------------------------------- > >> > kernel:kassert_panic+0x166 > >> > kernel:g_resize_provider_event+0x181 > >> > kernel:g_run_events+0x186^M^M > >> > kernel:fork_exit+0x83^M^M > >> > -------------------------------------------------- > >> > > >> > No further information available unfortunately. > >> > >> This one is related to r302087 :) > > > > It looks like there is a race. I think we need to replace the KASSERT > > in g_resize_provider_event() with a return in case the provider is > > withered. > > > > I won't be able to work on or test this until sometime next week. So if > > you guys want to go ahead and make the change, please do. > > But why are we calling g_resize_provider on a withered object? That's > the part I don't understand in this thread. It isn't withered when the event is queued, but it is withered by the time the event is executed. There is a check in g_resize_provider() to make sure it isn't withered. If not, the event is queued. But once g_resize_provider_event() runs, it is withered and we run into the KASSERT. There isn't adequate locking and ordering in there to prevent the race from happening, so the assert should be replaced with an "if (withered) return" statement. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@freebsd.org Fri Aug 12 15:21:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA151BB770B for ; Fri, 12 Aug 2016 15:21:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F78614C8 for ; Fri, 12 Aug 2016 15:21:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id b62so27409581iod.3 for ; Fri, 12 Aug 2016 08:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=tuuLVUoKijK5+mlYDt0WFJeWveGEDlqXa8WtC09tvDo=; b=OoXXkDX5yYd68xDhizSMKFP5QSiEVMBEFQOn0svKPnqUNu0luTuAr5K0f9l6n7wAKZ Iv0yBlntyKsJIoEVuOD7ppUjPYGSP7b7vIsoxnE/fdEVHA+x1fMnvsN5TMiVkLgnV3Uz OFJ20wwI9GcynRcsuVZ2aVxxMVLN+r61gMnzQzw0aPUc44BwQPATzXrAV6Kij89jNkNT WeVBVCpDxkBVyLVy+/SNMJbcQFisFxI4QOySraear2tus9+AwL6W5f9Nmnew+ezJU63Q QUs7KxKoitw/tbdMY2rmoOjQ9Z0TzGKLzMLrBexw2w1XsJWjSmbAAaa0Jc/LCBVQdX8t 6BsA== 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; bh=tuuLVUoKijK5+mlYDt0WFJeWveGEDlqXa8WtC09tvDo=; b=Mj/sqcj1wM+tkssAj5SKFuNmwoPuGtz3PhOG8Edn+jA0dd+XGhi9WuDmJxtInQmNOS CU3tXMgD759q/aXZjgNdQ9DsXYrVmYxvFeZY/50QGOCjC7kIhpNVHdqN22C9nWVXCwPY aTziP6XWDgF7sJfn2VvCUh+tWyNa5eLSR12n0HKZVw4Qpy9N8KfIXTPCgNrXU15R867A Fy3dlD7EoKgbjeVvmybSK9ae9rotuA5aoUXn7+YNR+Iurvixkb3imC+DMef+NAKW7itO 5YX8fy4Jhe+xWDsBifq8F0hs5ZsC8BuPkCF5uXZ3I5frLCPibcVaBO4tbyUPF4XV2ED7 endA== X-Gm-Message-State: AEkoouuzGuukLkd3uB8mg0ZizpZbGUryORgMu7LLVyLI/MQH9tbl9X2gwwb4YfC0KfayEl/TRq7Bphj5lsn7Ug== X-Received: by 10.107.9.39 with SMTP id j39mr18458049ioi.73.1471015265444; Fri, 12 Aug 2016 08:21:05 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Fri, 12 Aug 2016 08:21:04 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160812151745.GA52527@mithlond.kdm.org> References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> From: Warner Losh Date: Fri, 12 Aug 2016 09:21:04 -0600 X-Google-Sender-Auth: 79eIeESz0kI_zDJn4NwG8mhAESA Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom To: "Kenneth D. Merry" Cc: "Andrey V. Elsukov" , Bryan Drewery , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 15:21:06 -0000 On Fri, Aug 12, 2016 at 9:17 AM, Kenneth D. Merry wrote: > On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote: >> On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry wrote: >> > On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote: >> >> On 12.08.16 03:26, Bryan Drewery wrote: >> >> > On r303467 I ran into this: >> >> > >> >> > panic @ time 1470916206.652, thread 0xfffff8000412f000: >> >> > g_resize_provider_event but withered >> >> > cpuid = 0 >> >> > Panic occurred in module kernel loaded at 0xffffffff80200000: >> >> > >> >> > Stack: -------------------------------------------------- >> >> > kernel:kassert_panic+0x166 >> >> > kernel:g_resize_provider_event+0x181 >> >> > kernel:g_run_events+0x186^M^M >> >> > kernel:fork_exit+0x83^M^M >> >> > -------------------------------------------------- >> >> > >> >> > No further information available unfortunately. >> >> >> >> This one is related to r302087 :) >> > >> > It looks like there is a race. I think we need to replace the KASSERT >> > in g_resize_provider_event() with a return in case the provider is >> > withered. >> > >> > I won't be able to work on or test this until sometime next week. So if >> > you guys want to go ahead and make the change, please do. >> >> But why are we calling g_resize_provider on a withered object? That's >> the part I don't understand in this thread. > > It isn't withered when the event is queued, but it is withered by the time > the event is executed. > > There is a check in g_resize_provider() to make sure it isn't withered. If > not, the event is queued. But once g_resize_provider_event() runs, it is > withered and we run into the KASSERT. > > There isn't adequate locking and ordering in there to prevent the race > from happening, so the assert should be replaced with an "if (withered) > return" statement. I'll grant that we may wither with outstanding events, but why is it withering? That seems odd. Either we're bogusly posting this event just before it will wither, or something else is bogusly withering it. Just removing the assert isn't going to fix the underlying issue. Back to Bryan: just to be clear, this is with the latest version of the code, and not the intermediate version that was fixed after numerous problems surfaced, right? Warner From owner-svn-src-head@freebsd.org Fri Aug 12 15:23:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3CACBB782D; Fri, 12 Aug 2016 15:23:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 915571796; Fri, 12 Aug 2016 15:23:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8569917D6; Fri, 12 Aug 2016 15:23:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3DEFA7D49; Fri, 12 Aug 2016 15:23:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Ud53tiU6bk1E; Fri, 12 Aug 2016 15:23:47 +0000 (UTC) Subject: Re: svn commit: r303019 - head/sys/geom DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CF6167D43 To: Warner Losh , "Kenneth D. Merry" References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> Cc: "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Fri, 12 Aug 2016 08:23:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cUcpUOGMI3scLeW38BQE1FqfCJfLSM1TH" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 15:23:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cUcpUOGMI3scLeW38BQE1FqfCJfLSM1TH Content-Type: multipart/mixed; boundary="srVN6Bwftn190dQEXwoKeebQISJUiN0dC" From: Bryan Drewery To: Warner Losh , "Kenneth D. Merry" Cc: "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> In-Reply-To: --srVN6Bwftn190dQEXwoKeebQISJUiN0dC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/12/16 8:21 AM, Warner Losh wrote: > On Fri, Aug 12, 2016 at 9:17 AM, Kenneth D. Merry wro= te: >> On Fri, Aug 12, 2016 at 09:13:58 -0600, Warner Losh wrote: >>> On Fri, Aug 12, 2016 at 9:11 AM, Kenneth D. Merry w= rote: >>>> On Fri, Aug 12, 2016 at 13:38:21 +0300, Andrey V. Elsukov wrote: >>>>> On 12.08.16 03:26, Bryan Drewery wrote: >>>>>> On r303467 I ran into this: >>>>>> >>>>>> panic @ time 1470916206.652, thread 0xfffff8000412f000: >>>>>> g_resize_provider_event but withered >>>>>> cpuid =3D 0 >>>>>> Panic occurred in module kernel loaded at 0xffffffff80200000: >>>>>> >>>>>> Stack: -------------------------------------------------- >>>>>> kernel:kassert_panic+0x166 >>>>>> kernel:g_resize_provider_event+0x181 >>>>>> kernel:g_run_events+0x186^M^M >>>>>> kernel:fork_exit+0x83^M^M >>>>>> -------------------------------------------------- >>>>>> >>>>>> No further information available unfortunately. >>>>> >>>>> This one is related to r302087 :) >>>> >>>> It looks like there is a race. I think we need to replace the KASSE= RT >>>> in g_resize_provider_event() with a return in case the provider is >>>> withered. >>>> >>>> I won't be able to work on or test this until sometime next week. S= o if >>>> you guys want to go ahead and make the change, please do. >>> >>> But why are we calling g_resize_provider on a withered object? That's= >>> the part I don't understand in this thread. >> >> It isn't withered when the event is queued, but it is withered by the = time >> the event is executed. >> >> There is a check in g_resize_provider() to make sure it isn't withered= =2E If >> not, the event is queued. But once g_resize_provider_event() runs, it= is >> withered and we run into the KASSERT. >> >> There isn't adequate locking and ordering in there to prevent the race= >> from happening, so the assert should be replaced with an "if (withered= ) >> return" statement. >=20 > I'll grant that we may wither with outstanding events, but why is it > withering? That seems odd. Either we're bogusly posting this event > just before it will wither, or something else is bogusly withering it. > Just removing the assert isn't going to fix the underlying issue. >=20 > Back to Bryan: just to be clear, this is with the latest version of > the code, and not the intermediate version that was fixed after > numerous problems surfaced, right? >=20 No, I was missing r303637. Hard to say if it is related... Andrey says it's not. I haven't dived into it yet and it's so far only happened once (out of a few tests). We do have various customizations but I'm inclined to think it's the stock code having problems. --=20 Regards, Bryan Drewery --srVN6Bwftn190dQEXwoKeebQISJUiN0dC-- --cUcpUOGMI3scLeW38BQE1FqfCJfLSM1TH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXreoAAAoJEDXXcbtuRpfPivgIAJPcWlrUrEp21ocPeeIpFiWL OWx/And4RE/SOtH9+355Bf30mQnSJUQKxZM7Wo/PNfXhVmkaqbLaiJcu+3C4FTJL VUXpuP1CEzuzpveWbhYy2b4aHa8ape47qBnVjjnNe+cFtPXKeOge6Ymscu9NbHJf 0xSUgMx/3xexOHpVAnUrEHzhNsP3f8yKN6HJN5GF0Sq7SkpG7n35b3u7oEuSDn4z KYzZ8x2qjo8p6VMkMds+fHaS5Dn73EYPXYpRfEtRJdo3+ZcJFTyZQp8EvjQf+mMY eoMoBc5a1vcx0hcsxMB7XX6+2RWUuewLgJDdjRObr2RMy/yHA0XEEGnlgewfYDE= =DYMe -----END PGP SIGNATURE----- --cUcpUOGMI3scLeW38BQE1FqfCJfLSM1TH-- From owner-svn-src-head@freebsd.org Fri Aug 12 16:05:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6218BB6B8F; Fri, 12 Aug 2016 16:05:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A71741A28; Fri, 12 Aug 2016 16:05:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CG5r9L007017; Fri, 12 Aug 2016 16:05:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CG5rU9007016; Fri, 12 Aug 2016 16:05:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608121605.u7CG5rU9007016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Aug 2016 16:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304008 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 16:05:54 -0000 Author: bdrewery Date: Fri Aug 12 16:05:53 2016 New Revision: 304008 URL: https://svnweb.freebsd.org/changeset/base/304008 Log: Avoid taking PROC_LOCK in syscalls if not being traced. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri Aug 12 14:10:11 2016 (r304007) +++ head/sys/dev/filemon/filemon.c Fri Aug 12 16:05:53 2016 (r304008) @@ -137,6 +137,8 @@ filemon_proc_get(struct proc *p) { struct filemon *filemon; + if (p->p_filemon == NULL) + return (NULL); PROC_LOCK(p); filemon = filemon_acquire(p->p_filemon); PROC_UNLOCK(p); From owner-svn-src-head@freebsd.org Fri Aug 12 16:13:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4A9BB6F9A; Fri, 12 Aug 2016 16:13:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD7E1453; Fri, 12 Aug 2016 16:13:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CGDoIu010739; Fri, 12 Aug 2016 16:13:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CGDoGF010738; Fri, 12 Aug 2016 16:13:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608121613.u7CGDoGF010738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 12 Aug 2016 16:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304009 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 16:13:51 -0000 Author: jhb Date: Fri Aug 12 16:13:50 2016 New Revision: 304009 URL: https://svnweb.freebsd.org/changeset/base/304009 Log: Remove description of P_FOLLOWFORK as this flag was removed. Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri Aug 12 16:05:53 2016 (r304008) +++ head/bin/ps/ps.1 Fri Aug 12 16:13:50 2016 (r304009) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 28, 2016 +.Dd August 12, 2016 .Dt PS 1 .Os .Sh NAME @@ -319,7 +319,6 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal" .It Dv "P_KPROC" Ta No "0x00004" Ta "Kernel process" -.It Dv "P_FOLLOWFORK" Ta No "0x00008" Ta "Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof" From owner-svn-src-head@freebsd.org Fri Aug 12 18:29:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39C9DBB7171; Fri, 12 Aug 2016 18:29:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E443A1DE1; Fri, 12 Aug 2016 18:29:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CITCN8059448; Fri, 12 Aug 2016 18:29:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CITCIu059447; Fri, 12 Aug 2016 18:29:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608121829.u7CITCIu059447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Aug 2016 18:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304011 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 18:29:13 -0000 Author: kib Date: Fri Aug 12 18:29:11 2016 New Revision: 304011 URL: https://svnweb.freebsd.org/changeset/base/304011 Log: Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Aug 12 18:07:44 2016 (r304010) +++ head/libexec/rtld-elf/rtld.c Fri Aug 12 18:29:11 2016 (r304011) @@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (process_needed(obj, obj->needed, flags) == -1) @@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool Obj_Entry *obj; int error; - error = 0; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (error = 0, obj = first; obj != NULL; + obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; error = relocate_object(obj, bind_now, rtldobj, flags, @@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first, { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1) @@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj) list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL")); - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { Needed_Entry *needed; char *name, *path; bool is_lib; @@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldt */ free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); } else { - obj = objs; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker || obj->tlsoffset == 0) continue; addr = segbase - obj->tlsoffset; From owner-svn-src-head@freebsd.org Fri Aug 12 18:31:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E069BB71E5; Fri, 12 Aug 2016 18:31:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50C3E1268; Fri, 12 Aug 2016 18:31:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CIViZW063026; Fri, 12 Aug 2016 18:31:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CIViOh063025; Fri, 12 Aug 2016 18:31:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608121831.u7CIViOh063025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Aug 2016 18:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304012 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 18:31:45 -0000 Author: kib Date: Fri Aug 12 18:31:44 2016 New Revision: 304012 URL: https://svnweb.freebsd.org/changeset/base/304012 Log: Fill phdr and phsize for rtld object. It is needed for dl_iterate_phdr() reporting the correct values. PR: 211367 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Aug 12 18:29:11 2016 (r304011) +++ head/libexec/rtld-elf/rtld.c Fri Aug 12 18:31:44 2016 (r304012) @@ -1916,6 +1916,7 @@ static void init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Ehdr *ehdr; const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; @@ -1954,6 +1955,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * relocate_objects(&objtmp, true, &objtmp, 0, NULL); } + ehdr = (Elf_Ehdr *)mapbase; + objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); + objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); /* Initialize the object list. */ TAILQ_INIT(&obj_list); From owner-svn-src-head@freebsd.org Fri Aug 12 18:34:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3503FBB7384; Fri, 12 Aug 2016 18:34:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0683C152C; Fri, 12 Aug 2016 18:34:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22f.google.com with SMTP id p64so11346028pfb.1; Fri, 12 Aug 2016 11:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nhtRYelolxTgNwxLF6BvyU4/cyMaFiWn769FCHQuyBQ=; b=jWFS1jZ0kxH2v1nsJ/yp5EoP0dmoYr3r9Pek9yfoaxK7DgkMmajf+4fIHuCcKLurWN Ds9t97zMygK2h9IJeZis9oGffvriUCemEbgtcuam5Gl1VyPXWXlNlKfaSj9uM4rbQxfs uyFcDbLFGm8MUWRmZHGQtDVLXUwi23u3WiWxX9+fRjdoBx+d69uSv8mGTUSb8Kf/3yjk BafMM++v8ANz4eA2ZAm0dqIBkHxoc9j+20NL3/q+/k1f+U9q2NjmO+67F/s4k+sdDFvI UnNGFlg9k6tYwtdJq9H6posM2Y0d6L+/Yph3yaEAbJLDj2jmWHpt1jb70oU1s8la5Hz5 cRiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nhtRYelolxTgNwxLF6BvyU4/cyMaFiWn769FCHQuyBQ=; b=gLPjUL+Wgmj4E0VDBQzv3z54TfkrjW43jw2KbRcdoGV8h7uBrDsxLlmIgo7FcgHw7H gNuze3y1n3m/6TkwX2kFPPMzUg7UR+qeEBl9slrFxs8naZV+bMb0BolALRXK1OHp30Qb SFQ9JLAPAbI5e26EM5OqvPx2bE7eJXxdlAAHa1UljyznY93IKtJdfMj8jdCpQHNOOsgn zvm4wM1UcmY2qFK367K5TROfx3XbTAmtIER/r/Ga4XVB8xrCNxBx06nf/1L3tN335iSn cGX7LOJ35dWDlmXSM8bCpQE2kziq8fRuPx3fQVJEjI1KRbbFrZKSw8O9F4FJIwOsCbiR kzPA== X-Gm-Message-State: AEkooutRO8B3iIJgahw0xcTC2V8KHT/RmMV/8jhKVx9Cc27df8vDrlTrOu1vikDxJYn6XQ== X-Received: by 10.98.70.199 with SMTP id o68mr29657093pfi.17.1471026884406; Fri, 12 Aug 2016 11:34:44 -0700 (PDT) Received: from [21.183.82.46] ([172.56.42.252]) by smtp.gmail.com with ESMTPSA id vt10sm14724165pab.43.2016.08.12.11.34.43 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Aug 2016 11:34:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf From: Ngie Cooper X-Mailer: iPhone Mail (13G35) In-Reply-To: <201608121829.u7CITCIu059447@repo.freebsd.org> Date: Fri, 12 Aug 2016 11:34:42 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> References: <201608121829.u7CITCIu059447@repo.freebsd.org> To: Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 18:34:45 -0000 > On Aug 12, 2016, at 11:29, Konstantin Belousov wrote: >=20 > Author: kib > Date: Fri Aug 12 18:29:11 2016 > New Revision: 304011 > URL: https://svnweb.freebsd.org/changeset/base/304011 >=20 > Log: > Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. Why? > Sponsored by: The FreeBSD Foundation > MFC after: 1 week >=20 > Modified: > head/libexec/rtld-elf/rtld.c >=20 > Modified: head/libexec/rtld-elf/rtld.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/libexec/rtld-elf/rtld.c Fri Aug 12 18:07:44 2016 (r304010) > +++ head/libexec/rtld-elf/rtld.c Fri Aug 12 18:29:11 2016 (r304011) > @@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in > { > Obj_Entry *obj; >=20 > - obj =3D first; > - TAILQ_FOREACH_FROM(obj, &obj_list, next) { > + for (obj =3D first; obj !=3D NULL; obj =3D TAILQ_NEXT(obj, next)) { > if (obj->marker) > continue; > if (process_needed(obj, obj->needed, flags) =3D=3D -1) > @@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool=20 > Obj_Entry *obj; > int error; >=20 > - error =3D 0; > - obj =3D first; > - TAILQ_FOREACH_FROM(obj, &obj_list, next) { > + for (error =3D 0, obj =3D first; obj !=3D NULL; > + obj =3D TAILQ_NEXT(obj, next)) { > if (obj->marker) > continue; > error =3D relocate_object(obj, bind_now, rtldobj, flags, > @@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first,=20 > { > Obj_Entry *obj; >=20 > - obj =3D first; > - TAILQ_FOREACH_FROM(obj, &obj_list, next) { > + for (obj =3D first; obj !=3D NULL; obj =3D TAILQ_NEXT(obj, next)) { > if (obj->marker) > continue; > if (resolve_object_ifunc(obj, bind_now, flags, lockstate) =3D=3D -1= ) > @@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj) >=20 > list_containers =3D getenv(_LD("TRACE_LOADED_OBJECTS_ALL")); >=20 > - TAILQ_FOREACH_FROM(obj, &obj_list, next) { > + for (; obj !=3D NULL; obj =3D TAILQ_NEXT(obj, next)) { > Needed_Entry *needed; > char *name, *path; > bool is_lib; > @@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldt > */ > free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); > } else { > - obj =3D objs; > - TAILQ_FOREACH_FROM(obj, &obj_list, next) { > + for (obj =3D objs; obj !=3D NULL; obj =3D TAILQ_NEXT(obj, next)) { > if (obj->marker || obj->tlsoffset =3D=3D 0) > continue; > addr =3D segbase - obj->tlsoffset; >=20 From owner-svn-src-head@freebsd.org Fri Aug 12 18:36:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8214ABB74AD; Fri, 12 Aug 2016 18:36:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7EC51825; Fri, 12 Aug 2016 18:36:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7CIaa2O029276 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Aug 2016 21:36:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7CIaa2O029276 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7CIaaCl029275; Fri, 12 Aug 2016 21:36:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Aug 2016 21:36:36 +0300 From: Konstantin Belousov To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304011 - head/libexec/rtld-elf Message-ID: <20160812183636.GP83214@kib.kiev.ua> References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 18:36:46 -0000 On Fri, Aug 12, 2016 at 11:34:42AM -0700, Ngie Cooper wrote: > > > On Aug 12, 2016, at 11:29, Konstantin Belousov wrote: > > > > Author: kib > > Date: Fri Aug 12 18:29:11 2016 > > New Revision: 304011 > > URL: https://svnweb.freebsd.org/changeset/base/304011 > > > > Log: > > Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. > > Why? Because the API is unusable. It causes full queue iteration when the object is NULL, i.e. at the end of the queue, instead of doing nothing. From owner-svn-src-head@freebsd.org Fri Aug 12 18:38:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC55BB7580; Fri, 12 Aug 2016 18:38:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F137A1A60; Fri, 12 Aug 2016 18:38:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7CIcjuj063526 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Aug 2016 11:38:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7CIcjYR063525; Fri, 12 Aug 2016 11:38:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 12 Aug 2016 11:38:45 -0700 From: Gleb Smirnoff To: Sean Bruno Cc: Michael Zhilin , ngie@FreeBSD.org, sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303848 - head/sys/netgraph Message-ID: <20160812183845.GJ1076@FreeBSD.org> References: <201608081931.u78JV1Ve026577@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608081931.u78JV1Ve026577@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 18:38:52 -0000 Hi! Sorry, I'm afraid this isn't a correct fix. Simply adding checks against NULL to avoid panics at race conditions isn't a solution. I can provide help with this problem. It must be related to my callout changes, in case if this is a very recent problem. Is it a recent problem or an old one? On Mon, Aug 08, 2016 at 07:31:01PM +0000, Sean Bruno wrote: S> Author: sbruno S> Date: Mon Aug 8 19:31:01 2016 S> New Revision: 303848 S> URL: https://svnweb.freebsd.org/changeset/base/303848 S> S> Log: S> Avoid panic from ng_uncallout when unpluggin ethernet cable with active S> PPTP VPN connection. S> S> Submitted by: Michael Zhilin S> Reviewed by: ngie S> MFC after: 3 days S> Differential Revision: https://reviews.freebsd.org/D7209 S> S> Modified: S> head/sys/netgraph/ng_base.c S> S> Modified: head/sys/netgraph/ng_base.c S> ============================================================================== S> --- head/sys/netgraph/ng_base.c Mon Aug 8 18:57:50 2016 (r303847) S> +++ head/sys/netgraph/ng_base.c Mon Aug 8 19:31:01 2016 (r303848) S> @@ -3815,7 +3815,7 @@ ng_uncallout(struct callout *c, node_p n S> item = c->c_arg; S> /* Do an extra check */ S> if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && S> - (NGI_NODE(item) == node)) { S> + (item != NULL) && (NGI_NODE(item) == node)) { S> /* S> * We successfully removed it from the queue before it ran S> * So now we need to unreference everything that was S> _______________________________________________ S> svn-src-all@freebsd.org mailing list S> https://lists.freebsd.org/mailman/listinfo/svn-src-all S> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Aug 12 19:31:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CF4BB36DB; Fri, 12 Aug 2016 19:31:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F50B15F5; Fri, 12 Aug 2016 19:31:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CJVg1V084046; Fri, 12 Aug 2016 19:31:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CJVgt6084040; Fri, 12 Aug 2016 19:31:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608121931.u7CJVgt6084040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Aug 2016 19:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304016 - in head: lib/libsysdecode libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 19:31:43 -0000 Author: kib Date: Fri Aug 12 19:31:41 2016 New Revision: 304016 URL: https://svnweb.freebsd.org/changeset/base/304016 Log: Move defines common between rtld and libsysdecode into the header, instead of copying inline into sources. Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/libexec/rtld-elf/rtld_utrace.h (contents, props changed) Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/utrace.c head/libexec/rtld-elf/rtld.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Fri Aug 12 19:26:12 2016 (r304015) +++ head/lib/libsysdecode/Makefile Fri Aug 12 19:31:41 2016 (r304016) @@ -9,6 +9,7 @@ SRCS= errno.c ioctl.c syscallnames.c utr INCS= sysdecode.h CFLAGS+= -I${.CURDIR}/../../sys +CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf MAN+= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ Modified: head/lib/libsysdecode/utrace.c ============================================================================== --- head/lib/libsysdecode/utrace.c Fri Aug 12 19:26:12 2016 (r304015) +++ head/lib/libsysdecode/utrace.c Fri Aug 12 19:31:41 2016 (r304016) @@ -35,33 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#define UTRACE_DLOPEN_START 1 -#define UTRACE_DLOPEN_STOP 2 -#define UTRACE_DLCLOSE_START 3 -#define UTRACE_DLCLOSE_STOP 4 -#define UTRACE_LOAD_OBJECT 5 -#define UTRACE_UNLOAD_OBJECT 6 -#define UTRACE_ADD_RUNDEP 7 -#define UTRACE_PRELOAD_FINISHED 8 -#define UTRACE_INIT_CALL 9 -#define UTRACE_FINI_CALL 10 -#define UTRACE_DLSYM_START 11 -#define UTRACE_DLSYM_STOP 12 - -struct utrace_rtld { - char sig[4]; /* 'RTLD' */ - int event; - void *handle; - void *mapbase; - size_t mapsize; - int refcnt; - char name[MAXPATHLEN]; -}; +#include "rtld_utrace.h" #ifdef __LP64__ struct utrace_rtld32 { - char sig[4]; /* 'RTLD' */ + char sig[4]; int event; uint32_t handle; uint32_t mapbase; @@ -189,10 +167,11 @@ sysdecode_utrace(FILE *fp, void *p, size struct utrace_malloc um; struct utrace_malloc32 *pm; #endif + static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG; - if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) { + if (len == sizeof(struct utrace_rtld) && bcmp(p, rtld_utrace_sig, + sizeof(rtld_utrace_sig)) == 0) return (print_utrace_rtld(fp, p)); - } if (len == sizeof(struct utrace_malloc)) { print_utrace_malloc(fp, p); @@ -200,7 +179,8 @@ sysdecode_utrace(FILE *fp, void *p, size } #ifdef __LP64__ - if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) { + if (len == sizeof(struct utrace_rtld32) && bcmp(p, rtld_utrace_sig, + sizeof(rtld_utrace_sig)) == 0) { pr = p; memset(&ur, 0, sizeof(ur)); memcpy(ur.sig, pr->sig, sizeof(ur.sig)); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Aug 12 19:26:12 2016 (r304015) +++ head/libexec/rtld-elf/rtld.c Fri Aug 12 19:31:41 2016 (r304016) @@ -59,6 +59,7 @@ #include "paths.h" #include "rtld_tls.h" #include "rtld_printf.h" +#include "rtld_utrace.h" #include "notes.h" /* Types. */ @@ -273,29 +274,6 @@ char *ld_env_prefix = LD_; (dlp)->num_alloc = obj_count, \ (dlp)->num_used = 0) -#define UTRACE_DLOPEN_START 1 -#define UTRACE_DLOPEN_STOP 2 -#define UTRACE_DLCLOSE_START 3 -#define UTRACE_DLCLOSE_STOP 4 -#define UTRACE_LOAD_OBJECT 5 -#define UTRACE_UNLOAD_OBJECT 6 -#define UTRACE_ADD_RUNDEP 7 -#define UTRACE_PRELOAD_FINISHED 8 -#define UTRACE_INIT_CALL 9 -#define UTRACE_FINI_CALL 10 -#define UTRACE_DLSYM_START 11 -#define UTRACE_DLSYM_STOP 12 - -struct utrace_rtld { - char sig[4]; /* 'RTLD' */ - int event; - void *handle; - void *mapbase; /* Used for 'parent' and 'init/fini' */ - size_t mapsize; - int refcnt; /* Used for 'mode' */ - char name[MAXPATHLEN]; -}; - #define LD_UTRACE(e, h, mb, ms, r, n) do { \ if (ld_utrace != NULL) \ ld_utrace_log(e, h, mb, ms, r, n); \ @@ -306,11 +284,9 @@ ld_utrace_log(int event, void *handle, v int refcnt, const char *name) { struct utrace_rtld ut; + static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG; - ut.sig[0] = 'R'; - ut.sig[1] = 'T'; - ut.sig[2] = 'L'; - ut.sig[3] = 'D'; + memcpy(ut.sig, rtld_utrace_sig, sizeof(ut.sig)); ut.event = event; ut.handle = handle; ut.mapbase = mapbase; Added: head/libexec/rtld-elf/rtld_utrace.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/rtld_utrace.h Fri Aug 12 19:31:41 2016 (r304016) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2007 John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef RTLD_UTRACE_H +#define RTLD_UTRACE_H + +#include + +#define UTRACE_DLOPEN_START 1 +#define UTRACE_DLOPEN_STOP 2 +#define UTRACE_DLCLOSE_START 3 +#define UTRACE_DLCLOSE_STOP 4 +#define UTRACE_LOAD_OBJECT 5 +#define UTRACE_UNLOAD_OBJECT 6 +#define UTRACE_ADD_RUNDEP 7 +#define UTRACE_PRELOAD_FINISHED 8 +#define UTRACE_INIT_CALL 9 +#define UTRACE_FINI_CALL 10 +#define UTRACE_DLSYM_START 11 +#define UTRACE_DLSYM_STOP 12 + +#define RTLD_UTRACE_SIG_SZ 4 +#define RTLD_UTRACE_SIG "RTLD" + +struct utrace_rtld { + char sig[RTLD_UTRACE_SIG_SZ]; + int event; + void *handle; + void *mapbase; /* Used for 'parent' and 'init/fini' */ + size_t mapsize; + int refcnt; /* Used for 'mode' */ + char name[MAXPATHLEN]; +}; + +#endif From owner-svn-src-head@freebsd.org Fri Aug 12 19:32:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B46ABB380F for ; Fri, 12 Aug 2016 19:32:39 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A58F17F7 for ; Fri, 12 Aug 2016 19:32:39 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x22c.google.com with SMTP id a33so887532ybi.3 for ; Fri, 12 Aug 2016 12:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bPz1o/OfeL6YzLGQka2+YreLUW8aCOI57xe8PSpwRik=; b=iJ+e+5RVo6GAHnuEW9ZlmX/7XKTGTEsLvfK08zma+fnB+wxiT4EQ3eNjBSI8VVeyYE XGk2BpFRXFe0cx1cvuG7+qhFYTMl8sREWKJMwOOdog2IA7nrKZlTknHkLT+6uDk9IFlp efWrlLAIMWzLFW9BUv/bxHjcyz5zmon3JsnkMxifnQBRVg2el11RXckLbt1LEhlGu6LA QlNz0TJOkf1Bl7fK7UIf7MHBeXk7gFLsXlhTOJsdF5PNNxxMDbfnAtORmv/jAjhjgqkv nIhLF1os3YPRAhVwEIQylzQnaDzIxb87TK9oXfwi8Ey8f6nXNCgu1+T1rPGzTywIQtF9 PAzw== 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; bh=bPz1o/OfeL6YzLGQka2+YreLUW8aCOI57xe8PSpwRik=; b=Es/g5VBHT7doLF6nh5BXaZtcL4Nd0D4CZMvc29vwnzrdHmWMSZpdDiarl6rpd1KYm+ HfF0NxP9QQoHwzlm2s3OeRRj8Lj4w2mazOPRAX2iN3Txb/s67jI8hgB1ToVo9b66F+h2 OWjO6GbB6dPpELtnzNo1KOCzjFtevtcroSCwhioVMBGDEOB21okjDRLNrBSfNdIN3iyB i0s113zKr8nVBe8fWY4EYWLDFeKCiirb1pVAuJTIjuZyofoKdAKiYMbmhh75QSftqEhu OtBFhBJ3xuLTbwfRNGVX2eONmBG7vFN8P5g20esn6MRBUknSzQSOHwUNyYNucPN30wUd nOdw== X-Gm-Message-State: AEkoout26XvP1P4ihF3k+hqFgjHCw8HH+1H3B9CI4RAZ3VboGq6BSfVORPUSB8Erl88V8bS1jtj0aFxqtsgOiQ== X-Received: by 10.37.216.23 with SMTP id p23mr11353116ybg.53.1471030358120; Fri, 12 Aug 2016 12:32:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Fri, 12 Aug 2016 12:32:37 -0700 (PDT) In-Reply-To: <20160812183636.GP83214@kib.kiev.ua> References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <20160812183636.GP83214@kib.kiev.ua> From: Ed Schouten Date: Fri, 12 Aug 2016 21:32:37 +0200 Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf To: Konstantin Belousov Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 19:32:39 -0000 2016-08-12 20:36 GMT+02:00 Konstantin Belousov : > Because the API is unusable. It causes full queue iteration when the object > is NULL, i.e. at the end of the queue, instead of doing nothing. Ah, thanks for working on this then. I personally think that all of those macros in that run in linear time should be removed. Why not just use the proper data structure? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 12 19:35:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF548BB3966; Fri, 12 Aug 2016 19:35:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F5F1B0C; Fri, 12 Aug 2016 19:35:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7CJZdYr043389 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Aug 2016 22:35:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7CJZdYr043389 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7CJZdFS043388; Fri, 12 Aug 2016 22:35:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Aug 2016 22:35:39 +0300 From: Konstantin Belousov To: Ed Schouten Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304011 - head/libexec/rtld-elf Message-ID: <20160812193539.GR83214@kib.kiev.ua> References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <20160812183636.GP83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 19:35:47 -0000 On Fri, Aug 12, 2016 at 09:32:37PM +0200, Ed Schouten wrote: > 2016-08-12 20:36 GMT+02:00 Konstantin Belousov : > > Because the API is unusable. It causes full queue iteration when the object > > is NULL, i.e. at the end of the queue, instead of doing nothing. > > Ah, thanks for working on this then. I personally think that all of > those macros in that run in linear time should be > removed. Why not just use the proper data structure? What is improper about the tail-queue for global object list ? Typical operations with it involve all objects in the list. The only special ops I am aware are lookups by name or by dev_t/inode, but having the parallel (two) maps there is overkill. From owner-svn-src-head@freebsd.org Fri Aug 12 19:47:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93AC4BB3CFD; Fri, 12 Aug 2016 19:47:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66ACC12FC; Fri, 12 Aug 2016 19:47:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CJlK2n090608; Fri, 12 Aug 2016 19:47:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CJlKo0090607; Fri, 12 Aug 2016 19:47:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608121947.u7CJlKo0090607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 12 Aug 2016 19:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304018 - head/sys/boot/efi/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.22 Precedence: list List-Id: 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, 12 Aug 2016 19:47:21 -0000 Author: jhb Date: Fri Aug 12 19:47:20 2016 New Revision: 304018 URL: https://svnweb.freebsd.org/changeset/base/304018 Log: Add defines needed to export SMBIOS serial numbers Some defines needed for exporting serial numbers from the SMBIOS were missed during integration of SMBIOS support in the EFI boot loader (r281138). This is needed for getting the hostid set from the system hardware UUID. PR: 206031 Submitted by: Thomas Eberhardt MFC after: 1 week Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Aug 12 19:43:06 2016 (r304017) +++ head/sys/boot/efi/loader/Makefile Fri Aug 12 19:47:20 2016 (r304018) @@ -63,6 +63,18 @@ CFLAGS+= -DNO_PCI -DEFI LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a .endif +.if !defined(BOOT_HIDE_SERIAL_NUMBERS) +# Export serial numbers, UUID, and asset tag from loader. +CFLAGS+= -DSMBIOS_SERIAL_NUMBERS +.if defined(BOOT_LITTLE_ENDIAN_UUID) +# Use little-endian UUID format as defined in SMBIOS 2.6. +CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID +.endif +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH From owner-svn-src-head@freebsd.org Fri Aug 12 19:52:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1091BBB3EAA for ; Fri, 12 Aug 2016 19:52:21 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF21C1783 for ; Fri, 12 Aug 2016 19:52:20 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x22c.google.com with SMTP id d10so6699016ybi.1 for ; Fri, 12 Aug 2016 12:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/bZunaWmBXtdrKvNin3dfDVaH3jLxJhrEQzEvNApG4U=; b=xMz7dQrU0IySm29ctQIdzC0h0RCBPy8tCbtD/Qe0FBoGrzvRax9dECLGjc+Pw9DFBR 8nqz7achuD4OpwrR+X+RMZpC293xQ36+ukOdmhr6nFlCv1AXu2jRwbHvq+0ryyuxAxUl f2EKh4AjnK/OleQ/IdRA+5ijYyLhtjoA7nHKcYYdG1ShtFYlGE/Vsg4/tgCciZvw/acv 8OINrrfBj5Cpz5t6aO6v1jsVXiBCnQtk6vf5LzqVsLa0Y6jqc1HQJt2oKgOacv3jAMxT VSRHudXtkGKFGVu26rLyVB8vHzcMp4poNRZZspcDscUT5LWqjYz9N18Hwf/k5HLpSygB 56UQ== 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; bh=/bZunaWmBXtdrKvNin3dfDVaH3jLxJhrEQzEvNApG4U=; b=GSZhQjf1sfFCU4aiU7o2lwYIkjs5SETgYLlerntnj1M/ejegHxbhF2s5l2GCR+44GN P/l2trCSlSOY3vo9ESlD7Ie/s/2mgPeX3x5mDdD+4jTdWTrCLEAsdSK3t3gGJMKCmtVR Yg5ioDUpPxR/mrdF7PAkqOYAtUOZYl0J/E/oPZsirlaPRo01PmFVRh55CMve7y51rM8j ysTaBTQ+Y8q+D9QUQQWWE42s+a1Jk4LrcK9zw458x97cy2MgUJC34bhlwu7/rGRbz19N AsaoCH+2KSuknz//w1eIcDROeEQ0S2DwoGSzkN+gbyEvSfelwJXacolkzOfhqQ0wiN6h ZAXA== X-Gm-Message-State: AEkooutD0B9U4btYUKPZlyZQoa0AxAto+bezzBhxgE4wSau2aIT9JZtuv1pYxPT4j7XMmrzBTcjigTd/kMKfJA== X-Received: by 10.37.109.213 with SMTP id i204mr9484604ybc.149.1471031540054; Fri, 12 Aug 2016 12:52:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Fri, 12 Aug 2016 12:52:19 -0700 (PDT) In-Reply-To: <20160812193539.GR83214@kib.kiev.ua> References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <20160812183636.GP83214@kib.kiev.ua> <20160812193539.GR83214@kib.kiev.ua> From: Ed Schouten Date: Fri, 12 Aug 2016 21:52:19 +0200 Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf To: Konstantin Belousov Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 19:52:21 -0000 Hi Kostik, 2016-08-12 21:35 GMT+02:00 Konstantin Belousov : > What is improper about the tail-queue for global object list ? > Typical operations with it involve all objects in the list. The only > special ops I am aware are lookups by name or by dev_t/inode, but having > the parallel (two) maps there is overkill. Nothing! That's all good. :-) All I wanted to say is that I think that it's a pity that provides macros that implement operations that can only be implemented with a suboptimal time complexity. A good example is SLIST_REMOVE(). In my opinion, it shouldn't exist in the first place. As soon as you need it, you should have very likely used LIST_*() instead. It would be nice if we could at one point get rid of those bad macros, but I guess I may be too optimistic about that. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 12 21:06:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7AF4BB848B; Fri, 12 Aug 2016 21:06:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E77F1681; Fri, 12 Aug 2016 21:06:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x233.google.com with SMTP id v123so36829700qkh.2; Fri, 12 Aug 2016 14:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kg80SxsWaS+othFyR72IQhl0+dqoHvjRNIjF2EuMa4c=; b=HoC9UysQwRNG9ZiDaBK/n2G70V2DMZwZ/9/0/WCmyX+liuKuIum5jGTXEPEvJNtgdc ba5sXmNUq+NMVx4x4AEVhwUxA/rDU+jKTLIDyjDGi4zdy7gJaUKd1KRbmtOG6p9hZwcZ qTGxA5oTzarol3/1bBbkNmILNYTi8LAheZdBXYXTmv83atj86/whIDBEg8fJyNWD90/G oS1G+sVzc2y1Nf8DeFEFqB+Xcn0Pp0Y1GUgNmwaWS3JJVyGnBEksNPxU3aKp03SVEaQU xlcueKMltL9wpABrxnit2MdCn0YyQ0UcCEwCATgRKt5gn6cvNJVRYgYwyrGo0txHkJdz Qocg== 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; bh=kg80SxsWaS+othFyR72IQhl0+dqoHvjRNIjF2EuMa4c=; b=iyyD5TtbP/viBPoW51UXVJqDoast5xkgxRrk4vxTrTx4w4v6i/0TIvbXEm3hpK+uPo EGsX4osdJL/FM6QBZPlgCoYmuNyyKdeMOqXU8yviLZKGUX8FLVGtlUaH+C0ZdGdFhYP+ /mJgy7FfBoMp/o2w8lIQqnCEb7vULrBJUDmiqt8Y1YUrOJXipgzJy9AWwpIYTEHfmRI4 h9IdNtnWN35K3Iv/0+0ZRBXElggFwbr71ZOZSPQjPEz0HNHktw9+EcYiyMufDsOafgxD vIcI+5DaEvR4VVFlZJbiQwjiJ0nAadcIOSds8hmKUezK/eQCINvPlqtdAReZC4/dvomM 9Nrw== X-Gm-Message-State: AEkoouscLiNUTFIgKn8/M4WrtFBXby3qibe5lqUjFL2e1KrQKQ75YQmMWNfxGz9z+6HV8FCOh4eExUNv8rzEOw== X-Received: by 10.55.56.129 with SMTP id f123mr20514630qka.30.1471035962244; Fri, 12 Aug 2016 14:06:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.182.70 with HTTP; Fri, 12 Aug 2016 14:06:01 -0700 (PDT) In-Reply-To: References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> From: Ngie Cooper Date: Fri, 12 Aug 2016 14:06:01 -0700 Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom To: Bryan Drewery Cc: Warner Losh , "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 21:06:03 -0000 On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery wrote: ... > No, I was missing r303637. Hard to say if it is related... Andrey says > it's not. I haven't dived into it yet and it's so far only happened > once (out of a few tests). We do have various customizations but I'm > inclined to think it's the stock code having problems. I hit it again on our internal vendor tree (what bdrewery was noting previously). I can provide some details about the panic if need be. Thanks, -Ngie From owner-svn-src-head@freebsd.org Fri Aug 12 21:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B866BB8884; Fri, 12 Aug 2016 21:25:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0635F1190; Fri, 12 Aug 2016 21:25:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id u25so18518696qtb.1; Fri, 12 Aug 2016 14:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SOX2rWsTpRe6HrVv2mpwHHydDqMy2IwFddhwSNB9fqc=; b=Sg0+kklZ6QePWBiGzGw+wS8JSpw++/zIrq/KlvcpBNsCtft9C/vHU+mQR5TzBq6Rg7 fVuYX4BPTc7/p2cG+WlzuSjitr1AW5xDe3p3iOJgG6ZFGNg1j/gQ+0t2aYStpWIbp+ib lloQANZFDb4mNS8l2cB2BdVrteP1pie/AhWodCC32Z2d5xOZMs2UQhXxTizXyrRo8yUB UX6emOZeEHq+5CfhZhxdH5f16g5lb0QdaK3LuZcWZMZ/wk2A5/Qez/OLrvaE0hva7n12 cToSNQr2Q1arJQOs5VwD+zuz80W4fMuADhMLr+q8ZXB67tI1ZLUAeZO1KlyNlClE55WM e+lw== 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; bh=SOX2rWsTpRe6HrVv2mpwHHydDqMy2IwFddhwSNB9fqc=; b=jX1IsJBFUujqn6wF+9TPO6ASUlZDupYjK/USo7muTUd+OJgDNlJzDvugrk4qgMvWBy TA89xRL8D4hOfmvRPU8b0fYpzoUF5uhJdahzUgC1TJzc3ADHSNnWRmBSsViznsnZ1XPp 07+yp55eu9jwkyVW6JOcoxY2kGUI1qTOu0WFuoN5QER/ZU13tTROnFt4wdMssNaDZ15E dFwErO3KbIxXun7/0wBCORn1/W13ipRaWZdxyyqUw/TpgE6QxmjBLieNBLTVAPaT6BwN swphJ1GwP6PE4pUfeQCbwzLlp+qCFEGZmQJa9Y7ZR9s/cDu5jOzuKqMSMRkNbE7QU9n3 mAnQ== X-Gm-Message-State: AEkooutOc/GA02WyaN4O8HtZmlZqX/dLdrk5p9lWWDBO3S2U3KaZAyAHywW4R5prlMTLY/OsOnRXC9MCa7oqJA== X-Received: by 10.237.59.79 with SMTP id q15mr18940337qte.77.1471037117572; Fri, 12 Aug 2016 14:25:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.182.70 with HTTP; Fri, 12 Aug 2016 14:25:17 -0700 (PDT) In-Reply-To: <20160812183636.GP83214@kib.kiev.ua> References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <20160812183636.GP83214@kib.kiev.ua> From: Ngie Cooper Date: Fri, 12 Aug 2016 14:25:17 -0700 Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 21:25:19 -0000 On Fri, Aug 12, 2016 at 11:36 AM, Konstantin Belousov wrote: ... > Because the API is unusable. It causes full queue iteration when the object > is NULL, i.e. at the end of the queue, instead of doing nothing. It would have been nice if this had been documented in the commit message instead of leaving the reader to guess.. Thank you for the explanation -- I really appreciate it! -Ngie From owner-svn-src-head@freebsd.org Fri Aug 12 21:29:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE8F2BB89BF; Fri, 12 Aug 2016 21:29:45 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2BD1520; Fri, 12 Aug 2016 21:29:45 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CLTiZq028011; Fri, 12 Aug 2016 21:29:44 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CLTiig028007; Fri, 12 Aug 2016 21:29:44 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201608122129.u7CLTiig028007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 12 Aug 2016 21:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304021 - in head/sys: conf kern net 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.22 Precedence: list List-Id: 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, 12 Aug 2016 21:29:45 -0000 Author: shurd (ports committer) Date: Fri Aug 12 21:29:44 2016 New Revision: 304021 URL: https://svnweb.freebsd.org/changeset/base/304021 Log: Update iflib to support more NIC designs - Move group task queue into kern/subr_gtaskqueue.c - Change intr_enable to return an int so it can be detected if it's not implemented - Allow different TX/RX queues per set to be different sizes - Don't split up TX mbufs before transmit - Allow a completion queue for TX as well as RX - Pass the RX budget to isc_rxd_available() to allow an earlier return and avoid multiple calls Submitted by: shurd Reviewed by: gallatin Approved by: scottl Differential Revision: https://reviews.freebsd.org/D7393 Added: head/sys/kern/subr_gtaskqueue.c (contents, props changed) head/sys/sys/gtaskqueue.h (contents, props changed) Modified: head/sys/conf/files head/sys/kern/subr_taskqueue.c head/sys/net/ifdi_if.m head/sys/net/iflib.c head/sys/net/iflib.h head/sys/sys/_task.h head/sys/sys/taskqueue.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 12 20:33:23 2016 (r304020) +++ head/sys/conf/files Fri Aug 12 21:29:44 2016 (r304021) @@ -3349,6 +3349,7 @@ kern/subr_disk.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware +kern/subr_gtaskqueue.c standard kern/subr_hash.c standard kern/subr_hints.c standard kern/subr_kdb.c standard Added: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_gtaskqueue.c Fri Aug 12 21:29:44 2016 (r304021) @@ -0,0 +1,864 @@ +/*- + * Copyright (c) 2000 Doug Rabson + * Copyright (c) 2014 Jeff Roberson + * Copyright (c) 2016 Matthew Macy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues"); +static void gtaskqueue_thread_enqueue(void *); +static void gtaskqueue_thread_loop(void *arg); + + +struct gtaskqueue_busy { + struct gtask *tb_running; + TAILQ_ENTRY(gtaskqueue_busy) tb_link; +}; + +static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; + +struct gtaskqueue { + STAILQ_HEAD(, gtask) tq_queue; + gtaskqueue_enqueue_fn tq_enqueue; + void *tq_context; + char *tq_name; + TAILQ_HEAD(, gtaskqueue_busy) tq_active; + struct mtx tq_mutex; + struct thread **tq_threads; + int tq_tcount; + int tq_spin; + int tq_flags; + int tq_callouts; + taskqueue_callback_fn tq_callbacks[TASKQUEUE_NUM_CALLBACKS]; + void *tq_cb_contexts[TASKQUEUE_NUM_CALLBACKS]; +}; + +#define TQ_FLAGS_ACTIVE (1 << 0) +#define TQ_FLAGS_BLOCKED (1 << 1) +#define TQ_FLAGS_UNLOCKED_ENQUEUE (1 << 2) + +#define DT_CALLOUT_ARMED (1 << 0) + +#define TQ_LOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_lock_spin(&(tq)->tq_mutex); \ + else \ + mtx_lock(&(tq)->tq_mutex); \ + } while (0) +#define TQ_ASSERT_LOCKED(tq) mtx_assert(&(tq)->tq_mutex, MA_OWNED) + +#define TQ_UNLOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_unlock_spin(&(tq)->tq_mutex); \ + else \ + mtx_unlock(&(tq)->tq_mutex); \ + } while (0) +#define TQ_ASSERT_UNLOCKED(tq) mtx_assert(&(tq)->tq_mutex, MA_NOTOWNED) + +static __inline int +TQ_SLEEP(struct gtaskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, + int t) +{ + if (tq->tq_spin) + return (msleep_spin(p, m, wm, t)); + return (msleep(p, m, pri, wm, t)); +} + +static struct gtaskqueue * +_gtaskqueue_create(const char *name, int mflags, + taskqueue_enqueue_fn enqueue, void *context, + int mtxflags, const char *mtxname __unused) +{ + struct gtaskqueue *queue; + char *tq_name; + + tq_name = malloc(TASKQUEUE_NAMELEN, M_GTASKQUEUE, mflags | M_ZERO); + if (!tq_name) + return (NULL); + + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); + + queue = malloc(sizeof(struct gtaskqueue), M_GTASKQUEUE, mflags | M_ZERO); + if (!queue) + return (NULL); + + STAILQ_INIT(&queue->tq_queue); + TAILQ_INIT(&queue->tq_active); + queue->tq_enqueue = enqueue; + queue->tq_context = context; + queue->tq_name = tq_name; + queue->tq_spin = (mtxflags & MTX_SPIN) != 0; + queue->tq_flags |= TQ_FLAGS_ACTIVE; + if (enqueue == gtaskqueue_thread_enqueue) + queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; + mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); + + return (queue); +} + + +/* + * Signal a taskqueue thread to terminate. + */ +static void +gtaskqueue_terminate(struct thread **pp, struct gtaskqueue *tq) +{ + + while (tq->tq_tcount > 0 || tq->tq_callouts > 0) { + wakeup(tq); + TQ_SLEEP(tq, pp, &tq->tq_mutex, PWAIT, "taskqueue_destroy", 0); + } +} + +static void +gtaskqueue_free(struct gtaskqueue *queue) +{ + + TQ_LOCK(queue); + queue->tq_flags &= ~TQ_FLAGS_ACTIVE; + gtaskqueue_terminate(queue->tq_threads, queue); + KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); + KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); + mtx_destroy(&queue->tq_mutex); + free(queue->tq_threads, M_GTASKQUEUE); + free(queue->tq_name, M_GTASKQUEUE); + free(queue, M_GTASKQUEUE); +} + +int +grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask) +{ + TQ_LOCK(queue); + if (gtask->ta_flags & TASK_ENQUEUED) { + TQ_UNLOCK(queue); + return (0); + } + STAILQ_INSERT_TAIL(&queue->tq_queue, gtask, ta_link); + gtask->ta_flags |= TASK_ENQUEUED; + TQ_UNLOCK(queue); + if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) + queue->tq_enqueue(queue->tq_context); + return (0); +} + +static void +gtaskqueue_task_nop_fn(void *context) +{ +} + +/* + * Block until all currently queued tasks in this taskqueue + * have begun execution. Tasks queued during execution of + * this function are ignored. + */ +static void +gtaskqueue_drain_tq_queue(struct gtaskqueue *queue) +{ + struct gtask t_barrier; + + if (STAILQ_EMPTY(&queue->tq_queue)) + return; + + /* + * Enqueue our barrier after all current tasks, but with + * the highest priority so that newly queued tasks cannot + * pass it. Because of the high priority, we can not use + * taskqueue_enqueue_locked directly (which drops the lock + * anyway) so just insert it at tail while we have the + * queue lock. + */ + GTASK_INIT(&t_barrier, 0, USHRT_MAX, gtaskqueue_task_nop_fn, &t_barrier); + STAILQ_INSERT_TAIL(&queue->tq_queue, &t_barrier, ta_link); + t_barrier.ta_flags |= TASK_ENQUEUED; + + /* + * Once the barrier has executed, all previously queued tasks + * have completed or are currently executing. + */ + while (t_barrier.ta_flags & TASK_ENQUEUED) + TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); +} + +/* + * Block until all currently executing tasks for this taskqueue + * complete. Tasks that begin execution during the execution + * of this function are ignored. + */ +static void +gtaskqueue_drain_tq_active(struct gtaskqueue *queue) +{ + struct gtaskqueue_busy tb_marker, *tb_first; + + if (TAILQ_EMPTY(&queue->tq_active)) + return; + + /* Block taskq_terminate().*/ + queue->tq_callouts++; + + /* + * Wait for all currently executing taskqueue threads + * to go idle. + */ + tb_marker.tb_running = TB_DRAIN_WAITER; + TAILQ_INSERT_TAIL(&queue->tq_active, &tb_marker, tb_link); + while (TAILQ_FIRST(&queue->tq_active) != &tb_marker) + TQ_SLEEP(queue, &tb_marker, &queue->tq_mutex, PWAIT, "-", 0); + TAILQ_REMOVE(&queue->tq_active, &tb_marker, tb_link); + + /* + * Wakeup any other drain waiter that happened to queue up + * without any intervening active thread. + */ + tb_first = TAILQ_FIRST(&queue->tq_active); + if (tb_first != NULL && tb_first->tb_running == TB_DRAIN_WAITER) + wakeup(tb_first); + + /* Release taskqueue_terminate(). */ + queue->tq_callouts--; + if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) + wakeup_one(queue->tq_threads); +} + +void +gtaskqueue_block(struct gtaskqueue *queue) +{ + + TQ_LOCK(queue); + queue->tq_flags |= TQ_FLAGS_BLOCKED; + TQ_UNLOCK(queue); +} + +void +gtaskqueue_unblock(struct gtaskqueue *queue) +{ + + TQ_LOCK(queue); + queue->tq_flags &= ~TQ_FLAGS_BLOCKED; + if (!STAILQ_EMPTY(&queue->tq_queue)) + queue->tq_enqueue(queue->tq_context); + TQ_UNLOCK(queue); +} + +static void +gtaskqueue_run_locked(struct gtaskqueue *queue) +{ + struct gtaskqueue_busy tb; + struct gtaskqueue_busy *tb_first; + struct gtask *gtask; + + KASSERT(queue != NULL, ("tq is NULL")); + TQ_ASSERT_LOCKED(queue); + tb.tb_running = NULL; + + while (STAILQ_FIRST(&queue->tq_queue)) { + TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); + + /* + * Carefully remove the first task from the queue and + * clear its TASK_ENQUEUED flag + */ + gtask = STAILQ_FIRST(&queue->tq_queue); + KASSERT(gtask != NULL, ("task is NULL")); + STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); + gtask->ta_flags &= ~TASK_ENQUEUED; + tb.tb_running = gtask; + TQ_UNLOCK(queue); + + KASSERT(gtask->ta_func != NULL, ("task->ta_func is NULL")); + gtask->ta_func(gtask->ta_context); + + TQ_LOCK(queue); + tb.tb_running = NULL; + wakeup(gtask); + + TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + tb_first = TAILQ_FIRST(&queue->tq_active); + if (tb_first != NULL && + tb_first->tb_running == TB_DRAIN_WAITER) + wakeup(tb_first); + } +} + +static int +task_is_running(struct gtaskqueue *queue, struct gtask *gtask) +{ + struct gtaskqueue_busy *tb; + + TQ_ASSERT_LOCKED(queue); + TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + if (tb->tb_running == gtask) + return (1); + } + return (0); +} + +static int +gtaskqueue_cancel_locked(struct gtaskqueue *queue, struct gtask *gtask) +{ + + if (gtask->ta_flags & TASK_ENQUEUED) + STAILQ_REMOVE(&queue->tq_queue, gtask, gtask, ta_link); + gtask->ta_flags &= ~TASK_ENQUEUED; + return (task_is_running(queue, gtask) ? EBUSY : 0); +} + +int +gtaskqueue_cancel(struct gtaskqueue *queue, struct gtask *gtask) +{ + int error; + + TQ_LOCK(queue); + error = gtaskqueue_cancel_locked(queue, gtask); + TQ_UNLOCK(queue); + + return (error); +} + +void +gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask) +{ + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) + TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); + TQ_UNLOCK(queue); +} + +void +gtaskqueue_drain_all(struct gtaskqueue *queue) +{ + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + gtaskqueue_drain_tq_queue(queue); + gtaskqueue_drain_tq_active(queue); + TQ_UNLOCK(queue); +} + +static int +_gtaskqueue_start_threads(struct gtaskqueue **tqp, int count, int pri, + cpuset_t *mask, const char *name, va_list ap) +{ + char ktname[MAXCOMLEN + 1]; + struct thread *td; + struct gtaskqueue *tq; + int i, error; + + if (count <= 0) + return (EINVAL); + + vsnprintf(ktname, sizeof(ktname), name, ap); + tq = *tqp; + + tq->tq_threads = malloc(sizeof(struct thread *) * count, M_GTASKQUEUE, + M_NOWAIT | M_ZERO); + if (tq->tq_threads == NULL) { + printf("%s: no memory for %s threads\n", __func__, ktname); + return (ENOMEM); + } + + for (i = 0; i < count; i++) { + if (count == 1) + error = kthread_add(gtaskqueue_thread_loop, tqp, NULL, + &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); + else + error = kthread_add(gtaskqueue_thread_loop, tqp, NULL, + &tq->tq_threads[i], RFSTOPPED, 0, + "%s_%d", ktname, i); + if (error) { + /* should be ok to continue, taskqueue_free will dtrt */ + printf("%s: kthread_add(%s): error %d", __func__, + ktname, error); + tq->tq_threads[i] = NULL; /* paranoid */ + } else + tq->tq_tcount++; + } + for (i = 0; i < count; i++) { + if (tq->tq_threads[i] == NULL) + continue; + td = tq->tq_threads[i]; + if (mask) { + error = cpuset_setthread(td->td_tid, mask); + /* + * Failing to pin is rarely an actual fatal error; + * it'll just affect performance. + */ + if (error) + printf("%s: curthread=%llu: can't pin; " + "error=%d\n", + __func__, + (unsigned long long) td->td_tid, + error); + } + thread_lock(td); + sched_prio(td, pri); + sched_add(td, SRQ_BORING); + thread_unlock(td); + } + + return (0); +} + +static int +gtaskqueue_start_threads(struct gtaskqueue **tqp, int count, int pri, + const char *name, ...) +{ + va_list ap; + int error; + + va_start(ap, name); + error = _gtaskqueue_start_threads(tqp, count, pri, NULL, name, ap); + va_end(ap); + return (error); +} + +static inline void +gtaskqueue_run_callback(struct gtaskqueue *tq, + enum taskqueue_callback_type cb_type) +{ + taskqueue_callback_fn tq_callback; + + TQ_ASSERT_UNLOCKED(tq); + tq_callback = tq->tq_callbacks[cb_type]; + if (tq_callback != NULL) + tq_callback(tq->tq_cb_contexts[cb_type]); +} + +static void +gtaskqueue_thread_loop(void *arg) +{ + struct gtaskqueue **tqp, *tq; + + tqp = arg; + tq = *tqp; + gtaskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_INIT); + TQ_LOCK(tq); + while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { + /* XXX ? */ + gtaskqueue_run_locked(tq); + /* + * Because taskqueue_run() can drop tq_mutex, we need to + * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the + * meantime, which means we missed a wakeup. + */ + if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) + break; + TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); + } + gtaskqueue_run_locked(tq); + /* + * This thread is on its way out, so just drop the lock temporarily + * in order to call the shutdown callback. This allows the callback + * to look at the taskqueue, even just before it dies. + */ + TQ_UNLOCK(tq); + gtaskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_SHUTDOWN); + TQ_LOCK(tq); + + /* rendezvous with thread that asked us to terminate */ + tq->tq_tcount--; + wakeup_one(tq->tq_threads); + TQ_UNLOCK(tq); + kthread_exit(); +} + +static void +gtaskqueue_thread_enqueue(void *context) +{ + struct gtaskqueue **tqp, *tq; + + tqp = context; + tq = *tqp; + wakeup_one(tq); +} + + +static struct gtaskqueue * +gtaskqueue_create_fast(const char *name, int mflags, + taskqueue_enqueue_fn enqueue, void *context) +{ + return _gtaskqueue_create(name, mflags, enqueue, context, + MTX_SPIN, "fast_taskqueue"); +} + + +struct taskqgroup_cpu { + LIST_HEAD(, grouptask) tgc_tasks; + struct gtaskqueue *tgc_taskq; + int tgc_cnt; + int tgc_cpu; +}; + +struct taskqgroup { + struct taskqgroup_cpu tqg_queue[MAXCPU]; + struct mtx tqg_lock; + char * tqg_name; + int tqg_adjusting; + int tqg_stride; + int tqg_cnt; +}; + +struct taskq_bind_task { + struct gtask bt_task; + int bt_cpuid; +}; + +static void +taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) +{ + struct taskqgroup_cpu *qcpu; + + qcpu = &qgroup->tqg_queue[idx]; + LIST_INIT(&qcpu->tgc_tasks); + qcpu->tgc_taskq = gtaskqueue_create_fast(NULL, M_WAITOK, + taskqueue_thread_enqueue, &qcpu->tgc_taskq); + gtaskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, + "%s_%d", qgroup->tqg_name, idx); + qcpu->tgc_cpu = idx * qgroup->tqg_stride; +} + +static void +taskqgroup_cpu_remove(struct taskqgroup *qgroup, int idx) +{ + + gtaskqueue_free(qgroup->tqg_queue[idx].tgc_taskq); +} + +/* + * Find the taskq with least # of tasks that doesn't currently have any + * other queues from the uniq identifier. + */ +static int +taskqgroup_find(struct taskqgroup *qgroup, void *uniq) +{ + struct grouptask *n; + int i, idx, mincnt; + int strict; + + mtx_assert(&qgroup->tqg_lock, MA_OWNED); + if (qgroup->tqg_cnt == 0) + return (0); + idx = -1; + mincnt = INT_MAX; + /* + * Two passes; First scan for a queue with the least tasks that + * does not already service this uniq id. If that fails simply find + * the queue with the least total tasks; + */ + for (strict = 1; mincnt == INT_MAX; strict = 0) { + for (i = 0; i < qgroup->tqg_cnt; i++) { + if (qgroup->tqg_queue[i].tgc_cnt > mincnt) + continue; + if (strict) { + LIST_FOREACH(n, + &qgroup->tqg_queue[i].tgc_tasks, gt_list) + if (n->gt_uniq == uniq) + break; + if (n != NULL) + continue; + } + mincnt = qgroup->tqg_queue[i].tgc_cnt; + idx = i; + } + } + if (idx == -1) + panic("taskqgroup_find: Failed to pick a qid."); + + return (idx); +} + +void +taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, + void *uniq, int irq, char *name) +{ + cpuset_t mask; + int qid; + + gtask->gt_uniq = uniq; + gtask->gt_name = name; + gtask->gt_irq = irq; + gtask->gt_cpu = -1; + mtx_lock(&qgroup->tqg_lock); + qid = taskqgroup_find(qgroup, uniq); + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + if (irq != -1 && smp_started) { + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); + mtx_unlock(&qgroup->tqg_lock); + intr_setaffinity(irq, &mask); + } else + mtx_unlock(&qgroup->tqg_lock); +} + +int +taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask, + void *uniq, int cpu, int irq, char *name) +{ + cpuset_t mask; + int i, qid; + + qid = -1; + gtask->gt_uniq = uniq; + gtask->gt_name = name; + gtask->gt_irq = irq; + gtask->gt_cpu = cpu; + mtx_lock(&qgroup->tqg_lock); + if (smp_started) { + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_cpu == cpu) { + qid = i; + break; + } + if (qid == -1) { + mtx_unlock(&qgroup->tqg_lock); + return (EINVAL); + } + } else + qid = 0; + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + if (irq != -1 && smp_started) { + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); + mtx_unlock(&qgroup->tqg_lock); + intr_setaffinity(irq, &mask); + } else + mtx_unlock(&qgroup->tqg_lock); + return (0); +} + +void +taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask) +{ + int i; + + mtx_lock(&qgroup->tqg_lock); + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) + break; + if (i == qgroup->tqg_cnt) + panic("taskqgroup_detach: task not in group\n"); + qgroup->tqg_queue[i].tgc_cnt--; + LIST_REMOVE(gtask, gt_list); + mtx_unlock(&qgroup->tqg_lock); + gtask->gt_taskqueue = NULL; +} + +static void +taskqgroup_binder(void *ctx) +{ + struct taskq_bind_task *gtask = (struct taskq_bind_task *)ctx; + cpuset_t mask; + int error; + + CPU_ZERO(&mask); + CPU_SET(gtask->bt_cpuid, &mask); + error = cpuset_setthread(curthread->td_tid, &mask); + thread_lock(curthread); + sched_bind(curthread, gtask->bt_cpuid); + thread_unlock(curthread); + + if (error) + printf("taskqgroup_binder: setaffinity failed: %d\n", + error); + free(gtask, M_DEVBUF); +} + +static void +taskqgroup_bind(struct taskqgroup *qgroup) +{ + struct taskq_bind_task *gtask; + int i; + + /* + * Bind taskqueue threads to specific CPUs, if they have been assigned + * one. + */ + for (i = 0; i < qgroup->tqg_cnt; i++) { + gtask = malloc(sizeof (*gtask), M_DEVBUF, M_NOWAIT); + GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask); + gtask->bt_cpuid = qgroup->tqg_queue[i].tgc_cpu; + grouptaskqueue_enqueue(qgroup->tqg_queue[i].tgc_taskq, + >ask->bt_task); + } +} + +static int +_taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) +{ + LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); + cpuset_t mask; + struct grouptask *gtask; + int i, old_cnt, qid; + + mtx_assert(&qgroup->tqg_lock, MA_OWNED); + + if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) { + printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n", + cnt, stride, mp_ncpus, smp_started); + return (EINVAL); + } + if (qgroup->tqg_adjusting) { + printf("taskqgroup_adjust failed: adjusting\n"); + return (EBUSY); + } + qgroup->tqg_adjusting = 1; + old_cnt = qgroup->tqg_cnt; + mtx_unlock(&qgroup->tqg_lock); + /* + * Set up queue for tasks added before boot. + */ + if (old_cnt == 0) { + LIST_SWAP(>ask_head, &qgroup->tqg_queue[0].tgc_tasks, + grouptask, gt_list); + qgroup->tqg_queue[0].tgc_cnt = 0; + } + + /* + * If new taskq threads have been added. + */ + for (i = old_cnt; i < cnt; i++) + taskqgroup_cpu_create(qgroup, i); + mtx_lock(&qgroup->tqg_lock); + qgroup->tqg_cnt = cnt; + qgroup->tqg_stride = stride; + + /* + * Adjust drivers to use new taskqs. + */ + for (i = 0; i < old_cnt; i++) { + while ((gtask = LIST_FIRST(&qgroup->tqg_queue[i].tgc_tasks))) { + LIST_REMOVE(gtask, gt_list); + qgroup->tqg_queue[i].tgc_cnt--; + LIST_INSERT_HEAD(>ask_head, gtask, gt_list); + } + } + + while ((gtask = LIST_FIRST(>ask_head))) { + LIST_REMOVE(gtask, gt_list); + if (gtask->gt_cpu == -1) + qid = taskqgroup_find(qgroup, gtask->gt_uniq); + else { + for (i = 0; i < qgroup->tqg_cnt; i++) + if (qgroup->tqg_queue[i].tgc_cpu == gtask->gt_cpu) { + qid = i; + break; + } + } + qgroup->tqg_queue[qid].tgc_cnt++; + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, + gt_list); + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; + } + /* + * Set new CPU and IRQ affinity + */ + for (i = 0; i < cnt; i++) { + qgroup->tqg_queue[i].tgc_cpu = i * qgroup->tqg_stride; + CPU_ZERO(&mask); + CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); + LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { + if (gtask->gt_irq == -1) + continue; + intr_setaffinity(gtask->gt_irq, &mask); + } + } + mtx_unlock(&qgroup->tqg_lock); + + /* + * If taskq thread count has been reduced. + */ + for (i = cnt; i < old_cnt; i++) + taskqgroup_cpu_remove(qgroup, i); + + mtx_lock(&qgroup->tqg_lock); + qgroup->tqg_adjusting = 0; + + taskqgroup_bind(qgroup); + + return (0); +} + +int +taskqgroup_adjust(struct taskqgroup *qgroup, int cpu, int stride) +{ + int error; + + mtx_lock(&qgroup->tqg_lock); + error = _taskqgroup_adjust(qgroup, cpu, stride); + mtx_unlock(&qgroup->tqg_lock); + + return (error); +} + +struct taskqgroup * +taskqgroup_create(char *name) +{ + struct taskqgroup *qgroup; + + qgroup = malloc(sizeof(*qgroup), M_GTASKQUEUE, M_WAITOK | M_ZERO); + mtx_init(&qgroup->tqg_lock, "taskqgroup", NULL, MTX_DEF); + qgroup->tqg_name = name; + LIST_INIT(&qgroup->tqg_queue[0].tgc_tasks); + + return (qgroup); +} + +void +taskqgroup_destroy(struct taskqgroup *qgroup) +{ + +} Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Aug 12 20:33:23 2016 (r304020) +++ head/sys/kern/subr_taskqueue.c Fri Aug 12 21:29:44 2016 (r304021) @@ -261,22 +261,6 @@ taskqueue_enqueue_locked(struct taskqueu } int -grouptaskqueue_enqueue(struct taskqueue *queue, struct task *task) -{ - TQ_LOCK(queue); - if (task->ta_pending) { - TQ_UNLOCK(queue); - return (0); - } - STAILQ_INSERT_TAIL(&queue->tq_queue, task, ta_link); - task->ta_pending = 1; - TQ_UNLOCK(queue); - if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) - queue->tq_enqueue(queue->tq_context); - return (0); -} - -int taskqueue_enqueue(struct taskqueue *queue, struct task *task) { int res; @@ -806,347 +790,3 @@ taskqueue_member(struct taskqueue *queue } return (ret); } - -struct taskqgroup_cpu { - LIST_HEAD(, grouptask) tgc_tasks; - struct taskqueue *tgc_taskq; - int tgc_cnt; - int tgc_cpu; -}; - -struct taskqgroup { - struct taskqgroup_cpu tqg_queue[MAXCPU]; - struct mtx tqg_lock; - char * tqg_name; - int tqg_adjusting; - int tqg_stride; - int tqg_cnt; -}; - -struct taskq_bind_task { - struct task bt_task; - int bt_cpuid; -}; - -static void -taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) -{ - struct taskqgroup_cpu *qcpu; - int i, j; - - qcpu = &qgroup->tqg_queue[idx]; - LIST_INIT(&qcpu->tgc_tasks); - qcpu->tgc_taskq = taskqueue_create_fast(NULL, M_WAITOK, - taskqueue_thread_enqueue, &qcpu->tgc_taskq); - taskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, - "%s_%d", qgroup->tqg_name, idx); - - for (i = CPU_FIRST(), j = 0; j < idx * qgroup->tqg_stride; - j++, i = CPU_NEXT(i)) { - /* - * Wait: evaluate the idx * qgroup->tqg_stride'th CPU, - * potentially wrapping the actual count - */ - } - qcpu->tgc_cpu = i; -} - -static void -taskqgroup_cpu_remove(struct taskqgroup *qgroup, int idx) -{ - - taskqueue_free(qgroup->tqg_queue[idx].tgc_taskq); -} - -/* - * Find the taskq with least # of tasks that doesn't currently have any - * other queues from the uniq identifier. - */ -static int -taskqgroup_find(struct taskqgroup *qgroup, void *uniq) -{ - struct grouptask *n; - int i, idx, mincnt; - int strict; - - mtx_assert(&qgroup->tqg_lock, MA_OWNED); - if (qgroup->tqg_cnt == 0) - return (0); - idx = -1; - mincnt = INT_MAX; - /* - * Two passes; First scan for a queue with the least tasks that - * does not already service this uniq id. If that fails simply find - * the queue with the least total tasks; - */ - for (strict = 1; mincnt == INT_MAX; strict = 0) { - for (i = 0; i < qgroup->tqg_cnt; i++) { - if (qgroup->tqg_queue[i].tgc_cnt > mincnt) - continue; - if (strict) { - LIST_FOREACH(n, - &qgroup->tqg_queue[i].tgc_tasks, gt_list) - if (n->gt_uniq == uniq) - break; - if (n != NULL) - continue; - } - mincnt = qgroup->tqg_queue[i].tgc_cnt; - idx = i; - } - } - if (idx == -1) - panic("taskqgroup_find: Failed to pick a qid."); - - return (idx); -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 12 22:13:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 204BDBB8C09; Fri, 12 Aug 2016 22:13:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84C317C6; Fri, 12 Aug 2016 22:13:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id f6so26029622ith.0; Fri, 12 Aug 2016 15:13:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=4/dLsJZHgCjW4OnbihVCR6YlKxqEpgQaTeY+8bvcxyY=; b=Mb7VmYu6UhD07ne8fmA0s1aK4k7DglpKuLykFlI2X0KUyUTNMhI0v1mP5OlGEPXlhE kVqpafwmZ8ZythOdQ7i/0eZ4r0cptF7jCpC5dDqLmCFAnYa6r885LpNCZhZnLZLGzNlo YMM30QFHaLPZ6YR+FV1DIJEFKmNhWWCg4Kxkbzja4ypAk/K0kedPum00Oftbrl/vc86I jZRbGH+ipWL0EZfUXr9rxguHEBw/jzRUZAAdjL874x3qcPKxUq0WP+bI6F7Ay0ZzQhcJ ubWrkjrS67hdwN+cb0ukYMXES6f8uxk94Ri038idl1n3iJGR0uDLP0EdyjdbVSz1YYwE 2GuA== X-Gm-Message-State: AEkoousKMmuqjDAPmspcU+/254A7HI1jlGWBLAfi/dbHzcJ6sBKHY+47n/WD/UstT2GCmQ== X-Received: by 10.36.224.197 with SMTP id c188mr1359939ith.21.1471040019249; Fri, 12 Aug 2016 15:13:39 -0700 (PDT) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com. [209.85.223.180]) by smtp.gmail.com with ESMTPSA id l124sm4309247ioe.26.2016.08.12.15.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Aug 2016 15:13:39 -0700 (PDT) Received: by mail-io0-f180.google.com with SMTP id q83so36946021iod.1; Fri, 12 Aug 2016 15:13:39 -0700 (PDT) X-Received: by 10.107.28.11 with SMTP id c11mr23794747ioc.7.1471040018324; Fri, 12 Aug 2016 15:13:38 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Fri, 12 Aug 2016 15:13:37 -0700 (PDT) In-Reply-To: <201608122129.u7CLTiig028007@repo.freebsd.org> References: <201608122129.u7CLTiig028007@repo.freebsd.org> From: Conrad Meyer Date: Fri, 12 Aug 2016 15:13:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r304021 - in head/sys: conf kern net sys To: Stephen Hurd Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 22:13:47 -0000 A manual page for gtaskqueue would be nice, if you have time. Thanks, Conrad On Fri, Aug 12, 2016 at 2:29 PM, Stephen Hurd wrote: > Author: shurd (ports committer) > Date: Fri Aug 12 21:29:44 2016 > New Revision: 304021 > URL: https://svnweb.freebsd.org/changeset/base/304021 > > Log: > Update iflib to support more NIC designs > > - Move group task queue into kern/subr_gtaskqueue.c > - Change intr_enable to return an int so it can be detected if it's not > implemented > - Allow different TX/RX queues per set to be different sizes > - Don't split up TX mbufs before transmit > - Allow a completion queue for TX as well as RX > - Pass the RX budget to isc_rxd_available() to allow an earlier return > and avoid multiple calls > > Submitted by: shurd > Reviewed by: gallatin > Approved by: scottl > Differential Revision: https://reviews.freebsd.org/D7393 > > Added: > head/sys/kern/subr_gtaskqueue.c (contents, props changed) > head/sys/sys/gtaskqueue.h (contents, props changed) > Modified: > head/sys/conf/files > head/sys/kern/subr_taskqueue.c > head/sys/net/ifdi_if.m > head/sys/net/iflib.c > head/sys/net/iflib.h > head/sys/sys/_task.h > head/sys/sys/taskqueue.h > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Fri Aug 12 20:33:23 2016 (r304020) > +++ head/sys/conf/files Fri Aug 12 21:29:44 2016 (r304021) > @@ -3349,6 +3349,7 @@ kern/subr_disk.c standard > kern/subr_eventhandler.c standard > kern/subr_fattime.c standard > kern/subr_firmware.c optional firmware > +kern/subr_gtaskqueue.c standard > kern/subr_hash.c standard > kern/subr_hints.c standard > kern/subr_kdb.c standard > > Added: head/sys/kern/subr_gtaskqueue.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/kern/subr_gtaskqueue.c Fri Aug 12 21:29:44 2016 (r304021) > @@ -0,0 +1,864 @@ > +/*- > + * Copyright (c) 2000 Doug Rabson > + * Copyright (c) 2014 Jeff Roberson > + * Copyright (c) 2016 Matthew Macy > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues"); > +static void gtaskqueue_thread_enqueue(void *); > +static void gtaskqueue_thread_loop(void *arg); > + > + > +struct gtaskqueue_busy { > + struct gtask *tb_running; > + TAILQ_ENTRY(gtaskqueue_busy) tb_link; > +}; > + > +static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; > + > +struct gtaskqueue { > + STAILQ_HEAD(, gtask) tq_queue; > + gtaskqueue_enqueue_fn tq_enqueue; > + void *tq_context; > + char *tq_name; > + TAILQ_HEAD(, gtaskqueue_busy) tq_active; > + struct mtx tq_mutex; > + struct thread **tq_threads; > + int tq_tcount; > + int tq_spin; > + int tq_flags; > + int tq_callouts; > + taskqueue_callback_fn tq_callbacks[TASKQUEUE_NUM_CALLBACKS]; > + void *tq_cb_contexts[TASKQUEUE_NUM_CALLBACKS]; > +}; > + > +#define TQ_FLAGS_ACTIVE (1 << 0) > +#define TQ_FLAGS_BLOCKED (1 << 1) > +#define TQ_FLAGS_UNLOCKED_ENQUEUE (1 << 2) > + > +#define DT_CALLOUT_ARMED (1 << 0) > + > +#define TQ_LOCK(tq) \ > + do { \ > + if ((tq)->tq_spin) \ > + mtx_lock_spin(&(tq)->tq_mutex); \ > + else \ > + mtx_lock(&(tq)->tq_mutex); \ > + } while (0) > +#define TQ_ASSERT_LOCKED(tq) mtx_assert(&(tq)->tq_mutex, MA_OWNED) > + > +#define TQ_UNLOCK(tq) \ > + do { \ > + if ((tq)->tq_spin) \ > + mtx_unlock_spin(&(tq)->tq_mutex); \ > + else \ > + mtx_unlock(&(tq)->tq_mutex); \ > + } while (0) > +#define TQ_ASSERT_UNLOCKED(tq) mtx_assert(&(tq)->tq_mutex, MA_NOTOWNED) > + > +static __inline int > +TQ_SLEEP(struct gtaskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, > + int t) > +{ > + if (tq->tq_spin) > + return (msleep_spin(p, m, wm, t)); > + return (msleep(p, m, pri, wm, t)); > +} > + > +static struct gtaskqueue * > +_gtaskqueue_create(const char *name, int mflags, > + taskqueue_enqueue_fn enqueue, void *context, > + int mtxflags, const char *mtxname __unused) > +{ > + struct gtaskqueue *queue; > + char *tq_name; > + > + tq_name = malloc(TASKQUEUE_NAMELEN, M_GTASKQUEUE, mflags | M_ZERO); > + if (!tq_name) > + return (NULL); > + > + snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); > + > + queue = malloc(sizeof(struct gtaskqueue), M_GTASKQUEUE, mflags | M_ZERO); > + if (!queue) > + return (NULL); > + > + STAILQ_INIT(&queue->tq_queue); > + TAILQ_INIT(&queue->tq_active); > + queue->tq_enqueue = enqueue; > + queue->tq_context = context; > + queue->tq_name = tq_name; > + queue->tq_spin = (mtxflags & MTX_SPIN) != 0; > + queue->tq_flags |= TQ_FLAGS_ACTIVE; > + if (enqueue == gtaskqueue_thread_enqueue) > + queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; > + mtx_init(&queue->tq_mutex, tq_name, NULL, mtxflags); > + > + return (queue); > +} > + > + > +/* > + * Signal a taskqueue thread to terminate. > + */ > +static void > +gtaskqueue_terminate(struct thread **pp, struct gtaskqueue *tq) > +{ > + > + while (tq->tq_tcount > 0 || tq->tq_callouts > 0) { > + wakeup(tq); > + TQ_SLEEP(tq, pp, &tq->tq_mutex, PWAIT, "taskqueue_destroy", 0); > + } > +} > + > +static void > +gtaskqueue_free(struct gtaskqueue *queue) > +{ > + > + TQ_LOCK(queue); > + queue->tq_flags &= ~TQ_FLAGS_ACTIVE; > + gtaskqueue_terminate(queue->tq_threads, queue); > + KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); > + KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); > + mtx_destroy(&queue->tq_mutex); > + free(queue->tq_threads, M_GTASKQUEUE); > + free(queue->tq_name, M_GTASKQUEUE); > + free(queue, M_GTASKQUEUE); > +} > + > +int > +grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask) > +{ > + TQ_LOCK(queue); > + if (gtask->ta_flags & TASK_ENQUEUED) { > + TQ_UNLOCK(queue); > + return (0); > + } > + STAILQ_INSERT_TAIL(&queue->tq_queue, gtask, ta_link); > + gtask->ta_flags |= TASK_ENQUEUED; > + TQ_UNLOCK(queue); > + if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) > + queue->tq_enqueue(queue->tq_context); > + return (0); > +} > + > +static void > +gtaskqueue_task_nop_fn(void *context) > +{ > +} > + > +/* > + * Block until all currently queued tasks in this taskqueue > + * have begun execution. Tasks queued during execution of > + * this function are ignored. > + */ > +static void > +gtaskqueue_drain_tq_queue(struct gtaskqueue *queue) > +{ > + struct gtask t_barrier; > + > + if (STAILQ_EMPTY(&queue->tq_queue)) > + return; > + > + /* > + * Enqueue our barrier after all current tasks, but with > + * the highest priority so that newly queued tasks cannot > + * pass it. Because of the high priority, we can not use > + * taskqueue_enqueue_locked directly (which drops the lock > + * anyway) so just insert it at tail while we have the > + * queue lock. > + */ > + GTASK_INIT(&t_barrier, 0, USHRT_MAX, gtaskqueue_task_nop_fn, &t_barrier); > + STAILQ_INSERT_TAIL(&queue->tq_queue, &t_barrier, ta_link); > + t_barrier.ta_flags |= TASK_ENQUEUED; > + > + /* > + * Once the barrier has executed, all previously queued tasks > + * have completed or are currently executing. > + */ > + while (t_barrier.ta_flags & TASK_ENQUEUED) > + TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); > +} > + > +/* > + * Block until all currently executing tasks for this taskqueue > + * complete. Tasks that begin execution during the execution > + * of this function are ignored. > + */ > +static void > +gtaskqueue_drain_tq_active(struct gtaskqueue *queue) > +{ > + struct gtaskqueue_busy tb_marker, *tb_first; > + > + if (TAILQ_EMPTY(&queue->tq_active)) > + return; > + > + /* Block taskq_terminate().*/ > + queue->tq_callouts++; > + > + /* > + * Wait for all currently executing taskqueue threads > + * to go idle. > + */ > + tb_marker.tb_running = TB_DRAIN_WAITER; > + TAILQ_INSERT_TAIL(&queue->tq_active, &tb_marker, tb_link); > + while (TAILQ_FIRST(&queue->tq_active) != &tb_marker) > + TQ_SLEEP(queue, &tb_marker, &queue->tq_mutex, PWAIT, "-", 0); > + TAILQ_REMOVE(&queue->tq_active, &tb_marker, tb_link); > + > + /* > + * Wakeup any other drain waiter that happened to queue up > + * without any intervening active thread. > + */ > + tb_first = TAILQ_FIRST(&queue->tq_active); > + if (tb_first != NULL && tb_first->tb_running == TB_DRAIN_WAITER) > + wakeup(tb_first); > + > + /* Release taskqueue_terminate(). */ > + queue->tq_callouts--; > + if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) > + wakeup_one(queue->tq_threads); > +} > + > +void > +gtaskqueue_block(struct gtaskqueue *queue) > +{ > + > + TQ_LOCK(queue); > + queue->tq_flags |= TQ_FLAGS_BLOCKED; > + TQ_UNLOCK(queue); > +} > + > +void > +gtaskqueue_unblock(struct gtaskqueue *queue) > +{ > + > + TQ_LOCK(queue); > + queue->tq_flags &= ~TQ_FLAGS_BLOCKED; > + if (!STAILQ_EMPTY(&queue->tq_queue)) > + queue->tq_enqueue(queue->tq_context); > + TQ_UNLOCK(queue); > +} > + > +static void > +gtaskqueue_run_locked(struct gtaskqueue *queue) > +{ > + struct gtaskqueue_busy tb; > + struct gtaskqueue_busy *tb_first; > + struct gtask *gtask; > + > + KASSERT(queue != NULL, ("tq is NULL")); > + TQ_ASSERT_LOCKED(queue); > + tb.tb_running = NULL; > + > + while (STAILQ_FIRST(&queue->tq_queue)) { > + TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); > + > + /* > + * Carefully remove the first task from the queue and > + * clear its TASK_ENQUEUED flag > + */ > + gtask = STAILQ_FIRST(&queue->tq_queue); > + KASSERT(gtask != NULL, ("task is NULL")); > + STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); > + gtask->ta_flags &= ~TASK_ENQUEUED; > + tb.tb_running = gtask; > + TQ_UNLOCK(queue); > + > + KASSERT(gtask->ta_func != NULL, ("task->ta_func is NULL")); > + gtask->ta_func(gtask->ta_context); > + > + TQ_LOCK(queue); > + tb.tb_running = NULL; > + wakeup(gtask); > + > + TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); > + tb_first = TAILQ_FIRST(&queue->tq_active); > + if (tb_first != NULL && > + tb_first->tb_running == TB_DRAIN_WAITER) > + wakeup(tb_first); > + } > +} > + > +static int > +task_is_running(struct gtaskqueue *queue, struct gtask *gtask) > +{ > + struct gtaskqueue_busy *tb; > + > + TQ_ASSERT_LOCKED(queue); > + TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { > + if (tb->tb_running == gtask) > + return (1); > + } > + return (0); > +} > + > +static int > +gtaskqueue_cancel_locked(struct gtaskqueue *queue, struct gtask *gtask) > +{ > + > + if (gtask->ta_flags & TASK_ENQUEUED) > + STAILQ_REMOVE(&queue->tq_queue, gtask, gtask, ta_link); > + gtask->ta_flags &= ~TASK_ENQUEUED; > + return (task_is_running(queue, gtask) ? EBUSY : 0); > +} > + > +int > +gtaskqueue_cancel(struct gtaskqueue *queue, struct gtask *gtask) > +{ > + int error; > + > + TQ_LOCK(queue); > + error = gtaskqueue_cancel_locked(queue, gtask); > + TQ_UNLOCK(queue); > + > + return (error); > +} > + > +void > +gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask) > +{ > + > + if (!queue->tq_spin) > + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); > + > + TQ_LOCK(queue); > + while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) > + TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); > + TQ_UNLOCK(queue); > +} > + > +void > +gtaskqueue_drain_all(struct gtaskqueue *queue) > +{ > + > + if (!queue->tq_spin) > + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); > + > + TQ_LOCK(queue); > + gtaskqueue_drain_tq_queue(queue); > + gtaskqueue_drain_tq_active(queue); > + TQ_UNLOCK(queue); > +} > + > +static int > +_gtaskqueue_start_threads(struct gtaskqueue **tqp, int count, int pri, > + cpuset_t *mask, const char *name, va_list ap) > +{ > + char ktname[MAXCOMLEN + 1]; > + struct thread *td; > + struct gtaskqueue *tq; > + int i, error; > + > + if (count <= 0) > + return (EINVAL); > + > + vsnprintf(ktname, sizeof(ktname), name, ap); > + tq = *tqp; > + > + tq->tq_threads = malloc(sizeof(struct thread *) * count, M_GTASKQUEUE, > + M_NOWAIT | M_ZERO); > + if (tq->tq_threads == NULL) { > + printf("%s: no memory for %s threads\n", __func__, ktname); > + return (ENOMEM); > + } > + > + for (i = 0; i < count; i++) { > + if (count == 1) > + error = kthread_add(gtaskqueue_thread_loop, tqp, NULL, > + &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); > + else > + error = kthread_add(gtaskqueue_thread_loop, tqp, NULL, > + &tq->tq_threads[i], RFSTOPPED, 0, > + "%s_%d", ktname, i); > + if (error) { > + /* should be ok to continue, taskqueue_free will dtrt */ > + printf("%s: kthread_add(%s): error %d", __func__, > + ktname, error); > + tq->tq_threads[i] = NULL; /* paranoid */ > + } else > + tq->tq_tcount++; > + } > + for (i = 0; i < count; i++) { > + if (tq->tq_threads[i] == NULL) > + continue; > + td = tq->tq_threads[i]; > + if (mask) { > + error = cpuset_setthread(td->td_tid, mask); > + /* > + * Failing to pin is rarely an actual fatal error; > + * it'll just affect performance. > + */ > + if (error) > + printf("%s: curthread=%llu: can't pin; " > + "error=%d\n", > + __func__, > + (unsigned long long) td->td_tid, > + error); > + } > + thread_lock(td); > + sched_prio(td, pri); > + sched_add(td, SRQ_BORING); > + thread_unlock(td); > + } > + > + return (0); > +} > + > +static int > +gtaskqueue_start_threads(struct gtaskqueue **tqp, int count, int pri, > + const char *name, ...) > +{ > + va_list ap; > + int error; > + > + va_start(ap, name); > + error = _gtaskqueue_start_threads(tqp, count, pri, NULL, name, ap); > + va_end(ap); > + return (error); > +} > + > +static inline void > +gtaskqueue_run_callback(struct gtaskqueue *tq, > + enum taskqueue_callback_type cb_type) > +{ > + taskqueue_callback_fn tq_callback; > + > + TQ_ASSERT_UNLOCKED(tq); > + tq_callback = tq->tq_callbacks[cb_type]; > + if (tq_callback != NULL) > + tq_callback(tq->tq_cb_contexts[cb_type]); > +} > + > +static void > +gtaskqueue_thread_loop(void *arg) > +{ > + struct gtaskqueue **tqp, *tq; > + > + tqp = arg; > + tq = *tqp; > + gtaskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_INIT); > + TQ_LOCK(tq); > + while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { > + /* XXX ? */ > + gtaskqueue_run_locked(tq); > + /* > + * Because taskqueue_run() can drop tq_mutex, we need to > + * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the > + * meantime, which means we missed a wakeup. > + */ > + if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) > + break; > + TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); > + } > + gtaskqueue_run_locked(tq); > + /* > + * This thread is on its way out, so just drop the lock temporarily > + * in order to call the shutdown callback. This allows the callback > + * to look at the taskqueue, even just before it dies. > + */ > + TQ_UNLOCK(tq); > + gtaskqueue_run_callback(tq, TASKQUEUE_CALLBACK_TYPE_SHUTDOWN); > + TQ_LOCK(tq); > + > + /* rendezvous with thread that asked us to terminate */ > + tq->tq_tcount--; > + wakeup_one(tq->tq_threads); > + TQ_UNLOCK(tq); > + kthread_exit(); > +} > + > +static void > +gtaskqueue_thread_enqueue(void *context) > +{ > + struct gtaskqueue **tqp, *tq; > + > + tqp = context; > + tq = *tqp; > + wakeup_one(tq); > +} > + > + > +static struct gtaskqueue * > +gtaskqueue_create_fast(const char *name, int mflags, > + taskqueue_enqueue_fn enqueue, void *context) > +{ > + return _gtaskqueue_create(name, mflags, enqueue, context, > + MTX_SPIN, "fast_taskqueue"); > +} > + > + > +struct taskqgroup_cpu { > + LIST_HEAD(, grouptask) tgc_tasks; > + struct gtaskqueue *tgc_taskq; > + int tgc_cnt; > + int tgc_cpu; > +}; > + > +struct taskqgroup { > + struct taskqgroup_cpu tqg_queue[MAXCPU]; > + struct mtx tqg_lock; > + char * tqg_name; > + int tqg_adjusting; > + int tqg_stride; > + int tqg_cnt; > +}; > + > +struct taskq_bind_task { > + struct gtask bt_task; > + int bt_cpuid; > +}; > + > +static void > +taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) > +{ > + struct taskqgroup_cpu *qcpu; > + > + qcpu = &qgroup->tqg_queue[idx]; > + LIST_INIT(&qcpu->tgc_tasks); > + qcpu->tgc_taskq = gtaskqueue_create_fast(NULL, M_WAITOK, > + taskqueue_thread_enqueue, &qcpu->tgc_taskq); > + gtaskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, > + "%s_%d", qgroup->tqg_name, idx); > + qcpu->tgc_cpu = idx * qgroup->tqg_stride; > +} > + > +static void > +taskqgroup_cpu_remove(struct taskqgroup *qgroup, int idx) > +{ > + > + gtaskqueue_free(qgroup->tqg_queue[idx].tgc_taskq); > +} > + > +/* > + * Find the taskq with least # of tasks that doesn't currently have any > + * other queues from the uniq identifier. > + */ > +static int > +taskqgroup_find(struct taskqgroup *qgroup, void *uniq) > +{ > + struct grouptask *n; > + int i, idx, mincnt; > + int strict; > + > + mtx_assert(&qgroup->tqg_lock, MA_OWNED); > + if (qgroup->tqg_cnt == 0) > + return (0); > + idx = -1; > + mincnt = INT_MAX; > + /* > + * Two passes; First scan for a queue with the least tasks that > + * does not already service this uniq id. If that fails simply find > + * the queue with the least total tasks; > + */ > + for (strict = 1; mincnt == INT_MAX; strict = 0) { > + for (i = 0; i < qgroup->tqg_cnt; i++) { > + if (qgroup->tqg_queue[i].tgc_cnt > mincnt) > + continue; > + if (strict) { > + LIST_FOREACH(n, > + &qgroup->tqg_queue[i].tgc_tasks, gt_list) > + if (n->gt_uniq == uniq) > + break; > + if (n != NULL) > + continue; > + } > + mincnt = qgroup->tqg_queue[i].tgc_cnt; > + idx = i; > + } > + } > + if (idx == -1) > + panic("taskqgroup_find: Failed to pick a qid."); > + > + return (idx); > +} > + > +void > +taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, > + void *uniq, int irq, char *name) > +{ > + cpuset_t mask; > + int qid; > + > + gtask->gt_uniq = uniq; > + gtask->gt_name = name; > + gtask->gt_irq = irq; > + gtask->gt_cpu = -1; > + mtx_lock(&qgroup->tqg_lock); > + qid = taskqgroup_find(qgroup, uniq); > + qgroup->tqg_queue[qid].tgc_cnt++; > + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); > + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; > + if (irq != -1 && smp_started) { > + CPU_ZERO(&mask); > + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); > + mtx_unlock(&qgroup->tqg_lock); > + intr_setaffinity(irq, &mask); > + } else > + mtx_unlock(&qgroup->tqg_lock); > +} > + > +int > +taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask, > + void *uniq, int cpu, int irq, char *name) > +{ > + cpuset_t mask; > + int i, qid; > + > + qid = -1; > + gtask->gt_uniq = uniq; > + gtask->gt_name = name; > + gtask->gt_irq = irq; > + gtask->gt_cpu = cpu; > + mtx_lock(&qgroup->tqg_lock); > + if (smp_started) { > + for (i = 0; i < qgroup->tqg_cnt; i++) > + if (qgroup->tqg_queue[i].tgc_cpu == cpu) { > + qid = i; > + break; > + } > + if (qid == -1) { > + mtx_unlock(&qgroup->tqg_lock); > + return (EINVAL); > + } > + } else > + qid = 0; > + qgroup->tqg_queue[qid].tgc_cnt++; > + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); > + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; > + if (irq != -1 && smp_started) { > + CPU_ZERO(&mask); > + CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); > + mtx_unlock(&qgroup->tqg_lock); > + intr_setaffinity(irq, &mask); > + } else > + mtx_unlock(&qgroup->tqg_lock); > + return (0); > +} > + > +void > +taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask) > +{ > + int i; > + > + mtx_lock(&qgroup->tqg_lock); > + for (i = 0; i < qgroup->tqg_cnt; i++) > + if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) > + break; > + if (i == qgroup->tqg_cnt) > + panic("taskqgroup_detach: task not in group\n"); > + qgroup->tqg_queue[i].tgc_cnt--; > + LIST_REMOVE(gtask, gt_list); > + mtx_unlock(&qgroup->tqg_lock); > + gtask->gt_taskqueue = NULL; > +} > + > +static void > +taskqgroup_binder(void *ctx) > +{ > + struct taskq_bind_task *gtask = (struct taskq_bind_task *)ctx; > + cpuset_t mask; > + int error; > + > + CPU_ZERO(&mask); > + CPU_SET(gtask->bt_cpuid, &mask); > + error = cpuset_setthread(curthread->td_tid, &mask); > + thread_lock(curthread); > + sched_bind(curthread, gtask->bt_cpuid); > + thread_unlock(curthread); > + > + if (error) > + printf("taskqgroup_binder: setaffinity failed: %d\n", > + error); > + free(gtask, M_DEVBUF); > +} > + > +static void > +taskqgroup_bind(struct taskqgroup *qgroup) > +{ > + struct taskq_bind_task *gtask; > + int i; > + > + /* > + * Bind taskqueue threads to specific CPUs, if they have been assigned > + * one. > + */ > + for (i = 0; i < qgroup->tqg_cnt; i++) { > + gtask = malloc(sizeof (*gtask), M_DEVBUF, M_NOWAIT); > + GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask); > + gtask->bt_cpuid = qgroup->tqg_queue[i].tgc_cpu; > + grouptaskqueue_enqueue(qgroup->tqg_queue[i].tgc_taskq, > + >ask->bt_task); > + } > +} > + > +static int > +_taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) > +{ > + LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); > + cpuset_t mask; > + struct grouptask *gtask; > + int i, old_cnt, qid; > + > + mtx_assert(&qgroup->tqg_lock, MA_OWNED); > + > + if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) { > + printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n", > + cnt, stride, mp_ncpus, smp_started); > + return (EINVAL); > + } > + if (qgroup->tqg_adjusting) { > + printf("taskqgroup_adjust failed: adjusting\n"); > + return (EBUSY); > + } > + qgroup->tqg_adjusting = 1; > + old_cnt = qgroup->tqg_cnt; > + mtx_unlock(&qgroup->tqg_lock); > + /* > + * Set up queue for tasks added before boot. > + */ > + if (old_cnt == 0) { > + LIST_SWAP(>ask_head, &qgroup->tqg_queue[0].tgc_tasks, > + grouptask, gt_list); > + qgroup->tqg_queue[0].tgc_cnt = 0; > + } > + > + /* > + * If new taskq threads have been added. > + */ > + for (i = old_cnt; i < cnt; i++) > + taskqgroup_cpu_create(qgroup, i); > + mtx_lock(&qgroup->tqg_lock); > + qgroup->tqg_cnt = cnt; > + qgroup->tqg_stride = stride; > + > + /* > + * Adjust drivers to use new taskqs. > + */ > + for (i = 0; i < old_cnt; i++) { > + while ((gtask = LIST_FIRST(&qgroup->tqg_queue[i].tgc_tasks))) { > + LIST_REMOVE(gtask, gt_list); > + qgroup->tqg_queue[i].tgc_cnt--; > + LIST_INSERT_HEAD(>ask_head, gtask, gt_list); > + } > + } > + > + while ((gtask = LIST_FIRST(>ask_head))) { > + LIST_REMOVE(gtask, gt_list); > + if (gtask->gt_cpu == -1) > + qid = taskqgroup_find(qgroup, gtask->gt_uniq); > + else { > + for (i = 0; i < qgroup->tqg_cnt; i++) > + if (qgroup->tqg_queue[i].tgc_cpu == gtask->gt_cpu) { > + qid = i; > + break; > + } > + } > + qgroup->tqg_queue[qid].tgc_cnt++; > + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, > + gt_list); > + gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; > + } > + /* > + * Set new CPU and IRQ affinity > + */ > + for (i = 0; i < cnt; i++) { > + qgroup->tqg_queue[i].tgc_cpu = i * qgroup->tqg_stride; > + CPU_ZERO(&mask); > + CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); > + LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { > + if (gtask->gt_irq == -1) > + continue; > + intr_setaffinity(gtask->gt_irq, &mask); > + } > + } > + mtx_unlock(&qgroup->tqg_lock); > + > + /* > + * If taskq thread count has been reduced. > + */ > + for (i = cnt; i < old_cnt; i++) > + taskqgroup_cpu_remove(qgroup, i); > + > + mtx_lock(&qgroup->tqg_lock); > + qgroup->tqg_adjusting = 0; > + > + taskqgroup_bind(qgroup); > + > + return (0); > +} > + > +int > +taskqgroup_adjust(struct taskqgroup *qgroup, int cpu, int stride) > +{ > + int error; > + > + mtx_lock(&qgroup->tqg_lock); > + error = _taskqgroup_adjust(qgroup, cpu, stride); > + mtx_unlock(&qgroup->tqg_lock); > + > + return (error); > +} > + > +struct taskqgroup * > +taskqgroup_create(char *name) > +{ > + struct taskqgroup *qgroup; > + > + qgroup = malloc(sizeof(*qgroup), M_GTASKQUEUE, M_WAITOK | M_ZERO); > + mtx_init(&qgroup->tqg_lock, "taskqgroup", NULL, MTX_DEF); > + qgroup->tqg_name = name; > + LIST_INIT(&qgroup->tqg_queue[0].tgc_tasks); > + > + return (qgroup); > +} > + > +void > +taskqgroup_destroy(struct taskqgroup *qgroup) > +{ > + > +} > > Modified: head/sys/kern/subr_taskqueue.c > ============================================================================== > --- head/sys/kern/subr_taskqueue.c Fri Aug 12 20:33:23 2016 (r304020) > +++ head/sys/kern/subr_taskqueue.c Fri Aug 12 21:29:44 2016 (r304021) > @@ -261,22 +261,6 @@ taskqueue_enqueue_locked(struct taskqueu > } > > int > -grouptaskqueue_enqueue(struct taskqueue *queue, struct task *task) > -{ > - TQ_LOCK(queue); > - if (task->ta_pending) { > - TQ_UNLOCK(queue); > - return (0); > - } > - STAILQ_INSERT_TAIL(&queue->tq_queue, task, ta_link); > - task->ta_pending = 1; > - TQ_UNLOCK(queue); > - if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) > - queue->tq_enqueue(queue->tq_context); > - return (0); > -} > - > -int > taskqueue_enqueue(struct taskqueue *queue, struct task *task) > { > int res; > @@ -806,347 +790,3 @@ taskqueue_member(struct taskqueue *queue > } > return (ret); > } > - > -struct taskqgroup_cpu { > - LIST_HEAD(, grouptask) tgc_tasks; > - struct taskqueue *tgc_taskq; > - int tgc_cnt; > - int tgc_cpu; > -}; > - > -struct taskqgroup { > - struct taskqgroup_cpu tqg_queue[MAXCPU]; > - struct mtx tqg_lock; > - char * tqg_name; > - int tqg_adjusting; > - int tqg_stride; > - int tqg_cnt; > -}; > - > -struct taskq_bind_task { > - struct task bt_task; > - int bt_cpuid; > -}; > - > -static void > -taskqgroup_cpu_create(struct taskqgroup *qgroup, int idx) > -{ > - struct taskqgroup_cpu *qcpu; > - int i, j; > - > - qcpu = &qgroup->tqg_queue[idx]; > - LIST_INIT(&qcpu->tgc_tasks); > - qcpu->tgc_taskq = taskqueue_create_fast(NULL, M_WAITOK, > - taskqueue_thread_enqueue, &qcpu->tgc_taskq); > - taskqueue_start_threads(&qcpu->tgc_taskq, 1, PI_SOFT, > - "%s_%d", qgroup->tqg_name, idx); > - > - for (i = CPU_FIRST(), j = 0; j < idx * qgroup->tqg_stride; > - j++, i = CPU_NEXT(i)) { > - /* > - * Wait: evaluate the idx * qgroup->tqg_stride'th CPU, > - * potentially wrapping the actual count > - */ > - } > - qcpu->tgc_cpu = i; > -} > - > -static void > -taskqgroup_cpu_remove(struct taskqgroup *qgroup, int idx) > -{ > - > - taskqueue_free(qgroup->tqg_queue[idx].tgc_taskq); > -} > - > -/* > - * Find the taskq with least # of tasks that doesn't currently have any > - * other queues from the uniq identifier. > - */ > -static int > -taskqgroup_find(struct taskqgroup *qgroup, void *uniq) > -{ > - struct grouptask *n; > - int i, idx, mincnt; > - int strict; > - > - mtx_assert(&qgroup->tqg_lock, MA_OWNED); > - if (qgroup->tqg_cnt == 0) > - return (0); > - idx = -1; > - mincnt = INT_MAX; > - /* > - * Two passes; First scan for a queue with the least tasks that > - * does not already service this uniq id. If that fails simply find > - * the queue with the least total tasks; > - */ > - for (strict = 1; mincnt == INT_MAX; strict = 0) { > - for (i = 0; i < qgroup->tqg_cnt; i++) { > - if (qgroup->tqg_queue[i].tgc_cnt > mincnt) > - continue; > - if (strict) { > - LIST_FOREACH(n, > - &qgroup->tqg_queue[i].tgc_tasks, gt_list) > - if (n->gt_uniq == uniq) > - break; > - if (n != NULL) > - continue; > - } > - mincnt = qgroup->tqg_queue[i].tgc_cnt; > - idx = i; > - } > - } > - if (idx == -1) > - panic("taskqgroup_find: Failed to pick a qid."); > - > - return (idx); > -} > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Fri Aug 12 21:43:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10C3BB801F; Fri, 12 Aug 2016 21:43:18 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C508012B3; Fri, 12 Aug 2016 21:43:18 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (75-161-70-238.albq.qwest.net [75.161.70.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id A39401928CE; Fri, 12 Aug 2016 21:43:16 +0000 (UTC) Subject: Re: svn commit: r303848 - head/sys/netgraph To: Gleb Smirnoff References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> Cc: Michael Zhilin , ngie@FreeBSD.org, sergey.dyatko@gmail.com From: Sean Bruno Message-ID: <9bf1be8a-0b06-bdcf-c876-209f3a31cbe4@freebsd.org> Date: Fri, 12 Aug 2016 15:43:15 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160812183845.GJ1076@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 12 Aug 2016 22:16:57 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 21:43:19 -0000 The original problem was reported in this review, it doesn't look like an "old" problem IMO. sean https://reviews.freebsd.org/D7209 From owner-svn-src-head@freebsd.org Fri Aug 12 22:20:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22E1BB8DCB; Fri, 12 Aug 2016 22:20:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B546D1B3B; Fri, 12 Aug 2016 22:20:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CMKqSG048067; Fri, 12 Aug 2016 22:20:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CMKq4n048066; Fri, 12 Aug 2016 22:20:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608122220.u7CMKq4n048066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 12 Aug 2016 22:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304023 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 22:20:54 -0000 Author: trasz Date: Fri Aug 12 22:20:52 2016 New Revision: 304023 URL: https://svnweb.freebsd.org/changeset/base/304023 Log: Print vnode details when vnode locking assertion gets triggered. MFC after: 1 month Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 12 22:00:13 2016 (r304022) +++ head/sys/kern/vfs_subr.c Fri Aug 12 22:20:52 2016 (r304023) @@ -4402,6 +4402,10 @@ int vfs_badlock_print = 1; /* Print lock SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, &vfs_badlock_print, 0, "Print lock violations"); +int vfs_badlock_vnode = 1; /* Print vnode details on lock violations. */ +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_vnode, CTLFLAG_RW, &vfs_badlock_vnode, + 0, "Print vnode details on lock violations"); + #ifdef KDB int vfs_badlock_backtrace = 1; /* Print backtrace at lock violations. */ SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW, @@ -4416,6 +4420,8 @@ vfs_badlock(const char *msg, const char if (vfs_badlock_backtrace) kdb_backtrace(); #endif + if (vfs_badlock_vnode) + vn_printf(vp, "vnode "); if (vfs_badlock_print) printf("%s: %p %s\n", str, (void *)vp, msg); if (vfs_badlock_ddb) From owner-svn-src-head@freebsd.org Fri Aug 12 22:22:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC06ABB8E3A; Fri, 12 Aug 2016 22:22:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84ACA1E56; Fri, 12 Aug 2016 22:22:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CMMB4M050748; Fri, 12 Aug 2016 22:22:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CMMBCa050747; Fri, 12 Aug 2016 22:22:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608122222.u7CMMBCa050747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 12 Aug 2016 22:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304024 - 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.22 Precedence: list List-Id: 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, 12 Aug 2016 22:22:12 -0000 Author: trasz Date: Fri Aug 12 22:22:11 2016 New Revision: 304024 URL: https://svnweb.freebsd.org/changeset/base/304024 Log: Remove unused "X" vnode lock assertion, somehow missed in r303743. MFC after: 1 month Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Aug 12 22:20:52 2016 (r304023) +++ head/sys/kern/vnode_if.src Fri Aug 12 22:22:11 2016 (r304024) @@ -44,7 +44,6 @@ # U: unlocked. # -: not applicable. vnode does not yet (or no longer) exists. # =: the same on input and output, may be either L or U. -# X: locked if not nil. # # The paramater named "vpp" is assumed to be always used with double # indirection (**vpp) and that name is hard-coded in vnode_if.awk ! From owner-svn-src-head@freebsd.org Fri Aug 12 22:23:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FD1CBB8E9F; Fri, 12 Aug 2016 22:23:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFF6117C; Fri, 12 Aug 2016 22:23:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id p64so12703964pfb.1; Fri, 12 Aug 2016 15:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=+bNLcWY8nG97imcfmvmI8LEQ0JVeSRAcOt6ekoi7/14=; b=Uwq73QMx4qUEaWT8Bjnm+7z64aJqNRQOVB2HS4WLFsoPigjpABuhYZQ9IlvjyfS5J/ 507xfpubFTtZoMHLojViZJ5uauvUU/3j+GO+p3Ee0+AEgY/R/tcl/3JaAV7dT5aVNn9i MKZhAMa/jgeHJ9sxgTZ0g3EUxSiq/w5NOmkPz1fufQec97sADBFC97Qq9nicdsE73Y+R TB9vDWmfw/WjmnKcXMFmwWttlsZW+jgk6i0ji2Ri+3igpDIJ6g1H8PcwH1g/SYwdycey LVX6nzvmnfoQZj4dJtRmmn0NRjthy6kMqVA4Z9C373r9yyqa95Nfex2a+47wvtiFyh0X jldg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=+bNLcWY8nG97imcfmvmI8LEQ0JVeSRAcOt6ekoi7/14=; b=eUISq896yjMmp14OvPNsuYBZLla9VYwuFqaPluaRD9iFgeK1i5ITxDstojFXGUvGa6 uSJIWErWVuiBoesKMHBXkb51WPtnA277qES1EmNO9/WAvqp9iNaueWIl6h2i+KQU3O66 R4dr6ZVN2PtWDrESkvqPMPCz/wSx+I0oKI7CYcNL2nb22oRDYzPng7xQdahfXCW7kr9x b2MSbxM7EUWDS1UZ4t49c3a2mSpL/KGdAO6/NB+xvekpl63ktaomf13qJ939YSF7TsVj PNEZIeqC3yuNmEUny3Vd8c6tLelXHLcpo6lP6K8UzI7/sLukii0CQfbdxPGWfsMf/2DQ NMZQ== X-Gm-Message-State: AEkoouuImKW0UvDkJVMPF1ko+uSk/SdxrYWlfKX6Bko+Ra0hvq3Fq44sNBJljYnCzGrMsw== X-Received: by 10.98.7.200 with SMTP id 69mr31148041pfh.33.1471040593686; Fri, 12 Aug 2016 15:23:13 -0700 (PDT) Received: from pinklady.west.isilon.com (scl-nat-134.emc.com. [137.69.117.134]) by smtp.gmail.com with ESMTPSA id j2sm15349807paa.46.2016.08.12.15.23.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Aug 2016 15:23:12 -0700 (PDT) Subject: Re: svn commit: r303848 - head/sys/netgraph Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A15DCF97-7671-4AC3-A4E4-029F9C77DFDA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160812183845.GJ1076@FreeBSD.org> Date: Fri, 12 Aug 2016 15:23:11 -0700 Cc: Sean Bruno , Michael Zhilin , Garrett Cooper , sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 22:23:14 -0000 --Apple-Mail=_A15DCF97-7671-4AC3-A4E4-029F9C77DFDA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 12, 2016, at 11:38, Gleb Smirnoff wrote: >=20 > Hi! >=20 > Sorry, I'm afraid this isn't a correct fix. Simply adding checks > against NULL to avoid panics at race conditions isn't a solution. >=20 > I can provide help with this problem. It must be related to my > callout changes, in case if this is a very recent problem. >=20 > Is it a recent problem or an old one? I should have requested that the change be revised or further qualified = first=E2=80=A6 as I said in the CR: =E2=80=9C=E2=80=9D=E2=80=9D In D7209#150056, @bz wrote: Is this sudden problem possibly related to glebius' callout changes? I = am not properly tracking things but if invariants changed and weren't = reflected in the callers, that might explain. I don't know to be honest. I'll add glebius (I should have done that in the first place). =E2=80=9C=E2=80=9D=E2=80=9D Thanks, -Ngie --Apple-Mail=_A15DCF97-7671-4AC3-A4E4-029F9C77DFDA 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 - https://gpgtools.org iQIcBAEBCgAGBQJXrkxPAAoJEPWDqSZpMIYVQSIP+wV+4X6wQhck3zD7EmZuZk3v sfE0jlfQ+wTWJ/zHhxUb/9lEsb4ss/j+0zcXVj7xsC6Mb+/I/X35du1SQbxWN3ga rFEelSqQK5x2ejao+A0iscXeKkZczu4KjfeTeQjqyfL5uaoFjbUYyBK+BIxNe4fw pvulKObZvrA8q5CSsPh/bynWQ+NZJ6d5ehhZFABC/D9ePYNj3ALmT5aGjbt6Jm5A F/0a38HGLlw0wBl6XSfcDuctFVHXKFQh6nK6TbJbmbhBqV4utN8Ke/5x++ZUq7HM 31CAU3LHTSI0bl64Jp9MSX/m8BwcNV49FqZ6kPlXkRtUnmaiMmwM0srKS+1h94IY 7UhqdsXAjB/JZU+qHp+VyiUEgryfiRBpR3bQu87iwCjviqr+Df+xsj2eDP5Lv3A/ mx5zBRfB/zIqVp/Nxvp069P4IT8pCBkbFrfnQNKve0LRI8SJbDPqfCnGvg7vls6C 6N7wCWeWh1kaW5BiJQnEyhV7RsZ8RiWPFY9R3AItzw2JLrqfFh01W+gQGdu8Lb/7 fmlZL+rZ57yVw5LdM2z4bB6P2SygfnzWwOp+1US8EBQtx588HJEVDhRPkbGrXyoY lhocyqGM3uf9QRsaxJ8cfVkr7K4WWh3VTfZ1Lulz8q5fXHq2Io6/MUcVbHn3KJqV OYGlgFKpSobqGJhq0NUs =WNWG -----END PGP SIGNATURE----- --Apple-Mail=_A15DCF97-7671-4AC3-A4E4-029F9C77DFDA-- From owner-svn-src-head@freebsd.org Fri Aug 12 22:25:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1046EBB8F61; Fri, 12 Aug 2016 22:25:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D74F81433; Fri, 12 Aug 2016 22:25:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CMP2Jd051023; Fri, 12 Aug 2016 22:25:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CMP2ti051022; Fri, 12 Aug 2016 22:25:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608122225.u7CMP2ti051022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 12 Aug 2016 22:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304025 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 22:25:03 -0000 Author: tsoome Date: Fri Aug 12 22:25:01 2016 New Revision: 304025 URL: https://svnweb.freebsd.org/changeset/base/304025 Log: Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7491 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Aug 12 22:22:11 2016 (r304024) +++ head/share/misc/committers-src.dot Fri Aug 12 22:25:01 2016 (r304025) @@ -312,6 +312,7 @@ theraven [label="David Chisnall\ntherave thompsa [label="Andrew Thompson\nthompsa@FreeBSD.org\n2005/05/25"] ticso [label="Bernd Walter\nticso@FreeBSD.org\n2002/01/31"] tijl [label="Tijl Coosemans\ntijl@FreeBSD.org\n2010/07/16"] +tsoome [label="Toomas Soome\ntsoome@FreeBSD.org\n2016/08/10"] trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2008/08/22"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/05/28"] trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2011/03/10"] @@ -363,6 +364,8 @@ adrian -> sgalabov ae -> melifaro +allanjude -> tsoome + alc -> davide andre -> qingli @@ -520,6 +523,7 @@ imp -> sanpei imp -> shiba imp -> takawata imp -> toshi +imp -> tsoome imp -> uch jake -> bms From owner-svn-src-head@freebsd.org Fri Aug 12 22:45:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A1D7BB633F; Fri, 12 Aug 2016 22:45:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1510D1CFC; Fri, 12 Aug 2016 22:45:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7CMj0Jl058530; Fri, 12 Aug 2016 22:45:00 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7CMixji058508; Fri, 12 Aug 2016 22:44:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201608122244.u7CMixji058508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 12 Aug 2016 22:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304026 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 22:45:01 -0000 Author: rmacklem Date: Fri Aug 12 22:44:59 2016 New Revision: 304026 URL: https://svnweb.freebsd.org/changeset/base/304026 Log: Update the nfsstats structure to include the changes needed by the patch in D1626 plus changes so that it includes counts for NFSv4.1 (and the draft of NFSv4.2). Also, make all the counts uint64_t and add a vers field at the beginning, so that future revisions can easily be implemented. There is code in place to handle the old vesion of the nfsstats structure for backwards binary compatibility. Subsequent commits will update nfsstat(8) to use the new fields. Submitted by: will (earlier version) Reviewed by: ken MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D1626 Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfs/nfs_commonkrpc.c Fri Aug 12 22:44:59 2016 (r304026) @@ -89,7 +89,7 @@ uint32_t nfscl_nfs4_done_probes[NFSV41_N NFSSTATESPINLOCK; NFSREQSPINLOCK; NFSDLOCKMUTEX; -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern struct nfsreqhead nfsd_reqq; extern int nfscl_ticks; extern void (*ncl_call_invalcaches)(struct vnode *); @@ -642,7 +642,7 @@ newnfs_request(struct nfsrv_descript *nd procnum = NFSV4PROC_COMPOUND; if (nmp != NULL) { - NFSINCRGLOBAL(newnfsstats.rpcrequests); + NFSINCRGLOBAL(nfsstatsv1.rpcrequests); /* Map the procnum to the old NFSv2 one, as required. */ if ((nd->nd_flag & ND_NFSV2) != 0) { @@ -762,18 +762,18 @@ tryagain: if (stat == RPC_SUCCESS) { error = 0; } else if (stat == RPC_TIMEDOUT) { - NFSINCRGLOBAL(newnfsstats.rpctimeouts); + NFSINCRGLOBAL(nfsstatsv1.rpctimeouts); error = ETIMEDOUT; } else if (stat == RPC_VERSMISMATCH) { - NFSINCRGLOBAL(newnfsstats.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EOPNOTSUPP; } else if (stat == RPC_PROGVERSMISMATCH) { - NFSINCRGLOBAL(newnfsstats.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EPROTONOSUPPORT; } else if (stat == RPC_INTR) { error = EINTR; } else { - NFSINCRGLOBAL(newnfsstats.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EACCES; } if (error) { Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfs/nfs_commonport.c Fri Aug 12 22:44:59 2016 (r304026) @@ -58,7 +58,7 @@ extern void (*nfsd_call_recall)(struct v extern int nfsrv_useacl; struct mount nfsv4root_mnt; int newnfs_numnfsd = 0; -struct nfsstats newnfsstats; +struct nfsstatsv1 nfsstatsv1; int nfs_numnfscbd = 0; int nfscl_debuglevel = 0; char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; @@ -69,6 +69,7 @@ void (*ncl_call_invalcaches)(struct vnod static int nfs_realign_test; static int nfs_realign_count; +static struct ext_nfsstats oldnfsstats; SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem"); SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, @@ -446,9 +447,12 @@ nfssvc_nfscommon(struct thread *td, stru static int nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) { - int error = EINVAL; + int error = EINVAL, i, j; struct nfsd_idargs nid; struct nfsd_oidargs onid; + struct { + int vers; /* Just the first field of nfsstats. */ + } nfsstatver; if (uap->flag & NFSSVC_IDNAME) { if ((uap->flag & NFSSVC_NEWSTRUCT) != 0) @@ -472,63 +476,157 @@ nfssvc_call(struct thread *p, struct nfs error = nfssvc_idname(&nid); goto out; } else if (uap->flag & NFSSVC_GETSTATS) { - error = copyout(&newnfsstats, - CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats)); + if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) { + /* Copy fields to the old ext_nfsstat structure. */ + oldnfsstats.attrcache_hits = + nfsstatsv1.attrcache_hits; + oldnfsstats.attrcache_misses = + nfsstatsv1.attrcache_misses; + oldnfsstats.lookupcache_hits = + nfsstatsv1.lookupcache_hits; + oldnfsstats.lookupcache_misses = + nfsstatsv1.lookupcache_misses; + oldnfsstats.direofcache_hits = + nfsstatsv1.direofcache_hits; + oldnfsstats.direofcache_misses = + nfsstatsv1.direofcache_misses; + oldnfsstats.accesscache_hits = + nfsstatsv1.accesscache_hits; + oldnfsstats.accesscache_misses = + nfsstatsv1.accesscache_misses; + oldnfsstats.biocache_reads = + nfsstatsv1.biocache_reads; + oldnfsstats.read_bios = + nfsstatsv1.read_bios; + oldnfsstats.read_physios = + nfsstatsv1.read_physios; + oldnfsstats.biocache_writes = + nfsstatsv1.biocache_writes; + oldnfsstats.write_bios = + nfsstatsv1.write_bios; + oldnfsstats.write_physios = + nfsstatsv1.write_physios; + oldnfsstats.biocache_readlinks = + nfsstatsv1.biocache_readlinks; + oldnfsstats.readlink_bios = + nfsstatsv1.readlink_bios; + oldnfsstats.biocache_readdirs = + nfsstatsv1.biocache_readdirs; + oldnfsstats.readdir_bios = + nfsstatsv1.readdir_bios; + for (i = 0; i < NFSV4_NPROCS; i++) + oldnfsstats.rpccnt[i] = nfsstatsv1.rpccnt[i]; + oldnfsstats.rpcretries = nfsstatsv1.rpcretries; + for (i = 0; i < NFSV4OP_NOPS; i++) + oldnfsstats.srvrpccnt[i] = + nfsstatsv1.srvrpccnt[i]; + for (i = NFSV42_NOPS, j = NFSV4OP_NOPS; + i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) + oldnfsstats.srvrpccnt[j] = + nfsstatsv1.srvrpccnt[i]; + oldnfsstats.srvrpc_errs = nfsstatsv1.srvrpc_errs; + oldnfsstats.srv_errs = nfsstatsv1.srv_errs; + oldnfsstats.rpcrequests = nfsstatsv1.rpcrequests; + oldnfsstats.rpctimeouts = nfsstatsv1.rpctimeouts; + oldnfsstats.rpcunexpected = nfsstatsv1.rpcunexpected; + oldnfsstats.rpcinvalid = nfsstatsv1.rpcinvalid; + oldnfsstats.srvcache_inproghits = + nfsstatsv1.srvcache_inproghits; + oldnfsstats.srvcache_idemdonehits = + nfsstatsv1.srvcache_idemdonehits; + oldnfsstats.srvcache_nonidemdonehits = + nfsstatsv1.srvcache_nonidemdonehits; + oldnfsstats.srvcache_misses = + nfsstatsv1.srvcache_misses; + oldnfsstats.srvcache_tcppeak = + nfsstatsv1.srvcache_tcppeak; + oldnfsstats.srvcache_size = nfsstatsv1.srvcache_size; + oldnfsstats.srvclients = nfsstatsv1.srvclients; + oldnfsstats.srvopenowners = nfsstatsv1.srvopenowners; + oldnfsstats.srvopens = nfsstatsv1.srvopens; + oldnfsstats.srvlockowners = nfsstatsv1.srvlockowners; + oldnfsstats.srvlocks = nfsstatsv1.srvlocks; + oldnfsstats.srvdelegates = nfsstatsv1.srvdelegates; + for (i = 0; i < NFSV4OP_CBNOPS; i++) + oldnfsstats.cbrpccnt[i] = + nfsstatsv1.cbrpccnt[i]; + oldnfsstats.clopenowners = nfsstatsv1.clopenowners; + oldnfsstats.clopens = nfsstatsv1.clopens; + oldnfsstats.cllockowners = nfsstatsv1.cllockowners; + oldnfsstats.cllocks = nfsstatsv1.cllocks; + oldnfsstats.cldelegates = nfsstatsv1.cldelegates; + oldnfsstats.cllocalopenowners = + nfsstatsv1.cllocalopenowners; + oldnfsstats.cllocalopens = nfsstatsv1.cllocalopens; + oldnfsstats.cllocallockowners = + nfsstatsv1.cllocallockowners; + oldnfsstats.cllocallocks = nfsstatsv1.cllocallocks; + error = copyout(&oldnfsstats, uap->argp, + sizeof (oldnfsstats)); + } else { + error = copyin(uap->argp, &nfsstatver, + sizeof(nfsstatver)); + if (error == 0 && nfsstatver.vers != NFSSTATS_V1) + error = EPERM; + if (error == 0) + error = copyout(&nfsstatsv1, uap->argp, + sizeof (nfsstatsv1)); + } if (error == 0) { if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { - newnfsstats.attrcache_hits = 0; - newnfsstats.attrcache_misses = 0; - newnfsstats.lookupcache_hits = 0; - newnfsstats.lookupcache_misses = 0; - newnfsstats.direofcache_hits = 0; - newnfsstats.direofcache_misses = 0; - newnfsstats.accesscache_hits = 0; - newnfsstats.accesscache_misses = 0; - newnfsstats.biocache_reads = 0; - newnfsstats.read_bios = 0; - newnfsstats.read_physios = 0; - newnfsstats.biocache_writes = 0; - newnfsstats.write_bios = 0; - newnfsstats.write_physios = 0; - newnfsstats.biocache_readlinks = 0; - newnfsstats.readlink_bios = 0; - newnfsstats.biocache_readdirs = 0; - newnfsstats.readdir_bios = 0; - newnfsstats.rpcretries = 0; - newnfsstats.rpcrequests = 0; - newnfsstats.rpctimeouts = 0; - newnfsstats.rpcunexpected = 0; - newnfsstats.rpcinvalid = 0; - bzero(newnfsstats.rpccnt, - sizeof(newnfsstats.rpccnt)); + nfsstatsv1.attrcache_hits = 0; + nfsstatsv1.attrcache_misses = 0; + nfsstatsv1.lookupcache_hits = 0; + nfsstatsv1.lookupcache_misses = 0; + nfsstatsv1.direofcache_hits = 0; + nfsstatsv1.direofcache_misses = 0; + nfsstatsv1.accesscache_hits = 0; + nfsstatsv1.accesscache_misses = 0; + nfsstatsv1.biocache_reads = 0; + nfsstatsv1.read_bios = 0; + nfsstatsv1.read_physios = 0; + nfsstatsv1.biocache_writes = 0; + nfsstatsv1.write_bios = 0; + nfsstatsv1.write_physios = 0; + nfsstatsv1.biocache_readlinks = 0; + nfsstatsv1.readlink_bios = 0; + nfsstatsv1.biocache_readdirs = 0; + nfsstatsv1.readdir_bios = 0; + nfsstatsv1.rpcretries = 0; + nfsstatsv1.rpcrequests = 0; + nfsstatsv1.rpctimeouts = 0; + nfsstatsv1.rpcunexpected = 0; + nfsstatsv1.rpcinvalid = 0; + bzero(nfsstatsv1.rpccnt, + sizeof(nfsstatsv1.rpccnt)); } if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) { - newnfsstats.srvrpc_errs = 0; - newnfsstats.srv_errs = 0; - newnfsstats.srvcache_inproghits = 0; - newnfsstats.srvcache_idemdonehits = 0; - newnfsstats.srvcache_nonidemdonehits = 0; - newnfsstats.srvcache_misses = 0; - newnfsstats.srvcache_tcppeak = 0; - newnfsstats.srvclients = 0; - newnfsstats.srvopenowners = 0; - newnfsstats.srvopens = 0; - newnfsstats.srvlockowners = 0; - newnfsstats.srvlocks = 0; - newnfsstats.srvdelegates = 0; - newnfsstats.clopenowners = 0; - newnfsstats.clopens = 0; - newnfsstats.cllockowners = 0; - newnfsstats.cllocks = 0; - newnfsstats.cldelegates = 0; - newnfsstats.cllocalopenowners = 0; - newnfsstats.cllocalopens = 0; - newnfsstats.cllocallockowners = 0; - newnfsstats.cllocallocks = 0; - bzero(newnfsstats.srvrpccnt, - sizeof(newnfsstats.srvrpccnt)); - bzero(newnfsstats.cbrpccnt, - sizeof(newnfsstats.cbrpccnt)); + nfsstatsv1.srvrpc_errs = 0; + nfsstatsv1.srv_errs = 0; + nfsstatsv1.srvcache_inproghits = 0; + nfsstatsv1.srvcache_idemdonehits = 0; + nfsstatsv1.srvcache_nonidemdonehits = 0; + nfsstatsv1.srvcache_misses = 0; + nfsstatsv1.srvcache_tcppeak = 0; + nfsstatsv1.srvclients = 0; + nfsstatsv1.srvopenowners = 0; + nfsstatsv1.srvopens = 0; + nfsstatsv1.srvlockowners = 0; + nfsstatsv1.srvlocks = 0; + nfsstatsv1.srvdelegates = 0; + nfsstatsv1.clopenowners = 0; + nfsstatsv1.clopens = 0; + nfsstatsv1.cllockowners = 0; + nfsstatsv1.cllocks = 0; + nfsstatsv1.cldelegates = 0; + nfsstatsv1.cllocalopenowners = 0; + nfsstatsv1.cllocalopens = 0; + nfsstatsv1.cllocallockowners = 0; + nfsstatsv1.cllocallocks = 0; + bzero(nfsstatsv1.srvrpccnt, + sizeof(nfsstatsv1.srvrpccnt)); + bzero(nfsstatsv1.cbrpccnt, + sizeof(nfsstatsv1.cbrpccnt)); } } goto out; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfs/nfsport.h Fri Aug 12 22:44:59 2016 (r304026) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -254,24 +255,26 @@ /* * Must be one more than last op#. + * NFSv4.2 isn't implemented yet, but define the op# limit for it. */ #define NFSV41_NOPS 59 +#define NFSV42_NOPS 72 /* Quirky case if the illegal op code */ #define NFSV4OP_OPILLEGAL 10044 /* - * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV4OP_NOPS. + * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV42_NOPS. */ -#define NFSV4OP_SYMLINK (NFSV4OP_NOPS) -#define NFSV4OP_MKDIR (NFSV4OP_NOPS + 1) -#define NFSV4OP_RMDIR (NFSV4OP_NOPS + 2) -#define NFSV4OP_READDIRPLUS (NFSV4OP_NOPS + 3) -#define NFSV4OP_MKNOD (NFSV4OP_NOPS + 4) -#define NFSV4OP_FSSTAT (NFSV4OP_NOPS + 5) -#define NFSV4OP_FSINFO (NFSV4OP_NOPS + 6) -#define NFSV4OP_PATHCONF (NFSV4OP_NOPS + 7) -#define NFSV4OP_V3CREATE (NFSV4OP_NOPS + 8) +#define NFSV4OP_SYMLINK (NFSV42_NOPS) +#define NFSV4OP_MKDIR (NFSV42_NOPS + 1) +#define NFSV4OP_RMDIR (NFSV42_NOPS + 2) +#define NFSV4OP_READDIRPLUS (NFSV42_NOPS + 3) +#define NFSV4OP_MKNOD (NFSV42_NOPS + 4) +#define NFSV4OP_FSSTAT (NFSV42_NOPS + 5) +#define NFSV4OP_FSINFO (NFSV42_NOPS + 6) +#define NFSV4OP_PATHCONF (NFSV42_NOPS + 7) +#define NFSV4OP_V3CREATE (NFSV42_NOPS + 8) /* * This is the count of the fake operations listed above. @@ -285,12 +288,12 @@ #define NFSV4OP_CBRECALL 4 /* - * Must be one greater than the last Callback Operation#. + * Must be one greater than the last Callback Operation# for NFSv4.0. */ #define NFSV4OP_CBNOPS 5 /* - * Additional Callback Ops for NFSv4.1 only. Not yet in nfsstats. + * Additional Callback Ops for NFSv4.1 only. */ #define NFSV4OP_CBLAYOUTRECALL 5 #define NFSV4OP_CBNOTIFY 6 @@ -303,6 +306,9 @@ #define NFSV4OP_CBNOTIFYLOCK 13 #define NFSV4OP_CBNOTIFYDEVID 14 +#define NFSV41_CBNOPS 15 +#define NFSV42_CBNOPS 16 + /* * The lower numbers -> 21 are used by NFSv2 and v3. These define higher * numbers used by NFSv4. @@ -360,7 +366,72 @@ #endif /* NFS_V3NPROCS */ /* - * Stats structure + * New stats structure. + * The vers field will be set to NFSSTATS_V1 by the caller. + */ +#define NFSSTATS_V1 1 +struct nfsstatsv1 { + int vers; /* Set to version requested by caller. */ + uint64_t attrcache_hits; + uint64_t attrcache_misses; + uint64_t lookupcache_hits; + uint64_t lookupcache_misses; + uint64_t direofcache_hits; + uint64_t direofcache_misses; + uint64_t accesscache_hits; + uint64_t accesscache_misses; + uint64_t biocache_reads; + uint64_t read_bios; + uint64_t read_physios; + uint64_t biocache_writes; + uint64_t write_bios; + uint64_t write_physios; + uint64_t biocache_readlinks; + uint64_t readlink_bios; + uint64_t biocache_readdirs; + uint64_t readdir_bios; + uint64_t rpccnt[NFSV41_NPROCS + 15]; + uint64_t rpcretries; + uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvrpc_errs; + uint64_t srv_errs; + uint64_t rpcrequests; + uint64_t rpctimeouts; + uint64_t rpcunexpected; + uint64_t rpcinvalid; + uint64_t srvcache_inproghits; + uint64_t srvcache_idemdonehits; + uint64_t srvcache_nonidemdonehits; + uint64_t srvcache_misses; + uint64_t srvcache_tcppeak; + int srvcache_size; /* Updated by atomic_xx_int(). */ + uint64_t srvclients; + uint64_t srvopenowners; + uint64_t srvopens; + uint64_t srvlockowners; + uint64_t srvlocks; + uint64_t srvdelegates; + uint64_t cbrpccnt[NFSV42_CBNOPS]; + uint64_t clopenowners; + uint64_t clopens; + uint64_t cllockowners; + uint64_t cllocks; + uint64_t cldelegates; + uint64_t cllocalopenowners; + uint64_t cllocalopens; + uint64_t cllocallockowners; + uint64_t cllocallocks; + uint64_t srvstartcnt; + uint64_t srvdonecnt; + uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + struct bintime busyfrom; + struct bintime busytime; +}; + +/* + * Old stats structure. */ struct ext_nfsstats { int attrcache_hits; @@ -416,11 +487,6 @@ struct ext_nfsstats { #ifdef _KERNEL /* - * Define the ext_nfsstats as nfsstats for the kernel code. - */ -#define nfsstats ext_nfsstats - -/* * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code. */ #ifndef NFS_NPROCS Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfs/nfsproto.h Fri Aug 12 22:44:59 2016 (r304026) @@ -345,10 +345,10 @@ /* * NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure - * or Operation#. Since the NFS V4 Op #s go higher, use NFSV41_NOPS, which + * or Operation#. Since the NFS V4 Op #s go higher, use NFSV42_NOPS, which * is one greater than the highest Op#. */ -#define NFSPROC_NOOP NFSV41_NOPS +#define NFSPROC_NOOP NFSV42_NOPS /* Actual Version 2 procedure numbers */ #define NFSV2PROC_NULL 0 Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clbio.c Fri Aug 12 22:44:59 2016 (r304026) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include extern int newnfs_directio_allow_mmap; -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern struct mtx ncl_iod_mutex; extern int ncl_numasync; extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; @@ -466,7 +466,7 @@ ncl_bioread(struct vnode *vp, struct uio switch (vp->v_type) { case VREG: - NFSINCRGLOBAL(newnfsstats.biocache_reads); + NFSINCRGLOBAL(nfsstatsv1.biocache_reads); lbn = uio->uio_offset / biosize; on = uio->uio_offset - (lbn * biosize); @@ -543,7 +543,7 @@ ncl_bioread(struct vnode *vp, struct uio n = MIN((unsigned)(bcount - on), uio->uio_resid); break; case VLNK: - NFSINCRGLOBAL(newnfsstats.biocache_readlinks); + NFSINCRGLOBAL(nfsstatsv1.biocache_readlinks); bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td); if (!bp) { error = newnfs_sigintr(nmp, td); @@ -563,7 +563,7 @@ ncl_bioread(struct vnode *vp, struct uio on = 0; break; case VDIR: - NFSINCRGLOBAL(newnfsstats.biocache_readdirs); + NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs); if (np->n_direofoffset && uio->uio_offset >= np->n_direofoffset) { return (0); @@ -992,7 +992,7 @@ ncl_write(struct vop_write_args *ap) } } - NFSINCRGLOBAL(newnfsstats.biocache_writes); + NFSINCRGLOBAL(nfsstatsv1.biocache_writes); lbn = uio->uio_offset / biosize; on = uio->uio_offset - (lbn * biosize); n = MIN((unsigned)(biosize - on), uio->uio_resid); @@ -1606,7 +1606,7 @@ ncl_doio(struct vnode *vp, struct buf *b switch (vp->v_type) { case VREG: uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE; - NFSINCRGLOBAL(newnfsstats.read_bios); + NFSINCRGLOBAL(nfsstatsv1.read_bios); error = ncl_readrpc(vp, uiop, cr); if (!error) { @@ -1641,11 +1641,11 @@ ncl_doio(struct vnode *vp, struct buf *b break; case VLNK: uiop->uio_offset = (off_t)0; - NFSINCRGLOBAL(newnfsstats.readlink_bios); + NFSINCRGLOBAL(nfsstatsv1.readlink_bios); error = ncl_readlinkrpc(vp, uiop, cr); break; case VDIR: - NFSINCRGLOBAL(newnfsstats.readdir_bios); + NFSINCRGLOBAL(nfsstatsv1.readdir_bios); uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ; if ((nmp->nm_flag & NFSMNT_RDIRPLUS) != 0) { error = ncl_readdirplusrpc(vp, uiop, cr, td); @@ -1707,7 +1707,7 @@ ncl_doio(struct vnode *vp, struct buf *b + bp->b_dirtyoff; io.iov_base = (char *)bp->b_data + bp->b_dirtyoff; uiop->uio_rw = UIO_WRITE; - NFSINCRGLOBAL(newnfsstats.write_bios); + NFSINCRGLOBAL(nfsstatsv1.write_bios); if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | B_CLUSTER)) == B_ASYNC) iomode = NFSWRITE_UNSTABLE; Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Aug 12 22:44:59 2016 (r304026) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #ifndef APPLEKEXT #include -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; extern int ncl_mbuf_mlen; extern enum vtype newnv2tov_type[8]; @@ -241,8 +241,8 @@ nfscl_reqstart(struct nfsrv_descript *nd } else { (void) nfsm_fhtom(nd, nfhp, fhlen, 0); } - if (procnum < NFSV4_NPROCS) - NFSINCRGLOBAL(newnfsstats.rpccnt[procnum]); + if (procnum < NFSV41_NPROCS) + NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); } #ifndef APPLE Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clstate.c Fri Aug 12 22:44:59 2016 (r304026) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* * Global variables */ -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern struct nfsreqhead nfsd_reqq; extern u_int32_t newnfs_false, newnfs_true; extern int nfscl_debuglevel; @@ -343,10 +343,10 @@ nfscl_newopen(struct nfsclclient *clp, s nowp->nfsow_defunct = 0; nfscl_lockinit(&nowp->nfsow_rwlock); if (dp != NULL) { - newnfsstats.cllocalopenowners++; + nfsstatsv1.cllocalopenowners++; LIST_INSERT_HEAD(&dp->nfsdl_owner, nowp, nfsow_list); } else { - newnfsstats.clopenowners++; + nfsstatsv1.clopenowners++; LIST_INSERT_HEAD(&clp->nfsc_owner, nowp, nfsow_list); } owp = *owpp = nowp; @@ -380,9 +380,9 @@ nfscl_newopen(struct nfsclclient *clp, s TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, nfsdl_list); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; - newnfsstats.cllocalopens++; + nfsstatsv1.cllocalopens++; } else { - newnfsstats.clopens++; + nfsstatsv1.clopens++; } LIST_INSERT_HEAD(&owp->nfsow_open, nop, nfso_list); *opp = nop; @@ -430,7 +430,7 @@ nfscl_deleg(mount_t mp, struct nfsclclie LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp, nfsdl_hash); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; - newnfsstats.cldelegates++; + nfsstatsv1.cldelegates++; nfscl_delegcnt++; } else { /* @@ -1071,10 +1071,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t LIST_INIT(&nlp->nfsl_lock); if (donelocally) { nlp->nfsl_open = NULL; - newnfsstats.cllocallockowners++; + nfsstatsv1.cllocallockowners++; } else { nlp->nfsl_open = op; - newnfsstats.cllockowners++; + nfsstatsv1.cllockowners++; } LIST_INSERT_HEAD(lhp, nlp, nfsl_list); lp = nlp; @@ -1402,9 +1402,9 @@ nfscl_freeopen(struct nfsclopen *op, int nfscl_freealllocks(&op->nfso_lock, local); FREE((caddr_t)op, M_NFSCLOPEN); if (local) - newnfsstats.cllocalopens--; + nfsstatsv1.cllocalopens--; else - newnfsstats.clopens--; + nfsstatsv1.clopens--; } /* @@ -1483,9 +1483,9 @@ nfscl_freeopenowner(struct nfsclowner *o LIST_REMOVE(owp, nfsow_list); FREE((caddr_t)owp, M_NFSCLOWNER); if (local) - newnfsstats.cllocalopenowners--; + nfsstatsv1.cllocalopenowners--; else - newnfsstats.clopenowners--; + nfsstatsv1.clopenowners--; } /* @@ -1502,9 +1502,9 @@ nfscl_freelockowner(struct nfscllockowne } FREE((caddr_t)lp, M_NFSCLLOCKOWNER); if (local) - newnfsstats.cllocallockowners--; + nfsstatsv1.cllocallockowners--; else - newnfsstats.cllockowners--; + nfsstatsv1.cllockowners--; } /* @@ -1517,9 +1517,9 @@ nfscl_freelock(struct nfscllock *lop, in LIST_REMOVE(lop, nfslo_list); FREE((caddr_t)lop, M_NFSCLLOCK); if (local) - newnfsstats.cllocallocks--; + nfsstatsv1.cllocallocks--; else - newnfsstats.cllocks--; + nfsstatsv1.cllocks--; } /* @@ -1553,7 +1553,7 @@ nfscl_freedeleg(struct nfscldeleghead *h TAILQ_REMOVE(hdp, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); FREE((caddr_t)dp, M_NFSCLDELEG); - newnfsstats.cldelegates--; + nfsstatsv1.cldelegates--; nfscl_delegcnt--; } @@ -1621,18 +1621,18 @@ nfscl_expireclient(struct nfsclclient *c LIST_REMOVE(op, nfso_list); op->nfso_own = towp; LIST_INSERT_HEAD(&towp->nfsow_open, op, nfso_list); - newnfsstats.cllocalopens--; - newnfsstats.clopens++; + nfsstatsv1.cllocalopens--; + nfsstatsv1.clopens++; } } else { /* Just add the openowner to the client list */ LIST_REMOVE(owp, nfsow_list); owp->nfsow_clp = clp; LIST_INSERT_HEAD(&clp->nfsc_owner, owp, nfsow_list); - newnfsstats.cllocalopenowners--; - newnfsstats.clopenowners++; - newnfsstats.cllocalopens--; - newnfsstats.clopens++; + nfsstatsv1.cllocalopenowners--; + nfsstatsv1.clopenowners++; + nfsstatsv1.cllocalopens--; + nfsstatsv1.clopens++; } } owp = nowp; @@ -2282,9 +2282,9 @@ nfscl_insertlock(struct nfscllockowner * else LIST_INSERT_AFTER(insert_lop, new_lop, nfslo_list); if (local) - newnfsstats.cllocallocks++; + nfsstatsv1.cllocallocks++; else - newnfsstats.cllocks++; + nfsstatsv1.cllocks++; } /* @@ -2571,7 +2571,7 @@ tryagain: LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); nfscl_delegcnt--; - newnfsstats.cldelegates--; + nfsstatsv1.cldelegates--; } NFSLOCKCLSTATE(); } @@ -2612,7 +2612,7 @@ tryagain: LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); nfscl_delegcnt--; - newnfsstats.cldelegates--; + nfsstatsv1.cldelegates--; } } dp = ndp; @@ -3215,8 +3215,8 @@ nfscl_docb(struct nfsrv_descript *nd, NF break; } nd->nd_procnum = op; - if (op < NFSV4OP_CBNOPS) - newnfsstats.cbrpccnt[nd->nd_procnum]++; + if (op < NFSV41_CBNOPS) + nfsstatsv1.cbrpccnt[nd->nd_procnum]++; switch (op) { case NFSV4OP_CBGETATTR: NFSCL_DEBUG(4, "cbgetattr\n"); Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clsubs.c Fri Aug 12 22:44:59 2016 (r304026) @@ -83,7 +83,7 @@ extern enum nfsiod_state ncl_iodwant[NFS extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; extern int ncl_numasync; extern unsigned int ncl_iodmax; -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; struct task ncl_nfsiodnew_task; @@ -219,12 +219,12 @@ ncl_getattrcache(struct vnode *vp, struc if ((time_second - np->n_attrstamp) >= timeo && (mustflush != 0 || np->n_attrstamp == 0)) { - newnfsstats.attrcache_misses++; + nfsstatsv1.attrcache_misses++; mtx_unlock(&np->n_mtx); KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } - newnfsstats.attrcache_hits++; + nfsstatsv1.attrcache_hits++; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (np->n_flag & NMODIFIED) { Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Fri Aug 12 22:44:59 2016 (r304026) @@ -78,7 +78,6 @@ FEATURE(nfscl, "NFSv4 client"); extern int nfscl_ticks; extern struct timeval nfsboottime; -extern struct nfsstats newnfsstats; extern int nfsrv_useacl; extern int nfscl_debuglevel; extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Aug 12 22:44:59 2016 (r304026) @@ -100,7 +100,7 @@ uint32_t nfscl_accesscache_load_done_id; #define TRUE 1 #define FALSE 0 -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern int nfsrv_useacl; extern int nfscl_debuglevel; MALLOC_DECLARE(M_NEWNFSREQ); @@ -258,14 +258,6 @@ int newnfs_directio_allow_mmap = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); -#if 0 -SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, - &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count"); - -SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, - &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count"); -#endif - #define NFSACCESS_ALL (NFSACCESS_READ | NFSACCESS_MODIFY \ | NFSACCESS_EXTEND | NFSACCESS_EXECUTE \ | NFSACCESS_DELETE | NFSACCESS_LOOKUP) @@ -418,7 +410,7 @@ nfs_access(struct vop_access_args *ap) if (time_second < (np->n_accesscache[i].stamp + nfsaccess_cache_timeout) && (np->n_accesscache[i].mode & mode) == mode) { - NFSINCRGLOBAL(newnfsstats.accesscache_hits); + NFSINCRGLOBAL(nfsstatsv1.accesscache_hits); gotahit = 1; } break; @@ -437,7 +429,7 @@ nfs_access(struct vop_access_args *ap) /* * Either a no, or a don't know. Go to the wire. */ - NFSINCRGLOBAL(newnfsstats.accesscache_misses); + NFSINCRGLOBAL(nfsstatsv1.accesscache_misses); error = nfs34_access_otw(vp, wmode, ap->a_td, ap->a_cred, &rmode); if (!error && @@ -857,7 +849,7 @@ nfs_getattr(struct vop_getattr_args *ap) if (NFS_ISV34(vp) && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) { - NFSINCRGLOBAL(newnfsstats.accesscache_misses); + NFSINCRGLOBAL(nfsstatsv1.accesscache_misses); nfs34_access_otw(vp, NFSACCESS_ALL, td, ap->a_cred, NULL); if (ncl_getattrcache(vp, ap->a_vap) == 0) { nfscl_deleggetmodtime(vp, &ap->a_vap->va_mtime); @@ -1114,7 +1106,7 @@ nfs_lookup(struct vop_lookup_args *ap) ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==))) { - NFSINCRGLOBAL(newnfsstats.lookupcache_hits); + NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; @@ -1141,7 +1133,7 @@ nfs_lookup(struct vop_lookup_args *ap) if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_mtime, &nctime, ==)) { - NFSINCRGLOBAL(newnfsstats.lookupcache_hits); + NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits); return (ENOENT); } cache_purge_negative(dvp); @@ -1149,7 +1141,7 @@ nfs_lookup(struct vop_lookup_args *ap) error = 0; newvp = NULLVP; - NFSINCRGLOBAL(newnfsstats.lookupcache_misses); + NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses); error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, NULL); @@ -2227,7 +2219,7 @@ nfs_readdir(struct vop_readdir_args *ap) if ((NFS_ISV4(vp) && np->n_change == vattr.va_filerev) || !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { mtx_unlock(&np->n_mtx); - NFSINCRGLOBAL(newnfsstats.direofcache_hits); + NFSINCRGLOBAL(nfsstatsv1.direofcache_hits); if (ap->a_eofflag != NULL) *ap->a_eofflag = 1; return (0); @@ -2254,7 +2246,7 @@ nfs_readdir(struct vop_readdir_args *ap) error = ncl_bioread(vp, uio, 0, ap->a_cred); if (!error && uio->uio_resid == tresid) { - NFSINCRGLOBAL(newnfsstats.direofcache_misses); + NFSINCRGLOBAL(nfsstatsv1.direofcache_misses); if (ap->a_eofflag != NULL) *ap->a_eofflag = 1; } Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Fri Aug 12 22:25:01 2016 (r304025) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Fri Aug 12 22:44:59 2016 (r304026) @@ -159,7 +159,7 @@ __FBSDID("$FreeBSD$"); #ifndef APPLEKEXT #include -extern struct nfsstats newnfsstats; +extern struct nfsstatsv1 nfsstatsv1; extern struct mtx nfsrc_udpmtx; extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; @@ -318,8 +318,8 @@ nfsrvd_initcache(void) TAILQ_INIT(&nfsrvudplru); nfsrc_tcpsavedreplies = 0; nfsrc_udpcachesize = 0; - newnfsstats.srvcache_tcppeak = 0; - newnfsstats.srvcache_size = 0; + nfsstatsv1.srvcache_tcppeak = 0; + nfsstatsv1.srvcache_size = 0; } /* @@ -395,14 +395,14 @@ loop: TAILQ_REMOVE(&nfsrvudplru, rp, rc_lru); TAILQ_INSERT_TAIL(&nfsrvudplru, rp, rc_lru); if (rp->rc_flag & RC_INPROG) { - newnfsstats.srvcache_inproghits++; + nfsstatsv1.srvcache_inproghits++; mtx_unlock(mutex); ret = RC_DROPIT; } else if (rp->rc_flag & RC_REPSTATUS) { /* * V2 only. */ - newnfsstats.srvcache_nonidemdonehits++; + nfsstatsv1.srvcache_nonidemdonehits++; mtx_unlock(mutex); nfsrvd_rephead(nd); *(nd->nd_errp) = rp->rc_status; @@ -410,7 +410,7 @@ loop: rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_UDPTIMEOUT; } else if (rp->rc_flag & RC_REPMBUF) { - newnfsstats.srvcache_nonidemdonehits++; + nfsstatsv1.srvcache_nonidemdonehits++; mtx_unlock(mutex); nd->nd_mreq = m_copym(rp->rc_reply, 0, M_COPYALL, M_WAITOK); @@ -425,8 +425,8 @@ loop: goto out; } } - newnfsstats.srvcache_misses++; - atomic_add_int(&newnfsstats.srvcache_size, 1); + nfsstatsv1.srvcache_misses++; + atomic_add_int(&nfsstatsv1.srvcache_size, 1); nfsrc_udpcachesize++; newrp->rc_flag |= RC_INPROG; @@ -480,7 +480,7 @@ nfsrvd_updatecache(struct nfsrv_descript * Reply from cache is a special case returned by nfsrv_checkseqid(). */ if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { - newnfsstats.srvcache_nonidemdonehits++; + nfsstatsv1.srvcache_nonidemdonehits++; mtx_unlock(mutex); nd->nd_repstat = 0; if (nd->nd_mreq) @@ -519,8 +519,8 @@ nfsrvd_updatecache(struct nfsrv_descript if (!(rp->rc_flag & RC_UDP)) { atomic_add_int(&nfsrc_tcpsavedreplies, 1); if (nfsrc_tcpsavedreplies > - newnfsstats.srvcache_tcppeak) - newnfsstats.srvcache_tcppeak = + nfsstatsv1.srvcache_tcppeak) + nfsstatsv1.srvcache_tcppeak = nfsrc_tcpsavedreplies; } mtx_unlock(mutex); @@ -678,7 +678,7 @@ tryagain: panic("nfs tcp cache0"); rp->rc_flag |= RC_LOCKED; if (rp->rc_flag & RC_INPROG) { - newnfsstats.srvcache_inproghits++; + nfsstatsv1.srvcache_inproghits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -687,7 +687,7 @@ tryagain: /* * V2 only. */ - newnfsstats.srvcache_nonidemdonehits++; + nfsstatsv1.srvcache_nonidemdonehits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -696,7 +696,7 @@ tryagain: *(nd->nd_errp) = rp->rc_status; rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout; } else if (rp->rc_flag & RC_REPMBUF) { - newnfsstats.srvcache_nonidemdonehits++; + nfsstatsv1.srvcache_nonidemdonehits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -711,8 +711,8 @@ tryagain: free((caddr_t)newrp, M_NFSRVCACHE); goto out; } - newnfsstats.srvcache_misses++; - atomic_add_int(&newnfsstats.srvcache_size, 1); + nfsstatsv1.srvcache_misses++; + atomic_add_int(&nfsstatsv1.srvcache_size, 1); /* * For TCP, multiple entries for a key are allowed, so don't @@ -801,7 +801,7 @@ nfsrc_freecache(struct nfsrvcache *rp) atomic_add_int(&nfsrc_tcpsavedreplies, -1); } FREE((caddr_t)rp, M_NFSRVCACHE); - atomic_add_int(&newnfsstats.srvcache_size, -1); + atomic_add_int(&nfsstatsv1.srvcache_size, -1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 12 23:48:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0A49BB72CB for ; Fri, 12 Aug 2016 23:48:30 +0000 (UTC) (envelope-from shurd@freebsd.org) Received: from fed1rmfepo201.cox.net (fed1rmfepo201.cox.net [68.230.241.146]) by mx1.freebsd.org (Postfix) with ESMTP id CAF1F1C4B for ; Fri, 12 Aug 2016 23:48:30 +0000 (UTC) (envelope-from shurd@freebsd.org) Received: from fed1rmimpo306.cox.net ([68.230.241.174]) by fed1rmfepo201.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160812234829.FMNC18419.fed1rmfepo201.cox.net@fed1rmimpo306.cox.net> for ; Fri, 12 Aug 2016 19:48:29 -0400 Received: from [192.168.0.33] ([72.194.73.141]) by fed1rmimpo306.cox.net with cox id WPoU1t00C32uAN001PoV2X; Fri, 12 Aug 2016 19:48:29 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090202.57AE604D.0056, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=FZKXvMK6 c=1 sm=1 tr=0 a=l4Y+EJuLrT/8f1z5FvEQ1g==:117 a=l4Y+EJuLrT/8f1z5FvEQ1g==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=I-6iYQsbzabAn6mO4woA:9 a=QEXdDO2ut3YA:10 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=myhuge@cox.net Subject: Re: svn commit: r304021 - in head/sys: conf kern net sys To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608122129.u7CLTiig028007@repo.freebsd.org> From: Stephen Hurd Message-ID: <57AE604C.7080407@FreeBSD.org> Date: Fri, 12 Aug 2016 16:48:28 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 12 Aug 2016 23:48:31 -0000 Conrad Meyer wrote: > A manual page for gtaskqueue would be nice, if you have time. I'll try to pull something together in the next few days. From owner-svn-src-head@freebsd.org Sat Aug 13 01:49:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B21BB863A; Sat, 13 Aug 2016 01:49:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D411900; Sat, 13 Aug 2016 01:49:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7D1nBQG026948; Sat, 13 Aug 2016 01:49:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7D1nBBE026947; Sat, 13 Aug 2016 01:49:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608130149.u7D1nBBE026947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 13 Aug 2016 01:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304033 - head/lib/libc/tests/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 01:49:13 -0000 Author: ngie Date: Sat Aug 13 01:49:11 2016 New Revision: 304033 URL: https://svnweb.freebsd.org/changeset/base/304033 Log: Increase timeout from 10 minutes to 20 minutes for all tests On particular slow networks, it can (on average) take longer to resolve hosts to IP* addresses. 20 minutes seemed reasonable for my work network This will be solved in a more meaningful way (if possible) using concurrency in the near future MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/resolv/resolv_test.c Modified: head/lib/libc/tests/resolv/resolv_test.c ============================================================================== --- head/lib/libc/tests/resolv/resolv_test.c Sat Aug 13 01:40:08 2016 (r304032) +++ head/lib/libc/tests/resolv/resolv_test.c Sat Aug 13 01:49:11 2016 (r304033) @@ -291,7 +291,7 @@ do { \ ATF_TC(getaddrinfo_test); ATF_TC_HEAD(getaddrinfo_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(getaddrinfo_test, tc) { @@ -301,7 +301,7 @@ ATF_TC_BODY(getaddrinfo_test, tc) ATF_TC(gethostby_test); ATF_TC_HEAD(gethostby_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(gethostby_test, tc) { @@ -312,7 +312,7 @@ ATF_TC_BODY(gethostby_test, tc) ATF_TC(getipnodeby_test); ATF_TC_HEAD(getipnodeby_test, tc) { - atf_tc_set_md_var(tc, "timeout", "450"); + atf_tc_set_md_var(tc, "timeout", "1200"); } ATF_TC_BODY(getipnodeby_test, tc) { From owner-svn-src-head@freebsd.org Sat Aug 13 01:51:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE1D3BB86B5; Sat, 13 Aug 2016 01:51:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A08141B11; Sat, 13 Aug 2016 01:51:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id 52so1344190qtq.3; Fri, 12 Aug 2016 18:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0+qMh0pnAJVa0CwnEClbEAErKAFrS+nqoSiYgPbGXlU=; b=pAkfXPfWAkvz9WqJ65waULFEGoOGiz60WU9lwsseJIPEWHe9rxI+sm2agd8jiZ3lex jy149xFn4Rw8fEODSPP86UowqvUxDBHyfsVYywW9DR10vBxmN12/9wF07De7NkMCdwhJ Vy6CIjek6JF2iFP9OchIHRiTCKE428HDabE3yPEp2GhMqU5WumXk+yUnKxUSg7AOtUT8 ULYQiMwM/SV3O5s6iTenqJISutJRX2JZLs1A6fdh8uf3HZhdE7v90euLk/a/4i5cRaiV G4KTfWwvS9AY+ct31UzdlpmGrMAg31Vhmv80IORFWu3K4uiR8VZXBoNd+kK1aWkgBtz2 DMQg== 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; bh=0+qMh0pnAJVa0CwnEClbEAErKAFrS+nqoSiYgPbGXlU=; b=GVN+7a0Dz6oMbMv8eL1sZLZGYksyrPw2Pr0cMLg7TJzUDik7yejgrcU2fLF95qxWPO uE0q5jqAzBPfuxOnEY4+fHRpw3dGmP9DmeffMudf+upDHJNBiFD5bA3SKrS+Vl0gOz2d 4VT8uMlrRa0trFhJvQnk6I9JNqSvdRXvkroUHWvj7BRQHNA4YbYQ2iQ8dl3gXql6se6Q KegwfrlNzqqZbhq9mgkvJa6ppNxpLwj8YmUzJEFocxRNsrwWyp/uagATb5u0/xl/tfet 85LDJ8lzmYx9hhaBBMfUXa9q9jyCKiNsYlZCdt2od7lbwwCthsJ5lbtA3NnGGDoQcNgJ oYgw== X-Gm-Message-State: AEkoous42q/38CDzqsMCwkhVoO8MA7xDswNsS4w0LSccuf4LQ03txOcclvMJOjFldgyZWWv+d9c6QcERPqF5mQ== X-Received: by 10.200.45.8 with SMTP id n8mr21032485qta.57.1471053063357; Fri, 12 Aug 2016 18:51:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.182.70 with HTTP; Fri, 12 Aug 2016 18:51:02 -0700 (PDT) In-Reply-To: <201608130149.u7D1nBBE026947@repo.freebsd.org> References: <201608130149.u7D1nBBE026947@repo.freebsd.org> From: Ngie Cooper Date: Fri, 12 Aug 2016 18:51:02 -0700 Message-ID: Subject: Re: svn commit: r304033 - head/lib/libc/tests/resolv To: Garrett Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 01:51:05 -0000 On Fri, Aug 12, 2016 at 6:49 PM, Garrett Cooper wrote: > Author: ngie > Date: Sat Aug 13 01:49:11 2016 > New Revision: 304033 > URL: https://svnweb.freebsd.org/changeset/base/304033 > > Log: > Increase timeout from 10 minutes to 20 minutes for all tests Ugh... I meant 7.5 minutes. Sorry >_>... From owner-svn-src-head@freebsd.org Sat Aug 13 02:05:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EE5BBB8AFE; Sat, 13 Aug 2016 02:05:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D381E13DE; Sat, 13 Aug 2016 02:05:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7D257bO034048; Sat, 13 Aug 2016 02:05:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7D257lf034047; Sat, 13 Aug 2016 02:05:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608130205.u7D257lf034047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 13 Aug 2016 02:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304034 - head/lib/libc/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.22 Precedence: list List-Id: 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, 13 Aug 2016 02:05:08 -0000 Author: ngie Date: Sat Aug 13 02:05:06 2016 New Revision: 304034 URL: https://svnweb.freebsd.org/changeset/base/304034 Log: Initialize `ai` to NULL and test for `ai` with type-appropriate values Depending on the address family and ai_flags containing AI_V4MAPPED, it might not do a proper DNS lookup on the provided DNS address Convert some `ai` boolean true/false checks to NULL/non-NULL while here. MFC after: 1 week PR: 211790 Reported by: Herbie.Robinson@stratus.com Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Aug 13 01:49:11 2016 (r304033) +++ head/lib/libc/net/getaddrinfo.c Sat Aug 13 02:05:06 2016 (r304034) @@ -2249,6 +2249,8 @@ _dns_getaddrinfo(void *rv, void *cb_data struct res_target q, q2; res_state res; + ai = NULL; + hostname = va_arg(ap, char *); pai = va_arg(ap, const struct addrinfo *); @@ -2327,16 +2329,16 @@ _dns_getaddrinfo(void *rv, void *cb_data /* prefer IPv6 */ if (q.next) { ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res); - if (ai) { + if (ai != NULL) { cur->ai_next = ai; while (cur && cur->ai_next) cur = cur->ai_next; } } - if (!ai || pai->ai_family != AF_UNSPEC || + if (ai == NULL || pai->ai_family != AF_UNSPEC || (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) + if (ai != NULL) cur->ai_next = ai; } free(buf); From owner-svn-src-head@freebsd.org Sat Aug 13 04:45:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 266F0BB81C1 for ; Sat, 13 Aug 2016 04:45:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCDCD1C4B for ; Sat, 13 Aug 2016 04:45:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id n134so4332748ith.1 for ; Fri, 12 Aug 2016 21:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yMfupWGAt8Lc21JiPebehI5ohxC3Tr1UNZgzbyxD2ws=; b=YTIeeALd0eAc59hHQJKjIxmUsgXGfztd2C37WLgcY84YbKHBE6DmC9rHVgG3hogzrK 6ym+Ivd20mDoZd4k87RIbDNGf89CstjUKhC5hmQdr5z9lVpyUUIzm9SQf1DHk4T71KYS N+HPFX9z/9XhqMkVo9wT9OZlIwdh4ADKm5uRH7UZNYSs/kM9jBA/VeoImDvvNkBFRofr W7KTwTsILLbiY16VNDobVNj5G/DH/hAVJTnxyYRLqmd5Bvi0mBovahbbVrE4TZ11aiKa dtHsMMNfJt6EmGofip6FQZEi2GqqERH1HuPeCsRvhmoxi8829fxg6dXSrUF8lDB2vaZM uwSQ== 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; bh=yMfupWGAt8Lc21JiPebehI5ohxC3Tr1UNZgzbyxD2ws=; b=A41D8X4R3b9Bz+dYaL4f2uIdi7p/BLpAqy/XrUnd02b18SP7VuVdwovA8MjUV7uv0S RJxQFFsGlpdQQ3nEq49bNAu5dSepvPzypSsF8kbIvf/kmOK011uVUepeJARvaPNZ6DiJ gan0jKpCNHwCbXSxVnqjRWxu2jBYWMBJnSh+h1o7reRqCpdlrypZ8iInOZgX0IaY4hif MJN8FI6PzVQymH4MeEiMiqZQx8ivzR62bx8FAPg88XS4YREH+Rxp54u3gM3UgemLrrof MjEmb2Lbrpp6qPLyA4cKHnMz6MiIxhk4H6W2HtVwV2AtTNSIbr+4JbwdN3oUP/UpCZAG eVIw== X-Gm-Message-State: AEkooutumf35bA4UMoJBJ6pa0wSMx+LSi9dYCbdeStirzzUdT1exubaFxNaiXvwZ3NwUuiiUprKIgfV123SEag== X-Received: by 10.36.237.131 with SMTP id r125mr13357ith.32.1471063552201; Fri, 12 Aug 2016 21:45:52 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.105 with HTTP; Fri, 12 Aug 2016 21:45:51 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> From: Warner Losh Date: Fri, 12 Aug 2016 22:45:51 -0600 X-Google-Sender-Auth: IVDHbTuixiTf-hehSHHyskNjyrk Message-ID: Subject: Re: svn commit: r303019 - head/sys/geom To: Ngie Cooper Cc: Bryan Drewery , "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 04:45:53 -0000 On Fri, Aug 12, 2016 at 3:06 PM, Ngie Cooper wrote: > On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery wrote: > > ... > >> No, I was missing r303637. Hard to say if it is related... Andrey says >> it's not. I haven't dived into it yet and it's so far only happened >> once (out of a few tests). We do have various customizations but I'm >> inclined to think it's the stock code having problems. > > I hit it again on our internal vendor tree (what bdrewery was noting > previously). I can provide some details about the panic if need be. Ideally, you'd reproduce it on an unmodified -current. In a vendor tree there's many chances that something else is odd or off that would make it hard for the community to help. Warner From owner-svn-src-head@freebsd.org Sat Aug 13 06:26:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E257FBB8471; Sat, 13 Aug 2016 06:26:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A196F1B1D; Sat, 13 Aug 2016 06:26:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7D6QXh9030529; Sat, 13 Aug 2016 06:26:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7D6QX9l030524; Sat, 13 Aug 2016 06:26:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608130626.u7D6QX9l030524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 13 Aug 2016 06:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304040 - head/tests/sys/acl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 06:26:35 -0000 Author: ngie Date: Sat Aug 13 06:26:33 2016 New Revision: 304040 URL: https://svnweb.freebsd.org/changeset/base/304040 Log: Redirect the output of the testcases to stderr instead of redirecting it to /dev/null This will aid in debugging failures MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/acl/00.sh head/tests/sys/acl/01.sh head/tests/sys/acl/02.sh head/tests/sys/acl/03.sh head/tests/sys/acl/04.sh Modified: head/tests/sys/acl/00.sh ============================================================================== --- head/tests/sys/acl/00.sh Sat Aug 13 06:16:38 2016 (r304039) +++ head/tests/sys/acl/00.sh Sat Aug 13 06:26:33 2016 (r304040) @@ -75,7 +75,7 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-posix.test >&2 if [ $? -eq 0 ]; then echo "ok 3" Modified: head/tests/sys/acl/01.sh ============================================================================== --- head/tests/sys/acl/01.sh Sat Aug 13 06:16:38 2016 (r304039) +++ head/tests/sys/acl/01.sh Sat Aug 13 06:26:33 2016 (r304040) @@ -76,7 +76,7 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2 if [ $? -eq 0 ]; then echo "ok 3" Modified: head/tests/sys/acl/02.sh ============================================================================== --- head/tests/sys/acl/02.sh Sat Aug 13 06:16:38 2016 (r304039) +++ head/tests/sys/acl/02.sh Sat Aug 13 06:26:33 2016 (r304040) @@ -76,9 +76,9 @@ rm xxx echo "ok 2" if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then - perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null + perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2 else - perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null + perl $TESTDIR/run $TESTDIR/tools-nfs4.test >&2 fi if [ $? -eq 0 ]; then Modified: head/tests/sys/acl/03.sh ============================================================================== --- head/tests/sys/acl/03.sh Sat Aug 13 06:16:38 2016 (r304039) +++ head/tests/sys/acl/03.sh Sat Aug 13 06:26:33 2016 (r304040) @@ -89,7 +89,7 @@ echo "ok 3" cd $MNTROOT -perl $TESTDIR/run $TESTDIR/tools-crossfs.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-crossfs.test >&2 if [ $? -eq 0 ]; then echo "ok 4" Modified: head/tests/sys/acl/04.sh ============================================================================== --- head/tests/sys/acl/04.sh Sat Aug 13 06:16:38 2016 (r304039) +++ head/tests/sys/acl/04.sh Sat Aug 13 06:26:33 2016 (r304040) @@ -57,7 +57,7 @@ echo "ok 1" cd $MNT -perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test >&2 if [ $? -eq 0 ]; then echo "ok 2" From owner-svn-src-head@freebsd.org Sat Aug 13 15:41:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03EDFBABE64; Sat, 13 Aug 2016 15:41:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7D5C1F0D; Sat, 13 Aug 2016 15:41:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DFf5kD036160; Sat, 13 Aug 2016 15:41:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DFf4wU036154; Sat, 13 Aug 2016 15:41:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608131541.u7DFf4wU036154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 15:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304041 - in head/sys: conf modules/ipfw 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.22 Precedence: list List-Id: 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, 13 Aug 2016 15:41:06 -0000 Author: ae Date: Sat Aug 13 15:41:04 2016 New Revision: 304041 URL: https://svnweb.freebsd.org/changeset/base/304041 Log: Move logging via BPF support into separate file. * make interface cloner VNET-aware; * simplify cloner code and use if_clone_simple(); * migrate LOGIF_LOCK() to rmlock; * add ipfw_bpf_mtap2() function to pass mbuf to BPF; * introduce new additional ipfwlog0 pseudo interface. It differs from ipfw0 by DLT type used in bpfattach. This interface is intended to used by ipfw modules to dump packets with additional info attached. Currently pflog format is used. ipfw_bpf_mtap2() function uses second argument to determine which interface use for dumping. If dlen is equal to ETHER_HDR_LEN it uses old ipfw0 interface, if dlen is equal to PFLOG_HDRLEN - ipfwlog0 will be used. Obtained from: Yandex LLC Sponsored by: Yandex LLC Added: head/sys/netpfil/ipfw/ip_fw_bpf.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/ipfw/Makefile head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_log.c head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 13 06:26:33 2016 (r304040) +++ head/sys/conf/files Sat Aug 13 15:41:04 2016 (r304041) @@ -3872,6 +3872,7 @@ netpfil/ipfw/ip_dummynet.c optional inet netpfil/ipfw/ip_dn_io.c optional inet dummynet netpfil/ipfw/ip_dn_glue.c optional inet dummynet netpfil/ipfw/ip_fw2.c optional inet ipfirewall +netpfil/ipfw/ip_fw_bpf.c optional inet ipfirewall netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall netpfil/ipfw/ip_fw_eaction.c optional inet ipfirewall netpfil/ipfw/ip_fw_log.c optional inet ipfirewall Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Sat Aug 13 06:26:33 2016 (r304040) +++ head/sys/modules/ipfw/Makefile Sat Aug 13 15:41:04 2016 (r304041) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw -SRCS= ip_fw2.c ip_fw_pfil.c +SRCS= ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c SRCS+= ip_fw_table_value.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sat Aug 13 06:26:33 2016 (r304040) +++ head/sys/netpfil/ipfw/ip_fw2.c Sat Aug 13 15:41:04 2016 (r304041) @@ -2792,6 +2792,7 @@ vnet_ipfw_init(const void *unused) #ifdef LINEAR_SKIPTO ipfw_init_skipto_cache(chain); #endif + ipfw_bpf_init(first); /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ @@ -2810,7 +2811,6 @@ vnet_ipfw_init(const void *unused) * is checked on each packet because there are no pfil hooks. */ V_ip_fw_ctl_ptr = ipfw_ctl3; - ipfw_log_bpf(1); /* init */ error = ipfw_attach_hooks(1); return (error); } @@ -2834,8 +2834,6 @@ vnet_ipfw_uninit(const void *unused) (void)ipfw_attach_hooks(0 /* detach */); V_ip_fw_ctl_ptr = NULL; - ipfw_log_bpf(0); /* uninit */ - last = IS_DEFAULT_VNET(curvnet) ? 1 : 0; IPFW_UH_WLOCK(chain); @@ -2865,6 +2863,7 @@ vnet_ipfw_uninit(const void *unused) ipfw_dyn_uninit(1); /* free the remaining parts */ ipfw_destroy_counters(); ipfw_destroy_obj_rewriter(); + ipfw_bpf_uninit(last); return (0); } Added: head/sys/netpfil/ipfw/ip_fw_bpf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/ipfw/ip_fw_bpf.c Sat Aug 13 15:41:04 2016 (r304041) @@ -0,0 +1,209 @@ +/*- + * Copyright (c) 2016 Yandex LLC + * Copyright (c) 2016 Andrey V. Elsukov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +static VNET_DEFINE(struct ifnet *, log_if); +static VNET_DEFINE(struct ifnet *, pflog_if); +static VNET_DEFINE(struct if_clone *, ipfw_cloner); +static VNET_DEFINE(struct if_clone *, ipfwlog_cloner); +#define V_ipfw_cloner VNET(ipfw_cloner) +#define V_ipfwlog_cloner VNET(ipfwlog_cloner) +#define V_log_if VNET(log_if) +#define V_pflog_if VNET(pflog_if) + +static struct rmlock log_if_lock; +#define LOGIF_LOCK_INIT(x) rm_init(&log_if_lock, "ipfw log_if lock") +#define LOGIF_LOCK_DESTROY(x) rm_destroy(&log_if_lock) +#define LOGIF_RLOCK_TRACKER struct rm_priotracker _log_tracker +#define LOGIF_RLOCK(x) rm_rlock(&log_if_lock, &_log_tracker) +#define LOGIF_RUNLOCK(x) rm_runlock(&log_if_lock, &_log_tracker) +#define LOGIF_WLOCK(x) rm_wlock(&log_if_lock) +#define LOGIF_WUNLOCK(x) rm_wunlock(&log_if_lock) + +static const char ipfwname[] = "ipfw"; +static const char ipfwlogname[] = "ipfwlog"; + +static int +ipfw_bpf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) +{ + + return (EINVAL); +} + +static int +ipfw_bpf_output(struct ifnet *ifp, struct mbuf *m, + const struct sockaddr *dst, struct route *ro) +{ + + if (m != NULL) + FREE_PKT(m); + return (0); +} + +static void +ipfw_clone_destroy(struct ifnet *ifp) +{ + + LOGIF_WLOCK(); + if (ifp->if_hdrlen == ETHER_HDR_LEN) + V_log_if = NULL; + else + V_pflog_if = NULL; + LOGIF_WUNLOCK(); + + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); +} + +static int +ipfw_clone_create(struct if_clone *ifc, int unit, caddr_t params) +{ + struct ifnet *ifp; + + ifp = if_alloc(IFT_PFLOG); + if (ifp == NULL) + return (ENOSPC); + if_initname(ifp, ipfwname, unit); + ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_mtu = 65536; + ifp->if_ioctl = ipfw_bpf_ioctl; + ifp->if_output = ipfw_bpf_output; + ifp->if_hdrlen = ETHER_HDR_LEN; + if_attach(ifp); + bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN); + LOGIF_WLOCK(); + if (V_log_if != NULL) { + LOGIF_WUNLOCK(); + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); + return (EEXIST); + } + V_log_if = ifp; + LOGIF_WUNLOCK(); + return (0); +} + +static int +ipfwlog_clone_create(struct if_clone *ifc, int unit, caddr_t params) +{ + struct ifnet *ifp; + + ifp = if_alloc(IFT_PFLOG); + if (ifp == NULL) + return (ENOSPC); + if_initname(ifp, ipfwlogname, unit); + ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_mtu = 65536; + ifp->if_ioctl = ipfw_bpf_ioctl; + ifp->if_output = ipfw_bpf_output; + ifp->if_hdrlen = PFLOG_HDRLEN; + if_attach(ifp); + bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN); + LOGIF_WLOCK(); + if (V_pflog_if != NULL) { + LOGIF_WUNLOCK(); + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); + return (EEXIST); + } + V_pflog_if = ifp; + LOGIF_WUNLOCK(); + return (0); +} + +void +ipfw_bpf_mtap2(void *data, u_int dlen, struct mbuf *m) +{ + LOGIF_RLOCK_TRACKER; + + LOGIF_RLOCK(); + if (dlen == ETHER_HDR_LEN) { + if (V_log_if == NULL) { + LOGIF_RUNLOCK(); + return; + } + BPF_MTAP2(V_log_if, data, dlen, m); + } else if (dlen == PFLOG_HDRLEN) { + if (V_pflog_if == NULL) { + LOGIF_RUNLOCK(); + return; + } + BPF_MTAP2(V_pflog_if, data, dlen, m); + } + LOGIF_RUNLOCK(); +} + +void +ipfw_bpf_init(int first) +{ + + if (first) { + LOGIF_LOCK_INIT(); + V_log_if = NULL; + V_pflog_if = NULL; + } + V_ipfw_cloner = if_clone_simple(ipfwname, ipfw_clone_create, + ipfw_clone_destroy, 0); + V_ipfwlog_cloner = if_clone_simple(ipfwlogname, ipfwlog_clone_create, + ipfw_clone_destroy, 0); +} + +void +ipfw_bpf_uninit(int last) +{ + + if_clone_detach(V_ipfw_cloner); + if_clone_detach(V_ipfwlog_cloner); + if (last) + LOGIF_LOCK_DESTROY(); +} + Modified: head/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_log.c Sat Aug 13 06:26:33 2016 (r304040) +++ head/sys/netpfil/ipfw/ip_fw_log.c Sat Aug 13 15:41:04 2016 (r304041) @@ -40,20 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include -#include -#include #include /* for ETHERTYPE_IP */ #include #include -#include #include -#include /* for IFT_PFLOG */ -#include /* for BPF */ #include #include @@ -96,155 +90,6 @@ __FBSDID("$FreeBSD$"); #define SNP(buf) buf, sizeof(buf) #endif /* !__APPLE__ */ -#ifdef WITHOUT_BPF -void -ipfw_log_bpf(int onoff) -{ -} -#else /* !WITHOUT_BPF */ -static VNET_DEFINE(struct ifnet *, log_if); /* hook to attach to bpf */ -#define V_log_if VNET(log_if) -static struct rwlock log_if_lock; -#define LOGIF_LOCK_INIT(x) rw_init(&log_if_lock, "ipfw log_if lock") -#define LOGIF_LOCK_DESTROY(x) rw_destroy(&log_if_lock) -#define LOGIF_RLOCK(x) rw_rlock(&log_if_lock) -#define LOGIF_RUNLOCK(x) rw_runlock(&log_if_lock) -#define LOGIF_WLOCK(x) rw_wlock(&log_if_lock) -#define LOGIF_WUNLOCK(x) rw_wunlock(&log_if_lock) - -static const char ipfwname[] = "ipfw"; - -/* we use this dummy function for all ifnet callbacks */ -static int -log_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr) -{ - return EINVAL; -} - -static int -ipfw_log_output(struct ifnet *ifp, struct mbuf *m, - const struct sockaddr *dst, struct route *ro) -{ - if (m != NULL) - FREE_PKT(m); - return EINVAL; -} - -static void -ipfw_log_start(struct ifnet* ifp) -{ - panic("ipfw_log_start() must not be called"); -} - -static const u_char ipfwbroadcastaddr[6] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - -static int -ipfw_log_clone_match(struct if_clone *ifc, const char *name) -{ - - return (strncmp(name, ipfwname, sizeof(ipfwname) - 1) == 0); -} - -static int -ipfw_log_clone_create(struct if_clone *ifc, char *name, size_t len, - caddr_t params) -{ - int error; - int unit; - struct ifnet *ifp; - - error = ifc_name2unit(name, &unit); - if (error) - return (error); - - error = ifc_alloc_unit(ifc, &unit); - if (error) - return (error); - - ifp = if_alloc(IFT_PFLOG); - if (ifp == NULL) { - ifc_free_unit(ifc, unit); - return (ENOSPC); - } - ifp->if_dname = ipfwname; - ifp->if_dunit = unit; - snprintf(ifp->if_xname, IFNAMSIZ, "%s%d", ipfwname, unit); - strlcpy(name, ifp->if_xname, len); - ifp->if_mtu = 65536; - ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_init = (void *)log_dummy; - ifp->if_ioctl = log_dummy; - ifp->if_start = ipfw_log_start; - ifp->if_output = ipfw_log_output; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; - ifp->if_broadcastaddr = ipfwbroadcastaddr; - ifp->if_baudrate = IF_Mbps(10); - - LOGIF_WLOCK(); - if (V_log_if == NULL) - V_log_if = ifp; - else { - LOGIF_WUNLOCK(); - if_free(ifp); - ifc_free_unit(ifc, unit); - return (EEXIST); - } - LOGIF_WUNLOCK(); - if_attach(ifp); - bpfattach(ifp, DLT_EN10MB, 14); - - return (0); -} - -static int -ipfw_log_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) -{ - int unit; - - if (ifp == NULL) - return (0); - - LOGIF_WLOCK(); - if (V_log_if != NULL && ifp == V_log_if) - V_log_if = NULL; - else { - LOGIF_WUNLOCK(); - return (EINVAL); - } - LOGIF_WUNLOCK(); - - unit = ifp->if_dunit; - bpfdetach(ifp); - if_detach(ifp); - if_free(ifp); - ifc_free_unit(ifc, unit); - - return (0); -} - -static VNET_DEFINE(struct if_clone *, ipfw_log_cloner); -#define V_ipfw_log_cloner VNET(ipfw_log_cloner) - -void -ipfw_log_bpf(int onoff) -{ - - if (onoff) { - if (IS_DEFAULT_VNET(curvnet)) - LOGIF_LOCK_INIT(); - V_ipfw_log_cloner = if_clone_advanced(ipfwname, 0, - ipfw_log_clone_match, ipfw_log_clone_create, - ipfw_log_clone_destroy); - } else { - if_clone_detach(V_ipfw_log_cloner); - if (IS_DEFAULT_VNET(curvnet)) - LOGIF_LOCK_DESTROY(); - } -} -#endif /* !WITHOUT_BPF */ - #define TARG(k, f) IP_FW_ARG_TABLEARG(chain, k, f) /* * We enter here when we have a rule with O_LOG. @@ -260,29 +105,23 @@ ipfw_log(struct ip_fw_chain *chain, stru char action2[92], proto[128], fragment[32]; if (V_fw_verbose == 0) { -#ifndef WITHOUT_BPF - LOGIF_RLOCK(); - if (V_log_if == NULL || V_log_if->if_bpf == NULL) { - LOGIF_RUNLOCK(); - return; - } - if (args->eh) /* layer2, use orig hdr */ - BPF_MTAP2(V_log_if, args->eh, ETHER_HDR_LEN, m); + ipfw_bpf_mtap2(args->eh, ETHER_HDR_LEN, m); else { /* Add fake header. Later we will store * more info in the header. */ if (ip->ip_v == 4) - BPF_MTAP2(V_log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); - else if (ip->ip_v == 6) - BPF_MTAP2(V_log_if, "DDDDDDSSSSSS\x86\xdd", ETHER_HDR_LEN, m); + ipfw_bpf_mtap2("DDDDDDSSSSSS\x08\x00", + ETHER_HDR_LEN, m); + else if (ip->ip_v == 6) + ipfw_bpf_mtap2("DDDDDDSSSSSS\x86\xdd", + ETHER_HDR_LEN, m); else /* Obviously bogus EtherType. */ - BPF_MTAP2(V_log_if, "DDDDDDSSSSSS\xff\xff", ETHER_HDR_LEN, m); + ipfw_bpf_mtap2("DDDDDDSSSSSS\xff\xff", + ETHER_HDR_LEN, m); } - LOGIF_RUNLOCK(); -#endif /* !WITHOUT_BPF */ return; } /* the old 'log' function */ Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 13 06:26:33 2016 (r304040) +++ head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 13 15:41:04 2016 (r304041) @@ -154,7 +154,9 @@ void ipfw_nat_destroy(void); /* In ip_fw_log.c */ struct ip; struct ip_fw_chain; -void ipfw_log_bpf(int); +void ipfw_bpf_init(int); +void ipfw_bpf_uninit(int); +void ipfw_bpf_mtap2(void *, u_int, struct mbuf *); void ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u_int hlen, struct ip_fw_args *args, struct mbuf *m, struct ifnet *oif, u_short offset, uint32_t tablearg, struct ip *ip); From owner-svn-src-head@freebsd.org Sat Aug 13 15:48:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8348EBABFA9; Sat, 13 Aug 2016 15:48:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 467391623; Sat, 13 Aug 2016 15:48:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DFmu2q037101; Sat, 13 Aug 2016 15:48:56 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DFmunn037099; Sat, 13 Aug 2016 15:48:56 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608131548.u7DFmunn037099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304043 - 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.22 Precedence: list List-Id: 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, 13 Aug 2016 15:48:57 -0000 Author: ae Date: Sat Aug 13 15:48:56 2016 New Revision: 304043 URL: https://svnweb.freebsd.org/changeset/base/304043 Log: Add three helper function to manage tables from external modules. ipfw_objhash_lookup_table_kidx does lookup kernel index of table; ipfw_ref_table/ipfw_unref_table takes and releases reference to table. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 13 15:48:34 2016 (r304042) +++ head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 13 15:48:56 2016 (r304043) @@ -743,8 +743,12 @@ typedef int (table_lookup_t)(struct tabl int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, uint32_t *val); -int ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, uint16_t plen, - void *paddr, uint32_t *val); +int ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, + uint16_t plen, void *paddr, uint32_t *val); +struct named_object *ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch, + uint16_t kidx); +int ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint16_t *kidx); +void ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx); int ipfw_init_tables(struct ip_fw_chain *ch, int first); int ipfw_resize_tables(struct ip_fw_chain *ch, unsigned int ntables); int ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int nsets); Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Sat Aug 13 15:48:34 2016 (r304042) +++ head/sys/netpfil/ipfw/ip_fw_table.c Sat Aug 13 15:48:56 2016 (r304043) @@ -1602,6 +1602,57 @@ ipfw_resize_tables(struct ip_fw_chain *c } /* + * Lookup table's named object by its @kidx. + */ +struct named_object * +ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch, uint16_t kidx) +{ + + return (ipfw_objhash_lookup_kidx(CHAIN_TO_NI(ch), kidx)); +} + +/* + * Take reference to table specified in @ntlv. + * On success return its @kidx. + */ +int +ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint16_t *kidx) +{ + struct tid_info ti; + struct table_config *tc; + int error; + + IPFW_UH_WLOCK_ASSERT(ch); + + ntlv_to_ti(ntlv, &ti); + error = find_table_err(CHAIN_TO_NI(ch), &ti, &tc); + if (error != 0) + return (error); + + if (tc == NULL) + return (ESRCH); + + tc_ref(tc); + *kidx = tc->no.kidx; + + return (0); +} + +void +ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx) +{ + + struct namedobj_instance *ni; + struct named_object *no; + + IPFW_UH_WLOCK_ASSERT(ch); + ni = CHAIN_TO_NI(ch); + no = ipfw_objhash_lookup_kidx(ni, kidx); + KASSERT(no != NULL, ("Table with index %d not found", kidx)); + no->refcnt--; +} + +/* * Lookup an IP @addr in table @tbl. * Stores found value in @val. * From owner-svn-src-head@freebsd.org Sat Aug 13 15:59:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13260BB84A7; Sat, 13 Aug 2016 15:59:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B81521D6C; Sat, 13 Aug 2016 15:59:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DFxMph040997; Sat, 13 Aug 2016 15:59:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DFxI68040959; Sat, 13 Aug 2016 15:59:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608131559.u7DFxI68040959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 13 Aug 2016 15:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304045 - head/share/timedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 15:59:23 -0000 Author: bapt Date: Sat Aug 13 15:59:18 2016 New Revision: 304045 URL: https://svnweb.freebsd.org/changeset/base/304045 Log: Set date and time formats back to what they were before CLDR While CLDR brings us a good and up to date source data to generate locales for all databses we are using for locales, it is not the case of LC_TIME. Where it does not defines the informations we need. Put back all the date and time formats from the old locales. Make it statically for now (in order to be able to merge it now into 11.0-RELEASE). The generation tools will be updated soon. That gives us time to properly work on LC_TIME during the 12 timeframe. While here fix abbreviated month for af_ZA (which are already fixed in CLDR data upstream) In locales where AP/PM was not defined before CLDR data, remove again the AP/PM informations For locales where AP/PM was defined before CLDR data, keep the CLDR information which was properly translated. MFC after: 3 days Modified: head/share/timedef/af_ZA.UTF-8.src head/share/timedef/am_ET.UTF-8.src head/share/timedef/ar_JO.UTF-8.src head/share/timedef/ar_MA.UTF-8.src head/share/timedef/ar_SA.UTF-8.src head/share/timedef/be_BY.CP1131.src head/share/timedef/be_BY.CP1251.src head/share/timedef/be_BY.ISO8859-5.src head/share/timedef/be_BY.UTF-8.src head/share/timedef/bg_BG.CP1251.src head/share/timedef/bg_BG.UTF-8.src head/share/timedef/ca_IT.ISO8859-15.src head/share/timedef/ca_IT.UTF-8.src head/share/timedef/cs_CZ.ISO8859-2.src head/share/timedef/cs_CZ.UTF-8.src head/share/timedef/da_DK.ISO8859-15.src head/share/timedef/da_DK.UTF-8.src head/share/timedef/de_AT.ISO8859-15.src head/share/timedef/de_AT.UTF-8.src head/share/timedef/de_DE.ISO8859-15.src head/share/timedef/de_DE.UTF-8.src head/share/timedef/el_GR.ISO8859-7.src head/share/timedef/el_GR.UTF-8.src head/share/timedef/en_CA.UTF-8.src head/share/timedef/en_GB.UTF-8.src head/share/timedef/en_IE.UTF-8.src head/share/timedef/en_PH.UTF-8.src head/share/timedef/en_SG.UTF-8.src head/share/timedef/en_US.UTF-8.src head/share/timedef/en_ZA.UTF-8.src head/share/timedef/es_AR.ISO8859-1.src head/share/timedef/es_CR.UTF-8.src head/share/timedef/es_ES.ISO8859-15.src head/share/timedef/es_ES.UTF-8.src head/share/timedef/es_MX.ISO8859-1.src head/share/timedef/es_MX.UTF-8.src head/share/timedef/et_EE.ISO8859-15.src head/share/timedef/eu_ES.UTF-8.src head/share/timedef/fi_FI.ISO8859-15.src head/share/timedef/fi_FI.UTF-8.src head/share/timedef/fr_BE.ISO8859-15.src head/share/timedef/fr_BE.UTF-8.src head/share/timedef/fr_CA.ISO8859-15.src head/share/timedef/fr_CA.UTF-8.src head/share/timedef/fr_CH.ISO8859-15.src head/share/timedef/fr_CH.UTF-8.src head/share/timedef/fr_FR.ISO8859-15.src head/share/timedef/fr_FR.UTF-8.src head/share/timedef/he_IL.UTF-8.src head/share/timedef/hi_IN.ISCII-DEV.src head/share/timedef/hi_IN.UTF-8.src head/share/timedef/hr_HR.ISO8859-2.src head/share/timedef/hr_HR.UTF-8.src head/share/timedef/hu_HU.ISO8859-2.src head/share/timedef/hu_HU.UTF-8.src head/share/timedef/hy_AM.ARMSCII-8.src head/share/timedef/hy_AM.UTF-8.src head/share/timedef/is_IS.ISO8859-15.src head/share/timedef/is_IS.UTF-8.src head/share/timedef/it_CH.ISO8859-15.src head/share/timedef/it_CH.UTF-8.src head/share/timedef/it_IT.ISO8859-15.src head/share/timedef/it_IT.UTF-8.src head/share/timedef/ja_JP.SJIS.src head/share/timedef/ja_JP.UTF-8.src head/share/timedef/ja_JP.eucJP.src head/share/timedef/kk_KZ.UTF-8.src head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src head/share/timedef/lt_LT.ISO8859-13.src head/share/timedef/lt_LT.UTF-8.src head/share/timedef/lv_LV.ISO8859-13.src head/share/timedef/lv_LV.UTF-8.src head/share/timedef/mn_MN.UTF-8.src head/share/timedef/nb_NO.ISO8859-15.src head/share/timedef/nb_NO.UTF-8.src head/share/timedef/nl_BE.UTF-8.src head/share/timedef/nl_NL.UTF-8.src head/share/timedef/nn_NO.ISO8859-15.src head/share/timedef/nn_NO.UTF-8.src head/share/timedef/pl_PL.ISO8859-2.src head/share/timedef/pl_PL.UTF-8.src head/share/timedef/pt_BR.ISO8859-1.src head/share/timedef/pt_BR.UTF-8.src head/share/timedef/pt_PT.ISO8859-15.src head/share/timedef/pt_PT.UTF-8.src head/share/timedef/ro_RO.ISO8859-2.src head/share/timedef/ro_RO.UTF-8.src head/share/timedef/ru_RU.CP1251.src head/share/timedef/ru_RU.CP866.src head/share/timedef/ru_RU.ISO8859-5.src head/share/timedef/ru_RU.KOI8-R.src head/share/timedef/ru_RU.UTF-8.src head/share/timedef/se_FI.UTF-8.src head/share/timedef/se_NO.UTF-8.src head/share/timedef/sk_SK.ISO8859-2.src head/share/timedef/sk_SK.UTF-8.src head/share/timedef/sl_SI.ISO8859-2.src head/share/timedef/sl_SI.UTF-8.src head/share/timedef/sr_RS.ISO8859-2.src head/share/timedef/sr_RS.ISO8859-5.src head/share/timedef/sr_RS.UTF-8.src head/share/timedef/sr_RS.UTF-8@latin.src head/share/timedef/sv_FI.ISO8859-15.src head/share/timedef/sv_SE.ISO8859-15.src head/share/timedef/sv_SE.UTF-8.src head/share/timedef/tr_TR.ISO8859-9.src head/share/timedef/tr_TR.UTF-8.src head/share/timedef/uk_UA.CP1251.src head/share/timedef/uk_UA.ISO8859-5.src head/share/timedef/uk_UA.KOI8-U.src head/share/timedef/uk_UA.UTF-8.src head/share/timedef/zh_CN.GB2312.src head/share/timedef/zh_CN.GBK.src head/share/timedef/zh_CN.UTF-8.src head/share/timedef/zh_CN.eucCN.src head/share/timedef/zh_HK.UTF-8.src head/share/timedef/zh_TW.Big5.src head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/af_ZA.UTF-8.src ============================================================================== --- head/share/timedef/af_ZA.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/af_ZA.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -7,15 +7,15 @@ Jan. Feb. Mrt. -Apr +Apr. Mei -Jun -Jul -Aug -Sep -Okt -Nov -Des +Jun. +Jul. +Aug. +Sep. +Okt. +Nov. +Des. # # Long month names (as in a date) Januarie @@ -50,20 +50,20 @@ Vrydag Saterdag # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%m/%d/%Y # # c_fmt -%d %B %Y %I:%M:%S %p +%a %b %e %X %Y # # AM/PM vm. nm. # # date_fmt -%d %B %Y %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) Januarie Modified: head/share/timedef/am_ET.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ar_JO.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ar_MA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ar_SA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/bg_BG.CP1251.src ============================================================================== --- head/share/timedef/bg_BG.CP1251.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/bg_BG.CP1251.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ %H:%M:%S # # x_fmt -%d.%m.%y г. +%d.%m.%y # # c_fmt -%A %e %B %Y ã. %H:%M:%S +%a %e %b %X %Y # # AM/PM ïð.îá. ñë.îá. # # date_fmt -%A %e %B %Y ã. %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) ÿíóàðè Modified: head/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/ca_IT.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/ca_IT.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/ca_IT.UTF-8.src ============================================================================== --- head/share/timedef/ca_IT.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/ca_IT.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/cs_CZ.ISO8859-2.src ============================================================================== --- head/share/timedef/cs_CZ.ISO8859-2.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/cs_CZ.ISO8859-2.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: head/share/timedef/cs_CZ.UTF-8.src ============================================================================== --- head/share/timedef/cs_CZ.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/cs_CZ.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: head/share/timedef/da_DK.ISO8859-15.src ============================================================================== --- head/share/timedef/da_DK.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/da_DK.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: head/share/timedef/da_DK.UTF-8.src ============================================================================== --- head/share/timedef/da_DK.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/da_DK.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: head/share/timedef/de_AT.ISO8859-15.src ============================================================================== --- head/share/timedef/de_AT.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/de_AT.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: head/share/timedef/de_AT.UTF-8.src ============================================================================== --- head/share/timedef/de_AT.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/de_AT.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: head/share/timedef/de_DE.ISO8859-15.src ============================================================================== --- head/share/timedef/de_DE.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/de_DE.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: head/share/timedef/de_DE.UTF-8.src ============================================================================== --- head/share/timedef/de_DE.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/de_DE.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: head/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/en_CA.UTF-8.src ============================================================================== --- head/share/timedef/en_CA.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_CA.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%d/%m/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_GB.UTF-8.src ============================================================================== --- head/share/timedef/en_GB.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_GB.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%A %e %B %Y at %H:%M:%S +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_IE.UTF-8.src ============================================================================== --- head/share/timedef/en_IE.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_IE.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_PH.UTF-8.src ============================================================================== --- head/share/timedef/en_PH.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_PH.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_SG.UTF-8.src ============================================================================== --- head/share/timedef/en_SG.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_SG.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/en_US.UTF-8.src ============================================================================== --- head/share/timedef/en_US.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_US.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%m/%d/%y +%m/%d/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %b %e %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) January Modified: head/share/timedef/en_ZA.UTF-8.src ============================================================================== --- head/share/timedef/en_ZA.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/en_ZA.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y/%m/%d +%d/%m/%Y # # c_fmt -%d %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%d %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: head/share/timedef/es_AR.ISO8859-1.src ============================================================================== --- head/share/timedef/es_AR.ISO8859-1.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_AR.ISO8859-1.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/es_CR.UTF-8.src ============================================================================== --- head/share/timedef/es_CR.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_CR.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/es_ES.ISO8859-15.src ============================================================================== --- head/share/timedef/es_ES.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_ES.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/es_ES.UTF-8.src ============================================================================== --- head/share/timedef/es_ES.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_ES.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/es_MX.ISO8859-1.src ============================================================================== --- head/share/timedef/es_MX.ISO8859-1.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_MX.ISO8859-1.src Sat Aug 13 15:59:18 2016 (r304045) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names -ene -feb -mar -abr -may -jun -jul -ago -sep -oct -nov -dic +ene. +feb. +mar. +abr. +may. +jun. +jul. +ago. +sep. +oct. +nov. +dic. # # Long month names (as in a date) enero @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/es_MX.UTF-8.src ============================================================================== --- head/share/timedef/es_MX.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/es_MX.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: head/share/timedef/et_EE.ISO8859-15.src ============================================================================== --- head/share/timedef/et_EE.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/et_EE.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ laupäev %H:%M.%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M.%S +%a %d %b %Y %X # # AM/PM AM PM # # date_fmt -%A %e %B %Y %H:%M.%S %Z +%a %d %b %Y %X %Z # # Long month names (without case ending) jaanuar Modified: head/share/timedef/eu_ES.UTF-8.src ============================================================================== --- head/share/timedef/eu_ES.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/eu_ES.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -56,14 +56,14 @@ larunbata %Y/%m/%d # # c_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y - %b - %e %a %X # # AM/PM AM PM # # date_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y(e)ko %B-ren %ea, %X %Z # # Long month names (without case ending) urtarrilak Modified: head/share/timedef/fi_FI.ISO8859-15.src ============================================================================== --- head/share/timedef/fi_FI.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fi_FI.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: head/share/timedef/fi_FI.UTF-8.src ============================================================================== --- head/share/timedef/fi_FI.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fi_FI.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: head/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_BE.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_BE.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_BE.UTF-8.src ============================================================================== --- head/share/timedef/fr_BE.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_BE.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CA.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_CA.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_CA.UTF-8.src ============================================================================== --- head/share/timedef/fr_CA.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_CA.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_CH.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_CH.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_CH.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_CH.UTF-8.src ============================================================================== --- head/share/timedef/fr_CH.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_CH.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_FR.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_FR.ISO8859-15.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_FR.ISO8859-15.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: head/share/timedef/fr_FR.UTF-8.src ============================================================================== --- head/share/timedef/fr_FR.UTF-8.src Sat Aug 13 15:49:46 2016 (r304044) +++ head/share/timedef/fr_FR.UTF-8.src Sat Aug 13 15:59:18 2016 (r304045) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 13 16:09:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 891E0BB86AE; Sat, 13 Aug 2016 16:09:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 400DB154F; Sat, 13 Aug 2016 16:09:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DG9oDb044845; Sat, 13 Aug 2016 16:09:50 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DG9nLe044837; Sat, 13 Aug 2016 16:09:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608131609.u7DG9nLe044837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 16:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 16:09:51 -0000 Author: ae Date: Sat Aug 13 16:09:49 2016 New Revision: 304046 URL: https://svnweb.freebsd.org/changeset/base/304046 Log: Add ipfw_nat64 module that implements stateless and stateful NAT64. The module works together with ipfw(4) and implemented as its external action module. Stateless NAT64 registers external action with name nat64stl. This keyword should be used to create NAT64 instance and to address this instance in rules. Stateless NAT64 uses two lookup tables with mapped IPv4->IPv6 and IPv6->IPv4 addresses to perform translation. A configuration of instance should looks like this: 1. Create lookup tables: # ipfw table T46 create type addr valtype ipv6 # ipfw table T64 create type addr valtype ipv4 2. Fill T46 and T64 tables. 3. Add rule to allow neighbor solicitation and advertisement: # ipfw add allow icmp6 from any to any icmp6types 135,136 4. Create NAT64 instance: # ipfw nat64stl NAT create table4 T46 table6 T64 5. Add rules that matches the traffic: # ipfw add nat64stl NAT ip from any to table(T46) # ipfw add nat64stl NAT ip from table(T64) to 64:ff9b::/96 6. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96 via NAT64 host. Stateful NAT64 registers external action with name nat64lsn. The only one option required to create nat64lsn instance - prefix4. It defines the pool of IPv4 addresses used for translation. A configuration of instance should looks like this: 1. Add rule to allow neighbor solicitation and advertisement: # ipfw add allow icmp6 from any to any icmp6types 135,136 2. Create NAT64 instance: # ipfw nat64lsn NAT create prefix4 A.B.C.D/28 3. Add rules that matches the traffic: # ipfw add nat64lsn NAT ip from any to A.B.C.D/28 # ipfw add nat64lsn NAT ip6 from any to 64:ff9b::/96 4. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96 via NAT64 host. Obtained from: Yandex LLC Relnotes: yes Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D6434 Added: head/sbin/ipfw/nat64lsn.c (contents, props changed) head/sbin/ipfw/nat64stl.c (contents, props changed) head/sys/modules/ipfw_nat64/ head/sys/modules/ipfw_nat64/Makefile (contents, props changed) head/sys/netinet6/ip_fw_nat64.h (contents, props changed) head/sys/netpfil/ipfw/nat64/ head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c (contents, props changed) head/sys/netpfil/ipfw/nat64/ip_fw_nat64.h (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64_translate.c (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64_translate.h (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64lsn.c (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64lsn.h (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64lsn_control.c (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64stl.c (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64stl.h (contents, props changed) head/sys/netpfil/ipfw/nat64/nat64stl_control.c (contents, props changed) Modified: head/sbin/ipfw/Makefile head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/main.c head/sbin/ipfw/tables.c head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile head/sys/netinet/ip_fw.h Modified: head/sbin/ipfw/Makefile ============================================================================== --- head/sbin/ipfw/Makefile Sat Aug 13 15:59:18 2016 (r304045) +++ head/sbin/ipfw/Makefile Sat Aug 13 16:09:49 2016 (r304046) @@ -5,7 +5,7 @@ PACKAGE=ipfw PROG= ipfw SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c tables.c -SRCS+= nptv6.c +SRCS+= nat64lsn.c nat64stl.c nptv6.c WARNS?= 2 .if ${MK_PF} != "no" Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Aug 13 15:59:18 2016 (r304045) +++ head/sbin/ipfw/ipfw.8 Sat Aug 13 16:09:49 2016 (r304046) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2016 +.Dd August 13, 2016 .Dt IPFW 8 .Os .Sh NAME @@ -113,6 +113,37 @@ in-kernel NAT. .Oc .Oc .Ar pathname +.Ss STATEFUL IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION +.Nm +.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm create Ar create-options +.Nm +.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm config Ar config-options +.Nm +.Oo Cm set Ar N Oc Cm nat64lsn +.Brq Ar name | all +.Brq Cm list | show +.Op Cm states +.Nm +.Oo Cm set Ar N Oc Cm nat64lsn +.Brq Ar name | all +.Cm destroy +.Nm +.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm stats Op Cm reset +.Ss STATELESS IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION +.Nm +.Oo Cm set Ar N Oc Cm nat64stl Ar name Cm create Ar create-options +.Nm +.Oo Cm set Ar N Oc Cm nat64stl Ar name Cm config Ar config-options +.Nm +.Oo Cm set Ar N Oc Cm nat64stl +.Brq Ar name | all +.Brq Cm list | show +.Nm +.Oo Cm set Ar N Oc Cm nat64stl +.Brq Ar name | all +.Cm destroy +.Nm +.Oo Cm set Ar N Oc Cm nat64stl Ar name Cm stats Op Cm reset .Ss IPv6-to-IPv6 NETWORK PREFIX TRANSLATION .Nm .Oo Cm set Ar N Oc Cm nptv6 Ar name Cm create Ar create-options @@ -837,6 +868,16 @@ nat instance see the .Sx NETWORK ADDRESS TRANSLATION (NAT) Section for further information. +.It Cm nat64lsn Ar name +Pass packet to a stateful NAT64 instance (for IPv6/IPv4 network address and +protocol translation): see the +.Sx IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION +Section for further information. +.It Cm nat64stl Ar name +Pass packet to a stateless NAT64 instance (for IPv6/IPv4 network address and +protocol translation): see the +.Sx IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION +Section for further information. .It Cm nptv6 Ar name Pass packet to a NPTv6 instance (for IPv6-to-IPv6 network prefix translation): see the @@ -2927,9 +2968,189 @@ instances. See .Sx SYSCTL VARIABLES for more info. +.Sh IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION +.Nm +supports in-kernel IPv6/IPv4 network address and protocol translation. +Stateful NAT64 translation allows IPv6-only clients to contact IPv4 servers +using unicast TCP, UDP or ICMP protocols. +One or more IPv4 addresses assigned to a stateful NAT64 translator are shared +among serveral IPv6-only clients. +When stateful NAT64 is used in conjunction with DNS64, no changes are usually +required in the IPv6 client or the IPv4 server. +The kernel module +.Cm ipfw_nat64 +should be loaded or kernel should have +.Cm options IPFIREWALL_NAT64 +to be able use stateful NAT64 translator. +.Pp +Stateful NAT64 uses a bunch of memory for several types of objects. +When IPv6 client initiates connection, NAT64 translator creates a host entry +in the states table. +Each host entry has a number of ports group entries allocated on demand. +Ports group entries contains connection state entries. +There are several options to control limits and lifetime for these objects. +.Pp +NAT64 translator follows RFC7915 when does ICMPv6/ICMP translation, +unsupported message types will be silently dropped. +IPv6 needs several ICMPv6 message types to be explicitly allowed for correct +operation. +Make sure that ND6 neighbor solicitation (ICMPv6 type 135) and neighbor +advertisement (ICMPv6 type 136) messages will not be handled by translation +rules. +.Pp +After translation NAT64 translator sends packets through corresponding netisr +queue. +Thus translator host should be configured as IPv4 and IPv6 router. +.Pp +Currently both stateful and stateless NAT64 translators use Well-Known IPv6 +Prefix +.Ar 64:ff9b::/96 +to represent IPv4 addresses in the IPv6 address. +Thus DNS64 service and routing should be configured to use Well-Known IPv6 +Prefix. +.Pp +The stateful NAT64 configuration command is the following: +.Bd -ragged -offset indent +.Bk -words +.Cm nat64lsn +.Ar name +.Cm create +.Ar create-options +.Ek +.Ed +.Pp +The following parameters can be configured: +.Bl -tag -width indent +.It Cm prefix4 Ar ipv4_prefix/mask +The IPv4 prefix with mask defines the pool of IPv4 addresses used as +source address after translation. +Stateful NAT64 module translates IPv6 source address of client to one +IPv4 address from this pool. +Note that incoming IPv4 packets that don't have corresponding state entry +in the states table will be dropped by translator. +Make sure that translation rules handle packets, destined to configured prefix. +.It Cm max_ports Ar number +Maximum number of ports reserved for upper level protocols to one IPv6 client. +All reserved ports are divided into chunks between supported protocols. +The number of connections from one IPv6 client is limited by this option. +Note that closed TCP connections still remain in the list of connections until +.Cm tcp_close_age +interval will not expire. +Default value is +.Ar 2048 . +.It Cm host_del_age Ar seconds +The number of seconds until the host entry for a IPv6 client will be deleted +and all its resources will be released due to inactivity. +Default value is +.Ar 3600 . +.It Cm pg_del_age Ar seconds +The number of seconds until a ports group with unused state entries will +be released. +Default value is +.Ar 900 . +.It Cm tcp_syn_age Ar seconds +The number of seconds while a state entry for TCP connection with only SYN +sent will be kept. +If TCP connection establishing will not be finished, +state entry will be deleted. +Default value is +.Ar 10 . +.It Cm tcp_est_age Ar seconds +The number of seconds while a state entry for established TCP connection +will be kept. +Default value is +.Ar 7200 . +.It Cm tcp_close_age Ar seconds +The number of seconds while a state entry for closed TCP connection +will be kept. +Keeping state entries for closed connections is needed, because IPv4 servers +typically keep closed connections in a TIME_WAIT state for a several minutes. +Since translator's IPv4 addresses are shared among all IPv6 clients, +new connections from the same addresses and ports may be rejected by server, +because these connections are still in a TIME_WAIT state. +Keeping them in translator's state table protects from such rejects. +Default value is +.Ar 180 . +.It Cm udp_age Ar seconds +The number of seconds while translator keeps state entry in a waiting for +reply to the sent UDP datagram. +Default value is +.Ar 120 . +.It Cm icmp_age Ar seconds +The number of seconds while translator keeps state entry in a waiting for +reply to the sent ICMP message. +Default value is +.Ar 60 . +.It Cm log +Turn on logging of all handled packets via BPF through +.Ar ipfwlog0 +interface. +.Ar ipfwlog0 +is a pseudo interface and can be created after a boot manually with +.Cm ifconfig +command. +Note that it has different purpose than +.Ar ipfw0 +interface. +Translators sends to BPF an additional information with each packet. +With +.Cm tcpdump +you are able to see each handled packet before and after translation. +.It Cm -log +Turn off logging of all handled packets via BPF. +.El +.Pp +To inspect a states table of stateful NAT64 the following command can be used: +.Bd -ragged -offset indent +.Bk -words +.Cm nat64lsn +.Ar name +.Cm show Cm states +.Ek +.Ed +.Pp +.Pp +Stateless NAT64 translator doesn't use a states table for translation +and converts IPv4 addresses to IPv6 and vice versa solely based on the +mappings taken from configured lookup tables. +Since a states table doesn't used by stateless translator, +it can be configured to pass IPv4 clients to IPv6-only servers. +.Pp +The stateless NAT64 configuration command is the following: +.Bd -ragged -offset indent +.Bk -words +.Cm nat64stl +.Ar name +.Cm create +.Ar create-options +.Ek +.Ed +.Pp +The following parameters can be configured: +.Bl -tag -width indent +.It Cm table4 Ar table46 +The lookup table +.Ar table46 +contains mapping how IPv4 addresses should be translated to IPv6 addresses. +.It Cm table6 Ar table64 +The lookup table +.Ar table64 +contains mapping how IPv6 addresses should be translated to IPv4 addresses. +.It Cm log +Turn on logging of all handled packets via BPF through +.Ar ipfwlog0 +interface. +.It Cm -log +Turn off logging of all handled packets via BPF. +.El +.Pp +Note that the behavior of stateless translator with respect to not matched +packets differs from stateful translator. +If corresponding addresses was not found in the lookup tables, the packet +will not be dropped and the search continues. .Sh IPv6-to-IPv6 NETWORK PREFIX TRANSLATION (NPTv6) .Nm -support in-kernel IPv6-to-IPv6 network prefix translation as described +supports in-kernel IPv6-to-IPv6 network prefix translation as described in RFC6296. The kernel module .Cm ipfw_nptv6 Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sat Aug 13 15:59:18 2016 (r304045) +++ head/sbin/ipfw/ipfw2.c Sat Aug 13 16:09:49 2016 (r304046) @@ -235,6 +235,8 @@ static struct _s_x ether_types[] = { }; static struct _s_x rule_eactions[] = { + { "nat64lsn", TOK_NAT64LSN }, + { "nat64stl", TOK_NAT64STL }, { "nptv6", TOK_NPTV6 }, { NULL, 0 } /* terminator */ }; Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Sat Aug 13 15:59:18 2016 (r304045) +++ head/sbin/ipfw/ipfw2.h Sat Aug 13 16:09:49 2016 (r304046) @@ -254,7 +254,30 @@ enum tokens { TOK_UNLOCK, TOK_VLIST, TOK_OLIST, + + /* NAT64 tokens */ + TOK_NAT64STL, + TOK_NAT64LSN, TOK_STATS, + TOK_STATES, + TOK_CONFIG, + TOK_TABLE4, + TOK_TABLE6, + TOK_PREFIX4, + TOK_PREFIX6, + TOK_AGG_LEN, + TOK_AGG_COUNT, + TOK_MAX_PORTS, + TOK_JMAXLEN, + TOK_PORT_RANGE, + TOK_HOST_DEL_AGE, + TOK_PG_DEL_AGE, + TOK_TCP_SYN_AGE, + TOK_TCP_CLOSE_AGE, + TOK_TCP_EST_AGE, + TOK_UDP_AGE, + TOK_ICMP_AGE, + TOK_LOGOFF, /* NPTv6 tokens */ TOK_NPTV6, @@ -347,6 +370,8 @@ void ipfw_flush(int force); void ipfw_zero(int ac, char *av[], int optname); void ipfw_list(int ac, char *av[], int show_counters); void ipfw_internal_handler(int ac, char *av[]); +void ipfw_nat64lsn_handler(int ac, char *av[]); +void ipfw_nat64stl_handler(int ac, char *av[]); void ipfw_nptv6_handler(int ac, char *av[]); int ipfw_check_object_name(const char *name); @@ -384,7 +409,10 @@ void bp_flush(struct buf_pr *b); /* tables.c */ struct _ipfw_obj_ctlv; +struct _ipfw_obj_ntlv; int table_check_name(const char *tablename); void ipfw_list_ta(int ac, char *av[]); void ipfw_list_values(int ac, char *av[]); +void table_fill_ntlv(struct _ipfw_obj_ntlv *ntlv, const char *name, + uint8_t set, uint16_t uidx); Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Sat Aug 13 15:59:18 2016 (r304045) +++ head/sbin/ipfw/main.c Sat Aug 13 16:09:49 2016 (r304046) @@ -425,6 +425,10 @@ ipfw_main(int oldac, char **oldav) if (co.use_set || try_next) { if (_substrcmp(*av, "delete") == 0) ipfw_delete(av); + else if (!strncmp(*av, "nat64stl", strlen(*av))) + ipfw_nat64stl_handler(ac, av); + else if (!strncmp(*av, "nat64lsn", strlen(*av))) + ipfw_nat64lsn_handler(ac, av); else if (!strncmp(*av, "nptv6", strlen(*av))) ipfw_nptv6_handler(ac, av); else if (_substrcmp(*av, "flush") == 0) Added: head/sbin/ipfw/nat64lsn.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ipfw/nat64lsn.c Sat Aug 13 16:09:49 2016 (r304046) @@ -0,0 +1,854 @@ +/*- + * Copyright (c) 2015-2016 Yandex LLC + * Copyright (c) 2015-2016 Alexander V. Chernikov + * Copyright (c) 2015-2016 Andrey V. Elsukov + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "ipfw2.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static void nat64lsn_fill_ntlv(ipfw_obj_ntlv *ntlv, const char *name, + uint8_t set); +typedef int (nat64lsn_cb_t)(ipfw_nat64lsn_cfg *cfg, const char *name, + uint8_t set); +static int nat64lsn_foreach(nat64lsn_cb_t *f, const char *name, uint8_t set, + int sort); + +static void nat64lsn_create(const char *name, uint8_t set, int ac, char **av); +static void nat64lsn_config(const char *name, uint8_t set, int ac, char **av); +static void nat64lsn_destroy(const char *name, uint8_t set); +static void nat64lsn_stats(const char *name, uint8_t set); +static void nat64lsn_reset_stats(const char *name, uint8_t set); +static int nat64lsn_show_cb(ipfw_nat64lsn_cfg *cfg, const char *name, + uint8_t set); +static int nat64lsn_destroy_cb(ipfw_nat64lsn_cfg *cfg, const char *name, + uint8_t set); +static int nat64lsn_states_cb(ipfw_nat64lsn_cfg *cfg, const char *name, + uint8_t set); + +static struct _s_x nat64cmds[] = { + { "create", TOK_CREATE }, + { "config", TOK_CONFIG }, + { "destroy", TOK_DESTROY }, + { "list", TOK_LIST }, + { "show", TOK_LIST }, + { "stats", TOK_STATS }, + { NULL, 0 } +}; + +static uint64_t +nat64lsn_print_states(void *buf) +{ + char s[INET6_ADDRSTRLEN], a[INET_ADDRSTRLEN], f[INET_ADDRSTRLEN]; + char sflags[4], *sf, *proto; + ipfw_obj_header *oh; + ipfw_obj_data *od; + ipfw_nat64lsn_stg *stg; + ipfw_nat64lsn_state *ste; + uint64_t next_idx; + int i, sz; + + oh = (ipfw_obj_header *)buf; + od = (ipfw_obj_data *)(oh + 1); + stg = (ipfw_nat64lsn_stg *)(od + 1); + sz = od->head.length - sizeof(*od); + next_idx = 0; + while (sz > 0 && next_idx != 0xFF) { + next_idx = stg->next_idx; + sz -= sizeof(*stg); + if (stg->count == 0) { + stg++; + continue; + } + switch (stg->proto) { + case IPPROTO_TCP: + proto = "TCP"; + break; + case IPPROTO_UDP: + proto = "UDP"; + break; + case IPPROTO_ICMPV6: + proto = "ICMPv6"; + break; + } + inet_ntop(AF_INET6, &stg->host6, s, sizeof(s)); + inet_ntop(AF_INET, &stg->alias4, a, sizeof(a)); + ste = (ipfw_nat64lsn_state *)(stg + 1); + for (i = 0; i < stg->count && sz > 0; i++) { + sf = sflags; + inet_ntop(AF_INET, &ste->daddr, f, sizeof(f)); + if (stg->proto == IPPROTO_TCP) { + if (ste->flags & 0x02) + *sf++ = 'S'; + if (ste->flags & 0x04) + *sf++ = 'E'; + if (ste->flags & 0x01) + *sf++ = 'F'; + } + *sf = '\0'; + switch (stg->proto) { + case IPPROTO_TCP: + case IPPROTO_UDP: + printf("%s:%d\t%s:%d\t%s\t%s\t%d\t%s:%d\n", + s, ste->sport, a, ste->aport, proto, + sflags, ste->idle, f, ste->dport); + break; + case IPPROTO_ICMPV6: + printf("%s\t%s\t%s\t\t%d\t%s\n", + s, a, proto, ste->idle, f); + break; + default: + printf("%s\t%s\t%d\t\t%d\t%s\n", + s, a, stg->proto, ste->idle, f); + } + ste++; + sz -= sizeof(*ste); + } + stg = (ipfw_nat64lsn_stg *)ste; + } + return (next_idx); +} + +static int +nat64lsn_states_cb(ipfw_nat64lsn_cfg *cfg, const char *name, uint8_t set) +{ + ipfw_obj_header *oh; + ipfw_obj_data *od; + void *buf; + uint64_t next_idx; + size_t sz; + + if (name != NULL && strcmp(cfg->name, name) != 0) + return (ESRCH); + + if (set != 0 && cfg->set != set) + return (ESRCH); + + next_idx = 0; + sz = 4096; + if ((buf = calloc(1, sz)) == NULL) + err(EX_OSERR, NULL); + do { + oh = (ipfw_obj_header *)buf; + od = (ipfw_obj_data *)(oh + 1); + nat64lsn_fill_ntlv(&oh->ntlv, cfg->name, set); + od->head.type = IPFW_TLV_OBJDATA; + od->head.length = sizeof(*od) + sizeof(next_idx); + *((uint64_t *)(od + 1)) = next_idx; + if (do_get3(IP_FW_NAT64LSN_LIST_STATES, &oh->opheader, &sz)) + err(EX_OSERR, "Error reading nat64lsn states"); + next_idx = nat64lsn_print_states(buf); + sz = 4096; + memset(buf, 0, sz); + } while (next_idx != 0xFF); + + free(buf); + return (0); +} + +static struct _s_x nat64statscmds[] = { + { "reset", TOK_RESET }, + { NULL, 0 } +}; + +static void +ipfw_nat64lsn_stats_handler(const char *name, uint8_t set, int ac, char *av[]) +{ + int tcmd; + + if (ac == 0) { + nat64lsn_stats(name, set); + return; + } + NEED1("nat64lsn stats needs command"); + tcmd = get_token(nat64statscmds, *av, "nat64lsn stats command"); + switch (tcmd) { + case TOK_RESET: + nat64lsn_reset_stats(name, set); + } +} + +static struct _s_x nat64listcmds[] = { + { "states", TOK_STATES }, + { "config", TOK_CONFIG }, + { NULL, 0 } +}; + +static void +ipfw_nat64lsn_list_handler(const char *name, uint8_t set, int ac, char *av[]) +{ + int tcmd; + + if (ac == 0) { + nat64lsn_foreach(nat64lsn_show_cb, name, set, 1); + return; + } + NEED1("nat64lsn list needs command"); + tcmd = get_token(nat64listcmds, *av, "nat64lsn list command"); + switch (tcmd) { + case TOK_STATES: + nat64lsn_foreach(nat64lsn_states_cb, name, set, 1); + break; + case TOK_CONFIG: + nat64lsn_foreach(nat64lsn_show_cb, name, set, 1); + } +} + +/* + * This one handles all nat64lsn-related commands + * ipfw [set N] nat64lsn NAME {create | config} ... + * ipfw [set N] nat64lsn NAME stats + * ipfw [set N] nat64lsn {NAME | all} destroy + * ipfw [set N] nat64lsn {NAME | all} {list | show} [config | states] + */ +#define nat64lsn_check_name table_check_name +void +ipfw_nat64lsn_handler(int ac, char *av[]) +{ + const char *name; + int tcmd; + uint8_t set; + + if (co.use_set != 0) + set = co.use_set - 1; + else + set = 0; + ac--; av++; + + NEED1("nat64lsn needs instance name"); + name = *av; + if (nat64lsn_check_name(name) != 0) { + if (strcmp(name, "all") == 0) + name = NULL; + else + errx(EX_USAGE, "nat64lsn instance name %s is invalid", + name); + } + ac--; av++; + NEED1("nat64lsn needs command"); + + tcmd = get_token(nat64cmds, *av, "nat64lsn command"); + if (name == NULL && tcmd != TOK_DESTROY && tcmd != TOK_LIST) + errx(EX_USAGE, "nat64lsn instance name required"); + switch (tcmd) { + case TOK_CREATE: + ac--; av++; + nat64lsn_create(name, set, ac, av); + break; + case TOK_CONFIG: + ac--; av++; + nat64lsn_config(name, set, ac, av); + break; + case TOK_LIST: + ac--; av++; + ipfw_nat64lsn_list_handler(name, set, ac, av); + break; + case TOK_DESTROY: + if (name == NULL) + nat64lsn_foreach(nat64lsn_destroy_cb, NULL, set, 0); + else + nat64lsn_destroy(name, set); + break; + case TOK_STATS: + ac--; av++; + ipfw_nat64lsn_stats_handler(name, set, ac, av); + } +} + +static void +nat64lsn_fill_ntlv(ipfw_obj_ntlv *ntlv, const char *name, uint8_t set) +{ + + ntlv->head.type = IPFW_TLV_EACTION_NAME(1); /* it doesn't matter */ + ntlv->head.length = sizeof(ipfw_obj_ntlv); + ntlv->idx = 1; + ntlv->set = set; + strlcpy(ntlv->name, name, sizeof(ntlv->name)); +} + +static void +nat64lsn_apply_mask(int af, void *prefix, uint16_t plen) +{ + struct in6_addr mask6, *p6; + struct in_addr mask4, *p4; + + if (af == AF_INET) { + p4 = (struct in_addr *)prefix; + mask4.s_addr = htonl(~((1 << (32 - plen)) - 1)); + p4->s_addr &= mask4.s_addr; + } else if (af == AF_INET6) { + p6 = (struct in6_addr *)prefix; + n2mask(&mask6, plen); + APPLY_MASK(p6, &mask6); + } +} + +static void +nat64lsn_parse_prefix(const char *arg, int af, void *prefix, uint16_t *plen) +{ + char *p, *l; + + p = strdup(arg); + if (p == NULL) + err(EX_OSERR, NULL); + if ((l = strchr(p, '/')) != NULL) + *l++ = '\0'; + if (l == NULL) + errx(EX_USAGE, "Prefix length required"); + if (inet_pton(af, p, prefix) != 1) + errx(EX_USAGE, "Bad prefix: %s", p); + *plen = (uint16_t)strtol(l, &l, 10); + if (*l != '\0' || *plen == 0 || (af == AF_INET && *plen > 32) || + (af == AF_INET6 && *plen > 96)) + errx(EX_USAGE, "Bad prefix length: %s", arg); + nat64lsn_apply_mask(af, prefix, *plen); + free(p); +} + +static uint32_t +nat64lsn_parse_int(const char *arg, const char *desc) +{ + char *p; + uint32_t val; + + val = (uint32_t)strtol(arg, &p, 10); + if (*p != '\0') + errx(EX_USAGE, "Invalid %s value: %s\n", desc, arg); + return (val); +} + +static struct _s_x nat64newcmds[] = { + { "prefix6", TOK_PREFIX6 }, + { "agg_len", TOK_AGG_LEN }, /* not yet */ + { "agg_count", TOK_AGG_COUNT }, /* not yet */ + { "port_range", TOK_PORT_RANGE }, /* not yet */ + { "jmaxlen", TOK_JMAXLEN }, + { "prefix4", TOK_PREFIX4 }, + { "max_ports", TOK_MAX_PORTS }, + { "host_del_age", TOK_HOST_DEL_AGE }, + { "pg_del_age", TOK_PG_DEL_AGE }, + { "tcp_syn_age", TOK_TCP_SYN_AGE }, + { "tcp_close_age",TOK_TCP_CLOSE_AGE }, + { "tcp_est_age", TOK_TCP_EST_AGE }, + { "udp_age", TOK_UDP_AGE }, + { "icmp_age", TOK_ICMP_AGE }, + { "log", TOK_LOG }, + { "-log", TOK_LOGOFF }, + { NULL, 0 } +}; + +/* + * Creates new nat64lsn instance + * ipfw nat64lsn create + * [ max_ports ] + * Request: [ ipfw_obj_lheader ipfw_nat64lsn_cfg ] + */ +#define NAT64LSN_HAS_PREFIX4 0x01 +#define NAT64LSN_HAS_PREFIX6 0x02 +static void +nat64lsn_create(const char *name, uint8_t set, int ac, char **av) +{ + char buf[sizeof(ipfw_obj_lheader) + sizeof(ipfw_nat64lsn_cfg)]; + ipfw_nat64lsn_cfg *cfg; + ipfw_obj_lheader *olh; + int tcmd, flags; + char *opt; + + memset(&buf, 0, sizeof(buf)); + olh = (ipfw_obj_lheader *)buf; + cfg = (ipfw_nat64lsn_cfg *)(olh + 1); + + /* Some reasonable defaults */ + inet_pton(AF_INET6, "64:ff9b::", &cfg->prefix6); + cfg->plen6 = 96; + cfg->set = set; + cfg->max_ports = NAT64LSN_MAX_PORTS; + cfg->jmaxlen = NAT64LSN_JMAXLEN; + cfg->nh_delete_delay = NAT64LSN_HOST_AGE; + cfg->pg_delete_delay = NAT64LSN_PG_AGE; + cfg->st_syn_ttl = NAT64LSN_TCP_SYN_AGE; + cfg->st_estab_ttl = NAT64LSN_TCP_EST_AGE; + cfg->st_close_ttl = NAT64LSN_TCP_FIN_AGE; + cfg->st_udp_ttl = NAT64LSN_UDP_AGE; + cfg->st_icmp_ttl = NAT64LSN_ICMP_AGE; + flags = NAT64LSN_HAS_PREFIX6; + while (ac > 0) { + tcmd = get_token(nat64newcmds, *av, "option"); + opt = *av; + ac--; av++; + + switch (tcmd) { + case TOK_PREFIX4: + NEED1("IPv4 prefix required"); + nat64lsn_parse_prefix(*av, AF_INET, &cfg->prefix4, + &cfg->plen4); + flags |= NAT64LSN_HAS_PREFIX4; + ac--; av++; + break; +#if 0 + case TOK_PREFIX6: + NEED1("IPv6 prefix required"); + nat64lsn_parse_prefix(*av, AF_INET6, &cfg->prefix6, + &cfg->plen6); + ac--; av++; + break; + case TOK_AGG_LEN: + NEED1("Aggregation prefix len required"); + cfg->agg_prefix_len = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; + case TOK_AGG_COUNT: + NEED1("Max per-prefix count required"); + cfg->agg_prefix_max = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; + case TOK_PORT_RANGE: + NEED1("port range x[:y] required"); + if ((p = strchr(*av, ':')) == NULL) + cfg->min_port = (uint16_t)nat64lsn_parse_int( + *av, opt); + else { + *p++ = '\0'; + cfg->min_port = (uint16_t)nat64lsn_parse_int( + *av, opt); + cfg->max_port = (uint16_t)nat64lsn_parse_int( + p, opt); + } + ac--; av++; + break; + case TOK_JMAXLEN: + NEED1("job queue length required"); + cfg->jmaxlen = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; +#endif + case TOK_MAX_PORTS: + NEED1("Max per-user ports required"); + cfg->max_ports = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; + case TOK_HOST_DEL_AGE: + NEED1("host delete delay required"); + cfg->nh_delete_delay = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_PG_DEL_AGE: + NEED1("portgroup delete delay required"); + cfg->pg_delete_delay = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_SYN_AGE: + NEED1("tcp syn age required"); + cfg->st_syn_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_CLOSE_AGE: + NEED1("tcp close age required"); + cfg->st_close_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_EST_AGE: + NEED1("tcp est age required"); + cfg->st_estab_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_UDP_AGE: + NEED1("udp age required"); + cfg->st_udp_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_ICMP_AGE: + NEED1("icmp age required"); + cfg->st_icmp_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_LOG: + cfg->flags |= NAT64_LOG; + break; + case TOK_LOGOFF: + cfg->flags &= ~NAT64_LOG; + break; + } + } + + /* Check validness */ + if ((flags & NAT64LSN_HAS_PREFIX4) != NAT64LSN_HAS_PREFIX4) + errx(EX_USAGE, "prefix4 required"); + + olh->count = 1; + olh->objsize = sizeof(*cfg); + olh->size = sizeof(buf); + strlcpy(cfg->name, name, sizeof(cfg->name)); + if (do_set3(IP_FW_NAT64LSN_CREATE, &olh->opheader, sizeof(buf)) != 0) + err(EX_OSERR, "nat64lsn instance creation failed"); +} + +/* + * Configures existing nat64lsn instance + * ipfw nat64lsn config + * Request: [ ipfw_obj_header ipfw_nat64lsn_cfg ] + */ +static void +nat64lsn_config(const char *name, uint8_t set, int ac, char **av) +{ + char buf[sizeof(ipfw_obj_header) + sizeof(ipfw_nat64lsn_cfg)]; + ipfw_nat64lsn_cfg *cfg; + ipfw_obj_header *oh; + size_t sz; + char *opt; + int tcmd; + + if (ac == 0) + errx(EX_USAGE, "config options required"); + memset(&buf, 0, sizeof(buf)); + oh = (ipfw_obj_header *)buf; + cfg = (ipfw_nat64lsn_cfg *)(oh + 1); + sz = sizeof(buf); + + nat64lsn_fill_ntlv(&oh->ntlv, name, set); + if (do_get3(IP_FW_NAT64LSN_CONFIG, &oh->opheader, &sz) != 0) + err(EX_OSERR, "failed to get config for instance %s", name); + + while (ac > 0) { + tcmd = get_token(nat64newcmds, *av, "option"); + opt = *av; + ac--; av++; + + switch (tcmd) { + case TOK_MAX_PORTS: + NEED1("Max per-user ports required"); + cfg->max_ports = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; + case TOK_JMAXLEN: + NEED1("job queue length required"); + cfg->jmaxlen = nat64lsn_parse_int(*av, opt); + ac--; av++; + break; + case TOK_HOST_DEL_AGE: + NEED1("host delete delay required"); + cfg->nh_delete_delay = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_PG_DEL_AGE: + NEED1("portgroup delete delay required"); + cfg->pg_delete_delay = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_SYN_AGE: + NEED1("tcp syn age required"); + cfg->st_syn_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_CLOSE_AGE: + NEED1("tcp close age required"); + cfg->st_close_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_TCP_EST_AGE: + NEED1("tcp est age required"); + cfg->st_estab_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_UDP_AGE: + NEED1("udp age required"); + cfg->st_udp_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_ICMP_AGE: + NEED1("icmp age required"); + cfg->st_icmp_ttl = (uint16_t)nat64lsn_parse_int( + *av, opt); + ac--; av++; + break; + case TOK_LOG: + cfg->flags |= NAT64_LOG; + break; + case TOK_LOGOFF: + cfg->flags &= ~NAT64_LOG; + break; + default: + errx(EX_USAGE, "Can't change %s option", opt); + } + } + + if (do_set3(IP_FW_NAT64LSN_CONFIG, &oh->opheader, sizeof(buf)) != 0) + err(EX_OSERR, "nat64lsn instance configuration failed"); +} + +/* + * Reset nat64lsn instance statistics specified by @oh->ntlv. + * Request: [ ipfw_obj_header ] + */ +static void +nat64lsn_reset_stats(const char *name, uint8_t set) +{ + ipfw_obj_header oh; + + memset(&oh, 0, sizeof(oh)); + nat64lsn_fill_ntlv(&oh.ntlv, name, set); + if (do_set3(IP_FW_NAT64LSN_RESET_STATS, &oh.opheader, sizeof(oh)) != 0) + err(EX_OSERR, "failed to reset stats for instance %s", name); +} + +/* + * Destroys nat64lsn instance specified by @oh->ntlv. + * Request: [ ipfw_obj_header ] + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 13 16:16:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85ED9BB8859; Sat, 13 Aug 2016 16:16:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475001973; Sat, 13 Aug 2016 16:16:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DGG2Qp048355; Sat, 13 Aug 2016 16:16:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DGG2K9048353; Sat, 13 Aug 2016 16:16:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608131616.u7DGG2K9048353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Aug 2016 16:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304047 - 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.22 Precedence: list List-Id: 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, 13 Aug 2016 16:16:03 -0000 Author: jhibbits Date: Sat Aug 13 16:16:02 2016 New Revision: 304047 URL: https://svnweb.freebsd.org/changeset/base/304047 Log: Add ePAPR boot support for PowerPC book-E (MPC85xx) hardware Summary: u-boot, following the ePAPR specification, puts secondary cores into a spinloop at boot, rather than leaving them shut off. It then relies on the host OS to write the correct values to a special spin table, located in coherent memory (on newer implementations), or noncoherent memory (older implementations). This supports both implementations of ePAPR, as well as continuing to support non-ePAPR booting, by first attempting to use the spintable, and falling back to expecting non-started CPUs. Test Plan: Booted on a P5020 board. Tested before and after the changes. Before the changes, prints the error "SMP: CPU 1 already out of hold-off state!" and panics shortly thereafter. After the changes, same boot method lets it complete boot. Reviewed by: nwhitehorn MFC after: 2 weeks Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D7494 Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Aug 13 16:09:49 2016 (r304046) +++ head/sys/powerpc/booke/locore.S Sat Aug 13 16:16:02 2016 (r304047) @@ -412,6 +412,8 @@ bp_kernload: ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r3 isync + bl zero_mas7 + bl zero_mas8 tlbwe isync msync Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 13 16:09:49 2016 (r304046) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 13 16:16:02 2016 (r304047) @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -63,6 +66,15 @@ extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ extern uint32_t bp_kernload; + +struct cpu_release { + uint32_t entry_h; + uint32_t entry_l; + uint32_t r3_h; + uint32_t r3_l; + uint32_t reserved; + uint32_t pir; +}; #endif extern uint32_t *bootinfo; @@ -316,6 +328,51 @@ mpc85xx_smp_get_bsp(platform_t plat, str return (0); } +#ifdef SMP +static int +mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pcpu *pc) +{ + vm_paddr_t rel_pa, bptr; + volatile struct cpu_release *rel; + vm_offset_t rel_va, rel_page; + phandle_t node; + int i; + + /* If we're calling this, the node already exists. */ + node = OF_finddevice("/cpus"); + for (i = 0, node = OF_child(node); i < pc->pc_cpuid; + i++, node = OF_peer(node)) + ; + if (OF_getencprop(node, "cpu-release-addr", (pcell_t *)&rel_pa, + sizeof(rel_pa)) == -1) { + return (ENOENT); + } + + rel_page = kva_alloc(PAGE_SIZE); + if (rel_page == 0) + return (ENOMEM); + + critical_enter(); + rel_va = rel_page + (rel_pa & PAGE_MASK); + pmap_kenter(rel_page, rel_pa & ~PAGE_MASK); + rel = (struct cpu_release *)rel_va; + bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); + rel->pir = pc->pc_cpuid; __asm __volatile("sync"); + rel->entry_h = (bptr >> 32); + rel->entry_l = bptr; __asm __volatile("sync"); + cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); + if (bootverbose) + printf("Waking up CPU %d via CPU release page %p\n", + pc->pc_cpuid, rel); + critical_exit(); + pmap_kremove(rel_page); + kva_free(rel_page, PAGE_SIZE); + + return (0); +} +#endif + static int mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc) { @@ -325,6 +382,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s int timeout; uintptr_t brr; int cpuid; + int epapr_boot = 0; uint32_t tgt; if (mpc85xx_is_qoriq()) { @@ -342,6 +400,20 @@ mpc85xx_smp_start_cpu(platform_t plat, s cpuid = pc->pc_cpuid + 24; } bp_kernload = kernload; + /* + * bp_kernload is in the boot page. Sync the cache because ePAPR + * booting has the other core(s) already running. + */ + __syncicache(&bp_kernload, sizeof(bp_kernload)); + + ap_pcpu = pc; + __asm __volatile("msync; isync"); + + /* First try the ePAPR way. */ + if (mpc85xx_smp_start_cpu_epapr(plat, pc) == 0) { + epapr_boot = 1; + goto spin_wait; + } reg = ccsr_read4(brr); if ((reg & (1 << cpuid)) != 0) { @@ -350,9 +422,6 @@ mpc85xx_smp_start_cpu(platform_t plat, s return (ENXIO); } - ap_pcpu = pc; - __asm __volatile("msync; isync"); - /* Flush caches to have our changes hit DRAM. */ cpu_flush_dcache(__boot_page, 4096); @@ -413,6 +482,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s ccsr_write4(brr, reg | (1 << cpuid)); __asm __volatile("isync; msync"); +spin_wait: timeout = 500; while (!pc->pc_awake && timeout--) DELAY(1000); /* wait 1ms */ @@ -422,11 +492,13 @@ mpc85xx_smp_start_cpu(platform_t plat, s * address (= 0xfffff000) isn't permanently remapped and thus not * usable otherwise. */ - if (mpc85xx_is_qoriq()) - ccsr_write4(OCP85XX_BSTAR, 0); - else - ccsr_write4(OCP85XX_BPTR, 0); - __asm __volatile("isync; msync"); + if (!epapr_boot) { + if (mpc85xx_is_qoriq()) + ccsr_write4(OCP85XX_BSTAR, 0); + else + ccsr_write4(OCP85XX_BPTR, 0); + __asm __volatile("isync; msync"); + } if (!pc->pc_awake) panic("SMP: CPU %d didn't wake up.\n", pc->pc_cpuid); From owner-svn-src-head@freebsd.org Sat Aug 13 16:26:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E43ABB8C21; Sat, 13 Aug 2016 16:26:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 021F014BD; Sat, 13 Aug 2016 16:26:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DGQGT7052307; Sat, 13 Aug 2016 16:26:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DGQGYR052305; Sat, 13 Aug 2016 16:26:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608131626.u7DGQGYR052305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 16:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304048 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 16:26:17 -0000 Author: ae Date: Sat Aug 13 16:26:15 2016 New Revision: 304048 URL: https://svnweb.freebsd.org/changeset/base/304048 Log: Replace __noinline with special debug macro NAT64NOINLINE. Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Sat Aug 13 16:16:02 2016 (r304047) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Sat Aug 13 16:26:15 2016 (r304048) @@ -77,12 +77,12 @@ nat64_log(struct pfloghdr *logdata, stru ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } #ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT -static __noinline struct sockaddr* nat64_find_route4(struct route *ro, +static NAT64NOINLINE struct sockaddr* nat64_find_route4(struct route *ro, in_addr_t dest, struct mbuf *m); -static __noinline struct sockaddr* nat64_find_route6(struct route_in6 *ro, +static NAT64NOINLINE struct sockaddr* nat64_find_route6(struct route_in6 *ro, struct in6_addr *dest, struct mbuf *m); -static __noinline int +static NAT64NOINLINE int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro, nat64_stats_block *stats, void *logdata) @@ -97,7 +97,7 @@ nat64_output(struct ifnet *ifp, struct m return (error); } -static __noinline int +static NAT64NOINLINE int nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata) { struct route_in6 ro6; @@ -144,7 +144,7 @@ nat64_output_one(struct mbuf *m, nat64_s return (error); } #else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ -static __noinline int +static NAT64NOINLINE int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct route *ro, nat64_stats_block *stats, void *logdata) @@ -176,7 +176,7 @@ nat64_output(struct ifnet *ifp, struct m return (ret); } -static __noinline int +static NAT64NOINLINE int nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata) { @@ -199,7 +199,7 @@ print_ipv6_header(struct ip6_hdr *ip6, c } -static __noinline int +static NAT64NOINLINE int nat64_embed_ip4(struct nat64_cfg *cfg, in_addr_t ia, struct in6_addr *ip6) { @@ -239,7 +239,7 @@ nat64_embed_ip4(struct nat64_cfg *cfg, i return (1); } -static __noinline in_addr_t +static NAT64NOINLINE in_addr_t nat64_extract_ip4(struct in6_addr *ip6, int plen) { in_addr_t ia; @@ -333,7 +333,7 @@ badip6: * IPv6 to IPv4: HC' = cksum_add(HC, result) * IPv4 to IPv6: HC' = cksum_add(HC, ~result) */ -static __noinline uint16_t +static NAT64NOINLINE uint16_t nat64_cksum_convert(struct ip6_hdr *ip6, struct ip *ip) { uint32_t sum; @@ -356,7 +356,7 @@ nat64_cksum_convert(struct ip6_hdr *ip6, #if __FreeBSD_version < 1100000 #define ip_fillid(ip) (ip)->ip_id = ip_newid() #endif -static __noinline void +static NAT64NOINLINE void nat64_init_ip4hdr(const struct ip6_hdr *ip6, const struct ip6_frag *frag, uint16_t plen, uint8_t proto, struct ip *ip) { @@ -386,7 +386,7 @@ nat64_init_ip4hdr(const struct ip6_hdr * } #define FRAGSZ(mtu) ((mtu) - sizeof(struct ip6_hdr) - sizeof(struct ip6_frag)) -static __noinline int +static NAT64NOINLINE int nat64_fragment6(nat64_stats_block *stats, struct ip6_hdr *ip6, struct mbufq *mq, struct mbuf *m, uint32_t mtu, uint16_t ip_id, uint16_t ip_off) { @@ -474,7 +474,7 @@ fail: #define rt_expire rt_rmx.rmx_expire #define rt_mtu rt_rmx.rmx_mtu #endif -static __noinline struct sockaddr* +static NAT64NOINLINE struct sockaddr* nat64_find_route6(struct route_in6 *ro, struct in6_addr *dest, struct mbuf *m) { struct sockaddr_in6 *dst; @@ -503,7 +503,7 @@ nat64_find_route6(struct route_in6 *ro, } #define NAT64_ICMP6_PLEN 64 -static __noinline void +static NAT64NOINLINE void nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint8_t code, uint32_t mtu, nat64_stats_block *stats, void *logdata) { @@ -600,7 +600,7 @@ freeit: m_freem(m); } -static __noinline struct sockaddr* +static NAT64NOINLINE struct sockaddr* nat64_find_route4(struct route *ro, in_addr_t dest, struct mbuf *m) { struct sockaddr_in *dst; @@ -629,7 +629,7 @@ nat64_find_route4(struct route *ro, in_a } #define NAT64_ICMP_PLEN 64 -static __noinline void +static NAT64NOINLINE void nat64_icmp_reflect(struct mbuf *m, uint8_t type, uint8_t code, uint16_t mtu, nat64_stats_block *stats, void *logdata) { @@ -738,7 +738,7 @@ nat64_icmp_handle_echo(struct ip6_hdr *i IPPROTO_ICMPV6, ~icmp6->icmp6_cksum); } -static __noinline struct mbuf * +static NAT64NOINLINE struct mbuf * nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *ip6, uint16_t icmpid, int offset, nat64_stats_block *stats) { Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Sat Aug 13 16:16:02 2016 (r304047) +++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Sat Aug 13 16:26:15 2016 (r304048) @@ -662,7 +662,7 @@ get_next_pg(struct nat64lsn_cfg *cfg, ui return (pg); } -static __noinline struct nat64lsn_portgroup * +static NAT64NOINLINE struct nat64lsn_portgroup * get_first_pg(struct nat64lsn_cfg *cfg, uint32_t *addr, uint8_t *nat_proto, uint16_t *port) { From owner-svn-src-head@freebsd.org Sat Aug 13 16:45:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F30C8BB8001; Sat, 13 Aug 2016 16:45:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6CCA1DEE; Sat, 13 Aug 2016 16:45:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DGjELG059452; Sat, 13 Aug 2016 16:45:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DGjEn1059448; Sat, 13 Aug 2016 16:45:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608131645.u7DGjEn1059448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 16:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304049 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw/nptv6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 16:45:16 -0000 Author: ae Date: Sat Aug 13 16:45:14 2016 New Revision: 304049 URL: https://svnweb.freebsd.org/changeset/base/304049 Log: Add `stats reset` command implementation to NPTv6 module to be able reset statistics counters. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/nptv6.c head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/nptv6/nptv6.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Aug 13 16:26:15 2016 (r304048) +++ head/sbin/ipfw/ipfw.8 Sat Aug 13 16:45:14 2016 (r304049) @@ -156,7 +156,7 @@ in-kernel NAT. .Brq Ar name | all .Cm destroy .Nm -.Oo Cm set Ar N Oc Cm nptv6 Ar name Cm stats +.Oo Cm set Ar N Oc Cm nptv6 Ar name Cm stats Op Cm reset .Ss INTERNAL DIAGNOSTICS .Nm .Cm internal iflist Modified: head/sbin/ipfw/nptv6.c ============================================================================== --- head/sbin/ipfw/nptv6.c Sat Aug 13 16:26:15 2016 (r304048) +++ head/sbin/ipfw/nptv6.c Sat Aug 13 16:45:14 2016 (r304049) @@ -56,6 +56,7 @@ static int nptv6_foreach(nptv6_cb_t *f, static void nptv6_create(const char *name, uint8_t set, int ac, char **av); static void nptv6_destroy(const char *name, uint8_t set); static void nptv6_stats(const char *name, uint8_t set); +static void nptv6_reset_stats(const char *name, uint8_t set); static int nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set); static int nptv6_destroy_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set); @@ -68,10 +69,15 @@ static struct _s_x nptv6cmds[] = { { NULL, 0 } }; +static struct _s_x nptv6statscmds[] = { + { "reset", TOK_RESET }, + { NULL, 0 } +}; + /* * This one handles all NPTv6-related commands * ipfw [set N] nptv6 NAME {create | config} ... - * ipfw [set N] nptv6 NAME stats + * ipfw [set N] nptv6 NAME stats [reset] * ipfw [set N] nptv6 {NAME | all} destroy * ipfw [set N] nptv6 {NAME | all} {list | show} */ @@ -119,7 +125,14 @@ ipfw_nptv6_handler(int ac, char *av[]) nptv6_destroy(name, set); break; case TOK_STATS: - nptv6_stats(name, set); + ac--; av++; + if (ac == 0) { + nptv6_stats(name, set); + break; + } + tcmd = get_token(nptv6statscmds, *av, "stats command"); + if (tcmd == TOK_RESET) + nptv6_reset_stats(name, set); } } @@ -304,6 +317,21 @@ nptv6_stats(const char *name, uint8_t se (uintmax_t)stats.dropped); } +/* + * Reset NPTv6 instance statistics specified by @oh->ntlv. + * Request: [ ipfw_obj_header ] + */ +static void +nptv6_reset_stats(const char *name, uint8_t set) +{ + ipfw_obj_header oh; + + memset(&oh, 0, sizeof(oh)); + nptv6_fill_ntlv(&oh.ntlv, name, set); + if (do_set3(IP_FW_NPTV6_RESET_STATS, &oh.opheader, sizeof(oh)) != 0) + err(EX_OSERR, "failed to reset stats for instance %s", name); +} + static int nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set) { Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Sat Aug 13 16:26:15 2016 (r304048) +++ head/sys/netinet/ip_fw.h Sat Aug 13 16:45:14 2016 (r304049) @@ -130,6 +130,7 @@ typedef struct _ip_fw3_opheader { #define IP_FW_NPTV6_CONFIG 152 /* Modify NPTv6 instance */ #define IP_FW_NPTV6_LIST 153 /* List NPTv6 instances */ #define IP_FW_NPTV6_STATS 154 /* Get NPTv6 instance statistics */ +#define IP_FW_NPTV6_RESET_STATS 155 /* Reset NPTv6 instance statistics */ /* * The kernel representation of ipfw rules is made of a list of Modified: head/sys/netpfil/ipfw/nptv6/nptv6.c ============================================================================== --- head/sys/netpfil/ipfw/nptv6/nptv6.c Sat Aug 13 16:26:15 2016 (r304048) +++ head/sys/netpfil/ipfw/nptv6/nptv6.c Sat Aug 13 16:45:14 2016 (r304049) @@ -700,6 +700,9 @@ nptv6_stats(struct ip_fw_chain *ch, ip_f oh = (ipfw_obj_header *)ipfw_get_sopt_header(sd, sz); if (oh == NULL) return (EINVAL); + if (ipfw_check_object_name_generic(oh->ntlv.name) != 0 || + oh->ntlv.set >= IPFW_MAX_SETS) + return (EINVAL); memset(&stats, 0, sizeof(stats)); IPFW_UH_RLOCK(ch); @@ -722,12 +725,45 @@ nptv6_stats(struct ip_fw_chain *ch, ip_f return (0); } +/* + * Reset NPTv6 statistics. + * Data layout (v0)(current): + * Request: [ ipfw_obj_header ] + * + * Returns 0 on success + */ +static int +nptv6_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op, + struct sockopt_data *sd) +{ + struct nptv6_cfg *cfg; + ipfw_obj_header *oh; + + if (sd->valsize != sizeof(*oh)) + return (EINVAL); + oh = (ipfw_obj_header *)sd->kbuf; + if (ipfw_check_object_name_generic(oh->ntlv.name) != 0 || + oh->ntlv.set >= IPFW_MAX_SETS) + return (EINVAL); + + IPFW_UH_WLOCK(ch); + cfg = nptv6_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set); + if (cfg == NULL) { + IPFW_UH_WUNLOCK(ch); + return (ESRCH); + } + COUNTER_ARRAY_ZERO(cfg->stats, NPTV6STATS); + IPFW_UH_WUNLOCK(ch); + return (0); +} + static struct ipfw_sopt_handler scodes[] = { { IP_FW_NPTV6_CREATE, 0, HDIR_SET, nptv6_create }, { IP_FW_NPTV6_DESTROY,0, HDIR_SET, nptv6_destroy }, { IP_FW_NPTV6_CONFIG, 0, HDIR_BOTH, nptv6_config }, { IP_FW_NPTV6_LIST, 0, HDIR_GET, nptv6_list }, { IP_FW_NPTV6_STATS, 0, HDIR_GET, nptv6_stats }, + { IP_FW_NPTV6_RESET_STATS,0, HDIR_SET, nptv6_reset_stats }, }; static int From owner-svn-src-head@freebsd.org Sat Aug 13 18:10:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89525BB87B5; Sat, 13 Aug 2016 18:10:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BAEC159F; Sat, 13 Aug 2016 18:10:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DIAWgR089122; Sat, 13 Aug 2016 18:10:32 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DIAW1i089121; Sat, 13 Aug 2016 18:10:32 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608131810.u7DIAW1i089121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 13 Aug 2016 18:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304050 - 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.22 Precedence: list List-Id: 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, 13 Aug 2016 18:10:33 -0000 Author: alc Date: Sat Aug 13 18:10:32 2016 New Revision: 304050 URL: https://svnweb.freebsd.org/changeset/base/304050 Log: Eliminate two calls to vm_page_xunbusy() that are both unnecessary and incorrect from the error cases in exec_map_first_page(). They are unnecessary because we automatically unbusy the page in vm_page_free() when we remove it from the object. The calls are incorrect because they happen after the page is freed, so we might actually unbusy the page after it has been reallocated to a different object. (This error was introduced in r292373.) Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Aug 13 16:45:14 2016 (r304049) +++ head/sys/kern/kern_exec.c Sat Aug 13 18:10:32 2016 (r304050) @@ -990,7 +990,6 @@ exec_map_first_page(imgp) vm_page_lock(ma[0]); vm_page_free(ma[0]); vm_page_unlock(ma[0]); - vm_page_xunbusy(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1018,7 +1017,6 @@ exec_map_first_page(imgp) vm_page_lock(ma[i]); vm_page_free(ma[i]); vm_page_unlock(ma[i]); - vm_page_xunbusy(ma[i]); } VM_OBJECT_WUNLOCK(object); return (EIO); From owner-svn-src-head@freebsd.org Sat Aug 13 18:46:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35A30BB8508; Sat, 13 Aug 2016 18:46:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB499181E; Sat, 13 Aug 2016 18:46:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DIkoaU004121; Sat, 13 Aug 2016 18:46:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DIknwl004117; Sat, 13 Aug 2016 18:46:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608131846.u7DIknwl004117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Aug 2016 18:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304051 - in head/sys/powerpc: aim booke 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.22 Precedence: list List-Id: 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, 13 Aug 2016 18:46:51 -0000 Author: jhibbits Date: Sat Aug 13 18:46:49 2016 New Revision: 304051 URL: https://svnweb.freebsd.org/changeset/base/304051 Log: Add a kdb show command to print arbitrary SPRs on PowerPC Summary: There is often a need at the debugger to print arbitrary special purpose registers (SPRs) on PowerPC. Using a rewritable asm stub, print any SPR provided on the command line. Note, as there is no checking in this, attempting to print a nonexistent SPR may cause a Program exception (illegal instruction, or boundedly undefined). Note also that this relies on the kernel text pages being writable. If in the future this is made not the case, this will need to be reworked. Test Plan: Printing the Processor Version Register (PVR, SPR 287): db> show spr 11f SPR 287(11f): 80240012 Differential Revision: https://reviews.freebsd.org/D7403 Modified: head/sys/powerpc/aim/locore.S head/sys/powerpc/booke/locore.S head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/aim/locore.S ============================================================================== --- head/sys/powerpc/aim/locore.S Sat Aug 13 18:10:32 2016 (r304050) +++ head/sys/powerpc/aim/locore.S Sat Aug 13 18:46:49 2016 (r304051) @@ -6,3 +6,10 @@ #include #endif +/* + * XXX: This should be moved to a shared AIM/booke asm file, if one ever is + * created. + */ +ENTRY(get_spr) + mfspr %r3, 0 + blr Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Aug 13 18:10:32 2016 (r304050) +++ head/sys/powerpc/booke/locore.S Sat Aug 13 18:46:49 2016 (r304051) @@ -848,6 +848,14 @@ ENTRY(dataloss_erratum_access) blr +/* + * XXX: This should be moved to a shared AIM/booke asm file, if one ever is + * created. + */ +ENTRY(get_spr) + mfspr %r3, 0 + blr + /************************************************************************/ /* Data section */ /************************************************************************/ Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sat Aug 13 18:10:32 2016 (r304050) +++ head/sys/powerpc/powerpc/machdep.c Sat Aug 13 18:46:49 2016 (r304051) @@ -516,3 +516,31 @@ spinlock_exit(void) } } +/* + * Simple ddb(4) command/hack to view any SPR on the running CPU. + * Uses a trivial asm function to perform the mfspr, and rewrites the mfspr + * instruction each time. + * XXX: Since it uses code modification, it won't work if the kernel code pages + * are marked RO. + */ +extern register_t get_spr(int); + +DB_SHOW_COMMAND(spr, db_show_spr) +{ + register_t spr; + volatile uint32_t *p; + int sprno, saved_sprno; + + if (!have_addr) + return; + + saved_sprno = sprno = (intptr_t) addr; + sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); + p = (uint32_t *)(void *)&get_spr; + *p = (*p & ~0x001ff800) | (sprno << 11); + __syncicache(get_spr, cacheline_size); + spr = get_spr(sprno); + + db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, + (unsigned long)spr); +} From owner-svn-src-head@freebsd.org Sat Aug 13 18:57:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F039BB8830; Sat, 13 Aug 2016 18:57:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5CE21D69; Sat, 13 Aug 2016 18:57:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DIvEwA007748; Sat, 13 Aug 2016 18:57:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DIvEIV007745; Sat, 13 Aug 2016 18:57:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608131857.u7DIvEIV007745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Aug 2016 18:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304052 - in head/sys/powerpc: booke 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.22 Precedence: list List-Id: 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, 13 Aug 2016 18:57:16 -0000 Author: jhibbits Date: Sat Aug 13 18:57:14 2016 New Revision: 304052 URL: https://svnweb.freebsd.org/changeset/base/304052 Log: Add missing pmap_kenter() method for book-e. This isn't added to AIM yet, because it's not yet needed. It's needed for Book-E ePAPR boot support. X-MFC With: r304047 Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Aug 13 18:46:49 2016 (r304051) +++ head/sys/powerpc/booke/pmap.c Sat Aug 13 18:57:14 2016 (r304052) @@ -385,7 +385,7 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_kenter, mmu_booke_kenter), MMUMETHOD(mmu_kenter_attr, mmu_booke_kenter_attr), MMUMETHOD(mmu_kextract, mmu_booke_kextract), -/* MMUMETHOD(mmu_kremove, mmu_booke_kremove), */ + MMUMETHOD(mmu_kremove, mmu_booke_kremove), MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), MMUMETHOD(mmu_change_attr, mmu_booke_change_attr), Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Sat Aug 13 18:46:49 2016 (r304051) +++ head/sys/powerpc/powerpc/mmu_if.m Sat Aug 13 18:57:14 2016 (r304052) @@ -870,6 +870,16 @@ METHOD void kenter_attr { } DEFAULT mmu_null_kenter_attr; /** + * @brief Unmap a wired page from kernel virtual address space + * + * @param _va mapped virtual address + */ +METHOD void kremove { + mmu_t _mmu; + vm_offset_t _va; +}; + +/** * @brief Determine if the given physical address range has been direct-mapped. * * @param _pa physical address start Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sat Aug 13 18:46:49 2016 (r304051) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sat Aug 13 18:57:14 2016 (r304052) @@ -510,6 +510,14 @@ pmap_kenter_attr(vm_offset_t va, vm_offs MMU_KENTER_ATTR(mmu_obj, va, pa, ma); } +void +pmap_kremove(vm_offset_t va) +{ + + CTR2(KTR_PMAP, "%s(%#x)", __func__, va); + return (MMU_KREMOVE(mmu_obj, va)); +} + boolean_t pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size) { From owner-svn-src-head@freebsd.org Sat Aug 13 18:59:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 595A7BB88DC; Sat, 13 Aug 2016 18:59:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 219BB1EE1; Sat, 13 Aug 2016 18:59:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x230.google.com with SMTP id 38so51629913iol.0; Sat, 13 Aug 2016 11:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZmWKe0055qTTd5cizuK1SUXRPbMfxjponOCn+cHlfMY=; b=XKzWUFc/8HaFkZz9IVtKIQsSf4l18/XWyx7/M4xDP0o6G3zheRGBSMc4aXfvb1Ksfi /C4iM+l6WeN+cvHOVu8r7De476hBA4d1T4KkwcIiFFdLNmV8CBG9yHI9phPzZlEJYln8 QRyhvHc9grI9KFxH1pzME8jYXWvUXk8W4TJhwKL6yv0EU+MY4FIncItmoH/GlgIYVZa6 Rboe7kh/hCqUh71/826UdH9jNvC6CrWxlJwGKKPYzNUFsbcAnCZXbu68el9Lo51BqmEk 65XhFcjDvezM8Cg6awUPq7AdtMz3Sm9MzIvecnGsbzoj/fe8C58hQ7CClJp9e0tCHqKP 7WmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZmWKe0055qTTd5cizuK1SUXRPbMfxjponOCn+cHlfMY=; b=IuC2Njkg3Y8O5NPfLbcuJkUXlYxRmOEpwgpq34NeF/W5mk/AkEV2/K2gmjmLqwr1yS BsIn5fZvjj5vV97EFjKh6ajoyRYyTOHvYEtDYxGj8yv8T84yrx5kil0qHKMiBsqMYqOp vgxpkJlC60jL34AQu7nNbdpOvbZ2XLHqofsa/UCFzowudFA2Nnr12TaSQ07TA8Je4EUb hZKHq3bdf1FducGz444OtMj5hBY0EvY6QjIluDDsW2cWF+bp4TlnQqLl1k/udTIQHnBy nDQYfQeZOlMuro01DeHmUviDPMJ72uW9IShL95nsXRNtyTfgXCYR8igH9LUzSld+FAG9 0XCw== X-Gm-Message-State: AEkoouvhyb7B3JWpABKb39bHFtF8W3rKXbWTqi1WNWzzcILzf632zT9vg4Uy90mdXsuBUA== X-Received: by 10.107.6.21 with SMTP id 21mr24575796iog.142.1471114741148; Sat, 13 Aug 2016 11:59:01 -0700 (PDT) Received: from zhabar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id c139sm3651251itc.17.2016.08.13.11.59.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Aug 2016 11:59:00 -0700 (PDT) Sender: Justin Hibbits Date: Sat, 13 Aug 2016 13:57:12 -0500 From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304052 - in head/sys/powerpc: booke powerpc Message-ID: <20160813135712.5b44502f@zhabar.knownspace> In-Reply-To: <201608131857.u7DIvEIV007745@repo.freebsd.org> References: <201608131857.u7DIvEIV007745@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; powerpc64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 18:59:02 -0000 On Sat, 13 Aug 2016 18:57:14 +0000 (UTC) Justin Hibbits wrote: > Author: jhibbits > Date: Sat Aug 13 18:57:14 2016 > New Revision: 304052 > URL: https://svnweb.freebsd.org/changeset/base/304052 > > Log: > Add missing pmap_kenter() method for book-e. This should obviously be pmap_kremove(). - Justin From owner-svn-src-head@freebsd.org Sat Aug 13 19:33:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9F8DBB92EF; Sat, 13 Aug 2016 19:33:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7021EE3; Sat, 13 Aug 2016 19:33:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7DJXJZE033196 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Aug 2016 22:33:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7DJXJZE033196 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7DJXJGC033195; Sat, 13 Aug 2016 22:33:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Aug 2016 22:33:19 +0300 From: Konstantin Belousov To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64 Message-ID: <20160813193319.GD83214@kib.kiev.ua> References: <201608131609.u7DG9nLe044837@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608131609.u7DG9nLe044837@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 19:33:25 -0000 On Sat, Aug 13, 2016 at 04:09:49PM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Sat Aug 13 16:09:49 2016 > New Revision: 304046 > URL: https://svnweb.freebsd.org/changeset/base/304046 > > Log: > Add ipfw_nat64 module that implements stateless and stateful NAT64. --- all_subdir_ipfw_nat64 --- /usr/home/kostik/work/build/bsd/DEV/src/sys/modules/ipfw_nat64/../../netpfil/ipfw/nat64/nat64lsn_control.c:737:7: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] next_idx, addr, cfg->pmask4); ^~~~~~~~ From owner-svn-src-head@freebsd.org Sat Aug 13 19:48:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542FFBB9500; Sat, 13 Aug 2016 19:48:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1983A1537; Sat, 13 Aug 2016 19:48:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DJmhDu025781; Sat, 13 Aug 2016 19:48:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DJmh2I025780; Sat, 13 Aug 2016 19:48:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608131948.u7DJmh2I025780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 13 Aug 2016 19:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304053 - 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.22 Precedence: list List-Id: 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, 13 Aug 2016 19:48:44 -0000 Author: markj Date: Sat Aug 13 19:48:43 2016 New Revision: 304053 URL: https://svnweb.freebsd.org/changeset/base/304053 Log: Initialize page busy lock state in vm_phys_add_page(). MFC after: 1 week Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sat Aug 13 18:57:14 2016 (r304052) +++ head/sys/vm/vm_phys.c Sat Aug 13 19:48:43 2016 (r304053) @@ -741,6 +741,7 @@ vm_phys_add_page(vm_paddr_t pa) vm_cnt.v_page_count++; m = vm_phys_paddr_to_vm_page(pa); + m->busy_lock = VPB_UNBUSIED; m->phys_addr = pa; m->queue = PQ_NONE; m->segind = vm_phys_paddr_to_segind(pa); From owner-svn-src-head@freebsd.org Sat Aug 13 19:49:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC39BB954F; Sat, 13 Aug 2016 19:49:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E261616D6; Sat, 13 Aug 2016 19:49:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DJnXiU025858; Sat, 13 Aug 2016 19:49:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DJnXTh025857; Sat, 13 Aug 2016 19:49:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608131949.u7DJnXTh025857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 13 Aug 2016 19:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304054 - 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.22 Precedence: list List-Id: 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, 13 Aug 2016 19:49:34 -0000 Author: markj Date: Sat Aug 13 19:49:32 2016 New Revision: 304054 URL: https://svnweb.freebsd.org/changeset/base/304054 Log: Strengthen assertions about the busy state of newly-allocated pages. Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Aug 13 19:48:43 2016 (r304053) +++ head/sys/vm/vm_page.c Sat Aug 13 19:49:32 2016 (r304054) @@ -1712,8 +1712,7 @@ vm_page_alloc(vm_object_t object, vm_pin ("vm_page_alloc: page %p has unexpected queue %d", m, m->queue)); KASSERT(m->wire_count == 0, ("vm_page_alloc: page %p is wired", m)); KASSERT(m->hold_count == 0, ("vm_page_alloc: page %p is held", m)); - KASSERT(!vm_page_sbusied(m), - ("vm_page_alloc: page %p is busy", m)); + KASSERT(!vm_page_busied(m), ("vm_page_alloc: page %p is busy", m)); KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("vm_page_alloc: page %p has unexpected memattr %d", m, @@ -2021,7 +2020,7 @@ vm_page_alloc_init(vm_page_t m) ("vm_page_alloc_init: page %p is wired", m)); KASSERT(m->hold_count == 0, ("vm_page_alloc_init: page %p is held", m)); - KASSERT(!vm_page_sbusied(m), + KASSERT(!vm_page_busied(m), ("vm_page_alloc_init: page %p is busy", m)); KASSERT(m->dirty == 0, ("vm_page_alloc_init: page %p is dirty", m)); From owner-svn-src-head@freebsd.org Sat Aug 13 19:51:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3AF3BB95A9; Sat, 13 Aug 2016 19:51:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3CFE199B; Sat, 13 Aug 2016 19:51:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DJp0V7026754; Sat, 13 Aug 2016 19:51:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DJp0OH026752; Sat, 13 Aug 2016 19:51:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608131951.u7DJp0OH026752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 13 Aug 2016 19:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304055 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 19:51:02 -0000 Author: markj Date: Sat Aug 13 19:51:00 2016 New Revision: 304055 URL: https://svnweb.freebsd.org/changeset/base/304055 Log: Fix handling of forward enum declarations in the CTF tools. Reported by: mmacy MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Aug 13 19:49:32 2016 (r304054) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Aug 13 19:51:00 2016 (r304055) @@ -816,6 +816,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d Dwarf_Unsigned uval; Dwarf_Signed sval; + if (die_isdecl(dw, die)) { + tdp->t_type = FORWARD; + return; + } + debug(3, "die %llu: creating enum\n", off); tdp->t_type = ENUM; Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sat Aug 13 19:49:32 2016 (r304054) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sat Aug 13 19:51:00 2016 (r304055) @@ -338,7 +338,8 @@ fwd_equiv(tdesc_t *ctdp, tdesc_t *mtdp) { tdesc_t *defn = (ctdp->t_type == FORWARD ? mtdp : ctdp); - return (defn->t_type == STRUCT || defn->t_type == UNION); + return (defn->t_type == STRUCT || defn->t_type == UNION || + defn->t_type == ENUM); } static int From owner-svn-src-head@freebsd.org Sat Aug 13 20:14:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D11BBB8115; Sat, 13 Aug 2016 20:14:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B02791E26; Sat, 13 Aug 2016 20:14:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DKEj7M036980; Sat, 13 Aug 2016 20:14:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DKEjuk036979; Sat, 13 Aug 2016 20:14:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201608132014.u7DKEjuk036979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 13 Aug 2016 20:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304058 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 20:14:46 -0000 Author: rmacklem Date: Sat Aug 13 20:14:44 2016 New Revision: 304058 URL: https://svnweb.freebsd.org/changeset/base/304058 Log: Update nfsstat.c to use the new kernel nfsstat structure and add the new "-d" flag from D1626. The man page will be updated in a subsequent commit. Submitted by: will (earlier version) Reviewed by: ken MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D1626 Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sat Aug 13 19:57:36 2016 (r304057) +++ head/usr.bin/nfsstat/nfsstat.c Sat Aug 13 20:14:44 2016 (r304058) @@ -29,6 +29,36 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +/*- + * Copyright (c) 2004, 2008, 2009 Silicon Graphics International Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + #ifndef lint static const char copyright[] = @@ -64,33 +94,57 @@ static const char rcsid[] = #include #include #include +#include #include #include #include +#include #include static int widemode = 0; static int zflag = 0; static int printtitle = 1; -static struct ext_nfsstats ext_nfsstats; +static struct nfsstatsv1 ext_nfsstats; static int extra_output = 0; static void intpr(int, int); -static void printhdr(int, int); +static void printhdr(int, int, int); static void usage(void); static char *sperc1(int, int); static char *sperc2(int, int); static void exp_intpr(int, int); -static void exp_sidewaysintpr(u_int, int, int); +static void exp_sidewaysintpr(u_int, int, int, int); +static void compute_new_stats(struct nfsstatsv1 *cur_stats, + struct nfsstatsv1 *prev_stats, int curop, long double etime, + long double *mbsec, long double *kb_per_transfer, + long double *transfers_per_second, long double *ms_per_transfer, + uint64_t *queue_len, long double *busy_pct); #define DELTA(field) (nfsstats.field - lastst.field) +#define STAT_TYPE_READ 0 +#define STAT_TYPE_WRITE 1 +#define STAT_TYPE_COMMIT 2 +#define NUM_STAT_TYPES 3 + +struct stattypes { + int stat_type; + int nfs_type; +} static statstruct[] = { + {STAT_TYPE_READ, NFSV4OP_READ}, + {STAT_TYPE_WRITE, NFSV4OP_WRITE}, + {STAT_TYPE_COMMIT, NFSV4OP_COMMIT} +}; + +#define STAT_TYPE_TO_NFS(stat_type) statstruct[stat_type].nfs_type + int main(int argc, char **argv) { u_int interval; int clientOnly = -1; int serverOnly = -1; + int newStats = 0; int ch; char *memf, *nlistf; int mntlen, i; @@ -100,7 +154,7 @@ main(int argc, char **argv) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "cesWM:mN:w:z")) != -1) + while ((ch = getopt(argc, argv, "cdesWM:mN:w:z")) != -1) switch(ch) { case 'M': memf = optarg; @@ -140,6 +194,11 @@ main(int argc, char **argv) if (serverOnly < 0) serverOnly = 0; break; + case 'd': + newStats = 1; + if (interval == 0) + interval = 1; + break; case 's': serverOnly = 1; if (clientOnly < 0) @@ -173,7 +232,8 @@ main(int argc, char **argv) errx(1, "NFS client/server not loaded"); if (interval) { - exp_sidewaysintpr(interval, clientOnly, serverOnly); + exp_sidewaysintpr(interval, clientOnly, serverOnly, + newStats); } else { if (extra_output != 0) exp_intpr(clientOnly, serverOnly); @@ -191,13 +251,14 @@ intpr(int clientOnly, int serverOnly) { int nfssvc_flag; - nfssvc_flag = NFSSVC_GETSTATS; + nfssvc_flag = NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT; if (zflag != 0) { if (clientOnly != 0) nfssvc_flag |= NFSSVC_ZEROCLTSTATS; if (serverOnly != 0) nfssvc_flag |= NFSSVC_ZEROSRVSTATS; } + ext_nfsstats.vers = NFSSTATS_V1; if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0) err(1, "Can't get stats"); if (clientOnly) { @@ -206,124 +267,124 @@ intpr(int clientOnly, int serverOnly) printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Getattr", "Setattr", "Lookup", "Readlink", "Read", "Write", "Create", "Remove"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_GETATTR], - ext_nfsstats.rpccnt[NFSPROC_SETATTR], - ext_nfsstats.rpccnt[NFSPROC_LOOKUP], - ext_nfsstats.rpccnt[NFSPROC_READLINK], - ext_nfsstats.rpccnt[NFSPROC_READ], - ext_nfsstats.rpccnt[NFSPROC_WRITE], - ext_nfsstats.rpccnt[NFSPROC_CREATE], - ext_nfsstats.rpccnt[NFSPROC_REMOVE]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUP], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READLINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READ], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_REMOVE]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Rename", "Link", "Symlink", "Mkdir", "Rmdir", "Readdir", "RdirPlus", "Access"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_RENAME], - ext_nfsstats.rpccnt[NFSPROC_LINK], - ext_nfsstats.rpccnt[NFSPROC_SYMLINK], - ext_nfsstats.rpccnt[NFSPROC_MKDIR], - ext_nfsstats.rpccnt[NFSPROC_RMDIR], - ext_nfsstats.rpccnt[NFSPROC_READDIR], - ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS], - ext_nfsstats.rpccnt[NFSPROC_ACCESS]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RENAME], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SYMLINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_ACCESS]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit"); - printf("%9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_MKNOD], - ext_nfsstats.rpccnt[NFSPROC_FSSTAT], - ext_nfsstats.rpccnt[NFSPROC_FSINFO], - ext_nfsstats.rpccnt[NFSPROC_PATHCONF], - ext_nfsstats.rpccnt[NFSPROC_COMMIT]); + printf("%9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKNOD], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSSTAT], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSINFO], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_PATHCONF], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMIT]); printf("Rpc Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", "TimedOut", "Invalid", "X Replies", "Retries", "Requests"); - printf("%9d %9d %9d %9d %9d\n", - ext_nfsstats.rpctimeouts, - ext_nfsstats.rpcinvalid, - ext_nfsstats.rpcunexpected, - ext_nfsstats.rpcretries, - ext_nfsstats.rpcrequests); + printf("%9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpctimeouts, + (uintmax_t)ext_nfsstats.rpcinvalid, + (uintmax_t)ext_nfsstats.rpcunexpected, + (uintmax_t)ext_nfsstats.rpcretries, + (uintmax_t)ext_nfsstats.rpcrequests); printf("Cache Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s", "Attr Hits", "Misses", "Lkup Hits", "Misses"); printf(" %9.9s %9.9s %9.9s %9.9s\n", "BioR Hits", "Misses", "BioW Hits", "Misses"); - printf("%9d %9d %9d %9d", - ext_nfsstats.attrcache_hits, - ext_nfsstats.attrcache_misses, - ext_nfsstats.lookupcache_hits, - ext_nfsstats.lookupcache_misses); - printf(" %9d %9d %9d %9d\n", - ext_nfsstats.biocache_reads - - ext_nfsstats.read_bios, - ext_nfsstats.read_bios, - ext_nfsstats.biocache_writes - - ext_nfsstats.write_bios, - ext_nfsstats.write_bios); + printf("%9ju %9ju %9ju %9ju", + (uintmax_t)ext_nfsstats.attrcache_hits, + (uintmax_t)ext_nfsstats.attrcache_misses, + (uintmax_t)ext_nfsstats.lookupcache_hits, + (uintmax_t)ext_nfsstats.lookupcache_misses); + printf(" %9ju %9ju %9ju %9ju\n", + (uintmax_t)(ext_nfsstats.biocache_reads - + ext_nfsstats.read_bios), + (uintmax_t)ext_nfsstats.read_bios, + (uintmax_t)(ext_nfsstats.biocache_writes - + ext_nfsstats.write_bios), + (uintmax_t)ext_nfsstats.write_bios); printf("%9.9s %9.9s %9.9s %9.9s", "BioRLHits", "Misses", "BioD Hits", "Misses"); printf(" %9.9s %9.9s %9.9s %9.9s\n", "DirE Hits", "Misses", "Accs Hits", "Misses"); - printf("%9d %9d %9d %9d", - ext_nfsstats.biocache_readlinks - - ext_nfsstats.readlink_bios, - ext_nfsstats.readlink_bios, - ext_nfsstats.biocache_readdirs - - ext_nfsstats.readdir_bios, - ext_nfsstats.readdir_bios); - printf(" %9d %9d %9d %9d\n", - ext_nfsstats.direofcache_hits, - ext_nfsstats.direofcache_misses, - ext_nfsstats.accesscache_hits, - ext_nfsstats.accesscache_misses); + printf("%9ju %9ju %9ju %9ju", + (uintmax_t)(ext_nfsstats.biocache_readlinks - + ext_nfsstats.readlink_bios), + (uintmax_t)ext_nfsstats.readlink_bios, + (uintmax_t)(ext_nfsstats.biocache_readdirs - + ext_nfsstats.readdir_bios), + (uintmax_t)ext_nfsstats.readdir_bios); + printf(" %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.direofcache_hits, + (uintmax_t)ext_nfsstats.direofcache_misses, + (uintmax_t)ext_nfsstats.accesscache_hits, + (uintmax_t)ext_nfsstats.accesscache_misses); } if (serverOnly) { printf("\nServer Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Getattr", "Setattr", "Lookup", "Readlink", "Read", "Write", "Create", "Remove"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR], - ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR], - ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP], - ext_nfsstats.srvrpccnt[NFSV4OP_READLINK], - ext_nfsstats.srvrpccnt[NFSV4OP_READ], - ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], - ext_nfsstats.srvrpccnt[NFSV4OP_CREATE], - ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READLINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READ], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CREATE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Rename", "Link", "Symlink", "Mkdir", "Rmdir", "Readdir", "RdirPlus", "Access"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_RENAME], - ext_nfsstats.srvrpccnt[NFSV4OP_LINK], - ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK], - ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_READDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS], - ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENAME], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit"); - printf("%9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD], - ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT], - ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO], - ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF], - ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT]); + printf("%9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT]); printf("Server Ret-Failed\n"); - printf("%17d\n", ext_nfsstats.srvrpc_errs); + printf("%17ju\n", (uintmax_t)ext_nfsstats.srvrpc_errs); printf("Server Faults\n"); - printf("%13d\n", ext_nfsstats.srv_errs); + printf("%13ju\n", (uintmax_t)ext_nfsstats.srv_errs); printf("Server Cache Stats:\n"); printf("%9.9s %9.9s %9.9s %9.9s\n", "Inprog", "Idem", "Non-idem", "Misses"); - printf("%9d %9d %9d %9d\n", - ext_nfsstats.srvcache_inproghits, - ext_nfsstats.srvcache_idemdonehits, - ext_nfsstats.srvcache_nonidemdonehits, - ext_nfsstats.srvcache_misses); + printf("%9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvcache_inproghits, + (uintmax_t)ext_nfsstats.srvcache_idemdonehits, + (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits, + (uintmax_t)ext_nfsstats.srvcache_misses); printf("Server Write Gathering:\n"); printf("%9.9s %9.9s %9.9s\n", "WriteOps", "WriteRPC", "Opsaved"); @@ -331,21 +392,37 @@ intpr(int clientOnly, int serverOnly) * The new client doesn't do write gathering. It was * only useful for NFSv2. */ - printf("%9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], - ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], 0); + printf("%9ju %9ju %9d\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], 0); } } static void -printhdr(int clientOnly, int serverOnly) +printhdr(int clientOnly, int serverOnly, int newStats) { - printf("%s%6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s", - ((serverOnly && clientOnly) ? " " : " "), - "GtAttr", "Lookup", "Rdlink", "Read", "Write", "Rename", - "Access", "Rddir"); - if (widemode && clientOnly) { - printf(" Attr Lkup BioR BioW Accs BioD"); + + if (newStats) { + printf(" [%s Read %s] [%s Write %s] " + "%s[=========== Total ============]\n" + " KB/t tps MB/s%s KB/t tps MB/s%s " + "%sKB/t tps MB/s ms ql %%b", + widemode ? "========" : "=====", + widemode ? "========" : "=====", + widemode ? "========" : "=====", + widemode ? "=======" : "====", + widemode ? "[Commit ] " : "", + widemode ? " ms" : "", + widemode ? " ms" : "", + widemode ? "tps ms " : ""); + } else { + printf("%s%6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s", + ((serverOnly && clientOnly) ? " " : " "), + "GtAttr", "Lookup", "Rdlink", "Read", "Write", "Rename", + "Access", "Rddir"); + if (widemode && clientOnly) { + printf(" Attr Lkup BioR BioW Accs BioD"); + } } printf("\n"); fflush(stdout); @@ -355,7 +432,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: nfsstat [-cemszW] [-M core] [-N system] [-w wait]\n"); + "usage: nfsstat [-cdemszW] [-M core] [-N system] [-w wait]\n"); exit(1); } @@ -392,6 +469,75 @@ sperc2(int ttl, int misses) return(p); } +#define DELTA_T(field) \ + devstat_compute_etime(&cur_stats->field, \ + (prev_stats ? &prev_stats->field : NULL)) + +/* + * XXX KDM mostly copied from ctlstat. We should commonize the code (and + * the devstat code) somehow. + */ +static void +compute_new_stats(struct nfsstatsv1 *cur_stats, + struct nfsstatsv1 *prev_stats, int curop, + long double etime, long double *mbsec, + long double *kb_per_transfer, + long double *transfers_per_second, + long double *ms_per_transfer, uint64_t *queue_len, + long double *busy_pct) +{ + uint64_t total_bytes = 0, total_operations = 0; + struct bintime total_time_bt; + struct timespec total_time_ts; + + bzero(&total_time_bt, sizeof(total_time_bt)); + bzero(&total_time_ts, sizeof(total_time_ts)); + + total_bytes = cur_stats->srvbytes[curop]; + total_operations = cur_stats->srvops[curop]; + if (prev_stats != NULL) { + total_bytes -= prev_stats->srvbytes[curop]; + total_operations -= prev_stats->srvops[curop]; + } + + *mbsec = total_bytes; + *mbsec /= 1024 * 1024; + if (etime > 0.0) { + *busy_pct = DELTA_T(busytime); + if (*busy_pct < 0) + *busy_pct = 0; + *busy_pct /= etime; + *busy_pct *= 100; + if (*busy_pct < 0) + *busy_pct = 0; + *mbsec /= etime; + } else { + *busy_pct = 0; + *mbsec = 0; + } + *kb_per_transfer = total_bytes; + *kb_per_transfer /= 1024; + if (total_operations > 0) + *kb_per_transfer /= total_operations; + else + *kb_per_transfer = 0; + if (etime > 0.0) { + *transfers_per_second = total_operations; + *transfers_per_second /= etime; + } else { + *transfers_per_second = 0.0; + } + + if (total_operations > 0) { + *ms_per_transfer = DELTA_T(srvduration[curop]); + *ms_per_transfer /= total_operations; + *ms_per_transfer *= 1000; + } else + *ms_per_transfer = 0.0; + + *queue_len = cur_stats->srvstartcnt - cur_stats->srvdonecnt; +} + /* * Print a description of the nfs stats for the experimental client/server. */ @@ -400,13 +546,14 @@ exp_intpr(int clientOnly, int serverOnly { int nfssvc_flag; - nfssvc_flag = NFSSVC_GETSTATS; + nfssvc_flag = NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT; if (zflag != 0) { if (clientOnly != 0) nfssvc_flag |= NFSSVC_ZEROCLTSTATS; if (serverOnly != 0) nfssvc_flag |= NFSSVC_ZEROSRVSTATS; } + ext_nfsstats.vers = NFSSTATS_V1; if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0) err(1, "Can't get stats"); if (clientOnly != 0) { @@ -418,81 +565,81 @@ exp_intpr(int clientOnly, int serverOnly , "Getattr", "Setattr", "Lookup", "Readlink", "Read", "Write", "Create", "Remove"); } - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_GETATTR], - ext_nfsstats.rpccnt[NFSPROC_SETATTR], - ext_nfsstats.rpccnt[NFSPROC_LOOKUP], - ext_nfsstats.rpccnt[NFSPROC_READLINK], - ext_nfsstats.rpccnt[NFSPROC_READ], - ext_nfsstats.rpccnt[NFSPROC_WRITE], - ext_nfsstats.rpccnt[NFSPROC_CREATE], - ext_nfsstats.rpccnt[NFSPROC_REMOVE]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUP], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READLINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READ], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_REMOVE]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "Rename", "Link", "Symlink", "Mkdir", "Rmdir", "Readdir", "RdirPlus", "Access"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_RENAME], - ext_nfsstats.rpccnt[NFSPROC_LINK], - ext_nfsstats.rpccnt[NFSPROC_SYMLINK], - ext_nfsstats.rpccnt[NFSPROC_MKDIR], - ext_nfsstats.rpccnt[NFSPROC_RMDIR], - ext_nfsstats.rpccnt[NFSPROC_READDIR], - ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS], - ext_nfsstats.rpccnt[NFSPROC_ACCESS]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RENAME], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SYMLINK], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_ACCESS]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit", "SetClId", "SetClIdCf", "Lock"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_MKNOD], - ext_nfsstats.rpccnt[NFSPROC_FSSTAT], - ext_nfsstats.rpccnt[NFSPROC_FSINFO], - ext_nfsstats.rpccnt[NFSPROC_PATHCONF], - ext_nfsstats.rpccnt[NFSPROC_COMMIT], - ext_nfsstats.rpccnt[NFSPROC_SETCLIENTID], - ext_nfsstats.rpccnt[NFSPROC_SETCLIENTIDCFRM], - ext_nfsstats.rpccnt[NFSPROC_LOCK]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKNOD], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSSTAT], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSINFO], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_PATHCONF], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMIT], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETCLIENTID], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETCLIENTIDCFRM], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCK]); if (printtitle) printf("%9.9s %9.9s %9.9s %9.9s\n", "LockT", "LockU", "Open", "OpenCfr"); - printf("%9d %9d %9d %9d\n", - ext_nfsstats.rpccnt[NFSPROC_LOCKT], - ext_nfsstats.rpccnt[NFSPROC_LOCKU], - ext_nfsstats.rpccnt[NFSPROC_OPEN], - ext_nfsstats.rpccnt[NFSPROC_OPENCONFIRM]); + printf("%9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCKT], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCKU], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPEN], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPENCONFIRM]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "OpenOwner", "Opens", "LockOwner", "Locks", "Delegs", "LocalOwn", "LocalOpen", "LocalLOwn"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.clopenowners, - ext_nfsstats.clopens, - ext_nfsstats.cllockowners, - ext_nfsstats.cllocks, - ext_nfsstats.cldelegates, - ext_nfsstats.cllocalopenowners, - ext_nfsstats.cllocalopens, - ext_nfsstats.cllocallockowners); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.clopenowners, + (uintmax_t)ext_nfsstats.clopens, + (uintmax_t)ext_nfsstats.cllockowners, + (uintmax_t)ext_nfsstats.cllocks, + (uintmax_t)ext_nfsstats.cldelegates, + (uintmax_t)ext_nfsstats.cllocalopenowners, + (uintmax_t)ext_nfsstats.cllocalopens, + (uintmax_t)ext_nfsstats.cllocallockowners); if (printtitle) printf("%9.9s\n", "LocalLock"); - printf("%9d\n", ext_nfsstats.cllocallocks); + printf("%9ju\n", (uintmax_t)ext_nfsstats.cllocallocks); if (printtitle) { printf("Rpc Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", "TimedOut", "Invalid", "X Replies", "Retries", "Requests"); } - printf("%9d %9d %9d %9d %9d\n", - ext_nfsstats.rpctimeouts, - ext_nfsstats.rpcinvalid, - ext_nfsstats.rpcunexpected, - ext_nfsstats.rpcretries, - ext_nfsstats.rpcrequests); + printf("%9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.rpctimeouts, + (uintmax_t)ext_nfsstats.rpcinvalid, + (uintmax_t)ext_nfsstats.rpcunexpected, + (uintmax_t)ext_nfsstats.rpcretries, + (uintmax_t)ext_nfsstats.rpcrequests); if (printtitle) { printf("Cache Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s", @@ -500,31 +647,33 @@ exp_intpr(int clientOnly, int serverOnly printf(" %9.9s %9.9s %9.9s %9.9s\n", "BioR Hits", "Misses", "BioW Hits", "Misses"); } - printf("%9d %9d %9d %9d", - ext_nfsstats.attrcache_hits, - ext_nfsstats.attrcache_misses, - ext_nfsstats.lookupcache_hits, - ext_nfsstats.lookupcache_misses); - printf(" %9d %9d %9d %9d\n", - ext_nfsstats.biocache_reads - ext_nfsstats.read_bios, - ext_nfsstats.read_bios, - ext_nfsstats.biocache_writes - ext_nfsstats.write_bios, - ext_nfsstats.write_bios); + printf("%9ju %9ju %9ju %9ju", + (uintmax_t)ext_nfsstats.attrcache_hits, + (uintmax_t)ext_nfsstats.attrcache_misses, + (uintmax_t)ext_nfsstats.lookupcache_hits, + (uintmax_t)ext_nfsstats.lookupcache_misses); + printf(" %9ju %9ju %9ju %9ju\n", + (uintmax_t)(ext_nfsstats.biocache_reads - + ext_nfsstats.read_bios), + (uintmax_t)ext_nfsstats.read_bios, + (uintmax_t)(ext_nfsstats.biocache_writes - + ext_nfsstats.write_bios), + (uintmax_t)ext_nfsstats.write_bios); if (printtitle) { printf("%9.9s %9.9s %9.9s %9.9s", "BioRLHits", "Misses", "BioD Hits", "Misses"); printf(" %9.9s %9.9s\n", "DirE Hits", "Misses"); } - printf("%9d %9d %9d %9d", - ext_nfsstats.biocache_readlinks - - ext_nfsstats.readlink_bios, - ext_nfsstats.readlink_bios, - ext_nfsstats.biocache_readdirs - - ext_nfsstats.readdir_bios, - ext_nfsstats.readdir_bios); - printf(" %9d %9d\n", - ext_nfsstats.direofcache_hits, - ext_nfsstats.direofcache_misses); + printf("%9ju %9ju %9ju %9ju", + (uintmax_t)(ext_nfsstats.biocache_readlinks - + ext_nfsstats.readlink_bios), + (uintmax_t)ext_nfsstats.readlink_bios, + (uintmax_t)(ext_nfsstats.biocache_readdirs - + ext_nfsstats.readdir_bios), + (uintmax_t)ext_nfsstats.readdir_bios); + printf(" %9ju %9ju\n", + (uintmax_t)ext_nfsstats.direofcache_hits, + (uintmax_t)ext_nfsstats.direofcache_misses); } if (serverOnly != 0) { if (printtitle) { @@ -534,116 +683,136 @@ exp_intpr(int clientOnly, int serverOnly , "Getattr", "Setattr", "Lookup", "Readlink", "Read", "Write", "Create", "Remove"); } - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR], - ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR], - ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP], - ext_nfsstats.srvrpccnt[NFSV4OP_READLINK], - ext_nfsstats.srvrpccnt[NFSV4OP_READ], - ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], - ext_nfsstats.srvrpccnt[NFSV4OP_V3CREATE], - ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READLINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READ], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_V3CREATE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "Rename", "Link", "Symlink", "Mkdir", "Rmdir", "Readdir", "RdirPlus", "Access"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_RENAME], - ext_nfsstats.srvrpccnt[NFSV4OP_LINK], - ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK], - ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_READDIR], - ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS], - ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENAME], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit", "LookupP", "SetClId", "SetClIdCf"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD], - ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT], - ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO], - ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF], - ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT], - ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUPP], - ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTID], - ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTIDCFRM]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUPP], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTID], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTIDCFRM]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "Open", "OpenAttr", "OpenDwnGr", "OpenCfrm", "DelePurge", "DeleRet", "GetFH", "Lock"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_OPEN], - ext_nfsstats.srvrpccnt[NFSV4OP_OPENATTR], - ext_nfsstats.srvrpccnt[NFSV4OP_OPENDOWNGRADE], - ext_nfsstats.srvrpccnt[NFSV4OP_OPENCONFIRM], - ext_nfsstats.srvrpccnt[NFSV4OP_DELEGPURGE], - ext_nfsstats.srvrpccnt[NFSV4OP_DELEGRETURN], - ext_nfsstats.srvrpccnt[NFSV4OP_GETFH], - ext_nfsstats.srvrpccnt[NFSV4OP_LOCK]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPEN], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENATTR], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENDOWNGRADE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENCONFIRM], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_DELEGPURGE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_DELEGRETURN], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETFH], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCK]); if (printtitle) printf( "%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n" , "LockT", "LockU", "Close", "Verify", "NVerify", "PutFH", "PutPubFH", "PutRootFH"); - printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_LOCKT], - ext_nfsstats.srvrpccnt[NFSV4OP_LOCKU], - ext_nfsstats.srvrpccnt[NFSV4OP_CLOSE], - ext_nfsstats.srvrpccnt[NFSV4OP_VERIFY], - ext_nfsstats.srvrpccnt[NFSV4OP_NVERIFY], - ext_nfsstats.srvrpccnt[NFSV4OP_PUTFH], - ext_nfsstats.srvrpccnt[NFSV4OP_PUTPUBFH], - ext_nfsstats.srvrpccnt[NFSV4OP_PUTROOTFH]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCKT], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCKU], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CLOSE], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_VERIFY], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_NVERIFY], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTFH], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTPUBFH], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTROOTFH]); if (printtitle) printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Renew", "RestoreFH", "SaveFH", "Secinfo", "RelLckOwn", "V4Create"); - printf("%9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSV4OP_RENEW], - ext_nfsstats.srvrpccnt[NFSV4OP_RESTOREFH], - ext_nfsstats.srvrpccnt[NFSV4OP_SAVEFH], - ext_nfsstats.srvrpccnt[NFSV4OP_SECINFO], - ext_nfsstats.srvrpccnt[NFSV4OP_RELEASELCKOWN], - ext_nfsstats.srvrpccnt[NFSV4OP_CREATE]); + printf("%9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENEW], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RESTOREFH], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SAVEFH], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SECINFO], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RELEASELCKOWN], + (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CREATE]); if (printtitle) { printf("Server:\n"); printf("%9.9s %9.9s %9.9s\n", "Retfailed", "Faults", "Clients"); } - printf("%9d %9d %9d\n", - ext_nfsstats.srv_errs, ext_nfsstats.srvrpc_errs, - ext_nfsstats.srvclients); + printf("%9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srv_errs, + (uintmax_t)ext_nfsstats.srvrpc_errs, + (uintmax_t)ext_nfsstats.srvclients); if (printtitle) printf("%9.9s %9.9s %9.9s %9.9s %9.9s \n", "OpenOwner", "Opens", "LockOwner", "Locks", "Delegs"); - printf("%9d %9d %9d %9d %9d \n", - ext_nfsstats.srvopenowners, - ext_nfsstats.srvopens, - ext_nfsstats.srvlockowners, - ext_nfsstats.srvlocks, - ext_nfsstats.srvdelegates); + printf("%9ju %9ju %9ju %9ju %9ju \n", + (uintmax_t)ext_nfsstats.srvopenowners, + (uintmax_t)ext_nfsstats.srvopens, + (uintmax_t)ext_nfsstats.srvlockowners, + (uintmax_t)ext_nfsstats.srvlocks, + (uintmax_t)ext_nfsstats.srvdelegates); if (printtitle) { printf("Server Cache Stats:\n"); printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Inprog", "Idem", "Non-idem", "Misses", "CacheSize", "TCPPeak"); } - printf("%9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvcache_inproghits, - ext_nfsstats.srvcache_idemdonehits, - ext_nfsstats.srvcache_nonidemdonehits, - ext_nfsstats.srvcache_misses, - ext_nfsstats.srvcache_size, - ext_nfsstats.srvcache_tcppeak); + printf("%9ju %9ju %9ju %9ju %9ju %9ju\n", + (uintmax_t)ext_nfsstats.srvcache_inproghits, + (uintmax_t)ext_nfsstats.srvcache_idemdonehits, + (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits, + (uintmax_t)ext_nfsstats.srvcache_misses, + (uintmax_t)ext_nfsstats.srvcache_size, + (uintmax_t)ext_nfsstats.srvcache_tcppeak); } } +static void +compute_totals(struct nfsstatsv1 *total_stats, struct nfsstatsv1 *cur_stats) +{ + int i; + + bzero(total_stats, sizeof(*total_stats)); + for (i = 0; i < (NFSV42_NOPS + NFSV4OP_FAKENOPS); i++) { + total_stats->srvbytes[0] += cur_stats->srvbytes[i]; + total_stats->srvops[0] += cur_stats->srvops[i]; + bintime_add(&total_stats->srvduration[0], + &cur_stats->srvduration[i]); + total_stats->srvrpccnt[i] = cur_stats->srvrpccnt[i]; + } + total_stats->srvstartcnt = cur_stats->srvstartcnt; + total_stats->srvdonecnt = cur_stats->srvdonecnt; + total_stats->busytime = cur_stats->busytime; + +} + /* * Print a running summary of nfs statistics for the experimental client and/or * server. @@ -652,40 +821,51 @@ exp_intpr(int clientOnly, int serverOnly * First line printed at top of screen is always cumulative. */ static void -exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly) +exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly, + int newStats) { - struct ext_nfsstats nfsstats, lastst, *ext_nfsstatsp; + struct nfsstatsv1 nfsstats, lastst, *ext_nfsstatsp; + struct nfsstatsv1 curtotal, lasttotal; + struct timespec ts, lastts; int hdrcnt = 1; ext_nfsstatsp = &lastst; - if (nfssvc(NFSSVC_GETSTATS, ext_nfsstatsp) < 0) + ext_nfsstatsp->vers = NFSSTATS_V1; + if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp) < 0) err(1, "Can't get stats"); + clock_gettime(CLOCK_MONOTONIC, &lastts); + compute_totals(&lasttotal, ext_nfsstatsp); sleep(interval); for (;;) { ext_nfsstatsp = &nfsstats; - if (nfssvc(NFSSVC_GETSTATS, ext_nfsstatsp) < 0) + ext_nfsstatsp->vers = NFSSTATS_V1; + if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp) + < 0) err(1, "Can't get stats"); + clock_gettime(CLOCK_MONOTONIC, &ts); if (--hdrcnt == 0) { - printhdr(clientOnly, serverOnly); - if (clientOnly && serverOnly) + printhdr(clientOnly, serverOnly, newStats); + if (newStats) + hdrcnt = 20; + else if (clientOnly && serverOnly) hdrcnt = 10; else hdrcnt = 20; } - if (clientOnly) { - printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", + if (clientOnly && newStats == 0) { + printf("%s %6ju %6ju %6ju %6ju %6ju %6ju %6ju %6ju", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(rpccnt[NFSPROC_GETATTR]), - DELTA(rpccnt[NFSPROC_LOOKUP]), - DELTA(rpccnt[NFSPROC_READLINK]), - DELTA(rpccnt[NFSPROC_READ]), - DELTA(rpccnt[NFSPROC_WRITE]), - DELTA(rpccnt[NFSPROC_RENAME]), - DELTA(rpccnt[NFSPROC_ACCESS]), - DELTA(rpccnt[NFSPROC_READDIR]) + - DELTA(rpccnt[NFSPROC_READDIRPLUS]) + (uintmax_t)DELTA(rpccnt[NFSPROC_GETATTR]), + (uintmax_t)DELTA(rpccnt[NFSPROC_LOOKUP]), + (uintmax_t)DELTA(rpccnt[NFSPROC_READLINK]), + (uintmax_t)DELTA(rpccnt[NFSPROC_READ]), + (uintmax_t)DELTA(rpccnt[NFSPROC_WRITE]), + (uintmax_t)DELTA(rpccnt[NFSPROC_RENAME]), + (uintmax_t)DELTA(rpccnt[NFSPROC_ACCESS]), + (uintmax_t)(DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS])) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -705,21 +885,74 @@ exp_sidewaysintpr(u_int interval, int cl } printf("\n"); } - if (serverOnly) { - printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", + + if (serverOnly && newStats) { + long double cur_secs, last_secs, etime; + long double mbsec; + long double kb_per_transfer; + long double transfers_per_second; + long double ms_per_transfer; + uint64_t queue_len; + long double busy_pct; + int i; + + cur_secs = ts.tv_sec + + ((long double)ts.tv_nsec / 1000000000); + last_secs = lastts.tv_sec + + ((long double)lastts.tv_nsec / 1000000000); + etime = cur_secs - last_secs; + + compute_totals(&curtotal, &nfsstats); + + for (i = 0; i < NUM_STAT_TYPES; i++) { + compute_new_stats(&nfsstats, &lastst, + STAT_TYPE_TO_NFS(i), etime, &mbsec, + &kb_per_transfer, + &transfers_per_second, + &ms_per_transfer, &queue_len, + &busy_pct); + + if (i == STAT_TYPE_COMMIT) { + if (widemode == 0) + continue; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 13 20:21:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B001BB850A; Sat, 13 Aug 2016 20:21:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B919814D3; Sat, 13 Aug 2016 20:21:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DKLWMp040783; Sat, 13 Aug 2016 20:21:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DKLWXq040782; Sat, 13 Aug 2016 20:21:32 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201608132021.u7DKLWXq040782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 13 Aug 2016 20:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304059 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 20:21:34 -0000 Author: rmacklem Date: Sat Aug 13 20:21:32 2016 New Revision: 304059 URL: https://svnweb.freebsd.org/changeset/base/304059 Log: Update the man page to descibe the "-d" option added by r304058. This is a content change. Submitted by: will (earlier version) Reviewed by: ken, wblock MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D1626 Modified: head/usr.bin/nfsstat/nfsstat.1 Modified: head/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- head/usr.bin/nfsstat/nfsstat.1 Sat Aug 13 20:14:44 2016 (r304058) +++ head/usr.bin/nfsstat/nfsstat.1 Sat Aug 13 20:21:32 2016 (r304059) @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 23, 2015 +.Dd August 13, 2016 .Dt NFSSTAT 1 .Os .Sh NAME @@ -38,7 +38,7 @@ statistics .Sh SYNOPSIS .Nm -.Op Fl cemszW +.Op Fl cdemszW .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar wait @@ -57,6 +57,28 @@ The options are as follows: .Bl -tag -width indent .It Fl c Only display client side statistics. +.It Fl d +Display statistics for the new NFS server that are similar to those +displayed by +.Xr iostat 8 . +This includes kilobytes per transfer, transfers per second, and megabytes per +second for read, write, and all operations. +It also includes the current queue depth, the busy percentage, and latency +for all operations. +If the +.Fl W +flag is added, commits per second, commit latency, read latency, and write +latency are also added to the display. +The busy percentage shown can exceed 100 at times. +This is because of the way busy percentages are calculated. +The busy time is calculated by adding the elapsed time between the +last time an operation started or finished, +and the current time. +If there is only one operation outstanding, the "busy time" time +will get updated with the total time of that operation. +That means that the difference in the busy time between the two +measurement intervals (often 1 second) +will increase by more than the measurement interval. .It Fl e Report the extra statistics collected by the NFS client and server for NFSv4. @@ -79,7 +101,8 @@ Only display server side statistics. Use wide format with interval short summary. This option is especially useful when combined with -.Fl c +.Fl c , +.Fl d , or .Fl s and a time delay. From owner-svn-src-head@freebsd.org Sat Aug 13 22:14:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD67BB7F0B; Sat, 13 Aug 2016 22:14:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE611EAE; Sat, 13 Aug 2016 22:14:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DMEG8I081726; Sat, 13 Aug 2016 22:14:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DMEGB6081725; Sat, 13 Aug 2016 22:14:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608132214.u7DMEGB6081725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 13 Aug 2016 22:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304061 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 22:14:17 -0000 Author: ae Date: Sat Aug 13 22:14:16 2016 New Revision: 304061 URL: https://svnweb.freebsd.org/changeset/base/304061 Log: Use %ju to print unsigned 64-bit value. Reported by: kib Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Sat Aug 13 21:20:06 2016 (r304060) +++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Sat Aug 13 22:14:16 2016 (r304061) @@ -733,8 +733,8 @@ nat64lsn_states(struct ip_fw_chain *ch, } if (addr < cfg->prefix4 || addr > cfg->pmask4) { IPFW_UH_RUNLOCK(ch); - DPRINTF(DP_GENERIC | DP_STATE, "XXX: %lu %u %u", - next_idx, addr, cfg->pmask4); + DPRINTF(DP_GENERIC | DP_STATE, "XXX: %ju %u %u", + (uintmax_t)next_idx, addr, cfg->pmask4); return (EINVAL); } From owner-svn-src-head@freebsd.org Sat Aug 13 23:35:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CAFBBB911E; Sat, 13 Aug 2016 23:35:21 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8CD15B7; Sat, 13 Aug 2016 23:35:21 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7DNZK6C011826; Sat, 13 Aug 2016 23:35:20 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7DNZKJk011825; Sat, 13 Aug 2016 23:35:20 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201608132335.u7DNZKJk011825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Sat, 13 Aug 2016 23:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304065 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 13 Aug 2016 23:35:21 -0000 Author: grog Date: Sat Aug 13 23:35:20 2016 New Revision: 304065 URL: https://svnweb.freebsd.org/changeset/base/304065 Log: Correct date ov VJ day (1945-08-15, about 03:00 UTC). Modified: head/usr.bin/calendar/calendars/calendar.holiday Modified: head/usr.bin/calendar/calendars/calendar.holiday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.holiday Sat Aug 13 23:00:15 2016 (r304064) +++ head/usr.bin/calendar/calendars/calendar.holiday Sat Aug 13 23:35:20 2016 (r304065) @@ -331,8 +331,8 @@ 08/13 Proclamation of Independence in Central African Republic 08/13 Women's Day in Tunisia 08/14 Independence Day in Pakistan -08/14 VJ Day, 1945 08/14 Waddi Dhahab in Morocco +08/15 VJ Day, 1945 08/15 Founding of Ascuncion in Paraguay 08/15 Independence Day in India 08/15 Liberation Day in South Korea