From owner-svn-src-head@freebsd.org Sun Aug 2 00:03:11 2015 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 D3B019B1815; Sun, 2 Aug 2015 00:03:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C36671940; Sun, 2 Aug 2015 00:03:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7203BST014334; Sun, 2 Aug 2015 00:03:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72039mS014328; Sun, 2 Aug 2015 00:03:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020003.t72039mS014328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286166 - 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.20 Precedence: list List-Id: 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, 02 Aug 2015 00:03:12 -0000 Author: markj Date: Sun Aug 2 00:03:08 2015 New Revision: 286166 URL: https://svnweb.freebsd.org/changeset/base/286166 Log: Don't modify curthread->td_locks unless INVARIANTS is enabled. This field is only used in a KASSERT that verifies that no locks are held when returning to user mode. Moreover, the td_locks accounting is only correct when LOCK_DEBUG > 0, which is implied by INVARIANTS. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3205 Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rmlock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/proc.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_lock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -69,12 +69,8 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #ifndef INVARIANTS #define _lockmgr_assert(lk, what, file, line) -#define TD_LOCKS_INC(td) -#define TD_LOCKS_DEC(td) -#else -#define TD_LOCKS_INC(td) ((td)->td_locks++) -#define TD_LOCKS_DEC(td) ((td)->td_locks--) #endif + #define TD_SLOCKS_INC(td) ((td)->td_lk_slocks++) #define TD_SLOCKS_DEC(td) ((td)->td_lk_slocks--) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_mutex.c Sun Aug 2 00:03:08 2015 (r286166) @@ -224,7 +224,7 @@ __mtx_lock_flags(volatile uintptr_t *c, line); WITNESS_LOCK(&m->lock_object, (opts & ~MTX_RECURSE) | LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } void @@ -248,7 +248,7 @@ __mtx_unlock_flags(volatile uintptr_t *c mtx_assert(m, MA_OWNED); __mtx_unlock(m, curthread, opts, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } void @@ -347,7 +347,7 @@ _mtx_trylock_flags_(volatile uintptr_t * if (rval) { WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); if (m->mtx_recurse == 0) LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); @@ -958,7 +958,7 @@ _mtx_destroy(volatile uintptr_t *c) if (LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin) spinlock_exit(); else - curthread->td_locks--; + TD_LOCKS_DEC(curthread); lock_profile_release_lock(&m->lock_object); /* Tell witness this isn't locked to make it happy. */ Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_rmlock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -608,11 +608,8 @@ _rm_wlock_debug(struct rmlock *rm, const _rm_wlock(rm); LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); - - curthread->td_locks++; - + TD_LOCKS_INC(curthread); } void @@ -628,7 +625,7 @@ _rm_wunlock_debug(struct rmlock *rm, con WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } int @@ -670,9 +667,7 @@ _rm_rlock_debug(struct rmlock *rm, struc LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); WITNESS_LOCK(&rm->lock_object, 0, file, line); - - curthread->td_locks++; - + TD_LOCKS_INC(curthread); return (1); } else if (trylock) LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 0, file, line); @@ -694,7 +689,7 @@ _rm_runlock_debug(struct rmlock *rm, str WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } #else Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_rwlock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -268,7 +268,7 @@ _rw_wlock_cookie(volatile uintptr_t *c, __rw_wlock(rw, curthread, file, line); LOCK_LOG_LOCK("WLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } int @@ -303,7 +303,7 @@ __rw_try_wlock(volatile uintptr_t *c, co if (!rw_recursed(rw)) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_WRITER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (rval); } @@ -325,8 +325,9 @@ _rw_wunlock_cookie(volatile uintptr_t *c LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); __rw_wunlock(rw, curthread, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } + /* * Determines whether a new reader can acquire a lock. Succeeds if the * reader already owns a read lock and the lock is locked for read to @@ -565,7 +566,7 @@ __rw_rlock(volatile uintptr_t *c, const waittime, file, line, LOCKSTAT_READER); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); curthread->td_rw_rlocks++; } @@ -596,7 +597,7 @@ __rw_try_rlock(volatile uintptr_t *c, co WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line); LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_READER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); curthread->td_rw_rlocks++; return (1); } @@ -714,7 +715,7 @@ _rw_runlock_cookie(volatile uintptr_t *c break; } LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); curthread->td_rw_rlocks--; } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_sx.c Sun Aug 2 00:03:08 2015 (r286166) @@ -261,7 +261,7 @@ _sx_slock(struct sx *sx, int opts, const if (!error) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); WITNESS_LOCK(&sx->lock_object, 0, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (error); @@ -290,7 +290,7 @@ sx_try_slock_(struct sx *sx, const char WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_READER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); return (1); } } @@ -318,7 +318,7 @@ _sx_xlock(struct sx *sx, int opts, const LOCK_LOG_LOCK("XLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (error); @@ -353,7 +353,7 @@ sx_try_xlock_(struct sx *sx, const char if (!sx_recursed(sx)) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_WRITER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (rval); @@ -371,7 +371,7 @@ _sx_sunlock(struct sx *sx, const char *f WITNESS_UNLOCK(&sx->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); __sx_sunlock(sx, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } void @@ -387,7 +387,7 @@ _sx_xunlock(struct sx *sx, const char *f LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); __sx_xunlock(sx, curthread, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/sys/proc.h Sun Aug 2 00:03:08 2015 (r286166) @@ -238,7 +238,7 @@ struct thread { int td_oncpu; /* (t) Which cpu we are on. */ volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */ u_char td_tsqueue; /* (t) Turnstile queue blocked on. */ - short td_locks; /* (k) Count of non-spin locks. */ + short td_locks; /* (k) Debug: count of non-spin locks */ short td_rw_rlocks; /* (k) Count of rwlock read locks. */ short td_lk_slocks; /* (k) Count of lockmgr shared locks. */ short td_stopsched; /* (k) Scheduler stopped. */ @@ -351,8 +351,14 @@ do { \ KASSERT((__m == &blocked_lock || __m == (lock)), \ ("Thread %p lock %p does not match %p", td, __m, (lock))); \ } while (0) + +#define TD_LOCKS_INC(td) ((td)->td_locks++) +#define TD_LOCKS_DEC(td) ((td)->td_locks--) #else #define THREAD_LOCKPTR_ASSERT(td, lock) + +#define TD_LOCKS_INC(td) +#define TD_LOCKS_DEC(td) #endif /* From owner-svn-src-head@freebsd.org Sun Aug 2 00:11:57 2015 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 9D04C9B198E; Sun, 2 Aug 2015 00:11:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 737BF1E2D; Sun, 2 Aug 2015 00:11:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720BvlN018595; Sun, 2 Aug 2015 00:11:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720Bvei018594; Sun, 2 Aug 2015 00:11:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020011.t720Bvei018594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286167 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:11:57 -0000 Author: markj Date: Sun Aug 2 00:11:56 2015 New Revision: 286167 URL: https://svnweb.freebsd.org/changeset/base/286167 Log: Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context. When a process is exiting, there is a narrow window where p_cred may be NULL while its threads are still executing. Specifically, the last thread to exit a process sets the process state to PRS_ZOMBIE with the proc spinlock held and then calls thread_exit(). thread_exit() drops the spin lock, permitting the process to be reaped and thus causing its cred struct to be released. However, the exiting thread may still cause DTrace probes to fire by calling sched_throw(), resulting in a double fault if such a probe enabling attempts to access the GID or UID DIF variables. The thread's cred reference is not susceptible to this race since it is not released until after the thread has exited. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 2 00:03:08 2015 (r286166) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 2 00:11:56 2015 (r286167) @@ -3510,7 +3510,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_uid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3522,6 +3521,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_uid); +#else + return ((uint64_t)curthread->td_ucred->cr_uid); +#endif case DIF_VAR_GID: if (!dtrace_priv_proc(state)) @@ -3533,7 +3535,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_gid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3545,6 +3546,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_gid); +#else + return ((uint64_t)curthread->td_ucred->cr_gid); +#endif case DIF_VAR_ERRNO: { #ifdef illumos From owner-svn-src-head@freebsd.org Sun Aug 2 00:15:53 2015 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 E4F339B19CF; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B2C8C1FD3; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720FrlQ018930; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720Fr6R018929; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020015.t720Fr6R018929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286168 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:15:54 -0000 Author: jmg Date: Sun Aug 2 00:15:52 2015 New Revision: 286168 URL: https://svnweb.freebsd.org/changeset/base/286168 Log: convert to C11's _Static_assert, and pull in sys/cdefs.h for compatibility w/ older non-C11 compilers... passed make tinerdbox.. Suggested by: imp Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Sun Aug 2 00:11:56 2015 (r286167) +++ head/sys/net/pfkeyv2.h Sun Aug 2 00:15:52 2015 (r286168) @@ -39,9 +39,7 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#ifndef _KERNEL -#define CTASSERT(x) struct __thisisjustnothing; -#endif +#include /* This file defines structures and symbols for the PF_KEY Version 2 @@ -231,7 +229,7 @@ struct sadb_x_policy { u_int32_t sadb_x_policy_id; u_int32_t sadb_x_policy_reserved2; }; -CTASSERT(sizeof(struct sadb_x_policy) == 16); +_Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch"); /* * When policy_type == IPSEC, it is followed by some of @@ -267,7 +265,7 @@ struct sadb_x_nat_t_type { u_int8_t sadb_x_nat_t_type_type; u_int8_t sadb_x_nat_t_type_reserved[3]; }; -CTASSERT(sizeof(struct sadb_x_nat_t_type) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_type) == 8, "struct size mismatch"); /* NAT-Traversal source or destination port. */ struct sadb_x_nat_t_port { @@ -276,7 +274,7 @@ struct sadb_x_nat_t_port { u_int16_t sadb_x_nat_t_port_port; u_int16_t sadb_x_nat_t_port_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_port) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_port) == 8, "struct size mismatch"); /* ESP fragmentation size. */ struct sadb_x_nat_t_frag { @@ -285,7 +283,7 @@ struct sadb_x_nat_t_frag { u_int16_t sadb_x_nat_t_frag_fraglen; u_int16_t sadb_x_nat_t_frag_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_frag) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_frag) == 8, "struct size mismatch"); #define SADB_EXT_RESERVED 0 From owner-svn-src-head@freebsd.org Sun Aug 2 00:18:49 2015 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 9C8379B1A06; Sun, 2 Aug 2015 00:18:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6BAC21B3; Sun, 2 Aug 2015 00:18:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720Inki019185; Sun, 2 Aug 2015 00:18:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720In8x019184; Sun, 2 Aug 2015 00:18:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020018.t720In8x019184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286169 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:18:49 -0000 Author: markj Date: Sun Aug 2 00:18:48 2015 New Revision: 286169 URL: https://svnweb.freebsd.org/changeset/base/286169 Log: Perform bounds checking when constructing a format string. This was detected by the FORTIFY_SOURCE build. PR: 201657 Reported by: pfg MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Sun Aug 2 00:15:52 2015 (r286168) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Sun Aug 2 00:18:48 2015 (r286169) @@ -1348,6 +1348,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE dtrace_aggdesc_t *agg; caddr_t lim = (caddr_t)buf + len, limit; char format[64] = "%"; + size_t ret; int i, aggrec, curagg = -1; uint64_t normal; @@ -1379,7 +1380,9 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE int prec = pfd->pfd_prec; int rval; + const char *start; char *f = format + 1; /* skip initial '%' */ + size_t fmtsz = sizeof(format) - 1; const dtrace_recdesc_t *rec; dt_pfprint_f *func; caddr_t addr; @@ -1536,6 +1539,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE break; } + start = f; if (pfd->pfd_flags & DT_PFCONV_ALT) *f++ = '#'; if (pfd->pfd_flags & DT_PFCONV_ZPAD) @@ -1548,6 +1552,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE *f++ = '\''; if (pfd->pfd_flags & DT_PFCONV_SPACE) *f++ = ' '; + fmtsz -= f - start; /* * If we're printing a stack and DT_PFCONV_LEFT is set, we @@ -1558,13 +1563,20 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE if (func == pfprint_stack && (pfd->pfd_flags & DT_PFCONV_LEFT)) width = 0; - if (width != 0) - f += snprintf(f, sizeof (format), "%d", ABS(width)); + if (width != 0) { + ret = snprintf(f, fmtsz, "%d", ABS(width)); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - if (prec > 0) - f += snprintf(f, sizeof (format), ".%d", prec); + if (prec > 0) { + ret = snprintf(f, fmtsz, ".%d", prec); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - (void) strcpy(f, pfd->pfd_fmt); + if (strlcpy(f, pfd->pfd_fmt, fmtsz) >= fmtsz) + return (dt_set_errno(dtp, EDT_COMPILER)); pfd->pfd_rec = rec; if (func(dtp, fp, format, pfd, addr, size, normal) < 0) From owner-svn-src-head@freebsd.org Sun Aug 2 00:22:15 2015 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 E6ABF9B1B4F; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D6C56867; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720MFCJ023072; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720MFqp023071; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020022.t720MFqp023071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286170 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:22:16 -0000 Author: jmg Date: Sun Aug 2 00:22:14 2015 New Revision: 286170 URL: https://svnweb.freebsd.org/changeset/base/286170 Log: mark this function as deprecated, and put the warning first, since I doubt most people will read to the end... Note the use of sys/cdefs.h for pre-C11 compilers... I didn't included a note about being compatibile w/ userland since a C11 feature should be obviously usable in userland... Suggested by: imp Modified: head/share/man/man9/CTASSERT.9 Modified: head/share/man/man9/CTASSERT.9 ============================================================================== --- head/share/man/man9/CTASSERT.9 Sun Aug 2 00:18:48 2015 (r286169) +++ head/share/man/man9/CTASSERT.9 Sun Aug 2 00:22:14 2015 (r286170) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2015 +.Dd August 1, 2015 .Dt CTASSERT 9 .Os .Sh NAME @@ -39,6 +39,15 @@ .Sh DESCRIPTION The .Fn CTASSERT +macro is deprecated and the C11 standard +.Fn _Static_assert +should be used instead. +The header +.Fa sys/cdefs.h +should be included to provide compatibility for pre-C11 compilers. +.Pp +The +.Fn CTASSERT macro evaluates .Fa expression at compile time and causes a compiler error if it is false. @@ -48,10 +57,6 @@ The macro is useful for asserting the size or alignment of important data structures and variables during compilation, which would otherwise cause the code to fail at run time. -.Pp -The -.Fn CTASSERT -macro is not usable in userland. .Sh EXAMPLES Assert that the size of the .Vt uuid From owner-svn-src-head@freebsd.org Sun Aug 2 00:23:22 2015 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 0353A9B1B9D; Sun, 2 Aug 2015 00:23:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DB23C9D4; Sun, 2 Aug 2015 00:23:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720NLnx023200; Sun, 2 Aug 2015 00:23:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720NJbP023190; Sun, 2 Aug 2015 00:23:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020023.t720NJbP023190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286171 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:23:22 -0000 Author: markj Date: Sun Aug 2 00:23:18 2015 New Revision: 286171 URL: https://svnweb.freebsd.org/changeset/base/286171 Log: - Remove hardcoded paths for the perl executable. - Rather than assuming that a process is listening on 127.0.0.1:22, use nc(1) to find an available port and bind to it for the duration of the test. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Sun Aug 2 00:23:18 2015 (r286171) @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # CDDL HEADER START # Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Sun Aug 2 00:23:18 2015 (r286171) @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # CDDL HEADER START # Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Sun Aug 2 00:23:18 2015 (r286171) @@ -58,12 +58,25 @@ fi dtrace=$1 local=127.0.0.1 -tcpport=22 DIR=/var/tmp/dtest.$$ +tcpport=1024 +bound=5000 +while [ $tcpport -lt $bound ]; do + nc -z $local $tcpport >/dev/null || break + tcpport=$(($tcpport + 1)) +done +if [ $tcpport -eq $bound ]; then + echo "couldn't find an available TCP port" + exit 1 +fi + mkdir $DIR cd $DIR +# nc will exit when the connection is closed. +nc -l $local $tcpport & + cat > test.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( @@ -76,7 +89,7 @@ cat > test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < 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 0207C9B1BCE; Sun, 2 Aug 2015 00:24:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E5FDFB2C; Sun, 2 Aug 2015 00:24:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720OOUl023324; Sun, 2 Aug 2015 00:24:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720OMv2023316; Sun, 2 Aug 2015 00:24:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020024.t720OMv2023316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286172 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:24:25 -0000 Author: markj Date: Sun Aug 2 00:24:21 2015 New Revision: 286172 URL: https://svnweb.freebsd.org/changeset/base/286172 Log: Don't hardcode the module or function component of lockstat probes. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Sun Aug 2 00:24:21 2015 (r286172) @@ -34,7 +34,7 @@ * */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_owned(); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Sun Aug 2 00:24:21 2015 (r286172) @@ -34,7 +34,7 @@ * */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_owned((kmutex_t *)arg0, 99); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Sun Aug 2 00:24:21 2015 (r286172) @@ -36,7 +36,7 @@ */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_type_adaptive(); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Sun Aug 2 00:24:21 2015 (r286172) @@ -35,7 +35,7 @@ */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_type_adaptive((kmutex_t *)arg0, 99); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d Sun Aug 2 00:24:21 2015 (r286172) @@ -48,7 +48,7 @@ BEGIN i = 0; } -lockstat::mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { ptr = mutex_owner((struct mtx *)arg0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Sun Aug 2 00:24:21 2015 (r286172) @@ -44,7 +44,7 @@ BEGIN ret = -99; } -mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { ret = mutex_type_adaptive((struct mtx *)arg0); i++; From owner-svn-src-head@freebsd.org Sun Aug 2 00:33:35 2015 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 C2FBD9B1DBC; Sun, 2 Aug 2015 00:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B3814F0F; Sun, 2 Aug 2015 00:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720XZY0027709; Sun, 2 Aug 2015 00:33:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720XZrA027708; Sun, 2 Aug 2015 00:33:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508020033.t720XZrA027708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 00:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286173 - head/usr.sbin/pw/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.20 Precedence: list List-Id: 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, 02 Aug 2015 00:33:35 -0000 Author: bapt Date: Sun Aug 2 00:33:34 2015 New Revision: 286173 URL: https://svnweb.freebsd.org/changeset/base/286173 Log: Remove netbsd tests on pw(8) First they are redundant with the tests we currently have on pw(8) Second they to modify the host database instead of being self contained withing the test directory Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:24:21 2015 (r286172) +++ head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:33:34 2015 (r286173) @@ -1,8 +1,5 @@ # $FreeBSD$ -TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/usr.sbin/useradd -.PATH: ${TESTSRC} - TESTSDIR= ${TESTSBASE}/usr.sbin/pw ATF_TESTS_SH= pw_etcdir \ @@ -24,12 +21,4 @@ FILES= group helper_functions.shin mast pw-modified.conf FILESDIR= ${TESTSDIR} -ATF_TESTS_SH+= pw_test -# - user{add,del} does not exist on FreeBSD; use pw user{add,del} instead -# - The command passes on FreeBSD -ATF_TESTS_SH_SED_pw_test= -e 's/useradd /pw useradd /' -ATF_TESTS_SH_SED_pw_test+= -e 's/userdel /pw userdel /' -ATF_TESTS_SH_SED_pw_test+= -e '/atf_expect_fail "PR bin\/39546"/d' -ATF_TESTS_SH_SRC_pw_test= t_useradd.sh - .include From owner-svn-src-head@freebsd.org Sun Aug 2 00:37:35 2015 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 5C4F59B1E8D; Sun, 2 Aug 2015 00:37:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 29B7310C8; Sun, 2 Aug 2015 00:37:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720bZ02028058; Sun, 2 Aug 2015 00:37:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720bYPt028055; Sun, 2 Aug 2015 00:37:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020037.t720bYPt028055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286174 - in head: cddl/usr.sbin/dtrace share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:37:35 -0000 Author: markj Date: Sun Aug 2 00:37:33 2015 New Revision: 286174 URL: https://svnweb.freebsd.org/changeset/base/286174 Log: Add a src.conf option to build and install the DTrace test suite. Reviewed by: gnn, ngie Differential Revision: https://reviews.freebsd.org/D3195 Added: head/tools/build/options/WITH_DTRACE_TESTS (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/Makefile head/share/mk/src.opts.mk Modified: head/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/Makefile Sun Aug 2 00:33:34 2015 (r286173) +++ head/cddl/usr.sbin/dtrace/Makefile Sun Aug 2 00:37:33 2015 (r286174) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace PROG= dtrace @@ -22,4 +24,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ LIBADD= dtrace +.if ${MK_DTRACE_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Aug 2 00:33:34 2015 (r286173) +++ head/share/mk/src.opts.mk Sun Aug 2 00:37:33 2015 (r286174) @@ -178,6 +178,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ + DTRACE_TESTS \ EISA \ HESIOD \ LLDB \ @@ -318,6 +319,10 @@ MK_KERBEROS:= no MK_AUTHPF:= no .endif +.if ${MK_TESTS} == "no" +MK_DTRACE_TESTS:= no +.endif + .if ${MK_TEXTPROC} == "no" MK_GROFF:= no .endif Added: head/tools/build/options/WITH_DTRACE_TESTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_DTRACE_TESTS Sun Aug 2 00:37:33 2015 (r286174) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build and install the DTrace test suite in +.Pa /usr/tests/cddl/usr.sbin/dtrace . +This test suite is considered experimental on architectures other than +amd64/amd64 and running it may cause system instability. From owner-svn-src-head@freebsd.org Sun Aug 2 00:56:17 2015 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 653009A5286; Sun, 2 Aug 2015 00:56:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 498471A65; Sun, 2 Aug 2015 00:56:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720uH21036541; Sun, 2 Aug 2015 00:56:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720uHW8036540; Sun, 2 Aug 2015 00:56:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020056.t720uHW8036540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286175 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 00:56:17 -0000 Author: markj Date: Sun Aug 2 00:56:16 2015 New Revision: 286175 URL: https://svnweb.freebsd.org/changeset/base/286175 Log: Regenerate after r286174. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Aug 2 00:37:33 2015 (r286174) +++ head/share/man/man5/src.conf.5 Sun Aug 2 00:56:16 2015 (r286175) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 284708 2015-06-22 20:21:57Z sjg .\" $FreeBSD$ -.Dd July 29, 2015 +.Dd August 1, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -137,8 +137,8 @@ associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks -Set to not build or install binutils (as, c++-filt, gconv, +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 286036 2015-07-29 20:02:20Z emaste +Set to not build or install binutils (as, c++-filt, ld, nm, objcopy, objdump, readelf, size and strip) as part of the normal system build. The resulting system cannot build programs from source. @@ -274,14 +274,14 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6hf, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL .\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as @@ -414,6 +414,12 @@ Set to not build dma Mail Transport Agen .\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb Set to not to install compressed system documentation. Only the uncompressed version will be installed. +.It Va WITH_DTRACE_TESTS +.\" from FreeBSD: head/tools/build/options/WITH_DTRACE_TESTS 286174 2015-08-02 00:37:33Z markj +Set to build and install the DTrace test suite in +.Pa /usr/tests/cddl/usr.sbin/dtrace . +This test suite is considered experimental on architectures other than +amd64/amd64 and running it may cause system instability. .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link @@ -1268,6 +1274,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_DTRACE_TESTS +.It .Va WITHOUT_TESTS_SUPPORT .El .It Va WITHOUT_TESTS_SUPPORT From owner-svn-src-head@freebsd.org Sun Aug 2 01:09:32 2015 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 BEFE89A5420; Sun, 2 Aug 2015 01:09:32 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AEA7E1EB4; Sun, 2 Aug 2015 01:09:32 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7219WEC041163; Sun, 2 Aug 2015 01:09:32 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7219UvB041157; Sun, 2 Aug 2015 01:09:30 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508020109.t7219UvB041157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 2 Aug 2015 01:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286176 - in head/tools/bus_space: . C Python X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 01:09:32 -0000 Author: marcel Date: Sun Aug 2 01:09:30 2015 New Revision: 286176 URL: https://svnweb.freebsd.org/changeset/base/286176 Log: Rename busdma_sync() to busdma_sync_range() and rename the base and size parameters to ofs and len (resp). Add a new busdma_sync() that makes the entire MD coherent. Modified: head/tools/bus_space/C/lang.c head/tools/bus_space/C/libbus.h head/tools/bus_space/Python/lang.c head/tools/bus_space/busdma.c head/tools/bus_space/busdma.h Modified: head/tools/bus_space/C/lang.c ============================================================================== --- head/tools/bus_space/C/lang.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/C/lang.c Sun Aug 2 01:09:30 2015 (r286176) @@ -227,8 +227,15 @@ busdma_seg_get_size(busdma_seg_t seg) } int -busdma_sync(busdma_md_t md, int op, bus_addr_t base, bus_size_t size) +busdma_sync(busdma_md_t md, int op) { - return (bd_sync(md, op, base, size)); + return (bd_sync(md, op, 0UL, ~0UL)); +} + +int +busdma_sync_range(busdma_md_t md, int op, bus_size_t ofs, bus_size_t len) +{ + + return (bd_sync(md, op, ofs, len)); } Modified: head/tools/bus_space/C/libbus.h ============================================================================== --- head/tools/bus_space/C/libbus.h Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/C/libbus.h Sun Aug 2 01:09:30 2015 (r286176) @@ -78,6 +78,7 @@ bus_size_t busdma_seg_get_size(busdma_se #define BUSDMA_SYNC_PREWRITE 4 #define BUSDMA_SYNC_POSTWRITE 8 -int busdma_sync(busdma_md_t md, int op, bus_addr_t, bus_size_t); +int busdma_sync(busdma_md_t md, int op); +int busdma_sync_range(busdma_md_t md, int op, bus_size_t, bus_size_t); #endif /* _LIBBUS_SPACE_H_ */ Modified: head/tools/bus_space/Python/lang.c ============================================================================== --- head/tools/bus_space/Python/lang.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/Python/lang.c Sun Aug 2 01:09:30 2015 (r286176) @@ -384,12 +384,27 @@ busdma_seg_get_size(PyObject *self, PyOb static PyObject * busdma_sync(PyObject *self, PyObject *args) { - u_long base, size; int error, mdid, op; - if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &base, &size)) + if (!PyArg_ParseTuple(args, "ii", &mdid, &op)) return (NULL); - error = bd_sync(mdid, op, base, size); + error = bd_sync(mdid, op, 0UL, ~0UL); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +busdma_sync_range(PyObject *self, PyObject *args) +{ + u_long ofs, len; + int error, mdid, op; + + if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &ofs, &len)) + return (NULL); + error = bd_sync(mdid, op, ofs, len); if (error) { PyErr_SetString(PyExc_IOError, strerror(error)); return (NULL); @@ -448,7 +463,9 @@ static PyMethodDef busdma_methods[] = { "Return the size of the segment." }, { "sync", busdma_sync, METH_VARARGS, - "Keep memory/caches coherent WRT to DMA." }, + "Make the entire memory descriptor coherent WRT to DMA." }, + { "sync_range", busdma_sync_range, METH_VARARGS, + "Make part of the memory descriptor coherent WRT to DMA." }, { NULL, NULL, 0, NULL } }; Modified: head/tools/bus_space/busdma.c ============================================================================== --- head/tools/bus_space/busdma.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/busdma.c Sun Aug 2 01:09:30 2015 (r286176) @@ -536,7 +536,7 @@ bd_seg_get_size(int sid, u_long *size_p) } int -bd_sync(int mdid, u_int op, u_long base, u_long size) +bd_sync(int mdid, u_int op, u_long ofs, u_long len) { struct proto_ioc_busdma ioc; struct obj *md; @@ -549,8 +549,8 @@ bd_sync(int mdid, u_int op, u_long base, ioc.request = PROTO_IOC_BUSDMA_SYNC; ioc.key = md->key; ioc.u.sync.op = op; - ioc.u.sync.base = base; - ioc.u.sync.size = size; + ioc.u.sync.base = ofs; + ioc.u.sync.size = len; if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) return (errno); Modified: head/tools/bus_space/busdma.h ============================================================================== --- head/tools/bus_space/busdma.h Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/busdma.h Sun Aug 2 01:09:30 2015 (r286176) @@ -51,6 +51,6 @@ int bd_md_next_seg(int mdid, int sid); int bd_seg_get_addr(int sid, u_long *); int bd_seg_get_size(int sid, u_long *); -int bd_sync(int mdid, u_int op, u_long base, u_long size); +int bd_sync(int mdid, u_int op, u_long ofs, u_long len); #endif /* _TOOLS_BUS_DMA_H_ */ From owner-svn-src-head@freebsd.org Sun Aug 2 02:00:21 2015 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 7F3AD9A5E4F; Sun, 2 Aug 2015 02:00:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6FC9215AC; Sun, 2 Aug 2015 02:00:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7220Let062981; Sun, 2 Aug 2015 02:00:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7220LCW062980; Sun, 2 Aug 2015 02:00:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508020200.t7220LCW062980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Aug 2015 02:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286177 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 02:00:21 -0000 Author: jhb Date: Sun Aug 2 02:00:20 2015 New Revision: 286177 URL: https://svnweb.freebsd.org/changeset/base/286177 Log: Fix a couple of markup typos. MFC after: 2 weeks Modified: head/lib/libc/stdio/open_memstream.3 Modified: head/lib/libc/stdio/open_memstream.3 ============================================================================== --- head/lib/libc/stdio/open_memstream.3 Sun Aug 2 01:09:30 2015 (r286176) +++ head/lib/libc/stdio/open_memstream.3 Sun Aug 2 02:00:20 2015 (r286177) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2014 +.Dd August 1, 2015 .Dt OPEN_MEMSTREAM 3 .Os .Sh NAME @@ -86,13 +86,13 @@ will contain the start of the memory buf will contain the smaller of the current position and the current buffer length. .Pp After a successful call to -.Xr fflush 3, +.Xr fflush 3 , the pointer referenced by .Fa bufp and the variable referenced by .Fa sizep are only valid until the next write operation or a call to -.Xr fclose 3. +.Xr fclose 3 . .Pp Once a stream is closed, the allocated buffer referenced by From owner-svn-src-head@freebsd.org Sun Aug 2 02:03:34 2015 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 BAB8A9AA02D; Sun, 2 Aug 2015 02:03:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::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 8B2E91994; Sun, 2 Aug 2015 02:03:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pachj5 with SMTP id hj5so63341930pac.3; Sat, 01 Aug 2015 19:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ml8fx/NoV4PSUv0/P32hIAkcpbAQPlRch8Z7oqjVL8Q=; b=cRCeVVYgOksgwbytTbelLgRnRRxcpbd0WCNh1RhbA7pVcBExFDedLRyiOnBkoq9SN7 5tl4iqKRGsfFjgs/TXe+pQS0AI3oM/9vrh9avimill4it8tgiIY0xT2c912fQGA6TtM8 MGmBM3lTtX9wiZYvOFsbIYhSQYNkHSnZ+pMCwB/DYgRHqZBwIxhlHsSkf3BWN22KY82j sfKuon9TWL3FnT8pkTQix6v4/IVLxlrNp2oFFEKo7QfIuZzLH4xcrNyb3zMnBORBgkFE j4opsYaYr61uY5laS8G7u3Pgkp9XOejdBGRrdBCcjeRMTvRrUIX1/UzlYBTHMawlO6Rt eshQ== X-Received: by 10.68.198.37 with SMTP id iz5mr389949pbc.129.1438481013914; Sat, 01 Aug 2015 19:03:33 -0700 (PDT) Received: from [33.172.230.148] ([172.56.32.252]) by smtp.gmail.com with ESMTPSA id au10sm3355397pbd.33.2015.08.01.19.03.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Aug 2015 19:03:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r286173 - head/usr.sbin/pw/tests From: Garrett Cooper X-Mailer: iPhone Mail (12H143) In-Reply-To: <201508020033.t720XZrA027708@repo.freebsd.org> Date: Sat, 1 Aug 2015 19:03:31 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <171F8C8E-9FEC-4F30-BF9D-42F3D74F6B50@gmail.com> References: <201508020033.t720XZrA027708@repo.freebsd.org> To: Baptiste Daroussin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 02:03:34 -0000 > On Aug 1, 2015, at 17:33, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sun Aug 2 00:33:34 2015 > New Revision: 286173 > URL: https://svnweb.freebsd.org/changeset/base/286173 >=20 > Log: > Remove netbsd tests on pw(8) >=20 > First they are redundant with the tests we currently have on pw(8) > Second they to modify the host database instead of being self contained w= ithing > the test directory >=20 > Modified: > head/usr.sbin/pw/tests/Makefile >=20 > Modified: head/usr.sbin/pw/tests/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:24:21 2015 (r28617= 2) > +++ head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:33:34 2015 (r28617= 3) > @@ -1,8 +1,5 @@ > # $FreeBSD$ >=20 > -TESTSRC=3D ${.CURDIR}/../../../contrib/netbsd-tests/usr.sbin/useradd > -.PATH: ${TESTSRC} > - > TESTSDIR=3D ${TESTSBASE}/usr.sbin/pw >=20 > ATF_TESTS_SH=3D pw_etcdir \ > @@ -24,12 +21,4 @@ FILES=3D group helper_functions.shin mast > pw-modified.conf > FILESDIR=3D ${TESTSDIR} >=20 > -ATF_TESTS_SH+=3D pw_test > -# - user{add,del} does not exist on FreeBSD; use pw user{add,del} instead= > -# - The command passes on FreeBSD > -ATF_TESTS_SH_SED_pw_test=3D -e 's/useradd /pw useradd /' > -ATF_TESTS_SH_SED_pw_test+=3D -e 's/userdel /pw userdel /' > -ATF_TESTS_SH_SED_pw_test+=3D -e '/atf_expect_fail "PR bin\/39546"/d' > -ATF_TESTS_SH_SRC_pw_test=3D t_useradd.sh > - > .include You forgot to add an ObsoleteFiles.inc entry..= From owner-svn-src-head@freebsd.org Sun Aug 2 02:23:31 2015 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 8EFE29AA45A; Sun, 2 Aug 2015 02:23:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7F96D389; Sun, 2 Aug 2015 02:23:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t722NVrG075470; Sun, 2 Aug 2015 02:23:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t722NVMx075469; Sun, 2 Aug 2015 02:23:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508020223.t722NVMx075469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 02:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286178 - 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.20 Precedence: list List-Id: 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, 02 Aug 2015 02:23:31 -0000 Author: bapt Date: Sun Aug 2 02:23:30 2015 New Revision: 286178 URL: https://svnweb.freebsd.org/changeset/base/286178 Log: Add removed tests to ObsoleteFiles.inc Submitted by: ngie Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 2 02:00:20 2015 (r286177) +++ head/ObsoleteFiles.inc Sun Aug 2 02:23:30 2015 (r286178) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150802: Remove netbsd's test on pw(8) +OLD_FILES+=usr/tests/usr.sbin/pw/pw_test # 20150719: Remove libarchive.pc OLD_FILES+=usr/libdata/pkgconfig/libarchive.pc # 20150705: Rename DTrace provider man pages. From owner-svn-src-head@freebsd.org Sun Aug 2 03:09:22 2015 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 1201D9AAAD4; Sun, 2 Aug 2015 03:09:22 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0141.outbound.protection.outlook.com [65.55.169.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47A8B1A91; Sun, 2 Aug 2015 03:09:20 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BLUPR05CA0055.namprd05.prod.outlook.com (10.141.20.25) by BLUPR05MB706.namprd05.prod.outlook.com (10.141.207.13) with Microsoft SMTP Server (TLS) id 15.1.225.19; Sun, 2 Aug 2015 02:34:34 +0000 Received: from BN1BFFO11FD038.protection.gbl (2a01:111:f400:7c10::1:138) by BLUPR05CA0055.outlook.office365.com (2a01:111:e400:855::25) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Sun, 2 Aug 2015 02:34:34 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BN1BFFO11FD038.mail.protection.outlook.com (10.58.144.101) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Sun, 2 Aug 2015 02:34:34 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 1 Aug 2015 19:34:33 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t722YWD72406; Sat, 1 Aug 2015 19:34:32 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 08273580AB; Sat, 1 Aug 2015 19:34:32 -0700 (PDT) To: Baptiste Daroussin CC: , , Subject: Re: svn commit: r284345 - in head: . bin/cat bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/expr bin/freebsd-version bin/getfacl bin/hostname bi... In-Reply-To: <20150726204948.GD1522@ivaldir.etoilebsd.net> References: <201506131920.t5DJKwMH033508@svn.freebsd.org> <20150726204948.GD1522@ivaldir.etoilebsd.net> Comments: In-reply-to: Baptiste Daroussin message dated "Sun, 26 Jul 2015 22:49:48 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 1 Aug 2015 19:34:31 -0700 Message-ID: <852.1438482871@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD038; 1:1WfYNFERfo/zOG8AJq2zcccV2ZxJI78p73xXRwYfJ2wFfxjdhacSYgdBDsQEg5PgfiIwEwwKIDoVY5QPHRGYvPd+gqctOAP0R1W9FPaYLbn+ngjNoG6cF8Jmwf7OqV2Ucp68114KslLbzXh5TKUUunQV2Z23hmjwxuVu0QPgmLSyHvuVhVqqd/vlL7CH7nWuxeuIQ9EUUG1JItJICYeVgaAwkhHFzeT3pAnNZ9AAEa8rYdq0mKHosXID+9EBuS56BequxfSve7bY+WkGX756uSF68XOeG8ZQ8Q8Nb0V0isM= X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(2980300002)(24454002)(199003)(189002)(48376002)(77156002)(62966003)(105596002)(450100001)(106466001)(19580395003)(76506005)(57986006)(86362001)(19580405001)(189998001)(2950100001)(6806004)(50226001)(77096005)(92566002)(110136002)(117636001)(87936001)(50986999)(46102003)(47776003)(76176999)(5001960100002)(5001920100001)(5003940100001)(50466002)(33716001)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB706; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 2:m+Syck2nmmIvpQEtscJ+mE1PVEgUyfW6oFPbfKGpdOgTEnb/TPUwSzNKeSTqk9jeZDGWOH4+R0vrAM5nC22pA/BmHmD4FhYsOxIghLnyuWUlpPiTXnj5yF5bzyhFsP763chKYgpQKY5RiwPbo3PkCJhC3iHsIpoqqU66k/7k6q0=; 3:ghswePUtJ6R016WnX8EcM+MjN5hreVMt14kTd843ZzMJ7bvZfnluAxwrsEswZADrdKEBfpy2bUNev+SnKF4GNQoEpLVleUQagejQ9sShCGrldNefBljEBmV1CnyXdy3ZEkrmr+u1o+n1MGKS6xc+mW4edoWJ/l7cxxabtBJxgUoedaBGQ8NsC+Hz2X/4byMh9UoIKqqa10Aye0nWGF5BlIUhxhIIz4hp8kCLc6Ygo3g=; 25:C2EJQQfyd2yv8Hf/FwQNsskz3dayN0ELm72JQwO4TUNNVYP5FKqtb4ijGrZjFbeki8SjddBRxuA5yGiT09vtAXapuWQHVvp925gvD9UYW5LI5l0KYMVHdnJ01PAzDX/V3bZpXIG8i4GWwlyfIvUEIF2TnCilnqvbtqyDAKGM12BaivHuwBJZ6n//7fUVsHcFNYXr8Mn0JPdzZys1iktcmMvXfYdtuMlRX0zpz3nPiOwoI7l+YlI95T0Kv51uK9ihii7uzAsCH+1iZdQd/FPeYQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB706; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 20:AutHj0wbSMYhaEl1zi4rOxjcKidBxjS2ltEuKjIhOjinifUG0trM1RN0NMpJrDs7bBwQdjpogfTLXjcYLGAJMDrUpbQ2qA3niaU1RJRKkvsjxeY7TV9lraHonNXXxt6Oje76Fo86w1OCWNM9npcO8RMzN9DIKfxB9DHDhYak/UraUYCmKcApd4Rshh6w3vP81+z3joaVrBdvtHQ0F0R/NIirOvM2tbm288kHQwy8b4xpUuT8m9RsiDcInkSPIoYyQWZ905Nko8DxkEZ+p6+3JZ11UODjmcKocu6OZXBsq3Sj+X/GcmB9bH2IaUJZmLl3vZKQJxVjrtcvmEP86D+LxH/4hlCJyxMgRrwnWsKZJpbmT8c1iXIOojgLWKmI/HRhI7Cwz85CMcHEc6V4nrSQgtQUp7FhO/Fneurn4t2RZMM3gySKJGU8tW7KGQPvJJPKz64wuvhHeeBL6PjBJVC5bA2O9qm66IRNqFl9Cu+DZoYqaGhenRYrePM4wH/iwHQk; 4:q+/u1zcaaWlv2nnyf78fXMqeqAaFtlP87Vj0bMYsw3N5bYDFMe/ZMLuaP7o0VnBg4GikgtDxJrvI0U8hJAgt6skQarysrUAkWlNzX5HGblSdwvC/OJPFkHwvSY81xGK1VEGHuF81qzubRUOOAP97tDSpswmn3lb6/8Vf5VxnofyHEBOURX+DFbGyNl88aDd+jZX7XIEncGy3HF+V8m1Kn9P/gzc61RwgXD7zR5vvOylFBMMFdjlu8+kobBWyHbH4v5KxC58O5n39g6iI4s51SDNK5g5P6y2OYQ94yBRfsHM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(10322497157591); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR05MB706; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB706; X-Forefront-PRVS: 0656A4403B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB706; 23:Oq09VV6ESbpgLPS45MPQYh+5168k31ql/8y0BCxd3o?= =?us-ascii?Q?VPU7DCAjG7hOOsjbhlN+dClu2LqUtcTyNN8aINU1jnPt0QtniD+yYOL26qKe?= =?us-ascii?Q?PRBSDn5G3AWDnt3pBFgqatIRR0YbFawlamRznXuQme8CxVW7EvAtSwQoD7wj?= =?us-ascii?Q?tM6anlrKhEe2JC+DLHS6pZBWNM6xjn8S6RvxpZRU+NYXGircmpiKeiiJPHrv?= =?us-ascii?Q?+17f+ervHRcY12L7V4ewB4YFjrSA2A0Vl+CqFpyLNcD8oVU3+eOg3X/ARG7D?= =?us-ascii?Q?4idIlxezgmtrLY+7Oo7goC+BMU9kL930fPLKvtvfZdfw23gQ0yzRm/eGGQq3?= =?us-ascii?Q?CUZN+DOndeHB+/nTwtAibCzvL5tk2ikEX5guiFsoPuMoxPMV7BFnc3SzPxAT?= =?us-ascii?Q?8Rjc5pKW/vuekXXGOhnQ6838NNLg6Z7Lp4ZvcXwLWY2K8cTFv2rxblP315c0?= =?us-ascii?Q?4NKRGJzQubwqKyFEUqknDZOQPw4kqyHplVG3UFxfhaEDwMeCMukViriXenlc?= =?us-ascii?Q?WZnVwufZANnKipdxqnJunux0avFgDiyhGbxzRbd3xXQGlQwJnyd0YB8SUpIG?= =?us-ascii?Q?xYtLSelD7inX85wvFToiM1KiUoyGdG8Wexq0qv8VdYtncMRjrJiVtocb13Qr?= =?us-ascii?Q?hpREP62yEYN/Syxr5R8MkbN2ZMJhjMhy27ijQLCR5UpSaganbOtTOEslWvGD?= =?us-ascii?Q?xOAwp1g/3qzQBJOdzDbzDJKDF7zxSUP6NpkhgaMJaNX+ZcoaTz0Tg6NTuAK1?= =?us-ascii?Q?5rdslfaIM9wnpcIYZgz2UIELptjL0SBfidhEi44EMaVmPM+qmzD4NqukRbmZ?= =?us-ascii?Q?JLOZalYz4e7kmJ4etFBdC/5YBMgb8qvlMmmteZ5UTg/5O4CZLEqwNDkxm1yY?= =?us-ascii?Q?8BDwqgEGItYQZVk7Jg4AVG5YEkygISw+kzGC0sV8uKkY8kmRAAf1CSAy007U?= =?us-ascii?Q?AHn2Xx4ZmLpLVhwEERzDu9NM6brBkBJS99tC8mT9xQa/PCRtxjh/XYDhsqe9?= =?us-ascii?Q?zsfP6Gp+nrrcv5GoO9J3yn1o6ZAxmZU3qJhl7dDBswfg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 5:MO3EEVQaPmHR4wph4byTfSUg/ZOIN/o/tkcYEH4VnJsdmT/U05ZD0L/EoLyvEuyQONJ1EKZlx3d/CegFTGoZz29PjOSq507eIM7gvjzu0iu24+plABoQG7h3afLbHEOROgsCxlfzoQz8r0+iuYzHCg==; 24:DzDz5EvAzl448Q41jIw/YiPcfzXtz+nVL2dIDeoag22s2Rv65RGXfeROn/Acz3hjLt33GI8vV4thviUxY96KoOPGy85A1JrrB4g8wopqgzI=; 20:v/DTV1LzgGuRaEOQDYPnKwNtKtogN42J2tPYXhjCYROL+oRULky4mF5RG1Z25aXkAZqr19Tbnz1aTkpIC7Ogrw== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2015 02:34:34.0230 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB706 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 03:09:22 -0000 Baptiste Daroussin wrote: > This breaks using fmake from ports because of usage of :U in sys.mk Oops - sorry. I saw Warner posted a patch for this which looked ok, but doesn't appear to have been committed. > is compatible with FreeBSD 9 (not that I'm just speaking about sys.mk not other > parts) Understood. AFAICT the following allows fmake to consume sys.mk Index: share/mk/sys.mk =================================================================== --- share/mk/sys.mk (revision 286177) +++ share/mk/sys.mk (working copy) @@ -33,8 +33,10 @@ # early include for customization # see local.sys.mk below -.-include +.sinclude +.if defined(.PARSEDIR) +# none of this is relevant without bmake .if ${MK_META_MODE} == "yes" .-include .elif ${MK_META_FILES} == "yes" && ${.MAKEFLAGS:U:M-B} == "" @@ -44,6 +46,7 @@ # This needs to be done early - before .PATH is computed .-include .endif +.endif # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall @@ -361,7 +364,7 @@ .endif # late include for customization -.-include +.sinclude .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} @@ -378,11 +381,12 @@ # when running target scripts, this is a problem for many makefiles here. # So define a shell that will do what FreeBSD expects. .ifndef WITHOUT_SHELL_ERRCTL +___MAKE_SHELL?= /bin/sh .SHELL: name=sh \ quiet="set -" echo="set -v" filter="set -" \ hasErrCtl=yes check="set -e" ignore="set +e" \ echoFlag=v errFlag=e \ - path=${__MAKE_SHELL:U/bin/sh} + path=${__MAKE_SHELL} .endif .include From owner-svn-src-head@freebsd.org Sun Aug 2 04:10:43 2015 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 CD1539AF744; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4E1B66; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id C4C2310406B6; Sun, 2 Aug 2015 14:10:34 +1000 (AEST) Date: Sun, 2 Aug 2015 14:10:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286168 - head/sys/net In-Reply-To: <201508020015.t720Fr6R018929@repo.freebsd.org> Message-ID: <20150802133842.N894@besplex.bde.org> References: <201508020015.t720Fr6R018929@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=z-DsBK8JfUJZqYZcnlkA:9 a=2pKiAXyLDbeUMeCR:21 a=tvztPCtJRzYOqW92:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 04:10:43 -0000 On Sun, 2 Aug 2015, John-Mark Gurney wrote: > Log: > convert to C11's _Static_assert, and pull in sys/cdefs.h for > compatibility w/ older non-C11 compilers... This include is bogus. already depends on the includer including other headers that include . Mainly . defined massive namespace pollution that includes everything in . It includes an infinite number of times via recursion, except the recursion is stopped by anti-reinclude guards. Th recursion makes the static number of nested includes of hard to count. Also, this is a kernel header. All kernel headers depend on the includer including and . Some work accidentally without this, and broken includers depend on this. For example, this file didn't depend on for the definition of CTASSERT() and wasn't broken when CTASSERT() was added, but if any includers of it that didn't include had there brokenness exposed. and defined much more massive namespace pollution than , together with some names that that are not pollution. Almost everything in is now part of the API. As a result, most kernel headers should not include . Some leaf headers like the x86 _types.h check that it is included before them. Some headers that are intentionally shared between the kernel and userland have a sloppy but non-polluting _KERNEL section that depends on many includes (mainly all the ones in and doesn't include anything explicitly, followed by a non-sloppy userland section that begins with an include of . This include used to be used for __BEGIN/__END_DECLS and __P(()) but is now just used for the former. Macros like __BEGIN/__END_DECLS and _Static_assert are just as ugly as __P(()) and should go away, but they have proliferated faster than __P(()) went away. The non-sloppyness includes not including but using basic types and declaring the few ufoo_t types that are part of the documented API of the header. If an application wants to abuse a kernel header, then it must fake the kernel environment for it. I don't know much about this header, but it is not documented in any man page so it can do anything. Bruce From owner-svn-src-head@freebsd.org Sun Aug 2 04:15:50 2015 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 B30239AF862; Sun, 2 Aug 2015 04:15:50 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0126.outbound.protection.outlook.com [207.46.100.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98361DAB; Sun, 2 Aug 2015 04:15:49 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from SN1PR0501CA0029.namprd05.prod.outlook.com (10.163.126.167) by CO2PR05MB634.namprd05.prod.outlook.com (10.141.199.17) with Microsoft SMTP Server (TLS) id 15.1.225.19; Sun, 2 Aug 2015 04:15:42 +0000 Received: from BY2FFO11FD022.protection.gbl (2a01:111:f400:7c0c::176) by SN1PR0501CA0029.outlook.office365.com (2a01:111:e400:52fe::39) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Sun, 2 Aug 2015 04:15:41 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BY2FFO11FD022.mail.protection.outlook.com (10.1.15.211) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Sun, 2 Aug 2015 04:15:40 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 1 Aug 2015 21:15:40 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t724FeD12834; Sat, 1 Aug 2015 21:15:40 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id D23EF580AB; Sat, 1 Aug 2015 21:15:39 -0700 (PDT) To: Bryan Drewery CC: , , Subject: Re: svn commit: r284598 - head/share/mk In-Reply-To: <55B8268A.5030305@FreeBSD.org> References: <201506191456.t5JEuPDU074336@svn.freebsd.org> <55B8268A.5030305@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Tue, 28 Jul 2015 18:04:10 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 1 Aug 2015 21:15:39 -0700 Message-ID: <4974.1438488939@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD022; 1:ZAgONPxEYyA/lxRARhiiNzFA3ZIzeBjP7Ri/Wy1+jAW1LWDoUa2WsESJFVR4I1yWp0Px3f0B07w9JaARhV4FxZltl6jgq9UtTIMSEn9mYFejomuFZpLscsKMPEw/8tLYFJNh+ldUQ3y/sZW8ub3rcbvD1jFfYvq3yHrS6BkG542MaR4hnrfKR/R4R+r+4M7dsJTe0UE345BQZvKXZ/ClzaCy5f/tS4UWcSIoTYZviMVzY7PCncp7BK9Dji7ncyBVDsTXRccr41KS1qO5zDMZsMrzapmRD556J62OXplo+o8= X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(24454002)(189002)(57986006)(87936001)(76506005)(50466002)(47776003)(19580405001)(450100001)(5001960100002)(62966003)(189998001)(110136002)(106466001)(77156002)(105596002)(48376002)(50226001)(117636001)(46102003)(50986999)(92566002)(77096005)(2950100001)(33716001)(76176999)(86362001)(6806004)(19580395003)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB634; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 2:J9sIMeBQxh4C/VMuWiJkOOSuL4dtRvWtFxztHjx6R3Yj+gwlvu5AKsQB69viN6sdwxkCAXQxycgOmwHdAzPVaGX0+Dt+W8xrJg4jNtC5zBRwclDWSaEn0+A7EhEXX+en8I9cGrGcBDkxexbx6K2TzolX+FWyXQXa5VgHC8CzFdI=; 3:SfFyYbjk9xEDOrslYQORi/+8Biq0ZvczCw2ZBI/6aJ85Am9baymZuqEJRPWzmSoTO6BAJXqRzZ+OUqtqRUyt3y5qq8Ah5SbwamOYunrcfX6MaIKeSSMRnDhT/HGYKmGUO1tIaqHKAuIPP4AdVCLqV6vNF0d/SgQog/yXZV6YtTIenKx4z/QYGlpMk/cFPY9JBnw6Z/0TOjqZ1icXfOS5QvnUnNZzIGw5tHqBJU2c4bM=; 25:+Hy+slv74EI+JG+N9jGoYvAmWs3Sy+UbdhjXmLE8I4exygSD9ONNeKXDa613b2AcjD/o/0l4KjsQ/j1/y6dlSrnBya6dXSPyVHsMg+g6WnmrN5TBq09R+j9ooo+JyDVxN5E57DaUKiXk/Deoh6WSsE9bmj5ktG9NNv7oOAoqwcEocvt4oZj92/CRISO5QW9ePppyfOyXJgcOK+Fj3GZa3dYGnSWtT/EXottTZD6dJrHXxYaCc14A4VoV6dC1uCV71Aaw1rbQ3VJF9SMkHfCmlw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB634; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 20:lBJ9UeVEuE13AZkO1anlHMQX/WH2XwpgPpr90kufUQJ5NLfLdl/cdeUe0vOlssJ0+lvM3Dop5c8Ea6nAwH2z6zopLMd3pL4OL+IxQCHcmiGoZZ2P5cWjuICUO2quIf06d2/2FesWg8IbJkqJdUXmJs1t+OzpcEMS+wKEbSPXZxxr7Jtf6DI1mSqp6oQD7gBmb+/Doas49/LVug7VW4MRXyGezF1qb7FCQEIWl2lz3Nl+/Z3JIPqQFQmHVszem5y5km9+7v+DHqtWX54cLS/2AAX89jFxwNGzzwzrhg/hDL6jJLQzUfr5D1QEiy/E2VDsgSzBFks71AG2YrfHCPqgN2tr21wZTidqWartgZX1qjX7KuFX4rhRYLgQFKg4dlz8hruFHHbePDTvw33Ss1HgwHTTRyI8+woCepuoYnV0TTNqE+3OlOdgSA0gRg53QN4OqVV/4Wd1n3FDYO5bw5Mxftglp7zed/ATeje9NZwuj+D5cb/kZYHNDVAo9gw9rbgJ; 4:RhzTd3xJI9eHZKLqfzoCN/LZlPZL8u+yUk3H7gm4+ctidH5zFaw2vMihInmonxiGl4V2Q2aFkxVkzuXlcjT05A2odDh0KQK/jjTmPSEmbGvdHB1tD4Hm96FpUeuQkkCD0Ni+PxJnrjjYDL79NNyOPgPKhv39cOLk9cQNCERmjkMaSpB0ddwrLk+AnbexxnjjqEmUFGXqQByqG3j+LNJNUSffsou3fYER7qG+uETzm/CIkHvZEJvXmq4jvz00BUCzKKmHj5I0Hh4K07ktLwipcmU+lk5d4VkcDTTnrWi2NMY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CO2PR05MB634; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB634; X-Forefront-PRVS: 0656A4403B X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 23:qw3OUvgS1JgRuHZT/zKsRq4+vIh+khgTTCKffhmS3Y3ktb/ZuAFw1xO2z7CHSV7oZYlsALSO6UR5jBm48FQkMl2HsTyuwwMB9m3PavlbpqyCf+6yOw8keKfql9fHATO+gh6HrvPvTnmTDuoLg4vFjlqjHdkT5H4MQVbzZg8AgN7CCNlJdwgjMz38RpVjm8wghoX6D+CYEbcml1uUL6RYEb2N/r0q79D5liJ6rfog2H9pefncJKmv+cvRbjuEPtOluUemEjLHMvP0bsmn1Xge2+15wTJE7rPkSs2n4Qtt5dhf0wV6VhFWVymml4Y7l9Km4Zx66rnzLlECTPn/MkqHxGL7O81JchwSsAKnl3sTaoHRvxrA9d0RFZSW6GAk+7ItamB3G5MXfP294KIVKnGtqKmkxFQELRR8sqSfgn6JEla/mSiZlmRU4bcObTkuuapEbd5ylotICHfE9m+tScYNoZsRLejrPLGJ4oXHN2II85kHG4463uO5VoAkQc0hgrND4zT2JpwsJ661lJBE4ILVQ2lfLYqIb0RVssB5KBshii9Bv/TWU3pXl3Ziw3nhqzppwxAd42/MFddcmiVuGIVYQC1rhwZmJfaWJGW/NUqI9VW+E7GQyEXwIk1itpccag8Claka6bUcSkoL4leciGGhqvd3IzG4IBEA1U4qWWzE0/8u3iyDBE9mlzdZQ0NnKTaf4VdZ4P1L41iIJPfIJJSjZRKgZWym9wc2p4aUro90Apcty7STR0pHuwwhjxH7U8uoLjXxOq1kd3FgOv7kXoK8ws8NgL7X73/IMiMBA0z6oFZIz9Gd36TE+9ROYDBLIHWJHbE/3+iXD46WYUd6qVDbBXVP68/2xKao9Ge0bD32s9qEaZxchWpiGLn/X3jM1IJKAiasPcI/tv9IL5ySW4H/IA== X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 5:WDFhYw3HqXSbRwoeBlJOrFOogkX7w2ilnZ/WcR1tGZackAC74OD4AHoOdWfq2M8vIDQrAUMsIipkQA3KV+LavY4QHzDb2tSNLokrna01CamivcUAJcKx0a33a4Y2/l+ST1/aGB36YZ/nDW8Bqyd5xw==; 24:MVcHemA2guvVWfVmQhfmkL4UA3YbmjQ/zvxoTn04f/YS1iCgiZUP3mLY7RhT3FOG05Rz+/3Y6Zm+FBLAynZyuMGs7jQ6MPCG0CtvILhgYjQ=; 20:grZ8GXkWEFeyfifPz6dUN+36IzFgbxVkUaUx0VGpRouHZlOwrfIO3Ah8Jr10a79XUQZV6+yiGAfWJSe/q8efFA== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2015 04:15:40.9231 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB634 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 04:15:50 -0000 Bryan Drewery wrote: > > head/share/mk/local.sys.mk > > I'm bothered by the amount of local.* files committed in the tree. I > expect, as a user and working in a downstream product, that a local.* > file is MINE, not FREEBSD. The pattern of using 'local' is quite common > as a *user* file. Yes that's exactly the point. local*mk (and src*) do not get installed in /usr/share/mk, yet the inlcudes exist as points for you to customize the behavior. > Why are these named as such? It seems they should just be 'src.' with > .sinclude hooks for actual local overrides. local* are name as such since that's all that bsd* should know about. Providing for local customization. Ideally the local.*.mk in src/share/mk would do nothing except include src.*mk which is where the smarts for building src should be. But /usr/share/mk/ should know noting about src* since it is supposed to be generically useful infra. There's extra stuff there because it might be useful as an example. We can work on that over time I guess. After many years consulting and providing tools to customers, I really like making it possible for them to customize without touching (hacking) any of the original bits, it has worked very well. That's key when you get to something really complicated like dirdeps.mk > > +# site customizations that do not depend on anything! > > +SRC_ENV_CONF?= /etc/src-env.conf > > +.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_) > > +.-include "${SRC_ENV_CONF}" > > +_src_env_conf_included_: .NOTMAIN > > .endif > > This needs to be documented in at least src.conf(5). I'm concerned that > the need to add this indicates subtle changes elsewhere that may break > existing /etc/src.conf setups, but I cannot find an example. Sorry, I didn't do the above originally; what is the concern? > > +# late include for customization > > +.-include > > In local.sys.mk from r284345 is an inclusion of SRCCONF, which is now > different and earlier than before. I wonder if this should move back to > only being included from bsd.own.mk (there is even a lingering > WITHOUT_SRCCONF check in that file). The way it is now is very obscure > in terms of when it is actually included and from where. Since I didn't move the inlcude of src.conf from bsd.own.mk (I would *guess* it was part of the src.opts changes) I'm not sure what the pros/cons of the two locations are. Certainly changing *anything* has potential to bite someone, but it is very hard to improve without change. From owner-svn-src-head@freebsd.org Sun Aug 2 04:34:03 2015 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 E70089AFD24; Sun, 2 Aug 2015 04:34:03 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AEA366A2; Sun, 2 Aug 2015 04:34:03 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t724Y2Ar081690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Aug 2015 21:34:02 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t724Y2AX081689; Sat, 1 Aug 2015 21:34:02 -0700 (PDT) (envelope-from jmg) Date: Sat, 1 Aug 2015 21:34:02 -0700 From: John-Mark Gurney To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286168 - head/sys/net Message-ID: <20150802043402.GP78154@funkthat.com> References: <201508020015.t720Fr6R018929@repo.freebsd.org> <20150802133842.N894@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150802133842.N894@besplex.bde.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 01 Aug 2015 21:34:03 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 04:34:04 -0000 Bruce Evans wrote this message on Sun, Aug 02, 2015 at 14:10 +1000: > On Sun, 2 Aug 2015, John-Mark Gurney wrote: > > > Log: > > convert to C11's _Static_assert, and pull in sys/cdefs.h for > > compatibility w/ older non-C11 compilers... > > This include is bogus. already depends on the includer > including other headers that include . Mainly . > defined massive namespace pollution that includes everything > in . It includes an infinite number of times > via recursion, except the recursion is stopped by anti-reinclude guards. > Th recursion makes the static number of nested includes of > hard to count. I'll test w/o sys/cdefs.h and if it compiles, I'll remove it... > Also, this is a kernel header. All kernel headers depend on the includer Except it isn't just a kernel header as we found out, otherwise CTASSERT would have been perfectly fine... It defines an API between kernel and userland for adding and changing the kernel SA/SP database... See sbin/setkey and lib/libipsec... [comments about kernel only headers deleted] > If an application wants to abuse a kernel header, then it must fake > the kernel environment for it. I don't know much about this header, > but it is not documented in any man page so it can do anything. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Sun Aug 2 04:44:48 2015 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 995129AFF01; Sun, 2 Aug 2015 04:44:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id C935FA9B; Sun, 2 Aug 2015 04:44:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 644D83C3D90; Sun, 2 Aug 2015 14:44:44 +1000 (AEST) Date: Sun, 2 Aug 2015 14:44:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: Bruce Evans , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285985 - in head/usr.sbin/pw: . tests In-Reply-To: <20150801192419.GB94932@stack.nl> Message-ID: <20150802141200.G894@besplex.bde.org> References: <201507282110.t6SLAx0k035167@repo.freebsd.org> <20150729080932.S5059@besplex.bde.org> <20150801133629.GA94932@stack.nl> <20150802022204.O3247@besplex.bde.org> <20150801192419.GB94932@stack.nl> 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=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=-i_Z2ZMzrw89SmjDpHoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 04:44:48 -0000 On Sat, 1 Aug 2015, Jilles Tjoelker wrote: > On Sun, Aug 02, 2015 at 02:59:00AM +1000, Bruce Evans wrote: >> On Sat, 1 Aug 2015, Jilles Tjoelker wrote: >>> These values are easily written using arithmetic expansion, for example >>> largeid=$((0x100000000)). > >> Not really. Shells are also very buggy or limited in this area. I >> often use old versions of sh and bash that only support up to INT32_MAX >> and have broken overflow handling. /bin/sh in -current only supports >> up to INT64_MAX (or maybe INTMAX_MAX) and has broken overflow handling >> (it clamps to INT64_MAX). Not so old versions of bash only support >> up to INT64_MAX and have differently broken overflow handling (4.3.99 >> blindly assigns to int64_t, so $((0x8000000000000000)) becomes >> -0x8000000000000000. > >> expr is also limited to INT64_MAX, but attempts to have non-broken >> overflow handling. > > The tests need not work with old versions of sh and bash (they already > rely on many more recent features and bugfixes). The broken overflow > handling in parsing literals does not affect the given example. But I complained about the example being deficient. It only needs to test up to UINT32_MAX now, but that may change. A similar test in dd already needs to go up to UINT64_MAX. dd does support hex numbers, and is suppose to support offsets about OFF_MAX, but this is broken by excessive support for the signedness of off_t. All kernel addresses in /dev/kmem are above 0xffffffff00000000 on amd64. I tried to get green@ to fix this in Y2K, but the result was a larger mess. >>> When using strtol() or similar functions, accepting hex typically >>> implies accepting octal as well, which causes confusing and >>> POSIX-violating results like 010 interpreted as eight. > >> This is a problem. strtonum could accept hex but not octal by calling >> strtoimax() twice for bases 10 and 16. Also dehumanized formats like >> 1k and 1K. It should also actually accept numbers as input. 1.1e1 if >> not I * Pi. > > Silently expanding what strtonum() accepts might cause breakage or even > security vulnerabilities. It is hard to fix broken APIs/UIs once they are used. strtonum() is not used often in /usr/src. Its main use is in openssh, and that is hard to fix since both strtonum and opensh are from OpenBSD. Using names in the reserved namespace causes portability problems. FreeBSD's expand_number() is a much worse name, but at least it doesn't conflict with better future uses of a reserved name. Bruce From owner-svn-src-head@freebsd.org Sun Aug 2 05:35:30 2015 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 285A79AF680; Sun, 2 Aug 2015 05:35:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A60D5199A; Sun, 2 Aug 2015 05:35:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id EAB8C1A2646; Sun, 2 Aug 2015 15:35:25 +1000 (AEST) Date: Sun, 2 Aug 2015 15:35:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286170 - head/share/man/man9 In-Reply-To: <201508020022.t720MFqp023071@repo.freebsd.org> Message-ID: <20150802145434.V1128@besplex.bde.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JJchhklRDgoQpUDWXggA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 05:35:30 -0000 On Sun, 2 Aug 2015, John-Mark Gurney wrote: > Log: > mark this function as deprecated, and put the warning first, since I > doubt most people will read to the end... Note the use of sys/cdefs.h > for pre-C11 compilers... This function shouldn't be deprecated. It is a kernel wrapper with a good name for hiding the implementation detail or not-yet standard interface _Static_assert(). CTASSERT() is the compile-time variant of KASSERT(). We intentionally use KASSERT() instead of anything like the standard assert(3) since we don't like the API or semantics of assert() and want one with different design and implementation bugs. I can't think of any use for different semantics to _Static_assert(), but using CTASSERT() retains flexibility. isn't a prerequisite for this function. The correct prerequisites for this function are already documented. They are and . > I didn't included a note about being compatibile w/ userland since a > C11 feature should be obviously usable in userland... If CTASSERT() is abused in userland, then the kernel environment must be faked. > Modified: head/share/man/man9/CTASSERT.9 > ============================================================================== > --- head/share/man/man9/CTASSERT.9 Sun Aug 2 00:18:48 2015 (r286169) > +++ head/share/man/man9/CTASSERT.9 Sun Aug 2 00:22:14 2015 (r286170) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 30, 2015 > +.Dd August 1, 2015 > .Dt CTASSERT 9 > .Os > .Sh NAME > @@ -39,6 +39,15 @@ > .Sh DESCRIPTION > The > .Fn CTASSERT > +macro is deprecated and the C11 standard > +.Fn _Static_assert > +should be used instead. > +The header > +.Fa sys/cdefs.h > +should be included to provide compatibility for pre-C11 compilers. _Static_assert() shoudn't be used instead, but when it is including sys/cdefs.h isn' optional. Then the documented prerequisites for this function might not be needed for the replacement but in the kernel they must be provided for other functions. Some section 9 man pages, e.g., atomic.9, document a minimal prerequisite like , but this sets a bad example and inhibits adding conditional features like KASSERTS()s in atomic.h. atomic.h is so low-level that you normally wouldn't want to bloat it with assertions, but you might want to add them for debugging. In fact, it is a style bug for any kernel file to use the documented prerequisite for the atomic functions. is part of the standard pollution in and it is a style bug to not depend on that. sys/param.h is a documented prerequisite in 264 section 9 man pages (at the source level; many more counting links). sys/systm.h is in only 34. sys/types.h is in 41. > +.Pp > +The > +.Fn CTASSERT > macro evaluates > .Fa expression > at compile time and causes a compiler error if it is false. > @@ -48,10 +57,6 @@ The > macro is useful for asserting the size or alignment of important > data structures and variables during compilation, which would > otherwise cause the code to fail at run time. > -.Pp > -The > -.Fn CTASSERT > -macro is not usable in userland. The CTASSERT() macro is still not usable in userland. It is only abusable. Its alternative _Static_assert() is usable, but most people won't read to the beginning of this to find it here. > .Sh EXAMPLES > Assert that the size of the > .Vt uuid Bruce From owner-svn-src-head@freebsd.org Sun Aug 2 11:43:32 2015 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 447279B1A18; Sun, 2 Aug 2015 11:43:32 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 017871F18; Sun, 2 Aug 2015 11:43:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 8387A25D3897; Sun, 2 Aug 2015 11:43:28 +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 701D9C76FD4; Sun, 2 Aug 2015 11:43:27 +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 JTys-3dlMZ3U; Sun, 2 Aug 2015 11:43:26 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:a9f2:c962:3e4a:6bcd] (unknown [IPv6:fde9:577b:c1a9:4410:a9f2:c962:3e4a:6bcd]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0E0D8C76FD3; Sun, 2 Aug 2015 11:43:24 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286168 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201508020015.t720Fr6R018929@repo.freebsd.org> Date: Sun, 2 Aug 2015 11:42:50 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508020015.t720Fr6R018929@repo.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 11:43:32 -0000 > On 02 Aug 2015, at 00:15 , John-Mark Gurney wrote: > -CTASSERT(sizeof(struct sadb_x_policy) =3D=3D 16); > +_Static_assert(sizeof(struct sadb_x_policy) =3D=3D 16, "struct size = mismatch"); If this fires, how does it look like? I am assuming the string at the = end is the error message? If so and if the assertion is not printed = that string should be improved rather than being the same for all = checks. /bz= From owner-svn-src-head@freebsd.org Sun Aug 2 11:58:25 2015 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 E5E269B1C04; Sun, 2 Aug 2015 11:58:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D32D96EB; Sun, 2 Aug 2015 11:58:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72BwPDu009656; Sun, 2 Aug 2015 11:58:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72BwPe2009655; Sun, 2 Aug 2015 11:58:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021158.t72BwPe2009655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 11:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286194 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 11:58:26 -0000 Author: ae Date: Sun Aug 2 11:58:24 2015 New Revision: 286194 URL: https://svnweb.freebsd.org/changeset/base/286194 Log: Remove redundant check. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Aug 2 10:08:57 2015 (r286193) +++ head/sys/netinet6/in6_src.c Sun Aug 2 11:58:24 2015 (r286194) @@ -640,14 +640,9 @@ selectroute(struct sockaddr_in6 *dstsock if (ron->ro_rt == NULL) { in6_rtalloc(ron, fibnum); /* multi path case? */ if (ron->ro_rt == NULL) { - /* XXX-BZ WT.? */ - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } error = EHOSTUNREACH; goto done; - } + } } rt = ron->ro_rt; From owner-svn-src-head@freebsd.org Sun Aug 2 12:40:57 2015 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 CCBD99B0960; Sun, 2 Aug 2015 12:40:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B479A18AD; Sun, 2 Aug 2015 12:40:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72Cevgi028635; Sun, 2 Aug 2015 12:40:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72Cev9i028634; Sun, 2 Aug 2015 12:40:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021240.t72Cev9i028634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 12:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286195 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 12:40:58 -0000 Author: ae Date: Sun Aug 2 12:40:56 2015 New Revision: 286195 URL: https://svnweb.freebsd.org/changeset/base/286195 Log: Properly handle IPV6_NEXTHOP socket option in selectroute(). o remove disabled code; o if nexthop address is link-local, use embedded scope zone id to determine outgoing interface; o properly fill ro_dst before doing route lookup; o remove LLE lookup, instead check rt_flags for RTF_GATEWAY bit. Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Aug 2 11:58:24 2015 (r286194) +++ head/sys/netinet6/in6_src.c Sun Aug 2 12:40:56 2015 (r286195) @@ -616,77 +616,38 @@ selectroute(struct sockaddr_in6 *dstsock */ if (opts && opts->ip6po_nexthop) { struct route_in6 *ron; - struct llentry *la; - - sin6_next = satosin6(opts->ip6po_nexthop); - - /* at this moment, we only support AF_INET6 next hops */ - if (sin6_next->sin6_family != AF_INET6) { - error = EAFNOSUPPORT; /* or should we proceed? */ - goto done; - } - - /* - * If the next hop is an IPv6 address, then the node identified - * by that address must be a neighbor of the sending host. - */ - ron = &opts->ip6po_nextroute; - /* - * XXX what do we do here? - * PLZ to be fixing - */ - - if (ron->ro_rt == NULL) { - in6_rtalloc(ron, fibnum); /* multi path case? */ - if (ron->ro_rt == NULL) { - error = EHOSTUNREACH; + sin6_next = satosin6(opts->ip6po_nexthop); + if (IN6_IS_ADDR_LINKLOCAL(&sin6_next->sin6_addr)) { + /* + * Next hop is LLA, thus it should be neighbor. + * Determine outgoing interface by zone index. + */ + zoneid = ntohs(in6_getscope(&sin6_next->sin6_addr)); + if (zoneid > 0) { + ifp = in6_getlinkifnet(zoneid); goto done; } } - - rt = ron->ro_rt; - ifp = rt->rt_ifp; - IF_AFDATA_RLOCK(ifp); - la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)sin6_next); - IF_AFDATA_RUNLOCK(ifp); - if (la != NULL) - LLE_RUNLOCK(la); - else { - error = EHOSTUNREACH; - goto done; - } -#if 0 - if ((ron->ro_rt && - (ron->ro_rt->rt_flags & (RTF_UP | RTF_LLINFO)) != - (RTF_UP | RTF_LLINFO)) || - !IN6_ARE_ADDR_EQUAL(&satosin6(&ron->ro_dst)->sin6_addr, - &sin6_next->sin6_addr)) { - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } - *satosin6(&ron->ro_dst) = *sin6_next; - } + ron = &opts->ip6po_nextroute; + /* Use a cached route if it exists and is valid. */ + if (ron->ro_rt != NULL && ( + (ron->ro_rt->rt_flags & RTF_UP) == 0 || + ron->ro_dst.sin6_family != AF_INET6 || + !IN6_ARE_ADDR_EQUAL(&ron->ro_dst.sin6_addr, + &sin6_next->sin6_addr))) + RO_RTFREE(ron); if (ron->ro_rt == NULL) { + ron->ro_dst = *sin6_next; in6_rtalloc(ron, fibnum); /* multi path case? */ - if (ron->ro_rt == NULL || - !(ron->ro_rt->rt_flags & RTF_LLINFO)) { - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } - error = EHOSTUNREACH; - goto done; - } } -#endif - /* - * When cloning is required, try to allocate a route to the - * destination so that the caller can store path MTU - * information. + * The node identified by that address must be a + * neighbor of the sending host. */ + if (ron->ro_rt == NULL || + (ron->ro_rt->rt_flags & RTF_GATEWAY) != 0) + error = EHOSTUNREACH; goto done; } From owner-svn-src-head@freebsd.org Sun Aug 2 12:47:53 2015 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 8D18C9B0AE4; Sun, 2 Aug 2015 12:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 71C641BCF; Sun, 2 Aug 2015 12:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72ClrkO032200; Sun, 2 Aug 2015 12:47:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72ClpqG032194; Sun, 2 Aug 2015 12:47:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021247.t72ClpqG032194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286196 - in head/usr.sbin/pw: . 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.20 Precedence: list List-Id: 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, 02 Aug 2015 12:47:53 -0000 Author: bapt Date: Sun Aug 2 12:47:50 2015 New Revision: 286196 URL: https://svnweb.freebsd.org/changeset/base/286196 Log: Rewrite parsing subcommands arguments of pw(8) Now each subcommands checks its arguments in a dedicated functions. This helps improving input validation, code readability/maintainability While here: - Add a -y option to pw userdel/usermod so it can maintain NIS servers if nispasswd is not defined in pw.conf(5) - Allow pw -r to remove directory with userdel -r - Fix bug when renaming a user which was not renaming the user name it groups it is a member of. - Only parse pw.conf(5) when needed. Added: head/usr.sbin/pw/pw_utils.c (contents, props changed) Modified: head/usr.sbin/pw/Makefile head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pwupd.h head/usr.sbin/pw/strtounum.c head/usr.sbin/pw/tests/pw_groupdel.sh head/usr.sbin/pw/tests/pw_useradd.sh head/usr.sbin/pw/tests/pw_userdel.sh head/usr.sbin/pw/tests/pw_usermod.sh Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/Makefile Sun Aug 2 12:47:50 2015 (r286196) @@ -3,7 +3,8 @@ PROG= pw MAN= pw.conf.5 pw.8 SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ - grupd.c pwupd.c psdate.c bitmap.c cpdir.c rm_r.c strtounum.c + grupd.c pwupd.c psdate.c bitmap.c cpdir.c rm_r.c strtounum.c \ + pw_utils.c WARNS?= 3 Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw.c Sun Aug 2 12:47:50 2015 (r286196) @@ -37,9 +37,6 @@ static const char rcsid[] = #include #include "pw.h" -#if !defined(_PATH_YP) -#define _PATH_YP "/var/yp/" -#endif const char *Modes[] = { "add", "del", "mod", "show", "next", NULL}; @@ -85,55 +82,39 @@ struct pwf VPWF = vgetgrnam, }; -struct pwconf conf; - -static struct cargs arglist; +static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = { + { /* user */ + pw_user_add, + pw_user_del, + pw_user_mod, + pw_user_show, + pw_user_next, + pw_user_lock, + pw_user_unlock, + }, + { /* group */ + pw_group_add, + pw_group_del, + pw_group_mod, + pw_group_show, + pw_group_next, + } +}; -static int getindex(const char *words[], const char *word); -static void cmdhelp(int mode, int which); +struct pwconf conf; +static int getindex(const char *words[], const char *word); +static void cmdhelp(int mode, int which); int main(int argc, char *argv[]) { - int ch; - int mode = -1; - int which = -1; - long id = -1; - char *config = NULL; + int mode = -1, which = -1, tmp; struct stat st; - const char *errstr; - char arg, *name; + char arg, *arg1; bool relocated, nis; - static const char *opts[W_NUM][M_NUM] = - { - { /* user */ - "R:V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y", - "R:V:C:qn:u:rY", - "R:V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY", - "R:V:C:qn:u:FPa7", - "R:V:C:q", - "R:V:C:q", - "R:V:C:q" - }, - { /* grp */ - "R:V:C:qn:g:h:H:M:opNPY", - "R:V:C:qn:g:Y", - "R:V:C:qn:d:g:l:h:H:FM:m:NPY", - "R:V:C:qn:g:FPa", - "R:V:C:q" - } - }; - - static int (*funcs[W_NUM]) (int _mode, char *_name, long _id, - struct cargs * _args) = - { /* Request handlers */ - pw_user, - pw_group - }; - - name = NULL; + arg1 = NULL; relocated = nis = false; memset(&conf, 0, sizeof(conf)); strlcpy(conf.rootdir, "/", sizeof(conf.rootdir)); @@ -141,17 +122,13 @@ main(int argc, char *argv[]) conf.fd = -1; conf.checkduplicate = true; - LIST_INIT(&arglist); - - (void)setlocale(LC_ALL, ""); + setlocale(LC_ALL, ""); /* * Break off the first couple of words to determine what exactly * we're being asked to do */ while (argc > 1) { - int tmp; - if (*argv[1] == '-') { /* * Special case, allow pw -V [args] for scripts etc. @@ -197,15 +174,9 @@ main(int argc, char *argv[]) mode = tmp % M_NUM; } else if (strcmp(argv[1], "help") == 0 && argv[2] == NULL) cmdhelp(mode, which); - else if (which != -1 && mode != -1) { - if (strspn(argv[1], "0123456789") == strlen(argv[1])) { - id = strtounum(argv[1], 0, UID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", - argv[1], errstr); - } else - name = argv[1]; - } else + else if (which != -1 && mode != -1) + arg1 = argv[1]; + else errx(EX_USAGE, "unknown keyword `%s'", argv[1]); ++argv; --argc; @@ -220,193 +191,22 @@ main(int argc, char *argv[]) conf.rootfd = open(conf.rootdir, O_DIRECTORY|O_CLOEXEC); if (conf.rootfd == -1) errx(EXIT_FAILURE, "Unable to open '%s'", conf.rootdir); - conf.which = which; - /* - * We know which mode we're in and what we're about to do, so now - * let's dispatch the remaining command line args in a genric way. - */ - optarg = NULL; - - while ((ch = getopt(argc, argv, opts[which][mode])) != -1) { - switch (ch) { - case '?': - errx(EX_USAGE, "unknown switch"); - break; - case '7': - conf.v7 = true; - break; - case 'C': - conf.config = optarg; - config = conf.config; - break; - case 'F': - conf.force = true; - break; - case 'N': - conf.dryrun = true; - break; - case 'l': - if (strlen(optarg) >= MAXLOGNAME) - errx(EX_USAGE, "new name too long: %s", optarg); - conf.newname = optarg; - break; - case 'P': - conf.pretty = true; - break; - case 'Y': - nis = true; - break; - case 'a': - conf.all = true; - break; - case 'c': - conf.gecos = pw_checkname(optarg, 1); - break; - case 'g': - if (which == 0) { /* for user* */ - addarg(&arglist, 'g', optarg); - break; - } - if (strspn(optarg, "0123456789") != strlen(optarg)) - errx(EX_USAGE, "-g expects a number"); - id = strtounum(optarg, 0, GID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", optarg, - errstr); - break; - case 'u': - if (strspn(optarg, "0123456789,") != strlen(optarg)) - errx(EX_USAGE, "-u expects a number"); - if (strchr(optarg, ',') != NULL) { - addarg(&arglist, 'u', optarg); - break; - } - id = strtounum(optarg, 0, UID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", optarg, - errstr); - break; - case 'n': - name = optarg; - break; - case 'H': - if (conf.fd != -1) - errx(EX_USAGE, "'-h' and '-H' are mutually " - "exclusive options"); - conf.precrypted = true; - if (strspn(optarg, "0123456789") != strlen(optarg)) - errx(EX_USAGE, "'-H' expects a file descriptor"); - - conf.fd = strtonum(optarg, 0, INT_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad file descriptor '%s': %s", - optarg, errstr); - break; - case 'h': - if (conf.fd != -1) - errx(EX_USAGE, "'-h' and '-H' are mutually " - "exclusive options"); - - if (strcmp(optarg, "-") == 0) - conf.fd = '-'; - else if (strspn(optarg, "0123456789") == strlen(optarg)) { - conf.fd = strtonum(optarg, 0, INT_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "'-h' expects a " - "file descriptor or '-'"); - } else - errx(EX_USAGE, "'-h' expects a file " - "descriptor or '-'"); - break; - case 'o': - conf.checkduplicate = false; - break; - case 'q': - conf.quiet = true; - break; - case 'r': - conf.deletehome = true; - break; - default: - addarg(&arglist, ch, optarg); - break; - } - optarg = NULL; - } - - if (name != NULL && strlen(name) >= MAXLOGNAME) - errx(EX_USAGE, "name too long: %s", name); - - /* - * Must be root to attempt an update - */ - if (geteuid() != 0 && mode != M_PRINT && mode != M_NEXT && !conf.dryrun) - errx(EX_NOPERM, "you must be root to run this program"); - - /* - * We should immediately look for the -q 'quiet' switch so that we - * don't bother with extraneous errors - */ - if (conf.quiet) - freopen(_PATH_DEVNULL, "w", stderr); - - /* - * Set our base working path if not overridden - */ - - if (config == NULL) { /* Only override config location if -C not specified */ - asprintf(&config, "%s/pw.conf", conf.etcpath); - if (config == NULL) - errx(EX_OSERR, "out of memory"); - } - - /* - * Now, let's do the common initialisation - */ - conf.userconf = read_userconfig(config); - - ch = funcs[which] (mode, name, id, &arglist); - - /* - * If everything went ok, and we've been asked to update - * the NIS maps, then do it now - */ - if (ch == EXIT_SUCCESS && nis) { - pid_t pid; - fflush(NULL); - if (chdir(_PATH_YP) == -1) - warn("chdir(" _PATH_YP ")"); - else if ((pid = fork()) == -1) - warn("fork()"); - else if (pid == 0) { - /* Is make anywhere else? */ - execlp("/usr/bin/make", "make", (char *)NULL); - _exit(1); - } else { - int i; - waitpid(pid, &i, 0); - if ((i = WEXITSTATUS(i)) != 0) - errx(ch, "make exited with status %d", i); - else - pw_log(conf.userconf, mode, which, "NIS maps updated"); - } - } - return ch; + return (cmdfunc[which][mode](argc, argv, arg1)); } static int getindex(const char *words[], const char *word) { - int i = 0; + int i = 0; while (words[i]) { if (strcmp(words[i], word) == 0) - return i; + return (i); i++; } - return -1; + return (-1); } @@ -456,7 +256,7 @@ cmdhelp(int mode, int which) " Setting defaults:\n" "\t-V etcdir alternate /etc location\n" "\t-R rootir alternate root directory\n" - "\t-D set user defaults\n" + "\t-D set user defaults\n" "\t-b dir default home root dir\n" "\t-e period default expiry period\n" "\t-p period default password change period\n" @@ -476,6 +276,7 @@ cmdhelp(int mode, int which) "\t-n name login name\n" "\t-u uid user id\n" "\t-Y update NIS maps\n" + "\t-y path set NIS passwd file path\n" "\t-r remove home & contents\n", "usage: pw usermod [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" @@ -500,6 +301,7 @@ cmdhelp(int mode, int which) "\t-h fd read password on fd\n" "\t-H fd read encrypted password on fd\n" "\t-Y update NIS maps\n" + "\t-y path set NIS passwd file path\n" "\t-N no update\n", "usage: pw usershow [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" @@ -576,31 +378,3 @@ cmdhelp(int mode, int which) } exit(EXIT_FAILURE); } - -struct carg * -getarg(struct cargs * _args, int ch) -{ - struct carg *c; - - if (_args == NULL) - return (NULL); - - c = LIST_FIRST(_args); - - while (c != NULL && c->ch != ch) - c = LIST_NEXT(c, list); - return c; -} - -struct carg * -addarg(struct cargs * _args, int ch, char *argstr) -{ - struct carg *ca = malloc(sizeof(struct carg)); - - if (ca == NULL) - errx(EX_OSERR, "out of memory"); - ca->ch = ch; - ca->val = argstr; - LIST_INSERT_HEAD(_args, ca, list); - return ca; -} Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw.h Sun Aug 2 12:47:50 2015 (r286196) @@ -78,21 +78,41 @@ LIST_HEAD(cargs, carg); #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 +struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); -int write_userconfig(char const * file); +int write_userconfig(struct userconf *cnf, char const * file); struct carg *addarg(struct cargs * _args, int ch, char *argstr); struct carg *getarg(struct cargs * _args, int ch); -int pw_user(int mode, char *name, long id, struct cargs * _args); -int pw_usernext(struct userconf *cnf, bool quiet); -int pw_group(int mode, char *name, long id, struct cargs * _args); +int pw_group_add(int argc, char **argv, char *name); +int pw_group_del(int argc, char **argv, char *name); +int pw_group_mod(int argc, char **argv, char *name); +int pw_group_next(int argc, char **argv, char *name); +int pw_group_show(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_del(int argc, char **argv, char *name); +int pw_user_lock(int argc, char **argv, char *name); +int pw_user_mod(int argc, char **argv, char *name); +int pw_user_next(int argc, char **argv, char *name); +int pw_user_show(int argc, char **argv, char *name); +int pw_user_unlock(int argc, char **argv, char *name); int pw_groupnext(struct userconf *cnf, bool quiet); char *pw_checkname(char *name, int gecos); +uintmax_t pw_checkid(char *nptr, uintmax_t maxval); +int pw_checkfd(char *nptr); int addnispwent(const char *path, struct passwd *pwd); int delnispwent(const char *path, const char *login); int chgnispwent(const char *path, const char *login, struct passwd *pwd); +int groupadd(struct userconf *, char *name, gid_t id, char *members, int fd, + bool dryrun, bool pretty, bool precrypted); + +int nis_update(void); + int boolean_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 12:47:50 2015 (r286196) @@ -235,9 +235,6 @@ read_userconfig(char const * file) buf = NULL; linecap = 0; - config.groups = sl_init(); - if (config.groups == NULL) - err(1, "sl_init()"); if (file == NULL) file = _PATH_PW_CONF; @@ -316,8 +313,11 @@ read_userconfig(char const * file) ? NULL : newstr(q); break; case _UC_EXTRAGROUPS: - for (i = 0; q != NULL; q = strtok(NULL, toks)) + for (i = 0; q != NULL; q = strtok(NULL, toks)) { + if (config.groups == NULL) + config.groups = sl_init(); sl_add(config.groups, newstr(q)); + } break; case _UC_DEFAULTCLASS: config.default_class = (q == NULL || !boolean_val(q, 1)) @@ -391,7 +391,7 @@ read_userconfig(char const * file) int -write_userconfig(char const * file) +write_userconfig(struct userconf *cnf, const char *file) { int fd; int i, j; @@ -416,40 +416,39 @@ write_userconfig(char const * file) sbuf_clear(buf); switch (i) { case _UC_DEFAULTPWD: - sbuf_cat(buf, boolean_str(config.default_password)); + sbuf_cat(buf, boolean_str(cnf->default_password)); break; case _UC_REUSEUID: - sbuf_cat(buf, boolean_str(config.reuse_uids)); + sbuf_cat(buf, boolean_str(cnf->reuse_uids)); break; case _UC_REUSEGID: - sbuf_cat(buf, boolean_str(config.reuse_gids)); + sbuf_cat(buf, boolean_str(cnf->reuse_gids)); break; case _UC_NISPASSWD: - sbuf_cat(buf, config.nispasswd ? config.nispasswd : - ""); + sbuf_cat(buf, cnf->nispasswd ? cnf->nispasswd : ""); quote = 0; break; case _UC_DOTDIR: - sbuf_cat(buf, config.dotdir ? config.dotdir : + sbuf_cat(buf, cnf->dotdir ? cnf->dotdir : boolean_str(0)); break; case _UC_NEWMAIL: - sbuf_cat(buf, config.newmail ? config.newmail : + sbuf_cat(buf, cnf->newmail ? cnf->newmail : boolean_str(0)); break; case _UC_LOGFILE: - sbuf_cat(buf, config.logfile ? config.logfile : + sbuf_cat(buf, cnf->logfile ? cnf->logfile : boolean_str(0)); break; case _UC_HOMEROOT: - sbuf_cat(buf, config.home); + sbuf_cat(buf, cnf->home); break; case _UC_HOMEMODE: - sbuf_printf(buf, "%04o", config.homemode); + sbuf_printf(buf, "%04o", cnf->homemode); quote = 0; break; case _UC_SHELLPATH: - sbuf_cat(buf, config.shelldir); + sbuf_cat(buf, cnf->shelldir); break; case _UC_SHELLS: for (j = 0; j < _UC_MAXSHELLS && @@ -459,46 +458,46 @@ write_userconfig(char const * file) quote = 0; break; case _UC_DEFAULTSHELL: - sbuf_cat(buf, config.shell_default ? - config.shell_default : bourne_shell); + sbuf_cat(buf, cnf->shell_default ? + cnf->shell_default : bourne_shell); break; case _UC_DEFAULTGROUP: - sbuf_cat(buf, config.default_group ? - config.default_group : ""); + sbuf_cat(buf, cnf->default_group ? + cnf->default_group : ""); break; case _UC_EXTRAGROUPS: - for (j = 0; config.groups != NULL && - j < (int)config.groups->sl_cur; j++) + for (j = 0; cnf->groups != NULL && + j < (int)cnf->groups->sl_cur; j++) sbuf_printf(buf, "%s\"%s\"", j ? - "," : "", config.groups->sl_str[j]); + "," : "", cnf->groups->sl_str[j]); quote = 0; break; case _UC_DEFAULTCLASS: - sbuf_cat(buf, config.default_class ? - config.default_class : ""); + sbuf_cat(buf, cnf->default_class ? + cnf->default_class : ""); break; case _UC_MINUID: - sbuf_printf(buf, "%ju", (uintmax_t)config.min_uid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_uid); quote = 0; break; case _UC_MAXUID: - sbuf_printf(buf, "%ju", (uintmax_t)config.max_uid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_uid); quote = 0; break; case _UC_MINGID: - sbuf_printf(buf, "%ju", (uintmax_t)config.min_gid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_gid); quote = 0; break; case _UC_MAXGID: - sbuf_printf(buf, "%ju", (uintmax_t)config.max_gid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_gid); quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%d", config.expire_days); + sbuf_printf(buf, "%ld", cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%d", config.password_days); + sbuf_printf(buf, "%ld", cnf->password_days); quote = 0; break; case _UC_NONE: Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 12:47:50 2015 (r286196) @@ -31,47 +31,50 @@ static const char rcsid[] = #include #include +#include #include -#include +#include +#include #include +#include #include -#include -#include #include "pw.h" #include "bitmap.h" - static struct passwd *lookup_pwent(const char *user); static void delete_members(struct group *grp, char *list); -static int print_group(struct group * grp); -static gid_t gr_gidpolicy(struct userconf * cnf, long id); +static int print_group(struct group * grp, bool pretty); +static gid_t gr_gidpolicy(struct userconf * cnf, intmax_t id); static void -set_passwd(struct group *grp, bool update) +grp_set_passwd(struct group *grp, bool update, int fd, bool precrypted) { int b; int istty; struct termios t, n; char *p, line[256]; - if (conf.fd == '-') { + if (fd == -1) + return; + + if (fd == '-') { grp->gr_passwd = "*"; /* No access */ return; } - if ((istty = isatty(conf.fd))) { + if ((istty = isatty(fd))) { n = t; /* Disable echo */ n.c_lflag &= ~(ECHO); - tcsetattr(conf.fd, TCSANOW, &n); + tcsetattr(fd, TCSANOW, &n); printf("%sassword for group %s:", update ? "New p" : "P", grp->gr_name); fflush(stdout); } - b = read(conf.fd, line, sizeof(line) - 1); + b = read(fd, line, sizeof(line) - 1); if (istty) { /* Restore state */ - tcsetattr(conf.fd, TCSANOW, &t); + tcsetattr(fd, TCSANOW, &t); fputc('\n', stdout); fflush(stdout); } @@ -83,7 +86,7 @@ set_passwd(struct group *grp, bool updat if (!*line) errx(EX_DATAERR, "empty password read on file descriptor %d", conf.fd); - if (conf.precrypted) { + if (precrypted) { if (strchr(line, ':') != 0) errx(EX_DATAERR, "wrong encrypted passwrd"); grp->gr_passwd = line; @@ -103,193 +106,24 @@ pw_groupnext(struct userconf *cnf, bool return (EXIT_SUCCESS); } -static int -pw_groupshow(const char *name, long id, struct group *fakegroup) -{ - struct group *grp = NULL; - - if (id < 0 && name == NULL && !conf.all) - errx(EX_DATAERR, "groupname or id or '-a' required"); - - if (conf.all) { - SETGRENT(); - while ((grp = GETGRENT()) != NULL) - print_group(grp); - ENDGRENT(); - - return (EXIT_SUCCESS); - } - - grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); - if (grp == NULL) { - if (conf.force) { - grp = fakegroup; - } else { - if (name == NULL) - errx(EX_DATAERR, "unknown gid `%ld'", id); - errx(EX_DATAERR, "unknown group `%s'", name); - } - } - - return (print_group(grp)); -} - -static int -pw_groupdel(const char *name, long id) +static struct group * +getgroup(char *name, intmax_t id, bool fatal) { - struct group *grp = NULL; - int rc; + struct group *grp; + if (id < 0 && name == NULL) + errx(EX_DATAERR, "groupname or id required"); grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); if (grp == NULL) { + if (!fatal) + return (NULL); if (name == NULL) - errx(EX_DATAERR, "unknown gid `%ld'", id); + errx(EX_DATAERR, "unknown gid `%ju'", id); errx(EX_DATAERR, "unknown group `%s'", name); } - - rc = delgrent(grp); - if (rc == -1) - err(EX_IOERR, "group '%s' not available (NIS?)", name); - else if (rc != 0) - err(EX_IOERR, "group update"); - pw_log(conf.userconf, M_DELETE, W_GROUP, "%s(%ld) removed", name, id); - - return (EXIT_SUCCESS); -} - -int -pw_group(int mode, char *name, long id, struct cargs * args) -{ - int rc; - struct carg *arg; - struct group *grp = NULL; - struct userconf *cnf = conf.userconf; - - static struct group fakegroup = - { - "nogroup", - "*", - -1, - NULL - }; - - if (mode == M_NEXT) - return (pw_groupnext(cnf, conf.quiet)); - - if (mode == M_PRINT) - return (pw_groupshow(name, id, &fakegroup)); - - if (mode == M_DELETE) - return (pw_groupdel(name, id)); - - if (mode == M_LOCK || mode == M_UNLOCK) - errx(EX_USAGE, "'lock' command is not available for groups"); - - if (id < 0 && name == NULL) - errx(EX_DATAERR, "group name or id required"); - - grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); - - if (mode == M_UPDATE) { - if (name == NULL && grp == NULL) /* Try harder */ - grp = GETGRGID(id); - - if (grp == NULL) { - if (name == NULL) - errx(EX_DATAERR, "unknown group `%s'", name); - else - errx(EX_DATAERR, "unknown group `%ld'", id); - } - if (name == NULL) /* Needed later */ - name = grp->gr_name; - - if (id > 0) - grp->gr_gid = (gid_t) id; - - if (conf.newname != NULL) - grp->gr_name = pw_checkname(conf.newname, 0); - } else { - if (name == NULL) /* Required */ - errx(EX_DATAERR, "group name required"); - else if (grp != NULL) /* Exists */ - errx(EX_DATAERR, "group name `%s' already exists", name); - - grp = &fakegroup; - grp->gr_name = pw_checkname(name, 0); - grp->gr_passwd = "*"; - grp->gr_gid = gr_gidpolicy(cnf, id); - grp->gr_mem = NULL; - } - - /* - * This allows us to set a group password Group passwords is an - * antique idea, rarely used and insecure (no secure database) Should - * be discouraged, but it is apparently still supported by some - * software. - */ - - if (conf.which == W_GROUP && conf.fd != -1) - set_passwd(grp, mode == M_UPDATE); - - if (((arg = getarg(args, 'M')) != NULL || - (arg = getarg(args, 'd')) != NULL || - (arg = getarg(args, 'm')) != NULL) && arg->val) { - char *p; - struct passwd *pwd; - - /* Make sure this is not stay NULL with -M "" */ - if (arg->ch == 'd') - delete_members(grp, arg->val); - else if (arg->ch == 'M') - grp->gr_mem = NULL; - - for (p = strtok(arg->val, ", \t"); arg->ch != 'd' && p != NULL; - p = strtok(NULL, ", \t")) { - int j; - - /* - * Check for duplicates - */ - pwd = lookup_pwent(p); - for (j = 0; grp->gr_mem != NULL && grp->gr_mem[j] != NULL; j++) { - if (strcmp(grp->gr_mem[j], pwd->pw_name) == 0) - break; - } - if (grp->gr_mem != NULL && grp->gr_mem[j] != NULL) - continue; - grp = gr_add(grp, pwd->pw_name); - } - } - - if (conf.dryrun) - return print_group(grp); - - if (mode == M_ADD && (rc = addgrent(grp)) != 0) { - if (rc == -1) - errx(EX_IOERR, "group '%s' already exists", - grp->gr_name); - else - err(EX_IOERR, "group update"); - } else if (mode == M_UPDATE && (rc = chggrent(name, grp)) != 0) { - if (rc == -1) - errx(EX_IOERR, "group '%s' not available (NIS?)", - grp->gr_name); - else - err(EX_IOERR, "group update"); - } - - if (conf.newname != NULL) - name = conf.newname; - /* grp may have been invalidated */ - if ((grp = GETGRNAM(name)) == NULL) - errx(EX_SOFTWARE, "group disappeared during update"); - - pw_log(cnf, mode, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); - - return EXIT_SUCCESS; + return (grp); } - /* * Lookup a passwd entry using a name or UID. */ @@ -332,11 +166,11 @@ delete_members(struct group *grp, char * } } - -static gid_t -gr_gidpolicy(struct userconf * cnf, long id) +static gid_t +gr_gidpolicy(struct userconf * cnf, intmax_t id) { struct group *grp; + struct bitmap bm; gid_t gid = (gid_t) - 1; /* @@ -347,66 +181,59 @@ gr_gidpolicy(struct userconf * cnf, long if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate) errx(EX_DATAERR, "gid `%ju' has already been allocated", (uintmax_t)grp->gr_gid); - } else { - struct bitmap bm; + return (gid); + } - /* - * We need to allocate the next available gid under one of - * two policies a) Grab the first unused gid b) Grab the - * highest possible unused gid - */ - if (cnf->min_gid >= cnf->max_gid) { /* Sanity claus^H^H^H^Hheck */ - cnf->min_gid = 1000; - cnf->max_gid = 32000; - } - bm = bm_alloc(cnf->max_gid - cnf->min_gid + 1); + /* + * We need to allocate the next available gid under one of + * two policies a) Grab the first unused gid b) Grab the + * highest possible unused gid + */ + if (cnf->min_gid >= cnf->max_gid) { /* Sanity claus^H^H^H^Hheck */ + cnf->min_gid = 1000; + cnf->max_gid = 32000; + } + bm = bm_alloc(cnf->max_gid - cnf->min_gid + 1); - /* - * Now, let's fill the bitmap from the password file - */ - SETGRENT(); - while ((grp = GETGRENT()) != NULL) - if ((gid_t)grp->gr_gid >= (gid_t)cnf->min_gid && - (gid_t)grp->gr_gid <= (gid_t)cnf->max_gid) - bm_setbit(&bm, grp->gr_gid - cnf->min_gid); - ENDGRENT(); + /* + * Now, let's fill the bitmap from the password file + */ + SETGRENT(); + while ((grp = GETGRENT()) != NULL) + if ((gid_t)grp->gr_gid >= (gid_t)cnf->min_gid && + (gid_t)grp->gr_gid <= (gid_t)cnf->max_gid) + bm_setbit(&bm, grp->gr_gid - cnf->min_gid); + ENDGRENT(); - /* - * Then apply the policy, with fallback to reuse if necessary - */ - if (cnf->reuse_gids) + /* + * Then apply the policy, with fallback to reuse if necessary + */ + if (cnf->reuse_gids) + gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); + else { + gid = (gid_t) (bm_lastset(&bm) + 1); + if (!bm_isset(&bm, gid)) + gid += cnf->min_gid; + else gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); - else { - gid = (gid_t) (bm_lastset(&bm) + 1); - if (!bm_isset(&bm, gid)) - gid += cnf->min_gid; - else - gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); - } - - /* - * Another sanity check - */ - if (gid < cnf->min_gid || gid > cnf->max_gid) - errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); - bm_dealloc(&bm); } - return gid; -} + /* + * Another sanity check + */ + if (gid < cnf->min_gid || gid > cnf->max_gid) + errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); + bm_dealloc(&bm); + return (gid); +} static int -print_group(struct group * grp) +print_group(struct group * grp, bool pretty) { - if (!conf.pretty) { - char *buf = NULL; - - buf = gr_make(grp); - printf("%s\n", buf); - free(buf); - } else { - int i; + char *buf = NULL; + int i; + if (pretty) { printf("Group Name: %-15s #%lu\n" " Members: ", grp->gr_name, (long) grp->gr_gid); @@ -415,6 +242,444 @@ print_group(struct group * grp) printf("%s%s", i ? "," : "", grp->gr_mem[i]); } fputs("\n\n", stdout); + return (EXIT_SUCCESS); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 2 12:48:37 2015 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 BB72A9B0B21; Sun, 2 Aug 2015 12:48:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AC6E71D17; Sun, 2 Aug 2015 12:48:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72Cmbse032274; Sun, 2 Aug 2015 12:48:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72Cmb4T032273; Sun, 2 Aug 2015 12:48:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021248.t72Cmb4T032273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286197 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 12:48:37 -0000 Author: bapt Date: Sun Aug 2 12:48:36 2015 New Revision: 286197 URL: https://svnweb.freebsd.org/changeset/base/286197 Log: Remove dead code Modified: head/usr.sbin/pw/pw.h Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 12:47:50 2015 (r286196) +++ head/usr.sbin/pw/pw.h Sun Aug 2 12:48:36 2015 (r286197) @@ -64,15 +64,6 @@ enum _which W_NUM }; -struct carg -{ - int ch; - char *val; - LIST_ENTRY(carg) list; -}; - -LIST_HEAD(cargs, carg); - #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 @@ -81,8 +72,6 @@ LIST_HEAD(cargs, carg); struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); int write_userconfig(struct userconf *cnf, char const * file); -struct carg *addarg(struct cargs * _args, int ch, char *argstr); -struct carg *getarg(struct cargs * _args, int ch); int pw_group_add(int argc, char **argv, char *name); int pw_group_del(int argc, char **argv, char *name); From owner-svn-src-head@freebsd.org Sun Aug 2 12:54:16 2015 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 9ACF39B0D43; Sun, 2 Aug 2015 12:54:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8BF5EF0; Sun, 2 Aug 2015 12:54:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72CsGLM036104; Sun, 2 Aug 2015 12:54:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72CsGfW036103; Sun, 2 Aug 2015 12:54:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021254.t72CsGfW036103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286198 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 12:54:16 -0000 Author: bapt Date: Sun Aug 2 12:54:15 2015 New Revision: 286198 URL: https://svnweb.freebsd.org/changeset/base/286198 Log: Fix regression: report again if a username already exists when creating it Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 12:48:36 2015 (r286197) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 12:54:15 2015 (r286198) @@ -1275,6 +1275,9 @@ pw_user_add(int argc, char **argv, char if (name == NULL) errx(EX_DATAERR, "login name required"); + if (GETPWNAM(name) != NULL) + errx(EX_DATAERR, "login name `%s' already exists", name); + pwd = &fakeuser; pwd->pw_name = name; pwd->pw_class = cmdcnf->default_class ? cmdcnf->default_class : ""; From owner-svn-src-head@freebsd.org Sun Aug 2 12:56:26 2015 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 2352E9B0DB5; Sun, 2 Aug 2015 12:56:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 13CCF259; Sun, 2 Aug 2015 12:56:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72CuPqK036266; Sun, 2 Aug 2015 12:56:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72CuPPk036265; Sun, 2 Aug 2015 12:56:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021256.t72CuPPk036265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286199 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 12:56:26 -0000 Author: bapt Date: Sun Aug 2 12:56:25 2015 New Revision: 286199 URL: https://svnweb.freebsd.org/changeset/base/286199 Log: Fix regression: report if a group already exists when creating it Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 12:54:15 2015 (r286198) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 12:56:25 2015 (r286199) @@ -546,6 +546,8 @@ pw_group_add(int argc, char **argv, char freopen(_PATH_DEVNULL, "w", stderr); if (name == NULL) errx(EX_DATAERR, "group name required"); + if (GETGRNAM(name) != NULL) + errx(EX_DATAERR, "group name `%s' already exists", name); cnf = get_userconfig(cfg); rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun, pretty, precrypted); From owner-svn-src-head@freebsd.org Sun Aug 2 13:02:55 2015 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 0B8C19B0F08; Sun, 2 Aug 2015 13:02:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D05818E6; Sun, 2 Aug 2015 13:02:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72D2sRh040155; Sun, 2 Aug 2015 13:02:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72D2sU4040153; Sun, 2 Aug 2015 13:02:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021302.t72D2sU4040153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286200 - head/usr.sbin/pw/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.20 Precedence: list List-Id: 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, 02 Aug 2015 13:02:55 -0000 Author: bapt Date: Sun Aug 2 13:02:53 2015 New Revision: 286200 URL: https://svnweb.freebsd.org/changeset/base/286200 Log: Add regression tests about adding already existsing groups/users Modified: head/usr.sbin/pw/tests/pw_groupadd.sh head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_groupadd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_groupadd.sh Sun Aug 2 12:56:25 2015 (r286199) +++ head/usr.sbin/pw/tests/pw_groupadd.sh Sun Aug 2 13:02:53 2015 (r286200) @@ -10,6 +10,17 @@ group_add_gid_too_large_body() { ${PW} groupadd -n test1 -g 9999999999999 } +atf_test_case group_add_already_exists +group_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:65 \ + -e inline:"pw: group name \`foo' already exists\n" \ + ${PW} groupadd foo +} + atf_init_test_cases() { atf_add_test_case group_add_gid_too_large + atf_add_test_case group_add_already_exists } Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 12:56:25 2015 (r286199) +++ head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 13:02:53 2015 (r286200) @@ -304,6 +304,16 @@ user_add_bad_shell_body() { atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell } +atf_test_case user_add_already_exists +user_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:65 \ + -e inline:"pw: login name \`foo' already exists\n" \ + ${PW} useradd foo +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -330,4 +340,5 @@ atf_init_test_cases() { atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large atf_add_test_case user_add_bad_shell + atf_add_test_case user_add_already_exists } From owner-svn-src-head@freebsd.org Sun Aug 2 13:22:52 2015 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 1BD309B1320; Sun, 2 Aug 2015 13:22:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 EBF6CFED; Sun, 2 Aug 2015 13:22:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DMpip048203; Sun, 2 Aug 2015 13:22:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DMlPC048188; Sun, 2 Aug 2015 13:22:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021322.t72DMlPC048188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286201 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 13:22:52 -0000 Author: bapt Date: Sun Aug 2 13:22:46 2015 New Revision: 286201 URL: https://svnweb.freebsd.org/changeset/base/286201 Log: Cleanup a bit includes Modified: head/usr.sbin/pw/cpdir.c head/usr.sbin/pw/grupd.c head/usr.sbin/pw/psdate.c head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_log.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pw_utils.c head/usr.sbin/pw/pwupd.c Modified: head/usr.sbin/pw/cpdir.c ============================================================================== --- head/usr.sbin/pw/cpdir.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/cpdir.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,17 +29,12 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include #include "pw.h" #include "pwupd.h" Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/grupd.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,13 +29,11 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include -#include #include #include -#include -#include #include "pwupd.h" Modified: head/usr.sbin/pw/psdate.c ============================================================================== --- head/usr.sbin/pw/psdate.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/psdate.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,12 +29,11 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include +#include +#include #include #include -#include #include -#include #include "psdate.h" Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw.c Sun Aug 2 13:22:46 2015 (r286201) @@ -32,9 +32,10 @@ static const char rcsid[] = #include #include #include -#include -#include -#include +#include +#include +#include + #include "pw.h" const char *Modes[] = { Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw.h Sun Aug 2 13:22:46 2015 (r286201) @@ -26,23 +26,13 @@ * $FreeBSD$ */ +#include + #define _WITH_GETLINE +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "psdate.h" #include "pwupd.h" enum _mode Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:22:46 2015 (r286201) @@ -31,11 +31,11 @@ static const char rcsid[] = #include #include -#include -#include -#include -#include + #include +#include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 13:22:46 2015 (r286201) @@ -32,10 +32,10 @@ static const char rcsid[] = #include #include #include -#include #include #include -#include +#include +#include #include #include Modified: head/usr.sbin/pw/pw_log.c ============================================================================== --- head/usr.sbin/pw/pw_log.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_log.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,6 +30,8 @@ static const char rcsid[] = #endif /* not lint */ #include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_nis.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,6 +30,7 @@ static const char rcsid[] = #endif /* not lint */ #include + #include #include #include Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,23 +30,28 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#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 "pw.h" #include "bitmap.h" +#include "psdate.h" #define LOGNAMESIZE (MAXLOGNAME-1) Modified: head/usr.sbin/pw/pw_utils.c ============================================================================== --- head/usr.sbin/pw/pw_utils.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_utils.c Sun Aug 2 13:22:46 2015 (r286201) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pwupd.c ============================================================================== --- head/usr.sbin/pw/pwupd.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pwupd.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,18 +29,16 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include + +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "pwupd.h" From owner-svn-src-head@freebsd.org Sun Aug 2 13:32:24 2015 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 991C59B15A4; Sun, 2 Aug 2015 13:32:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6DE09169B; Sun, 2 Aug 2015 13:32:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DWOGt052333; Sun, 2 Aug 2015 13:32:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DWOQl052332; Sun, 2 Aug 2015 13:32:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021332.t72DWOQl052332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286202 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 13:32:24 -0000 Author: bapt Date: Sun Aug 2 13:32:23 2015 New Revision: 286202 URL: https://svnweb.freebsd.org/changeset/base/286202 Log: Split some extra long lines Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 13:22:46 2015 (r286201) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 13:32:23 2015 (r286202) @@ -623,7 +623,8 @@ rmat(uid_t uid) st.st_uid == uid) { char tmp[MAXPATHLEN]; - snprintf(tmp, sizeof(tmp), "/usr/bin/atrm %s", e->d_name); + snprintf(tmp, sizeof(tmp), "/usr/bin/atrm %s", + e->d_name); system(tmp); } } @@ -869,7 +870,8 @@ pw_user_del(int argc, char **argv, char /* Remove crontabs */ snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name); if (access(file, F_OK) == 0) { - snprintf(file, sizeof(file), "crontab -u %s -r", pwd->pw_name); + snprintf(file, sizeof(file), "crontab -u %s -r", + pwd->pw_name); system(file); } } @@ -1321,7 +1323,8 @@ pw_user_add(int argc, char **argv, char printf("%s\n", cmdcnf->nispasswd); rc = addnispwent(cmdcnf->nispasswd, pwd); if (rc == -1) - warnx("User '%s' already exists in NIS passwd", pwd->pw_name); + warnx("User '%s' already exists in NIS passwd", + pwd->pw_name); else if (rc != 0) warn("NIS passwd update"); /* NOTE: we treat NIS-only update errors as non-fatal */ @@ -1351,7 +1354,8 @@ pw_user_add(int argc, char **argv, char grp = GETGRGID(pwd->pw_gid); pw_log(cnf, M_ADD, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", pwd->pw_name, (uintmax_t)pwd->pw_uid, - grp ? grp->gr_name : "unknown", (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), + grp ? grp->gr_name : "unknown", + (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); /* @@ -1582,7 +1586,8 @@ pw_user_mod(int argc, char **argv, char if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0) errx(EX_DATAERR, "can't change uid of `root' account"); if (pwd->pw_uid == 0 && strcmp(pwd->pw_name, "root") != 0) - warnx("WARNING: account `%s' will have a uid of 0 (superuser access!)", pwd->pw_name); + warnx("WARNING: account `%s' will have a uid of 0 " + "(superuser access!)", pwd->pw_name); } if (grname && pwd->pw_uid != 0) { From owner-svn-src-head@freebsd.org Sun Aug 2 13:33:18 2015 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 2F95F9B1620; Sun, 2 Aug 2015 13:33:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 20BA81986; Sun, 2 Aug 2015 13:33:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DXIJ9052433; Sun, 2 Aug 2015 13:33:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DXH8q052432; Sun, 2 Aug 2015 13:33:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021333.t72DXH8q052432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286203 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 13:33:18 -0000 Author: bapt Date: Sun Aug 2 13:33:17 2015 New Revision: 286203 URL: https://svnweb.freebsd.org/changeset/base/286203 Log: Split some extra long lines Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 13:32:23 2015 (r286202) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 13:33:17 2015 (r286203) @@ -180,7 +180,8 @@ gr_gidpolicy(struct userconf * cnf, intm gid = (gid_t) id; if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate) - errx(EX_DATAERR, "gid `%ju' has already been allocated", (uintmax_t)grp->gr_gid); + errx(EX_DATAERR, "gid `%ju' has already been allocated", + (uintmax_t)grp->gr_gid); return (gid); } @@ -222,7 +223,8 @@ gr_gidpolicy(struct userconf * cnf, intm * Another sanity check */ if (gid < cnf->min_gid || gid > cnf->max_gid) - errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); + errx(EX_SOFTWARE, "unable to allocate a new gid - range fully " + "used"); bm_dealloc(&bm); return (gid); } From owner-svn-src-head@freebsd.org Sun Aug 2 13:50:12 2015 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 66BD69B19D8; Sun, 2 Aug 2015 13:50:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5805917A; Sun, 2 Aug 2015 13:50:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DoCMg056889; Sun, 2 Aug 2015 13:50:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DoC5M056888; Sun, 2 Aug 2015 13:50:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021350.t72DoC5M056888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286204 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 13:50:12 -0000 Author: bapt Date: Sun Aug 2 13:50:11 2015 New Revision: 286204 URL: https://svnweb.freebsd.org/changeset/base/286204 Log: Fix build on 32bits Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:33:17 2015 (r286203) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:50:11 2015 (r286204) @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%ld", cnf->expire_days); + sbuf_printf(buf, "%lld", (long long)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%ld", cnf->password_days); + sbuf_printf(buf, "%lld", (long long)cnf->password_days); quote = 0; break; case _UC_NONE: From owner-svn-src-head@freebsd.org Sun Aug 2 14:56:32 2015 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 6171A9B0865; Sun, 2 Aug 2015 14:56:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 40E7D1E6E; Sun, 2 Aug 2015 14:56:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72EuWsA085567; Sun, 2 Aug 2015 14:56:32 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72EuVPg085565; Sun, 2 Aug 2015 14:56:31 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508021456.t72EuVPg085565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 2 Aug 2015 14:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286205 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 14:56:32 -0000 Author: ed Date: Sun Aug 2 14:56:30 2015 New Revision: 286205 URL: https://svnweb.freebsd.org/changeset/base/286205 Log: Add a manual page for the cloudabi and cloudabi64 kernel modules. CloudABI has two separate kernel modules: cloudabi and cloudabi64. The first module contains all the pointer size independent code, whereas cloudabi64 contains the actual 64-bits specific system calls and the ELF loader. Reviewed by: wblock Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3258 Added: head/share/man/man4/cloudabi.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Aug 2 13:50:11 2015 (r286204) +++ head/share/man/man4/Makefile Sun Aug 2 14:56:30 2015 (r286205) @@ -96,6 +96,7 @@ MAN= aac.4 \ cdce.4 \ ch.4 \ ciss.4 \ + cloudabi.4 \ cm.4 \ cmx.4 \ ${_coretemp.4} \ @@ -583,6 +584,7 @@ MLINKS+=bwn.4 if_bwn.4 MLINKS+=${_bxe.4} ${_if_bxe.4} MLINKS+=cas.4 if_cas.4 MLINKS+=cdce.4 if_cdce.4 +MLINKS+=cloudabi.4 cloudabi64.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 Added: head/share/man/man4/cloudabi.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cloudabi.4 Sun Aug 2 14:56:30 2015 (r286205) @@ -0,0 +1,103 @@ +.\" Copyright (c) 2015 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. +.\" +.\" $FreeBSD$ +.Dd July 31, 2015 +.Dt CLOUDABI 4 +.Os +.Sh NAME +.Nm cloudabi , +.Nm cloudabi64 +.Nd CloudABI support +.Sh SYNOPSIS +Support for 64-bit CloudABI executables can be compiled into the kernel +by adding this line to the kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_CLOUDABI64" +.Ed +.Pp +CloudABI support can also be loaded at boot time from +.Xr loader.conf 5 : +.Bd -literal -offset indent +cloudabi_load="YES" +cloudabi64_load="YES" +.Ed +.Sh DESCRIPTION +CloudABI is a POSIX-like pure capability-based runtime environment, +similar to +.Xr capsicum 4 . +It can be used to develop applications that are cross-platform, +easier to test, +and hardened against security exploits. +.Pp +Support for CloudABI on +.Fx +consists of two separate kernel modules. +The +.Nm cloudabi +kernel module implements all of the system calls that do not depend on +data structures that differ between architectures. +.Pp +The +.Nm cloudabi64 +kernel module provides implementations of all of the machine-dependent +system calls. +It assumes that pointers stored in data structures provided as system +call arguments are 64 bits in size. +It also provides the image activator that loads and starts 64-bit ELF +executables. +.Pp +Though the +.Nm cloudabi +module can be loaded on any architecture supported by +.Fx , +the +.Nm cloudabi64 +module is only available for amd64. +.Pp +A full cross compilation toolchain for CloudABI is available in the +.Pa devel/cloudabi-toolchain +port. +.Pp +The +.Pa sysutils/cloudabi-utils +port provides the +.Xr cloudabi-run 1 +utility. +.Xr cloudabi-run 1 +can be used to safely execute CloudABI processes with access to a +restricted set of resources. +.Sh SEE ALSO +.Xr cloudabi-run 1 , +.Xr capsicum 4 , +.Xr linux 4 , +.Xr elf 5 +.Pp +cloudlibc on GitHub: +.Pa https://github.com/NuxiNL/cloudlibc . +.Sh HISTORY +CloudABI support first appeared in +.Fx 11.0 . +.Sh AUTHORS +Nuxi: +.Pa https://nuxi.nl/ . From owner-svn-src-head@freebsd.org Sun Aug 2 16:07:32 2015 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 EA5969B194D; Sun, 2 Aug 2015 16:07:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DADB61F73; Sun, 2 Aug 2015 16:07:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72G7VpG019159; Sun, 2 Aug 2015 16:07:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72G7U1I019156; Sun, 2 Aug 2015 16:07:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508021607.t72G7U1I019156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 2 Aug 2015 16:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286206 - 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.20 Precedence: list List-Id: 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, 02 Aug 2015 16:07:32 -0000 Author: tuexen Date: Sun Aug 2 16:07:30 2015 New Revision: 286206 URL: https://svnweb.freebsd.org/changeset/base/286206 Log: Don't take the port numbers for packets containing ABORT chunks from a freed mbuf. Just use them from the stcb. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_indata.c Sun Aug 2 16:07:30 2015 (r286206) @@ -2312,11 +2312,8 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, - struct sockaddr *src, struct sockaddr *dst, - struct sctphdr *sh, struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, - uint8_t mflowtype, uint32_t mflowid, - uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_nets *net, uint32_t * high_tsn) { struct sctp_data_chunk *ch, chunk_buf; struct sctp_association *asoc; @@ -2408,10 +2405,7 @@ sctp_process_data(struct mbuf **mm, int chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; - sctp_abort_association(inp, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) { @@ -2423,10 +2417,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_no_user_data_cause(ch->dp.tsn); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; - sctp_abort_association(inp, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } #ifdef SCTP_AUDITING_ENABLED @@ -2493,12 +2484,7 @@ sctp_process_data(struct mbuf **mm, int snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", ch->ch.chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - sctp_abort_association(inp, stcb, - m, iphlen, - src, dst, - sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } break; Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_indata.h Sun Aug 2 16:07:30 2015 (r286206) @@ -112,12 +112,8 @@ void int sctp_process_data(struct mbuf **, int, int *, int, - struct sockaddr *src, struct sockaddr *dst, - struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint32_t *, - uint8_t, uint32_t, - uint32_t, uint16_t); + struct sctp_nets *, uint32_t *); void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_input.c Sun Aug 2 16:07:30 2015 (r286206) @@ -5981,10 +5981,7 @@ sctp_common_input_processing(struct mbuf } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, - src, dst, sh, - inp, stcb, net, &high_tsn, - mflowtype, mflowid, - vrf_id, port); + inp, stcb, net, &high_tsn); if (retval == 2) { /* * The association aborted, NO UNLOCK needed since From owner-svn-src-head@freebsd.org Sun Aug 2 16:26:42 2015 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 A12919B1E7C; Sun, 2 Aug 2015 16:26:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 90A69D92; Sun, 2 Aug 2015 16:26:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72GQghL027377; Sun, 2 Aug 2015 16:26:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72GQgxR027375; Sun, 2 Aug 2015 16:26:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508021626.t72GQgxR027375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Aug 2015 16:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286208 - in head/sys/dev/pms/freebsd/driver: common ini/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 16:26:42 -0000 Author: imp Date: Sun Aug 2 16:26:41 2015 New Revision: 286208 URL: https://svnweb.freebsd.org/changeset/base/286208 Log: Don't forget to check the vendor when probing. Also, there's no need to double check for if the card has probed before. In fact, there's no reason to single check either. Simplify the code as a result. $FreeBSD$ added to lxutil.c in a non-standard way to help keep the diffs with upstream to a minimum. Differential Revision: https://reviews.freebsd.org/D3263 Modified: head/sys/dev/pms/freebsd/driver/common/lxutil.c head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Modified: head/sys/dev/pms/freebsd/driver/common/lxutil.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/common/lxutil.c Sun Aug 2 16:25:21 2015 (r286207) +++ head/sys/dev/pms/freebsd/driver/common/lxutil.c Sun Aug 2 16:26:41 2015 (r286208) @@ -19,6 +19,7 @@ *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ******************************************************************************/ +/* $FreeBSD$ */ /****************************************************************************** This program is part of PMC-Sierra initiator/target device driver. The functions here are commonly used by different type of drivers that support @@ -756,37 +757,30 @@ STATIC int agtiapi_ProbeCard( device_t d int thisCard ) { int idx; - static U32 cardMap[4] = { 0, 0, 0, 0 }; + u_int16_t agtiapi_vendor; // PCI vendor ID u_int16_t agtiapi_dev; // PCI device ID AGTIAPI_PRINTK("agtiapi_ProbeCard: start\n"); - if ( ! atomic_cmpset_32( &cardMap[thisCard], 0, 5 ) ) { // card already ran - AGTIAPI_PRINTK( "We'll only ID this card once -- %d\n", thisCard ); - return 2; // error return value; card already ran this function - } - else { - agtiapi_dev = pci_get_device( dev ); // get PCI device ID - for( idx = 0; idx < COUNT(ag_card_type); idx++ ) - { - if( ag_card_type[idx].deviceId == agtiapi_dev ) - { // device ID match - memset( (void *)&agCardInfoList[ thisCard ], 0, - sizeof(ag_card_info_t) ); - thisCardInst->cardIdIndex = idx; - thisCardInst->pPCIDev = dev; - thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex; - thisCardInst->cardID = - pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr - AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n", - thisCardInst->pPCIDev, thisCardInst ); - device_printf( dev, - "agtiapi PCI Probe Vendor ID : 0x%x Device ID : 0x%x\n", - pci_get_vendor(dev), agtiapi_dev ); - device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] ); - return 0; - } + agtiapi_vendor = pci_get_vendor( dev ); // get PCI vendor ID + agtiapi_dev = pci_get_device( dev ); // get PCI device ID + for( idx = 0; idx < COUNT(ag_card_type); idx++ ) + { + if ( ag_card_type[idx].deviceId == agtiapi_dev && + ag_card_type[idx].vendorId == agtiapi_vendor) + { // device ID match + memset( (void *)&agCardInfoList[ thisCard ], 0, + sizeof(ag_card_info_t) ); + thisCardInst->cardIdIndex = idx; + thisCardInst->pPCIDev = dev; + thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex; + thisCardInst->cardID = + pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr + AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n", + thisCardInst->pPCIDev, thisCardInst ); + device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] ); + return 0; } } - return 7; + return 1; } Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sun Aug 2 16:25:21 2015 (r286207) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sun Aug 2 16:26:41 2015 (r286208) @@ -214,7 +214,6 @@ STATIC void agtiapi_CheckIOTimeout(void -static unsigned char cardMap[AGTIAPI_MAX_CARDS] = { 0, 0, 0, 0 }; static ag_card_info_t agCardInfoList[ AGTIAPI_MAX_CARDS ]; // card info list static void agtiapi_cam_action( struct cam_sim *, union ccb * ); static void agtiapi_cam_poll( struct cam_sim * ); @@ -695,37 +694,20 @@ Note: static int agtiapi_probe( device_t dev ) { int retVal; - - if ( pci_get_vendor(dev) == PCI_VENDOR_ID_PMC_SIERRA || - pci_get_vendor(dev) == PCI_VENDOR_ID_HIALEAH ) + int thisCard; + ag_card_info_t *thisCardInst; + + thisCard = device_get_unit( dev ); + if ( thisCard >= AGTIAPI_MAX_CARDS ) { - int thisCard = device_get_unit( dev ); -// AGTIAPI_PRINTK("agtiapi_probe: thisCard %d\n", thisCard); - if( thisCard >= AGTIAPI_MAX_CARDS) - { - device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" ); - return (ENXIO); // maybe change to different return value? - } - ag_card_info_t *thisCardInst = &agCardInfoList[ thisCard ]; - retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard ); - if ( retVal ) { - // error on probe - if( retVal == 2 ) return 0; // another thread ran probe on this card - device_printf( dev, - "agtiapi_probe: PCI DEVICE NOT SUPPORTED by this driver!!" - "Vendor ID : 0x%x Device ID : 0x%x\n", - pci_get_vendor(dev), pci_get_device( dev ) ); - return (ENXIO); // maybe change to different return value? - } - else { - // AGTIAPI_PRINTK( "agtiapi_ProbeCard: returned with pointer values " - // "%p / %p\n", - // thisCardInst->pPCIDev, thisCardInst ); - cardMap[thisCard] = 11; // record this card is present - return( BUS_PROBE_DEFAULT ); // successful probe - } + device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" ); + return (ENXIO); // maybe change to different return value? } - return (ENXIO); + thisCardInst = &agCardInfoList[ thisCard ]; + retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard ); + if ( retVal ) + return (ENXIO); // maybe change to different return value? + return( BUS_PROBE_DEFAULT ); // successful probe } From owner-svn-src-head@freebsd.org Sun Aug 2 16:34:43 2015 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 1D24F9B00D1 for ; Sun, 2 Aug 2015 16:34:43 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1.freebsd.org (Postfix) with SMTP id F199D1488 for ; Sun, 2 Aug 2015 16:34:42 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 2 Aug 2015 16:35:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t72GYX9v013990; Sun, 2 Aug 2015 10:34:33 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1438533273.50703.2.camel@freebsd.org> Subject: Re: svn commit: r286168 - head/sys/net From: Ian Lepore To: "Bjoern A. Zeeb" Cc: John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 02 Aug 2015 10:34:33 -0600 In-Reply-To: References: <201508020015.t720Fr6R018929@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 16:34:43 -0000 On Sun, 2015-08-02 at 11:42 +0000, Bjoern A. Zeeb wrote: > > On 02 Aug 2015, at 00:15 , John-Mark Gurney wrote: > > -CTASSERT(sizeof(struct sadb_x_policy) == 16); > > +_Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch"); > > > If this fires, how does it look like? I am assuming the string at the end is the error message? If so and if the assertion is not printed that string should be improved rather than being the same for all checks. > > /bz > It generates a compiler error, so the output is going to contain file-and-line like any other compiler error, as well as the message from the source code. -- Ian From owner-svn-src-head@freebsd.org Sun Aug 2 16:41:14 2015 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 EB8549B0334; Sun, 2 Aug 2015 16:41:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BB8551A21; Sun, 2 Aug 2015 16:41:13 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.15.1) with ESMTPSA id t72Gf66i082161 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Aug 2015 16:41:11 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r286168 - head/sys/net From: David Chisnall In-Reply-To: <1438533273.50703.2.camel@freebsd.org> Date: Sun, 2 Aug 2015 17:42:05 +0100 Cc: "Bjoern A. Zeeb" , John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <064AFABE-35B4-48B9-9F95-545792504984@FreeBSD.org> References: <201508020015.t720Fr6R018929@repo.freebsd.org> <1438533273.50703.2.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 16:41:15 -0000 On 2 Aug 2015, at 17:34, Ian Lepore wrote: > > It generates a compiler error, so the output is going to contain > file-and-line like any other compiler error, as well as the message from > the source code. It will, of course, vary between compilers, but this is what clang generates: $ cat static.c _Static_assert(0, "example assert failed"); $ cc static.c static.c:1:1: error: static_assert failed "example assert failed" _Static_assert(0, "example assert failed"); ^ ~ 1 error generated. GCC 4.8 and later produce very similar output: $ gcc-4.8 static.c static.c:1:1: error: static assertion failed: "example assert failed" _Static_assert(0, "example assert failed"); ^ gcc 4.7 only provides the first line: $ gcc-4.7 static.c static.c:1:1: error: static assertion failed: "example assert failed" David From owner-svn-src-head@freebsd.org Sun Aug 2 18:20:37 2015 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 D37739B17EE; Sun, 2 Aug 2015 18:20:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A4CD513B; Sun, 2 Aug 2015 18:20:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72IKbh1075215; Sun, 2 Aug 2015 18:20:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72IKbXW075196; Sun, 2 Aug 2015 18:20:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021820.t72IKbXW075196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 18:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286210 - head/usr.sbin/pw/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.20 Precedence: list List-Id: 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, 02 Aug 2015 18:20:37 -0000 Author: bapt Date: Sun Aug 2 18:20:36 2015 New Revision: 286210 URL: https://svnweb.freebsd.org/changeset/base/286210 Log: Convert the year used for regression test fro 2043 to 2037 This makes the regression tests pass on systems where time_t is 32bits Modified: head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 16:29:30 2015 (r286209) +++ head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 18:20:36 2015 (r286210) @@ -181,29 +181,29 @@ user_add_expiration_body() { populate_etc_skel atf_check -s exit:0 \ - ${PW} useradd foo -e 20-03-2043 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-03-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -s exit:0 \ - ${PW} useradd foo -e 20-03-43 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-03-37 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -s exit:0 \ - ${PW} useradd foo -e 20-Mar-2043 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-Mar-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e 20-Foo-2043 + ${PW} useradd foo -e 20-Foo-2037 atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e 20-13-2043 - atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2043" + ${PW} useradd foo -e 20-13-2037 + atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2037" atf_check -s exit:0 ${PW} userdel foo atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e "12 20-03-2043" - atf_check -s exit:0 ${PW} useradd foo -e "20-03-2043 12:00" + ${PW} useradd foo -e "12 20-03-2037" + atf_check -s exit:0 ${PW} useradd foo -e "20-03-2037 12:00" atf_check -s exit:0 ${PW} userdel foo } From owner-svn-src-head@freebsd.org Sun Aug 2 18:40:25 2015 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 6DDED9B1C51; Sun, 2 Aug 2015 18:40:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::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 3F6F9B03; Sun, 2 Aug 2015 18:40:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by padck2 with SMTP id ck2so72176682pad.0; Sun, 02 Aug 2015 11:40:24 -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-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=c5CtOLyfsJQ+Qm/zkvPU1Tncn8pO8ynFpxw4bO0YkAk=; b=uMQt+nY2/qfMiz+Cufl538jP4yBI40vI/+5F3vAVgBmr4Z96tQs4nMOx4rVjx7kfCW p5sz5faMSTyejKNx+O3rZIy9nmRlar77nK0+uxprkfF3usaJoBkVz+yRFXX4D9wPcAkl HgudoVHpFVVQk1TmXO82iTmTdTKrGwOV4ceb7nCiIbniZI53T/eIrP6U57eZID5ATlGY vSZinNNTJv2UrIMTgo/fiHgZroKr7jfFPTtcDWYmWuqHZbQ+djyC+fmgB+L56YcQ5mY+ Z1Ig5SBQ3s+0kb3dwaXoLQ4bIr1W/F/Dx6pP/OhumKoq4ifI+SBabFPlG0nCxvRPVlWm mwgg== X-Received: by 10.66.101.71 with SMTP id fe7mr28593683pab.89.1438540824763; Sun, 02 Aug 2015 11:40:24 -0700 (PDT) Received: from raichu ([104.232.114.184]) by smtp.gmail.com with ESMTPSA id v9sm14900116pdr.96.2015.08.02.11.40.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 11:40:23 -0700 (PDT) Sender: Mark Johnston Date: Sun, 2 Aug 2015 11:40:21 -0700 From: Mark Johnston To: Ermal =?iso-8859-1?Q?Lu=E7i?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286028 - head/sys/netinet Message-ID: <20150802184021.GB59626@raichu> References: <201507291804.t6TI42iH065403@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201507291804.t6TI42iH065403@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 18:40:25 -0000 On Wed, Jul 29, 2015 at 06:04:02PM +0000, Ermal Luçi wrote: > Author: eri > Date: Wed Jul 29 18:04:01 2015 > New Revision: 286028 > URL: https://svnweb.freebsd.org/changeset/base/286028 > > Log: > ip_output normalization and fixes > > ip_output has a big chunk of code used to handle special cases with pfil consumers which also forces a reloop on it. > Gather all this code together to make it readable and properly handle the reloop cases. > > Some of the issues identified: > > M_IP_NEXTHOP is not handled properly in existing code. > route reference leaking is possible with in FIB number change > route flags checking is not consistent in the function > > Differential Revision: https://reviews.freebsd.org/D3022 > Reviewed by: gnn > Approved by: gnn(mentor) > MFC after: 4 weeks > > Modified: > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Wed Jul 29 17:59:13 2015 (r286027) > +++ head/sys/netinet/ip_output.c Wed Jul 29 18:04:01 2015 (r286028) > @@ -106,6 +106,94 @@ static void ip_mloopback > extern int in_mcast_loop; > extern struct protosw inetsw[]; > > +static inline int > +ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > + struct sockaddr_in *dst, int *fibnum, int *error) > +{ > + struct m_tag *fwd_tag = NULL; > + struct in_addr odst; > + struct ip *ip; > + > + ip = mtod(m, struct ip *); > + > + /* Run through list of hooks for output packets. */ > + odst.s_addr = ip->ip_dst.s_addr; > + *error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); > + if ((*error) != 0 || m == NULL) > + return 1; /* Finished */ > + This can result in a use-after-free in ip_output() if a pfil hook consumes the first mbuf in the chain. This happens for example when ipfw nat is in use: m_megapullup() copies the input packet into a single cluster, which is returned above. However, ip_output() will continue to reference the original mbuf chain. The patch below fixes the problem for me. Thanks, -Mark diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 0790777..086a8c9 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -107,18 +107,21 @@ extern int in_mcast_loop; extern struct protosw inetsw[]; static inline int -ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, - struct sockaddr_in *dst, int *fibnum, int *error) +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, + struct sockaddr_in *dst, int *fibnum, int *error) { struct m_tag *fwd_tag = NULL; + struct mbuf *m; struct in_addr odst; struct ip *ip; + m = *mp; ip = mtod(m, struct ip *); /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - *error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); + *error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, inp); + m = *mp; if ((*error) != 0 || m == NULL) return 1; /* Finished */ @@ -552,7 +555,7 @@ sendit: /* Jump over all PFIL processing if hooks are not active. */ if (PFIL_HOOKED(&V_inet_pfil_hook)) { - switch (ip_output_pfil(m, ifp, inp, dst, &fibnum, &error)) { + switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, &error)) { case 1: /* Finished */ goto done; From owner-svn-src-head@freebsd.org Sun Aug 2 19:37:43 2015 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 31E419B193D for ; Sun, 2 Aug 2015 19:37:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) (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 049A22C1 for ; Sun, 2 Aug 2015 19:37:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by pacgq8 with SMTP id gq8so7736052pac.3 for ; Sun, 02 Aug 2015 12:37: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:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=2hvezxoA3O8/ySOkDP1xgSdlTn0ImyWTz5ehnNDrOD0=; b=MZS/MC0bd8/iGIAAgMCk4a8lUlJVbC+qlQNVzZ+4tsZ3pueczzUVukSLWdKoqAVyao 24rh+ELWH6cowyWrretEPuwXt8LaabDtwQukyaLboaCgIXOUzUgiy+hLRLXGrklQAqGH dkdojk3nee/c0m9HjnavIkmr77I0MI3+FhMvdJ6WNmZl71f62DrjCJqlMd8HX3/cNj7w 821CaAtKcCjjjw2/abLWhQCp216UF6DTT2l7araCumhuUr84BEC5hMsvxl3biYGRuKCl u3GrStBvn3sf9km2EvpIZ8Uzuc+XE0OgsAEHQtUGA1DQCk9mg4PZ5q+XxPHETuGgOdhf +1DA== X-Gm-Message-State: ALoCoQlagpVYAh3UwpQdsK5lmtBAL9PJJsbV2TwbDuPzhnjb5mvkrlx2eBstIosqXUraEo5UD0Zs X-Received: by 10.67.5.37 with SMTP id cj5mr29095497pad.44.1438544256321; Sun, 02 Aug 2015 12:37:36 -0700 (PDT) Received: from [10.64.26.198] ([69.53.236.236]) by smtp.gmail.com with ESMTPSA id zb2sm5446993pbb.46.2015.08.02.12.37.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Aug 2015 12:37:35 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r284345 - in head: . bin/cat bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/expr bin/freebsd-version bin/getfacl bin/hostname bi... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <852.1438482871@chaos> Date: Sun, 2 Aug 2015 13:37:32 -0600 Cc: Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-Id: <7B84DD3E-87F3-48C9-82CD-687A83CFFB4E@bsdimp.com> References: <201506131920.t5DJKwMH033508@svn.freebsd.org> <20150726204948.GD1522@ivaldir.etoilebsd.net> <852.1438482871@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 19:37:43 -0000 --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 1, 2015, at 8:34 PM, Simon J. Gerraty wrote: >=20 > Baptiste Daroussin wrote: >> This breaks using fmake from ports because of usage of :U in sys.mk >=20 > Oops - sorry. > I saw Warner posted a patch for this which looked ok, but doesn't = appear > to have been committed. Yea, I wanted to roll in your comments first, but my week has been quite = busy since then=E2=80=A6 Wanrer >> is compatible with FreeBSD 9 (not that I'm just speaking about sys.mk = not other >> parts) >=20 > Understood. >=20 > AFAICT the following allows fmake to consume sys.mk >=20 > Index: share/mk/sys.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/mk/sys.mk (revision 286177) > +++ share/mk/sys.mk (working copy) > @@ -33,8 +33,10 @@ >=20 > # early include for customization > # see local.sys.mk below > -.-include > +.sinclude >=20 > +.if defined(.PARSEDIR) > +# none of this is relevant without bmake > .if ${MK_META_MODE} =3D=3D "yes" > .-include > .elif ${MK_META_FILES} =3D=3D "yes" && ${.MAKEFLAGS:U:M-B} =3D=3D "" > @@ -44,6 +46,7 @@ > # This needs to be done early - before .PATH is computed > .-include > .endif > +.endif >=20 > # If the special target .POSIX appears (without prerequisites or > # commands) before the first noncomment line in the makefile, make = shall > @@ -361,7 +364,7 @@ > .endif >=20 > # late include for customization > -.-include > +.sinclude >=20 > .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) > SHELL=3D ${__MAKE_SHELL} > @@ -378,11 +381,12 @@ > # when running target scripts, this is a problem for many makefiles = here. > # So define a shell that will do what FreeBSD expects. > .ifndef WITHOUT_SHELL_ERRCTL > +___MAKE_SHELL?=3D /bin/sh > .SHELL: name=3Dsh \ > quiet=3D"set -" echo=3D"set -v" filter=3D"set -" \ > hasErrCtl=3Dyes check=3D"set -e" ignore=3D"set +e" \ > echoFlag=3Dv errFlag=3De \ > - path=3D${__MAKE_SHELL:U/bin/sh} > + path=3D${__MAKE_SHELL} > .endif >=20 > .include >=20 --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A 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 iQIcBAEBCgAGBQJVvnF9AAoJEGwc0Sh9sBEAAPYP/2oWZ72BwG9aqum2+6/cCsj1 QpjnDVGafhdDlWY0LHCzfQoENDcQKBxiD3wV0JcH+bggG6sZsxN1ylCLPRoP8PND /JtzzsCZuScagCFwxKSgRAg2djm1+5DTlFJuHpb2swvFPe4Nxn4aXIQEbSbZFKaK 5dqo9m9cQTkeHs7tl2Ky+WmHA0Rz8c/KcNaRnPy1TYUUau+wJ3jQE6pG8C8jNiAI EF9syF5ur1VPpy7TqA02112W8VtI3Kw9x74NpuiFWPifP5I228BOwVvXx6VCOxdr UXf3W2sJ6jdhH/fFdbLi69n7z+3HplUKCmSbuccerdeN4rR8QB94HifEAhhIpiGU Ec16RSJZjTX4qpGGwEDpeO9k+4oFFxdhvsSoJjLGQjPoZ1kDFj5Gj385hntn+Geo w9jN0JD0tG/gPTwtrW3pKVji60VpEHvXDcGjXDJ1G1eh3H4INVLzWaWXLFmzNRtH 3ayPU5Ajd9qBFXJdqeGojScPfTD9BmAHswbfBxyW6VgCKvXnyG6YwNdoJyjytta2 87IiHD2CqqzuQCUd3t8LHR3tq25e8j51uboJsUoey0rTiaiePtur1+OBOcWMMKx7 Bb3ahzUOSdH7nKMN/cVwyHKPVW9cSo8BhlGskkC+kxBRox3LMh11czs+1J7zlO63 N10juwCUnPSfMJYUt41E =vhJu -----END PGP SIGNATURE----- --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A-- From owner-svn-src-head@freebsd.org Sun Aug 2 19:49:25 2015 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 3196D9B1C02; Sun, 2 Aug 2015 19:49:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 221D0B29; Sun, 2 Aug 2015 19:49:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72JnPDd011080; Sun, 2 Aug 2015 19:49:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72JnO2U011079; Sun, 2 Aug 2015 19:49:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021949.t72JnO2U011079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 19:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286211 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 19:49:25 -0000 Author: bapt Date: Sun Aug 2 19:49:24 2015 New Revision: 286211 URL: https://svnweb.freebsd.org/changeset/base/286211 Log: Use intmax_t rather than long long Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 18:20:36 2015 (r286210) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 19:49:24 2015 (r286211) @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%lld", (long long)cnf->expire_days); + sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%lld", (long long)cnf->password_days); + sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); quote = 0; break; case _UC_NONE: From owner-svn-src-head@freebsd.org Sun Aug 2 21:24:04 2015 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 5651B9B12FA; Sun, 2 Aug 2015 21:24:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 44FBC1C15; Sun, 2 Aug 2015 21:24:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72LO4Qs056003; Sun, 2 Aug 2015 21:24:04 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72LO4Jc056002; Sun, 2 Aug 2015 21:24:04 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508022124.t72LO4Jc056002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 2 Aug 2015 21:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286212 - head/tools/bus_space/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 21:24:04 -0000 Author: marcel Date: Sun Aug 2 21:24:03 2015 New Revision: 286212 URL: https://svnweb.freebsd.org/changeset/base/286212 Log: Add an example program (in Python) for the AMD Am79c900 (ILACC) ethernet controller. The ethernet controller is emulated by VMware Fusion (for example) and is a good device to demonstrate how to use the bus space and busdma functions due to its simple programming. The program sets up the DMA structures, sends a DHCP discover packet, waits 2 seconds, and iterates over the receive ring for an offer. Added: head/tools/bus_space/examples/ head/tools/bus_space/examples/am79c900_diag.py (contents, props changed) Added: head/tools/bus_space/examples/am79c900_diag.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/examples/am79c900_diag.py Sun Aug 2 21:24:03 2015 (r286212) @@ -0,0 +1,344 @@ +#!/usr/bin/env python +# +# Copyright (c) 2014 Marcel Moolenaar +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 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$ +# + +''' +Simple diagnostics program fo the AMD Am89c900 series ILACC. +This ethernet controller is emulated by VMware Fusion among +possibly other virtualization platforms. + +The datasheet can be found here: + http://support.amd.com/TechDocs/18219.pdf + +This example program sends a single DHCP discovery packet, +waits 2 seconds and then iterates over the receive ring for +a targeted packet. + +For this program to function, connect the network interface +to a network with a DHCP server. In VMware Fusion this can +best be done by configuring the interface as a NAT interface +using the "Share with my Mac" setting. +''' + +import ctypes +import logging +import os +import sys +import time + +sys.path.append('/usr/lib') + +import bus +import busdma + + +# ILACC initialization block definition +class initblock(ctypes.LittleEndianStructure): + _fields_ = [('mode', ctypes.c_uint32), + ('hwaddr', ctypes.c_uint8 * 6), + ('_pad1_', ctypes.c_uint16), + ('filter', ctypes.c_uint16 * 4), + ('rxdesc', ctypes.c_uint32), + ('txdesc', ctypes.c_uint32), + ('_pad2_', ctypes.c_uint32)] + + +# ILACC ring buffer descriptor +class bufdesc(ctypes.LittleEndianStructure): + _fields_ = [('buffer', ctypes.c_uint32), + ('flags', ctypes.c_uint32), + ('length', ctypes.c_uint32), + ('_pad_', ctypes.c_uint32)] + + +# The DHCP packet definition (incl. all headers) +class packet(ctypes.BigEndianStructure): + _pack_ = 1 + _fields_ = [('eth_dest', ctypes.c_uint8 * 6), + ('eth_src', ctypes.c_uint8 * 6), + ('eth_type', ctypes.c_uint16), + ('ip_vl', ctypes.c_uint8), + ('ip_de', ctypes.c_uint8), + ('ip_len', ctypes.c_uint16), + ('ip_id', ctypes.c_uint16), + ('ip_ff', ctypes.c_uint16), + ('ip_ttl', ctypes.c_uint8), + ('ip_proto', ctypes.c_uint8), + ('ip_cksum', ctypes.c_uint16), + ('ip_src', ctypes.c_uint32), + ('ip_dest', ctypes.c_uint32), + ('udp_src', ctypes.c_uint16), + ('udp_dest', ctypes.c_uint16), + ('udp_len', ctypes.c_uint16), + ('udp_cksum', ctypes.c_uint16), + ('bootp_op', ctypes.c_uint8), + ('bootp_htype', ctypes.c_uint8), + ('bootp_hlen', ctypes.c_uint8), + ('bootp_hops', ctypes.c_uint8), + ('bootp_xid', ctypes.c_uint32), + ('bootp_secs', ctypes.c_uint16), + ('bootp_flags', ctypes.c_uint16), + ('bootp_ciaddr', ctypes.c_uint32), + ('bootp_yiaddr', ctypes.c_uint32), + ('bootp_siaddr', ctypes.c_uint32), + ('bootp_giaddr', ctypes.c_uint32), + ('bootp_chaddr', ctypes.c_uint8 * 16), + ('bootp_sname', ctypes.c_uint8 * 64), + ('bootp_file', ctypes.c_uint8 * 128), + ('dhcp_magic', ctypes.c_uint32), + ('dhcp_options', ctypes.c_uint8 * 60)] + +MACFMT = '%02x:%02x:%02x:%02x:%02x:%02x' + +dev = 'pci0:2:1:0' + +logging.basicConfig(level=logging.DEBUG) + +pcicfg = bus.map(dev, 'pcicfg') +logging.debug('pcicfg=%s (%s)' % (pcicfg, dev)) + +vendor = bus.read_2(pcicfg, 0) +device = bus.read_2(pcicfg, 2) +if vendor != 0x1022 or device != 0x2000: + logging.error('Not an AMD PCnet-PCI (vendor=%x, device=%x)' % + (vendor, device)) + sys.exit(1) + +command = bus.read_2(pcicfg, 4) +if not (command & 1): + logging.info('enabling I/O port decoding') + command |= 1 + bus.write_2(pcicfg, 4, command) + +if not (command & 4): + logging.info('enabling bus mastering') + command |= 4 + bus.write_2(pcicfg, 4, command) + +bus.unmap(pcicfg) + +io = bus.map(dev, '10.io') +logging.debug('io=%s (%s)' % (io, dev)) + + +def delay(msec): + time.sleep(msec / 1000.0) + + +def ffs(x): + y = (1 + (x ^ (x-1))) >> 1 + return y.bit_length() + + +def ip_str(a): + return '%d.%d.%d.%d' % ((a >> 24) & 255, (a >> 16) & 255, (a >> 8) & 255, + a & 255) + + +def mac_is(l, r): + for i in xrange(6): + if l[i] != r[i]: + return False + return True + + +def mac_str(m): + return MACFMT % (m[0], m[1], m[2], m[3], m[4], m[5]) + + +def rdbcr(reg): + bus.write_2(io, 0x12, reg & 0xffff) + return bus.read_2(io, 0x16) + + +def wrbcr(reg, val): + bus.write_2(io, 0x12, reg & 0xffff) + bus.write_2(io, 0x16, val & 0xffff) + + +def rdcsr(reg): + bus.write_2(io, 0x12, reg & 0xffff) + return bus.read_2(io, 0x10) + + +def wrcsr(reg, val): + bus.write_2(io, 0x12, reg & 0xffff) + bus.write_2(io, 0x10, val & 0xffff) + + +def start(): + wrcsr(0, 0x42) + delay(100) + + +def stop(): + wrcsr(0, 4) + delay(100) + + +mac = () +bcast = () +for o in xrange(6): + mac += (bus.read_1(io, o),) + bcast += (0xff,) +logging.info('ethernet address = ' + MACFMT % mac) + +stop() +wrbcr(20, 2) # reset +wrcsr(3, 0) # byte swapping mode +wrbcr(2, rdbcr(2) | 2) # Autoneg + +memsize = 32*1024 +bufsize = 1536 +nrxbufs = 16 +ntxbufs = 4 +logging.debug("DMA memory: size = %#x (TX buffers: %u, RX buffers: %u)" % + (memsize, ntxbufs, nrxbufs)) + +mem_tag = busdma.tag_create(dev, 16, 0, 0xffffffff, memsize, 1, memsize, 0, 0) +dmamem = busdma.mem_alloc(mem_tag, 0) +busseg = busdma.md_first_seg(dmamem, busdma.MD_BUS_SPACE) +cpuseg = busdma.md_first_seg(dmamem, busdma.MD_VIRT_SPACE) +busaddr = busdma.seg_get_addr(busseg) +cpuaddr = busdma.seg_get_addr(cpuseg) +logging.debug("DMA memory: CPU address: %#x, device address: %#x" % + (cpuaddr, busaddr)) + +addr_initblock = cpuaddr +addr_rxdesc = addr_initblock + ctypes.sizeof(initblock) +addr_txdesc = addr_rxdesc + ctypes.sizeof(bufdesc) * nrxbufs +addr_rxbufs = addr_txdesc + ctypes.sizeof(bufdesc) * ntxbufs +addr_txbufs = addr_rxbufs + bufsize * nrxbufs + +ib = initblock.from_address(addr_initblock) +ib.mode = ((ffs(ntxbufs) - 1) << 28) | ((ffs(nrxbufs) - 1) << 20) +for i in xrange(len(mac)): + ib.hwaddr[i] = mac[i] +for i in xrange(4): + ib.filter[i] = 0xffff +ib.rxdesc = busaddr + (addr_rxdesc - cpuaddr) +ib.txdesc = busaddr + (addr_txdesc - cpuaddr) +ib._pad1_ = 0 +ib._pad2_ = 0 + +for i in xrange(nrxbufs): + bd = bufdesc.from_address(addr_rxdesc + ctypes.sizeof(bufdesc) * i) + bd.buffer = busaddr + (addr_rxbufs - cpuaddr) + bufsize * i + bd.flags = (1 << 31) | (15 << 12) | (-bufsize & 0xfff) + bd.length = 0 + bd._pad_ = 0 + +for i in xrange(ntxbufs): + bd = bufdesc.from_address(addr_txdesc + ctypes.sizeof(bufdesc) * i) + bd.buffer = busaddr + (addr_txbufs - cpuaddr) + bufsize * i + bd.flags = (15 << 12) + bd.length = 0 + bd._pad_ = 0 + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, 0, addr_rxbufs - cpuaddr) + +# Program address of DMA memory +wrcsr(1, busaddr) +wrcsr(2, busaddr >> 16) +delay(100) + +# Initialize hardware +wrcsr(0, 1) +logging.debug('Waiting for initialization to complete') +csr = rdcsr(0) +while (csr & 0x100) == 0: + logging.debug('CSR=%#x' % (csr)) + csr = rdcsr(0) + +start() + +pkt = packet.from_address(addr_txbufs) +ctypes.memset(addr_txbufs, 0, ctypes.sizeof(pkt)) +options = [53, 1, 1] +for i in xrange(len(options)): + pkt.dhcp_options[i] = options[i] +pkt.dhcp_magic = 0x63825363 +for i in xrange(6): + pkt.bootp_chaddr[i] = mac[i] +pkt.bootp_hlen = 6 +pkt.bootp_htype = 1 +pkt.bootp_op = 1 +pkt.udp_len = ctypes.sizeof(pkt) - 34 +pkt.udp_dest = 67 +pkt.udp_src = 68 +pkt.ip_dest = 0xffffffff +pkt.ip_cksum = 0x79a6 +pkt.ip_proto = 17 +pkt.ip_ttl = 64 +pkt.ip_len = ctypes.sizeof(pkt) - 14 +pkt.ip_vl = 0x45 +pkt.eth_type = 0x0800 +for i in xrange(6): + pkt.eth_src[i] = mac[i] + pkt.eth_dest[i] = bcast[i] +pktlen = ctypes.sizeof(pkt) + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_txbufs - cpuaddr, bufsize) + +bd = bufdesc.from_address(addr_txdesc) +bd.length = 0 +bd.flags = (1 << 31) | (1 << 25) | (1 << 24) | (0xf << 12) | (-pktlen & 0xfff) + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_txdesc - cpuaddr, + ctypes.sizeof(bufdesc)) + +wrcsr(0, 0x48) + +logging.info('DHCP discovery packet sent') + +# Now wait 2 seconds for a DHCP offer to be received. +logging.debug('Waiting 2 seconds for an offer to be received') +time.sleep(2) + +stop() + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_rxdesc - cpuaddr, + ctypes.sizeof(bufdesc) * nrxbufs) + +for i in xrange(nrxbufs): + bd = bufdesc.from_address(addr_rxdesc + ctypes.sizeof(bufdesc) * i) + if (bd.flags & 0x80000000): + continue + pkt = packet.from_address(addr_rxbufs + i * bufsize) + if mac_is(pkt.eth_dest, bcast): + logging.debug('RX #%d: broadcast packet: length %u' % (i, bd.length)) + continue + if not mac_is(pkt.eth_dest, mac): + logging.debug('RX #%d: packet for %s?' % (i, mac_str(pkt.eth_dest))) + continue + logging.debug('RX %d: packet from %s!' % (i, mac_str(pkt.eth_src))) + logging.info('Our IP address = %s' % (ip_str(pkt.ip_dest))) + +busdma.mem_free(dmamem) +busdma.tag_destroy(mem_tag) +bus.unmap(io) From owner-svn-src-head@freebsd.org Sun Aug 2 21:33:41 2015 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 191319B191C; Sun, 2 Aug 2015 21:33:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 09DE834A; Sun, 2 Aug 2015 21:33:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72LXeVB060621; Sun, 2 Aug 2015 21:33:40 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72LXeZc060620; Sun, 2 Aug 2015 21:33:40 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508022133.t72LXeZc060620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 21:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286213 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 02 Aug 2015 21:33:41 -0000 Author: jmg Date: Sun Aug 2 21:33:40 2015 New Revision: 286213 URL: https://svnweb.freebsd.org/changeset/base/286213 Log: looks like all archs either have clang or cdefs included before.. drop this include as unnecessary.. Requested by: bde Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Sun Aug 2 21:24:03 2015 (r286212) +++ head/sys/net/pfkeyv2.h Sun Aug 2 21:33:40 2015 (r286213) @@ -39,8 +39,6 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#include - /* This file defines structures and symbols for the PF_KEY Version 2 key management interface. It was written at the U.S. Naval Research From owner-svn-src-head@freebsd.org Mon Aug 3 01:22:50 2015 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 998739AFA64; Mon, 3 Aug 2015 01:22:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8A44F1C7D; Mon, 3 Aug 2015 01:22:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t731Moqi056318; Mon, 3 Aug 2015 01:22:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t731MoXh056317; Mon, 3 Aug 2015 01:22:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201508030122.t731MoXh056317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 3 Aug 2015 01:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286214 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 01:22:50 -0000 Author: gonzo Date: Mon Aug 3 01:22:49 2015 New Revision: 286214 URL: https://svnweb.freebsd.org/changeset/base/286214 Log: Pass correct type of argument to ti_gpio_unmask_irq in ti_gpio_activate_resource Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sun Aug 2 21:33:40 2015 (r286213) +++ head/sys/arm/ti/ti_gpio.c Mon Aug 3 01:22:49 2015 (r286214) @@ -849,14 +849,16 @@ static int ti_gpio_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { - int pin; + struct ti_gpio_mask_arg mask_arg; if (type != SYS_RES_IRQ) return (ENXIO); /* Unmask the interrupt. */ - pin = rman_get_start(res); - ti_gpio_unmask_irq((void *)(uintptr_t)pin); + mask_arg.pin = rman_get_start(res); + mask_arg.softc = device_get_softc(dev); + + ti_gpio_unmask_irq((void *)&mask_arg); return (0); } From owner-svn-src-head@freebsd.org Mon Aug 3 01:24:49 2015 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 863359AFC11; Mon, 3 Aug 2015 01:24:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 76D081E2F; Mon, 3 Aug 2015 01:24:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t731OnRr056437; Mon, 3 Aug 2015 01:24:49 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t731Om1f056435; Mon, 3 Aug 2015 01:24:48 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508030124.t731Om1f056435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 3 Aug 2015 01:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286215 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 01:24:49 -0000 Author: marcel Date: Mon Aug 3 01:24:48 2015 New Revision: 286215 URL: https://svnweb.freebsd.org/changeset/base/286215 Log: Make image_copyout_zeroes() an interface function. Modified: head/usr.bin/mkimg/image.c head/usr.bin/mkimg/image.h Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Mon Aug 3 01:22:49 2015 (r286214) +++ head/usr.bin/mkimg/image.c Mon Aug 3 01:24:48 2015 (r286215) @@ -517,14 +517,14 @@ image_copyout_memory(int fd, size_t size return (0); } -static int -image_copyout_zeroes(int fd, size_t size) +int +image_copyout_zeroes(int fd, size_t count) { static uint8_t *zeroes = NULL; size_t sz; int error; - if (lseek(fd, (off_t)size, SEEK_CUR) != -1) + if (lseek(fd, (off_t)count, SEEK_CUR) != -1) return (0); /* @@ -537,12 +537,12 @@ image_copyout_zeroes(int fd, size_t size return (ENOMEM); } - while (size > 0) { - sz = (size > secsz) ? secsz : size; + while (count > 0) { + sz = (count > secsz) ? secsz : count; error = image_copyout_memory(fd, sz, zeroes); if (error) return (error); - size -= sz; + count -= sz; } return (0); } Modified: head/usr.bin/mkimg/image.h ============================================================================== --- head/usr.bin/mkimg/image.h Mon Aug 3 01:22:49 2015 (r286214) +++ head/usr.bin/mkimg/image.h Mon Aug 3 01:24:48 2015 (r286215) @@ -35,6 +35,7 @@ int image_copyin(lba_t blk, int fd, uint int image_copyout(int fd); int image_copyout_done(int fd); int image_copyout_region(int fd, lba_t blk, lba_t size); +int image_copyout_zeroes(int fd, size_t count); int image_data(lba_t blk, lba_t size); lba_t image_get_size(void); int image_init(void); From owner-svn-src-head@freebsd.org Mon Aug 3 01:50:53 2015 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 E15159B203F for ; Mon, 3 Aug 2015 01:50:52 +0000 (UTC) (envelope-from www-data@h1637417.stratoserver.net) Received: from h1637417.stratoserver.net (h1637417.stratoserver.net [85.214.61.70]) by mx1.freebsd.org (Postfix) with ESMTP id 69CB6A4D for ; Mon, 3 Aug 2015 01:50:52 +0000 (UTC) (envelope-from www-data@h1637417.stratoserver.net) Received: from localhost (localhost [127.0.0.1]) by h1637417.stratoserver.net (Postfix) with ESMTP id 13FD42104A9D for ; Mon, 3 Aug 2015 03:50:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at h1637417.stratoserver.net Received: from h1637417.stratoserver.net ([127.0.0.1]) by localhost (h1637417.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l7Tz+7UOnkUn for ; Mon, 3 Aug 2015 03:50:39 +0200 (CEST) Received: by h1637417.stratoserver.net (Postfix, from userid 33) id 24AFB2104AB5; Mon, 3 Aug 2015 03:50:28 +0200 (CEST) To: svn-src-head@freebsd.org Subject: Notice to Appear in Court Date: Mon, 3 Aug 2015 03:50:28 +0200 From: "State Court" Reply-To: "State Court" Message-ID: X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 01:50:53 -0000 Notice to Appear, You have to appear in the Court on the August 07. Please, do not forget to bring all the documents related to the case. Note: The case will be heard by the judge in your absence if you do not come. The Court Notice is attached to this email. Regards, Phillip Mcdowell, Court Secretary. From owner-svn-src-head@freebsd.org Mon Aug 3 05:58:18 2015 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 EFB1C99C111; Mon, 3 Aug 2015 05:58:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 BE33C100F; Mon, 3 Aug 2015 05:58:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodd187 with SMTP id d187so134722190iod.2; Sun, 02 Aug 2015 22:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zj6zIW44ciMGgZpDGlP3u7XU/JzvAfYC20gr70xmwlc=; b=lSgNqSPEOCR6d503ZsaFlEykWJK5xgr1n8lmf2ZnpA7iGUMGnI1+Tkp1y89q6GT6BM qDwTA3D8C0lpvn85oG+L+OLzbgDPweXkL8OW0Q7BQPgCtpvjN6nEmkauU5inTJhLdgs0 47788NuZ3e0DvIM8aSKMuio+hPY5qiYR21ijZ5GAZtqPgg8WTza5uq8bLrB/C9tw0jJF vIjVc969WIwTdAMt3RTe0U3Rig9Ik7Ub49llPOblNnQKOVdQR9OZB0578hSkqhCnxZ7U 7VnPN1hcH1rwVBqltV+ZMSqDW9xf8/9rHMvs1glRhFkpaacNKvV04kIZWp3jC2hSmMZa 3tbQ== MIME-Version: 1.0 X-Received: by 10.107.169.138 with SMTP id f10mr17617355ioj.75.1438581497205; Sun, 02 Aug 2015 22:58:17 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Sun, 2 Aug 2015 22:58:17 -0700 (PDT) In-Reply-To: <201508021949.t72JnO2U011079@repo.freebsd.org> References: <201508021949.t72JnO2U011079@repo.freebsd.org> Date: Sun, 2 Aug 2015 22:58:17 -0700 Message-ID: Subject: Re: svn commit: r286211 - head/usr.sbin/pw From: Adrian Chadd To: Baptiste Daroussin 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.20 Precedence: list List-Id: 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, 03 Aug 2015 05:58:18 -0000 pw is still broken, compiling mips: cc1: warnings being treated as errors /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_show': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:758: warning: comparison of unsigned expression < 0 is always false /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_del': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:831: warning: comparison of unsigned expression < 0 is always false /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_mod': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:1433: warning: suggest parentheses around assignment used as truth value --- pw_user.o --- .. tsk bapt! I'm on holiday and I can't build -head. :( -a On 2 August 2015 at 12:49, Baptiste Daroussin wrote: > Author: bapt > Date: Sun Aug 2 19:49:24 2015 > New Revision: 286211 > URL: https://svnweb.freebsd.org/changeset/base/286211 > > Log: > Use intmax_t rather than long long > > Modified: > head/usr.sbin/pw/pw_conf.c > > Modified: head/usr.sbin/pw/pw_conf.c > ============================================================================== > --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 18:20:36 2015 (r286210) > +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 19:49:24 2015 (r286211) > @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c > quote = 0; > break; > case _UC_EXPIRE: > - sbuf_printf(buf, "%lld", (long long)cnf->expire_days); > + sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); > quote = 0; > break; > case _UC_PASSWORD: > - sbuf_printf(buf, "%lld", (long long)cnf->password_days); > + sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); > quote = 0; > break; > case _UC_NONE: > From owner-svn-src-head@freebsd.org Mon Aug 3 05:59:31 2015 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 6B0A799C178; Mon, 3 Aug 2015 05:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5C88811B0; Mon, 3 Aug 2015 05:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t735xVG6036550; Mon, 3 Aug 2015 05:59:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t735xVsI036549; Mon, 3 Aug 2015 05:59:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508030559.t735xVsI036549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 3 Aug 2015 05:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286217 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 05:59:31 -0000 Author: adrian Date: Mon Aug 3 05:59:30 2015 New Revision: 286217 URL: https://svnweb.freebsd.org/changeset/base/286217 Log: Actually set quiet to something. /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Aug 3 03:08:48 2015 (r286216) +++ head/usr.sbin/pw/pw_user.c Mon Aug 3 05:59:30 2015 (r286217) @@ -677,7 +677,7 @@ pw_user_next(int argc, char **argv, char cfg = optarg; break; case 'q': - quiet; + quiet = true; break; } } From owner-svn-src-head@freebsd.org Mon Aug 3 06:06:57 2015 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 E41B399C385; Mon, 3 Aug 2015 06:06:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CF9C81A1A; Mon, 3 Aug 2015 06:06:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7366vjs040600; Mon, 3 Aug 2015 06:06:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7366vBn040599; Mon, 3 Aug 2015 06:06:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508030606.t7366vBn040599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Aug 2015 06:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286218 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 06:06:58 -0000 Author: bapt Date: Mon Aug 3 06:06:56 2015 New Revision: 286218 URL: https://svnweb.freebsd.org/changeset/base/286218 Log: Fix bugs spotted by gcc Reported by: adrian Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Aug 3 05:59:30 2015 (r286217) +++ head/usr.sbin/pw/pw_user.c Mon Aug 3 06:06:56 2015 (r286218) @@ -700,7 +700,7 @@ pw_user_show(int argc, char **argv, char { struct passwd *pwd = NULL; char *name = NULL; - uid_t id = -1; + intmax_t id = -1; int ch; bool all = false; bool pretty = false; @@ -786,7 +786,7 @@ pw_user_del(int argc, char **argv, char char home[MAXPATHLEN]; const char *cfg = NULL; struct stat st; - uid_t id; + intmax_t id = -1; int ch, rc; bool nis = false; bool deletehome = false; @@ -1423,8 +1423,9 @@ pw_user_mod(int argc, char **argv, char int ch, fd = -1; size_t i, j; bool quiet, createhome, pretty, dryrun, nis, edited, docreatehome; + bool precrypted; mode_t homemode = 0; - time_t expire_days, password_days, now, precrypted; + time_t expire_days, password_days, now; expire_days = password_days = -1; gecos = homedir = grname = name = newname = skel = shell =NULL; From owner-svn-src-head@freebsd.org Mon Aug 3 06:52:43 2015 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 9F9B199CDFF; Mon, 3 Aug 2015 06:52:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::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 6B9F3D26; Mon, 3 Aug 2015 06:52:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykdu72 with SMTP id u72so103246074ykd.2; Sun, 02 Aug 2015 23:52:42 -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:date:message-id:subject :from:to:cc:content-type; bh=yb3ibPIAx9kyT58AeOYJcrxuykd3yFAF5eNUE7pv2vA=; b=P/p2vbAA/pWSKA6a/oGJJePiGpC2cDniwE92XtrZPueISO3/C9t9i0nLV7ZYcSNp0i N78Pem5x8E926iOjlbAB/b+jIu54BJczpMYnadhU1zlfQaZqhOEnxPSr8Qp3yDCDyuAk ybzp7OebRNH9HxgSO7i2Bc1tkdleXHjsW0DZ7z638p/cxG8vrI/tQ64IBtGhKvIoHrij h3InuUyzeatbCdM7ecpUFIQeWWFUHck6uMVeUOOAjd7Whb07inCh+pme1wpFL4hiqwdq 4WQaapVeCrUxgKyXwGh6uph40cQop2nNDYXPk0Kqkj3iaVe2J3MmTcqPgqDBcOLfbsVb +Vug== MIME-Version: 1.0 X-Received: by 10.129.45.68 with SMTP id t65mr19133849ywt.152.1438584762390; Sun, 02 Aug 2015 23:52:42 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.83.139 with HTTP; Sun, 2 Aug 2015 23:52:42 -0700 (PDT) In-Reply-To: <20150802184021.GB59626@raichu> References: <201507291804.t6TI42iH065403@repo.freebsd.org> <20150802184021.GB59626@raichu> Date: Mon, 3 Aug 2015 08:52:42 +0200 X-Google-Sender-Auth: S4oAVOtBo0MjtJpT9dYOYvQ-tIg Message-ID: Subject: Re: svn commit: r286028 - head/sys/netinet From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= 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 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 06:52:43 -0000 On Sun, Aug 2, 2015 at 8:40 PM, Mark Johnston wrote: > On Wed, Jul 29, 2015 at 06:04:02PM +0000, Ermal Lu=C3=A7i wrote: > > Author: eri > > Date: Wed Jul 29 18:04:01 2015 > > New Revision: 286028 > > URL: https://svnweb.freebsd.org/changeset/base/286028 > > > > Log: > > ip_output normalization and fixes > > > > ip_output has a big chunk of code used to handle special cases with > pfil consumers which also forces a reloop on it. > > Gather all this code together to make it readable and properly handle > the reloop cases. > > > > Some of the issues identified: > > > > M_IP_NEXTHOP is not handled properly in existing code. > > route reference leaking is possible with in FIB number change > > route flags checking is not consistent in the function > > > > Differential Revision: https://reviews.freebsd.org/D3022 > > Reviewed by: gnn > > Approved by: gnn(mentor) > > MFC after: 4 weeks > > > > Modified: > > head/sys/netinet/ip_output.c > > > > Modified: head/sys/netinet/ip_output.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/netinet/ip_output.c Wed Jul 29 17:59:13 2015 > (r286027) > > +++ head/sys/netinet/ip_output.c Wed Jul 29 18:04:01 2015 > (r286028) > > @@ -106,6 +106,94 @@ static void ip_mloopback > > extern int in_mcast_loop; > > extern struct protosw inetsw[]; > > > > +static inline int > > +ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > > + struct sockaddr_in *dst, int *fibnum, int *error) > > +{ > > + struct m_tag *fwd_tag =3D NULL; > > + struct in_addr odst; > > + struct ip *ip; > > + > > + ip =3D mtod(m, struct ip *); > > + > > + /* Run through list of hooks for output packets. */ > > + odst.s_addr =3D ip->ip_dst.s_addr; > > + *error =3D pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, i= np); > > + if ((*error) !=3D 0 || m =3D=3D NULL) > > + return 1; /* Finished */ > > + > > This can result in a use-after-free in ip_output() if a pfil hook > consumes the first mbuf in the chain. This happens for example when ipfw > nat is in use: m_megapullup() copies the input packet into a single > cluster, which is returned above. However, ip_output() will continue to > reference the original mbuf chain. > > The patch below fixes the problem for me. > > Good catch just push it in. Ok for me. > Thanks, > -Mark > > diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c > index 0790777..086a8c9 100644 > --- a/sys/netinet/ip_output.c > +++ b/sys/netinet/ip_output.c > @@ -107,18 +107,21 @@ extern int in_mcast_loop; > extern struct protosw inetsw[]; > > static inline int > -ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > - struct sockaddr_in *dst, int *fibnum, int *error) > +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, > + struct sockaddr_in *dst, int *fibnum, int *error) > { > struct m_tag *fwd_tag =3D NULL; > + struct mbuf *m; > struct in_addr odst; > struct ip *ip; > > + m =3D *mp; > ip =3D mtod(m, struct ip *); > > /* Run through list of hooks for output packets. */ > odst.s_addr =3D ip->ip_dst.s_addr; > - *error =3D pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, i= np); > + *error =3D pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, i= np); > + m =3D *mp; > if ((*error) !=3D 0 || m =3D=3D NULL) > return 1; /* Finished */ > > @@ -552,7 +555,7 @@ sendit: > > /* Jump over all PFIL processing if hooks are not active. */ > if (PFIL_HOOKED(&V_inet_pfil_hook)) { > - switch (ip_output_pfil(m, ifp, inp, dst, &fibnum, &error)= ) > { > + switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, > &error)) { > case 1: /* Finished */ > goto done; > > --=20 Ermal From owner-svn-src-head@freebsd.org Mon Aug 3 07:29:58 2015 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 CF4699B26A8; Mon, 3 Aug 2015 07:29:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C11AC8AC; Mon, 3 Aug 2015 07:29:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t737TwpL074815; Mon, 3 Aug 2015 07:29:58 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t737TwlP074814; Mon, 3 Aug 2015 07:29:58 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508030729.t737TwlP074814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 07:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286221 - head/sys/amd64/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.20 Precedence: list List-Id: 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, 03 Aug 2015 07:29:58 -0000 Author: ed Date: Mon Aug 3 07:29:57 2015 New Revision: 286221 URL: https://svnweb.freebsd.org/changeset/base/286221 Log: Set p_osrel to __FreeBSD_version on process startup. Certain system calls have quirks applied to make them work as if called on an older version of FreeBSD. As CloudABI executables don't have the FreeBSD OS release number in the ELF header, this value is set to zero, making the system calls fall back to typically historic, non-standard behaviour. Reviewed by: kib Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 07:28:23 2015 (r286220) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 07:29:57 2015 (r286221) @@ -73,10 +73,20 @@ cloudabi64_fixup(register_t **stack_base { char canarybuf[64]; Elf64_Auxargs *args; + struct thread *td; void *argdata, *canary; size_t argdatalen; int error; + /* + * CloudABI executables do not store the FreeBSD OS release + * number in their header. Set the OS release number to the + * latest version of FreeBSD, so that system calls behave as if + * called natively. + */ + td = curthread; + td->td_proc->p_osrel = __FreeBSD_version; + /* Store canary for stack smashing protection. */ argdata = *stack_base; arc4rand(canarybuf, sizeof(canarybuf), 0); @@ -108,7 +118,7 @@ cloudabi64_fixup(register_t **stack_base VAL(CLOUDABI_AT_PAGESZ, args->pagesz), PTR(CLOUDABI_AT_PHDR, args->phdr), VAL(CLOUDABI_AT_PHNUM, args->phnum), - VAL(CLOUDABI_AT_TID, curthread->td_tid), + VAL(CLOUDABI_AT_TID, td->td_tid), #undef VAL #undef PTR { .a_type = CLOUDABI_AT_NULL }, From owner-svn-src-head@freebsd.org Mon Aug 3 09:34:11 2015 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 054E09B1547; Mon, 3 Aug 2015 09:34:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E7978FE1; Mon, 3 Aug 2015 09:34:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t739YA9l026669; Mon, 3 Aug 2015 09:34:10 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t739YAkT026668; Mon, 3 Aug 2015 09:34:10 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201508030934.t739YAkT026668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 3 Aug 2015 09:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286223 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 09:34:11 -0000 Author: smh Date: Mon Aug 3 09:34:09 2015 New Revision: 286223 URL: https://svnweb.freebsd.org/changeset/base/286223 Log: Fix KSTACK_PAGES check in ZFS module The check introduced by r285946 failed to add the dependency on opt_kstack_pages.h which meant the default value for the platform instead of the customised options KSTACK_PAGES=X was being tested. Also wrap in #ifdef __FreeBSD__ for portability. MFC after: 3 days Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 08:04:31 2015 (r286222) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 09:34:09 2015 (r286223) @@ -132,6 +132,9 @@ * distinguish between the operation failing, and * deserialization failing. */ +#ifdef __FreeBSD__ +#include "opt_kstack_pages.h" +#endif #include #include @@ -6491,18 +6494,22 @@ static void zfs_shutdown(void *, int); static eventhandler_tag zfs_shutdown_event_tag; +#ifdef __FreeBSD__ #define ZFS_MIN_KSTACK_PAGES 4 +#endif int zfs__init(void) { +#ifdef __FreeBSD__ #if KSTACK_PAGES < ZFS_MIN_KSTACK_PAGES printf("ZFS NOTICE: KSTACK_PAGES is %d which could result in stack " "overflow panic!\nPlease consider adding " "'options KSTACK_PAGES=%d' to your kernel config\n", KSTACK_PAGES, ZFS_MIN_KSTACK_PAGES); #endif +#endif zfs_root_token = root_mount_hold("ZFS"); mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-head@freebsd.org Mon Aug 3 09:47:39 2015 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 734C59B1A26; Mon, 3 Aug 2015 09:47:39 +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 315081979; Mon, 3 Aug 2015 09:47:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMCLC-0002tQ-7S; Mon, 03 Aug 2015 12:47:30 +0300 Date: Mon, 3 Aug 2015 12:47:30 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803094730.GA24698@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508030934.t739YAkT026668@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 09:47:39 -0000 On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > Author: smh > Date: Mon Aug 3 09:34:09 2015 > New Revision: 286223 > URL: https://svnweb.freebsd.org/changeset/base/286223 > > Log: > Fix KSTACK_PAGES check in ZFS module > > The check introduced by r285946 failed to add the dependency on > opt_kstack_pages.h which meant the default value for the platform instead > of the customised options KSTACK_PAGES=X was being tested. > > Also wrap in #ifdef __FreeBSD__ for portability. /usr/src/sys/kern/kern_proc.c:int kstack_pages = KSTACK_PAGES; May be check variable kstack_pages is best way? Eliminate dependency on foreign opt_XXXX. > MFC after: 3 days > Sponsored by: Multiplay > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 08:04:31 2015 (r286222) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 09:34:09 2015 (r286223) > @@ -132,6 +132,9 @@ > * distinguish between the operation failing, and > * deserialization failing. > */ > +#ifdef __FreeBSD__ > +#include "opt_kstack_pages.h" > +#endif > > #include > #include > @@ -6491,18 +6494,22 @@ static void zfs_shutdown(void *, int); > > static eventhandler_tag zfs_shutdown_event_tag; > > +#ifdef __FreeBSD__ > #define ZFS_MIN_KSTACK_PAGES 4 > +#endif > > int > zfs__init(void) > { > > +#ifdef __FreeBSD__ > #if KSTACK_PAGES < ZFS_MIN_KSTACK_PAGES > printf("ZFS NOTICE: KSTACK_PAGES is %d which could result in stack " > "overflow panic!\nPlease consider adding " > "'options KSTACK_PAGES=%d' to your kernel config\n", KSTACK_PAGES, > ZFS_MIN_KSTACK_PAGES); > #endif > +#endif > zfs_root_token = root_mount_hold("ZFS"); > > mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Aug 3 10:37:28 2015 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 9B9039B184A for ; Mon, 3 Aug 2015 10:37:28 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) (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 3ABE41EB7 for ; Mon, 3 Aug 2015 10:37:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wibud3 with SMTP id ud3so130131654wib.1 for ; Mon, 03 Aug 2015 03:37:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=FLGnY8o7utKEFJqjWoqlKZfcM5ShQsWRMGshtaWoeXU=; b=QiAQf3rfo3iUVXGQ0HiZZI5fOiiY4ByThpu6R8KE2FxbsGRHGPvG9X/z+9wZIvDeP9 foyA+ieNy57s9hohO6IcIOpkWN2Lb3dEV/jnXLdR1SvJYTraarwgw3wZ9E4N36T+jEFO UJhbNkhab+dxvU9fhYfyXWcqI7FxizsXV2IJofrd1JM+unEvnbvWLmMX2EpPJhBunJKG o6VgOSjyhH/wVfhi4+u8NbN9a7rfTZSPIg6ragcDLiU8owhpINh0zhYnqjd6585juv1j 6zwkQ+5+sTOjqlbIsYsPisdmYLITwnh9IhtqmnCDIIJXwj+ITD65vmeuC0ENvN8K+KOL EqdA== X-Gm-Message-State: ALoCoQkj4I3ABr4xqZpZpcCuFKMAA9lT3gAaQBgmkZKdFLzLxgp3fONM6WjDrROIvgRGFutq22Yg X-Received: by 10.180.198.178 with SMTP id jd18mr32689901wic.14.1438597912194; Mon, 03 Aug 2015 03:31:52 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id pn6sm22161131wjb.36.2015.08.03.03.31.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 03:31:51 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <55BF431E.3020601@freebsd.org> Date: Mon, 3 Aug 2015 11:31:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150803094730.GA24698@zxy.spb.ru> 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.20 Precedence: list List-Id: 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, 03 Aug 2015 10:37:28 -0000 On 03/08/2015 10:47, Slawa Olhovchenkov wrote: > On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > >> Author: smh >> Date: Mon Aug 3 09:34:09 2015 >> New Revision: 286223 >> URL: https://svnweb.freebsd.org/changeset/base/286223 >> >> Log: >> Fix KSTACK_PAGES check in ZFS module >> >> The check introduced by r285946 failed to add the dependency on >> opt_kstack_pages.h which meant the default value for the platform instead >> of the customised options KSTACK_PAGES=X was being tested. >> >> Also wrap in #ifdef __FreeBSD__ for portability. > /usr/src/sys/kern/kern_proc.c:int kstack_pages = KSTACK_PAGES; > > May be check variable kstack_pages is best way? > Eliminate dependency on foreign opt_XXXX. > I did think of that but as other modules such as dtrace, which is also cddl code, already have this dependency I went with this. I'm easy though, if there's a concusses that kstack_pages or possibly curthread->td_kstack_pages, which would take into account the possibility of varied thread stack sizes, then I can make that change. What do others think? Regards Steve From owner-svn-src-head@freebsd.org Mon Aug 3 10:52:29 2015 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 154C89B1D41; Mon, 3 Aug 2015 10:52:29 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E036FBA0; Mon, 3 Aug 2015 10:52:28 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 61FED14C; Mon, 3 Aug 2015 03:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1438599147; bh=FSSJILy5mFdM1+MVxZbemXA7fL23qCI+Wb4d+H+AYI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jKwUdh02Vo7/aChfB5vwiWW17SgMaYYHCGHlIZuzPB2ROK59CanFZmTTTHDn4yvf/ Jje984T20FqGT7U/hQzpjvoNtKESJnhOKwkYOi713OZHPxEk2CfGkz8SZ+VdzB6uKZ UCEydkevDoX1s4ni417WmBlpwVYwF9iG/ju6ZGJw= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Steven Hartland , Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 03 Aug 2015 03:52:21 -0700 Message-ID: <2757800.HIDNx1G49O@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <55BF431E.3020601@freebsd.org> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1678551.kvVk1t1hKO"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 10:52:29 -0000 --nextPart1678551.kvVk1t1hKO Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Monday, August 03, 2015 11:31:58 AM Steven Hartland wrote: > On 03/08/2015 10:47, Slawa Olhovchenkov wrote: > > On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > >> Author: smh > >> Date: Mon Aug 3 09:34:09 2015 > >> New Revision: 286223 > >> URL: https://svnweb.freebsd.org/changeset/base/286223 > >>=20 > >> Log: > >> Fix KSTACK_PAGES check in ZFS module > >> =20 > >> The check introduced by r285946 failed to add the dependency on= > >> opt_kstack_pages.h which meant the default value for the platfo= rm > >> instead > >> of the customised options KSTACK_PAGES=3DX was being tested. > >> =20 > >> Also wrap in #ifdef __FreeBSD__ for portability. > >=20 > > /usr/src/sys/kern/kern_proc.c:int kstack_pages =3D KSTACK_PAGES; > >=20 > > May be check variable kstack_pages is best way? > > Eliminate dependency on foreign opt_XXXX. >=20 > I did think of that but as other modules such as dtrace, which is als= o > cddl code, already have this dependency I went with this. >=20 > I'm easy though, if there's a concusses that kstack_pages or possibly= > curthread->td_kstack_pages, which would take into account the > possibility of varied thread stack sizes, then I can make that change= . >=20 > What do others think? The whole thing has missing the point. Changing the default for the entire kernel just because the zfs compat=20= wrappers can't be bothered requesting a suitable value is.. unfortunate= ..=20 particularly when it is in freebsd-provided code, not upstream zfs code= . Fix the kproc_kthread_add() calls in do_thread_create() and zvol_geom_r= un()=20 instead. Enforce a lower bound there for zfs threads instead of making= the=20 entire rest of the kernel use more memory. eg: I'm thinking along these lines: Index: cddl/compat/opensolaris/sys/proc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =2D-- cddl/compat/opensolaris/sys/proc.h=09(revision 286224) +++ cddl/compat/opensolaris/sys/proc.h=09(working copy) @@ -77,6 +77,8 @@ =09ASSERT(state =3D=3D TS_RUN); =09ASSERT(pp =3D=3D &p0); =20 +=09if (stksize < 16384) +=09=09stksize =3D 16384;=09/* Enforce lower bound on ZFS threads */ =09error =3D kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, =09 stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); =09if (error =3D=3D 0) { Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16= k or=20 32k pages, from memory). Specifying an arbitrary number of pages in co= de=20 that's supposed to be portable isn't a good idea. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1678551.kvVk1t1hKO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVv0flAAoJEDXWlwnsgJ4ELMUIAK1tbIolkh8SIGfIo1A5Vw+n AzTThK+ccU3rm+PWWEjbJLd8vBMHmSNnbR/V3CgvKN58z6dpRUYQHl1jY0HFp8AH M71sG7cw6HPQ2mlJYzslYyGSPndtDRAjBVYAlXxWVwNAmXHuuq/pEliGX1nPKSIo A6ZBbb1++UrG3dq0qc1U51XZTqG0al36S3N4XRSWAvL+HZf57xCqPjlvd7sRh/lC tuPxTbAbPNb6z2xDpxf4pFwfj+Yj+yZ5vajRV3vvABIRHbPh+JRzfUtnxt6PaPRy B6Ujzt4EeNIlMbbPaRyf6Z3aoJt74K4VdocIJERDvXhGPvWcuIYNAiBfWRrtNuk= =LYLt -----END PGP SIGNATURE----- --nextPart1678551.kvVk1t1hKO-- From owner-svn-src-head@freebsd.org Mon Aug 3 11:03:42 2015 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 408569B20CE; Mon, 3 Aug 2015 11:03: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 F0AE211EB; Mon, 3 Aug 2015 11:03:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMDWs-0004VE-42; Mon, 03 Aug 2015 14:03:38 +0300 Date: Mon, 3 Aug 2015 14:03:38 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803110338.GB24698@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BF431E.3020601@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 11:03:42 -0000 On Mon, Aug 03, 2015 at 11:31:58AM +0100, Steven Hartland wrote: > On 03/08/2015 10:47, Slawa Olhovchenkov wrote: > > On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > > > >> Author: smh > >> Date: Mon Aug 3 09:34:09 2015 > >> New Revision: 286223 > >> URL: https://svnweb.freebsd.org/changeset/base/286223 > >> > >> Log: > >> Fix KSTACK_PAGES check in ZFS module > >> > >> The check introduced by r285946 failed to add the dependency on > >> opt_kstack_pages.h which meant the default value for the platform instead > >> of the customised options KSTACK_PAGES=X was being tested. > >> > >> Also wrap in #ifdef __FreeBSD__ for portability. > > /usr/src/sys/kern/kern_proc.c:int kstack_pages = KSTACK_PAGES; > > > > May be check variable kstack_pages is best way? > > Eliminate dependency on foreign opt_XXXX. > > > I did think of that but as other modules such as dtrace, which is also > cddl code, already have this dependency I went with this. > > I'm easy though, if there's a concusses that kstack_pages or possibly > curthread->td_kstack_pages, which would take into account the > possibility of varied thread stack sizes, then I can make that change. > > What do others think? ZFS currently don't have true direct dependency from KSTACK_PAGES (no code like this: /usr/src/sys/i386/i386/mp_machdep.c: bootSTK = (char *)bootstacks[cpu] + KSTACK_PAGES * PAGE_SIZE - 4; This is simple guard check. I.e. change KSTACK_PAGES don't want recompile zfs.ko. And less work to somebody converted KSTACK_PAGES to loader tunable. Most of this code already may be conveted to use kstack_pages w/o performance impact. Only 5 lines in 3 asm files need some more work. From owner-svn-src-head@freebsd.org Mon Aug 3 11:05:04 2015 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 DC5FA9B223B; Mon, 3 Aug 2015 11:05:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CCE4814E7; Mon, 3 Aug 2015 11:05:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73B54Mq062959; Mon, 3 Aug 2015 11:05:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73B535s062954; Mon, 3 Aug 2015 11:05:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508031105.t73B535s062954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2015 11:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286225 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 11:05:05 -0000 Author: andrew Date: Mon Aug 3 11:05:02 2015 New Revision: 286225 URL: https://svnweb.freebsd.org/changeset/base/286225 Log: Pass the pcb to store the vfp state in to vfp_save_state. This fixes a bug in savectx where it will be used to store the current state however will pass in a pcb when vfp_save_state expected a thread pointer. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/swtch.S head/sys/arm64/arm64/vfp.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/vfp.h Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Aug 3 10:10:49 2015 (r286224) +++ head/sys/arm64/arm64/machdep.c Mon Aug 3 11:05:02 2015 (r286225) @@ -180,7 +180,7 @@ fill_fpregs(struct thread *td, struct fp * If we have just been running VFP instructions we will * need to save the state to memcpy it below. */ - vfp_save_state(td); + vfp_save_state(td, pcb); memcpy(regs->fp_q, pcb->pcb_vfp, sizeof(regs->fp_q)); regs->fp_cr = pcb->pcb_fpcr; @@ -314,7 +314,7 @@ get_fpcontext(struct thread *td, mcontex * If we have just been running VFP instructions we will * need to save the state to memcpy it below. */ - vfp_save_state(td); + vfp_save_state(td, curpcb); memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_vfp, sizeof(mcp->mc_fpregs)); Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Mon Aug 3 10:10:49 2015 (r286224) +++ head/sys/arm64/arm64/swtch.S Mon Aug 3 11:05:02 2015 (r286225) @@ -131,6 +131,8 @@ ENTRY(cpu_switch) mov x19, x0 mov x20, x1 mov x21, x2 + /* Load the pcb address */ + mov x1, x4 bl vfp_save_state mov x2, x21 mov x1, x20 @@ -268,9 +270,11 @@ ENTRY(savectx) /* Store the VFP registers */ #ifdef VFP - mov x29, lr + mov x28, lr + mov x1, x0 /* move pcb to the correct register */ + mov x0, xzr /* td = NULL */ bl vfp_save_state - mov lr, x29 + mov lr, x28 #endif ret Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Mon Aug 3 10:10:49 2015 (r286224) +++ head/sys/arm64/arm64/vfp.c Mon Aug 3 11:05:02 2015 (r286225) @@ -82,12 +82,18 @@ vfp_discard(struct thread *td) } void -vfp_save_state(struct thread *td) +vfp_save_state(struct thread *td, struct pcb *pcb) { __int128_t *vfp_state; uint64_t fpcr, fpsr; uint32_t cpacr; + KASSERT(pcb != NULL, ("NULL vfp pcb")); + KASSERT(td == NULL || td->td_pcb == pcb, ("Invalid vfp pcb")); + + if (td == NULL) + td = curthread; + critical_enter(); /* * Only store the registers if the VFP is enabled, @@ -98,7 +104,7 @@ vfp_save_state(struct thread *td) KASSERT(PCPU_GET(fpcurthread) == td, ("Storing an invalid VFP state")); - vfp_state = td->td_pcb->pcb_vfp; + vfp_state = pcb->pcb_vfp; __asm __volatile( "mrs %0, fpcr \n" "mrs %1, fpsr \n" @@ -120,8 +126,8 @@ vfp_save_state(struct thread *td) "stp q30, q31, [%2, #16 * 30]\n" : "=&r"(fpcr), "=&r"(fpsr) : "r"(vfp_state)); - td->td_pcb->pcb_fpcr = fpcr; - td->td_pcb->pcb_fpsr = fpsr; + pcb->pcb_fpcr = fpcr; + pcb->pcb_fpsr = fpsr; dsb(ish); vfp_disable(); Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Mon Aug 3 10:10:49 2015 (r286224) +++ head/sys/arm64/arm64/vm_machdep.c Mon Aug 3 11:05:02 2015 (r286225) @@ -74,7 +74,7 @@ cpu_fork(struct thread *td1, struct proc td1->td_pcb->pcb_tpidr_el0 = READ_SPECIALREG(tpidr_el0); #ifdef VFP if ((td1->td_pcb->pcb_fpflags & PCB_FP_STARTED) != 0) - vfp_save_state(td1); + vfp_save_state(td1, td1->td_pcb); #endif } Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Mon Aug 3 10:10:49 2015 (r286224) +++ head/sys/arm64/include/vfp.h Mon Aug 3 11:05:02 2015 (r286225) @@ -38,7 +38,7 @@ void vfp_init(void); void vfp_discard(struct thread *); void vfp_restore_state(void); -void vfp_save_state(struct thread *); +void vfp_save_state(struct thread *, struct pcb *); #endif #endif From owner-svn-src-head@freebsd.org Mon Aug 3 11:19:49 2015 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 3EB789B2806; Mon, 3 Aug 2015 11:19:49 +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 BE2D51E7F; Mon, 3 Aug 2015 11:19:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t73BJhY6029920 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 3 Aug 2015 14:19:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t73BJhY6029920 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t73BJgDn029919; Mon, 3 Aug 2015 14:19:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Aug 2015 14:19:42 +0300 From: Konstantin Belousov To: Peter Wemm Cc: svn-src-all@freebsd.org, Steven Hartland , Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803111942.GB2072@kib.kiev.ua> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2757800.HIDNx1G49O@overcee.wemm.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 11:19:49 -0000 On Mon, Aug 03, 2015 at 03:52:21AM -0700, Peter Wemm wrote: > On Monday, August 03, 2015 11:31:58 AM Steven Hartland wrote: > > On 03/08/2015 10:47, Slawa Olhovchenkov wrote: > > > On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > > >> Author: smh > > >> Date: Mon Aug 3 09:34:09 2015 > > >> New Revision: 286223 > > >> URL: https://svnweb.freebsd.org/changeset/base/286223 > > >> > > >> Log: > > >> Fix KSTACK_PAGES check in ZFS module > > >> > > >> The check introduced by r285946 failed to add the dependency on > > >> opt_kstack_pages.h which meant the default value for the platform > > >> instead > > >> of the customised options KSTACK_PAGES=X was being tested. > > >> > > >> Also wrap in #ifdef __FreeBSD__ for portability. > > > > > > /usr/src/sys/kern/kern_proc.c:int kstack_pages = KSTACK_PAGES; > > > > > > May be check variable kstack_pages is best way? > > > Eliminate dependency on foreign opt_XXXX. > > > > I did think of that but as other modules such as dtrace, which is also > > cddl code, already have this dependency I went with this. > > > > I'm easy though, if there's a concusses that kstack_pages or possibly > > curthread->td_kstack_pages, which would take into account the > > possibility of varied thread stack sizes, then I can make that change. > > > > What do others think? > > The whole thing has missing the point. > > Changing the default for the entire kernel just because the zfs compat > wrappers can't be bothered requesting a suitable value is.. unfortunate.. > particularly when it is in freebsd-provided code, not upstream zfs code. > > Fix the kproc_kthread_add() calls in do_thread_create() and zvol_geom_run() > instead. Enforce a lower bound there for zfs threads instead of making the > entire rest of the kernel use more memory. > > eg: I'm thinking along these lines: > Index: cddl/compat/opensolaris/sys/proc.h > ==================================================== > --- cddl/compat/opensolaris/sys/proc.h (revision 286224) > +++ cddl/compat/opensolaris/sys/proc.h (working copy) > @@ -77,6 +77,8 @@ > ASSERT(state == TS_RUN); > ASSERT(pp == &p0); > > + if (stksize < 16384) > + stksize = 16384; /* Enforce lower bound on ZFS threads */ > error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, > stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); > if (error == 0) { > > > Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16k or > 32k pages, from memory). Specifying an arbitrary number of pages in code > that's supposed to be portable isn't a good idea. This would not help. Issue is the size of the thread0 stack, which overflows in this case. I looked at the possibility of making default kernel stack size configurable by a loader tunable, and the issue is that thread0 gets its stack set up too early (locore for i386, hammer_time() for amd64). I.e., it is possible to make the setting effective for all threads after thread0, but not for the one which causes the issue. I do not want to modify ABI between loader and kernel to pass the parameter. From owner-svn-src-head@freebsd.org Mon Aug 3 11:32:19 2015 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 BFFD79B2BA7; Mon, 3 Aug 2015 11:32:19 +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 77DF7899; Mon, 3 Aug 2015 11:32:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMDya-00051n-38; Mon, 03 Aug 2015 14:32:16 +0300 Date: Mon, 3 Aug 2015 14:32:16 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: Peter Wemm , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803113215.GA8792@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150803111942.GB2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 11:32:19 -0000 On Mon, Aug 03, 2015 at 02:19:42PM +0300, Konstantin Belousov wrote: > > The whole thing has missing the point. > > > > Changing the default for the entire kernel just because the zfs compat > > wrappers can't be bothered requesting a suitable value is.. unfortunate.. > > particularly when it is in freebsd-provided code, not upstream zfs code. > > > > Fix the kproc_kthread_add() calls in do_thread_create() and zvol_geom_run() > > instead. Enforce a lower bound there for zfs threads instead of making the > > entire rest of the kernel use more memory. > > > > eg: I'm thinking along these lines: > > Index: cddl/compat/opensolaris/sys/proc.h > > ==================================================== > > --- cddl/compat/opensolaris/sys/proc.h (revision 286224) > > +++ cddl/compat/opensolaris/sys/proc.h (working copy) > > @@ -77,6 +77,8 @@ > > ASSERT(state == TS_RUN); > > ASSERT(pp == &p0); > > > > + if (stksize < 16384) > > + stksize = 16384; /* Enforce lower bound on ZFS threads */ > > error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, > > stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); > > if (error == 0) { > > > > > > Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16k or > > 32k pages, from memory). Specifying an arbitrary number of pages in code > > that's supposed to be portable isn't a good idea. > > This would not help. Issue is the size of the thread0 stack, which > overflows in this case. > > I looked at the possibility of making default kernel stack size > configurable by a loader tunable, and the issue is that thread0 gets its > stack set up too early (locore for i386, hammer_time() for amd64). I.e., > it is possible to make the setting effective for all threads after thread0, > but not for the one which causes the issue. > > I do not want to modify ABI between loader and kernel to pass the parameter. Parsing kenv by asm too complex? From owner-svn-src-head@freebsd.org Mon Aug 3 11:50:15 2015 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 576749B2DD3 for ; Mon, 3 Aug 2015 11:50:15 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) (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 E8D73E70 for ; Mon, 3 Aug 2015 11:50:14 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wicgj17 with SMTP id gj17so101573483wic.1 for ; Mon, 03 Aug 2015 04:50:12 -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-type :content-transfer-encoding; bh=sRCs9aRhn6wpNk1fXwcnq2Z2k5kclH72G6PBDJr4RqM=; b=Uc+1UAHd1pQBxnH/M/JY1Q4p8BIejiqhsa30ONDfQcRQIxVfqIjS8v8znns18+4Q1i VV3Q5E18rwvrNysxGoEgyHXS1G7sK86OfME63lsaLGfFokkushQiIro+MFwl+3ZeP/y0 3prf5H+fHeN1kBOaNDIIE+d+80hep5/IJalerpz8LtqVbPlmqECHc/pxAGNeO2/8C+bX vVKzsLctZuaqex/YzqAEJ0yLmbUieBU2lwCYM1bXD0Cjz234zD2rebOk52eeZwdqF5ss NDfkHnP9LoIDLW39KL7hXmGulW7ZUPS+e/UQgdh1IcMFsVXL0MKyCEjFWOM/P0n2iggh HB7Q== X-Gm-Message-State: ALoCoQkvpQvbgJ+fcdtgZG9Lz4CwNf8kIJiUs/fTy1iyr/rdMme0zj2ZA8YlsmEH/yVg2SRUuj0U X-Received: by 10.194.112.3 with SMTP id im3mr32955778wjb.54.1438602612681; Mon, 03 Aug 2015 04:50:12 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id u7sm13222417wif.3.2015.08.03.04.50.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 04:50:11 -0700 (PDT) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Konstantin Belousov , Peter Wemm References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> Cc: svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org From: Steven Hartland Message-ID: <55BF557B.60009@multiplay.co.uk> Date: Mon, 3 Aug 2015 12:50:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150803111942.GB2072@kib.kiev.ua> 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.20 Precedence: list List-Id: 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, 03 Aug 2015 11:50:15 -0000 On 03/08/2015 12:19, Konstantin Belousov wrote: > On Mon, Aug 03, 2015 at 03:52:21AM -0700, Peter Wemm wrote: >> On Monday, August 03, 2015 11:31:58 AM Steven Hartland wrote: >>> On 03/08/2015 10:47, Slawa Olhovchenkov wrote: >>>> On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: >>>>> Author: smh >>>>> Date: Mon Aug 3 09:34:09 2015 >>>>> New Revision: 286223 >>>>> URL: https://svnweb.freebsd.org/changeset/base/286223 >>>>> >>>>> Log: >>>>> Fix KSTACK_PAGES check in ZFS module >>>>> >>>>> The check introduced by r285946 failed to add the dependency on >>>>> opt_kstack_pages.h which meant the default value for the platform >>>>> instead >>>>> of the customised options KSTACK_PAGES=X was being tested. >>>>> >>>>> Also wrap in #ifdef __FreeBSD__ for portability. >>>> /usr/src/sys/kern/kern_proc.c:int kstack_pages = KSTACK_PAGES; >>>> >>>> May be check variable kstack_pages is best way? >>>> Eliminate dependency on foreign opt_XXXX. >>> I did think of that but as other modules such as dtrace, which is also >>> cddl code, already have this dependency I went with this. >>> >>> I'm easy though, if there's a concusses that kstack_pages or possibly >>> curthread->td_kstack_pages, which would take into account the >>> possibility of varied thread stack sizes, then I can make that change. >>> >>> What do others think? >> The whole thing has missing the point. >> >> Changing the default for the entire kernel just because the zfs compat >> wrappers can't be bothered requesting a suitable value is.. unfortunate.. >> particularly when it is in freebsd-provided code, not upstream zfs code. >> >> Fix the kproc_kthread_add() calls in do_thread_create() and zvol_geom_run() >> instead. Enforce a lower bound there for zfs threads instead of making the >> entire rest of the kernel use more memory. >> >> eg: I'm thinking along these lines: >> Index: cddl/compat/opensolaris/sys/proc.h >> ==================================================== >> --- cddl/compat/opensolaris/sys/proc.h (revision 286224) >> +++ cddl/compat/opensolaris/sys/proc.h (working copy) >> @@ -77,6 +77,8 @@ >> ASSERT(state == TS_RUN); >> ASSERT(pp == &p0); >> >> + if (stksize < 16384) >> + stksize = 16384; /* Enforce lower bound on ZFS threads */ >> error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, >> stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); >> if (error == 0) { >> >> >> Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16k or >> 32k pages, from memory). Specifying an arbitrary number of pages in code >> that's supposed to be portable isn't a good idea. > This would not help. Issue is the size of the thread0 stack, which > overflows in this case. > > I looked at the possibility of making default kernel stack size > configurable by a loader tunable, and the issue is that thread0 gets its > stack set up too early (locore for i386, hammer_time() for amd64). I.e., > it is possible to make the setting effective for all threads after thread0, > but not for the one which causes the issue. > > I do not want to modify ABI between loader and kernel to pass the parameter. I've created a review for the current proposed change to look at the kernel var kstack_pages vs the compile time define KSTACK_PAGES. For this change I don't want to get into fixing the thread0 stack size, which can be done later, just to provide a reasonable warning to the user that smaller values could cause a panic. @slw I've added peter and kib as reviewers if you phabricator account then feel free to add yourself. Regards Steve From owner-svn-src-head@freebsd.org Mon Aug 3 11:57:12 2015 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 8F1CC9B2F78; Mon, 3 Aug 2015 11:57:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 61E411172; Mon, 3 Aug 2015 11:57:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73BvC5j082997; Mon, 3 Aug 2015 11:57:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73BvCg2082996; Mon, 3 Aug 2015 11:57:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508031157.t73BvCg2082996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 11:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286226 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 11:57:12 -0000 Author: trasz Date: Mon Aug 3 11:57:11 2015 New Revision: 286226 URL: https://svnweb.freebsd.org/changeset/base/286226 Log: Rework the way iSCSI initiator handles system shutdown. This fixes hangs on shutdown with LUNs with mounted filesystems over a disconnected iSCSI session. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3052 Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Mon Aug 3 11:05:02 2015 (r286225) +++ head/sys/dev/iscsi/iscsi.c Mon Aug 3 11:57:11 2015 (r286226) @@ -2322,11 +2322,23 @@ iscsi_shutdown(struct iscsi_softc *sc) { struct iscsi_session *is; - ISCSI_DEBUG("removing all sessions due to shutdown"); + /* + * Trying to reconnect during system shutdown would lead to hang. + */ + fail_on_disconnection = 1; + /* + * If we have any sessions waiting for reconnection, request + * maintenance thread to fail them immediately instead of waiting + * for reconnect timeout. + */ sx_slock(&sc->sc_lock); - TAILQ_FOREACH(is, &sc->sc_sessions, is_next) - iscsi_session_terminate(is); + TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { + ISCSI_SESSION_LOCK(is); + if (is->is_waiting_for_iscsid) + iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); + } sx_sunlock(&sc->sc_lock); } @@ -2352,12 +2364,7 @@ iscsi_load(void) } sc->sc_cdev->si_drv1 = sc; - /* - * Note that this needs to get run before dashutdown(). Otherwise, - * when rebooting with iSCSI session with outstanding requests, - * but disconnected, dashutdown() will hang on cam_periph_runccb(). - */ - sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_post_sync, + sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); return (0); @@ -2375,7 +2382,7 @@ iscsi_unload(void) } if (sc->sc_shutdown_eh != NULL) - EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->sc_shutdown_eh); + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_eh); sx_slock(&sc->sc_lock); TAILQ_FOREACH_SAFE(is, &sc->sc_sessions, is_next, tmp) From owner-svn-src-head@freebsd.org Mon Aug 3 12:02:10 2015 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 C8DC09B1690; Mon, 3 Aug 2015 12:02:10 +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 80BCC1A68; Mon, 3 Aug 2015 12:02:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMERS-0005dE-A7; Mon, 03 Aug 2015 15:02:06 +0300 Date: Mon, 3 Aug 2015 15:02:06 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: Konstantin Belousov , Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803120206.GB8792@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BF557B.60009@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 12:02:10 -0000 On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: > > I looked at the possibility of making default kernel stack size > > configurable by a loader tunable, and the issue is that thread0 gets its > > stack set up too early (locore for i386, hammer_time() for amd64). I.e., > > it is possible to make the setting effective for all threads after thread0, > > but not for the one which causes the issue. > > > > I do not want to modify ABI between loader and kernel to pass the parameter. > I've created a review for the current proposed change to look at the > kernel var kstack_pages vs > the compile time define KSTACK_PAGES. > > For this change I don't want to get into fixing the thread0 stack size, > which can be done later, just > to provide a reasonable warning to the user that smaller values could > cause a panic. > > @slw I've added peter and kib as reviewers if you phabricator account > then feel free to add yourself. I am currently don't have phabricator account, thanks. From owner-svn-src-head@freebsd.org Mon Aug 3 12:04:11 2015 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 B6A069B178F; Mon, 3 Aug 2015 12:04:11 +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 5BE361C1F; Mon, 3 Aug 2015 12:04:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t73C41UA040458 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 3 Aug 2015 15:04:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t73C41UA040458 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t73C3x4Z040457; Mon, 3 Aug 2015 15:03:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Aug 2015 15:03:59 +0300 From: Konstantin Belousov To: Steven Hartland Cc: Peter Wemm , svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803120359.GC2072@kib.kiev.ua> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BF557B.60009@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 12:04:11 -0000 On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: > For this change I don't want to get into fixing the thread0 stack size, > which can be done later, just > to provide a reasonable warning to the user that smaller values could > cause a panic. Hmm, is it limited to the thread0 only ? I.e., would only increasing the initial thread stack size be enough to boot the kernel ? The zfs threads do request larger stack size, I know this. Can somebody test the following patch in the i386 configuration which does not boot ? diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c index 7a00740..6a00d23 100644 --- a/sys/i386/i386/genassym.c +++ b/sys/i386/i386/genassym.c @@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall)); ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); /* ASSYM(UPAGES, UPAGES);*/ ASSYM(KSTACK_PAGES, KSTACK_PAGES); +ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); ASSYM(NPDEPG, NPDEPG); diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 5bf7944..4d8e22f 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -731,7 +731,7 @@ no_kernend: movl %esi,R(IdlePTD) /* Allocate KSTACK */ - ALLOCPAGES(KSTACK_PAGES) + ALLOCPAGES(TD0_KSTACK_PAGES) movl %esi,R(p0kpa) addl $KERNBASE, %esi movl %esi, R(proc0kstack) @@ -800,7 +800,7 @@ no_kernend: /* Map proc0's KSTACK in the physical way ... */ movl R(p0kpa), %eax - movl $(KSTACK_PAGES), %ecx + movl $(TD0_KSTACK_PAGES), %ecx fillkptphys($PG_RW) /* Map ISA hole */ diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 2be5dbc..76790f0 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2445,7 +2445,7 @@ init386(first) #endif thread0.td_kstack = proc0kstack; - thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_kstack_pages = TD0_KSTACK_PAGES; /* * This may be done better later if it gets more high level diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index b3fd85f..bc79c20 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -114,6 +114,11 @@ #define KSTACK_PAGES 2 /* Includes pcb! */ #endif #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ +#if KSTACK_PAGES < 3 +#define TD0_KSTACK_PAGES 4 +#else +#define TD0_KSTACK_PAGES KSTACK_PAGES +#endif /* * Ceiling on amount of swblock kva space, can be changed via From owner-svn-src-head@freebsd.org Mon Aug 3 12:13:58 2015 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 847119B1A7A; Mon, 3 Aug 2015 12:13:58 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 742913B2; Mon, 3 Aug 2015 12:13:58 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73CDw9F090939; Mon, 3 Aug 2015 12:13:58 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73CDtrg090930; Mon, 3 Aug 2015 12:13:55 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508031213.t73CDtrg090930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 3 Aug 2015 12:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286227 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 12:13:58 -0000 Author: jch Date: Mon Aug 3 12:13:54 2015 New Revision: 286227 URL: https://svnweb.freebsd.org/changeset/base/286227 Log: Decompose TCP INP_INFO lock to increase short-lived TCP connections scalability: - The existing TCP INP_INFO lock continues to protect the global inpcb list stability during full list traversal (e.g. tcp_pcblist()). - A new INP_LIST lock protects inpcb list actual modifications (inp allocation and free) and inpcb global counters. It allows to use TCP INP_INFO_RLOCK lock in critical paths (e.g. tcp_input()) and INP_INFO_WLOCK only in occasional operations that walk all connections. PR: 183659 Differential Revision: https://reviews.freebsd.org/D2599 Reviewed by: jhb, adrian Tested by: adrian, nitroboost-gmail.com Sponsored by: Verisign, Inc. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/toecore.c head/sys/netinet6/in6_pcb.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Aug 3 12:13:54 2015 (r286227) @@ -639,7 +639,7 @@ t3_send_fin(struct toedev *tod, struct t unsigned int tid = toep->tp_tid; #endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); CTR4(KTR_CXGB, "%s: tid %d, toep %p, flags %x", __func__, tid, toep, @@ -925,12 +925,12 @@ do_act_open_rpl(struct sge_qset *qs, str rc = act_open_rpl_status_to_errno(s); if (rc != EAGAIN) - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); toe_connect_failed(tod, inp, rc); toepcb_release(toep); /* unlocks inp */ if (rc != EAGAIN) - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); @@ -1061,7 +1061,7 @@ send_reset(struct toepcb *toep) struct adapter *sc = tod->tod_softc; struct mbuf *m; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); CTR4(KTR_CXGB, "%s: tid %d, toep %p (%x)", __func__, tid, toep, @@ -1172,12 +1172,12 @@ do_rx_data(struct sge_qset *qs, struct r SOCKBUF_UNLOCK(so_rcv); INP_WUNLOCK(inp); - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); @@ -1222,7 +1222,7 @@ do_peer_close(struct sge_qset *qs, struc struct tcpcb *tp; struct socket *so; - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1250,7 +1250,7 @@ do_peer_close(struct sge_qset *qs, struc case TCPS_FIN_WAIT_2: tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); INP_WLOCK(inp); toepcb_release(toep); /* no more CPLs expected */ @@ -1264,7 +1264,7 @@ do_peer_close(struct sge_qset *qs, struc done: INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); @@ -1285,7 +1285,7 @@ do_close_con_rpl(struct sge_qset *qs, st struct tcpcb *tp; struct socket *so; - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1303,7 +1303,7 @@ do_close_con_rpl(struct sge_qset *qs, st tcp_twstart(tp); release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); INP_WLOCK(inp); toepcb_release(toep); /* no more CPLs expected */ @@ -1328,7 +1328,7 @@ release: done: INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); @@ -1489,7 +1489,7 @@ do_abort_req(struct sge_qset *qs, struct return (do_abort_req_synqe(qs, r, m)); inp = toep->tp_inp; - INP_INFO_WLOCK(&V_tcbinfo); /* for tcp_close */ + INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1503,7 +1503,7 @@ do_abort_req(struct sge_qset *qs, struct toep->tp_flags |= TP_ABORT_REQ_RCVD; toep->tp_flags |= TP_ABORT_SHUTDOWN; INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); } @@ -1523,7 +1523,7 @@ do_abort_req(struct sge_qset *qs, struct INP_WLOCK(inp); /* re-acquire */ toepcb_release(toep); /* no more CPLs expected */ } - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); send_abort_rpl(tod, tid, qset); m_freem(m); Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Mon Aug 3 12:13:54 2015 (r286227) @@ -541,11 +541,11 @@ do_pass_accept_req(struct sge_qset *qs, REJECT_PASS_ACCEPT(); /* no l2te, or ifp mismatch */ } - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); /* Don't offload if the 4-tuple is already in use */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); REJECT_PASS_ACCEPT(); } @@ -558,7 +558,7 @@ do_pass_accept_req(struct sge_qset *qs, * resources tied to this listen context. */ INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); REJECT_PASS_ACCEPT(); } so = inp->inp_socket; @@ -686,7 +686,7 @@ do_pass_establish(struct sge_qset *qs, s struct toepcb *toep; struct socket *so; struct listen_ctx *lctx = synqe->lctx; - struct inpcb *inp = lctx->inp; + struct inpcb *inp = lctx->inp, *new_inp; struct tcpopt to; struct tcphdr th; struct in_conninfo inc; @@ -700,7 +700,7 @@ do_pass_establish(struct sge_qset *qs, s KASSERT(qs->idx == synqe->qset, ("%s qset mismatch %d %d", __func__, qs->idx, synqe->qset)); - INP_INFO_WLOCK(&V_tcbinfo); /* for syncache_expand */ + INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); if (__predict_false(inp->inp_flags & INP_DROPPED)) { @@ -714,7 +714,7 @@ do_pass_establish(struct sge_qset *qs, s ("%s: listen socket dropped but tid %u not aborted.", __func__, tid)); INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); } @@ -730,7 +730,7 @@ do_pass_establish(struct sge_qset *qs, s reset: t3_send_reset_synqe(tod, synqe); INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); m_freem(m); return (0); } @@ -748,21 +748,23 @@ reset: goto reset; } - if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { - struct inpcb *new_inp = sotoinpcb(so); + /* New connection inpcb is already locked by syncache_expand(). */ + new_inp = sotoinpcb(so); + INP_WLOCK_ASSERT(new_inp); - INP_WLOCK(new_inp); + if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); t3_offload_socket(tod, synqe, so); - INP_WUNLOCK(new_inp); } + INP_WUNLOCK(new_inp); + /* Remove the synq entry and release its reference on the lctx */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(td, lctx); if (inp) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); release_synqe(synqe); m_freem(m); @@ -1128,7 +1130,7 @@ t3_offload_socket(struct toedev *tod, vo struct cpl_pass_establish *cpl = synqe->cpl; struct toepcb *toep = synqe->toep; - INP_INFO_LOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); offload_socket(so, toep); Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/dev/cxgbe/tom/t4_connect.c Mon Aug 3 12:13:54 2015 (r286227) @@ -189,12 +189,12 @@ act_open_failure_cleanup(struct adapter toep->tid = -1; if (status != EAGAIN) - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); toe_connect_failed(tod, inp, status); final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); } static int Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 3 12:13:54 2015 (r286227) @@ -1085,7 +1085,7 @@ do_peer_close(struct sge_iq *iq, const s KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1127,7 +1127,7 @@ do_peer_close(struct sge_iq *iq, const s case TCPS_FIN_WAIT_2: tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); INP_WLOCK(inp); final_cpl_received(toep); @@ -1139,7 +1139,7 @@ do_peer_close(struct sge_iq *iq, const s } done: INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (0); } @@ -1166,7 +1166,7 @@ do_close_con_rpl(struct sge_iq *iq, cons KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1184,7 +1184,7 @@ do_close_con_rpl(struct sge_iq *iq, cons tcp_twstart(tp); release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); INP_WLOCK(inp); final_cpl_received(toep); /* no more CPLs expected */ @@ -1208,7 +1208,7 @@ release: } done: INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (0); } @@ -1367,7 +1367,7 @@ do_abort_req(struct sge_iq *iq, const st } inp = toep->inp; - INP_INFO_WLOCK(&V_tcbinfo); /* for tcp_close */ + INP_INFO_RLOCK(&V_tcbinfo); /* for tcp_close */ INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1401,7 +1401,7 @@ do_abort_req(struct sge_iq *iq, const st final_cpl_received(toep); done: - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); } @@ -1515,12 +1515,12 @@ do_rx_data(struct sge_iq *iq, const stru SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); - INP_INFO_WLOCK(&V_tcbinfo); + INP_INFO_RLOCK(&V_tcbinfo); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/dev/cxgbe/tom/t4_listen.c Mon Aug 3 12:13:54 2015 (r286227) @@ -930,7 +930,7 @@ t4_offload_socket(struct toedev *tod, vo struct cpl_pass_establish *cpl = mtod(synqe->syn, void *); struct toepcb *toep = *(struct toepcb **)(cpl + 1); - INP_INFO_LOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); @@ -1259,15 +1259,15 @@ do_pass_accept_req(struct sge_iq *iq, co REJECT_PASS_ACCEPT(); rpl = wrtod(wr); - INP_INFO_WLOCK(&V_tcbinfo); /* for 4-tuple check */ + INP_INFO_RLOCK(&V_tcbinfo); /* for 4-tuple check */ /* Don't offload if the 4-tuple is already in use */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); } - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); inp = lctx->inp; /* listening socket, not owned by TOE */ INP_WLOCK(inp); @@ -1441,7 +1441,7 @@ do_pass_establish(struct sge_iq *iq, con unsigned int tid = GET_TID(cpl); struct synq_entry *synqe = lookup_tid(sc, tid); struct listen_ctx *lctx = synqe->lctx; - struct inpcb *inp = lctx->inp; + struct inpcb *inp = lctx->inp, *new_inp; struct socket *so; struct tcphdr th; struct tcpopt to; @@ -1459,7 +1459,7 @@ do_pass_establish(struct sge_iq *iq, con KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); - INP_INFO_WLOCK(&V_tcbinfo); /* for syncache_expand */ + INP_INFO_RLOCK(&V_tcbinfo); /* for syncache_expand */ INP_WLOCK(inp); CTR6(KTR_CXGBE, @@ -1475,7 +1475,7 @@ do_pass_establish(struct sge_iq *iq, con } INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (0); } @@ -1500,7 +1500,7 @@ reset: */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (0); } toep->tid = tid; @@ -1534,6 +1534,10 @@ reset: goto reset; } + /* New connection inpcb is already locked by syncache_expand(). */ + new_inp = sotoinpcb(so); + INP_WLOCK_ASSERT(new_inp); + /* * This is for the unlikely case where the syncache entry that we added * has been evicted from the syncache, but the syncache_expand above @@ -1544,20 +1548,18 @@ reset: * this somewhat defeats the purpose of having a tod_offload_socket :-( */ if (__predict_false(!(synqe->flags & TPF_SYNQE_EXPANDED))) { - struct inpcb *new_inp = sotoinpcb(so); - - INP_WLOCK(new_inp); tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); t4_offload_socket(TOEDEV(ifp), synqe, so); - INP_WUNLOCK(new_inp); } + INP_WUNLOCK(new_inp); + /* Done with the synqe */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); release_synqe(synqe); return (0); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/netinet/in_pcb.c Mon Aug 3 12:13:54 2015 (r286227) @@ -224,6 +224,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinf INP_INFO_LOCK_INIT(pcbinfo, name); INP_HASH_LOCK_INIT(pcbinfo, "pcbinfohash"); /* XXXRW: argument? */ + INP_LIST_LOCK_INIT(pcbinfo, "pcbinfolist"); #ifdef VIMAGE pcbinfo->ipi_vnet = curvnet; #endif @@ -262,6 +263,7 @@ in_pcbinfo_destroy(struct inpcbinfo *pcb in_pcbgroup_destroy(pcbinfo); #endif uma_zdestroy(pcbinfo->ipi_zone); + INP_LIST_LOCK_DESTROY(pcbinfo); INP_HASH_LOCK_DESTROY(pcbinfo); INP_INFO_LOCK_DESTROY(pcbinfo); } @@ -276,7 +278,14 @@ in_pcballoc(struct socket *so, struct in struct inpcb *inp; int error; - INP_INFO_WLOCK_ASSERT(pcbinfo); +#ifdef INVARIANTS + if (pcbinfo == &V_tcbinfo) { + INP_INFO_RLOCK_ASSERT(pcbinfo); + } else { + INP_INFO_WLOCK_ASSERT(pcbinfo); + } +#endif + error = 0; inp = uma_zalloc(pcbinfo->ipi_zone, M_NOWAIT); if (inp == NULL) @@ -308,6 +317,8 @@ in_pcballoc(struct socket *so, struct in inp->inp_flags |= IN6P_IPV6_V6ONLY; } #endif + INP_WLOCK(inp); + INP_LIST_WLOCK(pcbinfo); LIST_INSERT_HEAD(pcbinfo->ipi_listhead, inp, inp_list); pcbinfo->ipi_count++; so->so_pcb = (caddr_t)inp; @@ -315,9 +326,9 @@ in_pcballoc(struct socket *so, struct in if (V_ip6_auto_flowlabel) inp->inp_flags |= IN6P_AUTOFLOWLABEL; #endif - INP_WLOCK(inp); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; refcount_init(&inp->inp_refcount, 1); /* Reference from inpcbinfo */ + INP_LIST_WUNLOCK(pcbinfo); #if defined(IPSEC) || defined(MAC) out: if (error != 0) { @@ -1246,7 +1257,13 @@ in_pcbfree(struct inpcb *inp) KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - INP_INFO_WLOCK_ASSERT(pcbinfo); +#ifdef INVARIANTS + if (pcbinfo == &V_tcbinfo) { + INP_INFO_RLOCK_ASSERT(pcbinfo); + } else { + INP_INFO_WLOCK_ASSERT(pcbinfo); + } +#endif INP_WLOCK_ASSERT(inp); /* XXXRW: Do as much as possible here. */ @@ -1254,8 +1271,10 @@ in_pcbfree(struct inpcb *inp) if (inp->inp_sp != NULL) ipsec_delete_pcbpolicy(inp); #endif + INP_LIST_WLOCK(pcbinfo); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; in_pcbremlists(inp); + INP_LIST_WUNLOCK(pcbinfo); #ifdef INET6 if (inp->inp_vflag & INP_IPV6PROTO) { ip6_freepcbopts(inp->in6p_outputopts); @@ -1412,7 +1431,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo struct ip_moptions *imo; int i, gap; - INP_INFO_RLOCK(pcbinfo); + INP_INFO_WLOCK(pcbinfo); LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) { INP_WLOCK(inp); imo = inp->inp_moptions; @@ -1442,7 +1461,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo } INP_WUNLOCK(inp); } - INP_INFO_RUNLOCK(pcbinfo); + INP_INFO_WUNLOCK(pcbinfo); } /* @@ -2163,8 +2182,16 @@ in_pcbremlists(struct inpcb *inp) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; - INP_INFO_WLOCK_ASSERT(pcbinfo); +#ifdef INVARIANTS + if (pcbinfo == &V_tcbinfo) { + INP_INFO_RLOCK_ASSERT(pcbinfo); + } else { + INP_INFO_WLOCK_ASSERT(pcbinfo); + } +#endif + INP_WLOCK_ASSERT(inp); + INP_LIST_WLOCK_ASSERT(pcbinfo); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; if (inp->inp_flags & INP_INHASHLIST) { @@ -2309,13 +2336,13 @@ inp_apply_all(void (*func)(struct inpcb { struct inpcb *inp; - INP_INFO_RLOCK(&V_tcbinfo); + INP_INFO_WLOCK(&V_tcbinfo); LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { INP_WLOCK(inp); func(inp, arg); INP_WUNLOCK(inp); } - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_INFO_WUNLOCK(&V_tcbinfo); } struct socket * Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/netinet/in_pcb.h Mon Aug 3 12:13:54 2015 (r286227) @@ -130,23 +130,35 @@ struct in_conninfo { struct icmp6_filter; /*- - * struct inpcb captures the network layer state for TCP, UDP, and raw IPv4 - * and IPv6 sockets. In the case of TCP, further per-connection state is + * struct inpcb captures the network layer state for TCP, UDP, and raw IPv4 and + * IPv6 sockets. In the case of TCP and UDP, further per-connection state is * hung off of inp_ppcb most of the time. Almost all fields of struct inpcb * are static after creation or protected by a per-inpcb rwlock, inp_lock. A - * few fields also require the global pcbinfo lock for the inpcb to be held, - * when modified, such as the global connection lists and hashes, as well as - * binding information (which affects which hash a connection is on). This - * model means that connections can be looked up without holding the - * per-connection lock, which is important for performance when attempting to - * find the connection for a packet given its IP and port tuple. Writing to - * these fields that write locks be held on both the inpcb and global locks. + * few fields are protected by multiple locks as indicated in the locking notes + * below. For these fields, all of the listed locks must be write-locked for + * any modifications. However, these fields can be safely read while any one of + * the listed locks are read-locked. This model can permit greater concurrency + * for read operations. For example, connections can be looked up while only + * holding a read lock on the global pcblist lock. This is important for + * performance when attempting to find the connection for a packet given its IP + * and port tuple. + * + * One noteworthy exception is that the global pcbinfo lock follows a different + * set of rules in relation to the inp_list field. Rather than being + * write-locked for modifications and read-locked for list iterations, it must + * be read-locked during modifications and write-locked during list iterations. + * This ensures that the relatively rare global list iterations safely walk a + * stable snapshot of connections while allowing more common list modifications + * to safely grab the pcblist lock just while adding or removing a connection + * from the global list. * * Key: * (c) - Constant after initialization * (g) - Protected by the pcbgroup lock * (i) - Protected by the inpcb lock * (p) - Protected by the pcbinfo lock for the inpcb + * (l) - Protected by the pcblist lock for the inpcb + * (h) - Protected by the pcbhash lock for the inpcb * (s) - Protected by another subsystem's locks * (x) - Undefined locking * @@ -161,15 +173,21 @@ struct icmp6_filter; * socket has been freed), or there may be close(2)-related races. * * The inp_vflag field is overloaded, and would otherwise ideally be (c). + * + * TODO: Currently only the TCP stack is leveraging the global pcbinfo lock + * read-lock usage during modification, this model can be applied to other + * protocols (especially SCTP). */ struct inpcb { - LIST_ENTRY(inpcb) inp_hash; /* (i/p) hash list */ + LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ - LIST_ENTRY(inpcb) inp_list; /* (i/p) list for all PCBs for proto */ + LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ + /* (p[w]) for list iteration */ + /* (p[r]/l) for addition/removal */ void *inp_ppcb; /* (i) pointer to per-protocol pcb */ struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */ - LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/p) group wildcard entry */ + LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ struct socket *inp_socket; /* (i) back pointer to socket */ struct ucred *inp_cred; /* (c) cache of socket cred */ u_int32_t inp_flow; /* (i) IPv6 flow information */ @@ -188,7 +206,7 @@ struct inpcb { * general use */ /* Local and foreign ports, local and foreign addr. */ - struct in_conninfo inp_inc; /* (i/p) list for PCB's local port */ + struct in_conninfo inp_inc; /* (i) list for PCB's local port */ /* MAC and IPSEC policy information. */ struct label *inp_label; /* (i) MAC label */ @@ -213,8 +231,8 @@ struct inpcb { int inp6_cksum; short inp6_hops; } inp_depend6; - LIST_ENTRY(inpcb) inp_portlist; /* (i/p) */ - struct inpcbport *inp_phd; /* (i/p) head of this list */ + LIST_ENTRY(inpcb) inp_portlist; /* (i/h) */ + struct inpcbport *inp_phd; /* (i/h) head of this list */ #define inp_zero_size offsetof(struct inpcb, inp_gencnt) inp_gen_t inp_gencnt; /* (c) generation count */ struct llentry *inp_lle; /* cached L2 information */ @@ -279,37 +297,46 @@ struct inpcbport { * Global data structure for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. Holds inpcb lists and information for managing them. * - * Each pcbinfo is protected by two locks: ipi_lock and ipi_hash_lock, - * the former covering mutable global fields (such as the global pcb list), - * and the latter covering the hashed lookup tables. The lock order is: + * Each pcbinfo is protected by three locks: ipi_lock, ipi_hash_lock and + * ipi_list_lock: + * - ipi_lock covering the global pcb list stability during loop iteration, + * - ipi_hash_lock covering the hashed lookup tables, + * - ipi_list_lock covering mutable global fields (such as the global + * pcb list) + * + * The lock order is: * - * ipi_lock (before) inpcb locks (before) {ipi_hash_lock, pcbgroup locks} + * ipi_lock (before) + * inpcb locks (before) + * ipi_list locks (before) + * {ipi_hash_lock, pcbgroup locks} * * Locking key: * * (c) Constant or nearly constant after initialisation * (g) Locked by ipi_lock + * (l) Locked by ipi_list_lock * (h) Read using either ipi_hash_lock or inpcb lock; write requires both * (p) Protected by one or more pcbgroup locks * (x) Synchronisation properties poorly defined */ struct inpcbinfo { /* - * Global lock protecting global inpcb list, inpcb count, etc. + * Global lock protecting full inpcb list traversal */ struct rwlock ipi_lock; /* * Global list of inpcbs on the protocol. */ - struct inpcbhead *ipi_listhead; /* (g) */ - u_int ipi_count; /* (g) */ + struct inpcbhead *ipi_listhead; /* (g/l) */ + u_int ipi_count; /* (l) */ /* * Generation count -- incremented each time a connection is allocated * or freed. */ - u_quad_t ipi_gencnt; /* (g) */ + u_quad_t ipi_gencnt; /* (l) */ /* * Fields associated with port lookup and allocation. @@ -367,6 +394,11 @@ struct inpcbinfo { * general use 2 */ void *ipi_pspare[2]; + + /* + * Global lock protecting global inpcb list, inpcb count, etc. + */ + struct rwlock ipi_list_lock; }; #ifdef _KERNEL @@ -466,6 +498,25 @@ short inp_so_options(const struct inpcb #define INP_INFO_WLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_WLOCKED) #define INP_INFO_UNLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_UNLOCKED) +#define INP_LIST_LOCK_INIT(ipi, d) \ + rw_init_flags(&(ipi)->ipi_list_lock, (d), 0) +#define INP_LIST_LOCK_DESTROY(ipi) rw_destroy(&(ipi)->ipi_list_lock) +#define INP_LIST_RLOCK(ipi) rw_rlock(&(ipi)->ipi_list_lock) +#define INP_LIST_WLOCK(ipi) rw_wlock(&(ipi)->ipi_list_lock) +#define INP_LIST_TRY_RLOCK(ipi) rw_try_rlock(&(ipi)->ipi_list_lock) +#define INP_LIST_TRY_WLOCK(ipi) rw_try_wlock(&(ipi)->ipi_list_lock) +#define INP_LIST_TRY_UPGRADE(ipi) rw_try_upgrade(&(ipi)->ipi_list_lock) +#define INP_LIST_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_list_lock) +#define INP_LIST_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_list_lock) +#define INP_LIST_LOCK_ASSERT(ipi) \ + rw_assert(&(ipi)->ipi_list_lock, RA_LOCKED) +#define INP_LIST_RLOCK_ASSERT(ipi) \ + rw_assert(&(ipi)->ipi_list_lock, RA_RLOCKED) +#define INP_LIST_WLOCK_ASSERT(ipi) \ + rw_assert(&(ipi)->ipi_list_lock, RA_WLOCKED) +#define INP_LIST_UNLOCK_ASSERT(ipi) \ + rw_assert(&(ipi)->ipi_list_lock, RA_UNLOCKED) + #define INP_HASH_LOCK_INIT(ipi, d) \ rw_init_flags(&(ipi)->ipi_hash_lock, (d), 0) #define INP_HASH_LOCK_DESTROY(ipi) rw_destroy(&(ipi)->ipi_hash_lock) Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Aug 3 11:57:11 2015 (r286226) +++ head/sys/netinet/tcp_input.c Mon Aug 3 12:13:54 2015 (r286227) @@ -608,7 +608,7 @@ tcp_input(struct mbuf **mp, int *offp, i char *s = NULL; /* address and port logging */ int ti_locked; #define TI_UNLOCKED 1 -#define TI_WLOCKED 2 +#define TI_RLOCKED 2 #ifdef TCPDEBUG /* @@ -797,8 +797,8 @@ tcp_input(struct mbuf **mp, int *offp, i * connection in TIMEWAIT and SYNs not targeting a listening socket. */ if ((thflags & (TH_FIN | TH_RST)) != 0) { - INP_INFO_WLOCK(&V_tcbinfo); - ti_locked = TI_WLOCKED; + INP_INFO_RLOCK(&V_tcbinfo); + ti_locked = TI_RLOCKED; } else ti_locked = TI_UNLOCKED; @@ -820,8 +820,8 @@ tcp_input(struct mbuf **mp, int *offp, i findpcb: #ifdef INVARIANTS - if (ti_locked == TI_WLOCKED) { - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) { + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); } else { INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); } @@ -969,20 +969,20 @@ findpcb: relocked: if (inp->inp_flags & INP_TIMEWAIT) { if (ti_locked == TI_UNLOCKED) { - if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) { + if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); - INP_INFO_WLOCK(&V_tcbinfo); - ti_locked = TI_WLOCKED; + INP_INFO_RLOCK(&V_tcbinfo); + ti_locked = TI_RLOCKED; INP_WLOCK(inp); if (in_pcbrele_wlocked(inp)) { inp = NULL; goto findpcb; } } else - ti_locked = TI_WLOCKED; + ti_locked = TI_RLOCKED; } - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); if (thflags & TH_SYN) tcp_dooptions(&to, optp, optlen, TO_SYN); @@ -991,7 +991,7 @@ relocked: */ if (tcp_twcheck(inp, &to, th, m, tlen)) goto findpcb; - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_INFO_RUNLOCK(&V_tcbinfo); return (IPPROTO_DONE); } /* @@ -1022,16 +1022,16 @@ relocked: */ #ifdef INVARIANTS if ((thflags & (TH_FIN | TH_RST)) != 0) - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); #endif if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN)))) { if (ti_locked == TI_UNLOCKED) { - if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) { + if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); - INP_INFO_WLOCK(&V_tcbinfo); - ti_locked = TI_WLOCKED; + INP_INFO_RLOCK(&V_tcbinfo); + ti_locked = TI_RLOCKED; INP_WLOCK(inp); if (in_pcbrele_wlocked(inp)) { inp = NULL; @@ -1039,9 +1039,9 @@ relocked: } goto relocked; } else - ti_locked = TI_WLOCKED; + ti_locked = TI_RLOCKED; } - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); } #ifdef MAC @@ -1096,7 +1096,7 @@ relocked: */ if ((thflags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK) { - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* * Parse the TCP options here because * syncookies need access to the reflected @@ -1148,7 +1148,11 @@ relocked: */ INP_WUNLOCK(inp); /* listen socket */ inp = sotoinpcb(so); - INP_WLOCK(inp); /* new connection */ + /* + * New connection inpcb is already locked by + * syncache_expand(). + */ + INP_WLOCK_ASSERT(inp); tp = intotcpcb(inp); KASSERT(tp->t_state == TCPS_SYN_RECEIVED, ("%s: ", __func__)); @@ -1379,8 +1383,8 @@ relocked: * Entry added to syncache and mbuf consumed. * Only the listen socket is unlocked by syncache_add(). */ - if (ti_locked == TI_WLOCKED) { - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; } INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); @@ -1429,8 +1433,8 @@ relocked: dropwithreset: TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); - if (ti_locked == TI_WLOCKED) { - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; } #ifdef INVARIANTS @@ -1453,8 +1457,8 @@ dropunlock: if (m != NULL) TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th); - if (ti_locked == TI_WLOCKED) { - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; } #ifdef INVARIANTS @@ -1511,13 +1515,13 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || tp->t_state != TCPS_ESTABLISHED) { - KASSERT(ti_locked == TI_WLOCKED, ("%s ti_locked %d for " + KASSERT(ti_locked == TI_RLOCKED, ("%s ti_locked %d for " "SYN/FIN/RST/!EST", __func__, ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); } else { #ifdef INVARIANTS - if (ti_locked == TI_WLOCKED) - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); else { KASSERT(ti_locked == TI_UNLOCKED, ("%s: EST " "ti_locked: %d", __func__, ti_locked)); @@ -1690,8 +1694,8 @@ tcp_do_segment(struct mbuf *m, struct tc /* * This is a pure ack for outstanding data. */ - if (ti_locked == TI_WLOCKED) - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; TCPSTAT_INC(tcps_predack); @@ -1794,8 +1798,8 @@ tcp_do_segment(struct mbuf *m, struct tc * nothing on the reassembly queue and we have enough * buffer space to take it. */ - if (ti_locked == TI_WLOCKED) - INP_INFO_WUNLOCK(&V_tcbinfo); + if (ti_locked == TI_RLOCKED) + INP_INFO_RUNLOCK(&V_tcbinfo); ti_locked = TI_UNLOCKED; /* Clean receiver SACK report if present */ @@ -2031,9 +2035,9 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_state_change(tp, TCPS_SYN_RECEIVED); } - KASSERT(ti_locked == TI_WLOCKED, ("%s: trimthenstep6: " + KASSERT(ti_locked == TI_RLOCKED, ("%s: trimthenstep6: " "ti_locked %d", __func__, ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -2106,8 +2110,8 @@ tcp_do_segment(struct mbuf *m, struct tc SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) || (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) { - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - KASSERT(ti_locked == TI_WLOCKED, + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_RLOCKED, ("%s: TH_RST ti_locked %d, th %p tp %p", __func__, ti_locked, th, tp)); KASSERT(tp->t_state != TCPS_SYN_SENT, @@ -2150,9 +2154,9 @@ tcp_do_segment(struct mbuf *m, struct tc * Send challenge ACK for any SYN in synchronized state. */ if ((thflags & TH_SYN) && tp->t_state != TCPS_SYN_SENT) { - KASSERT(ti_locked == TI_WLOCKED, + KASSERT(ti_locked == TI_RLOCKED, ("tcp_do_segment: TH_SYN ti_locked %d", ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); TCPSTAT_INC(tcps_badsyn); if (V_tcp_insecure_syn && @@ -2265,9 +2269,9 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((so->so_state & SS_NOFDREF) && tp->t_state > TCPS_CLOSE_WAIT && tlen) { - KASSERT(ti_locked == TI_WLOCKED, ("%s: SS_NOFDEREF && " + KASSERT(ti_locked == TI_RLOCKED, ("%s: SS_NOFDEREF && " "CLOSE_WAIT && tlen ti_locked %d", __func__, ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data " @@ -2768,9 +2772,9 @@ process_ACK: */ case TCPS_CLOSING: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 3 12:14:44 2015 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 F13CC9B1AF1; Mon, 3 Aug 2015 12:14:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D54117EE; Mon, 3 Aug 2015 12:14:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73CEi5o091039; Mon, 3 Aug 2015 12:14:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73CEhCf091034; Mon, 3 Aug 2015 12:14:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508031214.t73CEhCf091034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2015 12:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286228 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 12:14:45 -0000 Author: kib Date: Mon Aug 3 12:14:42 2015 New Revision: 286228 URL: https://svnweb.freebsd.org/changeset/base/286228 Log: Clear the IA32_MISC_ENABLE MSR bit, which limits the max CPUID reported, on APs. We already did this on BSP. Otherwise, the userspace software which depends on the features reported by the high CPUID levels is misbehaving. In particular, AVX detection is non-functional, depending on which CPU thread happens to execute when doing CPUID. Another victim is the libthr signal handlers interposer, which needs to save full FPU extended state. Reported and tested by: Andre Meiser Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/md_var.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/md_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Aug 3 12:13:54 2015 (r286227) +++ head/sys/amd64/amd64/mp_machdep.c Mon Aug 3 12:14:42 2015 (r286228) @@ -252,6 +252,7 @@ init_secondary(void) wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ + intel_fix_cpuid(); lidt(&r_idt); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Aug 3 12:13:54 2015 (r286227) +++ head/sys/amd64/include/md_var.h Mon Aug 3 12:14:42 2015 (r286228) @@ -114,6 +114,7 @@ void dump_drop_page(vm_paddr_t); void identify_cpu(void); void initializecpu(void); void initializecpucache(void); +bool intel_fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); int is_physical_memory(vm_paddr_t addr); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Aug 3 12:13:54 2015 (r286227) +++ head/sys/i386/i386/mp_machdep.c Mon Aug 3 12:14:42 2015 (r286228) @@ -247,6 +247,8 @@ init_secondary(void) pc->pc_prvspace = pc; pc->pc_curthread = 0; + intel_fix_cpuid(); + gdt_segs[GPRIV_SEL].ssd_base = (int) pc; gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss; Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Aug 3 12:13:54 2015 (r286227) +++ head/sys/i386/include/md_var.h Mon Aug 3 12:14:42 2015 (r286228) @@ -118,6 +118,7 @@ void fillw(int /*u_short*/ pat, void *ba void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); void initializecpu(void); void initializecpucache(void); +bool intel_fix_cpuid(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Aug 3 12:13:54 2015 (r286227) +++ head/sys/x86/x86/identcpu.c Mon Aug 3 12:14:42 2015 (r286228) @@ -1295,6 +1295,33 @@ identify_hypervisor(void) } /* + * Clear "Limit CPUID Maxval" bit and return true if the caller should + * get the largest standard CPUID function number again if it is set + * from BIOS. It is necessary for probing correct CPU topology later + * and for the correct operation of the AVX-aware userspace. + */ +bool +intel_fix_cpuid(void) +{ + uint64_t msr; + + if (cpu_vendor_id != CPU_VENDOR_INTEL) + return (false); + if ((CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x3) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xe)) { + msr = rdmsr(MSR_IA32_MISC_ENABLE); + if ((msr & IA32_MISC_EN_LIMCPUID) != 0) { + msr &= ~IA32_MISC_EN_LIMCPUID; + wrmsr(MSR_IA32_MISC_ENABLE, msr); + return (true); + } + } + return (false); +} + +/* * Final stage of CPU identification. */ #ifdef __i386__ @@ -1328,22 +1355,9 @@ identify_cpu(void) identify_hypervisor(); cpu_vendor_id = find_cpu_vendor_id(); - /* - * Clear "Limit CPUID Maxval" bit and get the largest standard CPUID - * function number again if it is set from BIOS. It is necessary - * for probing correct CPU topology later. - * XXX This is only done on the BSP package. - */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4 && - ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || - (CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) >= 0xe))) { - uint64_t msr; - msr = rdmsr(MSR_IA32_MISC_ENABLE); - if ((msr & 0x400000ULL) != 0) { - wrmsr(MSR_IA32_MISC_ENABLE, msr & ~0x400000ULL); - do_cpuid(0, regs); - cpu_high = regs[0]; - } + if (intel_fix_cpuid()) { + do_cpuid(0, regs); + cpu_high = regs[0]; } if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { From owner-svn-src-head@freebsd.org Mon Aug 3 13:06:22 2015 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 620B79B25BB; Mon, 3 Aug 2015 13:06:22 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::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 DC2021F2D; Mon, 3 Aug 2015 13:06:21 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by labow3 with SMTP id ow3so16164314lab.1; Mon, 03 Aug 2015 06:06:19 -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:content-type; bh=iOMyHenElxoCyae+96euAY/lKwgXg9l3lfGqpT08OSw=; b=nRBAGnX+ZP+SV0hdLLbaH8bA9ebURKaJfnP7LL0hOK0DtfYFqGQYscre2fCJRZ5ZVZ ZyRwi2Ji6PLslASUHi6mpAuPc6qAfcsSG3k1v+k6mpegJoQPSIr3RQtspjyl1k62fuDz /lIk9p2rwWYcTin1sEfAlTb8fa6Un5QOLg2uRtRbnUAVF57p7R9NrVcqjBMW9fheSnjd LldjcZ0vI2jg48ttLx1Bn7Hyio+qHjZtKFnok1CEnVPxL5Wn27OcVlHukiFfqBh463y3 3QBdAroPKPhxtqufpkkyYkO/4y23qzBrXPH5hHksHegzcsEV9r8P+8Nrmg4NRE/hmjzb LSyQ== X-Received: by 10.112.144.69 with SMTP id sk5mr16793734lbb.6.1438607179582; Mon, 03 Aug 2015 06:06:19 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.152.115.140 with HTTP; Mon, 3 Aug 2015 06:06:00 -0700 (PDT) In-Reply-To: <20150728124220.GW72729@FreeBSD.org> References: <201507021810.t62IAgCc003272@repo.freebsd.org> <20150728124220.GW72729@FreeBSD.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Mon, 3 Aug 2015 15:06:00 +0200 X-Google-Sender-Auth: -7vzaOBPz8xukJkEsV3qIFMZqvc Message-ID: Subject: Re: svn commit: r285051 - head/sys/netinet To: Gleb Smirnoff Cc: =?UTF-8?Q?Ermal_Lu=C3=A7i?= , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 13:06:22 -0000 On Tue, Jul 28, 2015 at 2:42 PM, Gleb Smirnoff wrote: > > Here is suggested patch. Ermal and Oliver, can you please test/benchmark > it? > =E2=80=8BHi, this patch reduce performanece :-( Here are the results regarding forwarding: x r285046.pps.forwarding (IPSEC compiled but not used) + r285051.pps.forwarding (IPSEC compiled but not used) * r285051-glebius-patched.pps.forwarding (IPSEC compiled but not used) +--------------------------------------------------------------------------= ------+ |xxx xx **** * + +++| ||_M_A___| |_A_| |AM|| +--------------------------------------------------------------------------= ------+ N Min Max Median Avg Stddev x 5 397733 406951 399300 401613.8 4324.9755 + 5 478095 482079 480869 480543.6 1666.0282 Difference at 95.0% confidence 78929.8 +/- 4779.72 19.6532% +/- 1.19013% (Student's t, pooled s =3D 3277.27) * 5 424720 430745 427014 427378.4 2351.7439 Difference at 95.0% confidence 25764.6 +/- 5076.98 6.41527% +/- 1.26415% (Student's t, pooled s =3D 3481.1) =E2=80=8B PMC stats during forwarding bench: [root@netgate]/data# pmcannotate pmc.forwarding.out /data/debug/boot/kernel/kernel.symbols CONVERSION STATISTICS: #samples/total 33880 Profile trace for function: __rw_rlock() [6.29%] Profile trace for function: ip_forward() [4.68%] Profile trace for function: ip_output() [4.64%] Profile trace for function: binuptime() [4.05%] Profile trace for function: igb_mq_start_locked() [3.79%] Profile trace for function: igb_rxeof() [3.46%] Profile trace for function: tsc_get_timecount_low_lfence() [3.25%] Profile trace for function: ether_output() [3.03%] Profile trace for function: rtalloc1_fib() [2.77%] Profile trace for function: random_ivy_read() [2.64%] Profile trace for function: _rw_runlock_cookie() [2.64%] Profile trace for function: ether_nh_input() [2.63%] Profile trace for function: ip_input() [2.55%] Profile trace for function: key_allocsp_default() [2.39%] Profile trace for function: igb_mq_start() [2.39%] Profile trace for function: bzero() [2.08%] Profile trace for function: uma_zalloc_arg() [1.95%] Profile trace for function: memcpy() [1.84%] Profile trace for function: _mtx_lock_spin_cookie() [1.83%] Profile trace for function: bcopy() [1.76%] Profile trace for function: random_harvest_queue() [1.63%] Profile trace for function: __mtx_lock_sleep() [1.56%] Profile trace for function: uma_zfree_arg() [1.47%] Profile trace for function: arpresolve() [1.39%] Profile trace for function: in_cksumdata() [1.25%] Profile trace for function: bounce_bus_dmamap_load_buffer() [1.22%] Profile trace for function: bcmp() [1.13%] Profile trace for function: rtalloc_ign_fib() [1.11%] Profile trace for function: rn_match() [1.03%] Profile trace for function: netisr_dispatch_src() [1.03%] Profile trace for function: critical_exit() [1.02%] Profile trace for function: bus_dmamap_load_mbuf_sg() [0.87%] Profile trace for function: spinlock_exit() [0.79%] Profile trace for function: in_cksum_skip() [0.75%] Profile trace for function: ip_ipsec_output() [0.75%] Profile trace for function: acpi_cpu_c1() [0.74%] Profile trace for function: in_broadcast() [0.74%] Profile trace for function: spinlock_enter() [0.74%] Profile trace for function: igb_refresh_mbufs() [0.71%] Profile trace for function: in_lltable_lookup() [0.71%] Profile trace for function: ip_fastforward() [0.68%] Profile trace for function: m_adj() [0.65%] Profile trace for function: ether_demux() [0.65%] Profile trace for function: _key_freesp() [0.61%] Profile trace for function: lockstat_nsecs() [0.60%] Profile trace for function: m_freem() [0.58%] Profile trace for function: critical_enter() [0.56%] Profile trace for function: m_copydata() [0.55%] Profile trace for function: mb_free_ext() [0.54%] Profile trace for function: pmap_kextract() [0.50%] =E2=80=8B =E2=80=8BAnd about fastforwarding: =E2=80=8B x 285046.pps.fastforwarding (IPSEC compiled but not used) + 285051.pps.fastforwarding (IPSEC compiled but not used) * r285051-glebius-patched.pps.fastforwarding (IPSEC compiled but not used) +--------------------------------------------------------------------------= ------+ |* + | |* * * * ++ +x x+ xx x| ||____AM__| |_MA__|__AM_| | +--------------------------------------------------------------------------= ------+ N Min Max Median Avg Stddev x 5 742683 754709 750940 749015.6 4944.9059 + 5 736459 747593 738197 740112.4 4511.1611 Difference at 95.0% confidence -8903.2 +/- 6902.82 -1.18865% +/- 0.921585% (Student's t, pooled s =3D 4733) * 5 638356 652855 646668 645263 6599.8604 Difference at 95.0% confidence -103753 +/- 8504.75 -13.8519% +/- 1.13546% (Student's t, pooled s =3D 5831.39) And pmcstat during fastforwarding: [root@netgate]/data# pmcannotate pmc.fastforwading.out /data/debug/boot/kernel/kernel.symbols CONVERSION STATISTICS: #samples/total 37656 Profile trace for function: __rw_rlock() [9.12%] Profile trace for function: ip_fastforward() [5.80%] Profile trace for function: binuptime() [5.73%] Profile trace for function: rtalloc1_fib() [4.92%] Profile trace for function: tsc_get_timecount_low_lfence() [4.71%] Profile trace for function: igb_rxeof() [4.51%] Profile trace for function: _rw_runlock_cookie() [4.14%] Profile trace for function: igb_mq_start_locked() [4.12%] Profile trace for function: ether_output() [3.36%] Profile trace for function: ether_nh_input() [3.11%] Profile trace for function: igb_mq_start() [3.02%] Profile trace for function: random_ivy_read() [2.88%] Profile trace for function: bzero() [2.70%] Profile trace for function: memcpy() [2.54%] Profile trace for function: random_harvest_queue() [2.32%] Profile trace for function: __mtx_lock_sleep() [1.91%] Profile trace for function: bcmp() [1.78%] Profile trace for function: _mtx_lock_spin_cookie() [1.73%] Profile trace for function: igb_txeof() [1.70%] Profile trace for function: rn_match() [1.69%] Profile trace for function: bounce_bus_dmamap_load_buffer() [1.52%] Profile trace for function: rtalloc_ign_fib() [1.30%] Profile trace for function: mb_free_ext() [1.29%] Profile trace for function: arpresolve() [1.28%] Profile trace for function: bcopy() [1.22%] Profile trace for function: spinlock_exit() [1.06%] Profile trace for function: mb_ctor_pack() [1.04%] Profile trace for function: uma_zalloc_arg() [1.02%] Profile trace for function: spinlock_enter() [1.00%] Profile trace for function: bus_dmamap_load_mbuf_sg() [0.93%] Profile trace for function: critical_exit() [0.90%] Profile trace for function: igb_refresh_mbufs() [0.89%] Profile trace for function: acpi_cpu_c1() [0.89%] Profile trace for function: netisr_dispatch_src() [0.81%] Profile trace for function: uma_zfree_arg() [0.80%] Profile trace for function: lockstat_nsecs() [0.79%] Profile trace for function: ether_demux() [0.76%] Profile trace for function: in_lltable_lookup() [0.75%] Profile trace for function: ip_findroute() [0.66%] Profile trace for function: in_localip() [0.65%] Profile trace for function: _mtx_trylock_flags_() [0.57%] Profile trace for function: _bus_dmamap_load_buffer() [0.54%] =E2=80=8BRegards, Olivier=E2=80=8B From owner-svn-src-head@freebsd.org Mon Aug 3 13:11:39 2015 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 A1DA89B2760; Mon, 3 Aug 2015 13:11:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7862E9; Mon, 3 Aug 2015 13:11:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA22526; Mon, 03 Aug 2015 16:11:35 +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 1ZMFWg-000BeF-N8; Mon, 03 Aug 2015 16:11:34 +0300 Message-ID: <55BF6863.8000103@FreeBSD.org> Date: Mon, 03 Aug 2015 16:10:59 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Scott Long CC: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r284297 - in head: cddl/contrib/opensolaris/cmd/lockstat sys/kern sys/sys References: <201506121001.t5CA1PTm089721@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 13:11:39 -0000 On 26/07/2015 23:27, Scott Long wrote: > >> On Jun 12, 2015, at 4:01 AM, Andriy Gapon wrote: >> >> Author: avg >> Date: Fri Jun 12 10:01:24 2015 >> New Revision: 284297 >> URL: https://svnweb.freebsd.org/changeset/base/284297 >> >> Log: >> several lockstat improvements >> >> 0. For spin events report time spent spinning, not a loop count. >> While loop count is much easier and cheaper to obtain it is hard >> to reason about the reported numbers, espcially for adaptive locks >> where both spinning and sleeping can happen. >> So, it's better to compare apples and apples. >> > > This causes spinning to be exceptionally more expensive just by having > KDTRACE_HOOKS enabled, whether or not Dtrace is actually in use. It > makes it undesirable to deploy with Dtrace by default since it impacts > performance. Is there a way to make the expensive collection optional, > or only enable when dtrace is using the lockstat module? Also have you > seen the other recent performance complaint related to this commit? Sorry for the trouble. Commit https://svnweb.freebsd.org/changeset/base/285704 should have fixed the problem. Could you please check if that's so? Thanks. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 3 13:21:15 2015 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 3DE069B28B7; Mon, 3 Aug 2015 13:21:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2D7BF4; Mon, 3 Aug 2015 13:21:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA22708; Mon, 03 Aug 2015 16:21:00 +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 1ZMFfn-000Bf6-P4; Mon, 03 Aug 2015 16:20:59 +0300 Message-ID: <55BF6A84.1040808@FreeBSD.org> Date: Mon, 03 Aug 2015 16:20:04 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "K. Macy" CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201507020832.t628W3WJ002944@repo.freebsd.org> 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.20 Precedence: list List-Id: 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, 03 Aug 2015 13:21:15 -0000 On 30/07/2015 10:24, K. Macy wrote: > Just FYI this change introduces a deadlock with with the > spa_namespace_lock. Mount will be holding this lock while trying to > acquire the spa_namespace_lock. zfskern on the other hand holds the > spa_namespace_lock when calling zfs_freebsd_access which in turn > tries to acquire the teardown lock. I missed the fact that zpool.cache file is being written with spa_namespace_lock held. I'll try to either resolve the problem in the next day or I will revert the change. > I think this makes a pretty strong case for the need to educate > WITNESS about rrm locks. > > Cheers. > > -K > > > > > > > > > > > On Thu, Jul 2, 2015 at 1:32 AM, Andriy Gapon wrote: >> Author: avg >> Date: Thu Jul 2 08:32:02 2015 >> New Revision: 285021 >> URL: https://svnweb.freebsd.org/changeset/base/285021 >> >> Log: >> zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls >> >> We now take z_teardown_lock as a writer to ensure that there is no I/O >> while the filesystem state is in a flux. Also, zfs_suspend_fs() -> >> zfsvfs_teardown() call zfs_unregister_callbacks() and zfs_resume_fs() -> >> zfsvfs_setup() call zfs_unregister_callbacks(). Previously there was no >> synchronization between those calls and the calls in the re-mounting >> case. That could lead to concurrent execution and a crash. >> >> PR: 180060 >> Differential Revision: https://reviews.freebsd.org/D2865 >> Suggested by: mahrens >> Reviewed by: delphij, pho, mahrens, will >> MFC after: 13 days >> Sponsored by: ClusterHQ >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 2 08:25:45 2015 (r285020) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jul 2 08:32:02 2015 (r285021) >> @@ -1717,9 +1717,19 @@ zfs_mount(vfs_t *vfsp) >> * according to those options set in the current VFS options. >> */ >> if (vfsp->vfs_flag & MS_REMOUNT) { >> - /* refresh mount options */ >> - zfs_unregister_callbacks(vfsp->vfs_data); >> + zfsvfs_t *zfsvfs = vfsp->vfs_data; >> + >> + /* >> + * Refresh mount options with z_teardown_lock blocking I/O while >> + * the filesystem is in an inconsistent state. >> + * The lock also serializes this code with filesystem >> + * manipulations between entry to zfs_suspend_fs() and return >> + * from zfs_resume_fs(). >> + */ >> + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); >> + zfs_unregister_callbacks(zfsvfs); >> error = zfs_register_callbacks(vfsp); >> + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); >> goto out; >> } >> >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 3 13:30:12 2015 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 835979B2B27 for ; Mon, 3 Aug 2015 13:30:12 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) (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 42257F6E; Mon, 3 Aug 2015 13:30:11 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [84.44.210.35] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZMFoG-00034X-FL; Mon, 03 Aug 2015 15:29:44 +0200 Date: Mon, 3 Aug 2015 15:29:45 +0200 From: Fabian Keil To: Andriy Gapon Cc: "svn-src-head@freebsd.org" Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <25a69eb6.5dfe13af@fabiankeil.de> In-Reply-To: <55BF6A84.1040808@FreeBSD.org> References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/BATTxX+=GyaRIl/vBJSHH+7"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 13:30:12 -0000 --Sig_/BATTxX+=GyaRIl/vBJSHH+7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Andriy Gapon wrote: > On 30/07/2015 10:24, K. Macy wrote: > > Just FYI this change introduces a deadlock with with the > > spa_namespace_lock. Mount will be holding this lock while trying to > > acquire the spa_namespace_lock. zfskern on the other hand holds the > > spa_namespace_lock when calling zfs_freebsd_access which in turn > > tries to acquire the teardown lock. >=20 > I missed the fact that zpool.cache file is being written with spa_namespa= ce_lock > held. > I'll try to either resolve the problem in the next day or I will revert t= he change. BTW, there's another (unrelated) spa_namespace_lock issue in spa_import_roo= tpool(): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D198563 Fabian --Sig_/BATTxX+=GyaRIl/vBJSHH+7 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlW/bMUACgkQBYqIVf93VJ2DzACgg46KzUgFHrfgrGpF6zSlWuWR sEAAoIb7Aj1ueONatgiHwiooq5mqzsaU =+qd2 -----END PGP SIGNATURE----- --Sig_/BATTxX+=GyaRIl/vBJSHH+7-- From owner-svn-src-head@freebsd.org Mon Aug 3 13:41:48 2015 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 85B569B2ECF; Mon, 3 Aug 2015 13:41:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 74A1F1647; Mon, 3 Aug 2015 13:41:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Dfmv4026946; Mon, 3 Aug 2015 13:41:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Dflee026942; Mon, 3 Aug 2015 13:41:47 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508031341.t73Dflee026942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 13:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286229 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 13:41:48 -0000 Author: ed Date: Mon Aug 3 13:41:47 2015 New Revision: 286229 URL: https://svnweb.freebsd.org/changeset/base/286229 Log: Add sysent flag to switch to capabilities mode on startup. CloudABI processes should run in capabilities mode automatically. There is no need to switch manually (e.g., by calling cap_enter()). Add a flag, SV_CAPSICUM, that can be used to call into cap_enter() during execve(). Reviewed by: kib Modified: head/sys/kern/kern_exec.c head/sys/sys/sysent.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Aug 3 12:14:42 2015 (r286228) +++ head/sys/kern/kern_exec.c Mon Aug 3 13:41:47 2015 (r286229) @@ -562,6 +562,10 @@ interpret: goto exec_fail_dealloc; } + /* ABI enforces the use of Capsicum. Switch into capabilities mode. */ + if (SV_PROC_FLAG(p, SV_CAPSICUM)) + sys_cap_enter(td, NULL); + /* * Copy out strings (args and env) and initialize stack base */ Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Aug 3 12:14:42 2015 (r286228) +++ head/sys/sys/sysent.h Mon Aug 3 13:41:47 2015 (r286229) @@ -139,11 +139,12 @@ struct sysentvec { void (*sv_thread_detach)(struct thread *); }; -#define SV_ILP32 0x000100 -#define SV_LP64 0x000200 -#define SV_IA32 0x004000 -#define SV_AOUT 0x008000 -#define SV_SHP 0x010000 +#define SV_ILP32 0x000100 /* 32-bit executable. */ +#define SV_LP64 0x000200 /* 64-bit executable. */ +#define SV_IA32 0x004000 /* Intel 32-bit executable. */ +#define SV_AOUT 0x008000 /* a.out executable. */ +#define SV_SHP 0x010000 /* Shared page. */ +#define SV_CAPSICUM 0x020000 /* Force cap_enter() on startup. */ #define SV_ABI_MASK 0xff #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) From owner-svn-src-head@freebsd.org Mon Aug 3 13:42:53 2015 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 89E729B2EFD; Mon, 3 Aug 2015 13:42:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7B3CB19D9; Mon, 3 Aug 2015 13:42:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Dgrxv027041; Mon, 3 Aug 2015 13:42:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73DgrjA027040; Mon, 3 Aug 2015 13:42:53 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508031342.t73DgrjA027040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 13:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286230 - head/sys/amd64/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.20 Precedence: list List-Id: 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, 03 Aug 2015 13:42:53 -0000 Author: ed Date: Mon Aug 3 13:42:52 2015 New Revision: 286230 URL: https://svnweb.freebsd.org/changeset/base/286230 Log: Let CloudABI use the SV_CAPSICUM flag. CloudABI processes will now start up in capabilities mode. Reviewed by: kib Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 13:41:47 2015 (r286229) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 13:42:52 2015 (r286230) @@ -224,7 +224,7 @@ static struct sysentvec cloudabi64_elf_s .sv_usrstack = USRSTACK, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi64_copyout_strings, - .sv_flags = SV_ABI_CLOUDABI, + .sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM, .sv_set_syscall_retval = cloudabi64_set_syscall_retval, .sv_fetch_syscall_args = cloudabi64_fetch_syscall_args, .sv_syscallnames = cloudabi64_syscallnames, From owner-svn-src-head@freebsd.org Mon Aug 3 13:49:29 2015 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 3F7E49B2055 for ; Mon, 3 Aug 2015 13:49:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (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 A1FA31D48 for ; Mon, 3 Aug 2015 13:49:28 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wibud3 with SMTP id ud3so136995323wib.1 for ; Mon, 03 Aug 2015 06:49:21 -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-type :content-transfer-encoding; bh=TV2W63je99BmkPByO4ycqYByDJzR9GBu5Gt/6UDFgoY=; b=m9Vzy1k3ImBHC6ufGuGbiqPXLrMdwXu2zcXcIO+sTSQ/52QPk9zxAyzVr/cWLHjGmi FZX95rKHaeH5RTpbIbkE9IruY85gfVAi/tou9X2cbWHO5BXX+GYBXd5+GsjdPCTUnAek QMNU3t56ElyggEdjMra+Xwt2uPAwwO9FfSsAN/DiWa14c+ogqVlvyA0ar/xYRpOCRrr8 cSpfmEcz4GvXPol/oa9OpFaB+uZtDo62p3Ufbf7PJSWcRkSOoc2i27BipJVZWwq8FgFI AO7UVVb/U3fx8DGEemTpRjan13CL5XZgzbksbA1BDZRvfdTuvut+B+rOr6stvdWTJ1JN V7Ew== X-Gm-Message-State: ALoCoQnCUDs9NmlVvAwbgtdFb1yviv3xSYzXKoMtmken1xriwGGHRisypgMyvTXO2NIlj5Mn/Cac X-Received: by 10.180.36.169 with SMTP id r9mr33363447wij.40.1438609761424; Mon, 03 Aug 2015 06:49:21 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id ev2sm13688483wib.21.2015.08.03.06.49.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 06:49:20 -0700 (PDT) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Konstantin Belousov References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> Cc: Peter Wemm , svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org From: Steven Hartland Message-ID: <55BF7167.1090900@multiplay.co.uk> Date: Mon, 3 Aug 2015 14:49:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150803120359.GC2072@kib.kiev.ua> 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.20 Precedence: list List-Id: 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, 03 Aug 2015 13:49:29 -0000 On 03/08/2015 13:03, Konstantin Belousov wrote: > On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >> For this change I don't want to get into fixing the thread0 stack size, >> which can be done later, just >> to provide a reasonable warning to the user that smaller values could >> cause a panic. > Hmm, is it limited to the thread0 only ? I.e., would only increasing > the initial thread stack size be enough to boot the kernel ? The zfs > threads do request larger stack size, I know this. > > Can somebody test the following patch in the i386 configuration which > does not boot ? > > diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c > index 7a00740..6a00d23 100644 > --- a/sys/i386/i386/genassym.c > +++ b/sys/i386/i386/genassym.c > @@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall)); > ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); > /* ASSYM(UPAGES, UPAGES);*/ > ASSYM(KSTACK_PAGES, KSTACK_PAGES); > +ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); > ASSYM(PAGE_SIZE, PAGE_SIZE); > ASSYM(NPTEPG, NPTEPG); > ASSYM(NPDEPG, NPDEPG); > diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s > index 5bf7944..4d8e22f 100644 > --- a/sys/i386/i386/locore.s > +++ b/sys/i386/i386/locore.s > @@ -731,7 +731,7 @@ no_kernend: > movl %esi,R(IdlePTD) > > /* Allocate KSTACK */ > - ALLOCPAGES(KSTACK_PAGES) > + ALLOCPAGES(TD0_KSTACK_PAGES) > movl %esi,R(p0kpa) > addl $KERNBASE, %esi > movl %esi, R(proc0kstack) > @@ -800,7 +800,7 @@ no_kernend: > > /* Map proc0's KSTACK in the physical way ... */ > movl R(p0kpa), %eax > - movl $(KSTACK_PAGES), %ecx > + movl $(TD0_KSTACK_PAGES), %ecx > fillkptphys($PG_RW) > > /* Map ISA hole */ > diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c > index 2be5dbc..76790f0 100644 > --- a/sys/i386/i386/machdep.c > +++ b/sys/i386/i386/machdep.c > @@ -2445,7 +2445,7 @@ init386(first) > #endif > > thread0.td_kstack = proc0kstack; > - thread0.td_kstack_pages = KSTACK_PAGES; > + thread0.td_kstack_pages = TD0_KSTACK_PAGES; > > /* > * This may be done better later if it gets more high level > diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h > index b3fd85f..bc79c20 100644 > --- a/sys/i386/include/param.h > +++ b/sys/i386/include/param.h > @@ -114,6 +114,11 @@ > #define KSTACK_PAGES 2 /* Includes pcb! */ > #endif > #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ > +#if KSTACK_PAGES < 3 > +#define TD0_KSTACK_PAGES 4 > +#else > +#define TD0_KSTACK_PAGES KSTACK_PAGES > +#endif > > /* > * Ceiling on amount of swblock kva space, can be changed via I don't have a reproduction box here I'm afraid, might be an idea to post the patch to the following bug reports to see if one of the reporters can test: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201859 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189355 Regards Steve From owner-svn-src-head@freebsd.org Mon Aug 3 13:49:48 2015 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 3BAA29B2081; Mon, 3 Aug 2015 13:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2CF041E69; Mon, 3 Aug 2015 13:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Dnm1t027379; Mon, 3 Aug 2015 13:49:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Dnltj027377; Mon, 3 Aug 2015 13:49:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508031349.t73Dnltj027377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Aug 2015 13:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286231 - in head/sys: amd64/conf i386/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.20 Precedence: list List-Id: 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, 03 Aug 2015 13:49:48 -0000 Author: imp Date: Mon Aug 3 13:49:46 2015 New Revision: 286231 URL: https://svnweb.freebsd.org/changeset/base/286231 Log: Add pmspvc device back to GENERIC. The issues with the device playing grabby hands with other driver's devices has been solved. MFC After: 3 weeks Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Aug 3 13:42:52 2015 (r286230) +++ head/sys/amd64/conf/GENERIC Mon Aug 3 13:49:46 2015 (r286231) @@ -170,8 +170,7 @@ device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s -#XXX PCI ID conflicts with ahd(4) and mvs(4) -#device pmspcv # PMC-Sierra SAS/SATA Controller driver +device pmspcv # PMC-Sierra SAS/SATA Controller driver #XXX pointer/int warnings #device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Aug 3 13:42:52 2015 (r286230) +++ head/sys/i386/conf/GENERIC Mon Aug 3 13:49:46 2015 (r286231) @@ -175,8 +175,7 @@ device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s -#XXX PCI ID conflicts with ahd(4) and mvs(4) -#device pmspcv # PMC-Sierra SAS/SATA Controller driver +device pmspcv # PMC-Sierra SAS/SATA Controller driver device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID From owner-svn-src-head@freebsd.org Mon Aug 3 14:31:07 2015 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 1F11F9B2977; Mon, 3 Aug 2015 14:31:07 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1043918D8; Mon, 3 Aug 2015 14:31:07 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73EV65Q045025; Mon, 3 Aug 2015 14:31:06 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73EV6hZ045024; Mon, 3 Aug 2015 14:31:06 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508031431.t73EV6hZ045024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 3 Aug 2015 14:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286232 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 14:31:07 -0000 Author: melifaro Date: Mon Aug 3 14:31:06 2015 New Revision: 286232 URL: https://svnweb.freebsd.org/changeset/base/286232 Log: Fix ipfw range deletion. Spotted by: ian,julian Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Aug 3 13:49:46 2015 (r286231) +++ head/sbin/ipfw/ipfw2.c Mon Aug 3 14:31:06 2015 (r286232) @@ -3033,9 +3033,10 @@ fill_flags_cmd(ipfw_insn *cmd, enum ipfw void ipfw_delete(char *av[]) { - int i; + int i, j; int exitval = EX_OK; int do_set = 0; + char *sep; ipfw_range_tlv rt; av++; @@ -3053,7 +3054,11 @@ ipfw_delete(char *av[]) /* Rule number */ while (*av && isdigit(**av)) { - i = atoi(*av); av++; + i = strtol(*av, &sep, 10); + j = i; + if (*sep== '-') + j = strtol(sep + 1, NULL, 10); + av++; if (co.do_nat) { exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); if (exitval) { @@ -3068,7 +3073,7 @@ ipfw_delete(char *av[]) rt.flags = IPFW_RCFLAG_SET; } else { rt.start_rule = i & 0xffff; - rt.end_rule = i & 0xffff; + rt.end_rule = j & 0xffff; if (rt.start_rule == 0 && rt.end_rule == 0) rt.flags |= IPFW_RCFLAG_ALL; else From owner-svn-src-head@freebsd.org Mon Aug 3 14:58:47 2015 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 987319AE05F; Mon, 3 Aug 2015 14:58:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 89F9F90C; Mon, 3 Aug 2015 14:58:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Ewl0E055904; Mon, 3 Aug 2015 14:58:47 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Ewlo3055903; Mon, 3 Aug 2015 14:58:47 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508031458.t73Ewlo3055903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 3 Aug 2015 14:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286233 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 14:58:47 -0000 Author: zbb Date: Mon Aug 3 14:58:46 2015 New Revision: 286233 URL: https://svnweb.freebsd.org/changeset/base/286233 Log: Add missing exception number to EL0 sync. abort on ARM64 When doing a data abort from userland it is possible to get more than one data abort inside the same exception level. Add an appropriate exception number to allow nesting of data_abort handler for EL0. Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3276 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Aug 3 14:31:06 2015 (r286232) +++ head/sys/arm64/arm64/trap.c Mon Aug 3 14:58:46 2015 (r286233) @@ -329,6 +329,7 @@ do_el0_sync(struct trapframe *frame) break; case EXCP_INSN_ABORT_L: case EXCP_DATA_ABORT_L: + case EXCP_DATA_ABORT: data_abort(frame, esr, 1); break; default: From owner-svn-src-head@freebsd.org Mon Aug 3 15:05:43 2015 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 762E99AE2F1; Mon, 3 Aug 2015 15:05:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x229.google.com (mail-yk0-x229.google.com [IPv6:2607:f8b0:4002:c07::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 32AFDD0D; Mon, 3 Aug 2015 15:05:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykoo205 with SMTP id o205so22511977yko.0; Mon, 03 Aug 2015 08:05:42 -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:date:message-id:subject :from:to:cc:content-type; bh=51Na3GClefhjU3ulb9xD1yLJf/Hw/rG/S7TKQrm/kZE=; b=WRzPmwH5AztzD7VwCr1sEHvbLGG/0AovRvPehAol1XShl6Kxcw6+SSXWnkGm70cpKM 1DThlQTmCXpe3BWyKUm5Pb4/QKdC4gXkyww+eQfPnYWcHKuvnl2E1R4cXtG8wOw7i7w5 x2eladXyeGKC0lXiDVBahi19O3UrXxNW/bRMwoDmWXwNe25MPMvpIEGCWl3wkg6SCwJI 9My2h7WLfBhDbJ2EPlrvTeEVJbi3anPBJS1xK62TLhDTaKpWeEfR2uxK9xaQSrJJc/6m 3cd1HyW5s4lkGBeM4oGwaCnSpLt2hsLrGrYg7UEbRjr3dkj3lnuBkJYouVFPw06p/Jd8 Gysw== MIME-Version: 1.0 X-Received: by 10.170.198.144 with SMTP id p138mr20800610yke.70.1438614342295; Mon, 03 Aug 2015 08:05:42 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.83.139 with HTTP; Mon, 3 Aug 2015 08:05:42 -0700 (PDT) In-Reply-To: References: <201507021810.t62IAgCc003272@repo.freebsd.org> <20150728124220.GW72729@FreeBSD.org> Date: Mon, 3 Aug 2015 17:05:42 +0200 X-Google-Sender-Auth: 9XThOUgrTxJV_yDg27MNOba6GRw Message-ID: Subject: Re: svn commit: r285051 - head/sys/netinet From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Gleb Smirnoff , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 15:05:43 -0000 Hello Olivier, its strange seeing so much contention on the arp tables on your PMC stats. Do you run ping(to prepopulate arp) or static arp to remove the noise from that interaction? Also do you run with flowtable active? On Mon, Aug 3, 2015 at 3:06 PM, Olivier Cochard-Labb=C3=A9 wrote: > On Tue, Jul 28, 2015 at 2:42 PM, Gleb Smirnoff > wrote: > >> >> Here is suggested patch. Ermal and Oliver, can you please test/benchmark >> it? >> > > =E2=80=8BHi, > > this patch reduce performanece :-( > > Here are the results regarding forwarding: > > x r285046.pps.forwarding (IPSEC compiled but not used) > + r285051.pps.forwarding (IPSEC compiled but not used) > * r285051-glebius-patched.pps.forwarding (IPSEC compiled but not used) > > +------------------------------------------------------------------------= --------+ > |xxx xx **** > * + +++| > ||_M_A___| > |_A_| |AM|| > > +------------------------------------------------------------------------= --------+ > N Min Max Median Avg Stdd= ev > x 5 397733 406951 399300 401613.8 4324.97= 55 > + 5 478095 482079 480869 480543.6 1666.02= 82 > Difference at 95.0% confidence > 78929.8 +/- 4779.72 > 19.6532% +/- 1.19013% > (Student's t, pooled s =3D 3277.27) > * 5 424720 430745 427014 427378.4 2351.74= 39 > Difference at 95.0% confidence > 25764.6 +/- 5076.98 > 6.41527% +/- 1.26415% > (Student's t, pooled s =3D 3481.1) > =E2=80=8B > > > PMC stats during forwarding bench: > [root@netgate]/data# pmcannotate pmc.forwarding.out > /data/debug/boot/kernel/kernel.symbols > CONVERSION STATISTICS: > #samples/total 33880 > Profile trace for function: __rw_rlock() [6.29%] > Profile trace for function: ip_forward() [4.68%] > Profile trace for function: ip_output() [4.64%] > Profile trace for function: binuptime() [4.05%] > Profile trace for function: igb_mq_start_locked() [3.79%] > Profile trace for function: igb_rxeof() [3.46%] > Profile trace for function: tsc_get_timecount_low_lfence() [3.25%] > Profile trace for function: ether_output() [3.03%] > Profile trace for function: rtalloc1_fib() [2.77%] > Profile trace for function: random_ivy_read() [2.64%] > Profile trace for function: _rw_runlock_cookie() [2.64%] > Profile trace for function: ether_nh_input() [2.63%] > Profile trace for function: ip_input() [2.55%] > Profile trace for function: key_allocsp_default() [2.39%] > Profile trace for function: igb_mq_start() [2.39%] > Profile trace for function: bzero() [2.08%] > Profile trace for function: uma_zalloc_arg() [1.95%] > Profile trace for function: memcpy() [1.84%] > Profile trace for function: _mtx_lock_spin_cookie() [1.83%] > Profile trace for function: bcopy() [1.76%] > Profile trace for function: random_harvest_queue() [1.63%] > Profile trace for function: __mtx_lock_sleep() [1.56%] > Profile trace for function: uma_zfree_arg() [1.47%] > Profile trace for function: arpresolve() [1.39%] > Profile trace for function: in_cksumdata() [1.25%] > Profile trace for function: bounce_bus_dmamap_load_buffer() [1.22%] > Profile trace for function: bcmp() [1.13%] > Profile trace for function: rtalloc_ign_fib() [1.11%] > Profile trace for function: rn_match() [1.03%] > Profile trace for function: netisr_dispatch_src() [1.03%] > Profile trace for function: critical_exit() [1.02%] > Profile trace for function: bus_dmamap_load_mbuf_sg() [0.87%] > Profile trace for function: spinlock_exit() [0.79%] > Profile trace for function: in_cksum_skip() [0.75%] > Profile trace for function: ip_ipsec_output() [0.75%] > Profile trace for function: acpi_cpu_c1() [0.74%] > Profile trace for function: in_broadcast() [0.74%] > Profile trace for function: spinlock_enter() [0.74%] > Profile trace for function: igb_refresh_mbufs() [0.71%] > Profile trace for function: in_lltable_lookup() [0.71%] > Profile trace for function: ip_fastforward() [0.68%] > Profile trace for function: m_adj() [0.65%] > Profile trace for function: ether_demux() [0.65%] > Profile trace for function: _key_freesp() [0.61%] > Profile trace for function: lockstat_nsecs() [0.60%] > Profile trace for function: m_freem() [0.58%] > Profile trace for function: critical_enter() [0.56%] > Profile trace for function: m_copydata() [0.55%] > Profile trace for function: mb_free_ext() [0.54%] > Profile trace for function: pmap_kextract() [0.50%] > > =E2=80=8B > > =E2=80=8BAnd about fastforwarding: > =E2=80=8B > x 285046.pps.fastforwarding (IPSEC compiled but not used) > + 285051.pps.fastforwarding (IPSEC compiled but not used) > * r285051-glebius-patched.pps.fastforwarding (IPSEC compiled but not used= ) > > +------------------------------------------------------------------------= --------+ > |* > + | > |* * * * ++ +x > x+ xx x| > ||____AM__| > |_MA__|__AM_| | > > +------------------------------------------------------------------------= --------+ > N Min Max Median Avg Stdd= ev > x 5 742683 754709 750940 749015.6 4944.90= 59 > + 5 736459 747593 738197 740112.4 4511.16= 11 > Difference at 95.0% confidence > -8903.2 +/- 6902.82 > -1.18865% +/- 0.921585% > (Student's t, pooled s =3D 4733) > * 5 638356 652855 646668 645263 6599.86= 04 > Difference at 95.0% confidence > -103753 +/- 8504.75 > -13.8519% +/- 1.13546% > (Student's t, pooled s =3D 5831.39) > > And pmcstat during fastforwarding: > > [root@netgate]/data# pmcannotate pmc.fastforwading.out > /data/debug/boot/kernel/kernel.symbols > CONVERSION STATISTICS: > #samples/total 37656 > Profile trace for function: __rw_rlock() [9.12%] > Profile trace for function: ip_fastforward() [5.80%] > Profile trace for function: binuptime() [5.73%] > Profile trace for function: rtalloc1_fib() [4.92%] > Profile trace for function: tsc_get_timecount_low_lfence() [4.71%] > Profile trace for function: igb_rxeof() [4.51%] > Profile trace for function: _rw_runlock_cookie() [4.14%] > Profile trace for function: igb_mq_start_locked() [4.12%] > Profile trace for function: ether_output() [3.36%] > Profile trace for function: ether_nh_input() [3.11%] > Profile trace for function: igb_mq_start() [3.02%] > Profile trace for function: random_ivy_read() [2.88%] > Profile trace for function: bzero() [2.70%] > Profile trace for function: memcpy() [2.54%] > Profile trace for function: random_harvest_queue() [2.32%] > Profile trace for function: __mtx_lock_sleep() [1.91%] > Profile trace for function: bcmp() [1.78%] > Profile trace for function: _mtx_lock_spin_cookie() [1.73%] > Profile trace for function: igb_txeof() [1.70%] > Profile trace for function: rn_match() [1.69%] > Profile trace for function: bounce_bus_dmamap_load_buffer() [1.52%] > Profile trace for function: rtalloc_ign_fib() [1.30%] > Profile trace for function: mb_free_ext() [1.29%] > Profile trace for function: arpresolve() [1.28%] > Profile trace for function: bcopy() [1.22%] > Profile trace for function: spinlock_exit() [1.06%] > Profile trace for function: mb_ctor_pack() [1.04%] > Profile trace for function: uma_zalloc_arg() [1.02%] > Profile trace for function: spinlock_enter() [1.00%] > Profile trace for function: bus_dmamap_load_mbuf_sg() [0.93%] > Profile trace for function: critical_exit() [0.90%] > Profile trace for function: igb_refresh_mbufs() [0.89%] > Profile trace for function: acpi_cpu_c1() [0.89%] > Profile trace for function: netisr_dispatch_src() [0.81%] > Profile trace for function: uma_zfree_arg() [0.80%] > Profile trace for function: lockstat_nsecs() [0.79%] > Profile trace for function: ether_demux() [0.76%] > Profile trace for function: in_lltable_lookup() [0.75%] > Profile trace for function: ip_findroute() [0.66%] > Profile trace for function: in_localip() [0.65%] > Profile trace for function: _mtx_trylock_flags_() [0.57%] > Profile trace for function: _bus_dmamap_load_buffer() [0.54%] > > =E2=80=8BRegards, > > Olivier=E2=80=8B > --=20 Ermal From owner-svn-src-head@freebsd.org Mon Aug 3 15:19:18 2015 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 B64289AE6D9; Mon, 3 Aug 2015 15:19:18 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::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 3C0081574; Mon, 3 Aug 2015 15:19:18 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by lbbpo9 with SMTP id po9so5854539lbb.2; Mon, 03 Aug 2015 08:19:16 -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:content-type; bh=rl3GnZvQa1CobsHp2tkVh41EdrHALUG1GbY38efjBgE=; b=DJ258E/6kDzQmv9hhItAICf6oFFD/n1yM6gMVD1xj62qJiaoMLISNVzfaNzG5F+Rmf rjE5EuHDVhFsTMCwzlJ0uC3k8g6SzQ2/Yy3OP8bF+LxClbEC2dmg5TxMZMbVPhSfbJcJ GV/HuBgD0je2YEHZsn5fHcN/ZJ7lUrhIQNP0ubmgCuzLMRob9a6zMnVhpbZLheIvGcS/ FOwAuRcD9+NmPrUKXkYh5zCli5LqgaamlkwIjXpwPVdxx8vBaSSSpZ3hLc5EzikxWYZF lADnGpjid5DsExOf8sNxbifCPg0Sxe46X5Jeueu080LJffswzDBGNFlNCw5Z01/Y5zqG OJJg== X-Received: by 10.112.144.69 with SMTP id sk5mr17520842lbb.6.1438615156050; Mon, 03 Aug 2015 08:19:16 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.152.115.140 with HTTP; Mon, 3 Aug 2015 08:18:56 -0700 (PDT) In-Reply-To: References: <201507021810.t62IAgCc003272@repo.freebsd.org> <20150728124220.GW72729@FreeBSD.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Mon, 3 Aug 2015 17:18:56 +0200 X-Google-Sender-Auth: QJl1Dau44qHZ-MYgcPdA_gGwAKo Message-ID: Subject: Re: svn commit: r285051 - head/sys/netinet To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= Cc: Gleb Smirnoff , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 15:19:18 -0000 On Mon, Aug 3, 2015 at 5:05 PM, Ermal Lu=C3=A7i wrote: > Hello Olivier, > > its strange seeing so much contention on the arp tables on your PMC stats= . > Do you run ping(to prepopulate arp) or static arp to remove the noise fro= m > that interaction? > =E2=80=8BI'm using static ARP on my devices (and static MAC assignement on = switches too) during my benchs. =E2=80=8B > > Also do you run with flowtable active? > =E2=80=8BNo I didn't have "options FLOWTABLE" in my kernel. Regards, Olivier From owner-svn-src-head@freebsd.org Mon Aug 3 16:27:37 2015 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 3C7EB9B270B; Mon, 3 Aug 2015 16:27:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2D7B61E3F; Mon, 3 Aug 2015 16:27:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73GRb0R092226; Mon, 3 Aug 2015 16:27:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73GRbTB092225; Mon, 3 Aug 2015 16:27:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508031627.t73GRbTB092225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 16:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286234 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 16:27:37 -0000 Author: trasz Date: Mon Aug 3 16:27:36 2015 New Revision: 286234 URL: https://svnweb.freebsd.org/changeset/base/286234 Log: Fix a problem which made loader(8) load non-kld files twice. For example, without this patch, the following three lines in /boot/loader.conf would result in /boot/root.img being preloaded twice, and two md(4) devices - md0 and md1 - being created. initmd_load="YES" initmd_type="md_image" initmd_name="/boot/root.img" Reviewed by: marcel@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3204 Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Mon Aug 3 14:58:46 2015 (r286233) +++ head/sys/boot/common/module.c Mon Aug 3 16:27:36 2015 (r286234) @@ -102,6 +102,7 @@ COMMAND_SET(load, "load", "load a kernel static int command_load(int argc, char *argv[]) { + struct preloaded_file *fp; char *typestr; int dofile, dokld, ch, error; @@ -139,6 +140,13 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } + + fp = file_findfile(argv[1], typestr); + if (fp) { + sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + return (CMD_ERROR); + } + return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); } /* From owner-svn-src-head@freebsd.org Mon Aug 3 16:30:49 2015 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 3376B9B291C; Mon, 3 Aug 2015 16:30:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 24F64362; Mon, 3 Aug 2015 16:30:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73GUn0O092978; Mon, 3 Aug 2015 16:30:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73GUmBR092976; Mon, 3 Aug 2015 16:30:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508031630.t73GUmBR092976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 16:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286236 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 16:30:49 -0000 Author: trasz Date: Mon Aug 3 16:30:47 2015 New Revision: 286236 URL: https://svnweb.freebsd.org/changeset/base/286236 Log: Document vgonel(9). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile head/share/man/man9/vgone.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Aug 3 16:30:03 2015 (r286235) +++ head/share/man/man9/Makefile Mon Aug 3 16:30:47 2015 (r286236) @@ -1739,6 +1739,7 @@ MLINKS+=vfs_getopt.9 vfs_copyopt.9 \ vfs_getopt.9 vfs_setopt.9 \ vfs_getopt.9 vfs_setopt_part.9 \ vfs_getopt.9 vfs_setopts.9 +MLINKS+=vgone.9 vgonel.9 MLINKS+=vhold.9 vdrop.9 \ vhold.9 vdropl.9 \ vhold.9 vholdl.9 Modified: head/share/man/man9/vgone.9 ============================================================================== --- head/share/man/man9/vgone.9 Mon Aug 3 16:30:03 2015 (r286235) +++ head/share/man/man9/vgone.9 Mon Aug 3 16:30:47 2015 (r286236) @@ -37,6 +37,7 @@ .In sys/vnode.h .Ft void .Fn vgone "struct vnode *vp" +.Fn vgonel "struct vnode *vp" .Sh DESCRIPTION The .Fn vgone @@ -56,6 +57,11 @@ The .Fn vgone function takes an exclusively locked vnode, and returns with the vnode exclusively locked. +The +.Fn vgonel +differs from +.Fn vgone +by requiring the vnode interlock to be held. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS From owner-svn-src-head@freebsd.org Mon Aug 3 16:35:19 2015 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 3E3379B29CE; Mon, 3 Aug 2015 16:35:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2CE389D3; Mon, 3 Aug 2015 16:35:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73GZJse096310; Mon, 3 Aug 2015 16:35:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73GZJ5J096309; Mon, 3 Aug 2015 16:35:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508031635.t73GZJ5J096309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 16:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286237 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 16:35:19 -0000 Author: trasz Date: Mon Aug 3 16:35:18 2015 New Revision: 286237 URL: https://svnweb.freebsd.org/changeset/base/286237 Log: Fix panic that would happen on forcibly unmounting devfs (note that as it is now, devfs ignores MNT_FORCE anyway, so it needs to be modified to trigger the panic) with consumers still opened. Note that this still results in a leak of r/w/e counters. It seems to be harmless, though. If anyone knows a better way to approach this - please tell. Discussed with: kib@, mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3050 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Mon Aug 3 16:30:47 2015 (r286236) +++ head/sys/geom/geom_dev.c Mon Aug 3 16:35:18 2015 (r286237) @@ -401,6 +401,20 @@ g_dev_close(struct cdev *dev, int flags, #else e = 0; #endif + + /* + * The vgonel(9) - caused by eg. forced unmount of devfs - calls + * VOP_CLOSE(9) on devfs vnode without any FREAD or FWRITE flags, + * which would result in zero deltas, which in turn would cause + * panic in g_access(9). + * + * Note that we cannot zero the counters (ie. do "r = cp->acr" + * etc) instead, because the consumer might be opened in another + * devfs instance. + */ + if (r + w + e == 0) + return (EINVAL); + sc = cp->private; mtx_lock(&sc->sc_mtx); sc->sc_open += r + w + e; From owner-svn-src-head@freebsd.org Mon Aug 3 16:39:26 2015 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 D74109B2AA1; Mon, 3 Aug 2015 16:39:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C8A9BC1C; Mon, 3 Aug 2015 16:39:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73GdQ81096524; Mon, 3 Aug 2015 16:39:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73GdQrI096523; Mon, 3 Aug 2015 16:39:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508031639.t73GdQrI096523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 3 Aug 2015 16:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286238 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 16:39:26 -0000 Author: sbruno Date: Mon Aug 3 16:39:25 2015 New Revision: 286238 URL: https://svnweb.freebsd.org/changeset/base/286238 Log: A misplaced #endif in ixgbe_ioctl() causes interface MTU to become zero when INET and INET6 are undefined. PR: 162028 Differential Revision: https://reviews.freebsd.org/D3187 Submitted by: hoomanfazaeli@gmail.com pluknet Reviewed by: erj hiren gelbius MFC after: 2 weeks Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Aug 3 16:35:18 2015 (r286237) +++ head/sys/dev/ixgbe/if_ix.c Mon Aug 3 16:39:25 2015 (r286238) @@ -828,9 +828,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; - bool avoid_reset = FALSE; #endif int error = 0; + bool avoid_reset = FALSE; switch (command) { @@ -843,7 +843,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c if (ifa->ifa_addr->sa_family == AF_INET6) avoid_reset = TRUE; #endif -#if defined(INET) || defined(INET6) /* ** Calling init results in link renegotiation, ** so we avoid doing it when possible. @@ -852,11 +851,12 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixgbe_init(adapter); +#if defined(INET) if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); +#endif } else error = ether_ioctl(ifp, command, data); -#endif break; case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); From owner-svn-src-head@freebsd.org Mon Aug 3 17:19:09 2015 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 D92229B2768; Mon, 3 Aug 2015 17:19:09 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x231.google.com (mail-yk0-x231.google.com [IPv6:2607:f8b0:4002:c07::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 9642A11B0; Mon, 3 Aug 2015 17:19:09 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykdu72 with SMTP id u72so116104601ykd.2; Mon, 03 Aug 2015 10:19:08 -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:date:message-id:subject :from:to:cc:content-type; bh=brxDrrDyqQy7Sa1Ex/0icekjfq7XN+/qYXgaNjhxfGk=; b=IX3AwqeOmrLJ1zaYJYuKcChoK2ceWZbSPZxHyvM67icTYWKOAV8biwcHAgW406V3uY 9ZEDXt/b87IwlvQLfQlE22K4Rhsk4FAgfTEUYPHnc+quPJGu4s+epNt+sGWRu2KsV88t k7UunQQp+pfDYPnE2kDNuOY/LIsclUHGARJx9iakS04pYCUU/4HawZRB/ukK+PUh+HTM F8rRBeApqAUfuMtlB2j0ZWQW4rdBnFb0U8lpyg3ThbW7PUkR/wy0is9OoPrEXlyNr7HQ Ct9ycrElE0T1I/Ap15Mzyo0jwNHH2Vf39pZAq0vnsvXVTDCndkRCkUzSNJxKwQqtLcIH s6KQ== MIME-Version: 1.0 X-Received: by 10.170.98.84 with SMTP id p81mr22012303yka.128.1438622348741; Mon, 03 Aug 2015 10:19:08 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.83.139 with HTTP; Mon, 3 Aug 2015 10:19:08 -0700 (PDT) In-Reply-To: References: <201507021810.t62IAgCc003272@repo.freebsd.org> <20150728124220.GW72729@FreeBSD.org> Date: Mon, 3 Aug 2015 19:19:08 +0200 X-Google-Sender-Auth: SA-mB18T0RISWUy8MwNXJlZkoWc Message-ID: Subject: Re: svn commit: r285051 - head/sys/netinet From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Gleb Smirnoff , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 17:19:09 -0000 On Mon, Aug 3, 2015 at 5:18 PM, Olivier Cochard-Labb=C3=A9 wrote: > On Mon, Aug 3, 2015 at 5:05 PM, Ermal Lu=C3=A7i wrote: > >> Hello Olivier, >> >> its strange seeing so much contention on the arp tables on your PMC stat= s. >> Do you run ping(to prepopulate arp) or static arp to remove the noise >> from that interaction? >> > > =E2=80=8BI'm using static ARP on my devices (and static MAC assignement o= n > switches too) during my benchs. > Then you have to create static ARPs for all your pkt-gen ips :) > =E2=80=8B > > >> >> Also do you run with flowtable active? >> > > =E2=80=8BNo I didn't have "options FLOWTABLE" in my kernel. > > Regards, > > Olivier > > --=20 Ermal From owner-svn-src-head@freebsd.org Mon Aug 3 17:23:55 2015 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 67CF59B289F; Mon, 3 Aug 2015 17:23:55 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::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 E057C16D9; Mon, 3 Aug 2015 17:23:54 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by labsr2 with SMTP id sr2so16301950lab.2; Mon, 03 Aug 2015 10:23:52 -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:content-type; bh=0c2ultnNnatggeGr/e+OGQZXzV7bIV03tMfjusa+Ofc=; b=rpvGcNmka7h2Xrk7hLnMRGIVByz/zcmJj8g5pC8G3rfVG0Up0A3XR0zgS6OgzOnX8i 2Xdl2E4SYLfmDb6W/eRT4+W5nS/hvld69mrqxkg6WXDGzXsOhEGqzqxtY8ZPKcLB9tb7 4lZ2iyI2n7k4HsBjXXmc2FxYxAajgl8PWmOPcxC57Lk6JhNOdZxNMR654S9kbzYOe6YT MVvqXRqlS3Kcw9eoQpLxal+2VW6cSimSLj0gzy7GraI9k3H5yDYdLHDSAbN4lvCqkuxX ZCWWW+FECB984WaOvSd1XsbQvqI95TC2DtWqk40e6UrqSf7VzoXoaLBXkU/BKONtOmqP MXWg== X-Received: by 10.152.36.226 with SMTP id t2mr18120109laj.6.1438622632592; Mon, 03 Aug 2015 10:23:52 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.152.115.140 with HTTP; Mon, 3 Aug 2015 10:23:33 -0700 (PDT) In-Reply-To: References: <201507021810.t62IAgCc003272@repo.freebsd.org> <20150728124220.GW72729@FreeBSD.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Mon, 3 Aug 2015 19:23:33 +0200 X-Google-Sender-Auth: 95JGL1VvnX5GG4taWzuuNIvGrEo Message-ID: Subject: Re: svn commit: r285051 - head/sys/netinet To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= Cc: Gleb Smirnoff , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 17:23:55 -0000 On Mon, Aug 3, 2015 at 7:19 PM, Ermal Lu=C3=A7i wrote: > > > > On Mon, Aug 3, 2015 at 5:18 PM, Olivier Cochard-Labb=C3=A9 > wrote: > >> On Mon, Aug 3, 2015 at 5:05 PM, Ermal Lu=C3=A7i wrote: >> >>> Hello Olivier, >>> >>> its strange seeing so much contention on the arp tables on your PMC >>> stats. >>> Do you run ping(to prepopulate arp) or static arp to remove the noise >>> from that interaction? >>> >> >> =E2=80=8BI'm using static ARP on my devices (and static MAC assignement = on >> switches too) during my benchs. >> > > Then you have to create static ARPs for all your pkt-gen ips :) > =E2=80=8BNo because the static ARP entry correspond to a next-hop router=E2= =80=8B. And all destination IPs generated by pkt-gen are "behind" this next-hop. From owner-svn-src-head@freebsd.org Mon Aug 3 17:39:39 2015 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 6AB779B2CB4; Mon, 3 Aug 2015 17:39:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4FBCE1F8; Mon, 3 Aug 2015 17:39:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Hdd5v022645; Mon, 3 Aug 2015 17:39:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73HdboY022639; Mon, 3 Aug 2015 17:39:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508031739.t73HdboY022639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Aug 2015 17:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286241 - in head/sys/cddl/dev/fbt: . aarch64 arm powerpc x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 17:39:39 -0000 Author: markj Date: Mon Aug 3 17:39:36 2015 New Revision: 286241 URL: https://svnweb.freebsd.org/changeset/base/286241 Log: Remove a couple of unused fields from the FBT probe struct. Modified: head/sys/cddl/dev/fbt/aarch64/fbt_isa.c head/sys/cddl/dev/fbt/arm/fbt_isa.c head/sys/cddl/dev/fbt/fbt.h head/sys/cddl/dev/fbt/powerpc/fbt_isa.c head/sys/cddl/dev/fbt/x86/fbt_isa.c Modified: head/sys/cddl/dev/fbt/aarch64/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/aarch64/fbt_isa.c Mon Aug 3 17:02:36 2015 (r286240) +++ head/sys/cddl/dev/fbt/aarch64/fbt_isa.c Mon Aug 3 17:39:36 2015 (r286241) @@ -58,7 +58,6 @@ fbt_invop(uintptr_t addr, uintptr_t *sta for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - fbt->fbtp_invop_cnt++; cpu->cpu_dtrace_caller = addr; dtrace_probe(fbt->fbtp_id, frame->tf_x[0], Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Mon Aug 3 17:02:36 2015 (r286240) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Mon Aug 3 17:39:36 2015 (r286241) @@ -56,7 +56,6 @@ fbt_invop(uintptr_t addr, uintptr_t *sta for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - fbt->fbtp_invop_cnt++; cpu->cpu_dtrace_caller = addr; /* TODO: Need 5th parameter from stack */ Modified: head/sys/cddl/dev/fbt/fbt.h ============================================================================== --- head/sys/cddl/dev/fbt/fbt.h Mon Aug 3 17:02:36 2015 (r286240) +++ head/sys/cddl/dev/fbt/fbt.h Mon Aug 3 17:39:36 2015 (r286241) @@ -45,8 +45,6 @@ typedef struct fbt_probe { const char *fbtp_name; modctl_t *fbtp_ctl; int fbtp_loadcnt; - int fbtp_primary; - int fbtp_invop_cnt; int fbtp_symindx; struct fbt_probe *fbtp_next; } fbt_probe_t; Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon Aug 3 17:02:36 2015 (r286240) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon Aug 3 17:39:36 2015 (r286241) @@ -60,7 +60,6 @@ fbt_invop(uintptr_t addr, uintptr_t *sta for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - fbt->fbtp_invop_cnt++; if (fbt->fbtp_roffset == 0) { cpu->cpu_dtrace_caller = addr; Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/x86/fbt_isa.c Mon Aug 3 17:02:36 2015 (r286240) +++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Mon Aug 3 17:39:36 2015 (r286241) @@ -66,7 +66,6 @@ fbt_invop(uintptr_t addr, uintptr_t *sta for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - fbt->fbtp_invop_cnt++; if (fbt->fbtp_roffset == 0) { int i = 0; /* From owner-svn-src-head@freebsd.org Mon Aug 3 17:47:03 2015 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 84E5A9B2E79; Mon, 3 Aug 2015 17:47:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 712DD8AB; Mon, 3 Aug 2015 17:47:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Hl3fu026588; Mon, 3 Aug 2015 17:47:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Hl3SA026587; Mon, 3 Aug 2015 17:47:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508031747.t73Hl3SA026587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Aug 2015 17:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286242 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 17:47:03 -0000 Author: markj Date: Mon Aug 3 17:47:02 2015 New Revision: 286242 URL: https://svnweb.freebsd.org/changeset/base/286242 Log: The mbuf parameter to ip_output_pfil() must be an output parameter since pfil(9) hooks may modify the chain. X-MFC-With: r286028 Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Aug 3 17:39:36 2015 (r286241) +++ head/sys/netinet/ip_output.c Mon Aug 3 17:47:02 2015 (r286242) @@ -107,18 +107,21 @@ extern int in_mcast_loop; extern struct protosw inetsw[]; static inline int -ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, - struct sockaddr_in *dst, int *fibnum, int *error) +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, + struct sockaddr_in *dst, int *fibnum, int *error) { struct m_tag *fwd_tag = NULL; + struct mbuf *m; struct in_addr odst; struct ip *ip; + m = *mp; ip = mtod(m, struct ip *); /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - *error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); + *error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, inp); + m = *mp; if ((*error) != 0 || m == NULL) return 1; /* Finished */ @@ -552,7 +555,7 @@ sendit: /* Jump over all PFIL processing if hooks are not active. */ if (PFIL_HOOKED(&V_inet_pfil_hook)) { - switch (ip_output_pfil(m, ifp, inp, dst, &fibnum, &error)) { + switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, &error)) { case 1: /* Finished */ goto done; From owner-svn-src-head@freebsd.org Mon Aug 3 17:52:48 2015 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 AC3BD9B206A; Mon, 3 Aug 2015 17:52:48 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::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 50D72DF5; Mon, 3 Aug 2015 17:52:48 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by wibxm9 with SMTP id xm9so132259704wib.0; Mon, 03 Aug 2015 10:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PTZ4Cg7+RmKS7U+qj8HA/eM/SqbAuY26B3UyzNw8CFs=; b=j6y4J2BNQHFJcnDht2TVIKkoiZRIC02GojhUzlHBgHVxO0VWS2XB1eqUMltmaEV53z Di0QbFjB4hsy2fIfRrHgDSzQMFfq9UTJMudoMgKujXXfMXX01ycLCIf/+nPnPxndh9Mm TQoWOc/S1eZYOSoGgwT0S5bDV1zWBJR+SkiAVP+BOyt59YYWsI2y70BISXB9+86nYdRE LCd7pjNIbJ4u8OKfp0v2AGBmIj1BY9iHvzrIXjbZ23jRH8PaGitfiBH9YuDH1nHVmOXq Szc3Kfv+fvQWrQweAq6lD6zKjTxSYd5i9g9KEN8NlqmrQjMmyjvnMe+BMP9xtpssuUxV +F+g== MIME-Version: 1.0 X-Received: by 10.180.8.68 with SMTP id p4mr36296251wia.27.1438624366874; Mon, 03 Aug 2015 10:52:46 -0700 (PDT) Received: by 10.27.96.132 with HTTP; Mon, 3 Aug 2015 10:52:46 -0700 (PDT) In-Reply-To: <201508031630.t73GUmBR092976@repo.freebsd.org> References: <201508031630.t73GUmBR092976@repo.freebsd.org> Date: Mon, 3 Aug 2015 13:52:46 -0400 Message-ID: Subject: Re: svn commit: r286236 - head/share/man/man9 From: Benjamin Kaduk To: Edward Tomasz Napierala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 17:52:48 -0000 On Mon, Aug 3, 2015 at 12:30 PM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Aug 3 16:30:47 2015 > New Revision: 286236 > URL: https://svnweb.freebsd.org/changeset/base/286236 > > Log: > Document vgonel(9). > Er, isn't this a step backwards? % static void vgonel(struct vnode *); It is only accidental that anything outside vfs_subr.c can call vgonel(). -Ben From owner-svn-src-head@freebsd.org Mon Aug 3 17:56:17 2015 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 0ABD69B2122; Mon, 3 Aug 2015 17:56:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4590C10A3; Mon, 3 Aug 2015 17:56:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA26351; Mon, 03 Aug 2015 20:56:13 +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 1ZMJy8-000Bw5-Kz; Mon, 03 Aug 2015 20:56:13 +0300 Message-ID: <55BFAAEB.2020900@FreeBSD.org> Date: Mon, 03 Aug 2015 20:54:51 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Edward Tomasz Napierala , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r286234 - head/sys/boot/common References: <201508031627.t73GRbTB092225@repo.freebsd.org> In-Reply-To: <201508031627.t73GRbTB092225@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.20 Precedence: list List-Id: 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, 03 Aug 2015 17:56:17 -0000 On 03/08/2015 19:27, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Aug 3 16:27:36 2015 > New Revision: 286234 > URL: https://svnweb.freebsd.org/changeset/base/286234 > > Log: > Fix a problem which made loader(8) load non-kld files twice. What was the problem? The change looks like defensive coding, but it's not clear why the loader would attempt to load the same file more than once in the first place. > For example, without this patch, the following three lines > in /boot/loader.conf would result in /boot/root.img being preloaded > twice, and two md(4) devices - md0 and md1 - being created. > > initmd_load="YES" > initmd_type="md_image" > initmd_name="/boot/root.img" > > Reviewed by: marcel@ > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3204 > > Modified: > head/sys/boot/common/module.c > > Modified: head/sys/boot/common/module.c > ============================================================================== > --- head/sys/boot/common/module.c Mon Aug 3 14:58:46 2015 (r286233) > +++ head/sys/boot/common/module.c Mon Aug 3 16:27:36 2015 (r286234) > @@ -102,6 +102,7 @@ COMMAND_SET(load, "load", "load a kernel > static int > command_load(int argc, char *argv[]) > { > + struct preloaded_file *fp; > char *typestr; > int dofile, dokld, ch, error; > > @@ -139,6 +140,13 @@ command_load(int argc, char *argv[]) > command_errmsg = "invalid load type"; > return(CMD_ERROR); > } > + > + fp = file_findfile(argv[1], typestr); > + if (fp) { > + sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); > + return (CMD_ERROR); > + } > + > return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); > } > /* > -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 3 18:20:17 2015 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 6B9499B27B6; Mon, 3 Aug 2015 18:20:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::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 2A6E23A4; Mon, 3 Aug 2015 18:20:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qgeu79 with SMTP id u79so94854866qge.1; Mon, 03 Aug 2015 11:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BuNH9DGv5VBTu+6CGaCfNu3DTUxH0pxCnvUsSNtkWY8=; b=uxiF+m0YFvZuF7C5AvdkNAe/OltHt9rydV0Gpf1kvGun/VOEuzqYAVyrSP6RQDuG+X U7UTtRk9je/hdR8RKJauKXs9ARaFLzg0BfzOWDDci7RMMJGs3/aJw3Lx7sriCZRwQdbv eyYJH36zOIBfveLsBRdGwjx2p0lfXjTp5iH+wUP8+q+U8ENI08gow4kg5NeCwF9oHmpR pke0wh2Ok5YdblbFqbqGDIB7IeA7J0NjAxcMF6ypFo8/qXtThFx9z1OKRPqth+/QBnGM S+1B9U33qa8qbzqr8tYj5CuBX5pjxidTNZfMkVALfhxehFLGPvdzp+eREw2zQ10ce6RZ JoSw== MIME-Version: 1.0 X-Received: by 10.140.90.99 with SMTP id w90mr26474258qgd.57.1438626016326; Mon, 03 Aug 2015 11:20:16 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Mon, 3 Aug 2015 11:20:16 -0700 (PDT) In-Reply-To: <55BFAAEB.2020900@FreeBSD.org> References: <201508031627.t73GRbTB092225@repo.freebsd.org> <55BFAAEB.2020900@FreeBSD.org> Date: Mon, 3 Aug 2015 11:20:16 -0700 Message-ID: Subject: Re: svn commit: r286234 - head/sys/boot/common From: NGie Cooper To: Andriy Gapon Cc: Edward Tomasz Napierala , "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.20 Precedence: list List-Id: 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, 03 Aug 2015 18:20:17 -0000 On Mon, Aug 3, 2015 at 10:54 AM, Andriy Gapon wrote: > On 03/08/2015 19:27, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Mon Aug 3 16:27:36 2015 >> New Revision: 286234 >> URL: https://svnweb.freebsd.org/changeset/base/286234 >> >> Log: >> Fix a problem which made loader(8) load non-kld files twice. > > What was the problem? > The change looks like defensive coding, but it's not clear why the loader would > attempt to load the same file more than once in the first place. > >> For example, without this patch, the following three lines >> in /boot/loader.conf would result in /boot/root.img being preloaded >> twice, and two md(4) devices - md0 and md1 - being created. Repro was something like this IIRC: - Start module load. - Hit a key to interrupt the boot so it drops into the loader prompt. - Hit boot again. From owner-svn-src-head@freebsd.org Mon Aug 3 18:22:32 2015 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 0D4869B28EE; Mon, 3 Aug 2015 18:22:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 F2DB19FA; Mon, 3 Aug 2015 18:22:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73IMVKe042759; Mon, 3 Aug 2015 18:22:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73IMVri042758; Mon, 3 Aug 2015 18:22:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508031822.t73IMVri042758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 3 Aug 2015 18:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286243 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 18:22:32 -0000 Author: loos Date: Mon Aug 3 18:22:31 2015 New Revision: 286243 URL: https://svnweb.freebsd.org/changeset/base/286243 Log: Add a KASSERT() to make sure we wont rotate the buffers twice (rotate the buffers while the hold buffer is in use). Suggested by: ed, ghelmer MFC with: r286142 Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Aug 3 17:47:02 2015 (r286242) +++ head/sys/net/bpf.c Mon Aug 3 18:22:31 2015 (r286243) @@ -2412,6 +2412,7 @@ catchpacket(struct bpf_d *d, u_char *pkt ++d->bd_dcount; return; } + KASSERT(!d->bd_hbuf_in_use, ("hold buffer is in use")); ROTATE_BUFFERS(d); do_wakeup = 1; curlen = 0; From owner-svn-src-head@freebsd.org Mon Aug 3 18:45:42 2015 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 665AF9B2E53; Mon, 3 Aug 2015 18:45:42 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::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 07859164B; Mon, 3 Aug 2015 18:45:42 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by lbqc9 with SMTP id c9so57359037lbq.1; Mon, 03 Aug 2015 11:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0jr4Q5Q6bSnWsrODk9LPNXYQTRAlC1KHTlqo9aQ0DRY=; b=yNW7L0vR9RC4oKU+pv5a/TRpKdPvi9hdZkdA7bNeju7/j8RNUM5x/pskWPeGDd0zJ1 +PXNSJ+F+5PZEpQFRXK/T9ahEsNMpU4hxNqBOcPswfnNwRJAu5NwXM6RnHDHL0qoNOMw ft5Zr5v+5WBkU83ZjNfSrf1t4ISoPJszKWacoyNi1dQVRSNXqahmZBjb0KAURHTJ5o0+ fbn+C/tD/Kn3l3e2+mQr0DjyA3oRDtNvJ0Z2yDrr7CkuHiuqHaxUIql+jG5QHgtX3D+i ArZKyUelo277pQC63782v+VkcGRiVI2shoyl4B34sA9siXucffc5lFnu2GY0K15vawX4 pWUg== MIME-Version: 1.0 X-Received: by 10.152.181.34 with SMTP id dt2mr18291579lac.84.1438627539930; Mon, 03 Aug 2015 11:45:39 -0700 (PDT) Received: by 10.152.112.170 with HTTP; Mon, 3 Aug 2015 11:45:39 -0700 (PDT) In-Reply-To: References: <201507312143.t6VLhSBm046797@repo.freebsd.org> Date: Mon, 3 Aug 2015 15:45:39 -0300 Message-ID: Subject: Re: svn commit: r286142 - head/sys/net From: Luiz Otavio O Souza To: Guy Helmer Cc: Ed Schouten , Luiz Otavio O Souza , 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.20 Precedence: list List-Id: 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, 03 Aug 2015 18:45:42 -0000 On Sat, Aug 1, 2015 at 6:02 PM, Guy Helmer wrote: > >> On Aug 1, 2015, at 4:50 AM, Ed Schouten wrote: >> >> Hi Luiz, >> >> 2015-07-31 23:43 GMT+02:00 Luiz Otavio O Souza : >>> - while (d->bd_hbuf_in_use) >>> - mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, >>> - PRINET, "bd_hbuf", 0); >> >> Would it make sense to replace them by an assertion, instead of >> omitting them entirely? >> >> KASSERT(!d->bd_hbuf_in_use, ("...")); > > I would appreciate the confidence that would provide. > > Guy Yeah, I agree. The KASSERT() makes the code even easier to understand. Note that only one KASSERT() is needed here, because to other case is specific to zero-copy buffers and the zero-copy buffers cannot be read with read(2) and this way they never set the in use flag for the hold buffer. Committed in r286243. Thanks! Luiz From owner-svn-src-head@freebsd.org Mon Aug 3 18:47:46 2015 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 5B6BE9B2E89; Mon, 3 Aug 2015 18:47:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2E9311927; Mon, 3 Aug 2015 18:47:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73Ilkgo051007; Mon, 3 Aug 2015 18:47:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Ilk0g051006; Mon, 3 Aug 2015 18:47:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508031847.t73Ilk0g051006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Aug 2015 18:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286244 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 18:47:46 -0000 Author: bapt Date: Mon Aug 3 18:47:45 2015 New Revision: 286244 URL: https://svnweb.freebsd.org/changeset/base/286244 Log: Remove never used file Obtained from: DragonFlyBSD Deleted: head/usr.bin/vgrind/vgrindefs.c From owner-svn-src-head@freebsd.org Mon Aug 3 19:36:06 2015 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 7E94F9B2C3E; Mon, 3 Aug 2015 19:36:06 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E99ACA8; Mon, 3 Aug 2015 19:36:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t73JZtUs090735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 3 Aug 2015 12:35:59 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Konstantin Belousov , Steven Hartland References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> Cc: Peter Wemm , svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org From: Julian Elischer Message-ID: <55BFC296.5050402@freebsd.org> Date: Tue, 4 Aug 2015 03:35:50 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150803120359.GC2072@kib.kiev.ua> 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.20 Precedence: list List-Id: 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, 03 Aug 2015 19:36:06 -0000 On 8/3/15 8:03 PM, Konstantin Belousov wrote: > On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >> For this change I don't want to get into fixing the thread0 stack size, >> which can be done later, just >> to provide a reasonable warning to the user that smaller values could >> cause a panic. > Hmm, is it limited to the thread0 only ? I.e., would only increasing > the initial thread stack size be enough to boot the kernel ? The zfs > threads do request larger stack size, I know this. > > Can somebody test the following patch in the i386 configuration which > does not boot ? I think this is a reasonable thing to do. Thread0 (and proc0) are special. I don't see why giving it a specially sized stack would be a problem. From owner-svn-src-head@freebsd.org Mon Aug 3 19:44:17 2015 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 B5E979B2E94; Mon, 3 Aug 2015 19:44:17 +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 6EE1A11DB; Mon, 3 Aug 2015 19:44:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMLee-0002zv-TY; Mon, 03 Aug 2015 22:44:12 +0300 Date: Mon, 3 Aug 2015 22:44:12 +0300 From: Slawa Olhovchenkov To: Julian Elischer Cc: Konstantin Belousov , Steven Hartland , Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803194412.GC8792@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BFC296.5050402@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 03 Aug 2015 19:44:17 -0000 On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: > On 8/3/15 8:03 PM, Konstantin Belousov wrote: > > On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: > >> For this change I don't want to get into fixing the thread0 stack size, > >> which can be done later, just > >> to provide a reasonable warning to the user that smaller values could > >> cause a panic. > > Hmm, is it limited to the thread0 only ? I.e., would only increasing > > the initial thread stack size be enough to boot the kernel ? The zfs > > threads do request larger stack size, I know this. > > > > Can somebody test the following patch in the i386 configuration which > > does not boot ? > > I think this is a reasonable thing to do. Thread0 (and proc0) are special. > I don't see why giving it a specially sized stack would be a problem. This is always do for ARM. May be need increase stack size for Thread0 on ARM too? From owner-svn-src-head@freebsd.org Mon Aug 3 20:30:28 2015 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 AA4439B2BA8; Mon, 3 Aug 2015 20:30:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9B6BC16D5; Mon, 3 Aug 2015 20:30:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73KUSNu094537; Mon, 3 Aug 2015 20:30:28 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73KUScF094536; Mon, 3 Aug 2015 20:30:28 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508032030.t73KUScF094536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 3 Aug 2015 20:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286255 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 20:30:28 -0000 Author: alc Date: Mon Aug 3 20:30:27 2015 New Revision: 286255 URL: https://svnweb.freebsd.org/changeset/base/286255 Log: Refinements to r281079's sequential access optimization: Prefetched pages, which constitute the majority of the pages that are processed by vm_fault_dontneed(), are already near the tail of the inactive queue. Only the pages at faulting virtual addresses are actually moved by vm_page_advise(..., MADV_DONTNEED). However, vm_page_advise(..., MADV_DONTNEED) is simultaneously too aggressive and passive for the moved pages. It makes most of these pages too easily reclaimable, and at the same time it leaves enough pages in the active queue to trigger pageouts by the page daemon. Instead, with this change, the pages at faulting virtual addresses are moved to the tail of the inactive queue, where they are relatively close to the pages prefetched by the same page fault. Discussed with: jeff Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Aug 3 19:15:19 2015 (r286254) +++ head/sys/vm/vm_fault.c Mon Aug 3 20:30:27 2015 (r286255) @@ -1081,9 +1081,19 @@ vm_fault_dontneed(const struct faultstat if (m->valid != VM_PAGE_BITS_ALL || vm_page_busied(m)) continue; + + /* + * Don't clear PGA_REFERENCED, since it would + * likely represent a reference by a different + * process. + * + * Typically, at this point, prefetched pages + * are still in the inactive queue. Only + * pages that triggered page faults are in the + * active queue. + */ vm_page_lock(m); - if (m->hold_count == 0 && m->wire_count == 0) - vm_page_advise(m, MADV_DONTNEED); + vm_page_deactivate(m); vm_page_unlock(m); } } From owner-svn-src-head@freebsd.org Mon Aug 3 20:43:37 2015 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 85D459B2F51; Mon, 3 Aug 2015 20:43:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5DC84150; Mon, 3 Aug 2015 20:43:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73KhbpE001920; Mon, 3 Aug 2015 20:43:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73Kha3U001918; Mon, 3 Aug 2015 20:43:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508032043.t73Kha3U001918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Aug 2015 20:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286256 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 20:43:37 -0000 Author: jhb Date: Mon Aug 3 20:43:36 2015 New Revision: 286256 URL: https://svnweb.freebsd.org/changeset/base/286256 Log: kgdb uses td_oncpu to determine if a thread is running and should use a pcb from stoppcbs[] rather than the thread's PCB. However, exited threads retained td_oncpu from the last time they ran, and newborn threads had their CPU fields cleared to zero during fork and thread creation since they are in the set of fields zeroed when threads are setup. To fix, explicitly update the CPU fields for exiting threads in sched_throw() to reflect the switch out and reset the CPU fields for new threads in sched_fork_thread() to NOCPU. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3193 Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Mon Aug 3 20:30:27 2015 (r286255) +++ head/sys/kern/sched_4bsd.c Mon Aug 3 20:43:36 2015 (r286256) @@ -792,6 +792,8 @@ sched_fork_thread(struct thread *td, str { struct td_sched *ts; + childtd->td_oncpu = NOCPU; + childtd->td_lastcpu = NOCPU; childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); @@ -1671,6 +1673,8 @@ sched_throw(struct thread *td) } else { lock_profile_release_lock(&sched_lock.lock_object); MPASS(td->td_lock == &sched_lock); + td->td_lastcpu = td->td_oncpu; + td->td_oncpu = NOCPU; } mtx_assert(&sched_lock, MA_OWNED); KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Aug 3 20:30:27 2015 (r286255) +++ head/sys/kern/sched_ule.c Mon Aug 3 20:43:36 2015 (r286256) @@ -2080,6 +2080,8 @@ sched_fork_thread(struct thread *td, str */ ts = td->td_sched; ts2 = child->td_sched; + child->td_oncpu = NOCPU; + child->td_lastcpu = NOCPU; child->td_lock = TDQ_LOCKPTR(tdq); child->td_cpuset = cpuset_ref(td->td_cpuset); ts2->ts_cpu = ts->ts_cpu; @@ -2703,6 +2705,8 @@ sched_throw(struct thread *td) MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); + td->td_lastcpu = td->td_oncpu; + td->td_oncpu = NOCPU; } KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); From owner-svn-src-head@freebsd.org Mon Aug 3 20:48:30 2015 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 E34889B2FF7 for ; Mon, 3 Aug 2015 20:48:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) (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 ACF9232E for ; Mon, 3 Aug 2015 20:48:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by iggf3 with SMTP id f3so63765136igg.1 for ; Mon, 03 Aug 2015 13:48:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=iC5jIbldLi5cQBQsOFtp+aW9nShZi8UGOWBpemhBBto=; b=ixa3EZH8/oD6MRFowKWebzApOWwDeFEXd/3NTTUhFa/oAGbol5vd2NiDILCuC9FCpb 8CdbJmcyi4T5QXRe9wlDNxS1UjElQ9qDx0MspX9GdURXjvqq5LphZT3WWJmJ170swGmz v2jiXBMp+UrWX5TTrdspjLoOtJLRfl/2LcSwaMWhbh50YzhSQRC7Zrib+6qSXML5rzaY iOVszMyOS/Vef4FZ2nmRBi7jpGANXmCJroIvA/jHHPQAdceU50XG5zDVIOpQfhNTXNMX Nyua4KjaHtOM3YWUR9NWnY/qb1mO5w7d9pYpoakfINh/XrodXYw2FP4jAIQSxBkD30RV Qgmw== X-Gm-Message-State: ALoCoQnkt0qRul+ps7HtC5HCtvXGGDmhZy5GfecuR7IjHCSM+FQPWbIq8aNUxf+J7E06nKHfkUCa X-Received: by 10.50.134.226 with SMTP id pn2mr105873igb.21.1438634903636; Mon, 03 Aug 2015 13:48:23 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id j20sm6549669igt.5.2015.08.03.13.48.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Aug 2015 13:48:22 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BD7BC49E-7BE6-4953-8F11-265F5F97268C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <20150803194412.GC8792@zxy.spb.ru> Date: Mon, 3 Aug 2015 14:48:21 -0600 Cc: Julian Elischer , Konstantin Belousov , Steven Hartland , Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Message-Id: References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 20:48:30 -0000 --Apple-Mail=_BD7BC49E-7BE6-4953-8F11-265F5F97268C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: >=20 > On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: >=20 >> On 8/3/15 8:03 PM, Konstantin Belousov wrote: >>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >>>> For this change I don't want to get into fixing the thread0 stack = size, >>>> which can be done later, just >>>> to provide a reasonable warning to the user that smaller values = could >>>> cause a panic. >>> Hmm, is it limited to the thread0 only ? I.e., would only = increasing >>> the initial thread stack size be enough to boot the kernel ? The = zfs >>> threads do request larger stack size, I know this. >>>=20 >>> Can somebody test the following patch in the i386 configuration = which >>> does not boot ? >>=20 >> I think this is a reasonable thing to do. Thread0 (and proc0) are = special. >> I don't see why giving it a specially sized stack would be a problem. >=20 > This is always do for ARM. > May be need increase stack size for Thread0 on ARM too? Seems reasonable. There should be a MI way of doing this, but all the = code and defines are buried in MD files, so each architecture needs some = love to make this a reality. Warner --Apple-Mail=_BD7BC49E-7BE6-4953-8F11-265F5F97268C 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 iQIcBAEBCgAGBQJVv9OWAAoJEGwc0Sh9sBEA+68QAOzKsh8S8HmwZPEX6KsvT4Pe PHqRL0tSxzdwAukfIUG/x46pi7EMTo6ME+xs6M/W+3OFZErBJkG/u908N8M/yPHe h/twZxjq6wiJ/mPnM3Sf+J5tY9JuWJe45VgFOQkqdBdNdbRCj/IhIPoDDUB2EvS1 rG+wKcC4IheJTKLcgtYM0g9sWXy9FtLtR8trr4QabpfvFgq+Ud2KsNtyY0vgSOAK hyeiUuy0ctb0FRMjMM4dV1lFguBT994EgrfWx6KhH5BCOX4xyMgWSHLSsrwjzvCV ZSvpWS44K1KFN+ctIrhEBIUloAXHm+xQ2HrVaw2r/KbsmW62WytaJhHcqmxEWlEM v3XahxsCiUKHnFZGSqDE3MiT8IR4NJzcTvyYUksfFKaalFOIcQ+wC83TQCjDGzig 5ldT3ciSoIbHYSXRNegd+QL2+tYSifBYf60252ZT77KepqbTrUOTsitaSAXMhnJN 0V1dxNDH6oqII+JphlktYsSefPi5yNKfcOHOoTu+XQkI4E3L2FftT83eYEusM5G9 fJ0X0LxLs8V8LV1TAgN18A7ivpJeFsS7l33u7t96sOU9K0GOMBdOYnXgQ0JPJ5eF X9gb2X0ePvNXi++qhZdbuD7JeXgVYqyWoOyJytMh/OKVAd259nfQdoPzpxAnDjR5 +ZMsvrHlvBf9ZxbX1AsW =PgYt -----END PGP SIGNATURE----- --Apple-Mail=_BD7BC49E-7BE6-4953-8F11-265F5F97268C-- From owner-svn-src-head@freebsd.org Mon Aug 3 21:11:34 2015 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 EC3769B26E5; Mon, 3 Aug 2015 21:11:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DD78C16D1; Mon, 3 Aug 2015 21:11:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73LBYY4014439; Mon, 3 Aug 2015 21:11:34 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73LBYlS014436; Mon, 3 Aug 2015 21:11:34 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508032111.t73LBYlS014436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 21:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286257 - 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.20 Precedence: list List-Id: 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, 03 Aug 2015 21:11:35 -0000 Author: ed Date: Mon Aug 3 21:11:33 2015 New Revision: 286257 URL: https://svnweb.freebsd.org/changeset/base/286257 Log: Add missing const keyword to function parameter. The umtx_key_get() function does not dereference the address off the userspace object. The pointer can safely be const. Modified: head/sys/kern/kern_umtx.c head/sys/sys/umtx.h Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Aug 3 20:43:36 2015 (r286256) +++ head/sys/kern/kern_umtx.c Mon Aug 3 21:11:33 2015 (r286257) @@ -793,7 +793,7 @@ umtxq_sleep(struct umtx_q *uq, const cha * Convert userspace address into unique logical address. */ int -umtx_key_get(void *addr, int type, int share, struct umtx_key *key) +umtx_key_get(const void *addr, int type, int share, struct umtx_key *key) { struct thread *td = curthread; vm_map_t map; Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Mon Aug 3 20:43:36 2015 (r286256) +++ head/sys/sys/umtx.h Mon Aug 3 21:11:33 2015 (r286257) @@ -153,7 +153,7 @@ umtx_key_match(const struct umtx_key *k1 } int umtx_copyin_timeout(const void *, struct timespec *); -int umtx_key_get(void *, int, int, struct umtx_key *); +int umtx_key_get(const void *, int, int, struct umtx_key *); void umtx_key_release(struct umtx_key *); struct umtx_q *umtxq_alloc(void); void umtxq_free(struct umtx_q *); From owner-svn-src-head@freebsd.org Mon Aug 3 21:19:32 2015 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 B859B9B289F; Mon, 3 Aug 2015 21:19:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A17371BE7; Mon, 3 Aug 2015 21:19:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73LJWaD014831; Mon, 3 Aug 2015 21:19:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73LJWWI014830; Mon, 3 Aug 2015 21:19:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201508032119.t73LJWWI014830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 3 Aug 2015 21:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286258 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 21:19:32 -0000 Author: dteske Date: Mon Aug 3 21:19:31 2015 New Revision: 286258 URL: https://svnweb.freebsd.org/changeset/base/286258 Log: Clarify pw(8) manual w/respect to required arguments. Break long lines at punctuation while here. Differential Revision: https://reviews.freebsd.org/D2700 Reviewed by: wblock, bapt MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Mon Aug 3 21:11:33 2015 (r286257) +++ head/usr.sbin/pw/pw.8 Mon Aug 3 21:19:31 2015 (r286258) @@ -35,11 +35,9 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar useradd -.Op name|uid +.Oo Fl n Oc name Oo Fl u Ar uid Oc .Op Fl C Ar config .Op Fl q -.Op Fl n Ar name -.Op Fl u Ar uid .Op Fl c Ar comment .Op Fl d Ar dir .Op Fl e Ar date @@ -61,7 +59,6 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar useradd -.Op name|uid .Fl D .Op Fl C Ar config .Op Fl q @@ -81,27 +78,23 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar userdel -.Op name|uid -.Op Fl n Ar name -.Op Fl u Ar uid +.Oo Fl n Oc name|uid | Fl u Ar uid .Op Fl r .Op Fl Y .Nm .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar usermod -.Op name|uid +.Oo Fl n Oc name|uid Oo Fl u Ar newuid Oc | Fl u Ar uid .Op Fl C Ar config .Op Fl q -.Op Fl n Ar name -.Op Fl u Ar uid .Op Fl c Ar comment .Op Fl d Ar dir .Op Fl e Ar date .Op Fl p Ar date .Op Fl g Ar group .Op Fl G Ar grouplist -.Op Fl l Ar name +.Op Fl l Ar newname .Op Fl m .Op Fl M Ar mode .Op Fl k Ar dir @@ -116,9 +109,7 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar usershow -.Op name|uid -.Op Fl n Ar name -.Op Fl u Ar uid +.Oo Fl n Oc name|uid | Fl u Ar uid .Op Fl F .Op Fl P .Op Fl 7 @@ -133,11 +124,9 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupadd -.Op group|gid +.Oo Fl n Oc name Oo Fl g Ar gid Oc .Op Fl C Ar config .Op Fl q -.Op Fl n Ar group -.Op Fl g Ar gid .Op Fl M Ar members .Op Fl o .Op Fl h Ar fd | Fl H Ar fd @@ -148,20 +137,16 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupdel -.Op group|gid -.Op Fl n Ar name -.Op Fl g Ar gid +.Oo Fl n Oc name|gid | Fl g Ar gid .Op Fl Y .Nm .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupmod -.Op group|gid +.Oo Fl n Oc name|gid Oo Fl g Ar newgid Oc | Fl g Ar gid .Op Fl C Ar config .Op Fl q -.Op Fl n Ar name -.Op Fl g Ar gid -.Op Fl l Ar name +.Op Fl l Ar newname .Op Fl M Ar members .Op Fl m Ar newmembers .Op Fl d Ar oldmembers @@ -173,9 +158,7 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar groupshow -.Op group|gid -.Op Fl n Ar name -.Op Fl g Ar gid +.Oo Fl n Oc name|gid | Fl g Ar gid .Op Fl F .Op Fl P .Op Fl a @@ -189,14 +172,14 @@ .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar lock -.Op name|uid +.Oo Fl n Oc name|uid | Fl u Ar uid .Op Fl C Ar config .Op Fl q .Nm .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Ar unlock -.Op name|uid +.Oo Fl n Oc name|uid | Fl u Ar uid .Op Fl C Ar config .Op Fl q .Sh DESCRIPTION @@ -250,8 +233,9 @@ all mean the same thing.) This flexibility is useful for interactive scripts calling .Nm for user and group database manipulation. -Following these keywords, you may optionally specify the user or group name or numeric -id as an alternative to using the +Following these keywords, +the user or group name or numeric id may be optionally specified as an +alternative to using the .Fl n Ar name , .Fl u Ar uid , .Fl g Ar gid @@ -266,12 +250,13 @@ will operate. Any paths specified will be relative to .Va rootdir . .It Fl V Ar etcdir -This flag sets an alternate location for the password, group and configuration files, -and may be used to maintain a user/group database in an alternate location. +Set an alternate location for the password, group, and configuration files. +Can be used to maintain a user/group database in an alternate location. If this switch is specified, the system .Pa /etc/pw.conf -will not be sourced for default configuration data, but the file pw.conf in the -specified directory will be used instead (or none, if it does not exist). +will not be sourced for default configuration data, +but the file pw.conf in the specified directory will be used instead +.Pq or none, if it does not exist . The .Fl C flag may be used to override this behaviour. @@ -294,7 +279,8 @@ configuration file. .It Fl q Use of this option causes .Nm -to suppress error messages, which may be useful in interactive environments where it +to suppress error messages, +which may be useful in interactive environments where it is preferable to interpret status codes returned by .Nm rather than messing up a carefully formatted display. @@ -338,27 +324,40 @@ and .Ar usermod commands: .Bl -tag -width "-G grouplist" -.It Fl n Ar name +.It Oo Fl n Oc Ar name +Required unless +.Fl u Ar uid +is given. Specify the user/account name. +In the case of +.Ar usermod +can be a uid. .It Fl u Ar uid +Required if +.Ar name +is not given. Specify the user/account numeric id. -.Pp -Usually, you only need to provide one or the other of these options, as the account -name will imply the uid, or vice versa. -However, there are times when you need to provide both. +In the case of +.Ar usermod +if paired with +.Ar name , +changes the numeric id of the named user/account. +.Pp +Usually, only one of these options is required, +as the account name will imply the uid, or vice versa. +However, there are times when both are needed. For example, when changing the uid of an existing user with .Ar usermod , -or overriding the default uid when creating a new account. -If you wish -.Nm -to automatically allocate the uid to a new user with +or overriding the default uid when creating a new account with +.Ar useradd . +To automatically allocate the uid to a new user with .Ar useradd , -then you should +then do .Em not use the .Fl u option. -You may also provide either the account or userid immediately after the +Either the account or userid can also be provided immediately after the .Ar useradd , .Ar userdel , .Ar usermod @@ -372,21 +371,23 @@ options. .El .Bl -tag -width "-G grouplist" .It Fl c Ar comment -This field sets the contents of the passwd GECOS field, which normally contains up -to four comma-separated fields containing the user's full name, office or location, +This field sets the contents of the passwd GECOS field, +which normally contains up to four comma-separated fields containing the +user's full name, office or location, and work and home phone numbers. These sub-fields are used by convention only, however, and are optional. -If this field is to contain spaces, you need to quote the comment itself with double -quotes +If this field is to contain spaces, +the comment must be enclosed in double quotes .Ql \&" . -Avoid using commas in this field as these are used as sub-field separators, and the -colon +Avoid using commas in this field as these are used as sub-field separators, +and the colon .Ql \&: character also cannot be used as this is the field separator for the passwd file itself. .It Fl d Ar dir This option sets the account's home directory. -Normally, you will only use this if the home directory is to be different from the +Normally, +this is only used if the home directory is to be different from the default determined from .Pa /etc/pw.conf - normally @@ -396,13 +397,15 @@ with the account name as a subdirectory. Set the account's expiration date. Format of the date is either a UNIX time in decimal, or a date in .Ql dd-mmm-yy[yy] -format, where dd is the day, mmm is the month, either in numeric or alphabetic format +format, where dd is the day, +mmm is the month, either in numeric or alphabetic format ('Jan', 'Feb', etc) and year is either a two or four digit year. This option also accepts a relative date in the form .Ql \&+n[mhdwoy] where .Ql \&n -is a decimal, octal (leading 0) or hexadecimal (leading 0x) digit followed by the +is a decimal, +octal (leading 0) or hexadecimal (leading 0x) digit followed by the number of Minutes, Hours, Days, Weeks, Months or Years from the current date at which the expiration date is to be set. .It Fl p Ar date @@ -442,8 +445,8 @@ This option instructs to attempt to create the user's home directory. While primarily useful when adding a new account with .Ar useradd , -this may also be of use when moving an existing user's home directory elsewhere on -the file system. +this may also be of use when moving an existing user's home directory elsewhere +on the file system. The new home directory is populated with the contents of the .Ar skeleton directory, which typically contains a set of shell configuration files that the @@ -461,7 +464,8 @@ existing configuration files in the user .Em not overwritten from the skeleton files. .Pp -When a user's home directory is created, it will by default be a subdirectory of the +When a user's home directory is created, +it will by default be a subdirectory of the .Ar basehome directory as specified by the .Fl b @@ -599,10 +603,13 @@ The default value for this is but it may be set elsewhere as desired. .It Fl e Ar days Set the default account expiration period in days. -Unlike use without -.Fl D , -the argument must be numeric, which specifies the number of days after creation when -the account is to expire. +When +.Fl D +is used, the +.Ar days +argument is interpreted differently. +It must be numeric and represents the number of days after creation +that the account expires. A value of 0 suppresses automatic calculation of the expiry date. .It Fl p Ar days Set the default password expiration period in days. @@ -615,8 +622,8 @@ with the same name as their login name. If a group is supplied, either its name or uid may be given as an argument. .It Fl G Ar grouplist Set the default groups in which new users are granted membership. -This is a separate set of groups from the primary group, and you should avoid -nominating the same group as both primary and extra groups. +This is a separate set of groups from the primary group. +Avoid nominating the same group as both primary and extra groups. In other words, these extra groups determine membership in groups .Em other than the primary group. @@ -630,7 +637,8 @@ This option sets the default login class .It Fl k Ar dir Set the default .Em skeleton -directory, from which prototype shell and other initialization files are copied when +directory, +from which prototype shell and other initialization files are copied when .Nm creates a user's home directory. See description of @@ -640,22 +648,24 @@ for naming conventions of these files. .Fl u Ar min , Ns Ar max , .Fl i Ar min , Ns Ar max .Xc -These options set the minimum and maximum user and group ids allocated for new accounts -and groups created by +Set the minimum and maximum user and group ids allocated for new +accounts and groups created by .Nm . The default values for each is 1000 minimum and 32000 maximum. .Ar min and .Ar max -are both numbers, where max must be greater than min, and both must be between 0 -and 32767. -In general, user and group ids less than 100 are reserved for use by the system, -and numbers greater than 32000 may also be reserved for special purposes (used by -some system daemons). +are both numbers, where max must be greater than min, +and both must be between 0 and 32767. +In general, +user and group ids less than 100 are reserved for use by the system, +and numbers greater than 32000 may also be reserved for special purposes +.Pq used by some system daemons . .It Fl w Ar method The .Fl w -option sets the default method used to set passwords for newly created user accounts. +option selects the default method used to set passwords for newly created user +accounts. .Ar method is one of: .Pp @@ -676,9 +686,11 @@ or .Ql \&no methods are the most secure; in the former case, .Nm -generates a password and prints it to stdout, which is suitable where you issue -users with passwords to access their accounts rather than having the user nominate -their own (possibly poorly chosen) password. +generates a password and prints it to stdout, +which is suitable when users are issued passwords rather than being allowed +to select their own +.Pq possibly poorly chosen +password. The .Ql \&no method requires that the superuser use @@ -699,7 +711,7 @@ servers. .Pp The .Ar userdel -command has only three valid options. +command has three distinct options. The .Fl n Ar name and @@ -714,7 +726,8 @@ to remove the user's home directory and The .Nm utility errs on the side of caution when removing files from the system. -Firstly, it will not do so if the uid of the account being removed is also used by +Firstly, +it will not do so if the uid of the account being removed is also used by another account on the system, and the 'home' directory in the password file is a valid path that commences with the character .Ql \&/ . @@ -725,20 +738,20 @@ will be removed. If any additional cleanup work is required, this is left to the administrator. .El .Pp -Mail spool files and crontabs are always removed when an account is deleted as these -are unconditionally attached to the user name. +Mail spool files and crontabs are always removed when an account is deleted as +these are unconditionally attached to the user name. Jobs queued for processing by .Ar at -are also removed if the user's uid is unique and not also used by another account on the -system. +are also removed if the user's uid is unique and not also used by another +account on the system. .Pp The .Ar usermod command adds one additional option: .Bl -tag -width "-G grouplist" -.It Fl l Ar name +.It Fl l Ar newname This option allows changing of an existing account name to -.Ql \&name . +.Ql \&newname . The new name must not already exist, and any attempt to duplicate an existing account name will be rejected. .El @@ -782,10 +795,24 @@ options (explained at the start of the p with the group manipulation commands. Other common options to all group-related commands are: .Bl -tag -width "-m newmembers" -.It Fl n Ar name +.It Oo Fl n Oc Ar name +Required unless +.Fl g Ar gid +is given. Specify the group name. +In the case of +.Ar groupmod +can be a gid. .It Fl g Ar gid +Required if +.Ar name +is not given. Specify the group numeric id. +In the case of +.Ar groupmod +if paired with +.Ar name , +changes the numeric id of the named group. .Pp As with the account name and id fields, you will usually only need to supply one of these, as the group name implies the uid and vice @@ -822,18 +849,19 @@ silently eliminated. also has a .Fl o option that allows allocation of an existing group id to a new group. -The default action is to reject an attempt to add a group, and this option overrides -the check for duplicate group ids. +The default action is to reject an attempt to add a group, +and this option overrides the check for duplicate group ids. There is rarely any need to duplicate a group id. .Pp The .Ar groupmod command adds one additional option: .Bl -tag -width "-m newmembers" -.It Fl l Ar name +.It Fl l Ar newname This option allows changing of an existing group name to -.Ql \&name . -The new name must not already exist, and any attempt to duplicate an existing group +.Ql \&newname . +The new name must not already exist, +and any attempt to duplicate an existing group name will be rejected. .El .Pp From owner-svn-src-head@freebsd.org Mon Aug 3 22:07:51 2015 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 7520D9B23E2; Mon, 3 Aug 2015 22:07:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5968B1517; Mon, 3 Aug 2015 22:07:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73M7pVs034881; Mon, 3 Aug 2015 22:07:51 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73M7oUF034879; Mon, 3 Aug 2015 22:07:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508032207.t73M7oUF034879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 22:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286259 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 22:07:51 -0000 Author: ed Date: Mon Aug 3 22:07:50 2015 New Revision: 286259 URL: https://svnweb.freebsd.org/changeset/base/286259 Log: Avoid calling strlen() where we can use the strspn() return value. Modified: head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Mon Aug 3 21:19:31 2015 (r286258) +++ head/usr.sbin/pw/pw_group.c Mon Aug 3 22:07:50 2015 (r286259) @@ -297,7 +297,7 @@ pw_group_show(int argc, char **argv, cha }; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, GID_MAX); else name = arg1; @@ -360,7 +360,7 @@ pw_group_del(int argc, char **argv, char bool nis = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, GID_MAX); else name = arg1; @@ -491,7 +491,7 @@ pw_group_add(int argc, char **argv, char quiet = precrypted = dryrun = pretty = nis = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, GID_MAX); else name = arg1; @@ -577,7 +577,7 @@ pw_group_mod(int argc, char **argv, char quiet = pretty = dryrun = nis = precrypted = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, GID_MAX); else name = arg1; Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Aug 3 21:19:31 2015 (r286258) +++ head/usr.sbin/pw/pw_user.c Mon Aug 3 22:07:50 2015 (r286259) @@ -214,7 +214,7 @@ pw_userlock(char *arg1, int mode) if (arg1 == NULL) errx(EX_DATAERR, "username or id required"); - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, UID_MAX); else name = arg1; @@ -709,7 +709,7 @@ pw_user_show(int argc, char **argv, char bool quiet = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, UID_MAX); else name = arg1; @@ -793,7 +793,7 @@ pw_user_del(int argc, char **argv, char bool quiet = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, UID_MAX); else name = arg1; @@ -1124,7 +1124,7 @@ pw_user_add(int argc, char **argv, char err(EXIT_FAILURE, "calloc()"); if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, UID_MAX); else name = arg1; @@ -1435,7 +1435,7 @@ pw_user_mod(int argc, char **argv, char edited = docreatehome = false; if (arg1 != NULL) { - if (strspn(arg1, "0123456789") == strlen(arg1)) + if (arg1[strspn(arg1, "0123456789")] == '\0') id = pw_checkid(arg1, UID_MAX); else name = arg1; From owner-svn-src-head@freebsd.org Mon Aug 3 22:14:46 2015 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 2312E9B2570; Mon, 3 Aug 2015 22:14:46 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1189D1A7C; Mon, 3 Aug 2015 22:14:46 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73MEjVe038795; Mon, 3 Aug 2015 22:14:45 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73MEjW1038794; Mon, 3 Aug 2015 22:14:45 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508032214.t73MEjW1038794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 3 Aug 2015 22:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286260 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 03 Aug 2015 22:14:46 -0000 Author: loos Date: Mon Aug 3 22:14:45 2015 New Revision: 286260 URL: https://svnweb.freebsd.org/changeset/base/286260 Log: Remove the mtx_sleep() from the kqueue f_event filter. The filter is called from the network hot path and must not sleep. The filter runs with the descriptor lock held and does not manipulates the buffers, so it is not necessary sleep when the hold buffer is in use. Just ignore the hold buffer contents when it is being copied to user space (when hold buffer in use is set). This fix the "Sleeping thread owns a non-sleepable lock" panic when the userland thread is too busy reading the packets from bpf(4). PR: 200323 MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Aug 3 22:07:50 2015 (r286259) +++ head/sys/net/bpf.c Mon Aug 3 22:14:45 2015 (r286260) @@ -2035,10 +2035,10 @@ filt_bpfread(struct knote *kn, long hint ready = bpf_ready(d); if (ready) { kn->kn_data = d->bd_slen; - while (d->bd_hbuf_in_use) - mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, - PRINET, "bd_hbuf", 0); - if (d->bd_hbuf) + /* + * Ignore the hold buffer if it is being copied to user space. + */ + if (!d->bd_hbuf_in_use && d->bd_hbuf) kn->kn_data += d->bd_hlen; } else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { callout_reset(&d->bd_callout, d->bd_rtout, From owner-svn-src-head@freebsd.org Tue Aug 4 00:11:40 2015 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 D22EE9B2979; Tue, 4 Aug 2015 00:11:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C42638EA; Tue, 4 Aug 2015 00:11:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t740BewC088015; Tue, 4 Aug 2015 00:11:40 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t740BeD3088014; Tue, 4 Aug 2015 00:11:40 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201508040011.t740BeD3088014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 4 Aug 2015 00:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286265 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 00:11:40 -0000 Author: jkim Date: Tue Aug 4 00:11:39 2015 New Revision: 286265 URL: https://svnweb.freebsd.org/changeset/base/286265 Log: Always define __va_list for amd64 and restore pre-r232261 behavior for i386. Note it allows exotic compilers, e.g., TCC, to build with our stdio.h, etc. PR: 201749 MFC after: 1 week Modified: head/sys/x86/include/_types.h Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Tue Aug 4 00:11:38 2015 (r286264) +++ head/sys/x86/include/_types.h Tue Aug 4 00:11:39 2015 (r286265) @@ -152,8 +152,17 @@ typedef int ___wchar_t; */ #ifdef __GNUCLIKE_BUILTIN_VARARGS typedef __builtin_va_list __va_list; /* internally known to gcc */ -#elif defined(lint) -typedef char * __va_list; /* pretend */ +#else +#ifdef __LP64__ +typedef struct { + unsigned int __gpo; + unsigned int __fpo; + void *__oaa; + void *__rsa; +} __va_list; +#else +typedef char * __va_list; +#endif #endif #if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ && !defined(__NO_GNUC_VA_LIST) From owner-svn-src-head@freebsd.org Tue Aug 4 02:34:52 2015 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 A32629AFCF9; Tue, 4 Aug 2015 02:34:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 890BF864; Tue, 4 Aug 2015 02:34:52 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t742YqVg045449; Tue, 4 Aug 2015 02:34:52 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t742YqQA045448; Tue, 4 Aug 2015 02:34:52 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508040234.t742YqQA045448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 4 Aug 2015 02:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286266 - head/usr.bin/ypmatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 02:34:52 -0000 Author: araujo (ports committer) Date: Tue Aug 4 02:34:51 2015 New Revision: 286266 URL: https://svnweb.freebsd.org/changeset/base/286266 Log: Remove the 3rd clause of BSD LICENSE. Sync the code with the OpenBSD version. Differential Revision: D3213 Reviewed by: rodrigc, bapt Obtained from: OpenBSD Sponsored by: gandi.net Modified: head/usr.bin/ypmatch/ypmatch.c Modified: head/usr.bin/ypmatch/ypmatch.c ============================================================================== --- head/usr.bin/ypmatch/ypmatch.c Tue Aug 4 00:11:39 2015 (r286265) +++ head/usr.bin/ypmatch/ypmatch.c Tue Aug 4 02:34:51 2015 (r286266) @@ -1,5 +1,8 @@ +/* $OpenBSD: ypmatch.c,v 1.16 2015/02/08 23:40:35 deraadt Exp $ */ +/* $NetBSD: ypmatch.c,v 1.8 1996/05/07 01:24:52 jtc Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt + * Copyright (c) 1992, 1993, 1996 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,9 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,18 +34,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +void usage(void); static const struct ypalias { char *alias, *name; @@ -62,30 +63,37 @@ static const struct ypalias { { "ethers", "ethers.byname" }, }; -static void +void usage(void) { - fprintf(stderr, "%s\n%s\n", - "usage: ypmatch [-kt] [-d domainname] key ... mapname", - " ypmatch -x"); + fprintf(stderr, + "usage: ypmatch [-kt] [-d domain] key ... mapname\n" + " ypmatch -x\n"); + fprintf(stderr, + "where\n" + "\tmapname may be either a mapname or a nickname for a map.\n" + "\t-k prints keys as well as values.\n" + "\t-t inhibits map nickname translation.\n" + "\t-x dumps the map nickname translation table.\n"); exit(1); } int main(int argc, char *argv[]) { - char *domainname = NULL; - char *inkey, *inmap, *outbuf; - int outbuflen, key, notrans; + char *domainname, *inkey, *inmap, *outbuf; + extern char *optarg; + extern int optind; + int outbuflen, key, notrans, rval; int c, r; u_int i; + domainname = NULL; notrans = key = 0; - - while ((c = getopt(argc, argv, "xd:kt")) != -1) + while ((c=getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i = 0; i 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 36AFA9AFE78; Tue, 4 Aug 2015 02:41:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 23740B85; Tue, 4 Aug 2015 02:41:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t742fFNu048173; Tue, 4 Aug 2015 02:41:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t742fFDi048172; Tue, 4 Aug 2015 02:41:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508040241.t742fFDi048172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 4 Aug 2015 02:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286267 - head/usr.bin/ypcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 02:41:15 -0000 Author: araujo (ports committer) Date: Tue Aug 4 02:41:14 2015 New Revision: 286267 URL: https://svnweb.freebsd.org/changeset/base/286267 Log: Remove the 3rd clause of BSD LICENSE. Sync the code with the OpenBSD version. Small style(9) fix up. Differential Revision: D3212 Reviewed by: rodrigc, bapt Obtained from: OpenBSD Sponsored by: gandi.net Modified: head/usr.bin/ypcat/ypcat.c Modified: head/usr.bin/ypcat/ypcat.c ============================================================================== --- head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:34:51 2015 (r286266) +++ head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:41:14 2015 (r286267) @@ -1,5 +1,7 @@ +/* $OpenBSD: ypcat.c,v 1.16 2015/02/08 23:40:35 deraadt Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt + * Copyright (c) 1992, 1993, 1996 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,9 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,18 +33,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include +void usage(void); +int printit(u_long, char *, int, char *, int, void *); static const struct ypalias { char *alias, *name; @@ -64,17 +65,18 @@ static const struct ypalias { static int key; -static void +void usage(void) { - fprintf(stderr, "%s\n%s\n", - "usage: ypcat [-kt] [-d domainname] mapname", - " ypcat -x"); + fprintf(stderr, + "usage: ypcat [-kt] [-d domainname] mapname\n" + " ypcat -x\n"); exit(1); } -static int -printit(unsigned long instatus, char *inkey, int inkeylen, char *inval, int invallen, void *dummy __unused) +int +printit(u_long instatus, char *inkey, int inkeylen, char *inval, int invallen, + void *indata) { if (instatus != YP_TRUE) return (instatus); @@ -87,31 +89,29 @@ printit(unsigned long instatus, char *in int main(int argc, char *argv[]) { - char *domainname = NULL; + char *domain = NULL, *inmap; struct ypall_callback ypcb; - char *inmap; - int notrans; - int c, r; + extern char *optarg; + extern int optind; + int notrans, c, r; u_int i; notrans = key = 0; - while ((c = getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i = 0; i 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 F14C99B213D; Tue, 4 Aug 2015 02:56:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E2B3111A3; Tue, 4 Aug 2015 02:56:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t742uWKg053687; Tue, 4 Aug 2015 02:56:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t742uWfQ053686; Tue, 4 Aug 2015 02:56:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508040256.t742uWfQ053686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 4 Aug 2015 02:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286268 - head/usr.bin/wall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 02:56:33 -0000 Author: pfg Date: Tue Aug 4 02:56:31 2015 New Revision: 286268 URL: https://svnweb.freebsd.org/changeset/base/286268 Log: Revert r286144 leaving the original fix to the buffer overflow. Some developers consider the new code unnecessarily obfuscated. There was also a benign off-by-one. Discussed with: bde, vangyzen, jmallett Modified: head/usr.bin/wall/ttymsg.c Modified: head/usr.bin/wall/ttymsg.c ============================================================================== --- head/usr.bin/wall/ttymsg.c Tue Aug 4 02:41:14 2015 (r286267) +++ head/usr.bin/wall/ttymsg.c Tue Aug 4 02:56:31 2015 (r286268) @@ -62,7 +62,7 @@ ttymsg(struct iovec *iov, int iovcnt, co struct iovec localiov[7]; ssize_t left, wret; int cnt, fd; - char device[MAXNAMLEN]; + char device[MAXNAMLEN] = _PATH_DEV; static char errbuf[1024]; char *p; int forked; @@ -71,9 +71,8 @@ ttymsg(struct iovec *iov, int iovcnt, co if (iovcnt > (int)(sizeof(localiov) / sizeof(localiov[0]))) return ("too many iov's (change code in wall/ttymsg.c)"); - strlcpy(device, _PATH_DEV, sizeof(device)); + strlcat(device, line, sizeof(device)); p = device + sizeof(_PATH_DEV) - 1; - strlcpy(p, line, sizeof(device) - sizeof(_PATH_DEV)); if (strncmp(p, "pts/", 4) == 0) p += 4; if (strchr(p, '/') != NULL) { From owner-svn-src-head@freebsd.org Tue Aug 4 04:15:04 2015 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 F2F199B334C; Tue, 4 Aug 2015 04:15:04 +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 68A991FF; Tue, 4 Aug 2015 04:15:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t744EwKw068425 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 07:14:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t744EwKw068425 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t744EwIw068424; Tue, 4 Aug 2015 07:14:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Aug 2015 07:14:58 +0300 From: Konstantin Belousov To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286265 - head/sys/x86/include Message-ID: <20150804041458.GF2072@kib.kiev.ua> References: <201508040011.t740BeD3088014@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508040011.t740BeD3088014@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 04:15:05 -0000 On Tue, Aug 04, 2015 at 12:11:40AM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue Aug 4 00:11:39 2015 > New Revision: 286265 > URL: https://svnweb.freebsd.org/changeset/base/286265 > > Log: > Always define __va_list for amd64 and restore pre-r232261 behavior for i386. > Note it allows exotic compilers, e.g., TCC, to build with our stdio.h, etc. > > PR: 201749 > MFC after: 1 week > > Modified: > head/sys/x86/include/_types.h > > Modified: head/sys/x86/include/_types.h > ============================================================================== > --- head/sys/x86/include/_types.h Tue Aug 4 00:11:38 2015 (r286264) > +++ head/sys/x86/include/_types.h Tue Aug 4 00:11:39 2015 (r286265) > @@ -152,8 +152,17 @@ typedef int ___wchar_t; > */ > #ifdef __GNUCLIKE_BUILTIN_VARARGS > typedef __builtin_va_list __va_list; /* internally known to gcc */ > -#elif defined(lint) > -typedef char * __va_list; /* pretend */ > +#else > +#ifdef __LP64__ > +typedef struct { > + unsigned int __gpo; > + unsigned int __fpo; > + void *__oaa; > + void *__rsa; > +} __va_list; What do the structure fields mean ? How is it related to the amd64 vararg ABI ? > +#else > +typedef char * __va_list; > +#endif > #endif > #if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ > && !defined(__NO_GNUC_VA_LIST) From owner-svn-src-head@freebsd.org Tue Aug 4 04:16:56 2015 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 54C2D9B3381; Tue, 4 Aug 2015 04:16:56 +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 BB548389; Tue, 4 Aug 2015 04:16:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t744GoM3069569 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 07:16:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t744GoM3069569 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t744GouI069568; Tue, 4 Aug 2015 07:16:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Aug 2015 07:16:50 +0300 From: Konstantin Belousov To: Benjamin Kaduk Cc: Edward Tomasz Napierala , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286236 - head/share/man/man9 Message-ID: <20150804041650.GG2072@kib.kiev.ua> References: <201508031630.t73GUmBR092976@repo.freebsd.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-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.20 Precedence: list List-Id: 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, 04 Aug 2015 04:16:56 -0000 On Mon, Aug 03, 2015 at 01:52:46PM -0400, Benjamin Kaduk wrote: > On Mon, Aug 3, 2015 at 12:30 PM, Edward Tomasz Napierala > wrote: > > > Author: trasz > > Date: Mon Aug 3 16:30:47 2015 > > New Revision: 286236 > > URL: https://svnweb.freebsd.org/changeset/base/286236 > > > > Log: > > Document vgonel(9). > > > > Er, isn't this a step backwards? > > % static void vgonel(struct vnode *); > > It is only accidental that anything outside vfs_subr.c can call vgonel(). Indeed, only kernel modules on some architectures could use a hole in the kernel linker to reference vgonel(). The kernel itself cannot call vgonel() outside vfs_subr.c. There is no point in putting vgonel(9) in the man page. From owner-svn-src-head@freebsd.org Tue Aug 4 04:24:23 2015 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 A474A9B34CF; Tue, 4 Aug 2015 04:24:23 +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 16F559D9; Tue, 4 Aug 2015 04:24:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t744OAjp070779 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 07:24:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t744OAjp070779 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t744OAkr070778; Tue, 4 Aug 2015 07:24:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Aug 2015 07:24:10 +0300 From: Konstantin Belousov To: Benjamin Kaduk Cc: Edward Tomasz Napierala , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286236 - head/share/man/man9 Message-ID: <20150804042410.GH2072@kib.kiev.ua> References: <201508031630.t73GUmBR092976@repo.freebsd.org> <20150804041650.GG2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150804041650.GG2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 04:24:23 -0000 On Tue, Aug 04, 2015 at 07:16:50AM +0300, Konstantin Belousov wrote: > On Mon, Aug 03, 2015 at 01:52:46PM -0400, Benjamin Kaduk wrote: > > On Mon, Aug 3, 2015 at 12:30 PM, Edward Tomasz Napierala > > wrote: > > > > > Author: trasz > > > Date: Mon Aug 3 16:30:47 2015 > > > New Revision: 286236 > > > URL: https://svnweb.freebsd.org/changeset/base/286236 > > > > > > Log: > > > Document vgonel(9). > > > > > > > Er, isn't this a step backwards? > > > > % static void vgonel(struct vnode *); > > > > It is only accidental that anything outside vfs_subr.c can call vgonel(). > Indeed, only kernel modules on some architectures could use a hole in > the kernel linker to reference vgonel(). The kernel itself cannot call > vgonel() outside vfs_subr.c. There is no point in putting vgonel(9) in > the man page. I believe the source of the confusion is the vgonel() definition, which lacks the static qualifier. I propose to remove vgonel(9) reference from the man page and add static to definition. Might be, a review of all functions in vfs_*.c and fixing their missed qualifiers would be useful. From owner-svn-src-head@freebsd.org Tue Aug 4 05:05:04 2015 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 A72D39B3B67; Tue, 4 Aug 2015 05:05:04 +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 6E89BB35; Tue, 4 Aug 2015 05:05:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id A525AD484C1; Tue, 4 Aug 2015 15:04:54 +1000 (AEST) Date: Tue, 4 Aug 2015 15:04:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286265 - head/sys/x86/include In-Reply-To: <20150804041458.GF2072@kib.kiev.ua> Message-ID: <20150804143613.H896@besplex.bde.org> References: <201508040011.t740BeD3088014@repo.freebsd.org> <20150804041458.GF2072@kib.kiev.ua> 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=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=ICcVLtZI1gsGk6wz9OEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 05:05:04 -0000 On Tue, 4 Aug 2015, Konstantin Belousov wrote: > On Tue, Aug 04, 2015 at 12:11:40AM +0000, Jung-uk Kim wrote: >> Log: >> Always define __va_list for amd64 and restore pre-r232261 behavior for i386. >> Note it allows exotic compilers, e.g., TCC, to build with our stdio.h, etc. Thanks. >> PR: 201749 >> MFC after: 1 week >> >> Modified: >> head/sys/x86/include/_types.h >> >> Modified: head/sys/x86/include/_types.h >> ============================================================================== >> --- head/sys/x86/include/_types.h Tue Aug 4 00:11:38 2015 (r286264) >> +++ head/sys/x86/include/_types.h Tue Aug 4 00:11:39 2015 (r286265) >> @@ -152,8 +152,17 @@ typedef int ___wchar_t; >> */ >> #ifdef __GNUCLIKE_BUILTIN_VARARGS >> typedef __builtin_va_list __va_list; /* internally known to gcc */ >> -#elif defined(lint) >> -typedef char * __va_list; /* pretend */ >> +#else >> +#ifdef __LP64__ >> +typedef struct { >> + unsigned int __gpo; >> + unsigned int __fpo; >> + void *__oaa; >> + void *__rsa; >> +} __va_list; Ugh. This is ugly and has many excical style bugs: - tab in 'typedef struct' - use of 'typedef struct' at all. style(9) forbids this. structs should be declared with a tag and the used directly. That means '#define __va_list struct __s_va_list' here - verbose spelling of 'unsigned' - ugly indentation from previous - excessive underscores in struct member names. Only names in outer scope need 2 underscores and . See stdio.h. > What do the structure fields mean ? How is it related to the amd64 vararg > ABI ? It seems ABI compatible, but perhaps not API compatible. The double underscores in the names might be to match an API. But I doubt that old compilers even support the __LP64__ case. The certainly don't access these names in any FreeBSD header. So the ABI could be matched by defining __va_list as an array of 3 uint64_t's or as a struct with unnamed fields or padding. >> +#else >> +typedef char * __va_list; This still has the '*' misplaced. >> +#endif >> #endif >> #if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ >> && !defined(__NO_GNUC_VA_LIST) Is this uglyness still necessary? The gnu-style '&&' in it isn't. This seems to be for very old versions of gcc that probably don't have builtin varargs. In old versions of this file, the condition defined(__GNUC_VA_LIST_COMPATIBILITY) was defined(__GNUC__) && !defined(__INTEL_COMPILER__), so I think this ifdef is just for defining something used in old gcc's distribution stdarg.h. The __INTEL_COMPILER__ part of this makes no sense, and __GNUC_VA_LIST_COMPATIBILITY is now just an obfuscated spelling of __GNUC__. Since this is for old gcc internals, non-gcc compilers are unlikely to need it for compatibility, so the obfuscation is just wrong. Bruce From owner-svn-src-head@freebsd.org Tue Aug 4 05:33:14 2015 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 DBFD29B20E4; Tue, 4 Aug 2015 05:33:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 886FF19B6; Tue, 4 Aug 2015 05:33:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 8855D1A248B; Tue, 4 Aug 2015 15:33:05 +1000 (AEST) Date: Tue, 4 Aug 2015 15:33:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcelo Araujo cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286267 - head/usr.bin/ypcat In-Reply-To: <201508040241.t742fFDi048172@repo.freebsd.org> Message-ID: <20150804150500.C896@besplex.bde.org> References: <201508040241.t742fFDi048172@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ItbjC+Lg c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=CgiagczvAAAA:8 a=DayoRurDc5bhoHBYV1gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 05:33:15 -0000 On Tue, 4 Aug 2015, Marcelo Araujo wrote: > Log: > Remove the 3rd clause of BSD LICENSE. > Sync the code with the OpenBSD version. > Small style(9) fix up. This has many style(9) fix downs. > Differential Revision: D3212 > Reviewed by: rodrigc, bapt > Obtained from: OpenBSD > Sponsored by: gandi.net > > Modified: > head/usr.bin/ypcat/ypcat.c > > Modified: head/usr.bin/ypcat/ypcat.c > ============================================================================== > --- head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:34:51 2015 (r286266) > +++ head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:41:14 2015 (r286267) > @@ -34,18 +33,20 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > +#include > +#include > +#include > +#include > > #include > #include > -#include > +#include > #include > > -#include > -#include > -#include > -#include > -#include > -#include Unsorting. The old organization was almost perfect except for including both sys/types and sys/param.h. Now there isn't even a blank line separating one pair of the 3 groupes of headers. > +void usage(void); > +int printit(u_long, char *, int, char *, int, void *); Unsorted declarations. Lost staticization. usage() was misplaced early in the file, so that since it was static, it didn't need a forward declaration, except style(9) requires one. usage() is its main example. > > static const struct ypalias { > char *alias, *name; > @@ -64,17 +65,18 @@ static const struct ypalias { > > static int key; > > -static void > +void Lost staticization. > usage(void) > { > - fprintf(stderr, "%s\n%s\n", > - "usage: ypcat [-kt] [-d domainname] mapname", > - " ypcat -x"); > + fprintf(stderr, > + "usage: ypcat [-kt] [-d domainname] mapname\n" > + " ypcat -x\n"); This fixes the indentation, but breaks the string using C90 string concatenation. style(9) doesn't specify using the "%s\n%s\n..." for printing multiple strings on multiple line by example, but almost all FreeBSD utilities including the old version of this one provide an example of this. > exit(1); > } > > -static int > -printit(unsigned long instatus, char *inkey, int inkeylen, char *inval, int invallen, void *dummy __unused) > +int > +printit(u_long instatus, char *inkey, int inkeylen, char *inval, int invallen, > + void *indata) Lost staticization. > { > if (instatus != YP_TRUE) > return (instatus); > @@ -87,31 +89,29 @@ printit(unsigned long instatus, char *in > int > main(int argc, char *argv[]) > { > - char *domainname = NULL; > + char *domain = NULL, *inmap; > struct ypall_callback ypcb; > - char *inmap; > - int notrans; > - int c, r; > + extern char *optarg; > + extern int optind; Extern declarations belong in a header file. Broken programs sometimes declare them directly to hide the bug that they don't include the correct header file, but this program still includes the correct header file (unistd.h>). Compilers are directed to warn about nested externs at a not very high WARNS. > + int notrans, c, r; Combining the declaration is good, but the variables are still unsorted. > u_int i; > > notrans = key = 0; > - > while ((c = getopt(argc, argv, "xd:kt")) != -1) > switch (c) { > case 'x': > - for (i = 0; i + for (i=0; i ... > @@ -120,24 +120,29 @@ main(int argc, char *argv[]) > if (optind + 1 != argc) > usage(); > > - if (!domainname) > - yp_get_default_domain(&domainname); > + if (!domain) > + yp_get_default_domain(&domain); Still uses '!' on pointers. > > inmap = argv[optind]; > - for (i = 0; (!notrans) && i - if (strcmp(inmap, ypaliases[i].alias) == 0) > - inmap = ypaliases[i].name; > + if (!notrans) { > + for (i=0; i case YPERR_YPBIND: > - errx(1, "not running ypbind"); > + errx(1, "ypcat: not running ypbind\n"); > + exit(1); Large regressions. Now the program name is printed twice, and the newline at the end of the message is printed twice, and there are 2 exits, with the new one unreachable. > default: > - errx(1, "no such map %s. reason: %s", inmap, yperr_string(r)); > + errx(1, "No such map %s. Reason: %s\n", > + inmap, yperr_string(r)); > + exit(1); As above, except the program name is not printed twice, plus - the first word after the program name is now capitalized. This is part of a sentence beginning with the program name and a colon. There are various style guides for capitilization after a colon. FreeBSD uses the following inconsistent rules in error messages: - don't capitalize - however, if the error message is from strerror(), then it capitalizes. Keep this. - the spacing and phrasing for the second sentence is not so good and is not improved by capitalization. It is more normal to use further punctuation in the same sentence. > } > exit(0); > } Bruce From owner-svn-src-head@freebsd.org Tue Aug 4 06:01:14 2015 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 A766B9B2951; Tue, 4 Aug 2015 06:01:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 965836D7; Tue, 4 Aug 2015 06:01:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7461E8C030677; Tue, 4 Aug 2015 06:01:14 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7461EQG030676; Tue, 4 Aug 2015 06:01:14 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508040601.t7461EQG030676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 4 Aug 2015 06:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286277 - 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.20 Precedence: list List-Id: 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, 04 Aug 2015 06:01:14 -0000 Author: ed Date: Tue Aug 4 06:01:13 2015 New Revision: 286277 URL: https://svnweb.freebsd.org/changeset/base/286277 Log: Fix bad arithmetic in umtx_key_get() to compute object offset. It looks like umtx_key_get() has the addition and subtraction the wrong way around, meaning that it fails to match in certain cases. This causes the cloudlibc unit tests to deadlock in certain cases. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3287 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Tue Aug 4 05:18:24 2015 (r286276) +++ head/sys/kern/kern_umtx.c Tue Aug 4 06:01:13 2015 (r286277) @@ -820,8 +820,8 @@ umtx_key_get(const void *addr, int type, (share == AUTO_SHARE && VM_INHERIT_SHARE == entry->inheritance)) { key->shared = 1; - key->info.shared.offset = entry->offset + entry->start - - (vm_offset_t)addr; + key->info.shared.offset = (vm_offset_t)addr - + entry->start + entry->offset; vm_object_reference(key->info.shared.object); } else { key->shared = 0; From owner-svn-src-head@freebsd.org Tue Aug 4 06:02:04 2015 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 A11AF9B2986; Tue, 4 Aug 2015 06:02:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8F1CC9C9; Tue, 4 Aug 2015 06:02:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74624jT031414; Tue, 4 Aug 2015 06:02:04 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74624YJ031413; Tue, 4 Aug 2015 06:02:04 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508040602.t74624YJ031413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 4 Aug 2015 06:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286278 - head/sys/compat/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.20 Precedence: list List-Id: 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, 04 Aug 2015 06:02:04 -0000 Author: ed Date: Tue Aug 4 06:02:03 2015 New Revision: 286278 URL: https://svnweb.freebsd.org/changeset/base/286278 Log: Let the CloudABI futex code use umtx_keys. The CloudABI kernel still passes all of the cloudlibc unit tests. Reviewed by: vangyzen Differential Revision: https://reviews.freebsd.org/D3286 Modified: head/sys/compat/cloudabi/cloudabi_futex.c Modified: head/sys/compat/cloudabi/cloudabi_futex.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_futex.c Tue Aug 4 06:01:13 2015 (r286277) +++ head/sys/compat/cloudabi/cloudabi_futex.c Tue Aug 4 06:02:03 2015 (r286278) @@ -35,13 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include -#include -#include -#include -#include -#include +#include #include #include @@ -105,13 +99,7 @@ struct futex_waiter; /* Identifier of a location in memory. */ struct futex_address { - /* For process-private objects: address space of the process. */ - struct vmspace * fa_vmspace; - /* For process-shared objects: VM object containing the object. */ - struct vm_object * fa_vmobject; - - /* Memory address within address space or offset within VM object. */ - uintptr_t fa_offset; + struct umtx_key fa_key; }; /* A set of waiting threads. */ @@ -225,61 +213,16 @@ static int futex_address_create(struct futex_address *fa, struct thread *td, const void *object, cloudabi_mflags_t scope) { - struct vmspace *vs; - struct vm_object *vo; - vm_map_t map; - vm_map_entry_t entry; - vm_pindex_t pindex; - vm_prot_t prot; - boolean_t wired; - /* - * Most of the time objects are stored in privately mapped - * anonymous memory. For these objects we wouldn't need to look - * up the corresponding VM object. The scope hint provided by - * userspace allows us to skip the VM map lookup for the common - * case. - * - * POSIX does permit enabling PTHREAD_PROCESS_SHARED on a lock - * stored in a private mapping, at the cost of additional - * performance overhead. Fall back to identifying the object by - * virtual memory address if the mapping isn't shared. - */ - vs = td->td_proc->p_vmspace; + KASSERT(td == curthread, + ("Can only create umtx keys for the current thread")); switch (scope) { - case CLOUDABI_MAP_SHARED: - map = &vs->vm_map; - if (vm_map_lookup(&map, (vm_offset_t)object, - VM_PROT_COPY | VM_PROT_WRITE, &entry, &vo, &pindex, &prot, - &wired) != KERN_SUCCESS) - return (EFAULT); - - if (entry->inheritance == VM_INHERIT_SHARE) { - /* - * Address corresponds to a shared mapping. - * Identify the address by its VM object. - */ - fa->fa_vmspace = NULL; - fa->fa_vmobject = vo; - vm_object_reference(vo); - fa->fa_offset = entry->offset - entry->start + - (vm_offset_t)object; - vm_map_lookup_done(map, entry); - return (0); - } - vm_map_lookup_done(map, entry); - /* FALLTHROUGH */ case CLOUDABI_MAP_PRIVATE: - /* - * Address corresponds to a private mapping. Never - * identify the address by its VM object, as shadow - * objects may get inserted if another thread forks. - * Simply use the VM space instead. - */ - fa->fa_vmspace = vs; - fa->fa_vmobject = NULL; - fa->fa_offset = (uintptr_t)object; - return (0); + return (umtx_key_get(object, TYPE_FUTEX, THREAD_SHARE, + &fa->fa_key)); + case CLOUDABI_MAP_SHARED: + return (umtx_key_get(object, TYPE_FUTEX, AUTO_SHARE, + &fa->fa_key)); default: return (EINVAL); } @@ -289,8 +232,7 @@ static void futex_address_free(struct futex_address *fa) { - if (fa->fa_vmobject != NULL) - vm_object_deallocate(fa->fa_vmobject); + umtx_key_release(&fa->fa_key); } static bool @@ -298,10 +240,7 @@ futex_address_match(const struct futex_a const struct futex_address *fa2) { - /* Either fa_vmspace or fa_vmobject is NULL. */ - return (fa1->fa_vmspace == fa2->fa_vmspace && - fa1->fa_vmobject == fa2->fa_vmobject && - fa1->fa_offset == fa2->fa_offset); + return (umtx_key_match(&fa1->fa_key, &fa2->fa_key)); } /* From owner-svn-src-head@freebsd.org Tue Aug 4 06:12:31 2015 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 CCED19B2BB6; Tue, 4 Aug 2015 06:12:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 940A7DAE; Tue, 4 Aug 2015 06:12:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E53A1425D74; Tue, 4 Aug 2015 16:12:20 +1000 (AEST) Date: Tue, 4 Aug 2015 16:12:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286268 - head/usr.bin/wall In-Reply-To: <201508040256.t742uWfQ053686@repo.freebsd.org> Message-ID: <20150804155237.L1126@besplex.bde.org> References: <201508040256.t742uWfQ053686@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JEayULNB4bDuRC7VNgQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 06:12:31 -0000 On Tue, 4 Aug 2015, Pedro F. Giffuni wrote: > Log: > Revert r286144 leaving the original fix to the buffer overflow. > > Some developers consider the new code unnecessarily obfuscated. > There was also a benign off-by-one. > > Discussed with: bde, vangyzen, jmallett It is this version that is unnecessarily obfuscated. > Modified: head/usr.bin/wall/ttymsg.c > ============================================================================== > --- head/usr.bin/wall/ttymsg.c Tue Aug 4 02:41:14 2015 (r286267) > +++ head/usr.bin/wall/ttymsg.c Tue Aug 4 02:56:31 2015 (r286268) > @@ -62,7 +62,7 @@ ttymsg(struct iovec *iov, int iovcnt, co > struct iovec localiov[7]; > ssize_t left, wret; > int cnt, fd; > - char device[MAXNAMLEN]; > + char device[MAXNAMLEN] = _PATH_DEV; > static char errbuf[1024]; > char *p; > int forked; Half of the string initialization is done by an auto initializer. Initializations in declarations are specifically forbidden in style(9), and this is a good example of how to obfuscate code using them. The original version using a static initializer was almost as obfuscated, but it was at least maximally efficient and had a technical reason for using the initializer. > @@ -71,9 +71,8 @@ ttymsg(struct iovec *iov, int iovcnt, co > if (iovcnt > (int)(sizeof(localiov) / sizeof(localiov[0]))) > return ("too many iov's (change code in wall/ttymsg.c)"); > > - strlcpy(device, _PATH_DEV, sizeof(device)); > + strlcat(device, line, sizeof(device)); The other half of the initialization is done using strlcat(). > p = device + sizeof(_PATH_DEV) - 1; > - strlcpy(p, line, sizeof(device) - sizeof(_PATH_DEV)); > if (strncmp(p, "pts/", 4) == 0) > p += 4; > if (strchr(p, '/') != NULL) { In private mail, I pointed out lots more bad code here. The pointer 'p' was introdiced to avoid writing out the expression for it in more places, especially in the "pts/" check. But the "pts/" check is badly written. It checks the copy of 'line' in 'device'. This is an obfuscated way of checking 'line' itself. It might be more secure the check the final string, but it is actually more secure to check 'line' since this will detect slashes that lost by strlcat() with no error checking. This method becomes even more unnatural when combined with the strcat(). We use the knowledge of the prefix to find the place to start for the check, but don't use this to find the place to start for the concatenation. These places are the same, and unwinding the obfuscation in the check requires knowing that they are the same. Bruce From owner-svn-src-head@freebsd.org Tue Aug 4 07:03:37 2015 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 1913D9B34B3; Tue, 4 Aug 2015 07:03:37 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF8A8219; Tue, 4 Aug 2015 07:03:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ZMWG2-0000pg-9I; Tue, 04 Aug 2015 08:03:33 +0100 Subject: Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <13981.1435792025@chaos> Date: Tue, 4 Aug 2015 08:03:24 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201506301700.t5UH0jPq001498@svn.freebsd.org> <13981.1435792025@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2104) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 07:03:37 -0000 > On 2 Jul 2015, at 00:07, Simon J. Gerraty wrote: >=20 > Mark Murray wrote: >> * src/sys/dev/random/random_adaptors.c = src/sys/dev/random/random_adaptors.h >> - Remove; plugability is no longer used. Compile-time algorithm >> selection is the way to go. >=20 > Errr we use that and need it. > Please put it back. >=20 > Whether we agree with NIST's ideas about how randomness should be > handled or not, we need to to be able to comply and we do not want to > burn their desired arrangement into our kernels. I=E2=80=99m nearly done with this. Please be patient for a few more = days. Thanks! M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Tue Aug 4 07:04:37 2015 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 B8D809B3527; Tue, 4 Aug 2015 07:04:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8FFC03BF; Tue, 4 Aug 2015 07:04:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7474bag055588; Tue, 4 Aug 2015 07:04:37 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7474bQx055587; Tue, 4 Aug 2015 07:04:37 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508040704.t7474bQx055587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 4 Aug 2015 07:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286279 - head/usr.bin/ypcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 07:04:37 -0000 Author: araujo (ports committer) Date: Tue Aug 4 07:04:36 2015 New Revision: 286279 URL: https://svnweb.freebsd.org/changeset/base/286279 Log: Get it closes to style(9). Staticization usage() and printit(). Fix the usage of err(3). Reviewed by: bde Modified: head/usr.bin/ypcat/ypcat.c Modified: head/usr.bin/ypcat/ypcat.c ============================================================================== --- head/usr.bin/ypcat/ypcat.c Tue Aug 4 06:02:03 2015 (r286278) +++ head/usr.bin/ypcat/ypcat.c Tue Aug 4 07:04:36 2015 (r286279) @@ -33,21 +33,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include + #include #include +#include +#include +#include +#include #include #include #include #include -void usage(void); -int printit(u_long, char *, int, char *, int, void *); - static const struct ypalias { char *alias, *name; } ypaliases[] = { @@ -65,16 +63,16 @@ static const struct ypalias { static int key; -void +static void usage(void) { - fprintf(stderr, - "usage: ypcat [-kt] [-d domainname] mapname\n" - " ypcat -x\n"); + fprintf(stderr, "%s\n%s\n", + "usage: ypcat [-kt] [-d domainname] mapname", + " ypcat -x"); exit(1); } -int +static int printit(u_long instatus, char *inkey, int inkeylen, char *inval, int invallen, void *indata) { @@ -91,9 +89,7 @@ main(int argc, char *argv[]) { char *domain = NULL, *inmap; struct ypall_callback ypcb; - extern char *optarg; - extern int optind; - int notrans, c, r; + int c, notrans, r; u_int i; notrans = key = 0; @@ -120,7 +116,7 @@ main(int argc, char *argv[]) if (optind + 1 != argc) usage(); - if (!domain) + if (domain == NULL) yp_get_default_domain(&domain); inmap = argv[optind]; @@ -137,12 +133,10 @@ main(int argc, char *argv[]) case 0: break; case YPERR_YPBIND: - errx(1, "ypcat: not running ypbind\n"); - exit(1); + errx(1, "not running ypbind"); default: - errx(1, "No such map %s. Reason: %s\n", + errx(1, "no such map %s. Reason: %s", inmap, yperr_string(r)); - exit(1); } exit(0); } From owner-svn-src-head@freebsd.org Tue Aug 4 07:32:30 2015 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 44C079B3CA0; Tue, 4 Aug 2015 07:32:30 +0000 (UTC) (envelope-from danfe@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 3833718BC; Tue, 4 Aug 2015 07:32:30 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 368FF1686; Tue, 4 Aug 2015 07:32:30 +0000 (UTC) Date: Tue, 4 Aug 2015 07:32:30 +0000 From: Alexey Dokuchaev To: Andriy Gapon Cc: Edward Tomasz Napierala , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r286234 - head/sys/boot/common Message-ID: <20150804073230.GA30381@FreeBSD.org> References: <201508031627.t73GRbTB092225@repo.freebsd.org> <55BFAAEB.2020900@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BFAAEB.2020900@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 07:32:30 -0000 On Mon, Aug 03, 2015 at 08:54:51PM +0300, Andriy Gapon wrote: > On 03/08/2015 19:27, Edward Tomasz Napierala wrote: > > New Revision: 286234 > > URL: https://svnweb.freebsd.org/changeset/base/286234 > > > > Log: > > Fix a problem which made loader(8) load non-kld files twice. > > What was the problem? > The change looks like defensive coding, but it's not clear why the > loader would attempt to load the same file more than once in the > first place. Seconded; it would be nice to know which commit had intriduced the issue, to make it easier for review and understand which stable branches need MFC. ./danfe From owner-svn-src-head@freebsd.org Tue Aug 4 08:16:19 2015 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 7054C9B2825; Tue, 4 Aug 2015 08:16:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 61091A1D; Tue, 4 Aug 2015 08:16:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t748GJvi083804; Tue, 4 Aug 2015 08:16:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t748GI25083800; Tue, 4 Aug 2015 08:16:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508040816.t748GI25083800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 4 Aug 2015 08:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286280 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 08:16:19 -0000 Author: trasz Date: Tue Aug 4 08:16:18 2015 New Revision: 286280 URL: https://svnweb.freebsd.org/changeset/base/286280 Log: Revert r286236; vgonel() is a static function. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile head/share/man/man9/vgone.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 4 07:04:36 2015 (r286279) +++ head/share/man/man9/Makefile Tue Aug 4 08:16:18 2015 (r286280) @@ -1739,7 +1739,6 @@ MLINKS+=vfs_getopt.9 vfs_copyopt.9 \ vfs_getopt.9 vfs_setopt.9 \ vfs_getopt.9 vfs_setopt_part.9 \ vfs_getopt.9 vfs_setopts.9 -MLINKS+=vgone.9 vgonel.9 MLINKS+=vhold.9 vdrop.9 \ vhold.9 vdropl.9 \ vhold.9 vholdl.9 Modified: head/share/man/man9/vgone.9 ============================================================================== --- head/share/man/man9/vgone.9 Tue Aug 4 07:04:36 2015 (r286279) +++ head/share/man/man9/vgone.9 Tue Aug 4 08:16:18 2015 (r286280) @@ -37,7 +37,6 @@ .In sys/vnode.h .Ft void .Fn vgone "struct vnode *vp" -.Fn vgonel "struct vnode *vp" .Sh DESCRIPTION The .Fn vgone @@ -57,11 +56,6 @@ The .Fn vgone function takes an exclusively locked vnode, and returns with the vnode exclusively locked. -The -.Fn vgonel -differs from -.Fn vgone -by requiring the vnode interlock to be held. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS From owner-svn-src-head@freebsd.org Tue Aug 4 08:17:46 2015 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 AEE4F9B2888; Tue, 4 Aug 2015 08:17:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::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 5000CB86; Tue, 4 Aug 2015 08:17:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wicmv11 with SMTP id mv11so165416898wic.0; Tue, 04 Aug 2015 01:17:44 -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:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=QEwTtJzCdtOdI2uURc0ZESKjrtZX9n7gfExNsODfbwA=; b=Z7GV0BbAm8evCj/cCqU4JvZufOAL0GrraF+MgpC2dLECyheSakkW3VIMc+HJT2N5Ob uydb1gZdPU1Y0tUKDi7vPfj1LuCayP2hmHxE3zt0IihGQhavTMlH6/W368SAXn75dSwU k+wR9icO1p030POeWGFIFoGnnaM7BuoztQ3sKEwK5l3XPg1YPU+hMfTtfpun9nVJ6vxE kExUSEyjnIGqsul1k3otQxEhLwGyl20WOirnHpQwqtzGBUFaA5Cns3WBluK78ss5ZoKM 0D5qxHG9nxX7NwcSlRYm2+Yxhy7zDNXZA2Wj5MxaMusqJA/iUAHv8HzRm5+vS6gYaUIz jBJw== X-Received: by 10.194.23.36 with SMTP id j4mr5322379wjf.105.1438676264827; Tue, 04 Aug 2015 01:17:44 -0700 (PDT) Received: from brick.home (ess151.neoplus.adsl.tpnet.pl. [83.20.138.151]) by smtp.gmail.com with ESMTPSA id l2sm1040759wib.11.2015.08.04.01.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 01:17:43 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 4 Aug 2015 10:17:41 +0200 From: Edward Tomasz Napierala To: Benjamin Kaduk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286236 - head/share/man/man9 Message-ID: <20150804081741.GA9262@brick.home> Mail-Followup-To: Benjamin Kaduk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201508031630.t73GUmBR092976@repo.freebsd.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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 08:17:46 -0000 On 0803T1352, Benjamin Kaduk wrote: > On Mon, Aug 3, 2015 at 12:30 PM, Edward Tomasz Napierala > wrote: > > > Author: trasz > > Date: Mon Aug 3 16:30:47 2015 > > New Revision: 286236 > > URL: https://svnweb.freebsd.org/changeset/base/286236 > > > > Log: > > Document vgonel(9). > > > > Er, isn't this a step backwards? > > % static void vgonel(struct vnode *); > > It is only accidental that anything outside vfs_subr.c can call vgonel(). Not sure how did I manage to miss that. Reverted, thanks. From owner-svn-src-head@freebsd.org Tue Aug 4 08:30:25 2015 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 414779B2C0A for ; Tue, 4 Aug 2015 08:30:25 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (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 D0E25116D for ; Tue, 4 Aug 2015 08:30:24 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wicgj17 with SMTP id gj17so139140113wic.1 for ; Tue, 04 Aug 2015 01:30:22 -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-type :content-transfer-encoding; bh=+PcW0Iy0BnbRfJen3gQ5XYZzBmhJB3SbnkUExrRw5BA=; b=LzNnvGmTg2HuZ7W0nj+q1kz0lE4GgS6UE7OESMlaroJO1lqPQxLJ8BnHGP02l7kPLL /ORHjoy6A0wBfPg1U5Xa08h38/znqmnPTPh1+AjvZRbynjQ7rE67PCSOBBv021ancmxH 3y4WUWfVRp5B9M1E8UDZ9bYZL7OgVxKj/cHT4Mo8DxXASiqweWJ1FqEgdJyToSVR9Lla FKBlL7/9l0ALxmOqgOhM5tLlBVfTNJvwQA3VxQjInpfOc/zp15O6CvFln6BIHgcvKs+f xd8gf2JzRj6zd63MbYsLuv58G0UyBMVCWypqLHcQlrGH+0FtGDBn6NJLVtV2lU2JLOau Tq1w== X-Gm-Message-State: ALoCoQnR7zWLfO/o4OqOU8AL+WNN7C7DXTUbt2wmihbspRJUvzCHePNLErIyx3WlsazLJXgVXlU5 X-Received: by 10.194.192.72 with SMTP id he8mr5514042wjc.11.1438677022811; Tue, 04 Aug 2015 01:30:22 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id wx9sm574444wjb.6.2015.08.04.01.30.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 01:30:21 -0700 (PDT) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Warner Losh , Slawa Olhovchenkov References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> Cc: Julian Elischer , Konstantin Belousov , Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org From: Steven Hartland Message-ID: <55C07826.9070002@multiplay.co.uk> Date: Tue, 4 Aug 2015 09:30:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: 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.20 Precedence: list List-Id: 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, 04 Aug 2015 08:30:25 -0000 On 03/08/2015 21:48, Warner Losh wrote: >> On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: >> >> On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: >> >>> On 8/3/15 8:03 PM, Konstantin Belousov wrote: >>>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >>>>> For this change I don't want to get into fixing the thread0 stack size, >>>>> which can be done later, just >>>>> to provide a reasonable warning to the user that smaller values could >>>>> cause a panic. >>>> Hmm, is it limited to the thread0 only ? I.e., would only increasing >>>> the initial thread stack size be enough to boot the kernel ? The zfs >>>> threads do request larger stack size, I know this. >>>> >>>> Can somebody test the following patch in the i386 configuration which >>>> does not boot ? >>> I think this is a reasonable thing to do. Thread0 (and proc0) are special. >>> I don't see why giving it a specially sized stack would be a problem. >> This is always do for ARM. >> May be need increase stack size for Thread0 on ARM too? > Seems reasonable. There should be a MI way of doing this, but all the code and defines are buried in MD files, so each architecture needs some love to make this a reality. > > Warner In the mean time are people happier with https://reviews.freebsd.org/D3279 or should I just leave it using the #define until someone has time to work on a full solution? Regards Steve From owner-svn-src-head@freebsd.org Tue Aug 4 08:51:57 2015 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 A5C5F9B2F82; Tue, 4 Aug 2015 08:51:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 92E0D1E1F; Tue, 4 Aug 2015 08:51:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t748pvRk099723; Tue, 4 Aug 2015 08:51:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t748pv15099722; Tue, 4 Aug 2015 08:51:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508040851.t748pv15099722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 4 Aug 2015 08:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286281 - 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.20 Precedence: list List-Id: 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, 04 Aug 2015 08:51:57 -0000 Author: trasz Date: Tue Aug 4 08:51:56 2015 New Revision: 286281 URL: https://svnweb.freebsd.org/changeset/base/286281 Log: Mark vgonel() as static. It was already declared static earlier; no idea why compilers don't warn about this. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 4 08:16:18 2015 (r286280) +++ head/sys/kern/vfs_subr.c Tue Aug 4 08:51:56 2015 (r286281) @@ -2850,7 +2850,7 @@ unlock: /* * vgone, with the vp interlock held. */ -void +static void vgonel(struct vnode *vp) { struct thread *td; From owner-svn-src-head@freebsd.org Tue Aug 4 08:56:51 2015 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 2A9A79B3078; Tue, 4 Aug 2015 08:56:51 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::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 B10A62F; Tue, 4 Aug 2015 08:56:50 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wibud3 with SMTP id ud3so14035590wib.0; Tue, 04 Aug 2015 01:56:49 -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:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ARhHsvyOioSCrfo8q1C7eAP/ozGUYp8/CCP41O1pzGY=; b=gmy40PVNmQSUTVXvX8AIhxmhj874v7iLPmukagSfq/NgBeZ1Y1a7StKG7qbEO75aAr CYnDLYZA/C6f814J4XNG8mndTD7zkWuVhxqWoKja/LOOKLyokCmu/Cm6TCZJuMzTtyM8 gZ8DXMDe2tDFr7opQW2Bt8QNZPkBmM6J7vcVKLD/4V6fuP8lNvhtcfQe8NJ33+Ldm7Oz TUvgsGnwWjGeppv/OjK3roCmM539efj5hL7472XZNM3sgTw6AsnK35ubHqJMp6eM6cM1 vthqcF4aV3ukM4J7CK/Mc0OB0nYMeL8UZtVCRVxQDy4563OgIfxc4cjv0LpvRo7x7KUy 3QQA== X-Received: by 10.180.211.10 with SMTP id my10mr5619963wic.41.1438678608974; Tue, 04 Aug 2015 01:56:48 -0700 (PDT) Received: from brick.home (ess151.neoplus.adsl.tpnet.pl. [83.20.138.151]) by smtp.gmail.com with ESMTPSA id 4sm627781wjt.46.2015.08.04.01.56.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 01:56:48 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 4 Aug 2015 10:56:45 +0200 From: Edward Tomasz Napierala To: Konstantin Belousov Cc: Benjamin Kaduk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286236 - head/share/man/man9 Message-ID: <20150804085645.GA9407@brick.home> Mail-Followup-To: Konstantin Belousov , Benjamin Kaduk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201508031630.t73GUmBR092976@repo.freebsd.org> <20150804041650.GG2072@kib.kiev.ua> <20150804042410.GH2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150804042410.GH2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 08:56:51 -0000 On 0804T0724, Konstantin Belousov wrote: > On Tue, Aug 04, 2015 at 07:16:50AM +0300, Konstantin Belousov wrote: > > On Mon, Aug 03, 2015 at 01:52:46PM -0400, Benjamin Kaduk wrote: > > > On Mon, Aug 3, 2015 at 12:30 PM, Edward Tomasz Napierala > > > wrote: > > > > > > > Author: trasz > > > > Date: Mon Aug 3 16:30:47 2015 > > > > New Revision: 286236 > > > > URL: https://svnweb.freebsd.org/changeset/base/286236 > > > > > > > > Log: > > > > Document vgonel(9). > > > > > > > > > > Er, isn't this a step backwards? > > > > > > % static void vgonel(struct vnode *); > > > > > > It is only accidental that anything outside vfs_subr.c can call vgonel(). > > Indeed, only kernel modules on some architectures could use a hole in > > the kernel linker to reference vgonel(). The kernel itself cannot call > > vgonel() outside vfs_subr.c. There is no point in putting vgonel(9) in > > the man page. > > I believe the source of the confusion is the vgonel() definition, which > lacks the static qualifier. I propose to remove vgonel(9) reference from > the man page and add static to definition. Done. > Might be, a review of all functions in vfs_*.c and fixing their missed > qualifiers would be useful. Would be nice if clang warned about this case. No idea why it doesn't. From owner-svn-src-head@freebsd.org Tue Aug 4 09:17:18 2015 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 22EEC9B36EC for ; Tue, 4 Aug 2015 09:17:18 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) (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 EA0D8B3B for ; Tue, 4 Aug 2015 09:17:17 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oizz185 with SMTP id z185so1935590oiz.0 for ; Tue, 04 Aug 2015 02:17:11 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pH8fFd6CcWmb5ZotUvzxrmk83aHzDfhs6tM0Th2h4Cw=; b=QggPHGNcmpXLTLmDZqedkxDE4SciteUCPbRN6Uh7yYKWgmWP2e26amOi09fXDYCJhk FFbpvBeoQDspzmmIOH4m3rsXlSy/zq1cxmjIyRHwplJs+fZE0ENqq6RgIda2S7r9mkQs zElqnZdbpm209Ndbq8I4XtJGTuoNuWbf91X1nDmkE55yHYL0vUqY3KGIWobr7CNHUWdM LAFYfnoxr/sv0hTz5tWwoQF5ATPo+fCax+Co3Xla6VGKv6PfPF8cO/3trT/tbV9Cbz00 Mjp9Fk8ojhBbCoevCEyhATxURCg6R15fvg13ltJ89Bl8aLiOojpNGR/BIvm2PxMRpVWz pNrQ== X-Gm-Message-State: ALoCoQmpiGUAST7viJdPbd3OktIrVqPJg6H7ShPe3ELY6+IpD20Ut0B5U/0nLaKdLx4XBWpfpzWR MIME-Version: 1.0 X-Received: by 10.202.67.67 with SMTP id q64mr2182546oia.124.1438679831273; Tue, 04 Aug 2015 02:17:11 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 4 Aug 2015 02:17:11 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <201508040851.t748pv15099722@repo.freebsd.org> References: <201508040851.t748pv15099722@repo.freebsd.org> Date: Tue, 4 Aug 2015 11:17:11 +0200 Message-ID: Subject: Re: svn commit: r286281 - head/sys/kern From: Ed Schouten To: Edward Tomasz Napierala 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.20 Precedence: list List-Id: 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, 04 Aug 2015 09:17:18 -0000 2015-08-04 10:51 GMT+02:00 Edward Tomasz Napierala : > Mark vgonel() as static. It was already declared static earlier; > no idea why compilers don't warn about this. That's because according to the standard, those keywords are meant to pile up: static void foo(void); _Noreturn void foo(void); void foo(void) { ... } is the same as: static _Noreturn void foo(void) { ... } -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 4 09:35:52 2015 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 8AD1E9B3A86; Tue, 4 Aug 2015 09:35:52 +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 14E5D148D; Tue, 4 Aug 2015 09:35:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t749ZhgV043753 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 12:35:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t749ZhgV043753 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t749ZgqZ043751; Tue, 4 Aug 2015 12:35:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Aug 2015 12:35:42 +0300 From: Konstantin Belousov To: Benjamin Kaduk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286236 - head/share/man/man9 Message-ID: <20150804093542.GL2072@kib.kiev.ua> References: <201508031630.t73GUmBR092976@repo.freebsd.org> <20150804041650.GG2072@kib.kiev.ua> <20150804042410.GH2072@kib.kiev.ua> <20150804085645.GA9407@brick.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150804085645.GA9407@brick.home> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 09:35:52 -0000 On Tue, Aug 04, 2015 at 10:56:45AM +0200, Edward Tomasz Napierala wrote: > Would be nice if clang warned about this case. No idea why it doesn't. Because it is valid standard C. Qualifiers are required for declaration, and are optional for definition. From owner-svn-src-head@freebsd.org Tue Aug 4 09:45:11 2015 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 D10B79B3C35; Tue, 4 Aug 2015 09:45:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C1C871A7B; Tue, 4 Aug 2015 09:45:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t749jBQA020007; Tue, 4 Aug 2015 09:45:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t749jBaf020006; Tue, 4 Aug 2015 09:45:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201508040945.t749jBaf020006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 4 Aug 2015 09:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286282 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 09:45:11 -0000 Author: hselasky Date: Tue Aug 4 09:45:10 2015 New Revision: 286282 URL: https://svnweb.freebsd.org/changeset/base/286282 Log: Avoid calling into the random subsystem before it is initialized. Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Aug 4 08:51:56 2015 (r286281) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Aug 4 09:45:10 2015 (r286282) @@ -701,9 +701,13 @@ static void build_inline_wqe(struct mlx4 static uint32_t hashrandom; static void hashrandom_init(void *arg) { + /* + * It is assumed that the random subsystem has been + * initialized when this function is called: + */ hashrandom = m_ether_tcpip_hash_init(); } -SYSINIT(hashrandom_init, SI_SUB_KLD, SI_ORDER_SECOND, &hashrandom_init, NULL); +SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL); u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb) { From owner-svn-src-head@freebsd.org Tue Aug 4 10:03:08 2015 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 49C6F9B3FAC for ; Tue, 4 Aug 2015 10:03:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.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 1B98A27D for ; Tue, 4 Aug 2015 10:03:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oihn130 with SMTP id n130so2380126oih.2 for ; Tue, 04 Aug 2015 03:03:07 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=0AqBK0pWLT+DCpiwRNa9Iu8mHT/9ZSScMhJhTK2P6vI=; b=Fn3258x4X0CgIkTIrBQH/ZIwBjZbZiSFEJje9y+8oiRjL/xcKhFkT/EDZAuFlbK2/r 0ZIRfa6Z+OqRnvIVap2U04CwJxBXmYqdDbRAdQWZgCOr/yf0QNnpCwuYDz4fV81q96M7 Z7mk1XHmtsYvxbscBdbfSNsje0cHq8baH799ro3CZUEW1tXHkMAjQPBz/Tdg6IGu15iF VHdwtajRUxQqDjRe9iMTUNCA1V2I1UDG+TIj0WjJfFha4IS183S25B00TzPwuBQZBP6q 5g0VqLc6UaHifoeeWSja2+ag+3VCRc+LVHsI5R7IgXrvZbQiGoeJ0uRs1veo28uQB9d3 0KKA== X-Gm-Message-State: ALoCoQmdKNvjc7Kcufb6pI9OvY8tzFY7WU9GCswZQT/5xGFqJzRtBsIZ5S6dkzqRaCK/e+XDeGoz MIME-Version: 1.0 X-Received: by 10.202.171.21 with SMTP id u21mr2265487oie.113.1438682587274; Tue, 04 Aug 2015 03:03:07 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 4 Aug 2015 03:03:07 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <20150802145434.V1128@besplex.bde.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> Date: Tue, 4 Aug 2015 12:03:07 +0200 Message-ID: Subject: Re: svn commit: r286170 - head/share/man/man9 From: Ed Schouten To: Bruce Evans Cc: John-Mark Gurney , 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.20 Precedence: list List-Id: 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, 04 Aug 2015 10:03:08 -0000 Hi Bruce, 2015-08-02 7:35 GMT+02:00 Bruce Evans : > This function shouldn't be deprecated. It is a kernel wrapper with a > good name for hiding the implementation detail or not-yet standard > interface _Static_assert(). _Static_assert has been part of the C standard for approximately 4 years now. I personally couldn't care less about the naming, but in a couple of years from now we'll have an entire generation of recently graduated computer scientists who know what _Static_assert does, because they used it in their C/C++ programming classes. None of them know what a 'CTASSERT' is. We constantly complain about how hard it is to attract new developers to the project. Maybe it's because we require them to learn nonsensical things in order to contribute code. > CTASSERT() is the compile-time variant of KASSERT(). We intentionally > use KASSERT() instead of anything like the standard assert(3) since > we don't like the API or semantics of assert() and want one with > different design and implementation bugs. I can't think of any use > for different semantics to _Static_assert(), but using CTASSERT() > retains flexibility. The problem with this reasoning is that it can be extrapolated. Why is _Static_assert() special in this regard? Why wouldn't we then write a wrapper around 'while' and use it all over our codebase, simply to retain flexibility? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 4 10:15:29 2015 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 501229B1233 for ; Tue, 4 Aug 2015 10:15:29 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (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 E953C99C for ; Tue, 4 Aug 2015 10:15:28 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wibxm9 with SMTP id xm9so159151931wib.0 for ; Tue, 04 Aug 2015 03:15:27 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qc6OX+21fHweNGTe60T5wXdVlzkaJF90nk6WYg7N9Rw=; b=QUKwj+V9iigCduM8sQ1Eo9aEQatinB6Bc2anFeoLsb09YQ7QuaQkJ2mtK9I52PphQ/ vWUZ+wD/CNIun1hXWLwlwA6TzLyxk2B7zc0w8tggfBc5ZqYtZX2U7aTFjzKCDBvC7DG0 QnlWUHB1DdO1aoDLvZmmH9pt21g0VGkBzc1YY10p/hiU4KDNt1fMobS+G2KQQIx2Ulq3 R4fKtE71kRbMwacZOLO0WsmeHr8wj2oj9ywiqwBAyOlOelKCm6ma/33l38IdvlKeQ3hS QbWktHeh5qsOnGYNUNxgMFZsRcj5Q+0HSjI229bfn4Z8rzPRiLMHfS1smyCGIKOBx1s3 pkQg== X-Gm-Message-State: ALoCoQl3z21aXhRNrhuUN6FYjUdGzgh0DJsis4AOUSXAjomCIl1S86klBrcQwjd4xyLIdzjMymfF MIME-Version: 1.0 X-Received: by 10.194.60.11 with SMTP id d11mr6159340wjr.143.1438683327142; Tue, 04 Aug 2015 03:15:27 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Tue, 4 Aug 2015 03:15:27 -0700 (PDT) In-Reply-To: <201507021437.t62EbL35082279@repo.freebsd.org> References: <201507021437.t62EbL35082279@repo.freebsd.org> Date: Tue, 4 Aug 2015 12:15:27 +0200 Message-ID: Subject: Re: svn commit: r285041 - in head: gnu/usr.bin/gdb/kgdb sys/amd64/include sys/cddl/dev/dtrace/i386 sys/i386/include From: Oliver Pinter 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.20 Precedence: list List-Id: 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, 04 Aug 2015 10:15:29 -0000 On 7/2/15, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 2 14:37:21 2015 > New Revision: 285041 > URL: https://svnweb.freebsd.org/changeset/base/285041 > > Log: > Use single instance of the identical INKERNEL() and PMC_IN_KERNEL() > macros on amd64 and i386. Move the definition to machine/param.h. > kgdb defines INKERNEL() too, the conflict is resolved by renaming kgdb > version to PINKERNEL(). > > On i386, correct the lowest kernel address. After the shared page was > introduced, USRSTACK no longer points to the last user address + 1 [*] > > Submitted by: Oliver Pinter [*] > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Hi Kostik! Do you have any plan to merge these changes back to 10-stable in the near future? > > Modified: > head/gnu/usr.bin/gdb/kgdb/trgt.c > head/sys/amd64/include/param.h > head/sys/amd64/include/pmc_mdep.h > head/sys/amd64/include/stack.h > head/sys/cddl/dev/dtrace/i386/dtrace_isa.c > head/sys/i386/include/param.h > head/sys/i386/include/pmc_mdep.h > head/sys/i386/include/stack.h > ... From owner-svn-src-head@freebsd.org Tue Aug 4 10:18:10 2015 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 157929B1296 for ; Tue, 4 Aug 2015 10:18:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) (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 BAD27B8F for ; Tue, 4 Aug 2015 10:18:09 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wibud3 with SMTP id ud3so170235178wib.1 for ; Tue, 04 Aug 2015 03:18: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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PwptmrXRlMZs2jy5V7eLmKKz27STspP8vG+GWeXfgK0=; b=Wl3sBB6EF/uGhxzMfrKs660OL430VSwjjmdjEj9KBv7iPQSUO7s1OrW/GMbLgtgvmQ 4HoBLXiIEqOQT9NUIB7sk/QXkHDaK6rLMCksXNh/pf28dD8SgqKt3rovNXVJkbqgAz3g pAuW2HKa5jLkG7QLgze29p2PR4PeeRSaSs8oAljuS6k1UegwilDOXXk932RxhPgcyNkZ UUkOK9BJvrZkV8OmXxxu5D8c6tTCS42k+LQjsx9VElRZQSZSNJASZPig84zXiFgtn591 Xz/YvGjrpLFOtyG13rg0r8s5LO9lxvKaKomLZsKKJ2fHl2aYx6YaiKV9gt9oQMI/nHco sSdQ== X-Gm-Message-State: ALoCoQnq3/y98jMG1dgPbWpnrjeECMjDZj3epz0Csan5ryUJkJcZmnPFA6n8DjFJenaAPzAN92If MIME-Version: 1.0 X-Received: by 10.194.143.6 with SMTP id sa6mr6142980wjb.67.1438683482475; Tue, 04 Aug 2015 03:18:02 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Tue, 4 Aug 2015 03:18:02 -0700 (PDT) In-Reply-To: <201507021522.t62FMEQY008049@repo.freebsd.org> References: <201507021522.t62FMEQY008049@repo.freebsd.org> Date: Tue, 4 Aug 2015 12:18:02 +0200 Message-ID: Subject: Re: svn commit: r285046 - head/sys/vm From: Oliver Pinter 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.20 Precedence: list List-Id: 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, 04 Aug 2015 10:18:10 -0000 On 7/2/15, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 2 15:22:13 2015 > New Revision: 285046 > URL: https://svnweb.freebsd.org/changeset/base/285046 > > Log: > Account for the main process stack being one page below the highest > user address when ABI uses shared page. > > Note that the change is no-op for correctness, since shared page does > not fault. The mapping for the shared page is installed at the > address space creation, the page is unmanaged and its pte/pv entry > cannot be reclaimed. > > Submitted by: Oliver Pinter > Review: https://reviews.freebsd.org/D2954 > MFC after: 1 week Hi Kostik! As same MFC this? Oliver > > Modified: > head/sys/vm/vm_map.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Thu Jul 2 15:17:30 2015 (r285045) > +++ head/sys/vm/vm_map.c Thu Jul 2 15:22:13 2015 (r285046) > @@ -3640,7 +3640,8 @@ Retry: > return (KERN_NO_SPACE); > } > > - is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr) ? 1 : 0; > + is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr && > + addr < (vm_offset_t)p->p_sysent->sv_usrstack) ? 1 : 0; > > /* > * If this is the main process stack, see if we're over the stack > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Aug 4 10:40:09 2015 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 D1DF09B1CB3; Tue, 4 Aug 2015 10:40:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C34221BE3; Tue, 4 Aug 2015 10:40:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74Ae9RJ040815; Tue, 4 Aug 2015 10:40:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74Ae9j1040814; Tue, 4 Aug 2015 10:40:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508041040.t74Ae9j1040814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 4 Aug 2015 10:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286283 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 10:40:09 -0000 Author: trasz Date: Tue Aug 4 10:40:08 2015 New Revision: 286283 URL: https://svnweb.freebsd.org/changeset/base/286283 Log: Fix panic triggered by code like this: open("/dev/md0", O_EXEC); Discussed with: kib@, mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3051 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Aug 4 09:45:10 2015 (r286282) +++ head/sys/geom/geom_dev.c Tue Aug 4 10:40:08 2015 (r286283) @@ -358,6 +358,13 @@ g_dev_open(struct cdev *dev, int flags, #else e = 0; #endif + + /* + * This happens on attempt to open a device node with O_EXEC. + */ + if (r + w + e == 0) + return (EINVAL); + if (w) { /* * When running in very secure mode, do not allow From owner-svn-src-head@freebsd.org Tue Aug 4 10:46:49 2015 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 2659B9B1F41; Tue, 4 Aug 2015 10:46:49 +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 DDD341FD5; Tue, 4 Aug 2015 10:46:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 236381FE023; Tue, 4 Aug 2015 12:46:40 +0200 (CEST) Message-ID: <55C09869.2040605@selasky.org> Date: Tue, 04 Aug 2015 12:48:09 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ed Schouten , Bruce Evans CC: John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286170 - head/share/man/man9 References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> 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.20 Precedence: list List-Id: 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, 04 Aug 2015 10:46:49 -0000 On 08/04/15 12:03, Ed Schouten wrote: > Hi Bruce, > > 2015-08-02 7:35 GMT+02:00 Bruce Evans: >> >This function shouldn't be deprecated. It is a kernel wrapper with a >> >good name for hiding the implementation detail or not-yet standard >> >interface _Static_assert(). > _Static_assert has been part of the C standard for approximately 4 years now. > > I personally couldn't care less about the naming, but in a couple of > years from now we'll have an entire generation of recently graduated > computer scientists who know what _Static_assert does, because they > used it in their C/C++ programming classes. None of them know what a > 'CTASSERT' is. Hi, Is it correct to assume that everyone doing programming has done a programming class of a certain kind? My gut feeling is it's good practice to have those wrapper macros because they isolate the compiler into a consistent and coherent API. Wouldn't the argument be the same for queue.3 . Once C-compilers finally decide to compile time support queues, we should throw queue.3 aswell? I'd say it is better to stay independent of what the compiler guys will come up with next, reminding me how hard it was to upgrade a machine recently from 9- to 10- because of C++11 .... --HPS From owner-svn-src-head@freebsd.org Tue Aug 4 10:52:16 2015 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 95B659B21CB for ; Tue, 4 Aug 2015 10:52:16 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.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 663F09D7 for ; Tue, 4 Aug 2015 10:52:16 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oibv126 with SMTP id v126so2880267oib.3 for ; Tue, 04 Aug 2015 03:52: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:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Vps+VBUnHWV2zghqf8UbcyLWzsmTOzBf5HLVHyF2Bko=; b=LxqRBUw0Crk08E1kZoddW95SjJ4t2d9pJcUQMAIfLVUWivQvND2gv6HvklzIWVarN7 Poe/YBSKcydI4aeNxhAU+5e6Catg6Iz36Q3SUmg4FpG4ptBC/sLW1Qwdzjwn+KUYz8wL OA1kkqxtUkA2a3jY8f3BDgiV/JHOnb0H3VHX80y9SS/479/JpD0MG5XBIN8nT8PUlN5i NLgIxeq0cu34hmF+B+/aTSy11BTPWGTF68Xp0LQn3FlYWJWFmoc7/XT8frIgZRektuHQ D2mNSxxIHCbV/EFyvBgbH7g5veCR0dZTLR3leR1dtHz5J+iH+qpsbRA7COZweGr33LDA 30cg== X-Gm-Message-State: ALoCoQmvKlhTuMbOPCgHzTd7aOqkzndh1F7DvvbNKPfhtEXJWdxGECsROeopEw92kYp6mD6ALfJO MIME-Version: 1.0 X-Received: by 10.202.171.21 with SMTP id u21mr2409807oie.113.1438685529495; Tue, 04 Aug 2015 03:52:09 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 4 Aug 2015 03:52:09 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <55C09869.2040605@selasky.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> <55C09869.2040605@selasky.org> Date: Tue, 4 Aug 2015 12:52:09 +0200 Message-ID: Subject: Re: svn commit: r286170 - head/share/man/man9 From: Ed Schouten To: Hans Petter Selasky Cc: Bruce Evans , John-Mark Gurney , 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.20 Precedence: list List-Id: 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, 04 Aug 2015 10:52:16 -0000 2015-08-04 12:48 GMT+02:00 Hans Petter Selasky : > Once C-compilers finally decide to compile time support queues, we should throw queue.3 aswell? If the API provided by the C standard would be functionally identical and easy to emulate with older compilers (which is the case for _Static_assert), then yes. Meaning: we should put a notice at the top of the man page that the C standard functionality should be used instead. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 4 11:03:53 2015 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 24CE69B26F2; Tue, 4 Aug 2015 11:03:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id D335010A1; Tue, 4 Aug 2015 11:03:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 44F59D62AB5; Tue, 4 Aug 2015 21:03:48 +1000 (AEST) Date: Tue, 4 Aug 2015 21:03:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286281 - head/sys/kern In-Reply-To: Message-ID: <20150804200922.S2008@besplex.bde.org> References: <201508040851.t748pv15099722@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ItbjC+Lg c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=WvSndk5DmgNJwsFNOsgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 11:03:53 -0000 On Tue, 4 Aug 2015, Ed Schouten wrote: > 2015-08-04 10:51 GMT+02:00 Edward Tomasz Napierala : >> Mark vgonel() as static. It was already declared static earlier; >> no idea why compilers don't warn about this. > > That's because according to the standard, those keywords are meant to pile up: > > static void foo(void); > _Noreturn void foo(void); > void foo(void) { > ... > } > > is the same as: > > static _Noreturn void foo(void) { > ... > } This is a bug in the standard. You can build up enormously complicated declarations, with the full declaration not visible in any one of the parts. E.g.: int foo(); int foo(int (*foo1())); int foo(int (*foo1(int (*foo2())))); int foo(int (*foo1(int (*foo2(int (*foo3)()))))); /* ... */ Every declaration in this sequence completes the type a little more, but the type is never complete. To obfuscate this further, remove the function parameter names, or use different ones in each prototype. To complicate this further, there are many possibilities. E.g., make foo() have several function args and (partially) complete each of these independently. Or use attributes to give even more independence in the steps. I don't know of any useful use for this except to complete function definitions in K&R or bad code. The code might have "int foo();" in it and you want to add a complete prototype without changing the original declaration. The complete prototypes should be declared in one step to avoid further obfuscations. Compilers have very bad support for warning about this. -Wredundant-decls is broken in gcc from when it was born up to at least gcc-4.2.1. The above declarations are non-redundant non-redeclarations, but gcc warns that they are redundant redaclaration. -Wredundant-decls is even more broken in clang. It doesn't warn even if all of the above declarations are repeated so that every declaration in the second copy is redundant. "Building up" doesn't work for all parts of declarations. In particular, the rules for linkage and storage class are confusing without building up, and building up doesn't work for them. Consider: static int foo; int foo; vs int foo; static int foo; According to TenDRA C90, the former is valid, but according to gcc and clang it is invalid. The latter is invalid according to all 3 compilers, so building up by adding the static is always invalid. I only trust TenDRA here. The former is a valid obfuscation (the opposite of building up) for all 3 compilers if foo is replaced by foo(). Now change 'int foo;' to 'extern int foo;' in the former. Then all 3 compilers accept it. extern is generally more confusing than static, especially in combination with inline. For static inline, the most common obfuscation is like this one for vgonel. You declare the function as inline in its prototype but not in its function body. This makes it inline if it is static in both. With static in neither and extern in either, both or neither, the behaviour is even more confusing. Bruce From owner-svn-src-head@freebsd.org Tue Aug 4 11:26:42 2015 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 2FFE09B3135 for ; Tue, 4 Aug 2015 11:26:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E48A01EF0; Tue, 4 Aug 2015 11:26:41 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-239-102.lns20.per1.internode.on.net [121.45.239.102]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t74BQVmx095803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 4 Aug 2015 04:26:34 -0700 (PDT) (envelope-from julian@freebsd.org) To: "Alexander V. Chernikov" , svn-src-head@freebsd.org References: <201508031431.t73EV6hZ045024@repo.freebsd.org> From: Julian Elischer Subject: another ipfw regression I think. Message-ID: <55C0A165.10103@freebsd.org> Date: Tue, 4 Aug 2015 19:26:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508031431.t73EV6hZ045024@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.20 Precedence: list List-Id: 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, 04 Aug 2015 11:26:42 -0000 another thing that seems broken now is that -q no longer stopps errors when deleting non existant rules. root@vps1:~ # ipfw -q delete 4000 ipfw: rule 4000 not found root@vps1:~ # echo $? 69 root@vps1: From owner-svn-src-head@freebsd.org Tue Aug 4 11:42:36 2015 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 84B8C9B3662; Tue, 4 Aug 2015 11:42:36 +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 3E995AB2; Tue, 4 Aug 2015 11:42:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id DA27AD4881E; Tue, 4 Aug 2015 21:42:31 +1000 (AEST) Date: Tue, 4 Aug 2015 21:42:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Bruce Evans , John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286170 - head/share/man/man9 In-Reply-To: Message-ID: <20150804210408.D2008@besplex.bde.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=WLmREnM5Lxl_QZHa9CoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 11:42:36 -0000 On Tue, 4 Aug 2015, Ed Schouten wrote: > Hi Bruce, > > 2015-08-02 7:35 GMT+02:00 Bruce Evans : >> This function shouldn't be deprecated. It is a kernel wrapper with a >> good name for hiding the implementation detail or not-yet standard >> interface _Static_assert(). > > _Static_assert has been part of the C standard for approximately 4 years now. We don't have any C11 compilers yet. I'm still waiting for a C99 compiler (with fenv support). > I personally couldn't care less about the naming, but in a couple of > years from now we'll have an entire generation of recently graduated > computer scientists who know what _Static_assert does, because they > used it in their C/C++ programming classes. None of them know what a > 'CTASSERT' is. I doubt that many of them will have even seen the identifier _Static_assert. It should be taught some time after fenv, but there probably isn't time to cover either. > We constantly complain about how hard it is to attract new developers > to the project. Maybe it's because we require them to learn > nonsensical things in order to contribute code. CTASSERT() isn't nonsense. It is just another special kernel API. >> CTASSERT() is the compile-time variant of KASSERT(). We intentionally >> use KASSERT() instead of anything like the standard assert(3) since >> we don't like the API or semantics of assert() and want one with >> different design and implementation bugs. I can't think of any use >> for different semantics to _Static_assert(), but using CTASSERT() >> retains flexibility. > > The problem with this reasoning is that it can be extrapolated. Why is > _Static_assert() special in this regard? Why wouldn't we then write a > wrapper around 'while' and use it all over our codebase, simply to > retain flexibility? Because of portability. The kernel can use new things like _Static_assert() but has negative reasons to switch from its better CTASSERT() API. Contribed code not written for C11 should be portable and not use it without messy ifdefs. Current contribed code doesn't even use it with messy ifdefs. Its only uses in src/contrib are in clang, llvm, once in libcxxrt, and once in top/utils.c written recently. The latter is just a mistake. Try getting such a change (in dusty deck code) accepted by the vendor. It would be easier to fix the code by using a C99 feature (snprintf()), but that would probably be too unportable for the vendor. contrib_top only uses snprintf() once now, and this is in a FreeBSD change. Non-contribed code in userland shouldn't abuse the kernel CTASSERT() and can reasonably use _Static_assert(). Bruce From owner-svn-src-head@freebsd.org Tue Aug 4 12:33:53 2015 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 D7FA29B1A46; Tue, 4 Aug 2015 12:33:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BC4A4ADD; Tue, 4 Aug 2015 12:33:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74CXrP2089441; Tue, 4 Aug 2015 12:33:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74CXqqd089437; Tue, 4 Aug 2015 12:33:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508041233.t74CXqqd089437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Aug 2015 12:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286284 - in head: lib/libc/amd64/sys lib/libc/i386/sys lib/libc/sys 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.20 Precedence: list List-Id: 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, 04 Aug 2015 12:33:54 -0000 Author: kib Date: Tue Aug 4 12:33:51 2015 New Revision: 286284 URL: https://svnweb.freebsd.org/changeset/base/286284 Log: Copy the fencing of the algorithm to do lock-less update and reading of the timehands, from the kern_tc.c implementation to vdso. Add comments giving hints where to look for the algorithm explanation. To compensate the removal of rmb() in userspace binuptime(), add explicit lfence instruction before rdtsc. On i386, add usual complications to detect SSE2 presence; assume that old CPUs which do not implement SSE2 also execute rdtsc almost in order. Reviewed by: alc, bde (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/i386/sys/__vdso_gettc.c head/lib/libc/sys/__vdso_gettimeofday.c head/sys/kern/kern_sharedpage.c Modified: head/lib/libc/amd64/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/amd64/sys/__vdso_gettc.c Tue Aug 4 10:40:08 2015 (r286283) +++ head/lib/libc/amd64/sys/__vdso_gettc.c Tue Aug 4 12:33:51 2015 (r286284) @@ -36,19 +36,29 @@ __FBSDID("$FreeBSD$"); static u_int __vdso_gettc_low(const struct vdso_timehands *th) { - uint32_t rv; + u_int rv; - __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + __asm __volatile("lfence; rdtsc; shrd %%cl, %%edx, %0" : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); return (rv); } +static u_int +__vdso_rdtsc32(void) +{ + u_int rv; + + __asm __volatile("lfence;rdtsc" : "=a" (rv) : : "edx"); + return (rv); +} + #pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); + return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : + __vdso_rdtsc32()); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/i386/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/i386/sys/__vdso_gettc.c Tue Aug 4 10:40:08 2015 (r286283) +++ head/lib/libc/i386/sys/__vdso_gettc.c Tue Aug 4 12:33:51 2015 (r286284) @@ -31,24 +31,78 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +static int lfence_works = -1; + +static int +get_lfence_usage(void) +{ + u_int cpuid_supported, p[4]; + + if (lfence_works == -1) { + __asm __volatile( + " pushfl\n" + " popl %%eax\n" + " movl %%eax,%%ecx\n" + " xorl $0x200000,%%eax\n" + " pushl %%eax\n" + " popfl\n" + " pushfl\n" + " popl %%eax\n" + " xorl %%eax,%%ecx\n" + " je 1f\n" + " movl $1,%0\n" + " jmp 2f\n" + "1: movl $0,%0\n" + "2:\n" + : "=r" (cpuid_supported) : : "eax", "ecx"); + if (cpuid_supported) { + __asm __volatile( + " pushl %%ebx\n" + " cpuid\n" + " movl %%ebx,%1\n" + " popl %%ebx\n" + : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (0x1)); + lfence_works = (p[3] & CPUID_SSE2) != 0; + } else + lfence_works = 0; + } + return (lfence_works); +} + static u_int __vdso_gettc_low(const struct vdso_timehands *th) { - uint32_t rv; + u_int rv; + if (get_lfence_usage() == 1) + lfence(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); return (rv); } +static u_int +__vdso_rdtsc32(void) +{ + u_int rv; + + if (get_lfence_usage() == 1) + lfence(); + rv = rdtsc32(); + return (rv); +} + #pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32()); + return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : + __vdso_rdtsc32()); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/sys/__vdso_gettimeofday.c ============================================================================== --- head/lib/libc/sys/__vdso_gettimeofday.c Tue Aug 4 10:40:08 2015 (r286283) +++ head/lib/libc/sys/__vdso_gettimeofday.c Tue Aug 4 12:33:51 2015 (r286284) @@ -42,6 +42,15 @@ tc_delta(const struct vdso_timehands *th th->th_counter_mask); } +/* + * Calculate the absolute or boot-relative time from the + * machine-specific fast timecounter and the published timehands + * structure read from the shared page. + * + * The lockless reading scheme is similar to the one used to read the + * in-kernel timehands, see sys/kern/kern_tc.c:binuptime(). This code + * is based on the kernel implementation. + */ static int binuptime(struct bintime *bt, struct vdso_timekeep *tk, int abs) { @@ -52,27 +61,21 @@ binuptime(struct bintime *bt, struct vds if (!tk->tk_enabled) return (ENOSYS); - /* - * XXXKIB. The load of tk->tk_current should use - * atomic_load_acq_32 to provide load barrier. But - * since tk points to r/o mapped page, x86 - * implementation of atomic_load_acq faults. - */ - curr = tk->tk_current; - rmb(); + curr = atomic_load_acq_32(&tk->tk_current); th = &tk->tk_th[curr]; if (th->th_algo != VDSO_TH_ALGO_1) return (ENOSYS); - gen = th->th_gen; + gen = atomic_load_acq_32(&th->th_gen); *bt = th->th_offset; bintime_addx(bt, th->th_scale * tc_delta(th)); if (abs) bintime_add(bt, &th->th_boottime); /* - * Barrier for load of both tk->tk_current and th->th_gen. + * Ensure that the load of th_offset is completed + * before the load of th_gen. */ - rmb(); + atomic_thread_fence_acq(); } while (curr != tk->tk_current || gen == 0 || gen != th->th_gen); return (0); } Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Tue Aug 4 10:40:08 2015 (r286283) +++ head/sys/kern/kern_sharedpage.c Tue Aug 4 12:33:51 2015 (r286284) @@ -119,6 +119,13 @@ shared_page_init(void *dummy __unused) SYSINIT(shp, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)shared_page_init, NULL); +/* + * Push the timehands update to the shared page. + * + * The lockless update scheme is similar to the one used to update the + * in-kernel timehands, see sys/kern/kern_tc.c:tc_windup() (which + * calls us after the timehands are updated). + */ static void timehands_update(struct sysentvec *sv) { @@ -127,47 +134,56 @@ timehands_update(struct sysentvec *sv) uint32_t enabled, idx; enabled = tc_fill_vdso_timehands(&th); - tk = (struct vdso_timekeep *)(shared_page_mapping + - sv->sv_timekeep_off); + th.th_gen = 0; idx = sv->sv_timekeep_curr; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); if (++idx >= VDSO_TH_NUM) idx = 0; sv->sv_timekeep_curr = idx; if (++sv->sv_timekeep_gen == 0) sv->sv_timekeep_gen = 1; - th.th_gen = 0; + + tk = (struct vdso_timekeep *)(shared_page_mapping + + sv->sv_timekeep_off); + tk->tk_th[idx].th_gen = 0; + atomic_thread_fence_rel(); if (enabled) tk->tk_th[idx] = th; - tk->tk_enabled = enabled; atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); - tk->tk_current = idx; + atomic_store_rel_32(&tk->tk_current, idx); + + /* + * The ordering of the assignment to tk_enabled relative to + * the update of the vdso_timehands is not important. + */ + tk->tk_enabled = enabled; } #ifdef COMPAT_FREEBSD32 static void timehands_update32(struct sysentvec *sv) { - struct vdso_timekeep32 *tk; struct vdso_timehands32 th; + struct vdso_timekeep32 *tk; uint32_t enabled, idx; enabled = tc_fill_vdso_timehands32(&th); - tk = (struct vdso_timekeep32 *)(shared_page_mapping + - sv->sv_timekeep_off); + th.th_gen = 0; idx = sv->sv_timekeep_curr; - atomic_store_rel_32(&tk->tk_th[idx].th_gen, 0); if (++idx >= VDSO_TH_NUM) idx = 0; sv->sv_timekeep_curr = idx; if (++sv->sv_timekeep_gen == 0) sv->sv_timekeep_gen = 1; - th.th_gen = 0; + + tk = (struct vdso_timekeep32 *)(shared_page_mapping + + sv->sv_timekeep_off); + tk->tk_th[idx].th_gen = 0; + atomic_thread_fence_rel(); if (enabled) tk->tk_th[idx] = th; - tk->tk_enabled = enabled; atomic_store_rel_32(&tk->tk_th[idx].th_gen, sv->sv_timekeep_gen); - tk->tk_current = idx; + atomic_store_rel_32(&tk->tk_current, idx); + tk->tk_enabled = enabled; } #endif From owner-svn-src-head@freebsd.org Tue Aug 4 13:40:27 2015 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 B65279B2E05; Tue, 4 Aug 2015 13:40:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A42FE11B0; Tue, 4 Aug 2015 13:40:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74DeRCh014691; Tue, 4 Aug 2015 13:40:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74DeRMX014690; Tue, 4 Aug 2015 13:40:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201508041340.t74DeRMX014690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 4 Aug 2015 13:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286285 - 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.20 Precedence: list List-Id: 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, 04 Aug 2015 13:40:27 -0000 Author: gjb Date: Tue Aug 4 13:40:26 2015 New Revision: 286285 URL: https://svnweb.freebsd.org/changeset/base/286285 Log: Ensure the local MANIFEST is always used when verifying remote distribution sets. MFC after: immediately Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Tue Aug 4 12:33:51 2015 (r286284) +++ head/usr.sbin/bsdinstall/scripts/auto Tue Aug 4 13:40:26 2015 (r286285) @@ -284,7 +284,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then DISTDIR_IS_UNIONFS=1 mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" else - export DISTRIBUTIONS="MANIFEST $ALL_DISTRIBUTIONS" + export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" fi From owner-svn-src-head@freebsd.org Tue Aug 4 13:50:54 2015 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 9A0709B2070; Tue, 4 Aug 2015 13:50:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 70E451CD8; Tue, 4 Aug 2015 13:50:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74Dosqb020592; Tue, 4 Aug 2015 13:50:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74DoraL020588; Tue, 4 Aug 2015 13:50:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508041350.t74DoraL020588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Aug 2015 13:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286288 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 13:50:54 -0000 Author: kib Date: Tue Aug 4 13:50:52 2015 New Revision: 286288 URL: https://svnweb.freebsd.org/changeset/base/286288 Log: Give large kernel stack to the initial thread . Otherwise, ZFS overflows the stack during root mount in some configurations. Tested by: Fabian Keil (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/i386/i386/genassym.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/include/param.h Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Tue Aug 4 13:42:44 2015 (r286287) +++ head/sys/i386/i386/genassym.c Tue Aug 4 13:50:52 2015 (r286288) @@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); /* ASSYM(UPAGES, UPAGES);*/ ASSYM(KSTACK_PAGES, KSTACK_PAGES); +ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); ASSYM(NPDEPG, NPDEPG); Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Tue Aug 4 13:42:44 2015 (r286287) +++ head/sys/i386/i386/locore.s Tue Aug 4 13:50:52 2015 (r286288) @@ -731,7 +731,7 @@ no_kernend: movl %esi,R(IdlePTD) /* Allocate KSTACK */ - ALLOCPAGES(KSTACK_PAGES) + ALLOCPAGES(TD0_KSTACK_PAGES) movl %esi,R(p0kpa) addl $KERNBASE, %esi movl %esi, R(proc0kstack) @@ -800,7 +800,7 @@ no_kernend: /* Map proc0's KSTACK in the physical way ... */ movl R(p0kpa), %eax - movl $(KSTACK_PAGES), %ecx + movl $(TD0_KSTACK_PAGES), %ecx fillkptphys($PG_RW) /* Map ISA hole */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Aug 4 13:42:44 2015 (r286287) +++ head/sys/i386/i386/machdep.c Tue Aug 4 13:50:52 2015 (r286288) @@ -2445,7 +2445,7 @@ init386(first) #endif thread0.td_kstack = proc0kstack; - thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_kstack_pages = TD0_KSTACK_PAGES; /* * This may be done better later if it gets more high level Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Tue Aug 4 13:42:44 2015 (r286287) +++ head/sys/i386/include/param.h Tue Aug 4 13:50:52 2015 (r286288) @@ -114,6 +114,11 @@ #define KSTACK_PAGES 2 /* Includes pcb! */ #endif #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ +#if KSTACK_PAGES < 4 +#define TD0_KSTACK_PAGES 4 +#else +#define TD0_KSTACK_PAGES KSTACK_PAGES +#endif /* * Ceiling on amount of swblock kva space, can be changed via From owner-svn-src-head@freebsd.org Tue Aug 4 14:01:10 2015 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 23F5E9B23F5 for ; Tue, 4 Aug 2015 14:01:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (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 B83FC2F1 for ; Tue, 4 Aug 2015 14:01:09 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wibud3 with SMTP id ud3so178619549wib.1 for ; Tue, 04 Aug 2015 07:01: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:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=yOF4FhAah6ErqnTh7n7YQzJz8aHzjYASoLiQWUAvfzA=; b=f9lSAWVjkeg+qh8liTv9D4cllHE0LsOL7Zxy4Qc3PiUXbOTswrm21a6fWZWL8Zs8GA CkGRNcOFqMxE0iNY12ra/UQqPMD+M3sVh5vsr4KMKQUeMAImNA5p/gtHbXi0DUSLp6wY mSayWdhvpnITp2OVNi2KG7Og8lzgpoG3+B2X+rszB7zr8do1yhkfL9DlIq4enCUZgUGP IRI+ROTJUeLxoPh9VQJxz1ASLRacG2VoBol3M+IVGjBnAiEuiLRq1etqnDG3aVG9/0q3 37eavgpIYxLzojH62m/rDrPCzjjpoy7f68Ijeg9XZQr2YaN2xZ7CAGeQt6FqsF/HoJdr OM4A== X-Gm-Message-State: ALoCoQml+B9K9+yvyR1T0wbXiXWNG4AvXoScVXo+UjwW495u34aJEefBJ/ZxBSS5qKsIkyRgsdoQ X-Received: by 10.194.191.164 with SMTP id gz4mr8460401wjc.21.1438696862393; Tue, 04 Aug 2015 07:01:02 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id yu4sm1992817wjc.43.2015.08.04.07.01.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 07:01:01 -0700 (PDT) Subject: Re: svn commit: r286288 - in head/sys/i386: i386 include To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508041350.t74DoraL020588@repo.freebsd.org> From: Steven Hartland Message-ID: <55C0C59B.5040906@multiplay.co.uk> Date: Tue, 4 Aug 2015 15:00:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508041350.t74DoraL020588@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.20 Precedence: list List-Id: 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, 04 Aug 2015 14:01:10 -0000 This effects other platforms arm and mips spring to mind from when I last checked. Would you like me to backout the checks I added to the ZFS module once all the platforms are addressed? Regards Steve On 04/08/2015 14:50, Konstantin Belousov wrote: > Author: kib > Date: Tue Aug 4 13:50:52 2015 > New Revision: 286288 > URL: https://svnweb.freebsd.org/changeset/base/286288 > > Log: > Give large kernel stack to the initial thread . Otherwise, ZFS > overflows the stack during root mount in some configurations. > > Tested by: Fabian Keil (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/i386/i386/genassym.c > head/sys/i386/i386/locore.s > head/sys/i386/i386/machdep.c > head/sys/i386/include/param.h > > Modified: head/sys/i386/i386/genassym.c > ============================================================================== > --- head/sys/i386/i386/genassym.c Tue Aug 4 13:42:44 2015 (r286287) > +++ head/sys/i386/i386/genassym.c Tue Aug 4 13:50:52 2015 (r286288) > @@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter > ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); > /* ASSYM(UPAGES, UPAGES);*/ > ASSYM(KSTACK_PAGES, KSTACK_PAGES); > +ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); > ASSYM(PAGE_SIZE, PAGE_SIZE); > ASSYM(NPTEPG, NPTEPG); > ASSYM(NPDEPG, NPDEPG); > > Modified: head/sys/i386/i386/locore.s > ============================================================================== > --- head/sys/i386/i386/locore.s Tue Aug 4 13:42:44 2015 (r286287) > +++ head/sys/i386/i386/locore.s Tue Aug 4 13:50:52 2015 (r286288) > @@ -731,7 +731,7 @@ no_kernend: > movl %esi,R(IdlePTD) > > /* Allocate KSTACK */ > - ALLOCPAGES(KSTACK_PAGES) > + ALLOCPAGES(TD0_KSTACK_PAGES) > movl %esi,R(p0kpa) > addl $KERNBASE, %esi > movl %esi, R(proc0kstack) > @@ -800,7 +800,7 @@ no_kernend: > > /* Map proc0's KSTACK in the physical way ... */ > movl R(p0kpa), %eax > - movl $(KSTACK_PAGES), %ecx > + movl $(TD0_KSTACK_PAGES), %ecx > fillkptphys($PG_RW) > > /* Map ISA hole */ > > Modified: head/sys/i386/i386/machdep.c > ============================================================================== > --- head/sys/i386/i386/machdep.c Tue Aug 4 13:42:44 2015 (r286287) > +++ head/sys/i386/i386/machdep.c Tue Aug 4 13:50:52 2015 (r286288) > @@ -2445,7 +2445,7 @@ init386(first) > #endif > > thread0.td_kstack = proc0kstack; > - thread0.td_kstack_pages = KSTACK_PAGES; > + thread0.td_kstack_pages = TD0_KSTACK_PAGES; > > /* > * This may be done better later if it gets more high level > > Modified: head/sys/i386/include/param.h > ============================================================================== > --- head/sys/i386/include/param.h Tue Aug 4 13:42:44 2015 (r286287) > +++ head/sys/i386/include/param.h Tue Aug 4 13:50:52 2015 (r286288) > @@ -114,6 +114,11 @@ > #define KSTACK_PAGES 2 /* Includes pcb! */ > #endif > #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ > +#if KSTACK_PAGES < 4 > +#define TD0_KSTACK_PAGES 4 > +#else > +#define TD0_KSTACK_PAGES KSTACK_PAGES > +#endif > > /* > * Ceiling on amount of swblock kva space, can be changed via > From owner-svn-src-head@freebsd.org Tue Aug 4 14:06:19 2015 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 52F6D9B2505; Tue, 4 Aug 2015 14:06:19 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::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 E2EC58CC; Tue, 4 Aug 2015 14:06:18 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wibud3 with SMTP id ud3so25499769wib.0; Tue, 04 Aug 2015 07:06:17 -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:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=RyI4VtqGKIMszuyYcUwHCnoGEM7wNsWri1aCU23GwnM=; b=ZdqJqQh9hmWlEkL+zbes/GoTB0BnnOyF4E0k6h/xPg3vVwSkHFPaq2GT3NbLh1BjQw SLhJb924XWAXCedhb6tGZCNSt2RZl3iDdzodeadxbQTBFNxVFvDX2ADqpU0TRexiEexx c0vtuRbIE145cwZgB3QjA/e8op/PtTqHN4aMra+BDmcwd0i8zaW/jPEXVzO0lpGj3shr KbcNNR9nY+tfSUdyhbsLdwrkTtihquOcL4PY1wXkgJ3Xc07gxox4fiYE28TemBb/WuGz wwFN61Iitu0v+WNdRdDspfTw8b25pstjSasOHFf2Jcl9GdxLnr5vRbqDLxpsZXCxuv/a In8Q== X-Received: by 10.194.23.167 with SMTP id n7mr8191124wjf.112.1438697177392; Tue, 04 Aug 2015 07:06:17 -0700 (PDT) Received: from brick.home (ess151.neoplus.adsl.tpnet.pl. [83.20.138.151]) by smtp.gmail.com with ESMTPSA id ck18sm2009114wjb.47.2015.08.04.07.06.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 07:06:16 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 4 Aug 2015 16:06:12 +0200 From: Edward Tomasz Napierala To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r286234 - head/sys/boot/common Message-ID: <20150804140612.GA13928@brick.home> Mail-Followup-To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201508031627.t73GRbTB092225@repo.freebsd.org> <55BFAAEB.2020900@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55BFAAEB.2020900@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 14:06:19 -0000 On 0803T2054, Andriy Gapon wrote: > On 03/08/2015 19:27, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Mon Aug 3 16:27:36 2015 > > New Revision: 286234 > > URL: https://svnweb.freebsd.org/changeset/base/286234 > > > > Log: > > Fix a problem which made loader(8) load non-kld files twice. > > What was the problem? > The change looks like defensive coding, but it's not clear why the loader would > attempt to load the same file more than once in the first place. It's because the "load_modules" Forth word gets called twice. It could be fixed, I guess, but I'm no good at Forth, so I chose the other way: I made the "load" command behave consistently; it already silently refused to load KLDs twice, and I made it behave the same way for other types of modules. From owner-svn-src-head@freebsd.org Tue Aug 4 14:27:27 2015 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 0A12B9B29DA; Tue, 4 Aug 2015 14:27:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D5183164D; Tue, 4 Aug 2015 14:27:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74ERQYr034862; Tue, 4 Aug 2015 14:27:26 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74ERQ9W034860; Tue, 4 Aug 2015 14:27:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201508041427.t74ERQ9W034860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 4 Aug 2015 14:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286289 - head/usr.bin/xargs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 14:27:27 -0000 Author: allanjude Date: Tue Aug 4 14:27:25 2015 New Revision: 286289 URL: https://svnweb.freebsd.org/changeset/base/286289 Log: xargs now takes -P0, creating as many concurrent processes as possible PR: 199976 Submitted by: Nikolai Lifanov Reviewed by: mjg, bjk Approved by: bapt (mentor) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2616 Modified: head/usr.bin/xargs/xargs.1 head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/xargs.1 ============================================================================== --- head/usr.bin/xargs/xargs.1 Tue Aug 4 13:50:52 2015 (r286288) +++ head/usr.bin/xargs/xargs.1 Tue Aug 4 14:27:25 2015 (r286289) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd March 16, 2012 +.Dd August 4, 2015 .Dt XARGS 1 .Os .Sh NAME @@ -207,6 +207,11 @@ Parallel mode: run at most invocations of .Ar utility at once. +If +.Ar maxprocs +is set to 0, +.Nm +will run as many processes as possible. .It Fl p Echo each command to be executed and ask the user whether it should be executed. Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Tue Aug 4 13:50:52 2015 (r286288) +++ head/usr.bin/xargs/xargs.c Tue Aug 4 14:27:25 2015 (r286289) @@ -46,9 +46,11 @@ static char sccsid[] = "@(#)xargs.c 8.1 #include __FBSDID("$FreeBSD$"); -#include +#include #include - +#include +#include +#include #include #include #include @@ -100,6 +102,7 @@ main(int argc, char *argv[]) long arg_max; int ch, Jflag, nargs, nflag, nline; size_t linelen; + struct rlimit rl; char *endptr; const char *errstr; @@ -166,6 +169,14 @@ main(int argc, char *argv[]) maxprocs = strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) errx(1, "-P %s: %s", optarg, errstr); + if (getrlimit(RLIMIT_NPROC, &rl) != 0) + errx(1, "getrlimit failed"); + if (*endptr != '\0') + errx(1, "invalid number for -P option"); + if (maxprocs < 0) + errx(1, "value for -P option should be >= 0"); + if (maxprocs == 0 || maxprocs > rl.rlim_cur) + maxprocs = rl.rlim_cur; break; case 'p': pflag = 1; From owner-svn-src-head@freebsd.org Tue Aug 4 15:04:29 2015 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 B60969B32FC; Tue, 4 Aug 2015 15:04:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A727ADCF; Tue, 4 Aug 2015 15:04:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74F4TDG050938; Tue, 4 Aug 2015 15:04:29 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74F4TWN050937; Tue, 4 Aug 2015 15:04:29 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201508041504.t74F4TWN050937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 4 Aug 2015 15:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286290 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 15:04:29 -0000 Author: kevlo Date: Tue Aug 4 15:04:28 2015 New Revision: 286290 URL: https://svnweb.freebsd.org/changeset/base/286290 Log: Add support for Planex GW-NS300N. Modified: head/share/man/man4/ral.4 Modified: head/share/man/man4/ral.4 ============================================================================== --- head/share/man/man4/ral.4 Tue Aug 4 14:27:25 2015 (r286289) +++ head/share/man/man4/ral.4 Tue Aug 4 15:04:28 2015 (r286290) @@ -14,7 +14,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2012 +.Dd August 4, 2015 .Dt RAL 4 .Os .Sh NAME @@ -184,6 +184,7 @@ chipsets, including: .It "MSI PC54G2" Ta RT2560 Ta PCI .It "OvisLink EVO-W54PCI" Ta RT2560 Ta PCI .It "PheeNet HWL-PCIG/RA" Ta RT2560 Ta PCI +.It "Planex GW-NS300N" Ta RT2860 Ta CardBus .It "Pro-Nets CB80211G" Ta RT2560 Ta CardBus .It "Pro-Nets PC80211G" Ta RT2560 Ta PCI .It "Repotec RP-WB7108" Ta RT2560 Ta CardBus From owner-svn-src-head@freebsd.org Tue Aug 4 16:08:17 2015 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 E46399B2602; Tue, 4 Aug 2015 16:08:17 +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 6C93D10FD; Tue, 4 Aug 2015 16:08:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t74G8Cqg042864 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 19:08:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t74G8Cqg042864 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t74G8CpK042863; Tue, 4 Aug 2015 19:08:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Aug 2015 19:08:12 +0300 From: Konstantin Belousov To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286288 - in head/sys/i386: i386 include Message-ID: <20150804160812.GP2072@kib.kiev.ua> References: <201508041350.t74DoraL020588@repo.freebsd.org> <55C0C59B.5040906@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C0C59B.5040906@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 16:08:18 -0000 On Tue, Aug 04, 2015 at 03:00:59PM +0100, Steven Hartland wrote: > This effects other platforms arm and mips spring to mind from when I > last checked. > > Would you like me to backout the checks I added to the ZFS module once > all the platforms are addressed? I stated my opinion in a review follow-up, IMO kernel should not lecture users. I cannot fix ARM or MIPS, and I am not even sure that the issue is there. Note that e.g. i386 uses clang, which somehow is much more stack-space hungry than even old gcc. From owner-svn-src-head@freebsd.org Tue Aug 4 16:15:01 2015 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 33F6B9B28B4; Tue, 4 Aug 2015 16:15:01 +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 DE0C41B19; Tue, 4 Aug 2015 16:15:00 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMerY-00008f-SH; Tue, 04 Aug 2015 19:14:48 +0300 Date: Tue, 4 Aug 2015 19:14:48 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: Warner Losh , src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Julian Elischer Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150804161448.GC24698@zxy.spb.ru> References: <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> <55C07826.9070002@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C07826.9070002@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 16:15:01 -0000 On Tue, Aug 04, 2015 at 09:30:30AM +0100, Steven Hartland wrote: > > > On 03/08/2015 21:48, Warner Losh wrote: > >> On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: > >> > >> On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: > >> > >>> On 8/3/15 8:03 PM, Konstantin Belousov wrote: > >>>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: > >>>>> For this change I don't want to get into fixing the thread0 stack size, > >>>>> which can be done later, just > >>>>> to provide a reasonable warning to the user that smaller values could > >>>>> cause a panic. > >>>> Hmm, is it limited to the thread0 only ? I.e., would only increasing > >>>> the initial thread stack size be enough to boot the kernel ? The zfs > >>>> threads do request larger stack size, I know this. > >>>> > >>>> Can somebody test the following patch in the i386 configuration which > >>>> does not boot ? > >>> I think this is a reasonable thing to do. Thread0 (and proc0) are special. > >>> I don't see why giving it a specially sized stack would be a problem. > >> This is always do for ARM. > >> May be need increase stack size for Thread0 on ARM too? > > Seems reasonable. There should be a MI way of doing this, but all the code and defines are buried in MD files, so each architecture needs some love to make this a reality. > > > > Warner > In the mean time are people happier with > https://reviews.freebsd.org/D3279 or should I just leave it using the > #define until someone has time to work on a full solution? Checking by #ifdef you check only parametr at time of building zfs.ko, checking variable you check actual value. May be check thread stack best if only for current tread. From owner-svn-src-head@freebsd.org Tue Aug 4 17:10:52 2015 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 EA1A19B37F2; Tue, 4 Aug 2015 17:10:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B36AD698; Tue, 4 Aug 2015 17:10:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t74HAqTs030516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Aug 2015 10:10:52 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t74HApLg030515; Tue, 4 Aug 2015 10:10:51 -0700 (PDT) (envelope-from jmg) Date: Tue, 4 Aug 2015 10:10:51 -0700 From: John-Mark Gurney To: Hans Petter Selasky Cc: Ed Schouten , Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286170 - head/share/man/man9 Message-ID: <20150804171051.GL78154@funkthat.com> References: <201508020022.t720MFqp023071@repo.freebsd.org> <20150802145434.V1128@besplex.bde.org> <55C09869.2040605@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C09869.2040605@selasky.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 04 Aug 2015 10:10:52 -0700 (PDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 17:10:53 -0000 Hans Petter Selasky wrote this message on Tue, Aug 04, 2015 at 12:48 +0200: > My gut feeling is it's good practice to have those wrapper macros > because they isolate the compiler into a consistent and coherent API. Except that we now have a consistent and coherent API w/ _Static_assert... We emulate this function on all compilers (or at least try to, see bde's other email about issues w/ the ifdef mess), and is available to both userland and kernel... It will also be available on other platforms, as opposed to having to port our CTASSERT macros to other platforms and introduce #ifdef's to make it compatible... > Wouldn't the argument be the same for queue.3 . Once C-compilers finally > decide to compile time support queues, we should throw queue.3 aswell? > I'd say it is better to stay independent of what the compiler guys will > come up with next, reminding me how hard it was to upgrade a machine > recently from 9- to 10- because of C++11 .... Last I checked, they don't change their API's ever revision of the langauge... Comparing this to C++11? Just wow, see above how this is properly covered by the ifdef mess in sys/cdefs.h for all compilers, this won't introduce any complications like the C++11... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@freebsd.org Tue Aug 4 17:47:14 2015 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 B60BA9B212F; Tue, 4 Aug 2015 17:47:14 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9FC3BBD4; Tue, 4 Aug 2015 17:47:14 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74HlE9m016945; Tue, 4 Aug 2015 17:47:14 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74HlCxn016937; Tue, 4 Aug 2015 17:47:12 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508041747.t74HlCxn016937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 4 Aug 2015 17:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286292 - in head/sys: netipsec opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 17:47:14 -0000 Author: jmg Date: Tue Aug 4 17:47:11 2015 New Revision: 286292 URL: https://svnweb.freebsd.org/changeset/base/286292 Log: Make IPsec work with AES-GCM and AES-ICM (aka CTR) in OCF... IPsec defines the keys differently than NIST does, so we have to muck with key lengths and nonce/IVs to be standard compliant... Remove the iv from secasvar as it was unused... Add a counter protected by a mutex to ensure that the counter for GCM and ICM will never be repeated.. This is a requirement for security.. I would use atomics, but we don't have a 64bit one on all platforms.. Fix a bug where IPsec was depending upon the OCF to ensure that the blocksize was always at least 4 bytes to maintain alignment... Move this logic into IPsec so changes to OCF won't break IPsec... In one place, espx was always non-NULL, so don't test that it's non-NULL before doing work.. minor style cleanups... drop setting key and klen as they were not used... Enforce that OCF won't pass invalid key lengths to AES that would panic the machine... This was has been tested by others too... I tested this against NetBSD 6.1.5 using mini-test suite in https://github.com/jmgurney/ipseccfgs and the only things that don't pass are keyed md5 and sha1, and 3des-deriv (setkey syntax error), all other modes listed in setkey's man page... The nice thing is that NetBSD uses setkey, so same config files were used on both... Reviewed by: gnn Modified: head/sys/netipsec/key.c head/sys/netipsec/key_debug.c head/sys/netipsec/keydb.h head/sys/netipsec/xform_esp.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/netipsec/key.c Tue Aug 4 17:47:11 2015 (r286292) @@ -2835,7 +2835,6 @@ key_cleansav(struct secasvar *sav) sav->tdb_xform->xf_zeroize(sav); sav->tdb_xform = NULL; } else { - KASSERT(sav->iv == NULL, ("iv but no xform")); if (sav->key_auth != NULL) bzero(sav->key_auth->key_data, _KEYLEN(sav->key_auth)); if (sav->key_enc != NULL) @@ -3013,7 +3012,6 @@ key_setsaval(struct secasvar *sav, struc sav->key_enc = NULL; sav->sched = NULL; sav->schedlen = 0; - sav->iv = NULL; sav->lft_c = NULL; sav->lft_h = NULL; sav->lft_s = NULL; Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/netipsec/key_debug.c Tue Aug 4 17:47:11 2015 (r286292) @@ -577,11 +577,6 @@ kdebug_secasv(struct secasvar *sav) kdebug_sadb_key((struct sadb_ext *)sav->key_auth); if (sav->key_enc != NULL) kdebug_sadb_key((struct sadb_ext *)sav->key_enc); - if (sav->iv != NULL) { - printf(" iv="); - ipsec_hexdump(sav->iv, sav->ivlen ? sav->ivlen : 8); - printf("\n"); - } if (sav->replay != NULL) kdebug_secreplay(sav->replay); Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/netipsec/keydb.h Tue Aug 4 17:47:11 2015 (r286292) @@ -122,10 +122,10 @@ struct secasvar { struct seckey *key_auth; /* Key for Authentication */ struct seckey *key_enc; /* Key for Encryption */ - caddr_t iv; /* Initilization Vector */ u_int ivlen; /* length of IV */ void *sched; /* intermediate encryption key */ size_t schedlen; + uint64_t cntr; /* counter for GCM and CTR */ struct secreplay *replay; /* replay prevention */ time_t created; /* for lifetime */ @@ -163,6 +163,12 @@ struct secasvar { #define SECASVAR_UNLOCK(_sav) mtx_unlock(&(_sav)->lock) #define SECASVAR_LOCK_DESTROY(_sav) mtx_destroy(&(_sav)->lock) #define SECASVAR_LOCK_ASSERT(_sav) mtx_assert(&(_sav)->lock, MA_OWNED) +#define SAV_ISGCM(_sav) \ + ((_sav)->alg_enc == SADB_X_EALG_AESGCM8 || \ + (_sav)->alg_enc == SADB_X_EALG_AESGCM12 || \ + (_sav)->alg_enc == SADB_X_EALG_AESGCM16) +#define SAV_ISCTR(_sav) ((_sav)->alg_enc == SADB_X_EALG_AESCTR) +#define SAV_ISCTRORGCM(_sav) (SAV_ISCTR((_sav)) || SAV_ISGCM((_sav))) /* replay prevention */ struct secreplay { Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/netipsec/xform_esp.c Tue Aug 4 17:47:11 2015 (r286292) @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -182,12 +184,14 @@ esp_init(struct secasvar *sav, struct xf __func__, txform->name)); return EINVAL; } - if ((sav->flags&(SADB_X_EXT_OLD|SADB_X_EXT_IV4B)) == SADB_X_EXT_IV4B) { + if ((sav->flags & (SADB_X_EXT_OLD | SADB_X_EXT_IV4B)) == + SADB_X_EXT_IV4B) { DPRINTF(("%s: 4-byte IV not supported with protocol\n", __func__)); return EINVAL; } - keylen = _KEYLEN(sav->key_enc); + /* subtract off the salt, RFC4106, 8.1 and RFC3686, 5.1 */ + keylen = _KEYLEN(sav->key_enc) - SAV_ISCTRORGCM(sav) * 4; if (txform->minkey > keylen || keylen > txform->maxkey) { DPRINTF(("%s: invalid key length %u, must be in the range " "[%u..%u] for algorithm %s\n", __func__, @@ -202,9 +206,10 @@ esp_init(struct secasvar *sav, struct xf * the ESP header will be processed incorrectly. The * compromise is to force it to zero here. */ - sav->ivlen = (txform == &enc_xform_null ? 0 : txform->ivsize); - sav->iv = (caddr_t) malloc(sav->ivlen, M_XDATA, M_WAITOK); - key_randomfill(sav->iv, sav->ivlen); /*XXX*/ + if (SAV_ISCTRORGCM(sav)) + sav->ivlen = 8; /* RFC4106 3.1 and RFC3686 3.1 */ + else + sav->ivlen = (txform == &enc_xform_null ? 0 : txform->ivsize); /* * Setup AH-related state. @@ -226,15 +231,15 @@ esp_init(struct secasvar *sav, struct xf */ if (sav->alg_enc == SADB_X_EALG_AESGCM16) { switch (keylen) { - case AES_128_HMAC_KEY_LEN: + case AES_128_GMAC_KEY_LEN: sav->alg_auth = SADB_X_AALG_AES128GMAC; sav->tdb_authalgxform = &auth_hash_nist_gmac_aes_128; break; - case AES_192_HMAC_KEY_LEN: + case AES_192_GMAC_KEY_LEN: sav->alg_auth = SADB_X_AALG_AES192GMAC; sav->tdb_authalgxform = &auth_hash_nist_gmac_aes_192; break; - case AES_256_HMAC_KEY_LEN: + case AES_256_GMAC_KEY_LEN: sav->alg_auth = SADB_X_AALG_AES256GMAC; sav->tdb_authalgxform = &auth_hash_nist_gmac_aes_256; break; @@ -246,19 +251,15 @@ esp_init(struct secasvar *sav, struct xf } bzero(&cria, sizeof(cria)); cria.cri_alg = sav->tdb_authalgxform->type; - cria.cri_klen = _KEYBITS(sav->key_enc) + 4; cria.cri_key = sav->key_enc->key_data; + cria.cri_klen = _KEYBITS(sav->key_enc) - SAV_ISGCM(sav) * 32; } /* Initialize crypto session. */ - bzero(&crie, sizeof (crie)); + bzero(&crie, sizeof(crie)); crie.cri_alg = sav->tdb_encalgxform->type; - crie.cri_klen = _KEYBITS(sav->key_enc); crie.cri_key = sav->key_enc->key_data; - if (sav->alg_enc == SADB_X_EALG_AESGCM16) - arc4rand(crie.cri_iv, sav->ivlen, 0); - - /* XXX Rounds ? */ + crie.cri_klen = _KEYBITS(sav->key_enc) - SAV_ISCTRORGCM(sav) * 32; if (sav->tdb_authalgxform && sav->tdb_encalgxform) { /* init both auth & enc */ @@ -291,10 +292,6 @@ esp_zeroize(struct secasvar *sav) if (sav->key_enc) bzero(sav->key_enc->key_data, _KEYLEN(sav->key_enc)); - if (sav->iv) { - free(sav->iv, M_XDATA); - sav->iv = NULL; - } sav->tdb_encalgxform = NULL; sav->tdb_xform = NULL; return error; @@ -310,6 +307,7 @@ esp_input(struct mbuf *m, struct secasva struct auth_hash *esph; struct enc_xform *espx; struct tdb_crypto *tc; + uint8_t *ivp; int plen, alen, hlen; struct newesp *esp; struct cryptodesc *crde; @@ -350,15 +348,13 @@ esp_input(struct mbuf *m, struct secasva */ plen = m->m_pkthdr.len - (skip + hlen + alen); if ((plen & (espx->blocksize - 1)) || (plen <= 0)) { - if (!espx || sav->alg_enc != SADB_X_EALG_AESGCM16) { - DPRINTF(("%s: payload of %d octets not a multiple of %d octets," - " SA %s/%08lx\n", __func__, - plen, espx->blocksize, ipsec_address(&sav->sah->saidx.dst, - buf, sizeof(buf)), (u_long) ntohl(sav->spi))); - ESPSTAT_INC(esps_badilen); - m_freem(m); - return EINVAL; - } + DPRINTF(("%s: payload of %d octets not a multiple of %d octets," + " SA %s/%08lx\n", __func__, plen, espx->blocksize, + ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), + (u_long)ntohl(sav->spi))); + ESPSTAT_INC(esps_badilen); + m_freem(m); + return EINVAL; } /* @@ -404,20 +400,13 @@ esp_input(struct mbuf *m, struct secasva /* Authentication descriptor */ crda->crd_skip = skip; - if (espx && espx->type == CRYPTO_AES_NIST_GCM_16) - crda->crd_len = hlen - sav->ivlen; + if (SAV_ISGCM(sav)) + crda->crd_len = 8; /* RFC4106 5, SPI + SN */ else crda->crd_len = m->m_pkthdr.len - (skip + alen); crda->crd_inject = m->m_pkthdr.len - alen; crda->crd_alg = esph->type; - if (espx && (espx->type == CRYPTO_AES_NIST_GCM_16)) { - crda->crd_key = sav->key_enc->key_data; - crda->crd_klen = _KEYBITS(sav->key_enc); - } else { - crda->crd_key = sav->key_auth->key_data; - crda->crd_klen = _KEYBITS(sav->key_auth); - } /* Copy the authenticator */ m_copydata(m, m->m_pkthdr.len - alen, alen, @@ -452,13 +441,26 @@ esp_input(struct mbuf *m, struct secasva crde->crd_len = m->m_pkthdr.len - (skip + hlen + alen); crde->crd_inject = skip + hlen - sav->ivlen; - crde->crd_alg = espx->type; - crde->crd_key = sav->key_enc->key_data; - crde->crd_klen = _KEYBITS(sav->key_enc); - if (espx && (espx->type == CRYPTO_AES_NIST_GCM_16)) + if (SAV_ISCTRORGCM(sav)) { + ivp = &crde->crd_iv[0]; + + /* GCM IV Format: RFC4106 4 */ + /* CTR IV Format: RFC3686 4 */ + /* Salt is last four bytes of key, RFC4106 8.1 */ + /* Nonce is last four bytes of key, RFC3686 5.1 */ + memcpy(ivp, sav->key_enc->key_data + + _KEYLEN(sav->key_enc) - 4, 4); + + if (SAV_ISCTR(sav)) { + /* Initial block counter is 1, RFC3686 4 */ + be32enc(&ivp[sav->ivlen + 4], 1); + } + + m_copydata(m, skip + hlen - sav->ivlen, sav->ivlen, &ivp[4]); crde->crd_flags |= CRD_F_IV_EXPLICIT; + } - /* XXX Rounds ? */ + crde->crd_alg = espx->type; return (crypto_dispatch(crp)); } @@ -664,6 +666,8 @@ esp_output(struct mbuf *m, struct ipsecr char buf[INET6_ADDRSTRLEN]; struct enc_xform *espx; struct auth_hash *esph; + uint8_t *ivp; + uint64_t cntr; int hlen, rlen, padding, blks, alen, i, roff; struct mbuf *mo = (struct mbuf *) NULL; struct tdb_crypto *tc; @@ -689,10 +693,9 @@ esp_output(struct mbuf *m, struct ipsecr rlen = m->m_pkthdr.len - skip; /* Raw payload length. */ /* - * NB: The null encoding transform has a blocksize of 4 - * so that headers are properly aligned. + * RFC4303 2.4 Requires 4 byte alignment. */ - blks = espx->ivsize; /* IV blocksize */ + blks = MAX(4, espx->blocksize); /* Cipher blocksize */ /* XXX clamp padding length a la KAME??? */ padding = ((blks - ((rlen + 2) % blks)) % blks) + 2; @@ -816,7 +819,7 @@ esp_output(struct mbuf *m, struct ipsecr m_copyback(m, protoff, sizeof(u_int8_t), (u_char *) &prot); /* Get crypto descriptors. */ - crp = crypto_getreq(esph && espx ? 2 : 1); + crp = crypto_getreq(esph != NULL ? 2 : 1); if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); @@ -825,29 +828,9 @@ esp_output(struct mbuf *m, struct ipsecr goto bad; } - if (espx) { - crde = crp->crp_desc; - crda = crde->crd_next; - - /* Encryption descriptor. */ - crde->crd_skip = skip + hlen; - crde->crd_len = m->m_pkthdr.len - (skip + hlen + alen); - crde->crd_flags = CRD_F_ENCRYPT; - crde->crd_inject = skip + hlen - sav->ivlen; - - /* Encryption operation. */ - crde->crd_alg = espx->type; - crde->crd_key = sav->key_enc->key_data; - crde->crd_klen = _KEYBITS(sav->key_enc); - if (espx->type == CRYPTO_AES_NIST_GCM_16) - crde->crd_flags |= CRD_F_IV_EXPLICIT; - /* XXX Rounds ? */ - } else - crda = crp->crp_desc; - /* IPsec-specific opaque crypto info. */ tc = (struct tdb_crypto *) malloc(sizeof(struct tdb_crypto), - M_XDATA, M_NOWAIT|M_ZERO); + M_XDATA, M_NOWAIT|M_ZERO); if (tc == NULL) { crypto_freereq(crp); DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); @@ -856,6 +839,40 @@ esp_output(struct mbuf *m, struct ipsecr goto bad; } + crde = crp->crp_desc; + crda = crde->crd_next; + + /* Encryption descriptor. */ + crde->crd_skip = skip + hlen; + crde->crd_len = m->m_pkthdr.len - (skip + hlen + alen); + crde->crd_flags = CRD_F_ENCRYPT; + crde->crd_inject = skip + hlen - sav->ivlen; + + /* Encryption operation. */ + crde->crd_alg = espx->type; + if (SAV_ISCTRORGCM(sav)) { + ivp = &crde->crd_iv[0]; + + /* GCM IV Format: RFC4106 4 */ + /* CTR IV Format: RFC3686 4 */ + /* Salt is last four bytes of key, RFC4106 8.1 */ + /* Nonce is last four bytes of key, RFC3686 5.1 */ + memcpy(ivp, sav->key_enc->key_data + + _KEYLEN(sav->key_enc) - 4, 4); + SECASVAR_LOCK(sav); + cntr = sav->cntr++; + SECASVAR_UNLOCK(sav); + be64enc(&ivp[4], cntr); + + if (SAV_ISCTR(sav)) { + /* Initial block counter is 1, RFC3686 4 */ + be32enc(&ivp[sav->ivlen + 4], 1); + } + + m_copyback(m, skip + hlen - sav->ivlen, sav->ivlen, &ivp[4]); + crde->crd_flags |= CRD_F_IV_EXPLICIT|CRD_F_IV_PRESENT; + } + /* Callback parameters */ tc->tc_isr = isr; KEY_ADDREFSA(sav); @@ -874,23 +891,13 @@ esp_output(struct mbuf *m, struct ipsecr if (esph) { /* Authentication descriptor. */ + crda->crd_alg = esph->type; crda->crd_skip = skip; - if (espx && espx->type == CRYPTO_AES_NIST_GCM_16) - crda->crd_len = hlen - sav->ivlen; + if (SAV_ISGCM(sav)) + crda->crd_len = 8; /* RFC4106 5, SPI + SN */ else crda->crd_len = m->m_pkthdr.len - (skip + alen); crda->crd_inject = m->m_pkthdr.len - alen; - - /* Authentication operation. */ - crda->crd_alg = esph->type; - if (espx && espx->type == CRYPTO_AES_NIST_GCM_16) { - crda->crd_key = sav->key_enc->key_data; - crda->crd_klen = _KEYBITS(sav->key_enc); - } else { - crda->crd_key = sav->key_auth->key_data; - crda->crd_klen = _KEYBITS(sav->key_auth); - } - } return crypto_dispatch(crp); @@ -921,7 +928,8 @@ esp_output_cb(struct cryptop *crp) IPSEC_ASSERT(isr->sp != NULL, ("NULL isr->sp")); IPSECREQUEST_LOCK(isr); sav = tc->tc_sav; - /* With the isr lock released SA pointer can be updated. */ + + /* With the isr lock released, SA pointer may have changed. */ if (sav != isr->sav) { ESPSTAT_INC(esps_notdb); DPRINTF(("%s: SA gone during crypto (SA %s/%08lx proto %u)\n", Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/opencrypto/cryptodev.h Tue Aug 4 17:47:11 2015 (r286292) @@ -78,7 +78,7 @@ #define SHA2_512_HASH_LEN 64 #define MD5_KPDK_HASH_LEN 16 #define SHA1_KPDK_HASH_LEN 20 -#define AES_HASH_LEN 16 +#define AES_GMAC_HASH_LEN 16 /* Maximum hash algorithm result length */ #define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */ @@ -102,12 +102,12 @@ #define SHA2_256_HMAC_KEY_LEN 32 #define SHA2_384_HMAC_KEY_LEN 48 #define SHA2_512_HMAC_KEY_LEN 64 -#define AES_128_HMAC_KEY_LEN 16 -#define AES_192_HMAC_KEY_LEN 24 -#define AES_256_HMAC_KEY_LEN 32 +#define AES_128_GMAC_KEY_LEN 16 +#define AES_192_GMAC_KEY_LEN 24 +#define AES_256_GMAC_KEY_LEN 32 /* Encryption algorithm block sizes */ -#define NULL_BLOCK_LEN 4 +#define NULL_BLOCK_LEN 4 /* IPsec to maintain alignment */ #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/opencrypto/cryptosoft.c Tue Aug 4 17:47:11 2015 (r286292) @@ -711,6 +711,7 @@ swcr_newsession(device_t dev, u_int32_t struct enc_xform *txf; struct comp_algo *cxf; u_int32_t i; + int len; int error; if (sid == NULL || cri == NULL) @@ -928,6 +929,10 @@ swcr_newsession(device_t dev, u_int32_t case CRYPTO_AES_256_NIST_GMAC: axf = &auth_hash_nist_gmac_aes_256; auth4common: + len = cri->cri_klen / 8; + if (len != 16 && len != 24 && len != 32) + return EINVAL; + (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); if ((*swd)->sw_ictx == NULL) { @@ -936,8 +941,7 @@ swcr_newsession(device_t dev, u_int32_t return ENOBUFS; } axf->Init((*swd)->sw_ictx); - axf->Setkey((*swd)->sw_ictx, cri->cri_key, - cri->cri_klen / 8); + axf->Setkey((*swd)->sw_ictx, cri->cri_key, len); (*swd)->sw_axf = axf; break; Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Tue Aug 4 15:15:06 2015 (r286291) +++ head/sys/opencrypto/xform.c Tue Aug 4 17:47:11 2015 (r286292) @@ -139,7 +139,7 @@ static int SHA512Update_int(void *, cons static u_int32_t deflate_compress(u_int8_t *, u_int32_t, u_int8_t **); static u_int32_t deflate_decompress(u_int8_t *, u_int32_t, u_int8_t **); -#define AESICM_BLOCKSIZE 16 +#define AESICM_BLOCKSIZE AES_BLOCK_LEN struct aes_icm_ctx { u_int32_t ac_ek[4*(RIJNDAEL_MAXNR + 1)]; @@ -353,7 +353,7 @@ struct auth_hash auth_hash_hmac_sha2_512 struct auth_hash auth_hash_nist_gmac_aes_128 = { CRYPTO_AES_128_NIST_GMAC, "GMAC-AES-128", - AES_128_HMAC_KEY_LEN, AES_HASH_LEN, sizeof(struct aes_gmac_ctx), + AES_128_GMAC_KEY_LEN, AES_GMAC_HASH_LEN, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, @@ -364,7 +364,7 @@ struct auth_hash auth_hash_nist_gmac_aes struct auth_hash auth_hash_nist_gmac_aes_192 = { CRYPTO_AES_192_NIST_GMAC, "GMAC-AES-192", - AES_192_HMAC_KEY_LEN, AES_HASH_LEN, sizeof(struct aes_gmac_ctx), + AES_192_GMAC_KEY_LEN, AES_GMAC_HASH_LEN, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, @@ -375,7 +375,7 @@ struct auth_hash auth_hash_nist_gmac_aes struct auth_hash auth_hash_nist_gmac_aes_256 = { CRYPTO_AES_256_NIST_GMAC, "GMAC-AES-256", - AES_256_HMAC_KEY_LEN, AES_HASH_LEN, sizeof(struct aes_gmac_ctx), + AES_256_GMAC_KEY_LEN, AES_GMAC_HASH_LEN, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, @@ -719,6 +719,9 @@ aes_icm_setkey(u_int8_t **sched, u_int8_ { struct aes_icm_ctx *ctx; + if (len != 16 && len != 24 && len != 32) + return EINVAL; + *sched = malloc(sizeof(struct aes_icm_ctx), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); if (*sched == NULL) @@ -726,8 +729,6 @@ aes_icm_setkey(u_int8_t **sched, u_int8_ ctx = (struct aes_icm_ctx *)*sched; ctx->ac_nr = rijndaelKeySetupEnc(ctx->ac_ek, (u_char *)key, len * 8); - if (ctx->ac_nr == 0) - return EINVAL; return 0; } From owner-svn-src-head@freebsd.org Tue Aug 4 17:47:33 2015 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 12A879B2158 for ; Tue, 4 Aug 2015 17:47:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm13-vm0.bullet.mail.bf1.yahoo.com (nm13-vm0.bullet.mail.bf1.yahoo.com [98.139.213.79]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF3C8D26 for ; Tue, 4 Aug 2015 17:47:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1438710445; bh=tstdlUa2CMgtpC/Ne0+nSWJOgFNCBkcZopm1gb4AhFo=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Ck///fepolBufMATMeS3Bx3jDXOyCig7kC9JbskZQ+aHnCS3IPMKRB88HM92nk/XWPzq8GhRuqBDPSM/FiS0uSrcpwg648K9NzWL3G4arzOOKf8snlqQaD1t3WWrSo3vCiNi8neYg0ElFXT8cv4dIfq0oM6rjS+64qAPVPjxheWJ2X/Iiz8tji3AaWCrmnijMddN9xntfzNHCe6wFfiUrhnBhlzIPZC9d6yQggkuEY5zopGbLDO+KCosnFSb+WnX3jzIyg0GN42zFR0ga83f4iQ7GNeBw4oFPY8ZFC76ukgvxRrx61rtcKtpCNzhZbRiNTJvfhl5Q7CASACHdIjLGw== Received: from [98.139.170.178] by nm13.bullet.mail.bf1.yahoo.com with NNFMP; 04 Aug 2015 17:47:25 -0000 Received: from [98.139.211.202] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 04 Aug 2015 17:47:25 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 04 Aug 2015 17:47:25 -0000 X-Yahoo-Newman-Id: 345328.92453.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: QoqYy3YVM1mvxpCcBo8qV8Xq4O18w8uFj9TJtVOn79UKx9p 2kqIIlbFmwONntF_UOt1IT0UbIvwJPDS3sj8genWfynWaAh835Y90YT.Sc4p gTw2qljL3_vuLn7UcDi1FGWNGI1QT86vXPoq6_KkKE6hjvYEO1FhL4w9hxRs Rx4Ux9YCkLscdv6XqE6JDy1W5k0e4n0hQt4rVfCvcCqR6XPQZoA.4y5JbuEV Hle_II2WQfTtoSE7W8SZl1rdtgUqwRyWEBRBnfuQUtkKWO6SEk9TnPgmAW6L A7l1Svp.zoCwHdGkxKi_BhLNquQb9UINPLJBpcYViCmJtDLagr6ZXd.qy5Xk JLLL2pc6LLAUnObpBod1CtdOAmtL.5DaPbu07QwriFU2rd83T5JB3rkoBULg kO9zfj0i7PdaP2FdJW3VWXhLw6e72g5L6CRjWAoUPEdpKZSSkf5i6Bd7lLkS T3iKlDCcZoiCQCqaSf1ewX_Iu84IJ3NM4Mqx7uo64dChzHjruq2cZvSjbEfQ h1AOdWVkNPw7b0tdIJDNFBhJ59WC_OHcz X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r286268 - head/usr.bin/wall To: Bruce Evans References: <201508040256.t742uWfQ053686@repo.freebsd.org> <20150804155237.L1126@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <55C0FAAF.4010704@FreeBSD.org> Date: Tue, 4 Aug 2015 12:47:27 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150804155237.L1126@besplex.bde.org> 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.20 Precedence: list List-Id: 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, 04 Aug 2015 17:47:33 -0000 On 08/04/15 01:12, Bruce Evans wrote: > On Tue, 4 Aug 2015, Pedro F. Giffuni wrote: > >> Log: >> Revert r286144 leaving the original fix to the buffer overflow. >> >> Some developers consider the new code unnecessarily obfuscated. >> There was also a benign off-by-one. >> >> Discussed with: bde, vangyzen, jmallett > > It is this version that is unnecessarily obfuscated. > I preferred the previous solution, with some adjustment for the off-by-one, but of course I am biased. I am aware you wanted a new fix with strlcat(): the original fix used strlcat so it should be nearer to your expected solution. At this time I really don't want to start a re-write of wall(1) beyond avoiding the buffer overflow. >> Modified: head/usr.bin/wall/ttymsg.c >> ============================================================================== >> >> --- head/usr.bin/wall/ttymsg.c Tue Aug 4 02:41:14 2015 (r286267) >> +++ head/usr.bin/wall/ttymsg.c Tue Aug 4 02:56:31 2015 (r286268) >> @@ -62,7 +62,7 @@ ttymsg(struct iovec *iov, int iovcnt, co >> struct iovec localiov[7]; >> ssize_t left, wret; >> int cnt, fd; >> - char device[MAXNAMLEN]; >> + char device[MAXNAMLEN] = _PATH_DEV; >> static char errbuf[1024]; >> char *p; >> int forked; > > Half of the string initialization is done by an auto initializer. > Initializations in declarations are specifically forbidden in style(9), > and this is a good example of how to obfuscate code using them. The > original version using a static initializer was almost as obfuscated, > but it was at least maximally efficient and had a technical reason > for using the initializer. > I understand initialization is done during compile time, while assignments are done in runtime. I personally prefer having the compiler do the effort instead of having the executable do it. Being this a style(9) issue I guess it should be fixed but it is a preexisting condition outside of the scope of the present patch: closing the overflow. >> @@ -71,9 +71,8 @@ ttymsg(struct iovec *iov, int iovcnt, co >> if (iovcnt > (int)(sizeof(localiov) / sizeof(localiov[0]))) >> return ("too many iov's (change code in wall/ttymsg.c)"); >> >> - strlcpy(device, _PATH_DEV, sizeof(device)); >> + strlcat(device, line, sizeof(device)); > > The other half of the initialization is done using strlcat(). > >> p = device + sizeof(_PATH_DEV) - 1; >> - strlcpy(p, line, sizeof(device) - sizeof(_PATH_DEV)); >> if (strncmp(p, "pts/", 4) == 0) >> p += 4; >> if (strchr(p, '/') != NULL) { > > In private mail, I pointed out lots more bad code here. The pointer > 'p' was introdiced to avoid writing out the expression for it in > more places, especially in the "pts/" check. But the "pts/" check > is badly written. It checks the copy of 'line' in 'device'. This > is an obfuscated way of checking 'line' itself. It might be more > secure the check the final string, but it is actually more secure > to check 'line' since this will detect slashes that lost by strlcat() > with no error checking. > > This method becomes even more unnatural when combined with the strcat(). > We use the knowledge of the prefix to find the place to start for the > check, but don't use this to find the place to start for the concatenation. > These places are the same, and unwinding the obfuscation in the check > requires knowing that they are the same. > I welcome a patch, but I don't want to run the risk of introducing more changes in this commit. This change is only about fixing a buffer overflow that breaks wall(1) when running it with bounds checking. Pedro. From owner-svn-src-head@freebsd.org Tue Aug 4 18:19:43 2015 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 0BAEE9B2B2E for ; Tue, 4 Aug 2015 18:19:43 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) (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 D167860 for ; Tue, 4 Aug 2015 18:19:42 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by obbop1 with SMTP id op1so13575043obb.2 for ; Tue, 04 Aug 2015 11:19: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:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=OS60yDEszMBhS0SjJ4poRap7Szr0Ic9tzSsLnN8sX48=; b=A4qoAjDMyhliKtcSJAKlqTPgagKhNXrbQ74si9Aw4PGVK+K+AJ/BouVy/3GUuNQTuP Ikd7PyUFds0mp8WkQqsT3kpmdQqCBNsUiO6wSVOAO/jcvDDWK5eWcT1oc73XFEOwkwn/ tgivm6yQotGhzD3QjE7eI/Dg8kO/MzXsnGE2XLrZvYvCIRBLXsoEGxeyw1TvAIi5+Z70 c0/XFYMX7M1YrtreRWCHSm5HIv+TBck93sjbegKer49V5VO2w4oEqRolHTxHfWT7cc8b 1far6QWdznlZZAS67nPzjvw2jrw8uL5gdvuasCxdlKMX+OAO7MrvY8K9sTsr8AnuS55+ Y8MA== X-Gm-Message-State: ALoCoQkpjXsAESJadTNkWIiiImkcSxAET9Mph+5hzmZ8G9dTtcz2b994Mc2tFJYkOOTlGies1fnF MIME-Version: 1.0 X-Received: by 10.182.86.72 with SMTP id n8mr4564603obz.9.1438712376362; Tue, 04 Aug 2015 11:19:36 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 4 Aug 2015 11:19:36 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <20150731152253.Y1843@besplex.bde.org> References: <201507310328.t6V3S3LC087650@repo.freebsd.org> <20150731152253.Y1843@besplex.bde.org> Date: Tue, 4 Aug 2015 20:19:36 +0200 Message-ID: Subject: Re: svn commit: r286103 - head/share/man/man9 From: Ed Schouten To: Bruce Evans Cc: John-Mark Gurney , 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.20 Precedence: list List-Id: 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, 04 Aug 2015 18:19:43 -0000 2015-07-31 8:21 GMT+02:00 Bruce Evans : > For gcc before 4.6, > the ifdef reduces to using __COUNTER__ as the second variable if > __COUNTER__ is supported, else nothing. So for the undocumented > subset of compilers that support __COUNTER__ all cases work, and > for the complementary subset no cases work (the macro is null). I was wondering: could we solve this by not using a typedef, but an external declaration: extern int __whatever[expr ? 1 : -1]; I think we can safely repeat this multiple times without triggering any compiler errors. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 4 18:23:23 2015 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 B67B59B2C67 for ; Tue, 4 Aug 2015 18:23:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (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 82A10682 for ; Tue, 4 Aug 2015 18:23:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by igbpg9 with SMTP id pg9so17102986igb.0 for ; Tue, 04 Aug 2015 11:23:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=E2x9s1Cn0HuFlETcx4JYKG5qwRdDhRiWlH3OOlgq8p8=; b=BdmQwFIDuY9Y0O9i/umBi1XECmxBbnmKP00c289JnSTESJ6x2W0Paxrc+aRSsPK8Tg 5eB6bgtzytlBTiMjiDdDOmXd4fg7gvSU/t7AsmGmAKhBSIF8cgVxFbP896onDioEjJfC JAiL98Him5Rbk53Ajwo58EIbvk+9ZCAWBQV3bIoDcf0Y9u6Vcjjim0xwDm1Y2r/7zOFj pgsrJF5xFINo2zQp4IrMGk/wr6IjopB2M9vETom8wvIVwBJ6MSkhZgzNcG+YYVwVgfuV /FUnZghulmMQG2Axv7feSHLNDZ8P0Xih14E/Y1DzOHMNSGb9zuDGiNG6qi7zBj3+MX/T yWMw== X-Gm-Message-State: ALoCoQkEFjOnR5PICdyBrr5VHczZXNcMZOiSrG5uMxHYKnawKPgfP4Vt2nJKStTuCBKZlmoPuSQq X-Received: by 10.50.88.8 with SMTP id bc8mr922105igb.46.1438712597429; Tue, 04 Aug 2015 11:23:17 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id k68sm95208iod.8.2015.08.04.11.23.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Aug 2015 11:23:16 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r286103 - head/share/man/man9 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_75426D4E-E6AF-483A-A501-151C65AC5939"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: Date: Tue, 4 Aug 2015 12:23:14 -0600 Cc: Bruce Evans , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2B9D4FA9-FDB2-405D-B8C0-BE9918941159@bsdimp.com> References: <201507310328.t6V3S3LC087650@repo.freebsd.org> <20150731152253.Y1843@besplex.bde.org> To: Ed Schouten X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 18:23:23 -0000 --Apple-Mail=_75426D4E-E6AF-483A-A501-151C65AC5939 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 4, 2015, at 12:19 PM, Ed Schouten wrote: >=20 > 2015-07-31 8:21 GMT+02:00 Bruce Evans : >> For gcc before 4.6, >> the ifdef reduces to using __COUNTER__ as the second variable if >> __COUNTER__ is supported, else nothing. So for the undocumented >> subset of compilers that support __COUNTER__ all cases work, and >> for the complementary subset no cases work (the macro is null). >=20 > I was wondering: could we solve this by not using a typedef, but an > external declaration: >=20 > extern int __whatever[expr ? 1 : -1]; >=20 > I think we can safely repeat this multiple times without triggering > any compiler errors. There=E2=80=99s at least one compiler in common use that warns about extern int fred[1]; extern int fred[1]; being a repeated declaration (despite being legal C). Warner --Apple-Mail=_75426D4E-E6AF-483A-A501-151C65AC5939 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 iQIcBAEBCgAGBQJVwQMSAAoJEGwc0Sh9sBEAnB8P/0Ha/x+2+ZkoK2ALA7O1wDDO C5a1J7JsqmDdkLid1NzcqHZFeOFt6BWiajSw4auIw96f7FAdI3VMR9CCj8DHivfS PFqfLx2SDV6Yb0kE1m456gb8Kgzcq2l8YJWtkGaSO+Lm/vMkUsK63YH0L6uyVX65 6moEk0gJeiodnYMqsLakj3nllpGX4Ozspjy529ra7/RnIxAU72fbX0OBiNGfNJhR xcydjHr/N2SOket8++xUoINhlc3PTGUO9zL7Q3Ftm+FZJMI0JsIogdjGmS0Zvy2i Zogldh72SIRKwr6KGMz5eddH2upqk4d5PTjjMsIHNt6dikbUcLoqNKc2Up6ieQ39 9LhDWf7PorNqStBwXgM+zddpAFeC8BJYDDyvkQ6f9AZYGbtiC1IA1V81XeMqNH6+ efGfbeShmTIB+E7QaoVxYF8V5tZZOKxz/XJCBzesDwP2ixjoFgOH13qh5VgZsBMF ecpRMy/q0zJ05XhVLBvFoTiEAcuDihXBaWh1oRnh/fUXbSrKg7pkOXVoeT83ziKa xG87UYBnejAxMgGQY9JhMbpNn/BxtCwZir1Vyp74cVHKh6j3SWC7dRB03lHs5D71 xYiSU4YcfK8S9YKsYPq9HMDNDvtUMSyq7wETZ0dQ4AQxs8l2Mr+Pz9XIWjmot5n7 DKZYiB2NyAxDo2sQVLty =lanK -----END PGP SIGNATURE----- --Apple-Mail=_75426D4E-E6AF-483A-A501-151C65AC5939-- From owner-svn-src-head@freebsd.org Tue Aug 4 18:27:26 2015 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 6EFFD9B2D12 for ; Tue, 4 Aug 2015 18:27:26 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.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 38F0A866 for ; Tue, 4 Aug 2015 18:27:26 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by oihn130 with SMTP id n130so9880387oih.2 for ; Tue, 04 Aug 2015 11:27:24 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6SKieCLg/xhezel9GXGbAaecMWfr/SE4qGrHUgjuch0=; b=JCUYvLP1yknWcp4X0Lpi3EI9PX6KKeBhoQNvzcDuDe1vziFX3YO6MfS3VAu2+Cvkm4 bgkdD9Ld3PmBVTj863sCf9SBeDJP915iqJQarVaDyoU+t21/BeRCdMrpLmGA0sqj0ZJn XngRgxNRxn/EoOhrpvlOhRS0gjrzvjgGZ+xL2vaKWqs595B1mh3LGu2b4pARAcrdTGOn +/jlmnS93E2eZ0zHWvpaVjMs/4Oa0GnoKECvvuXal6wU6PkTcx3ix/WT2YfPg2h6RGTp gTs78vKk1bZiLKTzgqmSckUs04VTyjjioog6KbNgNwnm1Jvh3I3IdOFE7t5cX4pLOKEs tS4A== X-Gm-Message-State: ALoCoQlTRyWjhzmQx5KIzGjjyVzJxGpD8suCHN3011ng12g9K87l5zaQIHnxBhV/yU21Hktnzq1l MIME-Version: 1.0 X-Received: by 10.202.48.22 with SMTP id w22mr4235021oiw.95.1438712844803; Tue, 04 Aug 2015 11:27:24 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 4 Aug 2015 11:27:24 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <2B9D4FA9-FDB2-405D-B8C0-BE9918941159@bsdimp.com> References: <201507310328.t6V3S3LC087650@repo.freebsd.org> <20150731152253.Y1843@besplex.bde.org> <2B9D4FA9-FDB2-405D-B8C0-BE9918941159@bsdimp.com> Date: Tue, 4 Aug 2015 20:27:24 +0200 Message-ID: Subject: Re: svn commit: r286103 - head/share/man/man9 From: Ed Schouten To: Warner Losh Cc: Bruce Evans , John-Mark Gurney , src-committers , 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.20 Precedence: list List-Id: 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, 04 Aug 2015 18:27:26 -0000 2015-08-04 20:23 GMT+02:00 Warner Losh : > There=E2=80=99s at least one compiler in common use that warns about > > extern int fred[1]; > extern int fred[1]; > > being a repeated declaration (despite being legal C). Would you happen to know which one that is? --=20 Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 4 18:59:55 2015 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 8934599569C; Tue, 4 Aug 2015 18:59:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7A93E1BF6; Tue, 4 Aug 2015 18:59:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74IxtSL047276; Tue, 4 Aug 2015 18:59:55 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74IxtCh047275; Tue, 4 Aug 2015 18:59:55 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201508041859.t74IxtCh047275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 4 Aug 2015 18:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286293 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 18:59:55 -0000 Author: jkim Date: Tue Aug 4 18:59:54 2015 New Revision: 286293 URL: https://svnweb.freebsd.org/changeset/base/286293 Log: Fix style(9) bugs. Modified: head/sys/x86/include/_types.h Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Tue Aug 4 17:47:11 2015 (r286292) +++ head/sys/x86/include/_types.h Tue Aug 4 18:59:54 2015 (r286293) @@ -154,12 +154,11 @@ typedef int ___wchar_t; typedef __builtin_va_list __va_list; /* internally known to gcc */ #else #ifdef __LP64__ -typedef struct { - unsigned int __gpo; - unsigned int __fpo; - void *__oaa; - void *__rsa; -} __va_list; +struct __s_va_list { + __uint32_t pad1[2]; /* gp_offset, fp_offset */ + __uint64_t pad2[2]; /* overflow_arg_area, reg_save_area */ +}; +typedef struct __s_va_list __va_list; #else typedef char * __va_list; #endif From owner-svn-src-head@freebsd.org Tue Aug 4 19:04:03 2015 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 580089958D6; Tue, 4 Aug 2015 19:04:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 495D613C; Tue, 4 Aug 2015 19:04:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74J43RF051258; Tue, 4 Aug 2015 19:04:03 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74J43xm051257; Tue, 4 Aug 2015 19:04:03 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508041904.t74J43xm051257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 4 Aug 2015 19:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286294 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 19:04:03 -0000 Author: rpaulo Date: Tue Aug 4 19:04:02 2015 New Revision: 286294 URL: https://svnweb.freebsd.org/changeset/base/286294 Log: BEAGLEBONE: remove dtrace from MODULES_EXTRA. This config is already building all modules, so we don't need the MODULES_EXTRA definition. It was also causing problems to users who rely on MODULES_OVERRIDE to do the right thing. Discussed with: ian Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue Aug 4 18:59:54 2015 (r286293) +++ head/sys/arm/conf/BEAGLEBONE Tue Aug 4 19:04:02 2015 (r286294) @@ -32,7 +32,6 @@ makeoptions MODULES_EXTRA="dtb/am335x" options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data makeoptions WITH_CTF=1 -makeoptions MODULES_EXTRA+="opensolaris dtrace dtrace/profile dtrace/fbt" options HZ=100 options SCHED_4BSD # 4BSD scheduler From owner-svn-src-head@freebsd.org Tue Aug 4 19:04:59 2015 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 D77269959C0; Tue, 4 Aug 2015 19:04:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (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 C5AEE303; Tue, 4 Aug 2015 19:04:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 319176559E; Tue, 4 Aug 2015 19:04:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r286265 - head/sys/x86/include To: Bruce Evans , Konstantin Belousov References: <201508040011.t740BeD3088014@repo.freebsd.org> <20150804041458.GF2072@kib.kiev.ua> <20150804143613.H896@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim X-Enigmail-Draft-Status: N1110 Message-ID: <55C10CDA.4070006@FreeBSD.org> Date: Tue, 4 Aug 2015 15:04:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150804143613.H896@besplex.bde.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 19:05:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 08/04/2015 01:04, Bruce Evans wrote: > On Tue, 4 Aug 2015, Konstantin Belousov wrote: > >> On Tue, Aug 04, 2015 at 12:11:40AM +0000, Jung-uk Kim wrote: >>> Log: Always define __va_list for amd64 and restore pre-r232261 >>> behavior for i386. Note it allows exotic compilers, e.g., TCC, >>> to build with our stdio.h, etc. > > Thanks. > >>> PR: 201749 MFC after: 1 week >>> >>> Modified: head/sys/x86/include/_types.h >>> >>> Modified: head/sys/x86/include/_types.h >>> ============================================================================== >>> >>> >>> - --- head/sys/x86/include/_types.h Tue Aug 4 00:11:38 2015 >>> (r286264) +++ head/sys/x86/include/_types.h Tue Aug 4 >>> 00:11:39 2015 (r286265) @@ -152,8 +152,17 @@ typedef int >>> ___wchar_t; */ #ifdef __GNUCLIKE_BUILTIN_VARARGS typedef >>> __builtin_va_list __va_list; /* internally known to gcc >>> */ -#elif defined(lint) -typedef char * >>> __va_list; /* pretend */ +#else +#ifdef __LP64__ +typedef >>> struct { + unsigned int __gpo; + unsigned int >>> __fpo; + void *__oaa; + void *__rsa; +} >>> __va_list; > > Ugh. This is ugly and has many excical style bugs: - tab in > 'typedef struct' - use of 'typedef struct' at all. style(9) > forbids this. structs should be declared with a tag and the used > directly. That means '#define __va_list struct __s_va_list' > here Fixed. Actually, I followed sys/powerpc/include/_types.h style. I guess we should fix that, too. > - verbose spelling of 'unsigned' This file consistently uses "unsigned int" instead of "unsigned". > - ugly indentation from previous - excessive underscores in struct > member names. Only names in outer scope need 2 underscores and . > See stdio.h. Fixed. >> What do the structure fields mean ? How is it related to the >> amd64 vararg ABI ? > > It seems ABI compatible, but perhaps not API compatible. The > double underscores in the names might be to match an API. But I > doubt that old compilers even support the __LP64__ case. The > certainly don't access these names in any FreeBSD header. So the > ABI could be matched by defining __va_list as an array of 3 > uint64_t's or as a struct with unnamed fields or padding. Done. I was not really interested in API compatibility. FYI, "Figure 3.34: va_list Type Declaration" defines the structure like this: typedef struct { unsigned int gp_offset; unsigned int fp_offset; void *overflow_arg_area; void *reg_save_area; } va_list[1]; >>> +#else +typedef char * __va_list; > > This still has the '*' misplaced. Note all sys/*/include/_types.h has similar style problems. Jung-uk Kim >>> +#endif #endif #if defined(__GNUC_VA_LIST_COMPATIBILITY) && >>> !defined(__GNUC_VA_LIST) \ && !defined(__NO_GNUC_VA_LIST) > > Is this uglyness still necessary? The gnu-style '&&' in it isn't. > This seems to be for very old versions of gcc that probably don't > have builtin varargs. In old versions of this file, the condition > defined(__GNUC_VA_LIST_COMPATIBILITY) was defined(__GNUC__) && > !defined(__INTEL_COMPILER__), so I think this ifdef is just for > defining something used in old gcc's distribution stdarg.h. The > __INTEL_COMPILER__ part of this makes no sense, and > __GNUC_VA_LIST_COMPATIBILITY is now just an obfuscated spelling of > __GNUC__. Since this is for old gcc internals, non-gcc compilers > are unlikely to need it for compatibility, so the obfuscation is > just wrong. > > Bruce -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVwQzUAAoJEHyflib82/FGbSsH/RfgNJxjeu8tJV7KE7szVLV1 bdfzGLXDs/40M4NqCjVd+9z2CFGzvfIfNXWykIwCTV0HAE6UUMb4BpirTYy9lfQF V7y61bd6Mn6i4NbIKMksO6KZduPzGDFAbfPOX4WHOQ6IwPiG/2mzUY9oIT0Sd90D B42Z+p1YljJfFHfaNsupL6xtYDR0SbB3avXeLaTWqf9QatTZvPatHMIncJsZ65ZD x2FAAC7g0Xjp8DKgWiEYmbEKYQsNJgDQ1jQJlmiI3pSdp+yOdQG3RkUs+Pd54Qte LkVdOVYRUwDIxEZIRNVcIpCEo6E+jYgRFfjZZB2v7UXVx8qoKO1qmP/RFyxRHcw= =sj5l -----END PGP SIGNATURE----- From owner-svn-src-head@freebsd.org Tue Aug 4 19:23:43 2015 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 293CF995F7A for ; Tue, 4 Aug 2015 19:23:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 EB4D469 for ; Tue, 4 Aug 2015 19:23:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by ioeg141 with SMTP id g141so27333330ioe.3 for ; Tue, 04 Aug 2015 12:23: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:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=4z1X0XcCg/VYU7LjTMNaLVZK0Iftt/5rUaKTWbwEDVg=; b=g4jC5qLHtE+9neJknFQ9BgAwE3XcH6BIR8YT+4yxUNGhE6bN3n9mInLDU8rCN/Ayjx PctulYqalX8qDymz0XPiuEnFF7eCnHiDCDq83FIqpfyGvSjq/BjuqlJrm2MZhWuVU+U+ q7QG8/NxZYGa5a0p8mN0tbU1HuBC9O5zf8ckvyJKbCMtckmBF8yGvcE6cl6C40Z0TpeU kUxloYEzDFmqDhgh+jOqbldDPgB6ODKiIzA+qwe8hJWkaGASVajB9o/92BjyBHhRUMZT VEEtURL6kUiMwFZzWEQ+pg7PJRpbDz2I7129bnw3TKlTcvLZ7S5PQbfG6ZgJXFOhcUI/ hegA== X-Gm-Message-State: ALoCoQnkCjmyoGLiWy3zJbG4543A6ml0ogKPao4ovjjnBxfb7BCTdMqKNmpjlButyBDuwPkEEyBU X-Received: by 10.107.12.194 with SMTP id 63mr6551040iom.4.1438716216490; Tue, 04 Aug 2015 12:23:36 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id b32sm212125iod.16.2015.08.04.12.23.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Aug 2015 12:23:34 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r286294 - head/sys/arm/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AD9CA067-3A67-40E8-A91C-F08E788C40E4"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <201508041904.t74J43xm051257@repo.freebsd.org> Date: Tue, 4 Aug 2015 13:23:31 -0600 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6D2565DD-042D-46AA-8F7A-A337EA0A2674@bsdimp.com> References: <201508041904.t74J43xm051257@repo.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 19:23:43 -0000 --Apple-Mail=_AD9CA067-3A67-40E8-A91C-F08E788C40E4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 4, 2015, at 1:04 PM, Rui Paulo wrote: >=20 > Author: rpaulo > Date: Tue Aug 4 19:04:02 2015 > New Revision: 286294 > URL: https://svnweb.freebsd.org/changeset/base/286294 >=20 > Log: > BEAGLEBONE: remove dtrace from MODULES_EXTRA. >=20 > This config is already building all modules, so we don't need the > MODULES_EXTRA definition. It was also causing problems to users who > rely on MODULES_OVERRIDE to do the right thing. -makeoptions MODULES_EXTRA+=3D"opensolaris dtrace dtrace/profile = dtrace/fbt=E2=80=9D The dtrace modules are building by default on ARM now? Are you sure? My = reading of the sys/modules/Makefile says that it isn=E2=80=99t on ARM. It was = added specifically for the dtrace stuff. Now the dtrace stuff isn=E2=80=99t built. Warner --Apple-Mail=_AD9CA067-3A67-40E8-A91C-F08E788C40E4 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 iQIcBAEBCgAGBQJVwRE0AAoJEGwc0Sh9sBEAueUQAK5t+7pVIH82L+hjDrVAX7vU QFFwzQ2azaWhrzJGISProiO7X8OjCNx/mAAPDQ52WXXqDek+s4uFpQRMXsk+Hzc+ AlGUBlKoJgUu5b95DNWyfJtXPEejsZ01KNyXEqtrmC2vpgTVkeJ4SOcQfUfEqIkf 7o0d6lzts4RPRy6wZXasEsINCjwDNKtbrPlzCDy6Olbg4qebx2EpdvdJxX4Ol7a+ 3yY6OvXPIgYAZL0k8afl8HVFMEbzPHS5AYjB2rdsAtesyXVXS1Y2BC1XqOdcmi1i qAO1Hg867LkC4DvgFAFM5k+c8gBl2NNYRbppDtxLsxP0KVz9zW2gEWYy1Uw8hwVT gvtA0+2YB7n+JyUmyEURhoXEXTyoUxAhH8vhROfC4rDfdezGwDhVFqYiCMsyf7CH jzliQ4uECVvc6dpLQRwxqhLJgJ/fey6CXeqx7WXqgyPANj3RM9QhEbspG7LQrict LLb9LXfyitn00iCF3n1syca6iwtWgFKsvsoxOfbp4/9jg2kjp8gfgLs16F5IEisf iCo4aWbp96taHIW7741zR9WnOGlzjVMSpceU7sg9/H1O91IVUU54y+wMf9Rtp5iQ K6J54oZw0oHjl5oLm/wZwXU907Jk4bkAdFPAAYdrp+hdBCo1vFsObpZ+ywN1Gx6f 2j5hlyomJmV+DoLxvA1C =Cxy/ -----END PGP SIGNATURE----- --Apple-Mail=_AD9CA067-3A67-40E8-A91C-F08E788C40E4-- From owner-svn-src-head@freebsd.org Tue Aug 4 19:46:21 2015 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 8EC659B35B7; Tue, 4 Aug 2015 19:46:21 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7D29CFFE; Tue, 4 Aug 2015 19:46:21 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t74JkLsT070272; Tue, 4 Aug 2015 19:46:21 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t74JkExD070238; Tue, 4 Aug 2015 19:46:14 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201508041946.t74JkExD070238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Tue, 4 Aug 2015 19:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286296 - in head/sys: amd64/amd64 arm/arm arm/include arm64/arm64 i386/i386 i386/include mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/include sparc64/spa... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 19:46:21 -0000 Author: jah Date: Tue Aug 4 19:46:13 2015 New Revision: 286296 URL: https://svnweb.freebsd.org/changeset/base/286296 Log: Add two new pmap functions: vm_offset_t pmap_quick_enter_page(vm_page_t m) void pmap_quick_remove_page(vm_offset_t kva) These will create and destroy a temporary, CPU-local KVA mapping of a specified page. Guarantees: --Will not sleep and will not fail. --Safe to call under a non-sleepable lock or from an ithread Restrictions: --Not guaranteed to be safe to call from an interrupt filter or under a spin mutex on all platforms --Current implementation does not guarantee more than one page of mapping space across all platforms. MI code should not make nested calls to pmap_quick_enter_page. --MI code should not perform locking while holding onto a mapping created by pmap_quick_enter_page The idea is to use this in busdma, for bounce buffer copies as well as virtually-indexed cache maintenance on mips and arm. NOTE: the non-i386, non-amd64 implementations of these functions still need review and testing. Reviewed by: kib Approved by: kib (mentor) Differential Revision: http://reviews.freebsd.org/D3013 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/include/pcpu.h head/sys/arm64/arm64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/include/pcpu.h head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/include/pcpu.h head/sys/sparc64/sparc64/pmap.c head/sys/vm/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/amd64/amd64/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -6940,6 +6940,18 @@ pmap_unmap_io_transient(vm_page_t page[] } } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ +} + #include "opt_ddb.h" #ifdef DDB #include Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/arm/arm/pmap-v6-new.c Tue Aug 4 19:46:13 2015 (r286296) @@ -1156,6 +1156,22 @@ pmap_bootstrap(vm_offset_t firstaddr) virtual_end = vm_max_kernel_address; } +static void +pmap_init_qpages(void) +{ + struct pcpu *pc; + int i; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL); + /* * The function can already be use in second initialization stage. * As such, the function DOES NOT call pmap_growkernel() where PT2 @@ -5709,6 +5725,42 @@ pmap_copy_pages(vm_page_t ma[], vm_offse mtx_unlock(&sysmaps->lock); } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + pt2_entry_t *pte; + vm_offset_t qmap_addr; + + critical_enter(); + + qmap_addr = PCPU_GET(qmap_addr); + pte = pt2map_entry(qmap_addr); + + KASSERT(*pte == 0, ("pmap_quick_enter_page: PTE busy")); + + pte2_store(pte, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), + PTE2_AP_KRW, pmap_page_get_memattr(m))); + tlb_flush_local(qmap_addr); + + return (qmap_addr); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + pt2_entry_t *pte; + vm_offset_t qmap_addr; + + qmap_addr = PCPU_GET(qmap_addr); + pte = pt2map_entry(qmap_addr); + + KASSERT(addr == qmap_addr, ("pmap_quick_remove_page: invalid address")); + KASSERT(*pte != 0, ("pmap_quick_remove_page: PTE not in use")); + + pte2_clear(pte); + critical_exit(); +} + /* * Copy the range specified by src_addr/len * from the source map to the range dst_addr/len Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/arm/arm/pmap-v6.c Tue Aug 4 19:46:13 2015 (r286296) @@ -1979,6 +1979,7 @@ pmap_bootstrap(vm_offset_t firstaddr, st pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } + /*************************************************** * Pmap allocation/deallocation routines. ***************************************************/ @@ -2306,6 +2307,31 @@ pmap_remove_pages(pmap_t pmap) PMAP_UNLOCK(pmap); } +static void +pmap_init_qpages(void) +{ + struct pcpu *pc; + struct l2_bucket *l2b; + int i; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + + l2b = pmap_get_l2_bucket(pmap_kernel(), pc->pc_qmap_addr); + if (l2b == NULL) + l2b = pmap_grow_l2_bucket(pmap_kernel(), + pc->pc_qmap_addr); + if (l2b == NULL) + panic("pmap_alloc_specials: no l2b for 0x%x", + pc->pc_qmap_addr); + pc->pc_qmap_pte = &l2b->l2b_kva[l2pte_index(pc->pc_qmap_addr)]; + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL); /*************************************************** * Low level mapping routines..... @@ -4678,6 +4704,49 @@ pmap_copy_page(vm_page_t src, vm_page_t pmap_copy_page_generic(VM_PAGE_TO_PHYS(src), VM_PAGE_TO_PHYS(dst)); } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + pt_entry_t *qmap_pte; + vm_offset_t qmap_addr; + + critical_enter(); + + qmap_addr = PCPU_GET(qmap_addr); + qmap_pte = PCPU_GET(qmap_pte); + + KASSERT(*qmap_pte == 0, ("pmap_quick_enter_page: PTE busy")); + + *qmap_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(m) | L2_S_REF; + if (m->md.pv_memattr != VM_MEMATTR_UNCACHEABLE) + *qmap_pte |= pte_l2_s_cache_mode; + pmap_set_prot(qmap_pte, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(qmap_pte); + cpu_tlb_flushD_SE(qmap_addr); + cpu_cpwait(); + + return (qmap_addr); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + pt_entry_t *qmap_pte; + + qmap_pte = PCPU_GET(qmap_pte); + + KASSERT(addr == PCPU_GET(qmap_addr), + ("pmap_quick_remove_page: invalid address")); + KASSERT(*qmap_pte != 0, + ("pmap_quick_remove_page: PTE not in use")); + + cpu_idcache_wbinv_range(addr, PAGE_SIZE); + pmap_l2cache_wbinv_range(addr, *qmap_pte & L2_S_FRAME, PAGE_SIZE); + *qmap_pte = 0; + PTE_SYNC(qmap_pte); + critical_exit(); +} + /* * this routine returns true if a physical page resides * in the given pmap. Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/arm/arm/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -227,8 +227,8 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; static pt_entry_t *csrc_pte, *cdst_pte; -static vm_offset_t csrcp, cdstp; -static struct mtx cmtx; +static vm_offset_t csrcp, cdstp, qmap_addr; +static struct mtx cmtx, qmap_mtx; static void pmap_init_l1(struct l1_ttable *, pd_entry_t *); /* @@ -2155,6 +2155,7 @@ pmap_bootstrap(vm_offset_t firstaddr, st pd_entry_t pde; pd_entry_t *kernel_l1pt = (pd_entry_t *)l1pt->pv_va; pt_entry_t *ptep; + pt_entry_t *qmap_pte; vm_paddr_t pa; vm_offset_t va; vm_size_t size; @@ -2276,6 +2277,8 @@ pmap_bootstrap(vm_offset_t firstaddr, st pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)csrc_pte); pmap_alloc_specials(&virtual_avail, 1, &cdstp, &cdst_pte); pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)cdst_pte); + pmap_alloc_specials(&virtual_avail, 1, &qmap_addr, &qmap_pte); + pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)qmap_pte); size = ((vm_max_kernel_address - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE; pmap_alloc_specials(&virtual_avail, @@ -2302,6 +2305,7 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); + mtx_init(&qmap_mtx, "quick mapping mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } @@ -4343,6 +4347,34 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + /* + * Don't bother with a PCPU pageframe, since we don't support + * SMP for anything pre-armv7. Use pmap_kenter() to ensure + * caching is handled correctly for multiple mappings of the + * same physical page. + */ + + mtx_assert(&qmap_mtx, MA_NOTOWNED); + mtx_lock(&qmap_mtx); + + pmap_kenter(qmap_addr, VM_PAGE_TO_PHYS(m)); + + return (qmap_addr); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + KASSERT(addr == qmap_addr, + ("pmap_quick_remove_page: invalid address")); + mtx_assert(&qmap_mtx, MA_OWNED); + pmap_kremove(addr); + mtx_unlock(&qmap_mtx); +} + /* * this routine returns true if a physical page resides * in the given pmap. Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/arm/include/pcpu.h Tue Aug 4 19:46:13 2015 (r286296) @@ -47,10 +47,14 @@ struct vmspace; unsigned int pc_vfpmvfr0; \ unsigned int pc_vfpmvfr1; \ struct pmap *pc_curpmap; \ - char __pad[141] + vm_offset_t pc_qmap_addr; \ + void *pc_qmap_pte; \ + char __pad[133] #else #define PCPU_MD_FIELDS \ - char __pad[157] + vm_offset_t qmap_addr; \ + void *pc_qmap_pte; \ + char __pad[149] #endif #ifdef _KERNEL Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/arm64/arm64/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -2441,6 +2441,18 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ +} + /* * Returns true if the pmap's pv is one of the first * 16 pvs linked to from this page. This count may Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/i386/i386/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -512,6 +512,22 @@ pmap_bootstrap(vm_paddr_t firstaddr) pmap_set_pg(); } +static void +pmap_init_qpages(void) +{ + struct pcpu *pc; + int i; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL); + /* * Setup the PAT MSR. */ @@ -5400,6 +5416,39 @@ pmap_align_superpage(vm_object_t object, *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + vm_offset_t qaddr; + pt_entry_t *pte; + + critical_enter(); + qaddr = PCPU_GET(qmap_addr); + pte = vtopte(qaddr); + + KASSERT(*pte == 0, ("pmap_quick_enter_page: PTE busy")); + *pte = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | + pmap_cache_bits(pmap_page_get_memattr(m), 0); + invlpg(qaddr); + + return (qaddr); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + vm_offset_t qaddr; + pt_entry_t *pte; + + qaddr = PCPU_GET(qmap_addr); + pte = vtopte(qaddr); + + KASSERT(*pte != 0, ("pmap_quick_remove_page: PTE not in use")); + KASSERT(addr == qaddr, ("pmap_quick_remove_page: invalid address")); + + *pte = 0; + critical_exit(); +} #if defined(PMAP_DEBUG) pmap_pid_dump(int pid) Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/i386/include/pcpu.h Tue Aug 4 19:46:13 2015 (r286296) @@ -58,7 +58,8 @@ int pc_private_tss; /* Flag indicating private tss*/\ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ u_int pc_vcpu_id; /* Xen vCPU ID */ \ - char __pad[233] + vm_offset_t pc_qmap_addr; /* KVA for temporary mappings */\ + char __pad[229] #ifdef _KERNEL Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/mips/mips/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -2638,6 +2638,62 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ +#if defined(__mips_n64) + return MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m)); +#else + vm_paddr_t pa; + struct local_sysmaps *sysm; + pt_entry_t *pte; + + pa = VM_PAGE_TO_PHYS(m); + + if (MIPS_DIRECT_MAPPABLE(pa)) + return (MIPS_PHYS_TO_DIRECT(pa)); + + critical_enter(); + sysm = &sysmap_lmem[PCPU_GET(cpuid)]; + + KASSERT(sysm->valid1 == 0, ("pmap_quick_enter_page: PTE busy")); + + pte = pmap_pte(kernel_pmap, sysm->base); + *pte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | + (is_cacheable_mem(pa) ? PTE_C_CACHE : PTE_C_UNCACHED); + sysm->valid1 = 1; + + return (sysm->base); +#endif +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + mips_dcache_wbinv_range(addr, PAGE_SIZE); + +#if !defined(__mips_n64) + struct local_sysmaps *sysm; + pt_entry_t *pte; + + if (addr >= MIPS_KSEG0_START && addr < MIPS_KSEG0_END) + return; + + sysm = &sysmap_lmem[PCPU_GET(cpuid)]; + + KASSERT(sysm->valid1 != 0, + ("pmap_quick_remove_page: PTE not in use")); + KASSERT(sysm->base == addr, + ("pmap_quick_remove_page: invalid address")); + + pte = pmap_pte(kernel_pmap, addr); + *pte = PTE_G; + tlb_invalidate_address(kernel_pmap, addr); + sysm->valid1 = 0; + critical_exit(); +#endif +} + /* * Returns true if the pmap's pv is one of the first * 16 pvs linked to from this page. This count may Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/aim/mmu_oea.c Tue Aug 4 19:46:13 2015 (r286296) @@ -316,6 +316,8 @@ boolean_t moea_dev_direct_mapped(mmu_t, static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, void **va); void moea_scan_init(mmu_t mmu); +vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); +void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_clear_modify, moea_clear_modify), @@ -351,6 +353,8 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_activate, moea_activate), MMUMETHOD(mmu_deactivate, moea_deactivate), MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), + MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), + MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, moea_bootstrap), @@ -1082,6 +1086,18 @@ moea_zero_page_idle(mmu_t mmu, vm_page_t moea_zero_page(mmu, m); } +vm_offset_t +moea_quick_enter_page(mmu_t mmu, vm_page_t m) +{ + + return (VM_PAGE_TO_PHYS(m)); +} + +void +moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) +{ +} + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Aug 4 19:46:13 2015 (r286296) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -227,6 +228,7 @@ static u_int moea64_clear_bit(mmu_t, vm static void moea64_kremove(mmu_t, vm_offset_t); static void moea64_syncicache(mmu_t, pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_size_t sz); +static void moea64_pmap_init_qpages(void); /* * Kernel MMU interface @@ -278,6 +280,8 @@ static void moea64_sync_icache(mmu_t, pm void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, void **va); void moea64_scan_init(mmu_t mmu); +vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); +void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_clear_modify, moea64_clear_modify), @@ -314,6 +318,8 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_activate, moea64_activate), MMUMETHOD(mmu_deactivate, moea64_deactivate), MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), + MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), + MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), /* Internal interfaces */ MMUMETHOD(mmu_mapdev, moea64_mapdev), @@ -974,6 +980,29 @@ moea64_late_bootstrap(mmu_t mmup, vm_off } } +static void +moea64_pmap_init_qpages(void) +{ + struct pcpu *pc; + int i; + + if (hw_direct_map) + return; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + PMAP_LOCK(kernel_pmap); + pc->pc_qmap_pvo = moea64_pvo_find_va(kernel_pmap, pc->pc_qmap_addr); + PMAP_UNLOCK(kernel_pmap); + mtx_init(&pc->pc_qmap_lock, "qmap lock", NULL, MTX_DEF); + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, moea64_pmap_init_qpages, NULL); + /* * Activate a user pmap. This mostly involves setting some non-CPU * state. @@ -1206,6 +1235,48 @@ moea64_zero_page_idle(mmu_t mmu, vm_page moea64_zero_page(mmu, m); } +vm_offset_t +moea64_quick_enter_page(mmu_t mmu, vm_page_t m) +{ + struct pvo_entry *pvo; + vm_paddr_t pa = VM_PAGE_TO_PHYS(m); + + if (hw_direct_map) + return (pa); + + /* + * MOEA64_PTE_REPLACE does some locking, so we can't just grab + * a critical section and access the PCPU data like on i386. + * Instead, pin the thread and grab the PCPU lock to prevent + * a preempting thread from using the same PCPU data. + */ + sched_pin(); + + mtx_assert(PCPU_PTR(qmap_lock), MA_NOTOWNED); + pvo = PCPU_GET(qmap_pvo); + + mtx_lock(PCPU_PTR(qmap_lock)); + pvo->pvo_pte.pa = moea64_calc_wimg(pa, pmap_page_get_memattr(m)) | + (uint64_t)pa; + MOEA64_PTE_REPLACE(mmu, pvo, MOEA64_PTE_INVALIDATE); + isync(); + + return (PCPU_GET(qmap_addr)); +} + +void +moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) +{ + if (hw_direct_map) + return; + + mtx_assert(PCPU_PTR(qmap_lock), MA_OWNED); + KASSERT(PCPU_GET(qmap_addr) == addr, + ("moea64_quick_remove_page: invalid address")); + mtx_unlock(PCPU_PTR(qmap_lock)); + sched_unpin(); +} + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/booke/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -246,6 +246,8 @@ static void pv_free(pv_entry_t); static void pv_insert(pmap_t, vm_offset_t, vm_page_t); static void pv_remove(pmap_t, vm_offset_t, vm_page_t); +static void booke_pmap_init_qpages(void); + /* Number of kva ptbl buffers, each covering one ptbl (PTBL_PAGES). */ #define PTBL_BUFS (128 * 16) @@ -332,6 +334,8 @@ static void mmu_booke_dumpsys_map(mmu_t static void mmu_booke_dumpsys_unmap(mmu_t, vm_paddr_t pa, size_t, void *); static void mmu_booke_scan_init(mmu_t); +static vm_offset_t mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m); +static void mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr); static mmu_method_t mmu_booke_methods[] = { /* pmap dispatcher interface */ @@ -371,6 +375,8 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_zero_page_idle, mmu_booke_zero_page_idle), MMUMETHOD(mmu_activate, mmu_booke_activate), MMUMETHOD(mmu_deactivate, mmu_booke_deactivate), + MMUMETHOD(mmu_quick_enter_page, mmu_booke_quick_enter_page), + MMUMETHOD(mmu_quick_remove_page, mmu_booke_quick_remove_page), /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, mmu_booke_bootstrap), @@ -1351,6 +1357,22 @@ pmap_bootstrap_ap(volatile uint32_t *trc } #endif +static void +booke_pmap_init_qpages(void) +{ + struct pcpu *pc; + int i; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, booke_pmap_init_qpages, NULL); + /* * Get the physical page address for the given pmap/virtual address. */ @@ -2272,6 +2294,61 @@ mmu_booke_zero_page_idle(mmu_t mmu, vm_p mmu_booke_kremove(mmu, va); } +static vm_offset_t +mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) +{ + vm_paddr_t paddr; + vm_offset_t qaddr; + uint32_t flags; + pte_t *pte; + + paddr = VM_PAGE_TO_PHYS(m); + + flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; + flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)); + + critical_enter(); + qaddr = PCPU_GET(qmap_addr); + + pte = &(kernel_pmap->pm_pdir[PDIR_IDX(qaddr)][PTBL_IDX(qaddr)]); + + KASSERT(pte->flags == 0, ("mmu_booke_quick_enter_page: PTE busy")); + + /* + * XXX: tlbivax is broadcast to other cores, but qaddr should + * not be present in other TLBs. Is there a better instruction + * sequence to use? Or just forget it & use mmu_booke_kenter()... + */ + __asm __volatile("tlbivax 0, %0" :: "r"(qaddr & MAS2_EPN_MASK)); + __asm __volatile("isync; msync"); + + pte->rpn = paddr & ~PTE_PA_MASK; + pte->flags = flags; + + /* Flush the real memory from the instruction cache. */ + if ((flags & (PTE_I | PTE_G)) == 0) + __syncicache((void *)qaddr, PAGE_SIZE); + + return (qaddr); +} + +static void +mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr) +{ + pte_t *pte; + + pte = &(kernel_pmap->pm_pdir[PDIR_IDX(addr)][PTBL_IDX(addr)]); + + KASSERT(PCPU_GET(qmap_addr) == addr, + ("mmu_booke_quick_remove_page: invalid address")); + KASSERT(pte->flags != 0, + ("mmu_booke_quick_remove_page: PTE not in use")); + + pte->flags = 0; + pte->rpn = 0; + critical_exit(); +} + /* * Return whether or not the specified physical page was modified * in any of physical maps. Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/include/pcpu.h Tue Aug 4 19:46:13 2015 (r286296) @@ -35,6 +35,7 @@ #include struct pmap; +struct pvo_entry; #define CPUSAVE_LEN 9 #define PCPU_MD_COMMON_FIELDS \ @@ -53,6 +54,9 @@ struct pmap; void *pc_restore; #define PCPU_MD_AIM32_FIELDS \ + vm_offset_t pc_qmap_addr; \ + struct pvo_entry *pc_qmap_pvo; \ + struct mtx pc_qmap_lock; \ /* char __pad[0] */ #define PCPU_MD_AIM64_FIELDS \ @@ -60,7 +64,10 @@ struct pmap; struct slb **pc_userslb; \ register_t pc_slbsave[18]; \ uint8_t pc_slbstack[1024]; \ - char __pad[1137] + vm_offset_t pc_qmap_addr; \ + struct pvo_entry *pc_qmap_pvo; \ + struct mtx pc_qmap_lock; \ + char __pad[1121 - sizeof(struct mtx)] #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS @@ -78,9 +85,10 @@ struct pmap; register_t pc_booke_mchksave[CPUSAVE_LEN]; \ register_t pc_booke_tlbsave[BOOKE_TLBSAVE_LEN]; \ register_t pc_booke_tlb_level; \ + vm_offset_t pc_qmap_addr; \ uint32_t *pc_booke_tlb_lock; \ int pc_tid_next; \ - char __pad[173] + char __pad[165] /* Definitions for register offsets within the exception tmp save areas */ #define CPUSAVE_R27 0 /* where r27 gets saved */ Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/powerpc/mmu_if.m Tue Aug 4 19:46:13 2015 (r286296) @@ -933,3 +933,26 @@ METHOD void dumpsys_unmap { METHOD void scan_init { mmu_t _mmu; }; + +/** + * @brief Create a temporary thread-local KVA mapping of a single page. + * + * @param _pg The physical page to map + * + * @retval addr The temporary KVA + */ +METHOD vm_offset_t quick_enter_page { + mmu_t _mmu; + vm_page_t _pg; +}; + +/** + * @brief Undo a mapping created by quick_enter_page + * + * @param _va The mapped KVA + */ +METHOD void quick_remove_page { + mmu_t _mmu; + vm_offset_t _va; +}; + Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Tue Aug 4 19:46:13 2015 (r286296) @@ -550,6 +550,20 @@ dumpsys_pa_init(void) return (MMU_SCAN_INIT(mmu_obj)); } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + return (MMU_QUICK_ENTER_PAGE(mmu_obj, m)); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + CTR2(KTR_PMAP, "%s(%#x)", __func__, addr); + MMU_QUICK_REMOVE_PAGE(mmu_obj, addr); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/sparc64/include/pcpu.h Tue Aug 4 19:46:13 2015 (r286296) @@ -51,6 +51,7 @@ struct pmap; struct intr_request *pc_irfree; \ struct pmap *pc_pmap; \ vm_offset_t pc_addr; \ + vm_offset_t pc_qmap_addr; \ u_long pc_tickref; \ u_long pc_tickadj; \ u_long pc_tickincrement; \ @@ -61,7 +62,7 @@ struct pmap; u_int pc_tlb_ctx; \ u_int pc_tlb_ctx_max; \ u_int pc_tlb_ctx_min; \ - char __pad[405] + char __pad[397] #ifdef _KERNEL Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/sparc64/sparc64/pmap.c Tue Aug 4 19:46:13 2015 (r286296) @@ -143,6 +143,7 @@ static int pmap_protect_tte(struct pmap struct tte *tp, vm_offset_t va); static int pmap_unwire_tte(pmap_t pm, pmap_t pm2, struct tte *tp, vm_offset_t va); +static void pmap_init_qpages(void); /* * Map the given physical page at the specified virtual address in the @@ -680,6 +681,25 @@ pmap_bootstrap(u_int cpu_impl) tlb_flush_nonlocked(); } +static void +pmap_init_qpages(void) +{ + struct pcpu *pc; + int i; + + if (dcache_color_ignore != 0) + return; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_qmap_addr = kva_alloc(PAGE_SIZE * DCACHE_COLORS); + if (pc->pc_qmap_addr == 0) + panic("pmap_init_qpages: unable to allocate KVA"); + } +} + +SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL); + /* * Map the 4MB kernel TSB pages. */ @@ -1934,6 +1954,54 @@ pmap_copy_page(vm_page_t msrc, vm_page_t } } +vm_offset_t +pmap_quick_enter_page(vm_page_t m) +{ + vm_paddr_t pa; + vm_offset_t qaddr; + struct tte *tp; + + pa = VM_PAGE_TO_PHYS(m); + if (dcache_color_ignore != 0 || m->md.color == DCACHE_COLOR(pa)) + return (TLB_PHYS_TO_DIRECT(pa)); + + critical_enter(); + qaddr = PCPU_GET(qmap_addr); + qaddr += (PAGE_SIZE * ((DCACHE_COLORS + DCACHE_COLOR(pa) - + DCACHE_COLOR(qaddr)) % DCACHE_COLORS)); + tp = tsb_kvtotte(qaddr); + + KASSERT(tp->tte_data == 0, ("pmap_quick_enter_page: PTE busy")); + + tp->tte_data = TD_V | TD_8K | TD_PA(pa) | TD_CP | TD_CV | TD_W; + tp->tte_vpn = TV_VPN(qaddr, TS_8K); + + return (qaddr); +} + +void +pmap_quick_remove_page(vm_offset_t addr) +{ + vm_offset_t qaddr; + struct tte *tp; + + if (addr >= VM_MIN_DIRECT_ADDRESS) + return; + + tp = tsb_kvtotte(addr); + qaddr = PCPU_GET(qmap_addr); + + KASSERT((addr >= qaddr) && (addr < (qaddr + (PAGE_SIZE * DCACHE_COLORS))), + ("pmap_quick_remove_page: invalid address")); + KASSERT(tp->tte_data != 0, ("pmap_quick_remove_page: PTE not in use")); + + stxa(TLB_DEMAP_VA(addr) | TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_VA(addr) | TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); + TTE_ZERO(tp); + critical_exit(); +} + int unmapped_buf_allowed; void Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Tue Aug 4 19:43:48 2015 (r286295) +++ head/sys/vm/pmap.h Tue Aug 4 19:46:13 2015 (r286296) @@ -152,6 +152,8 @@ void pmap_unwire(pmap_t pmap, vm_offse void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); void pmap_zero_page_idle(vm_page_t); +vm_offset_t pmap_quick_enter_page(vm_page_t); +void pmap_quick_remove_page(vm_offset_t); #define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) #define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) From owner-svn-src-head@freebsd.org Tue Aug 4 20:07:10 2015 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 48F559B3BB6 for ; Tue, 4 Aug 2015 20:07:10 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) (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 F3E07EF0 for ; Tue, 4 Aug 2015 20:07:09 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wijp15 with SMTP id p15so20573846wij.0 for ; Tue, 04 Aug 2015 13:07: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:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Qxcb9H9ZhLQuo1H5STyyIWknLobEnhB3KongaOyxKWc=; b=OAETsFobKOt3MICSFRihtFQexR8c8Rvr+78bPDS4r9y/r71vEg40qsNrOP6G+4RoUX n+VYvMR776YG6iDZKUYt8YcA0KqK/XVQx7CpuAMXsgenVO6mI0gKRfcgyDMPlvjDzWLL sko0fH18LxpbeIdr6mQpzq57nbm1NjlqHXhZZr4SIQt6jl+6GCvXPbFSv3+wTPHyX2yw UMoJY6lh3zNIUzcrzZH33PVoqh9X7zIQeo4WoFLIFFyFmtX78pjn8OA1s9S/cRehUorS DSqyJhQIj0At0zaYFu7MFVu6KOd8hvQCclr9qcqGILWiaLAu+iPFDhNP+8hz9uHOWFaf cSIA== X-Gm-Message-State: ALoCoQmaBjzSg+56N0u1RgbNlrSUEt8m4212eT+1cZNkZ3YsyJCBNgc0jbDUL+Ta4GBImDdUeSuA X-Received: by 10.180.77.40 with SMTP id p8mr2314131wiw.29.1438718822216; Tue, 04 Aug 2015 13:07:02 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id pu6sm508841wjc.34.2015.08.04.13.07.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Aug 2015 13:07:00 -0700 (PDT) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov References: <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> <55C07826.9070002@multiplay.co.uk> <20150804161448.GC24698@zxy.spb.ru> Cc: Warner Losh , src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Julian Elischer From: Steven Hartland Message-ID: <55C11B5F.2080007@multiplay.co.uk> Date: Tue, 4 Aug 2015 21:06:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150804161448.GC24698@zxy.spb.ru> 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.20 Precedence: list List-Id: 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, 04 Aug 2015 20:07:10 -0000 On 04/08/2015 17:14, Slawa Olhovchenkov wrote: > On Tue, Aug 04, 2015 at 09:30:30AM +0100, Steven Hartland wrote: > >> >> On 03/08/2015 21:48, Warner Losh wrote: >>>> On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: >>>> >>>> On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: >>>> >>>>> On 8/3/15 8:03 PM, Konstantin Belousov wrote: >>>>>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >>>>>>> For this change I don't want to get into fixing the thread0 stack size, >>>>>>> which can be done later, just >>>>>>> to provide a reasonable warning to the user that smaller values could >>>>>>> cause a panic. >>>>>> Hmm, is it limited to the thread0 only ? I.e., would only increasing >>>>>> the initial thread stack size be enough to boot the kernel ? The zfs >>>>>> threads do request larger stack size, I know this. >>>>>> >>>>>> Can somebody test the following patch in the i386 configuration which >>>>>> does not boot ? >>>>> I think this is a reasonable thing to do. Thread0 (and proc0) are special. >>>>> I don't see why giving it a specially sized stack would be a problem. >>>> This is always do for ARM. >>>> May be need increase stack size for Thread0 on ARM too? >>> Seems reasonable. There should be a MI way of doing this, but all the code and defines are buried in MD files, so each architecture needs some love to make this a reality. >>> >>> Warner >> In the mean time are people happier with >> https://reviews.freebsd.org/D3279 or should I just leave it using the >> #define until someone has time to work on a full solution? > Checking by #ifdef you check only parametr at time of building zfs.ko, > checking variable you check actual value. > May be check thread stack best if only for current tread. Not sure I follow you as its not a #ifdef check its straight if in the new version i.e. if (kstack_pages < ZFS_MIN_KSTACK_PAGES) { Just in case you didn't notice kib committed a fix for i386 thread0 in r286288 so this may not be needed at all any more which is good news :) Regards Steve From owner-svn-src-head@freebsd.org Tue Aug 4 20:24:18 2015 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 211049B30E9; Tue, 4 Aug 2015 20:24:18 +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 CCDA21CD2; Tue, 4 Aug 2015 20:24:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMikt-0005RD-Ff; Tue, 04 Aug 2015 23:24:11 +0300 Date: Tue, 4 Aug 2015 23:24:11 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: Warner Losh , src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Julian Elischer Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150804202411.GD8792@zxy.spb.ru> References: <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> <55C07826.9070002@multiplay.co.uk> <20150804161448.GC24698@zxy.spb.ru> <55C11B5F.2080007@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C11B5F.2080007@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 04 Aug 2015 20:24:18 -0000 On Tue, Aug 04, 2015 at 09:06:55PM +0100, Steven Hartland wrote: > > > On 04/08/2015 17:14, Slawa Olhovchenkov wrote: > > On Tue, Aug 04, 2015 at 09:30:30AM +0100, Steven Hartland wrote: > > > >> > >> On 03/08/2015 21:48, Warner Losh wrote: > >>>> On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: > >>>> > >>>> On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: > >>>> > >>>>> On 8/3/15 8:03 PM, Konstantin Belousov wrote: > >>>>>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: > >>>>>>> For this change I don't want to get into fixing the thread0 stack size, > >>>>>>> which can be done later, just > >>>>>>> to provide a reasonable warning to the user that smaller values could > >>>>>>> cause a panic. > >>>>>> Hmm, is it limited to the thread0 only ? I.e., would only increasing > >>>>>> the initial thread stack size be enough to boot the kernel ? The zfs > >>>>>> threads do request larger stack size, I know this. > >>>>>> > >>>>>> Can somebody test the following patch in the i386 configuration which > >>>>>> does not boot ? > >>>>> I think this is a reasonable thing to do. Thread0 (and proc0) are special. > >>>>> I don't see why giving it a specially sized stack would be a problem. > >>>> This is always do for ARM. > >>>> May be need increase stack size for Thread0 on ARM too? > >>> Seems reasonable. There should be a MI way of doing this, but all the code and defines are buried in MD files, so each architecture needs some love to make this a reality. > >>> > >>> Warner > >> In the mean time are people happier with > >> https://reviews.freebsd.org/D3279 or should I just leave it using the > >> #define until someone has time to work on a full solution? > > Checking by #ifdef you check only parametr at time of building zfs.ko, > > checking variable you check actual value. > > May be check thread stack best if only for current tread. > Not sure I follow you as its not a #ifdef check its straight if in the > new version i.e. > if (kstack_pages < ZFS_MIN_KSTACK_PAGES) { This check checked how actual kernel compile vs how compile zfs.ko. Remeber that kenel may be compiled independed from modules? > Just in case you didn't notice kib committed a fix for i386 thread0 in > r286288 so this may not be needed at all any more which is good news :) If I understund kib fix (and you about ZFS stack requirements) you need check curthread->td_kstack_pages (for case old, unfixed kerenel, depended from KSTACK_PAGES in Thread0). I.e. for all cases: - unfixed kernel with KSTACK_PAGES < 4 - unfixed kernel with KSTACK_PAGES >= 4 - fixed kernel with KSTACK_PAGES < 4 - fixed kernel with KSTACK_PAGES >= 4 - compiling zfs.ko separately from kernel with different KSTACK_PAGES - using zfs.ko with old kernel checking curthread->td_kstack_pages is right way (or, may be curthread->td_kstack_pages*PAGE_SIZE -- I am not cleanly understund what need to check -- size in bytes or size in pages). Checking KSTACK_PAGES by ifdef can produce vrong result. From owner-svn-src-head@freebsd.org Tue Aug 4 23:15:31 2015 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 8EBF19B394F; Tue, 4 Aug 2015 23:15:31 +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 4673514B4; Tue, 4 Aug 2015 23:15:30 +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 5F28925D37D1; Tue, 4 Aug 2015 23:15:20 +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 533E7C76FEB; Tue, 4 Aug 2015 23:15:19 +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 xekwvrzdScsX; Tue, 4 Aug 2015 23:15:18 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:c1ce:98f8:3a8:95a9] (unknown [IPv6:fde9:577b:c1a9:4410:c1ce:98f8:3a8:95a9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6A86CC76FEA; Tue, 4 Aug 2015 23:15:17 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286292 - in head/sys: netipsec opencrypto From: "Bjoern A. Zeeb" In-Reply-To: <201508041747.t74HlCxn016937@repo.freebsd.org> Date: Tue, 4 Aug 2015 23:14:57 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3DBFA7E4-B0F6-4B39-911D-20147D8FCEF8@FreeBSD.org> References: <201508041747.t74HlCxn016937@repo.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 23:15:31 -0000 > On 04 Aug 2015, at 17:47 , John-Mark Gurney wrote: >=20 > Author: jmg > Date: Tue Aug 4 17:47:11 2015 > New Revision: 286292 > URL: https://svnweb.freebsd.org/changeset/base/286292 >=20 > Log: > .. . .. >=20 > Reviewed by: gnn >=20 This should have been 6-8 commits; dissecting what is what even if obvious in some places will even be more pain to understand this in 4 = years from now. Especially given it seems cleanup, whitespace, and multiple functional changes all mixed together; not to mention that it=E2=80=99s (complex) security stuff.= From owner-svn-src-head@freebsd.org Tue Aug 4 23:22:13 2015 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 924A99B3B2C; Tue, 4 Aug 2015 23:22:13 +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 4A3F21AC2; Tue, 4 Aug 2015 23:22:12 +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 1273325D3A7B; Tue, 4 Aug 2015 23:22:10 +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 34A85C76FEB; Tue, 4 Aug 2015 23:22:10 +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 cfvLOWukijyL; Tue, 4 Aug 2015 23:22:08 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:c1ce:98f8:3a8:95a9] (unknown [IPv6:fde9:577b:c1a9:4410:c1ce:98f8:3a8:95a9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id EE96FC76FEA; Tue, 4 Aug 2015 23:22:07 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286296 - in head/sys: amd64/amd64 arm/arm arm/include arm64/arm64 i386/i386 i386/include mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/include sparc64/spa... From: "Bjoern A. Zeeb" In-Reply-To: <201508041946.t74JkExD070238@repo.freebsd.org> Date: Tue, 4 Aug 2015 23:22:02 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508041946.t74JkExD070238@repo.freebsd.org> To: "Jason A. Harmening" X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 23:22:13 -0000 > On 04 Aug 2015, at 19:46 , Jason A. Harmening wrote: >=20 > Author: jah > Date: Tue Aug 4 19:46:13 2015 > New Revision: 286296 > URL: https://svnweb.freebsd.org/changeset/base/286296 >=20 > Log: > Add two new pmap functions: > vm_offset_t pmap_quick_enter_page(vm_page_t m) > void pmap_quick_remove_page(vm_offset_t kva) >=20 > These will create and destroy a temporary, CPU-local KVA mapping of a = specified page. >=20 > Guarantees: > --Will not sleep and will not fail. > --Safe to call under a non-sleepable lock or from an ithread >=20 > Restrictions: > --Not guaranteed to be safe to call from an interrupt filter or under = a spin mutex on all platforms > --Current implementation does not guarantee more than one page of = mapping space across all platforms. MI code should not make nested calls = to pmap_quick_enter_page. > --MI code should not perform locking while holding onto a mapping = created by pmap_quick_enter_page >=20 > The idea is to use this in busdma, for bounce buffer copies as well = as virtually-indexed cache maintenance on mips and arm. >=20 > NOTE: the non-i386, non-amd64 implementations of these functions = still need review and testing. Most of this description should go into a section 9 man page rather than = the commit message ;-) /bz From owner-svn-src-head@freebsd.org Tue Aug 4 23:50:29 2015 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 CDAAA9B310E; Tue, 4 Aug 2015 23:50:29 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com [IPv6:2607:f8b0:4003:c01::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 907B8771; Tue, 4 Aug 2015 23:50:29 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by obnw1 with SMTP id w1so19447014obn.3; Tue, 04 Aug 2015 16:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=TjgkAr/GHwliK7jHItvP6+YaZzeAYu9UWZFlqtE5ePA=; b=roV6CuKOh+QsriaIwnLAjwQs/hkXLQS2q6fBBbVPV4dWYbEt3X2cLMEaxsS61rS5La rNXiJzEFIpZlDUaiMl/FfTjQVJWy0Du0B1ujvznDn9wo0yNyRTlW2xWffy4sKDYzUI58 yFhQzGLdBqXlNmXaHp/5ejsbxRei+I/M+fTthUlop+N+doH09J88tQaBnGW2CFVpSI8f dIaPdquzAosVTJuVBejliEFDd5CfIUUiR3mCxl59XND13Mtl6btqX4OASlY5dy5ytMfh vA3dDjxtZVepo788Wn7pctGEW2Sv0Ziqc9dncL8bFVyTmKAXMUUlRJ50bX1TTjPYWdQx V/Ag== X-Received: by 10.182.158.200 with SMTP id ww8mr4810082obb.53.1438732228911; Tue, 04 Aug 2015 16:50:28 -0700 (PDT) Received: from corona.austin.rr.com (cpe-72-177-6-10.austin.res.rr.com. [72.177.6.10]) by smtp.googlemail.com with ESMTPSA id r3sm606809oia.22.2015.08.04.16.50.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 16:50:28 -0700 (PDT) Subject: Re: svn commit: r286296 - in head/sys: amd64/amd64 arm/arm arm/include arm64/arm64 i386/i386 i386/include mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/include sparc64/spa... To: "Bjoern A. Zeeb" , "Jason A. Harmening" References: <201508041946.t74JkExD070238@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jason Harmening Message-ID: <55C150A3.4030509@gmail.com> Date: Tue, 4 Aug 2015 18:54:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 04 Aug 2015 23:50:29 -0000 On 08/04/15 18:22, Bjoern A. Zeeb wrote: > >> On 04 Aug 2015, at 19:46 , Jason A. Harmening wrote: >> >> Author: jah >> Date: Tue Aug 4 19:46:13 2015 >> New Revision: 286296 >> URL: https://svnweb.freebsd.org/changeset/base/286296 >> >> Log: >> Add two new pmap functions: >> vm_offset_t pmap_quick_enter_page(vm_page_t m) >> void pmap_quick_remove_page(vm_offset_t kva) >> >> These will create and destroy a temporary, CPU-local KVA mapping of a specified page. >> >> Guarantees: >> --Will not sleep and will not fail. >> --Safe to call under a non-sleepable lock or from an ithread >> >> Restrictions: >> --Not guaranteed to be safe to call from an interrupt filter or under a spin mutex on all platforms >> --Current implementation does not guarantee more than one page of mapping space across all platforms. MI code should not make nested calls to pmap_quick_enter_page. >> --MI code should not perform locking while holding onto a mapping created by pmap_quick_enter_page >> >> The idea is to use this in busdma, for bounce buffer copies as well as virtually-indexed cache maintenance on mips and arm. >> >> NOTE: the non-i386, non-amd64 implementations of these functions still need review and testing. > > Most of this description should go into a section 9 man page rather than the commit message ;-) > > /bz > Yep, I'm planning to write one. From owner-svn-src-head@freebsd.org Wed Aug 5 01:52:12 2015 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 36BDA9B3F69; Wed, 5 Aug 2015 01:52:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 27BD7815; Wed, 5 Aug 2015 01:52:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t751qCmm043479; Wed, 5 Aug 2015 01:52:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t751qCXC043478; Wed, 5 Aug 2015 01:52:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508050152.t751qCXC043478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 5 Aug 2015 01:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286298 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 01:52:12 -0000 Author: jhibbits Date: Wed Aug 5 01:52:11 2015 New Revision: 286298 URL: https://svnweb.freebsd.org/changeset/base/286298 Log: Remove some unnecessary includes. Modified: head/sys/dev/nand/nfc_rb.c Modified: head/sys/dev/nand/nfc_rb.c ============================================================================== --- head/sys/dev/nand/nfc_rb.c Wed Aug 5 00:00:06 2015 (r286297) +++ head/sys/dev/nand/nfc_rb.c Wed Aug 5 01:52:11 2015 (r286298) @@ -31,16 +31,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include #include #include #include -#include -#include -#include +#include #include From owner-svn-src-head@freebsd.org Wed Aug 5 01:52:53 2015 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 247339B3FA2; Wed, 5 Aug 2015 01:52:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 15967956; Wed, 5 Aug 2015 01:52:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t751qqpL043587; Wed, 5 Aug 2015 01:52:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t751qqxP043586; Wed, 5 Aug 2015 01:52:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508050152.t751qqxP043586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 5 Aug 2015 01:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286299 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 01:52:53 -0000 Author: jhibbits Date: Wed Aug 5 01:52:52 2015 New Revision: 286299 URL: https://svnweb.freebsd.org/changeset/base/286299 Log: Remove one more that crept in unnecessarily from previous commit. Modified: head/sys/dev/nand/nfc_rb.c Modified: head/sys/dev/nand/nfc_rb.c ============================================================================== --- head/sys/dev/nand/nfc_rb.c Wed Aug 5 01:52:11 2015 (r286298) +++ head/sys/dev/nand/nfc_rb.c Wed Aug 5 01:52:52 2015 (r286299) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include From owner-svn-src-head@freebsd.org Wed Aug 5 03:03:58 2015 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 D492F9B3090; Wed, 5 Aug 2015 03:03:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C5EB3DF3; Wed, 5 Aug 2015 03:03:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7533wXS074288; Wed, 5 Aug 2015 03:03:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7533wlx074287; Wed, 5 Aug 2015 03:03:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508050303.t7533wlx074287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 5 Aug 2015 03:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286303 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 03:03:58 -0000 Author: ngie Date: Wed Aug 5 03:03:57 2015 New Revision: 286303 URL: https://svnweb.freebsd.org/changeset/base/286303 Log: Update the comment about handling old-style rc(5) scripts The old-style (*.sh) scripts in /etc/rc.d are explicitly ignored, whereas other scripts ending in .sh are permitted Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Aug 5 02:19:38 2015 (r286302) +++ head/etc/rc.subr Wed Aug 5 03:03:57 2015 (r286303) @@ -1266,8 +1266,11 @@ _run_rc_killcmd() # run_rc_script file arg # Start the script `file' with `arg', and correctly handle the # return value from the script. -# If `file' ends with `.sh', it's sourced into the current environment -# when $rc_fast_and_loose is set, otherwise it is run as a child process. +# If `file' ends with `.sh' and lives in /etc/rc.d, ignore it as it's +# an old-style startup file. +# If `file' ends with `.sh' and does not live in /etc/rc.d, it's sourced +# into the current environment if $rc_fast_and_loose is set; otherwise +# it is run as a child process. # If `file' appears to be a backup or scratch file, ignore it. # Otherwise if it is executable run as a child process. # From owner-svn-src-head@freebsd.org Wed Aug 5 03:17:08 2015 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 E9A829B33DA; Wed, 5 Aug 2015 03:17:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CE0D7143B; Wed, 5 Aug 2015 03:17:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t753H7pC078455; Wed, 5 Aug 2015 03:17:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t753H7iO078454; Wed, 5 Aug 2015 03:17:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508050317.t753H7iO078454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 5 Aug 2015 03:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286304 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 03:17:08 -0000 Author: ngie Date: Wed Aug 5 03:17:06 2015 New Revision: 286304 URL: https://svnweb.freebsd.org/changeset/base/286304 Log: Set f_file to -1/F_UNUSED when after closing when possible This will help ensure we don't trash file descriptors that get used later on in the daemon Found via internal Coverity scan MFC after: 2 weeks Discussed with: cem, ed, markj Differential Revision: https://reviews.freebsd.org/D3081 Submitted by: Miles Ohlrich Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Aug 5 03:03:57 2015 (r286303) +++ head/usr.sbin/syslogd/syslogd.c Wed Aug 5 03:17:06 2015 (r286304) @@ -349,6 +349,18 @@ static int waitdaemon(int, int, int); static void timedout(int); static void increase_rcvbuf(int); +static void +close_filed(struct filed *f) +{ + + if (f == NULL || f->f_file == -1) + return; + + (void)close(f->f_file); + f->f_file = -1; + f->f_type = F_UNUSED; +} + int main(int argc, char *argv[]) { @@ -1024,7 +1036,8 @@ logmsg(int pri, const char *msg, const c (void)strlcpy(f->f_lasttime, timestamp, sizeof(f->f_lasttime)); fprintlog(f, flags, msg); - (void)close(f->f_file); + close(f->f_file); + f->f_file = -1; } (void)sigsetmask(omask); return; @@ -1313,8 +1326,7 @@ fprintlog(struct filed *f, int flags, co */ if (errno != ENOSPC) { int e = errno; - (void)close(f->f_file); - f->f_type = F_UNUSED; + close_filed(f); errno = e; logerror(f->f_un.f_fname); } @@ -1338,7 +1350,7 @@ fprintlog(struct filed *f, int flags, co } if (writev(f->f_file, iov, IOV_SIZE) < 0) { int e = errno; - (void)close(f->f_file); + close_filed(f); if (f->f_un.f_pipe.f_pid > 0) deadq_enter(f->f_un.f_pipe.f_pid, f->f_un.f_pipe.f_pname); @@ -1446,7 +1458,7 @@ reapchild(int signo __unused) for (f = Files; f; f = f->f_next) if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid == pid) { - (void)close(f->f_file); + close_filed(f); f->f_un.f_pipe.f_pid = 0; log_deadchild(pid, status, f->f_un.f_pipe.f_pname); @@ -1550,7 +1562,7 @@ die(int signo) if (f->f_prevcount) fprintlog(f, 0, (char *)NULL); if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) { - (void)close(f->f_file); + close_filed(f); f->f_un.f_pipe.f_pid = 0; } } @@ -1634,11 +1646,11 @@ init(int signo) case F_FORW: case F_CONSOLE: case F_TTY: - (void)close(f->f_file); + close_filed(f); break; case F_PIPE: if (f->f_un.f_pipe.f_pid > 0) { - (void)close(f->f_file); + close_filed(f); deadq_enter(f->f_un.f_pipe.f_pid, f->f_un.f_pipe.f_pname); } From owner-svn-src-head@freebsd.org Wed Aug 5 04:22:05 2015 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 ACD959B23CA; Wed, 5 Aug 2015 04:22:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 67CFB10DC; Wed, 5 Aug 2015 04:22:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 6FC3810424FD; Wed, 5 Aug 2015 14:21:54 +1000 (AEST) Date: Wed, 5 Aug 2015 14:21:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Warner Losh , Bruce Evans , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286103 - head/share/man/man9 In-Reply-To: Message-ID: <20150805135323.X1025@besplex.bde.org> References: <201507310328.t6V3S3LC087650@repo.freebsd.org> <20150731152253.Y1843@besplex.bde.org> <2B9D4FA9-FDB2-405D-B8C0-BE9918941159@bsdimp.com> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ItbjC+Lg c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=7Qk2ozbKAAAA:8 a=1w3kyzAKuwnzmpU9ikIA: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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 04:22:05 -0000 On Tue, 4 Aug 2015, Ed Schouten wrote: > 2015-08-04 20:23 GMT+02:00 Warner Losh : >> There=E2=80=99s at least one compiler in common use that warns about >> >> extern int fred[1]; >> extern int fred[1]; >> >> being a repeated declaration (despite being legal C). > > Would you happen to know which one that is? All non-broken compilers warn about this when directed to do so by -Wredundant-decls. I think -Wno-system-headers turns this off, but we use -Wsystem-headers so as to see bugs in our system headers. clang is broken and doesn't even warn that it ignores -Wredundant-decls. We use -Wredundant-decls at WARNS >=3D 6. We used to use it always in the kernel, but now we turn it and most other warnings off in cddl code. We use -Wsystem-headers at WARNS >=3D 1. We don't use it explicitly in the kernel. That might be a bug. The kernel uses nonstandard include paths, but so does userland for bootstrapping and cross compiling. The kernel also uses -nostdinc and that should kill any idea that the kernel has about which headers are system ones. Makeworld doesn't seem to use -nostdinc. That might be another bug. It uses lots of -I paths, but there is still a possibility of getting host headers mixed with target ones. cddl has different messes for -nostdinc. It seems to duplicate it together with spamming CFLAGS with lots of -I's. Bruce From owner-svn-src-head@freebsd.org Wed Aug 5 04:39:48 2015 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 344629B26BE; Wed, 5 Aug 2015 04:39:48 +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 B91F41954; Wed, 5 Aug 2015 04:39:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t754dhV0024692 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 5 Aug 2015 07:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t754dhV0024692 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t754dh3U024691; Wed, 5 Aug 2015 07:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 5 Aug 2015 07:39:43 +0300 From: Konstantin Belousov To: Jung-uk Kim Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286265 - head/sys/x86/include Message-ID: <20150805043943.GV2072@kib.kiev.ua> References: <201508040011.t740BeD3088014@repo.freebsd.org> <20150804041458.GF2072@kib.kiev.ua> <20150804143613.H896@besplex.bde.org> <55C10CDA.4070006@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C10CDA.4070006@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 05 Aug 2015 04:39:48 -0000 On Tue, Aug 04, 2015 at 03:04:58PM -0400, Jung-uk Kim wrote: > Done. I was not really interested in API compatibility. FYI, "Figure > 3.34: va_list Type Declaration" defines the structure like this: > > typedef struct { > unsigned int gp_offset; > unsigned int fp_offset; > void *overflow_arg_area; > void *reg_save_area; > } va_list[1]; Thank you for the pointer. I read this long time ago as an optional advice for the possible implementation and not as the ABI requirement, so I forgot about it. From owner-svn-src-head@freebsd.org Wed Aug 5 06:25:41 2015 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 46A1A9B4C77; Wed, 5 Aug 2015 06:25:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id EE718762; Wed, 5 Aug 2015 06:25:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 68F671A2209; Wed, 5 Aug 2015 16:25:34 +1000 (AEST) Date: Wed, 5 Aug 2015 16:25:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286293 - head/sys/x86/include In-Reply-To: <201508041859.t74IxtCh047275@repo.freebsd.org> Message-ID: <20150805162146.H1434@besplex.bde.org> References: <201508041859.t74IxtCh047275@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=y8ldLoeJNce22yX4hrYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 06:25:41 -0000 On Tue, 4 Aug 2015, Jung-uk Kim wrote: > Log: > Fix style(9) bugs. Thanks. > Modified: > head/sys/x86/include/_types.h > > Modified: head/sys/x86/include/_types.h > ============================================================================== > --- head/sys/x86/include/_types.h Tue Aug 4 17:47:11 2015 (r286292) > +++ head/sys/x86/include/_types.h Tue Aug 4 18:59:54 2015 (r286293) > @@ -154,12 +154,11 @@ typedef int ___wchar_t; > typedef __builtin_va_list __va_list; /* internally known to gcc */ > #else > #ifdef __LP64__ > -typedef struct { > - unsigned int __gpo; > - unsigned int __fpo; > - void *__oaa; > - void *__rsa; > -} __va_list; > +struct __s_va_list { > + __uint32_t pad1[2]; /* gp_offset, fp_offset */ > + __uint64_t pad2[2]; /* overflow_arg_area, reg_save_area */ > +}; Er, the struct members need at least 1 underscore, since pad* is in the application namespace and this is a very public file. > +typedef struct __s_va_list __va_list; I said to use #define, but now prefer this since it is better for debuggers and all the nearby __va_list's are typedefs. This typedef should be followed by a tab like all the nearby ones. > #else > typedef char * __va_list; > #endif Bruce From owner-svn-src-head@freebsd.org Wed Aug 5 07:34:31 2015 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 497DD9B2FDF; Wed, 5 Aug 2015 07:34:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 20505DAE; Wed, 5 Aug 2015 07:34:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t757YUGZ084301; Wed, 5 Aug 2015 07:34:30 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t757YUnY084298; Wed, 5 Aug 2015 07:34:30 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508050734.t757YUnY084298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 07:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286307 - in head: lib/libc/sys sys/kern 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.20 Precedence: list List-Id: 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, 05 Aug 2015 07:34:31 -0000 Author: ed Date: Wed Aug 5 07:34:29 2015 New Revision: 286307 URL: https://svnweb.freebsd.org/changeset/base/286307 Log: Make it possible to implement poll(2) on top of kqueue(2). It looks like EVFILT_READ and EVFILT_WRITE trigger under the same conditions as poll()'s POLLRDNORM and POLLWRNORM as described by POSIX. The only difference is that POLLRDNORM has to be triggered on regular files unconditionally, whereas EVFILT_READ only triggers when not EOF. Introduce a new flag, NOTE_FILE_POLL, that can be used to make EVFILT_READ and EVFILT_WRITE behave identically to poll(). This flag will be used by cloudlibc's poll() function. Reviewed by: jmg Differential Revision: https://reviews.freebsd.org/D3303 Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/vfs_subr.c head/sys/sys/event.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Aug 5 07:29:59 2015 (r286306) +++ head/lib/libc/sys/kqueue.2 Wed Aug 5 07:34:29 2015 (r286307) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2015 +.Dd August 4, 2015 .Dt KQUEUE 2 .Os .Sh NAME @@ -288,6 +288,14 @@ Returns when the file pointer is not at .Va data contains the offset from current position to end of file, and may be negative. +.Pp +This behavior is different from +.Xr poll 2 , +where read events are triggered for regular files unconditionally. +This event can be triggered unconditionally by setting the +.Dv NOTE_FILE_POLL +flag in +.Va fflags . .It "Fifos, Pipes" Returns when the there is data to read; .Va data Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 5 07:29:59 2015 (r286306) +++ head/sys/kern/vfs_subr.c Wed Aug 5 07:34:29 2015 (r286307) @@ -4622,7 +4622,7 @@ filt_vfsread(struct knote *kn, long hint VI_LOCK(vp); kn->kn_data = va.va_size - kn->kn_fp->f_offset; - res = (kn->kn_data != 0); + res = (kn->kn_sfflags & NOTE_FILE_POLL) != 0 || kn->kn_data != 0; VI_UNLOCK(vp); return (res); } Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Aug 5 07:29:59 2015 (r286306) +++ head/sys/sys/event.h Wed Aug 5 07:34:29 2015 (r286307) @@ -108,6 +108,7 @@ struct kevent { * data/hint flags for EVFILT_{READ|WRITE}, shared with userspace */ #define NOTE_LOWAT 0x0001 /* low water mark */ +#define NOTE_FILE_POLL 0x0002 /* behave like poll() */ /* * data/hint flags for EVFILT_VNODE, shared with userspace From owner-svn-src-head@freebsd.org Wed Aug 5 07:36:52 2015 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 7DD209B4059; Wed, 5 Aug 2015 07:36:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 622F61078; Wed, 5 Aug 2015 07:36:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t757aqiJ084497; Wed, 5 Aug 2015 07:36:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t757apIw084494; Wed, 5 Aug 2015 07:36:51 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508050736.t757apIw084494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 07:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286309 - in head/sys: compat/linux 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.20 Precedence: list List-Id: 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, 05 Aug 2015 07:36:52 -0000 Author: ed Date: Wed Aug 5 07:36:50 2015 New Revision: 286309 URL: https://svnweb.freebsd.org/changeset/base/286309 Log: Allow the creation of kqueues with a restricted set of Capsicum rights. On CloudABI we want to create file descriptors with just the minimal set of Capsicum rights in place. The reason for this is that it makes it easier to obtain uniform behaviour across different operating systems. By explicitly whitelisting the operations, we can return consistent error codes, but also prevent applications from depending OS-specific behaviour. Extend kern_kqueue() to take an additional struct filecaps that is passed on to falloc_caps(). Update the existing consumers to pass in NULL. Differential Revision: https://reviews.freebsd.org/D3259 Modified: head/sys/compat/linux/linux_event.c head/sys/kern/kern_event.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Wed Aug 5 07:35:34 2015 (r286308) +++ head/sys/compat/linux/linux_event.c Wed Aug 5 07:36:50 2015 (r286309) @@ -205,7 +205,7 @@ epoll_create_common(struct thread *td, i { int error; - error = kern_kqueue(td, flags); + error = kern_kqueue(td, flags, NULL); if (error) return (error); Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Aug 5 07:35:34 2015 (r286308) +++ head/sys/kern/kern_event.c Wed Aug 5 07:36:50 2015 (r286309) @@ -738,11 +738,11 @@ int sys_kqueue(struct thread *td, struct kqueue_args *uap) { - return (kern_kqueue(td, 0)); + return (kern_kqueue(td, 0, NULL)); } int -kern_kqueue(struct thread *td, int flags) +kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps) { struct filedesc *fdp; struct kqueue *kq; @@ -760,7 +760,7 @@ kern_kqueue(struct thread *td, int flags } fdp = p->p_fd; - error = falloc(td, &fp, &fd, flags); + error = falloc_caps(td, &fp, &fd, flags, fcaps); if (error) goto done2; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Aug 5 07:35:34 2015 (r286308) +++ head/sys/sys/syscallsubr.h Wed Aug 5 07:36:50 2015 (r286309) @@ -126,7 +126,7 @@ int kern_kevent(struct thread *td, int f int kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout); -int kern_kqueue(struct thread *td, int flags); +int kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps); int kern_kldload(struct thread *td, const char *file, int *fileid); int kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat); int kern_kldunload(struct thread *td, int fileid, int flags); From owner-svn-src-head@freebsd.org Wed Aug 5 07:37:07 2015 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 667CA9B4084; Wed, 5 Aug 2015 07:37:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 57B1811C5; Wed, 5 Aug 2015 07:37:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t757b70a084557; Wed, 5 Aug 2015 07:37:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t757b7fU084556; Wed, 5 Aug 2015 07:37:07 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508050737.t757b7fU084556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 07:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286310 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 07:37:07 -0000 Author: ed Date: Wed Aug 5 07:37:06 2015 New Revision: 286310 URL: https://svnweb.freebsd.org/changeset/base/286310 Log: Allow the creation of polling descriptors (kqueues) on CloudABI. Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 5 07:36:50 2015 (r286309) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 5 07:37:06 2015 (r286310) @@ -104,6 +104,9 @@ cloudabi_sys_fd_create1(struct thread *t }; switch (uap->type) { + case CLOUDABI_FILETYPE_POLL: + cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_KQUEUE); + return (kern_kqueue(td, 0, &fcaps)); case CLOUDABI_FILETYPE_SHARED_MEMORY: cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); From owner-svn-src-head@freebsd.org Wed Aug 5 08:18:07 2015 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 F3FB89B4AC3; Wed, 5 Aug 2015 08:18:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D809493C; Wed, 5 Aug 2015 08:18:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t758I6gH001147; Wed, 5 Aug 2015 08:18:06 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t758I628001144; Wed, 5 Aug 2015 08:18:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508050818.t758I628001144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 08:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286312 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 08:18:07 -0000 Author: ed Date: Wed Aug 5 08:18:05 2015 New Revision: 286312 URL: https://svnweb.freebsd.org/changeset/base/286312 Log: Add the remaining pointer size independent CloudABI socket system calls. CloudABI uses a structure called cloudabi_sockstat_t. Think of it as 'struct stat' for sockets. It is used by functions such as getsockname(), getpeername(), some of the getsockopt() values, etc. This change implements the sock_stat_get() system call that returns a copy of this structure. The accept() system call should also return a full copy of this structure eventually, but for now we're only interested in the peer address. Add a TODO() to make sure this is patched up later on. Differential Revision: https://reviews.freebsd.org/D3218 Modified: head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi/cloudabi_util.h Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Wed Aug 5 08:17:10 2015 (r286311) +++ head/sys/compat/cloudabi/cloudabi_sock.c Wed Aug 5 08:18:05 2015 (r286312) @@ -27,14 +27,62 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include +#include +#include #include +#include #include #include #include #include +#include + +#include + #include #include +#include + +/* Converts FreeBSD's struct sockaddr to CloudABI's cloudabi_sockaddr_t. */ +void +cloudabi_convert_sockaddr(const struct sockaddr *sa, socklen_t sal, + cloudabi_sockaddr_t *rsa) +{ + const struct sockaddr_in *sin; + const struct sockaddr_in6 *sin6; + + /* Zero-sized socket address. */ + if (sal < offsetof(struct sockaddr, sa_family) + sizeof(sa->sa_family)) + return; + + switch (sa->sa_family) { + case AF_INET: + if (sal < sizeof(struct sockaddr_in)) + return; + sin = (const struct sockaddr_in *)sa; + rsa->sa_family = CLOUDABI_AF_INET; + memcpy(&rsa->sa_inet.addr, &sin->sin_addr, + sizeof(rsa->sa_inet.addr)); + rsa->sa_inet.port = ntohs(sin->sin_port); + return; + case AF_INET6: + if (sal < sizeof(struct sockaddr_in6)) + return; + sin6 = (const struct sockaddr_in6 *)sa; + rsa->sa_family = CLOUDABI_AF_INET6; + memcpy(&rsa->sa_inet6.addr, &sin6->sin6_addr, + sizeof(rsa->sa_inet6.addr)); + rsa->sa_inet6.port = ntohs(sin6->sin6_port); + return; + case AF_UNIX: + rsa->sa_family = CLOUDABI_AF_UNIX; + return; + } +} /* Copies a pathname into a UNIX socket address structure. */ static int @@ -62,9 +110,27 @@ int cloudabi_sys_sock_accept(struct thread *td, struct cloudabi_sys_sock_accept_args *uap) { + struct sockaddr *sa; + cloudabi_sockstat_t ss = {}; + socklen_t sal; + int error; - /* Not implemented. */ - return (ENOSYS); + if (uap->buf == NULL) { + /* Only return the new file descriptor number. */ + return (kern_accept(td, uap->s, NULL, NULL, NULL)); + } else { + /* Also return properties of the new socket descriptor. */ + sal = MAX(sizeof(struct sockaddr_in), + sizeof(struct sockaddr_in6)); + error = kern_accept(td, uap->s, (void *)&sa, &sal, NULL); + if (error != 0) + return (error); + + /* TODO(ed): Fill the other members of cloudabi_sockstat_t. */ + cloudabi_convert_sockaddr(sa, sal, &ss.ss_peername); + free(sa, M_SONAME); + return (copyout(&ss, uap->buf, sizeof(ss))); + } } int @@ -134,7 +200,51 @@ int cloudabi_sys_sock_stat_get(struct thread *td, struct cloudabi_sys_sock_stat_get_args *uap) { + cloudabi_sockstat_t ss = {}; + cap_rights_t rights; + struct file *fp; + struct sockaddr *sa; + struct socket *so; + int error; + + error = getsock_cap(td, uap->fd, cap_rights_init(&rights, + CAP_GETSOCKOPT | CAP_GETPEERNAME | CAP_GETSOCKNAME), &fp, NULL); + if (error != 0) + return (error); + so = fp->f_data; + + CURVNET_SET(so->so_vnet); + + /* Set ss_sockname. */ + error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + if (error == 0) { + cloudabi_convert_sockaddr(sa, sa->sa_len, &ss.ss_sockname); + free(sa, M_SONAME); + } + + /* Set ss_peername. */ + if ((so->so_state & (SS_ISCONNECTED | SS_ISCONFIRMING)) != 0) { + error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); + if (error == 0) { + cloudabi_convert_sockaddr(sa, sa->sa_len, + &ss.ss_peername); + free(sa, M_SONAME); + } + } + + CURVNET_RESTORE(); + + /* Set ss_error. */ + SOCK_LOCK(so); + ss.ss_error = so->so_error; + if ((uap->flags & CLOUDABI_SOCKSTAT_CLEAR_ERROR) != 0) + so->so_error = 0; + SOCK_UNLOCK(so); + + /* Set ss_state. */ + if ((so->so_options & SO_ACCEPTCONN) != 0) + ss.ss_state |= CLOUDABI_SOCKSTAT_ACCEPTCONN; - /* Not implemented. */ - return (ENOSYS); + fdrop(fp, td); + return (copyout(&ss, uap->buf, sizeof(ss))); } Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Wed Aug 5 08:17:10 2015 (r286311) +++ head/sys/compat/cloudabi/cloudabi_util.h Wed Aug 5 08:18:05 2015 (r286312) @@ -28,6 +28,8 @@ #ifndef _CLOUDABI_UTIL_H_ #define _CLOUDABI_UTIL_H_ +#include + #include struct file; @@ -41,6 +43,10 @@ int cloudabi_clock_time_get(struct threa /* Converts a FreeBSD errno to a CloudABI errno. */ cloudabi_errno_t cloudabi_convert_errno(int); +/* Converts FreeBSD's struct sockaddr to CloudABI's cloudabi_sockaddr_t. */ +void cloudabi_convert_sockaddr(const struct sockaddr *, socklen_t, + cloudabi_sockaddr_t *); + /* Converts a file descriptor to a CloudABI file descriptor type. */ cloudabi_filetype_t cloudabi_convert_filetype(const struct file *); From owner-svn-src-head@freebsd.org Wed Aug 5 10:48:34 2015 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 042949B3A61; Wed, 5 Aug 2015 10:48:34 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E9ED3CCD; Wed, 5 Aug 2015 10:48:33 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75AmXxX061589; Wed, 5 Aug 2015 10:48:33 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75AmXTM061588; Wed, 5 Aug 2015 10:48:33 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201508051048.t75AmXTM061588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Wed, 5 Aug 2015 10:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286313 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 10:48:34 -0000 Author: jah Date: Wed Aug 5 10:48:32 2015 New Revision: 286313 URL: https://svnweb.freebsd.org/changeset/base/286313 Log: Properly sort the function declarations added in r286296 Submitted by: alc Approved by: kib (mentor) Modified: head/sys/vm/pmap.h Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Wed Aug 5 08:18:05 2015 (r286312) +++ head/sys/vm/pmap.h Wed Aug 5 10:48:32 2015 (r286313) @@ -141,6 +141,8 @@ void pmap_pinit0(pmap_t); void pmap_protect(pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); void pmap_qenter(vm_offset_t, vm_page_t *, int); void pmap_qremove(vm_offset_t, int); +vm_offset_t pmap_quick_enter_page(vm_page_t); +void pmap_quick_remove_page(vm_offset_t); void pmap_release(pmap_t); void pmap_remove(pmap_t, vm_offset_t, vm_offset_t); void pmap_remove_all(vm_page_t m); @@ -152,8 +154,6 @@ void pmap_unwire(pmap_t pmap, vm_offse void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); void pmap_zero_page_idle(vm_page_t); -vm_offset_t pmap_quick_enter_page(vm_page_t); -void pmap_quick_remove_page(vm_offset_t); #define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) #define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) From owner-svn-src-head@freebsd.org Wed Aug 5 10:50:35 2015 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 0157A9B3AE8; Wed, 5 Aug 2015 10:50:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E6C78F32; Wed, 5 Aug 2015 10:50:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75AoY2w061757; Wed, 5 Aug 2015 10:50:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75AoYwa061755; Wed, 5 Aug 2015 10:50:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508051050.t75AoYwa061755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 5 Aug 2015 10:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286314 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 10:50:35 -0000 Author: kib Date: Wed Aug 5 10:50:33 2015 New Revision: 286314 URL: https://svnweb.freebsd.org/changeset/base/286314 Log: Fix UP build after r286296, ensure that CPU_FOREACH() is defined. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Aug 5 10:48:32 2015 (r286313) +++ head/sys/i386/i386/pmap.c Wed Aug 5 10:50:33 2015 (r286314) @@ -118,11 +118,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SMP #include -#else -#include -#endif #include #include From owner-svn-src-head@freebsd.org Wed Aug 5 11:17:07 2015 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 1DFD49B32BC for ; Wed, 5 Aug 2015 11:17:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) (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 ACC031F71 for ; Wed, 5 Aug 2015 11:17:06 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wibxm9 with SMTP id xm9so61804337wib.1 for ; Wed, 05 Aug 2015 04:17: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-type :content-transfer-encoding; bh=zrUkd0M0EyR2nMUB57z9BEnD8YFl+FfpXBromSp83Eg=; b=IWq583S85QESV30Cu7tsLGOdNZYBQM9tBmG0lRk1qKmh+xrNxKTL5OX5uvrR2ufVQ3 2pTiHpgUT7gfABFtii8n1m3+R7IaoZTbQgA6L6/o2BKQa+7HyWnHSgS/pecRYPcZFyZ/ eRmb7OQlGSwP66y54/wCFPyVADIYtSB6VOXMtGYsVcZpmgz1ByNA3cw9Mctvqa9kUoQk zkQoQ3BM5gv7+hSDM8mVViDdnmt8y8kSAneA3vKfKm7LX102n+GK9o/c8D5m0g1POnMm ZGV5RfchGRlTmWnnQ09K341ufMDPNsL7jwV5E1ojWQOHuU5BUA/yT8Gr4fymvuwm36re mtag== X-Gm-Message-State: ALoCoQnreqMpWUo7ozDiD45jyBG4kXOEEL4holrO8cfAv/jwJl7+wlTcUD0mippeREsD2nbU5H4D X-Received: by 10.180.208.81 with SMTP id mc17mr8727987wic.93.1438773029894; Wed, 05 Aug 2015 04:10:29 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id ea2sm3300849wib.2.2015.08.05.04.10.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Aug 2015 04:10:29 -0700 (PDT) Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov References: <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> <55C07826.9070002@multiplay.co.uk> <20150804161448.GC24698@zxy.spb.ru> <55C11B5F.2080007@multiplay.co.uk> <20150804202411.GD8792@zxy.spb.ru> Cc: Warner Losh , src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Julian Elischer From: Steven Hartland Message-ID: <55C1EF1F.6040204@multiplay.co.uk> Date: Wed, 5 Aug 2015 12:10:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150804202411.GD8792@zxy.spb.ru> 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.20 Precedence: list List-Id: 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, 05 Aug 2015 11:17:07 -0000 On 04/08/2015 21:24, Slawa Olhovchenkov wrote: > On Tue, Aug 04, 2015 at 09:06:55PM +0100, Steven Hartland wrote: > >> >> On 04/08/2015 17:14, Slawa Olhovchenkov wrote: >>> On Tue, Aug 04, 2015 at 09:30:30AM +0100, Steven Hartland wrote: >>> >>>> On 03/08/2015 21:48, Warner Losh wrote: >>>>>> On Aug 3, 2015, at 1:44 PM, Slawa Olhovchenkov wrote: >>>>>> >>>>>> On Tue, Aug 04, 2015 at 03:35:50AM +0800, Julian Elischer wrote: >>>>>> >>>>>>> On 8/3/15 8:03 PM, Konstantin Belousov wrote: >>>>>>>> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote: >>>>>>>>> For this change I don't want to get into fixing the thread0 stack size, >>>>>>>>> which can be done later, just >>>>>>>>> to provide a reasonable warning to the user that smaller values could >>>>>>>>> cause a panic. >>>>>>>> Hmm, is it limited to the thread0 only ? I.e., would only increasing >>>>>>>> the initial thread stack size be enough to boot the kernel ? The zfs >>>>>>>> threads do request larger stack size, I know this. >>>>>>>> >>>>>>>> Can somebody test the following patch in the i386 configuration which >>>>>>>> does not boot ? >>>>>>> I think this is a reasonable thing to do. Thread0 (and proc0) are special. >>>>>>> I don't see why giving it a specially sized stack would be a problem. >>>>>> This is always do for ARM. >>>>>> May be need increase stack size for Thread0 on ARM too? >>>>> Seems reasonable. There should be a MI way of doing this, but all the code and defines are buried in MD files, so each architecture needs some love to make this a reality. >>>>> >>>>> Warner >>>> In the mean time are people happier with >>>> https://reviews.freebsd.org/D3279 or should I just leave it using the >>>> #define until someone has time to work on a full solution? >>> Checking by #ifdef you check only parametr at time of building zfs.ko, >>> checking variable you check actual value. >>> May be check thread stack best if only for current tread. >> Not sure I follow you as its not a #ifdef check its straight if in the >> new version i.e. >> if (kstack_pages < ZFS_MIN_KSTACK_PAGES) { > This check checked how actual kernel compile vs how compile zfs.ko. > Remeber that kenel may be compiled independed from modules? Correct that's the requirement as its thread0 that appears to be the key. > >> Just in case you didn't notice kib committed a fix for i386 thread0 in >> r286288 so this may not be needed at all any more which is good news :) > If I understund kib fix (and you about ZFS stack requirements) you > need check curthread->td_kstack_pages (for case old, unfixed kerenel, > depended from KSTACK_PAGES in Thread0). > > I.e. for all cases: > > - unfixed kernel with KSTACK_PAGES < 4 > - unfixed kernel with KSTACK_PAGES >= 4 > - fixed kernel with KSTACK_PAGES < 4 > - fixed kernel with KSTACK_PAGES >= 4 > - compiling zfs.ko separately from kernel with different KSTACK_PAGES > - using zfs.ko with old kernel > > checking curthread->td_kstack_pages is right way (or, may be > curthread->td_kstack_pages*PAGE_SIZE -- I am not cleanly understund > what need to check -- size in bytes or size in pages). > Checking KSTACK_PAGES by ifdef can produce vrong result. Its not clear to me if curthread will be thread0 however in unfixed thread0 stack size would have been kstack_pages so at the time this was still correct IMO. Just to be clear this is not checked by an ifdef, that's just OS guard which is correct. Latest revision which now explicitly checks thread0 stack size is now available: https://reviews.freebsd.org/D3279 Regards Steve From owner-svn-src-head@freebsd.org Wed Aug 5 11:27:46 2015 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 BCDA69B3669; Wed, 5 Aug 2015 11:27:46 +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 739E3954; Wed, 5 Aug 2015 11:27:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMwrD-000OqL-OL; Wed, 05 Aug 2015 14:27:39 +0300 Date: Wed, 5 Aug 2015 14:27:39 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: Warner Losh , src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Julian Elischer Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150805112739.GE8792@zxy.spb.ru> References: <55BF557B.60009@multiplay.co.uk> <20150803120359.GC2072@kib.kiev.ua> <55BFC296.5050402@freebsd.org> <20150803194412.GC8792@zxy.spb.ru> <55C07826.9070002@multiplay.co.uk> <20150804161448.GC24698@zxy.spb.ru> <55C11B5F.2080007@multiplay.co.uk> <20150804202411.GD8792@zxy.spb.ru> <55C1EF1F.6040204@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55C1EF1F.6040204@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) 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.20 Precedence: list List-Id: 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, 05 Aug 2015 11:27:46 -0000 On Wed, Aug 05, 2015 at 12:10:23PM +0100, Steven Hartland wrote: > >> Just in case you didn't notice kib committed a fix for i386 thread0 in > >> r286288 so this may not be needed at all any more which is good news :) > > If I understund kib fix (and you about ZFS stack requirements) you > > need check curthread->td_kstack_pages (for case old, unfixed kerenel, > > depended from KSTACK_PAGES in Thread0). > > > > I.e. for all cases: > > > > - unfixed kernel with KSTACK_PAGES < 4 > > - unfixed kernel with KSTACK_PAGES >= 4 > > - fixed kernel with KSTACK_PAGES < 4 > > - fixed kernel with KSTACK_PAGES >= 4 > > - compiling zfs.ko separately from kernel with different KSTACK_PAGES > > - using zfs.ko with old kernel > > > > checking curthread->td_kstack_pages is right way (or, may be > > curthread->td_kstack_pages*PAGE_SIZE -- I am not cleanly understund > > what need to check -- size in bytes or size in pages). > > Checking KSTACK_PAGES by ifdef can produce vrong result. > Its not clear to me if curthread will be thread0 however in unfixed printf("zfs__init thread check: curthread %p thread0 %p\n", curthread, &thread0) ? > thread0 stack size would have been kstack_pages so at the time this was > still correct IMO. Not clear to me where is real limitaion -- in thread0 or in thread executed zfs__init. Just for me, what is correct? 1) limitation in thread0 (some code from ZFS executed later in thread0, not in current tread), not in zfs__init 2) limitation in zfs__init (or in some code executed later in current thread), currently zfs__init exeuted in thread0 > Just to be clear this is not checked by an ifdef, that's just OS guard > which is correct. > > Latest revision which now explicitly checks thread0 stack size is now > available: > https://reviews.freebsd.org/D3279 nice to me. From owner-svn-src-head@freebsd.org Wed Aug 5 12:53:58 2015 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 203C69B4210; Wed, 5 Aug 2015 12:53:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 04D3B99D; Wed, 5 Aug 2015 12:53:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75Crv7n020398; Wed, 5 Aug 2015 12:53:57 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75CruZa020389; Wed, 5 Aug 2015 12:53:56 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201508051253.t75CruZa020389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 5 Aug 2015 12:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286317 - in head: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 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.20 Precedence: list List-Id: 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, 05 Aug 2015 12:53:58 -0000 Author: vangyzen Date: Wed Aug 5 12:53:55 2015 New Revision: 286317 URL: https://svnweb.freebsd.org/changeset/base/286317 Log: Disable SSE in libthr Clang emits SSE instructions on amd64 in the common path of pthread_mutex_unlock. If the thread does not otherwise use SSE, this usage incurs a context-switch of the FPU/SSE state, which reduces the performance of multiple real-world applications by a non-trivial amount (3-5% in one application). Instead of this change, I experimented with eagerly switching the FPU state at context-switch time. This did not help. Most of the cost seems to be in the read/write of memory--as kib@ stated--and not in the #NM handling. I tested on machines with and without XSAVEOPT. One counter-argument to this change is that most applications already use SIMD, and the number of applications and amount of SIMD usage are only increasing. This is absolutely true. I agree that--in general and in principle--this change is in the wrong direction. However, there are applications that do not use enough SSE to offset the extra context-switch cost. SSE does not provide a clear benefit in the current libthr code with the current compiler, but it does provide a clear loss in some cases. Therefore, disabling SSE in libthr is a non-loss for most, and a gain for some. I refrained from disabling SSE in libc--as was suggested--because I can't make the above argument for libc. It provides a wide variety of code; each case should be analyzed separately. https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html Suggestions from: dim, jmg, rpaulo Approved by: kib (mentor) MFC after: 2 weeks Sponsored by: Dell Inc. Modified: head/lib/libthr/arch/amd64/Makefile.inc head/lib/libthr/arch/i386/Makefile.inc head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc head/share/mk/bsd.cpu.mk Modified: head/lib/libthr/arch/amd64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/amd64/Makefile.inc Wed Aug 5 11:24:40 2015 (r286316) +++ head/lib/libthr/arch/amd64/Makefile.inc Wed Aug 5 12:53:55 2015 (r286317) @@ -1,3 +1,9 @@ #$FreeBSD$ SRCS+= _umtx_op_err.S + +# With the current compiler and libthr code, using SSE in libthr +# does not provide enough performance improvement to outweigh +# the extra context switch cost. This can measurably impact +# performance when the application also does not use enough SSE. +CFLAGS+=${CFLAGS_NO_SIMD} Modified: head/lib/libthr/arch/i386/Makefile.inc ============================================================================== --- head/lib/libthr/arch/i386/Makefile.inc Wed Aug 5 11:24:40 2015 (r286316) +++ head/lib/libthr/arch/i386/Makefile.inc Wed Aug 5 12:53:55 2015 (r286317) @@ -1,3 +1,9 @@ # $FreeBSD$ SRCS+= _umtx_op_err.S + +# With the current compiler and libthr code, using SSE in libthr +# does not provide enough performance improvement to outweigh +# the extra context switch cost. This can measurably impact +# performance when the application also does not use enough SSE. +CFLAGS+=${CFLAGS_NO_SIMD} Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Wed Aug 5 11:24:40 2015 (r286316) +++ head/libexec/rtld-elf/amd64/Makefile.inc Wed Aug 5 12:53:55 2015 (r286317) @@ -1,6 +1,6 @@ # $FreeBSD$ -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float # Uncomment this to build the dynamic linker as an executable instead # of a shared library: #LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Wed Aug 5 11:24:40 2015 (r286316) +++ head/libexec/rtld-elf/i386/Makefile.inc Wed Aug 5 12:53:55 2015 (r286317) @@ -1,6 +1,6 @@ # $FreeBSD$ -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float # Uncomment this to build the dynamic linker as an executable instead # of a shared library: #LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Aug 5 11:24:40 2015 (r286316) +++ head/share/mk/bsd.cpu.mk Wed Aug 5 12:53:55 2015 (r286317) @@ -282,6 +282,27 @@ _CPUCFLAGS += -mfloat-abi=softfp CFLAGS += ${_CPUCFLAGS} .endif +# +# Prohibit the compiler from emitting SIMD instructions. +# These flags are added to CFLAGS in areas where the extra context-switch +# cost outweighs the advantages of SIMD instructions. +# +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and +# -mno-sse42 +# (-mfpmath= is not supported) +# +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS_NO_SIMD.clang= -mno-avx +CFLAGS_NO_SIMD= -mno-mmx -mno-sse +.endif +CFLAGS_NO_SIMD += ${CFLAGS_NO_SIMD.${COMPILER_TYPE}} + # Add in any architecture-specific CFLAGS. # These come from make.conf or the command line or the environment. CFLAGS += ${CFLAGS.${MACHINE_ARCH}} From owner-svn-src-head@freebsd.org Wed Aug 5 13:09:48 2015 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 8A3349B44B7; Wed, 5 Aug 2015 13:09:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6DBC5F4B; Wed, 5 Aug 2015 13:09:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75D9mZ6025555; Wed, 5 Aug 2015 13:09:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75D9lhi025549; Wed, 5 Aug 2015 13:09:47 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508051309.t75D9lhi025549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 13:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286318 - in head/sys: compat/cloudabi64 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.20 Precedence: list List-Id: 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, 05 Aug 2015 13:09:48 -0000 Author: ed Date: Wed Aug 5 13:09:46 2015 New Revision: 286318 URL: https://svnweb.freebsd.org/changeset/base/286318 Log: Import the latest CloudABI system call definitions and table. We're going to need these for next code I'm going to send out for review: support for poll() and kqueue() on CloudABI. Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/syscalls.master head/sys/contrib/cloudabi/syscalldefs_md.h head/sys/contrib/cloudabi/syscalldefs_mi.h Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Aug 5 12:53:55 2015 (r286317) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Aug 5 13:09:46 2015 (r286318) @@ -36,3 +36,12 @@ cloudabi64_sys_poll(struct thread *td, s /* Not implemented. */ return (ENOSYS); } + +int +cloudabi64_sys_poll_fd(struct thread *td, + struct cloudabi64_sys_poll_fd_args *uap) +{ + + /* Not implemented. */ + return (ENOSYS); +} Modified: head/sys/compat/cloudabi64/syscalls.master ============================================================================== --- head/sys/compat/cloudabi64/syscalls.master Wed Aug 5 12:53:55 2015 (r286317) +++ head/sys/compat/cloudabi64/syscalls.master Wed Aug 5 13:09:46 2015 (r286318) @@ -157,11 +157,9 @@ void * addr, size_t len); } 39 AUE_NULL STD { cloudabi64_size_t cloudabi64_sys_poll( \ - cloudabi_fd_t fd, \ const cloudabi64_subscription_t *in, \ - cloudabi64_size_t nin, \ cloudabi64_event_t *out, \ - cloudabi64_size_t nout); } + cloudabi64_size_t nevents); } 40 AUE_NULL STD { void cloudabi_sys_proc_exec( \ cloudabi_fd_t fd, const void *data, \ @@ -212,3 +210,11 @@ cloudabi_mflags_t scope); } 55 AUE_NULL STD { void cloudabi_sys_thread_tcb_set(void *tcb); } 56 AUE_NULL STD { void cloudabi_sys_thread_yield(); } + +57 AUE_NULL STD { cloudabi64_size_t cloudabi64_sys_poll_fd( \ + cloudabi_fd_t fd, \ + const cloudabi64_subscription_t *in, \ + cloudabi64_size_t nin, \ + cloudabi64_event_t *out, \ + cloudabi64_size_t nout, \ + const cloudabi64_subscription_t *timeout); } Modified: head/sys/contrib/cloudabi/syscalldefs_md.h ============================================================================== --- head/sys/contrib/cloudabi/syscalldefs_md.h Wed Aug 5 12:53:55 2015 (r286317) +++ head/sys/contrib/cloudabi/syscalldefs_md.h Wed Aug 5 13:09:46 2015 (r286318) @@ -186,6 +186,7 @@ typedef struct { MEMBER(cloudabi_clockid_t) clock_id; MEMBER(cloudabi_timestamp_t) timeout; MEMBER(cloudabi_timestamp_t) precision; + MEMBER(uint16_t) flags; } clock; // CLOUDABI_EVENTTYPE_CONDVAR: Release a lock and wait on a @@ -202,6 +203,7 @@ typedef struct { // called without blocking. struct { MEMBER(cloudabi_fd_t) fd; + MEMBER(uint16_t) flags; } fd_readwrite; // CLOUDABI_EVENT_LOCK_RDLOCK and CLOUDABI_EVENT_LOCK_WRLOCK: Wait @@ -224,15 +226,17 @@ ASSERT_OFFSET(subscription_t, clock.iden ASSERT_OFFSET(subscription_t, clock.clock_id, 24, 24); ASSERT_OFFSET(subscription_t, clock.timeout, 32, 32); ASSERT_OFFSET(subscription_t, clock.precision, 40, 40); +ASSERT_OFFSET(subscription_t, clock.flags, 48, 48); ASSERT_OFFSET(subscription_t, condvar.condvar, 16, 16); ASSERT_OFFSET(subscription_t, condvar.lock, 20, 24); ASSERT_OFFSET(subscription_t, condvar.condvar_scope, 24, 32); ASSERT_OFFSET(subscription_t, condvar.lock_scope, 25, 33); ASSERT_OFFSET(subscription_t, fd_readwrite.fd, 16, 16); +ASSERT_OFFSET(subscription_t, fd_readwrite.flags, 20, 20); ASSERT_OFFSET(subscription_t, lock.lock, 16, 16); ASSERT_OFFSET(subscription_t, lock.lock_scope, 20, 24); ASSERT_OFFSET(subscription_t, proc_terminate.fd, 16, 16); -ASSERT_SIZE(subscription_t, 48, 48); +ASSERT_SIZE(subscription_t, 56, 56); typedef struct { MEMBER(PTR(IDENT(threadentry_t))) entry_point; // Entry point. Modified: head/sys/contrib/cloudabi/syscalldefs_mi.h ============================================================================== --- head/sys/contrib/cloudabi/syscalldefs_mi.h Wed Aug 5 12:53:55 2015 (r286317) +++ head/sys/contrib/cloudabi/syscalldefs_mi.h Wed Aug 5 13:09:46 2015 (r286318) @@ -204,9 +204,6 @@ #define CLOUDABI_O_EXCL 0x4 #define CLOUDABI_O_TRUNC 0x8 -// File descriptor passed to poll() to poll just once. -#define CLOUDABI_POLL_ONCE 0xffffffff - // File descriptor returned to pdfork()'s child process. #define CLOUDABI_PROCESS_CHILD 0xffffffff @@ -326,6 +323,12 @@ #define CLOUDABI_SUBSCRIPTION_ENABLE 0x10 #define CLOUDABI_SUBSCRIPTION_ONESHOT 0x20 +// cloudabi_subscription_t::clock.flags. +#define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x1 + +// cloudabi_subscription_t::fd_readwrite.flags. +#define CLOUDABI_SUBSCRIPTION_FD_READWRITE_POLL 0x1 + // unlinkat(). #define CLOUDABI_UNLINK_REMOVEDIR 0x1 From owner-svn-src-head@freebsd.org Wed Aug 5 13:10:15 2015 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 99FC89B44F0; Wed, 5 Aug 2015 13:10:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8A9ED11A3; Wed, 5 Aug 2015 13:10:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75DAFVK028072; Wed, 5 Aug 2015 13:10:15 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75DADYk028064; Wed, 5 Aug 2015 13:10:13 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508051310.t75DADYk028064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 13:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286319 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 13:10:15 -0000 Author: ed Date: Wed Aug 5 13:10:13 2015 New Revision: 286319 URL: https://svnweb.freebsd.org/changeset/base/286319 Log: Regenerate the system call table. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Aug 5 13:09:46 2015 (r286318) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Aug 5 13:10:13 2015 (r286319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -232,11 +232,9 @@ struct cloudabi_sys_mem_unmap_args { char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; }; struct cloudabi64_sys_poll_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char nin_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nin; char nin_r_[PADR_(cloudabi64_size_t)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nout_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nout; char nout_r_[PADR_(cloudabi64_size_t)]; + char nevents_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nevents; char nevents_r_[PADR_(cloudabi64_size_t)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -310,6 +308,14 @@ struct cloudabi_sys_thread_tcb_set_args struct cloudabi_sys_thread_yield_args { register_t dummy; }; +struct cloudabi64_sys_poll_fd_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; + char nin_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nin; char nin_r_[PADR_(cloudabi64_size_t)]; + char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; + char nout_l_[PADL_(cloudabi64_size_t)]; cloudabi64_size_t nout; char nout_r_[PADR_(cloudabi64_size_t)]; + char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; +}; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); @@ -367,6 +373,7 @@ int cloudabi64_sys_thread_create(struct int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); int cloudabi_sys_thread_tcb_set(struct thread *, struct cloudabi_sys_thread_tcb_set_args *); int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); +int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); #ifdef COMPAT_43 @@ -448,6 +455,7 @@ int cloudabi_sys_thread_yield(struct thr #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_tcb_set AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL +#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Wed Aug 5 13:09:46 2015 (r286318) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Wed Aug 5 13:10:13 2015 (r286319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 @@ -63,4 +63,5 @@ #define CLOUDABI64_SYS_cloudabi_sys_thread_exit 54 #define CLOUDABI64_SYS_cloudabi_sys_thread_tcb_set 55 #define CLOUDABI64_SYS_cloudabi_sys_thread_yield 56 -#define CLOUDABI64_SYS_MAXSYSCALL 57 +#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 57 +#define CLOUDABI64_SYS_MAXSYSCALL 58 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Wed Aug 5 13:09:46 2015 (r286318) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Wed Aug 5 13:10:13 2015 (r286319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed */ const char *cloudabi64_syscallnames[] = { @@ -64,4 +64,5 @@ const char *cloudabi64_syscallnames[] = "cloudabi_sys_thread_exit", /* 54 = cloudabi_sys_thread_exit */ "cloudabi_sys_thread_tcb_set", /* 55 = cloudabi_sys_thread_tcb_set */ "cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */ + "cloudabi64_sys_poll_fd", /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Aug 5 13:09:46 2015 (r286318) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Aug 5 13:10:13 2015 (r286319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed + * created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 286318 2015-08-05 13:09:46Z ed */ #include @@ -72,4 +72,5 @@ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_exit */ { AS(cloudabi_sys_thread_tcb_set_args), (sy_call_t *)cloudabi_sys_thread_tcb_set, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_tcb_set */ { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */ + { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Aug 5 13:09:46 2015 (r286318) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Aug 5 13:10:13 2015 (r286319) @@ -367,12 +367,10 @@ systrace_args(int sysnum, void *params, /* cloudabi64_sys_poll */ case 39: { struct cloudabi64_sys_poll_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - iarg[2] = p->nin; /* cloudabi64_size_t */ - uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ - iarg[4] = p->nout; /* cloudabi64_size_t */ - *n_args = 5; + uarg[0] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ + uarg[1] = (intptr_t) p->out; /* cloudabi64_event_t * */ + iarg[2] = p->nevents; /* cloudabi64_size_t */ + *n_args = 3; break; } /* cloudabi_sys_proc_exec */ @@ -511,6 +509,18 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } + /* cloudabi64_sys_poll_fd */ + case 57: { + struct cloudabi64_sys_poll_fd_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ + iarg[2] = p->nin; /* cloudabi64_size_t */ + uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ + iarg[4] = p->nout; /* cloudabi64_size_t */ + uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -1155,18 +1165,12 @@ systrace_entry_setargdesc(int sysnum, in case 39: switch(ndx) { case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "const cloudabi64_subscription_t *"; break; - case 2: - p = "cloudabi64_size_t"; - break; - case 3: + case 1: p = "cloudabi64_event_t *"; break; - case 4: + case 2: p = "cloudabi64_size_t"; break; default: @@ -1392,6 +1396,31 @@ systrace_entry_setargdesc(int sysnum, in /* cloudabi_sys_thread_yield */ case 56: break; + /* cloudabi64_sys_poll_fd */ + case 57: + switch(ndx) { + case 0: + p = "cloudabi_fd_t"; + break; + case 1: + p = "const cloudabi64_subscription_t *"; + break; + case 2: + p = "cloudabi64_size_t"; + break; + case 3: + p = "cloudabi64_event_t *"; + break; + case 4: + p = "cloudabi64_size_t"; + break; + case 5: + p = "const cloudabi64_subscription_t *"; + break; + default: + break; + }; + break; default: break; }; @@ -1682,6 +1711,11 @@ systrace_return_setargdesc(int sysnum, i break; /* cloudabi_sys_thread_yield */ case 56: + /* cloudabi64_sys_poll_fd */ + case 57: + if (ndx == 0 || ndx == 1) + p = "cloudabi64_size_t"; + break; default: break; }; From owner-svn-src-head@freebsd.org Wed Aug 5 13:46:16 2015 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 271289B4D17; Wed, 5 Aug 2015 13:46:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 F261EB3D; Wed, 5 Aug 2015 13:46:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75DkFIA042507; Wed, 5 Aug 2015 13:46:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75DkFrY042506; Wed, 5 Aug 2015 13:46:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508051346.t75DkFrY042506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Aug 2015 13:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286320 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 13:46:16 -0000 Author: mav Date: Wed Aug 5 13:46:15 2015 New Revision: 286320 URL: https://svnweb.freebsd.org/changeset/base/286320 Log: Issue all reads of single XCOPY segment simultaneously. During vMotion and Clone VMware by default runs multiple sequential 4MB XCOPY requests same time. If CTL issues reads sequentially in 1MB chunks for each XCOPY command, reads from different commands are not detected as sequential by serseq option code and allowed to execute simultaneously. Such read pattern confused ZFS prefetcher, causing suboptimal disk access. Issuing all reads same time make serseq code work properly, serializing reads both within each XCOPY command and between them. My tests with ZFS pool of 14 disks in RAID10 shows prefetcher efficiency improved from 37% to 99.7%, copying speed improved by 10-60%, average read latency reduced twice on HDD layer and by five times on zvol layer. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Wed Aug 5 13:10:13 2015 (r286319) +++ head/sys/cam/ctl/ctl_tpc.c Wed Aug 5 13:46:15 2015 (r286320) @@ -817,7 +817,7 @@ tpc_process_b2b(struct tpc_list *list) struct scsi_ec_segment_b2b *seg; struct scsi_ec_cscd_dtsp *sdstp, *ddstp; struct tpc_io *tior, *tiow; - struct runl run, *prun; + struct runl run; uint64_t sl, dl; off_t srclba, dstlba, numbytes, donebytes, roundbytes; int numlba; @@ -889,8 +889,7 @@ tpc_process_b2b(struct tpc_list *list) list->segsectors = numbytes / dstblock; donebytes = 0; TAILQ_INIT(&run); - prun = &run; - list->tbdio = 1; + list->tbdio = 0; while (donebytes < numbytes) { roundbytes = numbytes - donebytes; if (roundbytes > TPC_MAX_IO_SIZE) { @@ -942,8 +941,8 @@ tpc_process_b2b(struct tpc_list *list) tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); - TAILQ_INSERT_TAIL(prun, tior, rlinks); - prun = &tior->run; + TAILQ_INSERT_TAIL(&run, tior, rlinks); + list->tbdio++; donebytes += roundbytes; srclba += roundbytes / srcblock; dstlba += roundbytes / dstblock; From owner-svn-src-head@freebsd.org Wed Aug 5 14:00:04 2015 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 1B6A99B4F9A for ; Wed, 5 Aug 2015 14:00:04 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) (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 AC22C1370 for ; Wed, 5 Aug 2015 14:00:02 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wibxm9 with SMTP id xm9so68421134wib.1 for ; Wed, 05 Aug 2015 07:00:01 -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:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=/hjMKj22J7COJy/FeSKqVW7h/3WI0z5RTD6cSmpg4QI=; b=Gua+0RMZaY2OLAM3Gb6Op+r1O+doHEvuE3jGu1SysHSPaKQf3HvNSMEHzG/MIJH+no rbbpOP1hbOHTMteQZ6jIzd92MjHaUBF4WHqV0j0wtSH2JpbMqpxfvMuEoBBUl5MXEo4O TErH4QLE9BYV85mXrdfIi+exKYGJ9bclNvkbN4pR34ZBRjBVNTz1A7wpPCXllCGZQCBG x+plvYMygbwBu7BIMgn5a4cPjtT9cwDkMaa2AdKBYih5ri4el8ZEBefClFuLEpotteIu NmxJHcrOVXitan4+FDVAGdHIzJ7aUSw4J9FbSho635zBrmahmCcCyFEjq9jsRSbXlFUn tygw== X-Gm-Message-State: ALoCoQmq1d78r10LHyAI6J/LeHe7V50f9+hA+ZmsxdpiOfAa/yamYEVhIU2WE1tu+YoAApK9+DDR X-Received: by 10.180.102.74 with SMTP id fm10mr10761416wib.25.1438783201311; Wed, 05 Aug 2015 07:00:01 -0700 (PDT) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by smtp.gmail.com with ESMTPSA id pn6sm4274263wjb.36.2015.08.05.07.00.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Aug 2015 07:00:00 -0700 (PDT) Subject: Re: svn commit: r286320 - head/sys/cam/ctl To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508051346.t75DkFrY042506@repo.freebsd.org> From: Steven Hartland Message-ID: <55C216DB.10703@multiplay.co.uk> Date: Wed, 5 Aug 2015 14:59:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508051346.t75DkFrY042506@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.20 Precedence: list List-Id: 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, 05 Aug 2015 14:00:04 -0000 Nice!! On 05/08/2015 14:46, Alexander Motin wrote: > Author: mav > Date: Wed Aug 5 13:46:15 2015 > New Revision: 286320 > URL: https://svnweb.freebsd.org/changeset/base/286320 > > Log: > Issue all reads of single XCOPY segment simultaneously. > > During vMotion and Clone VMware by default runs multiple sequential 4MB > XCOPY requests same time. If CTL issues reads sequentially in 1MB chunks > for each XCOPY command, reads from different commands are not detected > as sequential by serseq option code and allowed to execute simultaneously. > Such read pattern confused ZFS prefetcher, causing suboptimal disk access. > Issuing all reads same time make serseq code work properly, serializing > reads both within each XCOPY command and between them. > > My tests with ZFS pool of 14 disks in RAID10 shows prefetcher efficiency > improved from 37% to 99.7%, copying speed improved by 10-60%, average > read latency reduced twice on HDD layer and by five times on zvol layer. > > MFC after: 2 weeks > Sponsored by: iXsystems, Inc. > > Modified: > head/sys/cam/ctl/ctl_tpc.c > > Modified: head/sys/cam/ctl/ctl_tpc.c > ============================================================================== > --- head/sys/cam/ctl/ctl_tpc.c Wed Aug 5 13:10:13 2015 (r286319) > +++ head/sys/cam/ctl/ctl_tpc.c Wed Aug 5 13:46:15 2015 (r286320) > @@ -817,7 +817,7 @@ tpc_process_b2b(struct tpc_list *list) > struct scsi_ec_segment_b2b *seg; > struct scsi_ec_cscd_dtsp *sdstp, *ddstp; > struct tpc_io *tior, *tiow; > - struct runl run, *prun; > + struct runl run; > uint64_t sl, dl; > off_t srclba, dstlba, numbytes, donebytes, roundbytes; > int numlba; > @@ -889,8 +889,7 @@ tpc_process_b2b(struct tpc_list *list) > list->segsectors = numbytes / dstblock; > donebytes = 0; > TAILQ_INIT(&run); > - prun = &run; > - list->tbdio = 1; > + list->tbdio = 0; > while (donebytes < numbytes) { > roundbytes = numbytes - donebytes; > if (roundbytes > TPC_MAX_IO_SIZE) { > @@ -942,8 +941,8 @@ tpc_process_b2b(struct tpc_list *list) > tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; > > TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); > - TAILQ_INSERT_TAIL(prun, tior, rlinks); > - prun = &tior->run; > + TAILQ_INSERT_TAIL(&run, tior, rlinks); > + list->tbdio++; > donebytes += roundbytes; > srclba += roundbytes / srcblock; > dstlba += roundbytes / dstblock; > From owner-svn-src-head@freebsd.org Wed Aug 5 14:45:53 2015 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 62B639B2B82; Wed, 5 Aug 2015 14:45:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4DF16E7F; Wed, 5 Aug 2015 14:45:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75EjrDl067105; Wed, 5 Aug 2015 14:45:53 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75Ejr90067104; Wed, 5 Aug 2015 14:45:53 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201508051445.t75Ejr90067104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Aug 2015 14:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286321 - head/sys/modules/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.20 Precedence: list List-Id: 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, 05 Aug 2015 14:45:53 -0000 Author: lwhsu (ports committer) Date: Wed Aug 5 14:45:52 2015 New Revision: 286321 URL: https://svnweb.freebsd.org/changeset/base/286321 Log: Fix `make depend` in sys/modules Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D3291 Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Wed Aug 5 13:46:15 2015 (r286320) +++ head/sys/modules/zfs/Makefile Wed Aug 5 14:45:52 2015 (r286321) @@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../.. KMOD= zfs -SRCS= bus_if.h device_if.h vnode_if.h +SRCS= bus_if.h device_if.h vnode_if.h opt_kstack_pages.h SUNW= ${SYSDIR}/cddl/contrib/opensolaris From owner-svn-src-head@freebsd.org Wed Aug 5 16:15:44 2015 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 25E1B9B4FB6; Wed, 5 Aug 2015 16:15:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1736034C; Wed, 5 Aug 2015 16:15:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75GFhbM003653; Wed, 5 Aug 2015 16:15:43 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75GFhdD003652; Wed, 5 Aug 2015 16:15:43 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508051615.t75GFhdD003652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 16:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286323 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 16:15:44 -0000 Author: ed Date: Wed Aug 5 16:15:43 2015 New Revision: 286323 URL: https://svnweb.freebsd.org/changeset/base/286323 Log: Make fcntl(F_SETFL) work. The stat_put() system call can be used to modify file descriptor attributes, such as flags, but also Capsicum permission bits. Support for changing Capsicum bits will be added as soon as its dependent changes have been pushed through code review. Obtained from: https://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 5 15:57:08 2015 (r286322) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 5 16:15:43 2015 (r286323) @@ -503,9 +503,26 @@ int cloudabi_sys_fd_stat_put(struct thread *td, struct cloudabi_sys_fd_stat_put_args *uap) { + cloudabi_fdstat_t fsb; + int error, oflags; - /* Not implemented. */ - return (ENOSYS); + error = copyin(uap->buf, &fsb, sizeof(fsb)); + if (error != 0) + return (error); + + if (uap->flags == CLOUDABI_FDSTAT_FLAGS) { + /* Convert flags. */ + oflags = 0; + if (fsb.fs_flags & CLOUDABI_FDFLAG_APPEND) + oflags |= O_APPEND; + if (fsb.fs_flags & CLOUDABI_FDFLAG_NONBLOCK) + oflags |= O_NONBLOCK; + if (fsb.fs_flags & (CLOUDABI_FDFLAG_SYNC | + CLOUDABI_FDFLAG_DSYNC | CLOUDABI_FDFLAG_RSYNC)) + oflags |= O_SYNC; + return (kern_fcntl(td, uap->fd, F_SETFL, oflags)); + } + return (EINVAL); } int From owner-svn-src-head@freebsd.org Wed Aug 5 16:45:48 2015 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 31DB99B4ABD; Wed, 5 Aug 2015 16:45:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2350C1AA4; Wed, 5 Aug 2015 16:45:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75GjmHd015945; Wed, 5 Aug 2015 16:45:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75Gjlja015944; Wed, 5 Aug 2015 16:45:47 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508051645.t75Gjlja015944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 16:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286324 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 16:45:48 -0000 Author: ed Date: Wed Aug 5 16:45:47 2015 New Revision: 286324 URL: https://svnweb.freebsd.org/changeset/base/286324 Log: Add DECLARE_MODULE() to the "cloudabi" kernel module. This kernel module does not require any explicit initialization, but a module declaration is needed to let the "cloudabi64" kernel module automatically pull this in. Obtained from: https://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi/cloudabi_proc.c Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Wed Aug 5 16:15:43 2015 (r286323) +++ head/sys/compat/cloudabi/cloudabi_proc.c Wed Aug 5 16:45:47 2015 (r286324) @@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -133,3 +135,12 @@ cloudabi_sys_proc_raise(struct thread *t PROC_UNLOCK(p); return (0); } + +static moduledata_t cloudabi_module = { + "cloudabi", + NULL, + NULL +}; + +DECLARE_MODULE(cloudabi, cloudabi_module, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(cloudabi, 1); From owner-svn-src-head@freebsd.org Wed Aug 5 16:49:53 2015 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 2962B9B4B97 for ; Wed, 5 Aug 2015 16:49:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm2-vm1.bullet.mail.bf1.yahoo.com (nm2-vm1.bullet.mail.bf1.yahoo.com [98.139.213.158]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D10E31E33 for ; Wed, 5 Aug 2015 16:49:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1438793388; bh=iHquILCHdNBvIBAMvcXSmdtIa1RKwtevIr/o2PF6V74=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=i+J5issgIrMvGMSlCPbwXLK5tIJIKFdH5d6NomaSXzuRyY/DUIrWfzOGdAtQb3qASURsSHr4mooyEka/E+Zc6ILrlCLqVJ7qr2xq/jDKNME91fwvapt44FIjD7EfBKGDKWTmGUiXB1x8pcsRAR4h+yelE1hnGOp7TfWkgQ++kng94TMdyKT7m35PvVtDUm7xu9kGyPX04lM4MP7+MNrgWDIMt/MZ7E+Ke1Pi7rW322iC8CV+N6w+L5nuTi2WPnfDCuiJUaM0+Dett8uvAczm14Wm+axDYqmt+ZM4j6V7ppTjdW72E0660oDb0ktc+jzKye+FQnutSSt67CVTJ6FD8w== Received: from [66.196.81.174] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 05 Aug 2015 16:49:48 -0000 Received: from [68.142.230.72] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 05 Aug 2015 16:49:48 -0000 Received: from [127.0.0.1] by smtp229.mail.bf1.yahoo.com with NNFMP; 05 Aug 2015 16:49:48 -0000 X-Yahoo-Newman-Id: 655504.93598.bm@smtp229.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: diaqHVwVM1nJwvmnaHOHm1ycFlXvinB4ZooFZl.3rC3oPBz 5wCbZVc9JiWx8oSKSfjYisO_PzUp_z0P10jHISmeQmX49tu7_Qbi1LuIVP3i KgIFzKw17rfzW.YwlOHZ9PMdnE5S_1QdyOwwQWwnIcvlnc.4N.YdjeBQdZW8 4WlOxCbTqYG.ERSIdVNmMWps1Fsw3lln3HgAJnl1Qc4lrIIIZU2tYdeQSXHm h4RRl37qog7tS.epn9BLHnlxJTeu.36Sq79EyvCfF8.QvkYmNB1H7E.AIa.1 968G1ljih9SVqvv7b_gCFa_6JhO_QrVds7EY0DodOYvoFNEiJ3oHu4MOgE3Z HAVWxmBy0SNdot4OIYbVSl.VqeO79ZCjlY2.6xOgauUg3ib_i3zoW56uL0Sf 1PdbW9QsbiUnhSslhlY.mnx8VFqx3eW3dpvXyUJpj2QA48DhfR1WlH6gUzUO GmgHVVEzhIyJqhSDjlTC7pnTt3jGJNdo2HCU3QiKD0XYAewjjrLnN6_9yJGS bqa2TA4ypXaqGcCHdNhRio1kAOO7cZN0- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r286323 - head/sys/compat/cloudabi To: Ed Schouten , svn-src-head@freebsd.org References: <201508051615.t75GFhdD003652@repo.freebsd.org> From: Pedro Giffuni Message-ID: <55C23EB1.20903@FreeBSD.org> Date: Wed, 5 Aug 2015 11:49:53 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508051615.t75GFhdD003652@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.20 Precedence: list List-Id: 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, 05 Aug 2015 16:49:53 -0000 Hi Ed; This just reminded me: Clang has support for type-safety attributes[1] for fcntl and ioctls. I gave them a try[2] but they broke compatibility. For a clean ABI you should consider them. Best regards, Pedro. [1] http://clang.llvm.org/docs/AttributeReference.html#type-safety-checking [2] https://reviews.freebsd.org/D2411 On 08/05/15 11:15, Ed Schouten wrote: > Author: ed > Date: Wed Aug 5 16:15:43 2015 > New Revision: 286323 > URL: https://svnweb.freebsd.org/changeset/base/286323 > > Log: > Make fcntl(F_SETFL) work. > > The stat_put() system call can be used to modify file descriptor > attributes, such as flags, but also Capsicum permission bits. Support > for changing Capsicum bits will be added as soon as its dependent > changes have been pushed through code review. > > Obtained from: https://github.com/NuxiNL/freebsd > From owner-svn-src-head@freebsd.org Wed Aug 5 16:53:50 2015 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 64E9F9B4C94; Wed, 5 Aug 2015 16:53:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4FC84E6; Wed, 5 Aug 2015 16:53:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75GroeA020165; Wed, 5 Aug 2015 16:53:50 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75Groqh020164; Wed, 5 Aug 2015 16:53:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508051653.t75Groqh020164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 5 Aug 2015 16:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286325 - head/sys/compat/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.20 Precedence: list List-Id: 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, 05 Aug 2015 16:53:50 -0000 Author: ed Date: Wed Aug 5 16:53:49 2015 New Revision: 286325 URL: https://svnweb.freebsd.org/changeset/base/286325 Log: Correct the previous commit: remove the DECLARE_MODULE(). It looks like a MODULE_VERSION() can also appear on its own -- there is no need to use explicitly use DECLARE_MODULE(). Looking at other modules, this seems common practice. Modified: head/sys/compat/cloudabi/cloudabi_proc.c Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Wed Aug 5 16:45:47 2015 (r286324) +++ head/sys/compat/cloudabi/cloudabi_proc.c Wed Aug 5 16:53:49 2015 (r286325) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -136,11 +135,4 @@ cloudabi_sys_proc_raise(struct thread *t return (0); } -static moduledata_t cloudabi_module = { - "cloudabi", - NULL, - NULL -}; - -DECLARE_MODULE(cloudabi, cloudabi_module, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_VERSION(cloudabi, 1); From owner-svn-src-head@freebsd.org Wed Aug 5 17:05:38 2015 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 41C849B4F43; Wed, 5 Aug 2015 17:05:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 260D7B28; Wed, 5 Aug 2015 17:05:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75H5ckc024786; Wed, 5 Aug 2015 17:05:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75H5aSD024777; Wed, 5 Aug 2015 17:05:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508051705.t75H5aSD024777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Aug 2015 17:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286327 - in head/sys: arm/include arm64/include mips/include powerpc/include sparc64/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 17:05:38 -0000 Author: emaste Date: Wed Aug 5 17:05:35 2015 New Revision: 286327 URL: https://svnweb.freebsd.org/changeset/base/286327 Log: Rationalize BSD license on sys/*/include/float.h Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Update clause numbering. Modified: head/sys/arm/include/float.h head/sys/arm64/include/float.h head/sys/mips/include/float.h head/sys/powerpc/include/float.h head/sys/sparc64/include/float.h head/sys/x86/include/float.h Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/arm/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/sys/arm64/include/float.h ============================================================================== --- head/sys/arm64/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/arm64/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 3. 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. Modified: head/sys/mips/include/float.h ============================================================================== --- head/sys/mips/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/mips/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/powerpc/include/float.h ============================================================================== --- head/sys/powerpc/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/powerpc/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/sparc64/include/float.h ============================================================================== --- head/sys/sparc64/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/sparc64/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -14,7 +14,7 @@ * 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 + * 3. 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. * Modified: head/sys/x86/include/float.h ============================================================================== --- head/sys/x86/include/float.h Wed Aug 5 16:58:04 2015 (r286326) +++ head/sys/x86/include/float.h Wed Aug 5 17:05:35 2015 (r286327) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * From owner-svn-src-head@freebsd.org Wed Aug 5 17:21:43 2015 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 910A69B333D; Wed, 5 Aug 2015 17:21:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7F7861465; Wed, 5 Aug 2015 17:21:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75HLhxd033256; Wed, 5 Aug 2015 17:21:43 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75HLhUo033255; Wed, 5 Aug 2015 17:21:43 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201508051721.t75HLhUo033255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 5 Aug 2015 17:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286328 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 17:21:43 -0000 Author: jkim Date: Wed Aug 5 17:21:42 2015 New Revision: 286328 URL: https://svnweb.freebsd.org/changeset/base/286328 Log: Fix more style issues. Submitted by: bde Modified: head/sys/x86/include/_types.h Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Wed Aug 5 17:05:35 2015 (r286327) +++ head/sys/x86/include/_types.h Wed Aug 5 17:21:42 2015 (r286328) @@ -155,10 +155,10 @@ typedef __builtin_va_list __va_list; /* #else #ifdef __LP64__ struct __s_va_list { - __uint32_t pad1[2]; /* gp_offset, fp_offset */ - __uint64_t pad2[2]; /* overflow_arg_area, reg_save_area */ + __uint32_t _pad1[2]; /* gp_offset, fp_offset */ + __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ }; -typedef struct __s_va_list __va_list; +typedef struct __s_va_list __va_list; #else typedef char * __va_list; #endif From owner-svn-src-head@freebsd.org Wed Aug 5 17:25:41 2015 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 CF6F49B344E for ; Wed, 5 Aug 2015 17:25:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1.freebsd.org (Postfix) with SMTP id B1CC11999 for ; Wed, 5 Aug 2015 17:25:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 5 Aug 2015 17:25:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t75HOW7C020884; Wed, 5 Aug 2015 11:24:32 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1438795472.70393.178.camel@freebsd.org> Subject: Re: svn commit: r286328 - head/sys/x86/include From: Ian Lepore To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 05 Aug 2015 11:24:32 -0600 In-Reply-To: <201508051721.t75HLhUo033255@repo.freebsd.org> References: <201508051721.t75HLhUo033255@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 17:25:41 -0000 On Wed, 2015-08-05 at 17:21 +0000, Jung-uk Kim wrote: > Author: jkim > Date: Wed Aug 5 17:21:42 2015 > New Revision: 286328 > URL: https://svnweb.freebsd.org/changeset/base/286328 > > Log: > Fix more style issues. > > Submitted by: bde > > Modified: > head/sys/x86/include/_types.h > > Modified: head/sys/x86/include/_types.h > ============================================================================== > --- head/sys/x86/include/_types.h Wed Aug 5 17:05:35 2015 (r286327) > +++ head/sys/x86/include/_types.h Wed Aug 5 17:21:42 2015 (r286328) > @@ -155,10 +155,10 @@ typedef __builtin_va_list __va_list; /* > #else > #ifdef __LP64__ > struct __s_va_list { > - __uint32_t pad1[2]; /* gp_offset, fp_offset */ > - __uint64_t pad2[2]; /* overflow_arg_area, reg_save_area */ > + __uint32_t _pad1[2]; /* gp_offset, fp_offset */ > + __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ > }; > -typedef struct __s_va_list __va_list; > +typedef struct __s_va_list __va_list; > #else > typedef char * __va_list; > #endif > You've just changed it from the style that's wrong on Wednesdays back to the style that's wrong on Mondays. So I guess you'll be getting a new mail about this next week. -- Ian From owner-svn-src-head@freebsd.org Wed Aug 5 17:38:03 2015 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 8ABE19B36AA; Wed, 5 Aug 2015 17:38:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7A7371EED; Wed, 5 Aug 2015 17:38:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75Hc3MN038357; Wed, 5 Aug 2015 17:38:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75Hc2MP038354; Wed, 5 Aug 2015 17:38:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508051738.t75Hc2MP038354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 5 Aug 2015 17:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286329 - in head/etc: defaults 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.20 Precedence: list List-Id: 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, 05 Aug 2015 17:38:03 -0000 Author: trasz Date: Wed Aug 5 17:38:02 2015 New Revision: 286329 URL: https://svnweb.freebsd.org/changeset/base/286329 Log: Make rctl_enable rc variable actually work. To avoid breaking existing setups that worked before, flip the default to "YES". Most people don't have /etc/rctl.conf, so they won't be affected in any way. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/defaults/rc.conf head/etc/rc.d/rctl Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Aug 5 17:21:42 2015 (r286328) +++ head/etc/defaults/rc.conf Wed Aug 5 17:38:02 2015 (r286329) @@ -664,7 +664,7 @@ opensm_enable="NO" # Opensm(8) for infin casperd_enable="YES" # casperd(8) daemon # rctl(8) requires kernel options RACCT and RCTL -rctl_enable="NO" # Load rctl(8) rules on boot +rctl_enable="YES" # Load rctl(8) rules on boot rctl_rules="/etc/rctl.conf" # rctl(8) ruleset. See rctl.conf(5). iovctl_files="" # Config files for iovctl(8) Modified: head/etc/rc.d/rctl ============================================================================== --- head/etc/rc.d/rctl Wed Aug 5 17:21:42 2015 (r286328) +++ head/etc/rc.d/rctl Wed Aug 5 17:38:02 2015 (r286329) @@ -10,6 +10,7 @@ . /etc/rc.subr name="rctl" +rcvar="rctl_enable" start_cmd="rctl_start" stop_cmd="rctl_stop" From owner-svn-src-head@freebsd.org Wed Aug 5 18:10:47 2015 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 476289B3E30; Wed, 5 Aug 2015 18:10:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 307DEE9B; Wed, 5 Aug 2015 18:10:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75IAlNo052455; Wed, 5 Aug 2015 18:10:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75IAlYt052444; Wed, 5 Aug 2015 18:10:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508051810.t75IAlYt052444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Aug 2015 18:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286330 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 18:10:47 -0000 Author: jhb Date: Wed Aug 5 18:10:46 2015 New Revision: 286330 URL: https://svnweb.freebsd.org/changeset/base/286330 Log: Whitespace fix: remove some spurious spaces before commas. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 5 17:38:02 2015 (r286329) +++ head/usr.bin/truss/syscalls.c Wed Aug 5 18:10:46 2015 (r286330) @@ -93,7 +93,7 @@ static const char rcsid[] = */ static struct syscall syscalls[] = { { .name = "fcntl", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, + .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, { .name = "fork", .ret_type = 1, .nargs = 0 }, { .name = "vfork", .ret_type = 1, .nargs = 0 }, { .name = "rfork", .ret_type = 1, .nargs = 1, @@ -101,9 +101,9 @@ static struct syscall syscalls[] = { { .name = "getegid", .ret_type = 1, .nargs = 0 }, { .name = "geteuid", .ret_type = 1, .nargs = 0 }, { .name = "linux_readlink", .ret_type = 1, .nargs = 3, - .args = { { Name, 0 } , { Name | OUT, 1 }, { Int, 2 }}}, + .args = { { Name, 0 }, { Name | OUT, 1 }, { Int, 2 }}}, { .name = "linux_socketcall", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 } , { LinuxSockArgs, 1 }}}, + .args = { { Int, 0 }, { LinuxSockArgs, 1 }}}, { .name = "getgid", .ret_type = 1, .nargs = 0 }, { .name = "getpid", .ret_type = 1, .nargs = 0 }, { .name = "getpgid", .ret_type = 1, .nargs = 1, @@ -114,7 +114,7 @@ static struct syscall syscalls[] = { .args = { { Int, 0 } } }, { .name = "getuid", .ret_type = 1, .nargs = 0 }, { .name = "readlink", .ret_type = 1, .nargs = 3, - .args = { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 } } }, + .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Int, 2 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, .args = { { Int, 0 }, { Quad, 1 + QUAD_ALIGN }, { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } }, { .name = "linux_lseek", .ret_type = 2, .nargs = 3, @@ -122,13 +122,13 @@ static struct syscall syscalls[] = { { .name = "mmap", .ret_type = 2, .nargs = 6, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } }, { .name = "linux_mkdir", .ret_type = 1, .nargs = 2, - .args = { { Name | IN, 0} , {Int, 1}}}, + .args = { { Name | IN, 0}, {Int, 1}}}, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 } , { Open, 1 }, { Octal, 2 } } }, + .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "mkdir", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 } , { Octal, 1 } } }, + .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "linux_open", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } }, { .name = "close", .ret_type = 1, .nargs = 1, @@ -154,7 +154,7 @@ static struct syscall syscalls[] = { { .name = "umount", .ret_type = 0, .nargs = 2, .args = { { Name, 0 }, { Int, 2 } } }, { .name = "fstat", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Stat | OUT , 1 } } }, + .args = { { Int, 0 }, { Stat | OUT, 1 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "lstat", .ret_type = 1, .nargs = 2, @@ -220,7 +220,7 @@ static struct syscall syscalls[] = { { .name = "getitimer", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Itimerval | OUT, 2 } } }, { .name = "setitimer", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Itimerval, 1 } , { Itimerval | OUT, 2 } } }, + .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } }, { .name = "kse_release", .ret_type = 0, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "kevent", .ret_type = 0, .nargs = 6, @@ -266,9 +266,9 @@ static struct syscall syscalls[] = { { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 } } }, { .name = "rename", .ret_type = 1, .nargs = 2, - .args = { { Name , 0 } , { Name, 1 } } }, + .args = { { Name, 0 }, { Name, 1 } } }, { .name = "symlink", .ret_type = 1, .nargs = 2, - .args = { { Name , 0 } , { Name, 1 } } }, + .args = { { Name, 0 }, { Name, 1 } } }, { .name = "posix_openpt", .ret_type = 1, .nargs = 1, .args = { { Open, 0 } } }, { .name = "wait4", .ret_type = 1, .nargs = 4, From owner-svn-src-head@freebsd.org Wed Aug 5 18:14:02 2015 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 488E19B3F34; Wed, 5 Aug 2015 18:14:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 20D3C1158; Wed, 5 Aug 2015 18:14:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75IE1ZE055835; Wed, 5 Aug 2015 18:14:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75IE1Xv055834; Wed, 5 Aug 2015 18:14:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508051814.t75IE1Xv055834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 5 Aug 2015 18:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286331 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 18:14:02 -0000 Author: jhb Date: Wed Aug 5 18:14:01 2015 New Revision: 286331 URL: https://svnweb.freebsd.org/changeset/base/286331 Log: Rework get_string() to make it more robust when fetching strings of unknown length. In particular, instead of blinding fetching 1k blocks, do an initial fetch up to the end of the current page followed by page-sized fetches up to the maximum size. Previously if the 1k buffer crossed a page boundary and the second page was not valid, the entire operation would fail. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Aug 5 18:10:46 2015 (r286330) +++ head/usr.bin/truss/syscalls.c Wed Aug 5 18:14:01 2015 (r286331) @@ -539,44 +539,56 @@ get_struct(pid_t pid, void *offset, void } #define MAXSIZE 4096 -#define BLOCKSIZE 1024 + /* * get_string * Copy a string from the process. Note that it is * expected to be a C string, but if max is set, it will * only get that much. */ - static char * -get_string(pid_t pid, void *offset, int max) +get_string(pid_t pid, void *addr, int max) { struct ptrace_io_desc iorequest; - char *buf; - int diff, i, size, totalsize; + char *buf, *nbuf; + size_t offset, size, totalsize; - diff = 0; - totalsize = size = max ? (max + 1) : BLOCKSIZE; + offset = 0; + if (max) + size = max + 1; + else { + /* Read up to the end of the current page. */ + size = PAGE_SIZE - ((uintptr_t)addr % PAGE_SIZE); + if (size > MAXSIZE) + size = MAXSIZE; + } + totalsize = size; buf = malloc(totalsize); if (buf == NULL) return (NULL); for (;;) { - diff = totalsize - size; iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (char *)offset + diff; - iorequest.piod_addr = buf + diff; + iorequest.piod_offs = (char *)addr + offset; + iorequest.piod_addr = buf + offset; iorequest.piod_len = size; if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) { free(buf); return (NULL); } - for (i = 0 ; i < size; i++) { - if (buf[diff + i] == '\0') + if (memchr(buf + offset, '\0', size) != NULL) + return (buf); + offset += size; + if (totalsize < MAXSIZE && max == 0) { + size = MAXSIZE - totalsize; + if (size > PAGE_SIZE) + size = PAGE_SIZE; + nbuf = realloc(buf, totalsize + size); + if (nbuf == NULL) { + buf[totalsize - 1] = '\0'; return (buf); - } - if (totalsize < MAXSIZE - BLOCKSIZE && max == 0) { - totalsize += BLOCKSIZE; - buf = realloc(buf, totalsize); - size = BLOCKSIZE; + } + buf = nbuf; + totalsize += size; } else { buf[totalsize - 1] = '\0'; return (buf); From owner-svn-src-head@freebsd.org Wed Aug 5 18:30:03 2015 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 B8E3F9B42B3; Wed, 5 Aug 2015 18:30:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A79A91AB6; Wed, 5 Aug 2015 18:30:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75IU3cp060519; Wed, 5 Aug 2015 18:30:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75IU1Oo060513; Wed, 5 Aug 2015 18:30:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508051830.t75IU1Oo060513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Aug 2015 18:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286332 - in head: . gnu/usr.bin/binutils gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/ar gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/ranlib gnu/usr.bin/binutils/readelf gnu/usr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 18:30:03 -0000 Author: emaste Date: Wed Aug 5 18:30:00 2015 New Revision: 286332 URL: https://svnweb.freebsd.org/changeset/base/286332 Log: Remove old GNU Binutils tools now provided by ELF Tool Chain Reviewed by: bapt, brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3238 Deleted: head/gnu/usr.bin/binutils/addr2line/Makefile head/gnu/usr.bin/binutils/addr2line/Makefile.depend head/gnu/usr.bin/binutils/addr2line/addr2line.1 head/gnu/usr.bin/binutils/ar/Makefile.depend head/gnu/usr.bin/binutils/nm/Makefile head/gnu/usr.bin/binutils/nm/Makefile.depend head/gnu/usr.bin/binutils/nm/nm.1 head/gnu/usr.bin/binutils/ranlib/Makefile.depend head/gnu/usr.bin/binutils/readelf/Makefile head/gnu/usr.bin/binutils/readelf/Makefile.depend head/gnu/usr.bin/binutils/readelf/readelf.1 head/gnu/usr.bin/binutils/size/Makefile head/gnu/usr.bin/binutils/size/Makefile.depend head/gnu/usr.bin/binutils/size/size.1 head/gnu/usr.bin/binutils/strings/Makefile head/gnu/usr.bin/binutils/strings/Makefile.depend head/gnu/usr.bin/binutils/strings/strings.1 head/gnu/usr.bin/binutils/strip/Makefile head/gnu/usr.bin/binutils/strip/Makefile.depend head/gnu/usr.bin/binutils/strip/strip.1 head/gnu/usr.bin/cc/c++filt/Makefile head/gnu/usr.bin/cc/c++filt/Makefile.depend Modified: head/UPDATING head/gnu/usr.bin/binutils/Makefile head/gnu/usr.bin/cc/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 5 18:14:01 2015 (r286331) +++ head/UPDATING Wed Aug 5 18:30:00 2015 (r286332) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150805: + GNU Binutils versions of addr2line, c++filt, nm, readelf, size, + strings and strip have been removed. The src.conf(5) knob + WITHOUT_ELFTOOLCHAIN_TOOLS no longer provides the binutils tools. + 20150728: As ZFS requires more kernel stack pages than is the default on some architectures e.g. i386, it now warns if KSTACK_PAGES is less than @@ -224,7 +229,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 taken from the ELF Tool Chain project rather than GNU binutils. They should be drop-in replacements, with the addition of arm64 support. The WITHOUT_ELFTOOLCHAIN_TOOLS= knob may be used to obtain the - binutils tools, if necessary. + binutils tools, if necessary. See 20150805 for updated information. 20150105: The default Unbound configuration now enables remote control Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Wed Aug 5 18:14:01 2015 (r286331) +++ head/gnu/usr.bin/binutils/Makefile Wed Aug 5 18:30:00 2015 (r286332) @@ -7,25 +7,11 @@ SUBDIR= doc\ libbfd \ libopcodes \ libbinutils \ - ${_addr2line} \ as \ ld \ - ${_nm} \ ${_objcopy} \ objdump \ - ${_readelf} \ - ${_size} \ - ${_strings} \ - ${_strip} -.if ${MK_ELFTOOLCHAIN_TOOLS} == "no" -_addr2line= addr2line -_nm= nm -_readelf= readelf -_size= size -_strings= strings -_strip= strip -.endif .if ${MK_ELFTOOLCHAIN_TOOLS} == "no" || ${MK_ELFCOPY_AS_OBJCOPY} == "no" _objcopy= objcopy .endif Modified: head/gnu/usr.bin/cc/Makefile ============================================================================== --- head/gnu/usr.bin/cc/Makefile Wed Aug 5 18:14:01 2015 (r286331) +++ head/gnu/usr.bin/cc/Makefile Wed Aug 5 18:30:00 2015 (r286332) @@ -13,9 +13,6 @@ SUBDIR+= cpp .if ${MK_CXX} != "no" SUBDIR+= cc1plus c++ -.if ${MK_ELFTOOLCHAIN_TOOLS} == "no" -SUBDIR+= c++filt -.endif .endif .if ${MK_GCOV} != "no" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 5 18:14:01 2015 (r286331) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 5 18:30:00 2015 (r286332) @@ -1025,9 +1025,6 @@ OLD_DIRS+=usr/include/fs/cuse .if ${MK_CXX} == no OLD_FILES+=usr/bin/CC OLD_FILES+=usr/bin/c++ -.if ${MK_ELFTOOLCHAIN_TOOLS} == no -OLD_FILES+=usr/bin/c++filt -.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .endif @@ -1656,14 +1653,16 @@ OLD_FILES+=usr/bin/elfcopy OLD_FILES+=usr/share/man/man1/elfcopy.1.gz .endif -.if ${MK_ELFTOOLCHAIN_TOOLS} == no && ${MK_BINUTILS} == no +.if ${MK_ELFTOOLCHAIN_TOOLS} == no OLD_FILES+=usr/bin/addr2line +OLD_FILES+=usr/bin/c++filt OLD_FILES+=usr/bin/nm OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/bin/size OLD_FILES+=usr/bin/strings OLD_FILES+=usr/bin/strip OLD_FILES+=usr/share/man/man1/addr2line.1.gz +OLD_FILES+=usr/share/man/man1/c++filt.1.gz OLD_FILES+=usr/share/man/man1/nm.1.gz OLD_FILES+=usr/share/man/man1/readelf.1.gz OLD_FILES+=usr/share/man/man1/size.1.gz @@ -1753,9 +1752,6 @@ OLD_FILES+=usr/share/man/man8/unstr.8.gz .endif .if ${MK_GCC} == no -.if ${MK_ELFTOOLCHAIN_TOOLS} == no -OLD_FILES+=usr/bin/c++filt -.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/bin/gcov Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Wed Aug 5 18:14:01 2015 (r286331) +++ head/tools/build/options/WITHOUT_BINUTILS Wed Aug 5 18:30:00 2015 (r286332) @@ -1,5 +1,4 @@ .\" $FreeBSD$ -Set to not build or install binutils (as, c++-filt, -ld, nm, objcopy, objdump, readelf, size and strip) as part +Set to not build or install binutils (as, ld, objcopy, and objdump ) as part of the normal system build. The resulting system cannot build programs from source. Modified: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS ============================================================================== --- head/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS Wed Aug 5 18:14:01 2015 (r286331) +++ head/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS Wed Aug 5 18:30:00 2015 (r286332) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to use +Set to avoid building ELF Tool Chain tools .Xr addr2line 1 , .Xr c++filt 1 , .Xr nm 1 , @@ -7,5 +7,4 @@ Set to use .Xr size 1 , .Xr strings 1 , and -.Xr strip 1 -from GNU binutils instead of the ELF Tool Chain project. +.Xr strip 1 . From owner-svn-src-head@freebsd.org Wed Aug 5 18:36:57 2015 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 995F69B44DB; Wed, 5 Aug 2015 18:36:57 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::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 533EB1EA; Wed, 5 Aug 2015 18:36:57 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by qgeu79 with SMTP id u79so36564020qge.1; Wed, 05 Aug 2015 11:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AUS7+Pfp9uct8508fQQjzTrMDt+oJvuaREdlWu6wBy0=; b=JNw5RkS90/bmbq3lieG32VZTCWHUFgdXL/2/3Hnaj/gSSYKLqmIV6F00AyzRfFNBEE xLrTROgceVpgt7Z62oah9yrzjbVlfaxQcz8GS1LNntH0MSrCOSjLbtcXArBaiqYVDAGG AoC/icmbts6p0gWD8mEhNEeTCuAlneC4KcUxO3ZGFNb4CPQ3yF1fhCnsy39GRpxxeOps sSsbqPywobsd4QiGBuDJfON93+HhGfKQ4ERQd5SzN9X+EXLwT78YEa+WxpUEhUITDYpv ECffLRtbYYFCJ+huatjnEeNy0ySaB74SiSEcMYJt/RLMUE5xy6+G7nJIKnD3ypZPmVnF wJXg== X-Received: by 10.140.96.202 with SMTP id k68mr2704886qge.93.1438799816317; Wed, 05 Aug 2015 11:36:56 -0700 (PDT) Received: from mbp.home (179-125-138-43.desktop.com.br. [179.125.138.43]) by smtp.gmail.com with ESMTPSA id v44sm1809422qgd.21.2015.08.05.11.36.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Aug 2015 11:36:55 -0700 (PDT) Sender: Renato Botelho Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286332 - in head: . gnu/usr.bin/binutils gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/ar gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/ranlib gnu/usr.bin/binutils/readelf gnu/usr... From: Renato Botelho In-Reply-To: <201508051830.t75IU1Oo060513@repo.freebsd.org> Date: Wed, 5 Aug 2015 15:36:51 -0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <9A7A42D6-A109-4BF8-B9FC-3D1E5B867BC2@FreeBSD.org> References: <201508051830.t75IU1Oo060513@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 18:36:57 -0000 > On Aug 5, 2015, at 15:30, Ed Maste wrote: > > Author: emaste > Date: Wed Aug 5 18:30:00 2015 > New Revision: 286332 > URL: https://svnweb.freebsd.org/changeset/base/286332 > > Log: > Remove old GNU Binutils tools now provided by ELF Tool Chain > > Reviewed by: bapt, brooks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3238 > > Deleted: > head/gnu/usr.bin/binutils/addr2line/Makefile > head/gnu/usr.bin/binutils/addr2line/Makefile.depend > head/gnu/usr.bin/binutils/addr2line/addr2line.1 > head/gnu/usr.bin/binutils/ar/Makefile.depend > head/gnu/usr.bin/binutils/nm/Makefile > head/gnu/usr.bin/binutils/nm/Makefile.depend > head/gnu/usr.bin/binutils/nm/nm.1 > head/gnu/usr.bin/binutils/ranlib/Makefile.depend > head/gnu/usr.bin/binutils/readelf/Makefile > head/gnu/usr.bin/binutils/readelf/Makefile.depend > head/gnu/usr.bin/binutils/readelf/readelf.1 > head/gnu/usr.bin/binutils/size/Makefile > head/gnu/usr.bin/binutils/size/Makefile.depend > head/gnu/usr.bin/binutils/size/size.1 > head/gnu/usr.bin/binutils/strings/Makefile > head/gnu/usr.bin/binutils/strings/Makefile.depend > head/gnu/usr.bin/binutils/strings/strings.1 > head/gnu/usr.bin/binutils/strip/Makefile > head/gnu/usr.bin/binutils/strip/Makefile.depend > head/gnu/usr.bin/binutils/strip/strip.1 > head/gnu/usr.bin/cc/c++filt/Makefile > head/gnu/usr.bin/cc/c++filt/Makefile.depend I noted empty directories were left, was that intentional? -- Renato Botelho From owner-svn-src-head@freebsd.org Wed Aug 5 18:55:40 2015 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 E40749B48D2; Wed, 5 Aug 2015 18:55:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D4857105F; Wed, 5 Aug 2015 18:55:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75IteTi073215; Wed, 5 Aug 2015 18:55:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75IteUB073214; Wed, 5 Aug 2015 18:55:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508051855.t75IteUB073214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Aug 2015 18:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286335 - in head/gnu/usr.bin/binutils: addr2line ar nm ranlib readelf size strings strip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 18:55:41 -0000 Author: emaste Date: Wed Aug 5 18:55:40 2015 New Revision: 286335 URL: https://svnweb.freebsd.org/changeset/base/286335 Log: Remove empty directories left by r286332 Reported by: garga Deleted: head/gnu/usr.bin/binutils/addr2line/ head/gnu/usr.bin/binutils/ar/ head/gnu/usr.bin/binutils/nm/ head/gnu/usr.bin/binutils/ranlib/ head/gnu/usr.bin/binutils/readelf/ head/gnu/usr.bin/binutils/size/ head/gnu/usr.bin/binutils/strings/ head/gnu/usr.bin/binutils/strip/ From owner-svn-src-head@freebsd.org Wed Aug 5 18:56:45 2015 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 A30109B490C; Wed, 5 Aug 2015 18:56:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 6D9DD11B8; Wed, 5 Aug 2015 18:56:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by iodd187 with SMTP id d187so58732253iod.2; Wed, 05 Aug 2015 11:56:44 -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:content-type; bh=UpuiKm63a03MoDef65fR9/G+s59z1BYWvHMFXx8HvXE=; b=0U6CCKHi/b5oAsbRT8lf0+hOtnu6Eq/2kgTEq2IMIrAV1xH0NcYjPtsAtlvrBW41Px 6SkAorBDqIi8GcN/5szJwc4D/d9P6EqrwCvGGI4okMMq5VRPXXU7YgJHccDa9NjcVZcN iEmhhxPWFtneZwRcg5/HTqhe3vzC7Tmf7mx/u2wOHGbFsOtmU/WcSaBgHXBHTcTbDyeX OSmT5l8rTduNKZpsazRAdFdp7HeocDMtIHWyV4SzM59727l0OY1RUWVTIEhYMyoEOcFL fD0Kpt6eRCMGic1Cy3tTthfgEgg3I35l9cmHkY9R7JSVVDTxDCTkPBZzXD+omdbGX0e2 xL/Q== X-Received: by 10.107.135.193 with SMTP id r62mr11002032ioi.29.1438801004517; Wed, 05 Aug 2015 11:56:44 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.136.200 with HTTP; Wed, 5 Aug 2015 11:56:25 -0700 (PDT) In-Reply-To: <9A7A42D6-A109-4BF8-B9FC-3D1E5B867BC2@FreeBSD.org> References: <201508051830.t75IU1Oo060513@repo.freebsd.org> <9A7A42D6-A109-4BF8-B9FC-3D1E5B867BC2@FreeBSD.org> From: Ed Maste Date: Wed, 5 Aug 2015 14:56:25 -0400 X-Google-Sender-Auth: M6zs7oG7VaVGHdZd9bZD3_Dd2m0 Message-ID: Subject: Re: svn commit: r286332 - in head: . gnu/usr.bin/binutils gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/ar gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/ranlib gnu/usr.bin/binutils/readelf gnu/usr... To: Renato Botelho 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.20 Precedence: list List-Id: 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, 05 Aug 2015 18:56:45 -0000 On 5 August 2015 at 14:36, Renato Botelho wrote: > > I noted empty directories were left, was that intentional? No, thanks for catching that -- cleaned up in r286335. From owner-svn-src-head@freebsd.org Wed Aug 5 19:05:15 2015 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 34ED89B4B35; Wed, 5 Aug 2015 19:05:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 18BE619C2; Wed, 5 Aug 2015 19:05:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75J5EGM077388; Wed, 5 Aug 2015 19:05:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75J5DvU077379; Wed, 5 Aug 2015 19:05:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508051905.t75J5DvU077379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 5 Aug 2015 19:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286336 - in head/sys: amd64/include arm64/include i386/include mips/include powerpc/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 19:05:15 -0000 Author: emaste Date: Wed Aug 5 19:05:12 2015 New Revision: 286336 URL: https://svnweb.freebsd.org/changeset/base/286336 Log: Rationalize BSD license on sys/*/include/in_cksum.h Remove the advertising clause from the Regents of the University of California's license, per the letter dated July 22, 1999. Update clause numbering. Modified: head/sys/amd64/include/in_cksum.h head/sys/arm64/include/in_cksum.h head/sys/i386/include/in_cksum.h head/sys/mips/include/in_cksum.h head/sys/powerpc/include/in_cksum.h head/sys/sparc64/include/in_cksum.h Modified: head/sys/amd64/include/in_cksum.h ============================================================================== --- head/sys/amd64/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/amd64/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/arm64/include/in_cksum.h ============================================================================== --- head/sys/arm64/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/arm64/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/i386/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/mips/include/in_cksum.h ============================================================================== --- head/sys/mips/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/mips/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/powerpc/include/in_cksum.h ============================================================================== --- head/sys/powerpc/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/powerpc/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * Modified: head/sys/sparc64/include/in_cksum.h ============================================================================== --- head/sys/sparc64/include/in_cksum.h Wed Aug 5 18:55:40 2015 (r286335) +++ head/sys/sparc64/include/in_cksum.h Wed Aug 5 19:05:12 2015 (r286336) @@ -10,7 +10,7 @@ * 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 + * 3. 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. * From owner-svn-src-head@freebsd.org Wed Aug 5 19:32:36 2015 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 BCB099B41A5; Wed, 5 Aug 2015 19:32:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 93992D38; Wed, 5 Aug 2015 19:32:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75JWaIh099866; Wed, 5 Aug 2015 19:32:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75JWa43099865; Wed, 5 Aug 2015 19:32:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508051932.t75JWa43099865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 5 Aug 2015 19:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286337 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 19:32:36 -0000 Author: adrian Date: Wed Aug 5 19:32:35 2015 New Revision: 286337 URL: https://svnweb.freebsd.org/changeset/base/286337 Log: Add TXOP enforce support to the AR9300 HAL. This is required for (more) correct TDMA support. Without it, the code tries to calculate the required guard interval based on the current rate, and since this is an 11n NIC and people try using 11n, it calls ath_hal_computetxtime() on an 11n rate which then panics. This doesn't fix TDMA slave mode on AR9300 - it just makes it have one less bug. Reported by: Berislav Purgar Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Aug 5 19:05:12 2015 (r286336) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed Aug 5 19:32:35 2015 (r286337) @@ -940,6 +940,13 @@ ar9300_get_capability(struct ath_hal *ah return HAL_OK; } return HAL_EINVAL; + case HAL_CAP_ENFORCE_TXOP: + if (capability == 0) + return (HAL_OK); + if (capability != 1) + return (HAL_ENOTSUPP); + (*result) = !! (ahp->ah_misc_mode & AR_PCU_TXOP_TBTT_LIMIT_ENA); + return (HAL_OK); default: return ath_hal_getcapability(ah, type, capability, result); } @@ -1041,6 +1048,18 @@ ar9300_set_capability(struct ath_hal *ah OS_REG_WRITE(ah, AR_DATABUF, ahp->rx_buf_size); return AH_TRUE; + case HAL_CAP_ENFORCE_TXOP: + if (capability != 1) + return AH_FALSE; + if (setting) { + ahp->ah_misc_mode |= AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_SET_BIT(ah, AR_PCU_MISC, AR_PCU_TXOP_TBTT_LIMIT_ENA); + } else { + ahp->ah_misc_mode &= ~AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_CLR_BIT(ah, AR_PCU_MISC, AR_PCU_TXOP_TBTT_LIMIT_ENA); + } + return AH_TRUE; + /* fall thru... */ default: return ath_hal_setcapability(ah, type, capability, setting, status); From owner-svn-src-head@freebsd.org Wed Aug 5 19:41:11 2015 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 E0BB99B42A9 for ; Wed, 5 Aug 2015 19:41:10 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.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 9D80C10C5 for ; Wed, 5 Aug 2015 19:41:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by qgeg42 with SMTP id g42so1122025qge.1 for ; Wed, 05 Aug 2015 12:41: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:message-id:subject:from:to:cc:date:in-reply-to :references:organization:content-type:mime-version; bh=4ONsobB/DPVEZ9Ak3CB40T6zSt7tTQjjHrpc46v1GJg=; b=ZIh8eIuBpc37vuLW5kpbUjhVPmXmuS7W7VQ/9UqYBOtRYELpDPyaY+VsmFntILnnMZ suM7Br4y7ZxbrxgV0yjxEzSB7UsvaTg6HMzfBva2WqMSApp6xZv1cjyHyUCVlBWPQbdF 6RAALCmKRUxur0gpRJ477iVyYxEceGJj01XDcdtb39g88SEeYSrk354mhding1HutWhf 91Gk6YVbEWnjqGHrbluxOEZSORtXpW+sPYHHtwnljSwJfblU24Rhw5PAz8u/IWEshNsy h1nLR88wA3hUlwLbEHE6Cooirbhz1tcNNVhqSVb4Uv7b2wOLGXQJlIOX8h+kkflk5/cz e2Ng== X-Gm-Message-State: ALoCoQnqFMxcf4vyAeN1B8vRe2DaKU5DTrA4Br9vW6Y8Z9I+WjlMiQEEt/RP24jOtS+yn8s7z/tZ X-Received: by 10.140.36.231 with SMTP id p94mr19635516qgp.60.1438803662702; Wed, 05 Aug 2015 12:41:02 -0700 (PDT) Received: from [192.168.1.22] ([136.160.244.66]) by smtp.gmail.com with ESMTPSA id 1sm1904976qhu.11.2015.08.05.12.41.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 12:41:01 -0700 (PDT) Message-ID: <1438803660.4365.13.camel@hardenedbsd.org> Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Shawn Webb To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 05 Aug 2015 15:41:00 -0400 In-Reply-To: <201508051932.t75JWa43099865@repo.freebsd.org> References: <201508051932.t75JWa43099865@repo.freebsd.org> Organization: HardenedBSD Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-MqdvZagX9ZSlPqEY6LWh" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 19:41:11 -0000 --=-MqdvZagX9ZSlPqEY6LWh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: > Author: adrian > Date: Wed Aug 5 19:32:35 2015 > New Revision: 286337 > URL: https://svnweb.freebsd.org/changeset/base/286337 >=20 > Log: > Add TXOP enforce support to the AR9300 HAL. > =20 > This is required for (more) correct TDMA support. Without it, the > code tries to calculate the required guard interval based on the > current rate, and since this is an 11n NIC and people try using > 11n, it calls ath_hal_computetxtime() on an 11n rate which then > panics. > =20 > This doesn't fix TDMA slave mode on AR9300 - it just makes it > have one less bug. > =20 > Reported by: Berislav Purgar >=20 > Modified: > head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Hey Adrian, Can this be MFC'd? Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --=-MqdvZagX9ZSlPqEY6LWh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJVwmbMAAoJEGqEZY9SRW7uNFEP/0VN29JCs6X2bc+z2bobVvBv dKqvTr3cvndPAYc+eK9cOcgTY9ScznIOTYDLk+QVdIpmWn7TC8raAAK3MB1A8s9k p7G8NZD1JSTSsJ/x4d7nwfn7TyXFSnWuXqcoxkrpLvb3NKfAX+eMWu7lHpEn6diF cjBzc+wXM4SfFegIKy971AdHth7YqcfWuAQIO/hGS29oehmO5d26P84fItYRLq+c MGWP52Lt3GBEsW8UwK/5J4/r29zJDUh2yFnFyfIXlT87my8kcSPJ/SUCtgz7Iwwc KkMgMGeEgNozhMqASZJpsnPRMt2YPQwT90racH4K5tLzDqxTLl+e6MjfPBFkyME4 459IXXoCpScROPhbLe3hUmmGE9Tcvs3otaTt86s/jl8IVxk6XtUgimH1O5/Cb5yx GBTHyoTvIhjmUWicAvaDc4ohVmGJIuBwftew1EMpE35YdYpQGpd66eYXXiV+AFP7 BH6atd9UzVPKglGgSn6gouHFKQZLyfkV5pIUkGASC1g7/BpOUnXsQ3Uki8Kw3IfG kzGBtVN+chDsFqIDwh4B0tZv/gFqgvubPKIuTN7VfftEA9ibCIE1AnfbLfDUnRpH 9PO9eJxp53ReDZHyYwmnNdLtNHmcAC9Epvuc3iyWtmy+HvQCd/FpGBNOPPt/XF72 zdpsvQ6lSNPyj/Pu1gF+ =sVVR -----END PGP SIGNATURE----- --=-MqdvZagX9ZSlPqEY6LWh-- From owner-svn-src-head@freebsd.org Wed Aug 5 19:45:13 2015 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 60ED09B4401; Wed, 5 Aug 2015 19:45:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 501C51517; Wed, 5 Aug 2015 19:45:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75JjDrv004350; Wed, 5 Aug 2015 19:45:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75JjCI0004346; Wed, 5 Aug 2015 19:45:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201508051945.t75JjCI0004346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 5 Aug 2015 19:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286338 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 19:45:13 -0000 Author: np Date: Wed Aug 5 19:45:11 2015 New Revision: 286338 URL: https://svnweb.freebsd.org/changeset/base/286338 Log: cxgbe(4): Update T5 and T4 firmwares bundled with the driver to 1.14.4.0. The changes in the firmwares since 1.11.27.0 are listed here (straight copy-paste from the "Release Notes.txt" accompanying the Chelsio Unified Wire 2.11.1.0 release on the website). 22.1. T5 Firmware +++++++++++++++++++++++++++++++++ Version : 1.14.4.0 Date : 08/05/2015 ================================================================================ FIXES ----- BASE: - Fixes a potential data path hang by properly programming PMTX congestion threshold settings. - Fixes a potential initialization error when accessing a configuration file stored on the flash. - Fixes a regression where SGE resources can be miss-sized if iWARP is disabled. ETH: - Fixes a timing issue that would prevent CR4 links from coming up with some switches. FOFCoE: - Defers fcoe linkdown mailbox command handling till LOGO is sent. - Updates vlan prio for all outstanding IOs during dcbx update. ENHANCEMENTS ------------ BASE: - Adds support for PAUSE OFF watchdog. - Reports devlog access information in PCIE_FW_PF register 7. ETH: - Enhances segmentation offload to include VxLAN and Geneve. - Adds PTP support. - Adds new interface to allow the driver to query the VI rss table base addresses. - Allows the driver to program the SGE ingrext contxt CongDrop field. OFLD: - Adds new interface for the driver to specify offloaded connections TCP snd and rcv scale factors. iSCSI: - Adds support for iscsi segmentatation offload (ISO). - Adds support for iscsi t10-dif offload. FOiSCSI: - Sets FORCE_BIT for cut through processing for FOiSCSI. FOFCoE: - Adds support for FCoE BB6. - Improves WRITE performance. ================================================================================ ================================================================================ Version : 1.13.32.0 Date : 03/25/2015 ================================================================================ FIXES ----- BASE: - Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of negative) - Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain adapter configurations) - Fixes config file based PL_TIMEOUT register programming ETH: - Fixes a potential EO UDP SEG header corruption - Fixes an issue where 1000Base-X was not enabled correctly when using QSA modules OFLD: - Fixes timeout issue with half-open connections - Fixes FW_FLOWC_WR processing when state is set to finwait1 FOFCoE: - Fixes fcoe xchg leaks in linkdown/peer down path - Fixes cleanup in FCoE linkdown and fixed buf timer flowid abuse - Fixes fw crash by clearing fcf flowc during bye FOiSCSI: - Don't create a new tcp socket if ERL0 attempt has timed out. ENHANCEMENTS ------------ BASE: - Adds support for VFs on PFs 4 to 7 - Adds support for QPs/CQs on any physical and virtual function ETH: - Stops sending LACP frames on loopback interface - Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE - Adds support for CR4 links (BEAN/AEC on 40G TwinAx cables) OFLD: - Improves default settings of LAN and CLUSTER TCP timer settings - Sends Negative Advice CPLs to software FOISCSI: - Adds IPv6 support for foiscsi. Keeps backward compatibility with old foiscsi drivers which doesn't support ipv6. FOFCoE: - Added fcoe debug support in flowc dump ================================================================================ ================================================================================ Version : 1.12.25.0 Date : 10/22/2014 ================================================================================ FIXES ----- BASE: - Improves precision of the Weight Round Robing Traffic Management Algorithm - Fixes an issue where the link would intermittently fail to come up - Fixes an issue where adapters with an external PHY couldn't run at 100Mbps - Fixes an issue where active optical cables were not recognized - Fixes link advertising issues on T520-BT (speed and pause frames) that would cause the link to negotiate unexpected settings - Forces link restart when auto-negotiation is disabled - Fix an issue where pause frames wouldn't be fully disabled even if requested ETH: - Fixes NVGRE Segmentation Offload network header generation. DCBX: - Fixes an issue where some settings were not being sent to the switch correctly - Fixes an issue where back-to-back DCBX port updates could get overwritten by FW - Fixes a firmware crash on DCBX APP information request before link up FOiSCSI: - Fixes abort task leak in tmf response handling - Fixes TCP RST handling while in iSCSI ERL0 - Fixes a firmware crash on BYE without INIT ENHANCEMENTS ------------- BASE: - Adds link partner settings reporting when available - Adds QSA support (in conjunction with QSA VPD) - Adds T520-BT LED support - Reports NOTSUPPORTED for modules with an unhandled identifier DCBX: - Adds version reporting (indicating which version FW is trying to negotiate) - Adds IEEE support - Reports LLDP time outs FOiSCSI: - Add support for multiple iSCSI DDP client - Sends DHCP renew request when lease expires ================================================================================ 22.2. T4 Firmware +++++++++++++++++ Version : 1.14.4.0 Date : 08/05/2015 ================================================================================ FIXES ----- BASE: - Fixes a potential initialization error when accessing a configuration file stored on the flash. - Initialize PCIE_DBG_INDIR_REQ.Enable to 0, as hardware failed to do so and register dumps could result in errors. ETH: - Fixes an issue that sometimes prevented the link from coming up in CR adapters. ENHANCEMENTS ------------ BASE: - Adds support for PAUSE OFF watchdog. - Reports devlog access information in PCIE_FW_PF register 7. ETH: - Adds new interface to allow the driver to query the VI rss table base addresses. OFLD: - Adds new interface for the driver to specify offloaded connections TCP snd and rcv scale factors. ================================================================================ ================================================================================ Version : 1.13.32.0 Date : 03/25/2015 ================================================================================ FIXES ----- BASE: - Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of negative) - Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain adapter configurations) - Fixes config file based PL_TIMEOUT register programming ETH: - Fixes a potential EO UDP SEG header corruption OFLD: - Fixes timeout issue with half-open connections - Fixes FW_FLOWC_WR processing when state is set to finwait1 FOiSCSI: - Don't create a new tcp socket if ERL0 attempt has timed out. ENHANCEMENTS ------------ ETH: - Stops sending LACP frames on loopback interface - Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE OFLD: - Improves default settings of LAN and CLUSTER TCP timer settings - Sends Negative Advice CPLs to software ================================================================================ ================================================================================ Version : 1.12.25.0 Date : 10/22/2014 ================================================================================ FIXES ----- BASE: - Improves precision of the Weight Round Robing Traffic Management Algorithm - Forces link restart when auto-negotiation is disabled - Fix an issue where pause frames wouldn't be fully disabled even if requested DCBX: - Fixes an issue where some settings were not being sent to the switch correctly - Fixes an issue where back-to-back DCBX port updates could get overwritten by FW - Fixes a firmware crash on DCBX APP information request before link up FOiSCSI: - Fixes abort task leak in tmf response handling - Fixes TCP RST handling while in iSCSI ERL0 - Fixes a firmware crash on BYE without INIT ENHANCEMENTS ------------ BASE: - Adds link partner settings reporting when available - Firmware now reports NOTSUPPORTED for modules with an unhandled identifier DCBX: - Adds version reporting (indicating which version FW is trying to negotiate) - Adds IEEE support - Reports LLDP time outs FOiSCSI: - Adds support for multiple iSCSI DDP clients - Sends DHCP renew request when lease expires ================================================================================ Obtained from: Chelsio Communications MFC after: 2 weeks Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.14.4.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.14.4.0.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.14.2.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.14.2.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 5 19:32:35 2015 (r286337) +++ head/sys/conf/files Wed Aug 5 19:45:11 2015 (r286338) @@ -1203,7 +1203,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.14.2.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.14.4.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1227,7 +1227,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.14.2.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.14.4.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.14.4.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.14.4.0.bin.uu Wed Aug 5 19:45:11 2015 (r286338) @@ -0,0 +1,9495 @@ +/*- + * Copyright (c) 2015 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ +begin-base64 644 t4fw +AAAEHgEOBAAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABAEEEAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFRodSBKdWwgMjMgMDA6 +MzA6MTAgUERUIDIwMTUgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjBlLjA0LjAwAAAAAAAAABlSRz1g +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//2U4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//koAAAAAA +H/+ShAAAAAAf/5KIAAAAAB//kowf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+J8OMACfgf/4nwH/+J8OMAE+gf +/4nwH/+J8OMAE+gf/4nwH/+LjOMAE+gf/4uMH/+SdOMAFYQf/5KAH/+0DOMAHHgf/7QMH/+0DOMA +PgQf/8AAH//+geMAPgQgAAAAIAABauMAfIggAAF4IAABfOMAffQgAAF8IAABheMAffggAAGYIAAB +nOMAfgQgAAGcIAABpeMAfgggAAG4IAABvOMAfhQgAAG8IAABxeMAfhggAAHYIAAB2OMAfiQgAAHc +IAAB4uMAfiQgAAH4IAAB+OMAfiwgAAH8IAAB/OMAfiwgAAIYIAACGOMAfiwgAAIcIAACHOMAfiwg +AAI4IAACOOMAfiwgAAI8IAACPOMAfiwgAAJYIAACWOMAfiwgAAJcIAACYuMAfiwgAAJ4IAACeOMA +fjQgAAJ8IAACguMAfjQgAAKYIAHzYuMAfjwgAwAAIAMUmOMCbwggAxSYIAMUmOMCg6AgAxSYIAbL +jOMCg6AgBsuQIAbRUOMGOpggCAAAIAgOQOMGQFggCA5AIAkkNuMGTpggCSRAIAklDOMHZJggCwAA +IAsAAOMHZWQgCwAAIAsAAOMHZWQgCwAAIAuan+MHZWQAAAAAAAAAAAAAAAAgABFWIAARSCAAFTog +ABFIIAAUtSAAEUggABH9IAAUTSAAE9IgABFIIAATfSAAEzQgABLJIAARNSAAEnQgABFIIAARSCAA +EUggABIcAAAAAAEQGAEABAAAAAAAAAAAAAD///////8P/P//8P///wD8IACtgyAAruogAK8aIACu +4CAArqEgAK6XIACuYSAArlcgAK5GIACt8iAArxggAK3oIACtuyAArxogAK2xAAAAAAAAAAoAAAAK +AAAAFAAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEA +AQACAAMABAAFAAYABwAIAAkACgAOABEAFQAZAB4AIwAtADwAUABkAMgBLAGQAfQAAAAAAAAAAAAA +AAAAAAAAAAAAAQABAAIAAgADAAMAAwADAAQABAAEAAQABAAFAAUABQAFAAUABQAGAAYABwAHAAAA +AgAAAAYAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKA +AAADgAAABQEAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAA +AcAAAAKAAAADgAD/AAECAgAAAAAAAAAAAAAAECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQ +AAggQIAAAAAAAAAAAAAAAAAAIAingCAIp4AgCKc5IAinCCAIptogCKauIAimriAIqF4gCKheIAim +riAIqF4gCKheIAimriAIpq4gCKZiIAioXiAIqF4gCKheIAioXiAIqF4gCKheIAioXiAIqF4gCKhe +IAioXiAIqF4gCKheIAioXiAIqF4gCKheIAioXiAIppEgAwoIAAAAASADDjgAAAD/IAMH4AAAAP8A +AAAAAAAAACADCfQAAAACIAMJ+AAAAAMgAwoAAAAABwAAAAAAAAAAIAMJ2AAAAAEgAwncAAAAAiAD +CeQAAAAEIAMOOAAAAP8gAwfgAAAA/wAAAAAAAAAAIAMH4AAAAAAgAw44AAAAACADCPAAAAABIAMI ++AAAAAQgAwkAAAAACCADCQwAAAAgIAMJHAAAAEAgAwkkAAAAgCADCSwAAAEAIAMJNAAAAgAgAwlI +AAAEACADCVwAAAgAIAMJdAAAEAAgAwmIAAAgACADCZgAAEAAIAMJpAAAgAAgAwm4AAEAACADCcgA +AgAAIAMI3AAAABAgAwjkAAAAESADCMQAAAAAIAMIyAAAAAEgAwjMAAAAAiADCNQAAAADAAAAAAAA +//8AAAAAAAD//yADCEQAAAEAIAMIUAAAAIAgAwhgAAAAQCADCHAAAAAgIAMIgAAAABAgAwiQAAAA +CCADCJwAAAAEIAMIqAAAAAIgAwi0AAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAB +AAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAcAAAAHAAAABgAAAAYA +DDUAABBGqgAUWFUAGGoAAAAraAAAI4MAABhqAAANBgAACyoAAAAAAAAAAAAAAAAAAGgrAABoKwAA +bIIAAG+cAABKaAAASmgAAE0pAABKaAAATuoAAEyYAABSPQAAT7gAAYagAAGGoAACCNYAAgjWAAII +1QACCNUAAosLAAKLCwACCNUAArZyAAK2cgADDUAABAYHAAAAAAAAAAAAAAAAAAICBQUICAsLDg4R +ERQUFxcaGh0dICAjIyYmKSksLC8vMjI1NTg4OzsAAAAAAAAAAQMREQgIEAkDAQAAAAAAACAE1awg +AayUIAA3KCABfCAgAajgIAGjVCABWTAgA+JkH//qRCAAmXAgAK/YH//dGCAAaEQgAFmwAAAAAAAA +AAAgAX3QIACIMAAAAAAAAAAAH//V+B//xXwf/8KUH//AMCAAVLAgAEzUIABJFCAApSQf/+P4IAai +2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAbQMIAGUGCAAuYggALi8 +H//xIB//0KAf/8w4IACFqCAFM2AgAS8QIAEPHCAA99AgAOuAIADe3CAA0VQgALxgIATYmCAEFYQg +ASRgIAQ5WCAB4OwgAGgEAAAAACAAueQgBaxEIACs8CABhnQgAAKYIACe2AAAAAAAAAAAH//0aCAA +uaQgBBg0AAAAAAAAAAAgA1r0IAAmrCAAHMwgACWYAAAAACAAMiAgAC98IAAsEAAAAAAgADboIAEo +IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAANHggBNVMAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAgADYoIANjwCAANTAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQA +AAAICwAAACADEewIAAAAIAMR+AgAAAAgAxIECgAAACADEhAMAAAAIAMSHBIAAAAgAxIsDQAAACAD +EkAOAAAAIAMSUBMAAAAgAxJgCgAAACADEnQOAAAAIAMSgBgAAAAgAxKQDQAAACADEqwOAAAAIAMS +vBAAAAAgAxLMEgAAACADEuAOAAAAIAMS9BAAAAAgAxMEEQAAACADExgKAAAAIAMTLAsAAAAgAxM4 +DQAAACADE0QUAAAAIAMTVAoAAAAgAxNsDwAAACADE3gGAAAAIAMTiAYAAAAgAxOQBgAAACADE5gG +AAAAIAMToAYAAAAgAxOoCQAAACADE7AGAAAAIAMTvAQAAAAgAxPEBgAAACADE8wLAAAAIAMT1AsA +AAAgAxPgBAAAACADE8QEAAAAIAMT7AkAAAAgAxP0CQAAACADFAAAAAAAAAAAAA0AAAAgAxQMCgAA +ACADFBwGAAAAIAMUKAIAAAAgAxQwAwAAACADDgwBAAAAIAMUNAAAAAAAAAAA12qkeOjHt1YkIHDb +wb3O7vV8D69Hh8YqqDBGE/1GlQFpgJjYi0T3r///W7GJXNe+a5ARIv2YcZOmeUOOSbQIIfYeJWLA +QLNAJl5aUem2x6rWLxBdAkQUU9ih5oHn0/vIIeHN5sM3B9b01Q2HRVoU7anj6QX876P4Z28C2Y0q +TIr/+jlCh3H2gW2dYSL95TgMpL7qREvez6n2u0tgvr+8cCibfsbqoSf61O8whQSIHQXZ1NA55tuZ +5R+ifPjErFZl9CkiREMq/5erlCOn/JOgOWVbWcOPDMyS/+/0fYWEXdFvqH5P/izm4KMBQxROCBGh +91N+gr068jUq19K764bTkQcMERYHDBEWBwwRFgcMERYFCQ4UBQkOFAUJDhQFCQ4UBAsQFwQLEBcE +CxAXBAsQFwYKDxUGCg8VBgoPFQYKDxUf/8AAAAQAICAG0VAgBtUQH/zeACAG0ZAf/6tEH/+sVB// +r6ADgAAAgQAAAB//r5AA//gAAQAAAAAQAACBBAEAgQQAAAEEAAABBAEAgAAAAAAF//8f/4UgBgAA +ACoAAAAf/8/4IARThAIAAACAEAAAQUAAAEFAAQCDAAAB//+//7////8f/5g8BAAACCADDCiBgAAA +DAAAAB//ktD//wAA//8A/wABAAAAAP//H/+wkB//qCQP///////QFP//0xAf/2XsH/zg6CAGzyz/ +/8EQH/9l4B//ZmQf/60EH/+eNB/84gAAAAho4P/+AOEBkgAf/5iwAP///x//nMwf/60UBEEACAQB +AAilAAAAwAAAAMAEAAAwAAAAH/+tkAAAHKAAAP+AIAbLkCALXTDhAC4AH/+thB//qWwf/65gH/+p +0B//rbDgAACg4QAwuAAAgADhAGAQAABAAOECEADhAjAA4QJQAOECcADhABAIH/zhQOEAe3Af/7PM +H/+zxB/84Agf/7PIH/+z5B//s9wf/7PgH/+z/B//s/Qf/7P4IAbRkB//sJAf/6tEH/zeAB//rFQf +/6zQH/+c3B//rlwAAP+AAAAdgB//ktAf/65oH/+uZB//rsgEAAAIBQAAAIP/AACBAAAAABAAACoA +AAAgAAeoIAMLSB//iTAf/4UgH/+voGdFIwHvzauJmLrc/hAyVHYf/4AAAAA/KCADDgzP////IAsG +MBAAAAA/////AgAAAEAAAAD//3//IAsHUB//r5AgACFwIAsH8AgAAAAA////IAsIYCALB4D3//// +IAsKUCAAHhj//v//IAsVIIAAAAAgAwwgDAAAAAAAQAAAAP//AACAAA0AAAAgACQ4//v//w/2gAAA +A///AAAn/yALGJAgCxjAAAEAAAAEAAAgADIgIAA0NCAAL3wgCxlQIAsZ8CAALBAgCxpAIAsa0AQB +AAjgAAAAH/+s/FMAAABSAAAAUQAAACAB68Qf/6ncIAsdcCALHdAgCx2gIAsgUB//rRQgCyCgH/+c +1B//rMQgCyJwFAAAAIAAAAJ4AAAAgAAABoAAsAAAAAoAAOMwkv//8ACAALEA4QGaAAACAAAgCyIw +H/+aZAAAfkAA/8AAH/+TVAEAAAAoAAAAJgAAACALIqAf/69EH/+pcCALJGAf/7BoOwAACA4AAADA +AAAA0AAAAB//gFAAAB+aAACJFB/84HQAAAhQH/+TkAYAAAAFgAAAIAtxoB//qTQrAAAAIABPmB// +qsQ1AAAAA4AAAAMAAAAH////AD///4BAAAAID///H////yAAAAAAAMAAH/+s4D0AAAAf/5jcBwAA +AIEEAQCBBAAAH/+rJAAAOpjDAAAAAAAP/wBDAAAAAAgABAAAACALcgAf/7NAH/+wsB//mDwABgAA +4QB6AB//mKwgoAAAH/+rZB//nOQf/5zQIAtyMAADB4AgC3KgH/+atAAgAAAAQAAAAAAJAAAAMAL/ +/Ph/o/+7AKP/ugDgAwAAg/+2AA////8P//gA/wAAACALcuAgCyVQIAslgCALc3AADwAAAAoAAP// +AA8f/6zoA//AAIP/wAAgC3PwIAt0YB//rcAf/7Eg/2DwAB//sQAf/5KQBIAACB//gGAARAAA/x// +/wDAAAABgMIAAACBAPAAAACBgAAA/3///x//qCT/v/////8AAACAAAAAAIbdH/+eLB/84gAf/5OA +7gAAAAAACWwf/OIMDwAAACALJcAf/61cAAAIbB//rlQf/56oH/+Y2B//gHAgBs2AAAAwAAAAJxAf +/9yIIAt8EB//rbQAAP/+H/+cxN6tvu8gAwZQNAAAAD8AAAAf/64oAACJBgCZAAAQAAcCAcCAAJkA +AAAf/7EkAIgACIKAAAEf/7C4H/+vxAMVAAADEQAAAA8D/yALKcAgCyogIAsqcCALKtAgCynwIADm +BCALLHAgCyygIAss8CALLVAgAOvIKQAAACAA8nwgC3xgIAt8wCALfTDw8PDw/wD/AKqqqqrMzMzM +H/+zMAAAIGAf/7E4IAEDmCALfcAgC34wAA9CQCAEPogf/61AH/+toAAJAAAAAEgAggAAACABKCgg +C36wIAt/IAAAH0AgCzVgIAs1gCALNaAACQAIH/+wLDAAAAAf/7EsH/+uACALN9AgCzew///3/yAL +ODAgBETMAACD/yAG01gVoAAAIAbUUCADB5Af/6twAAAIBgAAiMx/AAAAAAAP/gAMAAAf/7B4IAuD +kCALg9AgC4KwIAuDQAAA4AAgC4HQ//wAACALgxAf/5poAAQD/woAAAAf/69UH/+t8B//sBQf/53Q +g/+3AIP/tiAgCzhg4QAAADMAAAAf/7CAH/+xdAP/4AB///8AAD/2kAAAH6gD//AAIAtw8CALcLAg +C3EQH/+ygCALOOAaAAAAIAs5MCABckAf/7B8AA///x//sDAf/6s8H/+t9CALhFAf/50EH/+stB// +qYgf/6t8IABsaCAGzQQgAAWIH/+n0B//mfgf/5h4IAuEkB//qdQgCzwwwAQAAB//q4gf/7BkH/+w +8CALhbAgCzxwIAMM0CAAbUjgAQAAH/+eMCALhvAgCzywIACp2B//niggAKb4IAuGcCALhsAf/5qI +IAs+YOD//gAgC2FQH/+eNCALSZAf/6z4H/+UzCALVIAgC1UQH/+rbB//sDQgC1gwIAtYgCALV8Ag +C1fwSAAAACABvNgf/6rUIAG+3B//mSwf/6lsH/+oZB//q1Qf/6i8AAAX4AAAFewf/6uUIAbRhB// +qUThAC4AH/+roOEAXgDhAg4A//+//+EADgDhAY4A//++/x//nMwf/6m4IAHD8CAB0BjgBQAAA/8A +AB//qQQgAwwoPAAAAAAF//+DAAAAH/+obCAB5bAf/63EIAtgcAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAIGAAAAAAAAA/////////////////////x///Igf//yIH//8UB///FAf//xQH//8UB// +9eAf//kIH//3ZB//92Qf//dkIAakyAAAAAAAAAAAAAAAAAAAAAAgBqgQIAaoEAAAAAAAAAAAAAAA +AAAAAAAgBqTIIAakyB//+fwf//n8H//5/B//+fwf//n8H//5/AAAAAAgAcUIAAAAAAAAAAAAAAAA +AAAAAAIBAAAAAAAAAAAAAAAAAAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAA +AAAAgQAAAAAAABgFAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAoAEfJ7E/J70w8D5jEBAgAW8nkX8np3awaQ +YLRmd2P4VA8zVcKsDxQAY//5AAAAbBAIKCAFJyAHKTEF+CCGFeAZRQD5AA6FYXcBAIoiFvJs/eTY +BeAMlQDxV7wN4A+lAOryaRvHAoAApogrgp4KeQopkr/9YA2DogCdACiCnQmIAegWBSQNUYAAKNII +9wANqJIAnQArYq7s8l0VirmAACpirSzCf+yrAQRz/QAA/UAKHiIAnQAu1gj9QAoeIgCdAC8gFKT/ +Dw9HLyQU9eAMXdIAnQAZ8k8uIhYsISmIFR/yTa7Mn4DqIh4uZ8KAAP0AZhWgDSUA/QBGFeALZQDt +8kYdVgKAAAuqAosUmoHpABUEQEEAAIkVCACKKDwQ/SDGFeBMBQD9IOYVoAxFAOy7NgTIgQAAbbkF +CACGCQJh7vI3FaCHgACIFe4ABQ3PAoAAqYjojCAlpDUAAAvJDG2ZAggCYS0hKdMP6iEoJugFAAAN +DU8tJSn9QAd0YgCdAP/kUAXgDBUA+iCoFeAe5QDqIh4uzUKAAPggJhXgCAUA+CAGFaANBQDoFgIl +2YEAAFiE8P7gABc3xQEA98AARzANlQDt5p0oBAqAAPmABVlSAJ0AwCDRDwAAAOokAAnYBIAA7EQA +CugEgABYhtnSoNEPAAAAAMCwD4k06dYILfYuAAD6QGgdoBvFAPwAAh2gDRUAWIomY//BAADqJAAK +2ASAAFiIWtKg0Q8A//lYDaAIBQDqJAAD2GEAAPwAAh2gDZUAWIoaY/+RwKBZvTYd8e6I2Pkf8giQ +D6UAY/+k2iBYC5Bj/nAAAAAAAPwAAh3gCgUA+kUkHa/8KgCKJ+tEAApoBIAA+0QAFaAMBQBYgGnS +oNEPAAAAbBAGLiIQlBHlIRoq0ASAACYgB/ZBKBXgH8UA6hYAKsfCgAD/AlIN4WYBAAcJQvEgcA3i +hQEAZIHy1PApIAX8QEgVoBuFAP6eAA2wGkUA+yAPlSIAnQDn8cceC9YAAOXxwxtPAoAA9MAMEhIA +nQClmS2SngdqCiqiv/egEbtSAJ0AKZKdCpkB7pQABI5JgACMKYsqDAc+DLsM92AJA+IAnQAqIE4t +IEyxqPugDewgCxUAKCROKjABKSIY80AN9pIAnQArIActIST4YCQVoAxVAP1ABAUwuxEA4KoRDdqC +gAALqgIb8asKiAIqIQcsIQkL3QL7BgAMeqoBAOvxph1TAoAACswCKiEimOCIIJzjneQLqgKa4v0A +ABQwCmUACogCmOEtIhCd5SwgOBvxm/gAIh2gTRUA+cEmFaDMGQAM2Dkd8ZeU6Ay9OfmmAA6wCwUA +m+cY8Yqd5u3xixTgBQAALCYYm+uZ6ugAFQdIwQAACQCK7eYOIchBAADv5g8neQEAAAkghg8CYwkA +hg8CYQxuEaXu6uadI4CxgACIKS8gOKeIKCYJ8+AIF5IAnQCJEAkJR/kgBwFSAJ0AwCDRD54S6iQA +C9gEgABYiVSOEv9NEA3gH8UA7BIBKVAEgADtEgAp2ASAAFiGNdKg0Q8AHvFhiuj3QAY4kgCdAAxp +EaWZK5Ke92AGi1IAnQApkp0Haworsr8LmQFkkL+wrJzo7pQADPN+AABgACwAAAAAAPPf8EhSAJ0A +CVQM9J0AFa/4AgAAAAAAAOsSAClQBIAAWIeq0qDRDwDqJAADWGEAAPwAIh2gDWUAWIlsY/9pjSLA +5A7dAvxARhXv/X4AAAAA+EOoFaTZAQAA0QQAvBoMiAL4Q6YVr/jGAIonjRHAwOqsIC7YBIAAWH++ +0qDRD9ogWIXLY/75AAD/9zwNoAkFAMCgWbx0HvEriuj5X/l4kB/FAP/9KA2gCQUAwJDAugurNPvB +BhXv/O4AAAAAbBAOlRwoIhAuIgknITUpIAcjFg4qMgL+YIgV4A0VAPxgaB2ntQEA4yEaJdv5AAAL +2zn6IaYV4ZkBAOf/Ngm3woAA/sJSDeOqAQAODkLxwHAN4tMBAGTUYyYgBcHo+f4ADzAXRQD2wCQd +YgCdAIciix705fwN4A6FACuwAZ8R82AhJxIAnQCZEJkamhQY8P7t8P8SMA0AAOYWCyyvAoAA6FUI +DN+CgACtu+sWCSJwBQAAiRqeGI0b9SAGqhIAnQArUp6GGf1gCiPiAJ0AL1KdJmK/Bv8BZPQ5GfDs +iZj3IAmYkgCdACqCrmShUhrw6SOCrSqifx3w5Qo7AesWBSTb/QAA+mAJ5iIAnQCb2PpgH2YiAJ0A +hymGKgwDPgdmDPLACaviAJ0AKRoA8yIyDeD69QArIBacE/tgCf0iAJ0AixGGwyogOPfg5hWgBgUA +9+EmFaBHBQD74QYV4KoZAAp2ORfw15YWLSIXFvDUnfotIhud+4nECnY5lhf5YBFK4gCdAIYdnh/s +FgMjDdmAAGABCBnwvomYapEuixsqUp6PGXujSy1SnS/yvw/dAZ0VhhXr8LYU0/0AAO9kAAMB6YAA +mrhl/xNgA0qeH/wgZhWgCgUAWbv1GfCtiZgY8KqME+4SDySO2wAA//9cDaAPBQDAoPogphWv/uYA +HfCkwLoLmzT7oQYV7/72AAAAAAD/+xQNoA8FAJ4fLxYQ/CBmFaAKBQBZu+EZ8JmMEy8SEImYjh8Y +8JX5P/VwkgCdAGACvcCgmhWLFRbwkcDaDZ007WYILfYmAABgAqSeHy8WEJwT6iQACdgEgABYiHKM +Ey8SEO4SDyV1oYAAYAJanh8vFhD6QPAVoAwFAFiISIwTLxIQ7hIPLXVmAABgA8eOF4sTiBSMEfYg +yBWvigUAKiQ7DJkMCGYCmbSs2AbuAi0iEOgmGylQBIAAWIbUjh+MExjwbvqzphWhCQUAc5sNKyAW +Kgr/+2AETSIAnQCKKSsgOA8CAKOq6iYJKAQKgADzYAQ/kgCdACYhNS/CBCshGikiEOb/Ng3vwoAA +f9sLCgpCZKAFCw1CZNBz/iAmFeAdhQD5/gAO8AoVAPohphWgBjUA9iGGFa/1xgCKJy8WEIse6qwg +KmAEgABYg3wvEhCaEy0iG/lAiBXv/N4AAAAAAAAA6iAHKeAEgABYh+EY8EOME/4h6BWv/Z4A2iBY +hNsY8D6ME44f+kEoFa/9tgBxnogKvwz//QAV7/4KAIsUihYtIhAZ8EQLqgIb8EQKaAKGHRrwOwmI +AunwOhsLPgAAIxYRJRYSJiAHhcAjIQf2QSQV4GYRAOtVAQsygoAA9qYACrozAQDmISIpmwKAAAN3 +AgpVAiMhJAlmApXwhSCX85by/eCmFeOYAQDo9gYsygKAAAk5AuMSESJT+QAA6fYEKq4CgADl5QIG +QIEAAOX2ASfIwQAA5RISIhQ1AABtqQUIAIYJAmEmIBSkZgYGRyYkFPTACDXSAJ0AiBj4s6YVoQcF +APLh8g3g+fUAKyAW+WAIzWIAnQAqIhexquomFyGAqYAAjCkrIDijzJwp82AHn5IAnQCNHWXQz8Ag +0Q8vIE5k+9kOeAL4QEYVoACGAAAAAAAA8x/cwFIAnQAOPwz//QAV7+42AAAAAAAA6xIOKVAEgADt +EgwqYASAAFiEu9Kg0Q8A6xIMKVAEgABYhkbSoNEPAPpAaB2gG8UA/AAiHaANFQBYiAhj/8GLEPpA +aB2gDBUA7RILJdhhAABYiAJj/6kAACYgO2RgceokAA5YBIAA/CAoFa+JBQDpJDsscASAAFiGM/oh +BhWgCwUAKyYb+kdmHe/7zgAAAAAA6xIFKVAEgABYCW1j/u+KJ+tEAApoBIAA+0QAFaAMBQBYfkvS +oNEPANogWIRZY/8I6iAHKeAEgABYh1dj/twAACchCSUWEiMWESQWEyYgB4TAIyEk9EDkFeBmEQDr +RAELMoKAAAZEAgpEAvZERBWqtQEA6yIHLdMCgAAKdwIJZgIqsRWaEpTwhSCX85by/eCmFeNIAQDo +9gYqIgKAAAQzAuP2BCXYgQAA9CJoFa/DBQADuwEjEhHrqQgKrgKAAAXlAuX2ASZggQAA5RISJMkB +AADpy0N+QASAAC1M/gzWEaaG5pM7d+DBAAD0n+/xEgCdAG3ZBQgAhgwCYWP97YsQ+kBoHaAMFQD7 +YkAV4A0FAFiHr2P+WgAAAPuPAAw//vYACJ0MDUkUbZkFCCCGDAJj79oIBcEBAADpTAwFSMEAAPWf +7UESAJ0AK8z+bbkFCECGCQJlY/2UAABsEAYoIAUc73H33t4F4BpFAPsACp0iAJ0AKyBOiciwuysk +TvcgCMiSAJ0ALnKu7e9pFxFxgAArcq0t0n8NuwHmtAAFkSmAALCe7sYIJYg5gAAvIBSz/w8PRy8k +FPXgEMXSAJ0ALiBz+EOoFe/69QD7wAQA0AsVAOC4GgdoBQAA+xcADTTdAQAtJHMJiAEIuDkKmQHp +Jh0sBw4AAIoifKcEKCBOyY99pwgrIEwpIE57kxTMbCwgFO0iAi5YHAAAZNHJwCDRDwCOJ8fzD68B +7yYCJ1DBAABYdQzj700VATmAACigANMP0w8DiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/ciSfT +D2SfpiqZFMqniplkr5wooAADiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/gY/96AAD//1QNoAoF +AMCgWbpqHO8hicj5P/bokgCdAMBgKSAUs5n4QoYd7/weAAAAAAAAAADqJAAK2ASAAFiFeNKg0Q8A +KiAFKyAHwdT9QA5lYbsBAAUFR/igDnlSAJ0AkxCNNp0S7e8NHZgEgAD1YAmKEgCdAAy6EaeqLqKe +98ANnNIAnQAqop0NvAoswr8MqgFkoT36QAgV4AwVAFgiWx3vASkhCRjvASshIi8gBx7vCywhJPlm +AA2w/xEA6BICL/qCgAAPzAIOzAIspgCOIJui+UCmFaAPJQDppgMvdgKAAA/uAv9AJhWgCQUA7QAV +BVBhAACxmeqDHgyP6AAADDkR9yAARPAIpQAolp30v/K5EgCdAIon60QACmgEgAD7RAAVoAwFAFh9 +Z2P+Ov/3bA2gCwUAwLoLmzTrxggrbwYAAGP+2+okAAtYBIAAWAh5/d2kBa/3dgCKJ8Cw+0QAFaAM +FQBYhfwZ7t6ZoP5ACBWgG8UA+d24BaAMFQD5QEYVoA0VAP3AABcwCBUA6O4CDXgEgADu9gEpUASA +AFiG6cAg0Q+JyPcgBKCSAJ0ADDoRp6ouop73wAVU0gCdACqinQ0+Ci7ivw6qAWSgmLCfn8hlrsGI +IusWASQE4YAA+L/sOVIAnQCKJysKAPtEABWgDBUAWIHYixAe7rqeoIwgHe66naL9gAAWMA0VAA3M +Apyhi7b7QGYV7/VKAAAAAOtUAAlQBIAAWIT+Y/08jzP+IEYV7/jWAP/5ZA2gCgUA+iAmFeAKBQBZ +udwc7pSJyIsRHe6T+T/6uJIAnQD//cgNoAoFAADAoMCKCJg0+YEGFa/9igAAAADqJAAF2GEAAPwA +Ih2gDaUAWIauY/9RAABsEAQoIBTvix5qGASAAIon+mBoHeAMBQDqrCAp6ASAAFh9BdKg0Q8AiyJz +vksU7neKSGqhRxvudCyyrsrHHe51LLKtLdJ/DcsBfcAbsK6eSH3AIS8gFO8kFC/a0AAA2iBYCBFj +/6fAsMCKCKg06EYILf8WAACJIsmVwCDRD8CgWbmrikhroa1j/+oAAAAAAAD6QGgdoBvFAPwAIh2g +DRUAWIaEwCDRDwBsEAgsIg8vIAcoITQnMgf+Q0QVp9UBAPm/wBXgCxUA6bk5CbAEgADrIgkqUASA +APgghhXgBBUA6Hc2D0/CgAD3IlIN4f8BAAsJQvEgcA3ijgEAZIJywbTsex8OlHQAACwgT+kgTSZg +BQAADAxHLCRP/SAUo6IAnQAsIAX7gBL9YgCdAI0i+iAGFa/7NQD9YA5Y4gCdACgiGY4y+cAU1SIA +nQCJOBjuMxzuMOSSYm/fgoAAmhCYEay76O4qFUgNAACZE+sWAi+nAoAAqET14A0iEgCdAIsTKkKe ++0AbG+IAnQCKEilCndMPKqK/CpkB7pQABJJxgACMKYsqDAU+0w8Muwz1YAnb4gCdAC0aAPWh8g3g ++PUAKyAW+WAZdSIAnQAsISIZ7iUoIQcqISQrIQn8QPAV6ogBAOmqAgxDAoAACLsCGe4eGO4PDS1A +6cwCDuqCgAAI3QKd4IkgnOKa5PvAZhXgClUA6+4WHM4CgAAKmQKZ4YgvmOUsIDj3wQYV4A0FAP3A +5hXgCiUA/dwcBeBJJQD4wIgVoMwZAAyaOZjpDNs5jWWd6h3uCPzAyBWgCQUA7OYLI4fhgAAKnBAN +zAKc7IwRiWiX75nuiGko5hCNai3mEewAFQdJIQAACQCKiGf44AujogCdAB/t7Qq9Ag/dAp3mwMX8 +k6YVoQkFAPUh8g3g+PUAKyAW+WATpSIAnQAsIhmKKSsgTykgOOWqCAZgBQAA7CYZJdv9AAArJE+a +KfMgD4+SAJ0AixRlse/AINEPnxWfFp4X6iQACtgEgABYha+OF+8SBSV1kYAAjBRlz9uKJ9sw7BIA +JVDBAABYgLLAINEPGu28iqj3QBCIkgCdAIwTK0Ke/WARQ6IAnQCLEilCnSuyvx3tswuZAeSSFGVj +/QAAnNjulAAM8mYAAGAAjiggOfEf+A4SAJ0A//vkDaAJFQAAAAAA85/sSFIAnQAJ5wz2/YAV7/X6 +AAAAAMGze8kUKSA6mhD+IMYV4Az1AP0gEP0iAJ0A6iQACtgEgABYg/rSoNEPAPAAGA2gGtUAwKGM +NyshCY04jjLrrxEN3QKAAA+7AuS7AglQBIAAWIPewCDRDwAAAP//WA2gGoUA6iQAB9hhAAD8IGgV +4AwVAFiFrmP/BQAACrgCmObA1fyTphXhDAUAdcsNKyAWKQr/+WAONWIAnQCKFGShXYtqjGeKaat7 +B8wMnGf3YNIN4A4FALGqjGWbaotmmmms6qt7d7sBsaqOKZtmmmUtIDil7p4p86AKN5IAnQCJJyiZ +FMqCi5nJvhntdyiwAJ8VnxYJiAooghAssAf6QGgdoA01AAuAAI8ViyLHo/tf8oDiAJ0AKCE0h2cu +IRqKL4sp6Hc2D2fCgAB3ywoLCULIlA4LQmSwtMHU+v4ADrAMFQD8IIYVr/KuANogWIHqY/4Kiifq +rDArWASAAFhr3dKg0Q8AAP/yqA2gCQUAAACfFZ8Wnhf6QPAVoAwFAFiFCo4X7xIFLWX+AADqJAAH +2EkAAPwAIh2gDQUAWIVlY/3gAAAAAADqIAcq4ASAAFiE02P9gZ8V/iDGFeAKBQBZuHoa7TKKqI8V ++V/u2JIAnQD/9+ANoAkFAMCQHO0swLoLqzT7gQYV7/eaAAAAAADzX/o4UgCdAAnnDPb9gBXv/PIA +iiefFe8WBinYBIAA7BIAJVDBAABYgBLWoP4gqBXv+hYAnxXvFgYpUASAAFiBsv4gqBXv+rYAAADB +U/pAaB2gCwUA/AACHaANNQBYekUrIAWPFooQ9X/ahWIAnQBj/SGfFZ8W6iAHKuAEgABYhKT+IKgV +7/iuAAAAAAAAAABsEA6THJUaiC+KKS4hGichNC8yBPhA8BXntQEA+3/AFeANFQAL2znrFgsp4ASA +APfhAA/xmQEA5yAFLzfCgAD+wfIN4qoBAPFAcA3ibgEAZGRFwaQI+o364CNtIgCdAI4iixz1xJwN +4AqFACuwAZ8S82AgdxIAnQCZEZkYGOzj6+zkEmgNAADtFgksrwKAAOhVCAzXgoAAq6rqFgcicAUA +AIYYnhaLGfTABfoSAJ0AKlKehhf7QAmD4gCdAC9SnSZivwb/AWT0JRns0YmY9yAJAJIAnQAqgq7T +D2ShOxrszSOCrSqifx3syQo7AesWAyTb/QAA+mAJLiIAnQCb2PpgHrYiAJ0AhymGKgwDPgdmDPLA +CPPiAJ0AKRoA8yIyDeD69QArIBacEPtgCTUiAJ0AG+zPKSA4+9mYBaAGBQD34OYVoEcFAP2AiBXg +mRkACXY5Cbo5ixKaFJYV/WAR4uIAnQCGG2Rh1WABBRnsqImYapEwixkqUp6PF3ujTS1SnS/yvw/d +AZ0ThhPr7KAU0/0AAO9kAAMB+YAAmrhl/ylgA0wAAJ4d/CAGFaAKBQBZt98Z7JeJmIwQGOyU7hIN +JI7TAAD//1QNoA8FAMCg+iBmFa/+3gAd7I7AugubNPuhBhXv/u4AAAAAAP/7ZA2gDwUAAJ4dnx78 +IAYVoAoFAFm3yxnsg4wQjx6JmI4dGOx/+T/2GJIAnQBgAr7AoJoTixMW7HvA2g2dNO1mCC323gAA +YAKlnh2fHpwQ6iQACdgEgABYhFyMEI8e7hINJXZpgABgAl2eHZ8e+kDwFaAMBQBYhDOMEI8e7hIN +LXY+AABgA8ScEP4hphWviQUA6SQ7JjhBAAAHAIbnEgInsIEAAAYCYY3Hl/iKxInGrX0HqgyaxHfb +CZ4d7BYAJMgFAACMEosQhhWOFJm2nbcG7gLtIg8pUASAAFiCto4dGOxQjBD6s6YVoQcFAHN7CCsg +FikK/3m5foopKyA4o6rqJgkoBAqAAPNgBCeSAJ0AJiE0j8QrIRqJL+b/Ng3vwoAAf9sKCgpCyKQL +DUJk0HP+IEYV4B1FAPn+AA7wChUA+iFmFaAGNQD2IUYVr/W2AAAAAAAAnh2KJ58eixzqrCAqYASA +AFh/Xu8SDi1gBIAA/iGoFa/8UgDqIAcp4ASAAFiDxYwQGOwm/iGoFa/9tgDaIFiAv4wQGOwijh36 +QSgVr/3CAHGeiAq/DP/9gBXv/goAF+wkG+wkHewpBqkChhsa7CjtmQIGQEEAAOVhVGfogQAAJRYQ +kx8lIAeDwAUlQOozAQqqgoAABTMCBzMCJyEHKiEiJiEJ9EHoFep3AQDrqgILuwKAAAdmAichJJPw +gyCW85n2mvL14KYV46kBAOUSEC1SAoAACncC5/YEKZ4CgAAD4wLj9gEiU/0AAOMSDyIMNQAAbakF +CACGDQJhJiAUpGYGBkcmJBT0wAgd0gCdAIgW+LOmFaEHBQDy4fIN4Pn1ACsgFvlgCLViAJ0AyD+L +KSogOKO7mynzQAffkgCdAIwbZcDXwCDRDy0gTmTb7wroAvhARhWgAIYAAAAAAADzH92wUgCdAArv +DP/9gBXv7q4AAAAAAADrEgwpUASAAO0SCipgBIAAWICl0qDRDwDrEgopUASAAFiCMNKg0Q8A+kBo +HaAbxQD8ACIdoA0VAFiD8mP/wYsR+kBoHaAMFQDtEgkl2GEAAFiD7GP/qQAAAAAAJiA7ZGB3K/qA +KyQ77BICLlgEgAAIIIYNAmPs9ggs8ASAAO0iDylQBIAAWIIZ+iDGFaAMBQD8R2Ydr/vKAOsSAylQ +BIAAWAVVY/7yiifrRAAKaASAAPtEABWgDAUAWHoz0qDRDwDaIFiAQWP/AOogByngBIAAWIM/Y/7f +AAAAJyEHJBYRJiAHhMCTH/JERBXgZhEA6kQBCzKCgAAGRAIW66AsISSKJwZEAiYhCfpmAAn6dwEA +66EVK7sCgAAHZgKHL5TwhCCX9ZPy9+BmFaM5AQDp9gYpmgKAAAPMAuMSDyomAoAABOQC7PYEJVCB +AAD14CYVr8wFAAyqAaq85BIRJmEBAADsiz18SASAALBIDIYRppZ2wzb0n/CIkgCdAG2JBQlAhg0C +ZWP+AIsR+kBoHaAMFQD7YkAV4A0FAFiDm2P+YgAAAPsPAAz//w4ACcwMDEgUbYkFCWCGDQJn780I +BUkBAADoTAwGwIEAAPWf7diSAJ0AsM5t6QUJgIYIAmlj/agAAABsEAYoIAUjIAckCgP9D0BEUTMB +ACggImSAbwIqAlh3/P1MwIDQDRUALCAhGOtTDwIA7DMRBn1WgACoMykyng8CAG6TRSsynWSwP/pA +CBWg/uUADs4B/cYADvAPBQD8RCYd4AkFAPggBhXgDAUA+CAmFeAOlQD4IEYV4A0FAFh+GvRzphWg +AgUA0Q/AINEPAABsEAoqIAX4QPAV4AwVAPhgaB2ntQEA6BYAJdv5AADryzkKGASAAOsWBSwgBIAA +/UHABFGZAQDBw/1AICUiAJ0AjSLv6ysenBYAAOvrJxGwEQAA5hYELPeCgACv7u4WAyzXAoAAq6rq +FgcswASAAIcX9QAEIhIAnQCKFCdynoYTjxf64AdbogCdACZivy/ynQb/Ae8WBieaEYAAJSEbikKH +KYYqBaU29U8ADnELBQB8swHVoJgaB2YM9MAF4+IAnQAqGgD1QjIN4Pz1ACsgFpga/WAF/SIAnQCK +QvqgDnqiAJ0AjBUb6xyHQ5ga63cBBgj5gABgALYAABrq/Yqo6BYKJQzfgACLF4wUhhMrsp6PFyZi +v3yzQy/ynRzq9Ab/AeTwOWVb/QAAm8jvFgYv+24AAGACowAAAAD4IWYV4AoFAFm2Mhrq6oqoiRvo +EgolDt8AAP//TA2gDwUAwPAc6uTAugurNPuBBhXv/wYAAAAAAP/8eA2gDwUAmRvqJAAK2ASAAFiC +xIkb6BIKJXmpgABgAjUAmRv6QPAVoAwFAFiCm4kb6BIKLXmWAABgAxrw4ASIUgCdAC0hGowplxj4 +IUYVou0BAOkWCy8EFgAAlxj4IUYVouwBAOkWCycDgYAAmBrpFgsu/8KAAHX7Xg7VDPnVtAWgt+kA +5kIDLdyCgAALeQKZGAhmAfaAZhWgAQIAiieZGysSAOqsICngBIAAWH3iiRv4IUgVoAslAOukAi0g +BIAA6qICKAQKgADy//u4UgCdAIwplxiYGpkbjhiPFuWtDApYBIAA5cwICVAEgADtRgIq6ASAAOwm +CSngBIAAWH39iBqJG48X+/OmFaEOBQB16wgrIBYmCv92uQzAofogphWv93YAAAAA6iAHKuAEgABY +gi+JG/ghSBWv/4oAjykY6quJFqX/nymMQ4tAjRXnxAAEyIEAAPwOAAU36wEA7hYBLojmAAAnIAcH +B0EIdwoncp/urRANU8KAAO2qAgJAQQAA6ncBAdP9AADnxwIBjD0AAG2pBQgAhgkCYYtAwICYEhnq +lhrqlS8hGoYWHuqSJCEHGOqP/CAoFaHXMQD/oABGukQBAO3QgConAoAA7MwPJnBBAAD4hgAKNMwd +AORmACZgBQAADDwMFOpqDV0M6CIAL/oCgACfZpdnnmOdZQykOQmJAulmBCxGAoAA5GYCIdAFAAAI +qAKYYSYgFONmCA0gBIAA5iQUKAQKgADzYAQakgCdAIgX9ROmFaEHBQD04fIN4Pn1ACsgFvlgBR1i +AJ0AiBLSgNEPAIoVZKCjwCDRDwAAAAAAAADqJAAE2GEAAPwgiBXgDBUAWIJqY//Ziif8ISYVp9tB +AOqsICgECoAA9aAEYdIAnQCMFisKAezMICnoBIAAWHjAmhL6gAgV7/vOAACLFuxNEQlQBIAA/WAA +RfAMFQBYdqT0gGAVr/2iAGW7/Plf38jSAJ0ALyAg8f/fd5IAnQBj/3MAAAAAAAAA6iAHKuAEgABY +gb2IEtKA0Q+KJ9ww6xIAJVCBAABYfUrAsvtARh3gAgUA0Q8AAAAA6zQADjgEgAD8YGgd4AwFAFh4 +ndtA7DQACugEgADqFgIr8ASAAO8SBilQBIAAWH1p+oAIFe/7FgDqJAAE2EkAAPwAIh2gDQUAWIIu +Y/7pAABsEAiSFJMVGeoRiED4IEYVr8sFAOsqAQJwIQAA+iBmFaeIQQDkgcBiUBEAAI8TLSEFqYws +wACv3wTMC+/8QC5YBIAA/4ANiuIAnQD6ICYVoGgBAP4AIh3gDQUABv04C98L690KB9ghAACCFZ4Q ++QAARXAMJQDyQQAV4A8FAPJAgBWgAg4AjRQOVQz/4CAVoAMFAO/kAARABQAA8Q5gDeB+AQCGEyKg +AC3RBQQiC+bWCAlYBIAA4hYGIzEBAAD2QAZ6ogCdAAgGQPIAIh2gDQUABi04C9IL690KAVghAAD3 +IBAVoAIVAAcjOIcVB2YLF+nopzcncKAGMgoGMwvsfAgBmCEAAI7QCwCJBe42LiYAAwCLItIA6qwB +JMgFAAD0X/sj4gCdAAUpDA4qDPugBhWgBxUA9WAoFeAGBQAJdjgIaAgisgAF5QgltgF+WwIiLAHi +tgAmfRKAABbpz4sSHunO5rYBB5AFAAAGIgKGFe67AQxuAoAADbsCkmD6gAYV4SwdANEPixD8ICgV +7/1SAAAA/E8ADf/8xgCFFRnpnwXFC/gAChXgAgUAsSLlgx4JD+gAAB3puIYSGum47W0BB9gFAAAN +uwKNFepmAQxOAoAACWYC69YAJhAFAAD2gAYVoSIdANEPAAAAAOoWAS1oBIAA+8BoHe/51gD9jwAN +//k+AGwQDPhASBWgCgUA6yAHKcgEgADygGgd58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYVobsBAPMb +XA3gDAUAmhacFZkTmxSbGxjpcR7pchXplJUY5eluHe+CgAAO3QgtFgouIBbt6Y8dpwKAAPSAAEJw +//UAf+ETAioCWC0eGOlkHemI6hYIJSoRgABgABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIAnQCJiPcg +BhCSAJ0AK1KuHOlZZLDRLMJ/K1KtDLsBZLDHsJmZiBzpd2SzSyzAgCzMN/4haBWkzB0ArDzrFgIm +YB0AAPXABYISAJ0ALkKe/cAIK6IAnQCMGitCnSzCvwy7AesWACWZUYAAKnEMiXeZEf1ADqxiAJ0A +LHAQ63IDJglBgAD5n/so0gCdAC5yA2Tg0I8WZfGwhhGPGI0U7hIAKVAEgADm/zYL2ASAAO8WASng +BIAAWCrUGOktHelR568ubTAEgABgAvIAAMCgWbRvGOkniYgd6Ur5P/mIkgCdAP/9CA2gCwUAwLDA +qgqZNPkBBhXv/M4AAGqRJCtCnnyzQYwaK0KdLMK/DLsB5LA1ZPP9AAD/AQYVr/0qAAAAAAD8IaYV +oAoFAFm0WBjpEImIHek07BINJI8TAAD//IwNoAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAAAP/8GA2g +CwUAAAAAihjAsZsW+V/5KuIAnQDA4J4W+V/4yuIAnQDrdAAJUASAAO0SCSngBIAAWCsQ/gAiHeAH +FQDnFgktOASAAP9AZhXv+7oAZLBJjxX+ACIdoAwFAA/sOGTAjIgRhhjqJAAL2ASAAO0SBCngBIAA +6GY2CPAEgADmFgEg+BEAAFgrnOjo4h0wBIAA/dIKBe/3/gAAAACLGA8CAA8CAPlhNg3gDAUAeaMB +wMH4ACId4A4FAAyeOOwWBSd8kYAA63QACVAEgADtEgkp4ASAAFgsOvdAaB3gCxUA+iEmFeAKFQD6 +4GYVr/2eAIsQFejnKiEHiXAc6OP/0ZQF6qoBAP9AABU4mQEA7KoCBMA9AAD8ISgVpIgdAOq2ACRA +CQAACDgMjiCZs+hfOQGz/QAA77YCL3YCgADubgIFqEEAAO62AS4O5gAAiBPojCAhlFUAAOo8/irI +BIAAbakFCACGCQJhKzz+DLsRq1ubECggFCwgBKOI9YAImRIAnQAICUcpJBT1IAouUgCdAIhyKCYc +iXHoFgctqASAAPMgCjBSAJ0A8TX4DeAHBQCnZiZGnSogFisK/3uhCusSASlQBIAAWC8MjBllwOPA +INEP6xIBKVAEgABYLwcuIBYY6I390WIF4P/1AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxgaB2gCRUA ++1/gFaANBQDqnTgJUASAAFgpxsAg0Q8AAAD6QGgdoBvFAPwAIh2gDRUAWICiY/+9AAAd6J0t0IDr +EgQm6N0AAPpAaB2k3R0A/GAARvAMFQDt3Acl2GEAAFiAl2P/jy4gFi8K///f+vRiAJ0A6xIBKVAE +gABYLt/AINEPixAMbBGsu/ogBhXv+5YAKCQUjXDxv/i6kgCdAPpAaB2gDAUAWHTS9sBgFa/8EgCK +J+s0AAnoBIAA+0QAFaAMBQBYdt/SoNEPAAAAAAAAAOsSAilQBIAAWAH1+iAIFe/6wgAAAAAAAOok +AAxgBIAAWAN4iBeJcZoc56QADV8CgADrVQgE9U2AAOtUAAlQBIAA/QBoHeAMBQBYAz33QABD//o6 +AIon/KBoHaALJQDqrCAp6ASAAFgpuCtwEPl/8TjSAJ0AKXAVCQhFZI4ZK3EJHOhWKnEML3ARjicM +qgyr/w+ICf3CpBWvzQUA7uwgJHiJAADt7gEEQEkAAAr4Oah9rs7u7EAm6IEAAO7bWn7QBIAADuow +G+hGLaEB/UAEFaH5MQAL/worIhfv8p8uZAKAAAzdAgvuDA/uLK7dqF79wCQd792BAP3ABB3v9nYA +ixT6QGgdoAwVAPtiQBXgDQUAWIA2Y/4NAAD9rwANP/6aAGwQBCMgACQK7XQxBiIhA7wi0Q+EIYYg +8kBoFaAIJQD3ZAACsJRxAPkPAAxzNgEA9GAAQfNmgQDl6CMcAQqAAABmGvZgAQG9RAEA5SIBAag5 +AADlIgwBmGkAAAQkLAQzKKMi0Q9sEAiKIicgB4kwlRX4QtAVoXcBAPFdTA3omQEA+CAmFeD89QB8 +gR0FC0f7f8AV4AkVAOubOQlQBIAAWC6G81MwDeD89QAa596IqBbn3PcADZiSAJ0ALmKuGefcZOHb +KZJ/JWKtCVUBZFHRKIz/KKYI6VQAAo2BgAAb5/glsIDt59ESqN0AAPggBhXkVR0A5UUIC88CgADm +mQgCqA0AAPTgCJISAJ0AKJKe9QATO+IAnQAlkp0NeAoogr8IVQFkUYgpIBb9IyYNoOvVACowEPtA +ElRiAJ0AKzELvLvaIFguMSggFCwgBKSI9YAMQReYAQApJBT1IA4uUgCdAIoVHufPjREoIQcc57MZ +58v/oeAV6ogBAP8AABQ0/x0A6YgCB/gFAAAPTwyYUIsgD+w5/KBmFeeqAQDsVgIt3gKAAOtLAgLI +QQAA61YBIcBBAAD5QAlxUgCdAOhBDWJT/QAAbakFCACGCQJhwICYFOkgBCJb/QAADLsRq1v1IAkJ +EgCdAIgyKCYc6TIBJdhBAACbEygWAvMgCbhQBQUAZpFQpUyIFAx9Eabd7NadLBAEgADRDwAAAAAA +9wAOkJIAnQAMeRGmmS6SnvXADvviAJ0AJZKdDXsKK7K/C1UBZFHNsI2dqGVe3WAAYwAAAAAAAADq +JAAJ2ASAAO0SBSpgBIAAWHxD0qDRDwDAoFmythrnbYio+R/yGJD89QD/+VgNoAUFAAAAAAAAAPpA +aB2gG8UA/AAiHaANFQBYf4xj/7HAUMDqDog0+UEGFa/4rgAd54Mt0IAt3Df64wAV5N0dAO1NCAlQ +BIAA/aBgFeAMFQBYf39j/3sAAAAA+EKGHa/6DgAAAACKJ/0gaB2gCxUA6qwgKmgEgABYddb6IIYV +r/tKAIsw82AIopIAnQDiEgQr5wKAAKbMJMad0Q8AAAAAAAAA6xIAKVAEgABYAOVj/jAAAOokAAxg +BIAAWAJqiTGLE4gS7KwRDSgEgADsuwgE9Z2AANog/QBoHeAMBQBYAjGIFKWlpUwMfRGm3ezWnSwQ +BIAA0Q8AAAAAAP/2lA2gBQUAjTWMNB7nUPpg6BXgCSUA/HAAB7CtcQD7LwAMu4whAPsgBADTzAEA +6MwID/gKgAD/gAEGfd0BAO67AQZwOQAA7rsMBmBpAAANvSwNzCj9YABFv/W6AAAAAOokAAPYSQAA +/AAiHaANBQBYfzhj/mHAoFmyVBrnDIioHecM+R/xCJD89QD/+PANoAUFAMBQwLoLizT7QQYV7/i2 +ALBLDLsR61sICVAEgAD7YgAV4AwFAFhzdLNM4hIEK+8CgACm3SzWndEPAGwQBIk3F+cfKzAW+c4s +BaMqBQAKKigLtgnoqAgLNwKAAKhmGOcZp2fkcr8pAQqAAP74CBWgDBUA6GYIDmgKgADmQRh0wCEA +AIsymOCek5aSDbsCKHbAmzLRDwAAH+cMr68p8r0AsQTt8sEucAqAAA6ZAvn3phXv/vUADt0DDZkB +HucE5XLAKW8CgACu3ZnQjzKYUOaGACkBCoAA5YYBLiAKgAAE/wIodsCfMtEPAAAAbBAKGeb4CSkK +KJJ/4hYIKWgEgAD7AAQA0AYVAOYWCisoCoAA+CCGFeBVTQAS5u8b5u8c5uAY5r31zdwFoyoFAOra +KA6/AoAA6ZJ/Juu5AACdFaSkqHesrJwWKHK5JEKf66oIBMv9AAD6IOYVo5kBAPghJhXgYwUA+IAE +AjAAbgAAihrAsP3/4h2gYwUA7FUDBQLxgACbGi1yuAReAQ7dAZ0QAQCHAzZgaD7VihiLF40ViBbj +OQkB8oEAAO4WCSzPAoAA+QAARH//9QDijAgEQv8AAODhBARCkQAA6IKfK0gKgAAPmQMJRAELgABj +/6eKGYsUsaoKCkMqtn/RDwAAAGwQBBvmvCoiAA8CACuyfx7muvtPAA1zLwUAD68oDv4IKeK/KOK+ +/c1qBe/79QALmQPpiwENZwKAAP2AAEZ/9PUA/YAIFaADFQD5DuAd4A0FABnmqxjmmPkAAEZ/LAEA +7PwIBf1EgADLKQjqMCnCvy/iwAmIDOj7E36BCoAAL+K+ADgaBIgDCP8BL+a+/aAgFeG7HQDksCxm +YMEAAH+3FGP/xAAACeow+ZfmFe//hgAAAAAAAP2gIBXhux0A5b/cZmDBAABYLtXAINEPAGwQBCYh +CfhCkBXv+AUAJyAV6JgBCzYCgADomQwLuQKAAAdmAvhChh3gBwUAJzQA+GBmHaAEFQAEZgKWMRXm +SSRWrdEPAAAAAGwQBBbmexXmU9MPpiIFNQIlJoAkIoBnQAttCAUoIoBngAJj//PRDwBsEAQT5nIi +Nopj//wAAAAAbBAEKCAFJSAH+mCoFa/01QD6QEgV4AMlAP0BIBHRVQEAwCDRDwCIKZorDwIA+wAI +PCIAnQAa5mIKWgnpofwlUAsAACqhAPsgBLOiAJ0A82AEcBIAnQACKgJYcrgrIgIPAgADugFkr7iK +JwS7AesmAiVQwQAAWGvq4+YrFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv +3Ikn0w9kn3YqmRTKp4qZZK9sKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/SgAA//9U +DaAKBQDaIFhypSsgIuq7DAlQBIAAWHPv2lD6ACId4AwFAFh1nIsiA7oB83/65mIAnQAvIAfaIPwA +Ih2gDQUA9WAEBzG/AQDuJgIl2H0AAFh+GMAg0Q8AAAAAAAAA6yAiKVAEgABYc9sqIAXBg3ihDGio +KYsi82AEBX/8RgApIDrAv3uZ6vpAaB2gCwUA/AACHaANJQBYcxJj/9cAAPpAaB2gCwUA/AACHaAN +JQBYcotj/78AAGwQCogrHeX7LiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDRDwMA +hgkCYZsVKCAFJSAH+CEGFe/01QD8QEgV4AMlAP0bQEHRVQEAiikc5fabK/tACBRiAJ0ADFwJ68H8 +JmALAAAswQD9YASjogCdAPOgBGASAJ0A2iBYckqLIgO6AWSvm4onBLsB6yYCJVDBAABYa30KqwLj +5b0VASmAACiwANMPA4gKKIIQLLAH+kBoHaANRQALgADrpAANfx4AAIknZJ9aKpkUK5IJyqhkv08o +sAADiAooghAssAf6QGgdoA01AAuAAOukAA1/LgAAY/8tAAAAAAD//0gNoAsFANogWHI3KyAi6rsM +CVAEgABYc4HaUPoAIh3gDAUAWHUuiyIDugHzf/rOYgCdAC8gB9og/AAiHaANBQD1YAQHMb8BAO4m +AiXYfQAAWH2qwCDRDwAAAAAAAADrICIpUASAAFhzbSogBcGDeKEMaKgpiyLzYAQFf/w6ACkgOsC/ +e5nq+kBoHaALBQD8AAIdoA0lAFhypGP/1wAA+kBoHaALBQD8AAIdoA0lAFhyHWP/vwAAbBAEHOWe +KzIEKTAW/WAEBbWZHQD1IAgAkgCdAOrlmRSIgYAA/8swBa/95QDk5WwUpLUAACyhfmmVHXyzCirM +BPtgCKOiAJ0AKyAGsLsLC0frJAYlgtGAAMAg0Q8ALKF+0w/sswx2eBEAAP9gB9PiAJ0AKCAGsIgI +CEfoJAYsftYAAIkniyIqmRQNuwGbIouZZKC0KLAABIgKKIIQ2iD9YPAVoA01AAuAAMAg0Q8AiyKK +Jw8CAA27AesmAiVQwQAAWGsFya0ooAAEiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSdkn24q +mRRkoGCKmWSvYyigAASICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0EAAOokAAnYBIAA7EQA +CugEgABYcyXAINEPAOokAAnYBIAA7EQACugEgABb/0HAINEPAP/9HA2gCwUA//50DaAKBQCINyLi +fwmIEfhAAEE/+5IAiDci4n8JiBH4QABBP/v6AGwQBBrlKSiiy2SACwnqMCuizAuZDGeQAdEPWHVE +0Q8AbBAEHeU7JyAHHOU6/kEEFeDnEQAO3DmcMIgg+8n+BeAKJQD6YEYV4BkFAOk2AyxGAoAACokC ++GAmFeF3AQDmIHkrvAKAAPfmAA9wDQUA/AQCHaALNQDp5SgTAjmAAJ01nDMLigIW5SWaMRrlJQbu +AiYhCZ40mjYEZgIiIAedOZU7+MYAC3EiAQDmNgopFAKAAAL/Agn/Au82CC2QBIAA0Q8sIQgrIQmd +NZU3B8wCBLsCCbsCCcwCnDTrNgYtEASAANEPAGwQBBjk9R7lCSwgBx3lCRnlDPpBBBXg/BEA/80A +DvHMAQDtNgAuZAKAAAy7Agm7AuOAgCmwBIAAHeTH/EAIFaAOBQCeZe1mAiG43QAA+sCGFeR3HQDq +fP8uZgKAAOx8Ag1XAoAA7GYBJVPhAACaYwIEiZlmI2YHBiCLJSEJ9MFmFaQzHQDlZgorkASAAOiA +BQMowQAAbTkCBQJh0Q8AAABsEAYd5OgLKxGtsyoyfxnk5hfkxIigwED44ABE8AYVAOm5CAQBqYAA +LDJ4LzJ7+YAFfGIAnQBl8RQsNnwrMnkrNnvdQA3kFgECAJSgDeQWwMn8QAXcIgCdAC8ye8HA7eTT +F4ORgAAiMnwqIQSOIPPh/g2mugEAJDZ89G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWMWQAAIjJ8 +sMzvMnshAPGAAMnGY/+/2iBYdV9loMIqIQT/QQAMFpoBAMiX0Q/aIFh1UtEP2iBYdRTRDwAAAAAA +APpAaB2gCwUAWHXi0Q8uLPjq0ogvAQqAAPzAAQXf/PUADLsDC6oBKtaIWbTIJDZ8JDZ7+m/oFa/8 +4gAAABXkZC9QYWTwalmrLVh0yyhyy9MPyIFYdKApUGFknylYdJrIrhXknyxSfrDM7FZ+JgLJgABY +dCFj/w4AAAAAHOSZ/m+IFaAKVQD8b0gV4AtFAO0WACFr5QAAWbL3+m/oFa/7MgAuMnviNnwveh4A +ACI2e9EPH+SNL/KucfaL9qwmHa/+IgAAAAAAWar0+q/GFa/+kgBsEAQU5IUZ5H/o5F0ZXsKAAKS0 +I0J/qYjouAgBgiGAACoyAHipAipCexzkdysxBCpGfwy6Aeo1BCnQBIAAWHURzqkpMQT/IQAMFtkB +AMjX0Q/aMFh1BdEP2jBYdMfRDwD6QGgdoAsFAFh1ltEPI0Z/0Q8AAGwQBPBg4A3v+fUAiCIJOQMJ +iAGYIoonKqwwWGnq4+QqFQEZgAAooAADiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSfLkiqZ +FMqlipnJrSigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+DRDwAA//9cDaAKBQDRDwAAbBAI +FuRJG+RJHeQg9cf8BaAYxQDjLOgl04EAAPhADcwnMwEADDURpFXoUp4pZsKAAKbEKUB/+QAQU+IA +nQAoUp1kgf+bEeoLHg1IBIAAmRAKIIYLAmULAmMNAIcJAmEJAmHtxwgJAQqAAP/IYgXgDhUA4+P1 +H3AKgACeE6/P/iCGFe//9QD/1wAPcAZFAP4gRhWgAMIAAAAAipnJrSigAAOICiiCEOygBy1YBIAA ++kBoHaANNQALgABlr+ApQiBkkO8tQHwsQH0e5BsN2wkHuwru3ggF2F8AAIqyLuCAZKE4/cf+DaAI +FQAvCgANjzgP/wkH/wov/Rcv/Jwv8hssCgEM3APx4SAN58wBAAzLCQe7CuxEfCXYXwAAwND8j6Yd +4AwFAI2w71KeJvP/AAAu4P//4AR7ogCdAC9Snfbf4BWg+PUA8efADedmAQB4YXTqEgQmQAUAAOhE +fSbj4QAAWHSWiRPSoOsSAiSAYYAAiqILqgEqJgKKJyqsMFhpcsmtKKAAA4gKKIIQ7KAHLVgEgAD6 +QGgdoA1FAAuAAGWv4IknZJ8XKpkUZa7u//u0DaAKBQCMEYsQDICGDGCGCwJpCwJn0Q+PEY0QLkR/ +D8CGD6CGDQJtDQJr0Q+bEeoHHg1ABIAAmBAKAIYLAmMLAmEN4IcIAm/o7AAJ0ASAAFmqV2Svr+3j +ohmvAoAA5FUICWbCgAD3gABCP/kyAMCx+7cADfAMBQD8j6Ydp7sBACtEfAu7CfdgAQXwDAUA+2Lg +Je/7mgAAAAtghgtAhgoCZwoCZdEPAABsEAQY42sCA0cMMxGoMysyhBnjeCiwAIqxCYgKCiGMAgo+ +KIIQAwI+/EBoHaANJQALgAAiNoTRD2wQBBTjXQIDRwwzEQQzCCQyhCpCASZAAChACPqYaB2gqSUA +AgU+AwI+eYEjGONkCGgKKIIQ6lQAClgEgAD8QGgdoA0lAAuAACI2hNEPAAAA6yQAClAEgABYdF3z +QGgdr/82AAAAAAAAbBAEWa23EuNCE+NjDAIAKSKCCRqOA6gKiIQLgABj/+sS44kD6DAE7jAFsTCT +IJQhlSIS44UT40WEIAQzApMgEuODwDAoN0AoN0QoN0goN0wjPQFyM+0S437AMJMgxy8T430DIwMS +43yEIAQ0AZQgEuN7hCAENAGUIBLjeYQgBDQBlCAS43iEIAQ0AZQgxy/AMQMjAxLjdYQgBDQBlCBj +//wAAAAS43KDIAMTFA8zEZMgEuNvwDAjJgBX/9kQ426RAJIBkwKUAxHjbIIQAeowohEB8DHAQATk +FgACABHjaIIQIxoAAyICkhAR42XAIZIQBOQxhAODAoIBgQAA0jABIwAAAAAQ42CRAJIBkwKUAxHj +XoIQAeowohEB8THAQATkFgACABHjVoIQIyoAAyICkhAR41bAIZIQBOQxhAODAoIBgQAA0zABMwAA +AAAQ41GRAJIBkwKUAxHjT4IQAeowohEB8jHAQATkFgACABHjRIIQI0oAAyICkhAR40fAIZIQBOQx +hAODAoIBgQAA1DABQwAAAAAAXJQBXZQCXpQDX5QAQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFyQAV2QAl6QA1+QAFMAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACclAAdkAGdlAKelAOflAQIlAUJlAYKlAcL +lABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJABnZACnpAHHZADn5AEeJAF +eZAGepAHe5AAUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANyUAB2QAd2UAt6U +A9+UBASUBQWUBgaUBweUCAiUCQmUCgqUCwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADckAHd +kALekAsdkAPfkAS0kAW1kAa2kAe3kAi4kAm5kAq6kAu7kABTAAAAH//9rADSMRD//goAAAAAAB// +/fQA0zEQ//4KAAAAAAAf//48ANQxEP/+CgAAAAAAAPQwCgAAAAAA9DAKAAAAAAD0MAoAAAAAbBAI +JyAHiCIW4j79xHQF4XcBAOWA8WvXAoAAGOI3LoCA5qoIB3DdAAD9U8gVpO4dAK5O6+IyF3AJAAD/ +gAhLoAmlACqinQt8CizCvwyqAeoWAiUH+YAAiNj3AAjwkgCdAC9iruziKBeFwYAAKmKtLMJ/7KsB +BHP9AAD9QAUmIgCdAJ7Y/UAFLiIAnQAvIBSk/w8PRy8kFPXgB65SAJ0A+CBIFeeFAQD5AAdxUgCd +AOg8ECIMPQAAsEptqQUIAIYJAmHAUIgSjTLtJhwiS/0AAOsyASzPAoAAqYiYE/NgCkBQCgUA6hYA +LYtKAACLEOtLCAvnAoAA5swIBdv9AADrxp0qkASAANEP6iQACdgEgADsRAAK6ASAAFh2Z9Kg0Q8A +wLAJjDTs1ggt+x4AAI0iZd/V+kBoHaAbxQD8ACIdoA0VAFh5tGP/v//8DA2gCgUAAACOImXvsC2A +gC3cN/rjABXk3R0A7U0ICVAEgAD9oEAV4AwVAFh5p2P/jMCgWazDHeHdiNj5H/bAkAmlAGP/nNog +W/sdY/8GAI4nnhGI6fvCpBXvyQUA5ekUJ2CBAAAJyQHpvQgKVwKAAOpVDARAQQAAmOkIVTLl5RQm +6QEAAP0ACDriAJ0AaKs9qKsrvPD7oATT4gCdAO8SAiIMdQAAsE5t6QUIAIYPAmErwgELqwjlyQQl +28EAAP1gBsxiAJ0A68YBLcAEgABkUKn1AGgd7/qWAAAAAAAA6iQADuAEgADsFgQsWASAAFv8fIsx +iBONFOoWAC1nAoAA7IgIBfT9gADaIPsAaB3gDAUAW/xDjRDtrQgKkASAAO1NCAv3AoAA5u4IBuv9 +AAAt5p3RDwjdDPogSBXk/R0A0w9t+QUIIIYLAmMrEgLvTwwEwQEAAO27CAeMQQAALvz/bekFCECG +CwJlL8kEDagMqJgojDDoxgEv+tYAACqcQJrB+4AGFaAIBQD5gIQdr/0WAAuIDPnBJhWv+9oAKJxA ++YAmFa/8sgBsEAQc4YUa4YUPAgAtwnYqoX4swpCj3eo6DA7uQoAA/YAARnALBQArxAQrxAVZFMH6 +QGgdoAsFAFv87tEPAAAAbBAEhSODIBThdvhAhBWhVQEA6uF0Gq7CgADkVAgBgLmAAPsABAQ2mDkA +CYgCKCUEIkJ/0Q8d4WsT4Wwf4WwmQn4rIQQuQn+SYJYho//9YAQF9ss5AAy7Aq9f7yYAJygFAAAl +Rn8iRn7rJQQqkASAANEPAABsEASCIwICQdEPAABsEASKIGWgUB3hWuoiAyn2woAArt39r+gV4AwV +APyAQAYxqgEABqoCDcgsCN0oJyUF7cwMBFgFAAD9bQAMP/vFAOuqAQxOQoAACVkCA6oCmiMJiAIo +JQTRD48jG+FGDw9BC/4Rq+stsn8ssn5y2RnZwPMj3g2gDAUAwMAstn8stn76QAgVoABGANjA8wwm +DaAMBQBy0RyNIZrQjiApsn2d4Zwg7CYBJMv9AAD5b6YV7/1mABnhLRjhLamIqOh4oR/qtn8vgSYA +AM2sKrJ9aqIXLbJ7/W/mFeAARgAAAAAAAOy2fyf/MYAA+kAIFa/+qgAc4R4Z4R6IIayZqen5DwAM +8AwFAAnIOPlvxhWv/iIAAGwQBPXCMgXgBhUA9EBoHaACNQD2gEADMAAaALAiKFJ/6GP3cquBAADR +DwAAbBAE9EJIFaQjQQDyWgAJP1OBAAQiCoQmgiEFRCgKRBGkItEPbBAEKSISIyAH1FD4PgAEcAU1 +APUACIiRMwEAF+D098HoBaGJ4QD1AAhwkgCdAPRgBjISAJ0ADDkRppkqkp4HOworsr/3QAiB0gCd +ACqSnQuqAfFPAA3nRAEAKCEHGeDv/8HgBaqIAQDr4O8cRwKAAAmIApigGODs/EAIFeA8BQCcp/tA +phXgGYUAmaP5QEYVoAgFAJim7t0CDv4CgACdpAX/Ap+hLyISD49B6KYIL/8CgAAvpgnt4N0Z9wKA +AAbuCCXmnSwiEioiEA3MAuwmEilYBIAAWNG8aEIYiif6ACId4AwFAPtEABWgDRUAWG7m0qDRD8Ag +0Q8c4LuLyGqxXww5EaaZLZKebtNqKpKdBz0KLdK/DaoB5KBdZfP9AAD/gQYVr/y+AAAvGgAPmQL4 +QkYV7/umAAAAKCoACJgC+EJGFa/7sgCJIsucaEJQwCDRDwAAAAAAAAD/+9gNoAoFAMCgWauGHOCf +i8hrsZL/+4QNoAoFAADAoMDaDb00/YEGFe/7RgAAAADqJAAB2GEAAPwAAh2gDTUAWHhaaUKujCcv +yRSKyf+EABWvyAUA6O4BB/hBAADvxRQlU8EAAOrGCSdxAQAAfqsqKcEVHeCZqpqayZ2gjCD7wS4F +4A0VAOumAi5mAoAADcwC/UAmFaACBQDRDx3gj52gjCD7wRwF4A0VAOumAi5mAoAADcwC/UAmFaAC +BQDRDwBsEBiSEI4gFeCGiSOLIYoiKhYiKxYk+CRmFeAEFQD0IOYVoAgFAPggphWgDEUA/CFGFaAN +NQAtFgn0IMYV4A8lAC8WCPXA8AXgD6UA/iIGFeANtQD8IiYV4AzFAPwiRhWgCIUA+CHGFaAElQD0 +IeYVoAl1APghphXgC1UA+iFmFeAKZQD6IYYVoAvVAPoiZhXgCuUAKhYU9cDIBaAJ9QD4IqYV4AhF +AJgUhhYrEiSJFSdhfiwSIiJhfweZKC9QgAkpCPiciBWjmQEAA5kK7pIAL1AEgAAmYj4tEiMI7ggL +YACOFywSJC0SIgfuKC9Qga4u+JyoFaPuAQAD7gqO4CoWFuoSIy1YBIAAqO4LYACOGCwSFi0SJAfu +KC9Qgq4u+JzIFaPuAQAD7gqO4CoWF+oSIi1YBIAACO4IC2AAjhksEhctEhYH7igvUIOuLvic6BWj +7gEAA+4KjuAqFhjqEiQtWASAAKjuC2AAjhosEhgtEhcH7igvUISuLvidCBWj7gEAA+4KjuAqFhnq +EhYtWASAAKjuC2AAjhssEhktEhgH7igvUIWuLvidKBWj7gEAA+4KjuAqFhrqEhctWASAAAjuCAtg +AI4cLBIaLRIZB+4oL1CGri74nUgVo+4BAAPuCo7gKhYb6hIYLVgEgACo7gtgAI4dLBIbLRIaB+4o +L1CHri74nWgVo+4BAAPuCo7gKhYc6hIZLVgEgACo7gtgAI4eLBIcLRIbB+4oL1CIDi4I+J2IFaPu +AQAD7gou4gAqFh3qEhotWASAAAjuCAtgAI4fLBIdLRIcB+4oL1CJri74nagVo+4BAAPuCi7iACoW +HuoSGy1YBIAACO4IC2AALhIQLBIeLRIdB+4oL1CKri74ncgVo+4BAAPuCo7gKhYf6hIcLVgEgAAI +7ggLYAAuEhEsEh8tEh4H7igvUIuuLvid6BWj7gEAA+4KjuAqFiDqEh0tWASAAKjuC2AALhISLBIg +LRIfB+4oL1CMri74nggVo+4BAAPuCo7gKhYh6hIeLVgEgACo7gtgACwSIS4SEy0SIC9QjQfuKChC +8a4u+iBmFaPuAQAD7gqO4OoSHy1YBIAAmxGo7gtgAIwRLhIULRIhL1COB+4oKELyri76IEYVo+4B +AAPuCo7g6hIgLVgEgAArFiOo7gtgAC4SFSwSI40TB+4oL1CPri74nmgVo+4BAAPuCo7g6hIhLTgE +gAAnFiLo7ggL2ASAAAtgAI4RKhYkKRISLRIVjxUrEhMsEhToEhEn+EEAAO8WBSXYQQAA6xYTJmBB +AADsFhQkQEEAAOgWESboQQAA7RYVJMhBAAApFhKNH4kciBuMHosd7xIQJEBBAADoFgsmYEEAAOwW +DiXYQQAA6xYNJ/hBAADvFhAkyEEAAOkWDCboQQAAnR+JFo0ZjxrrEgciIQEAAOwSCCboQQAA7RYJ +J/hBAADvFgoiqEEAAO8SBCZgQQAA7BYIJdhBAADrFgckyCEAAOkWBif7/QAA7xYEL+IWAACJEI8T +ixKOkIiTjJKNkauIp8yq3a/unpCdkZySmJPRDwBsEAQpIhX4oAAE8Dh1AOmMDAEgQQAA8yAART+L +BQDrpBAlUEUAAPkABdNiAJ0AKwoAWadLLCIVKyIU7c0RCUAEgAD8QkYV7oA9AP1rAA2wCTUA+kJm +FeAKJQBtqgyOhA4Oju6GBCRAEQAADwIA0w/TD22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyO +mYCagZuCnIPrRAAJUASAAFv+tYogiCKJIY8jCAiOCQmODw+OCgqOmiCfIykmAegmAilABIAAGd83 +AgCGAwJh+AAKFeAJtQBtmgIIAIrRDwAAAAAAAAD9gQAVoAsFAFmnHPhAaB2gCUUA0w9tmiHpggQk +QEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD6iQAClgEgABb/pPaQP/7/A2gPIUAAGwQBiki +FfhCiBWgRgUA0w/4gABFdZkBAAlmDHSrAbGIKiYVBioM6CYUJVFBAAD2gAezogCdAOs0AAtgBIAA +Wabw+EBoHaAJRQDTD9MPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4KcgyUsEOok +AArYBIAAW/5wBkcM9uAFjtIAnQDmNAgK0ASAAPbgaB2gAwUA5BYAKkAEgAD4yGgdoAlFAAoCZwhA +hgoCZQgghgoCYwgAhuoMAAlABIAAbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kc +g+okAArYBIAAW/5T6lQAAZgFAADmbMAiIQEAAO9tmmpABIAAixAKPBELywjsfAwK0ASAAFmmuNEP +AAAAAAAA6zQACmAEgABZprPRDwAAAPZgAEYwAwUA/CAGFa//JgBsEAQY3ssZ3ska3scT3sqTI5gi +mSH6QAYVoAsFACsmFSsmFNEPAAAAbBAG3iDk4hAqYASAAOdCByvQBIAA+71wBeAYNQDjQhUpkASA +AOdyDiL76QAAePsnGN64CPgKiICaE5wS7hYBLAAigAAAkxAqspXsVAAJWASAAFmocWSlz/KCphXg +AgUA0Q8AAAAAK+ISC5tS7hYBJf9BgAAa3qHjFgApWASAAOqityrgBIAAWahkZKWCGt6a2yDqorkq +4ASAAFmoX2Sm4Breltsg6qK7KuAEgABZqFr3SOAN43bFABrekNsg6qK9KuAEgABZqFRkpuEa3ovb +IOqivyrgBIAAWahPI30D7wIAAZoBAAD7QENwEgCdACsw2cFY9WAsCGIAnQBptyElNNmLEPqCphXg +AgUA0Q+TECqyjexUAAlYBIAAWag/ZKcfixD6gqYV4AIFANEPkxAqspvsVAAJWASAAFmoN2WvGPog +aB2gC7UAWM3F+gAiHeADBQDqszgFAOGAAOoSAitYBIAAWaa8yKkc3muNEQysNizWF2UzK40Q/IKm +FeACBQDRDwAAAC5AbmTuzZMQKrKx7FQACVgEgABZqCBlrrr6IGgdoBtlAFjNrfoAIh3gAgUA6rI4 +BQCpgADqEgIrWASAAFmmpCx9AyrFKGUi1I0Q/IKmFeACBQDRDwCTECqyo+xUAAlYBIAAWagMZKK7 +Gt5D2yDqoo8q4ASAAFmoB2WuWPogaB2gC1UAWM2V+gAiHeACBQDqsjgFKBmAAOoSAitYBIAAWaaM +LEBv8YAnbtIAnQBkpOWKE/oAoh3gDNUAWM1x0qDRD5MQKrKp7FQACVgEgABZp/Flrsj6IGgdoBsl +AFjNf2SiOytAbtMPZLeS6hICK1gEgABZpncsQhYKzDYsRhaLEPqCphXgAgUA0Q+TECqyp+xUAAlY +BIAAWaffZKI3Gt4WAisCDwIA6qKhKuAEgABZp9llrmj6IGgdoAvlAFjNZ2Sh2+oSAitYBIAAWaZh +K30CKrUUixD6gqYV4AIFANEPkxAqspnsVAAJWASAAFmnymSiKhreANsg6qKlKuAEgABZp8Vko4ca +3fzbINMP6qKTKuAEgABZp8BlrgL6IGgdoAt1AFjNTWShdStAbmS3Ahrd8YsS6qLfK2AEgABZp7Zl +pmQrQG/AyAy7AitEb4sQ+oKmFeACBQDRDwAAkxAqsq/sVAAJWASAAFmnq2Sh7xrd4tsg0w/qopEq +4ASAAFmnpmWtmvogaB2gC2UAWM0zZKENK0BuZLaJGt3XixLqot8rYASAAFmnnGSmmCtAbywK/Qy7 +AStEb4sQ+oKmFeACBQDRDwCTECqyl+xUAAlYBIAAWaeRZKG3Gt3I2yDTD+qiiyrgBIAAWaeMZKLa +Gt3C2yDqoqsq4ASAAFmnh2SsVxrdvtsg6qKzKuAEgABZp4JlrEQa3bmLEuqizStgBIAAWad9ZaRq +ixErshILmVLImWiSB/kgD2HSAJ0AjBErxhLygqYV4AIFANEPkxAqsofsVAAJWASAAFmncGShehrd +ptsg6qKJKuAEgABZp2tlrK/6IGgdoAslAFjM+MqiGt2eixLqot8rYASAAFmnY2Wsj4oT+gBCHeAM +1QBYzNrSoNEPwCDRDwAAAPogaB2gC/UAWMzqZK/q6hICK1gEgABZpeXrEgAj4AsAACrFFfqCphXg +AgUA0Q8AAPogaB2gGxUAWMzeZK+6LUBuZNUkKUBv8T/hb5IAnQDxP+Ev0gCdAOoSAitYBIAAWaXT +LkIXCu42LkYXixD6gqYV4AIFANEPAPogaB2gC6UAWMzMZK9yL0Bu0w9k9JXqEgIrWASAAFmlxShB +NPsADwKiAJ0AihP6AUId4AzVAFjMq9Kg0Q8AAAD6IGgdoBtVAFjMvGSvMuoSASpYBIAA7BICK2gE +gABYzESLEPqCphXgAgUA0Q8AAAD6IGgdoAuVAFjMsGSvAilAbmSUOBrdVYsS6qLfK2AEgABZpxll +onMrQG+NEPyCphXgDBUADLsC+o3mHeACBQDRDwAAAAAAAAD6IGgdoAsVAFjMnmSuuhrdRIsS0w/q +ot8rYASAAFmnCGWrJIoT+gAiHeAM1QBYzH/SoNEPAAAAAOoSAitYBIAAWaWO9UAWspIAnQDHL9EP +APogaB2gC4UAWMyK+gAiHeACBQDqsjgFAUmAACxAbg8CAGTDoRrdM+sSAitgBIAAWabwZaKGLUBv +wOgO3QItRG9lLjWPEP6CphXgAgUA0Q8A6hIBKlgEgABYzH9lr5wrMNlj+m4AAAAA+iBoHaAbBQBY +zHBkrgIoQG7TD2SDFOoSAitYBIAAWaVpKUIYixArRhUKmTb4gwYV4AIFANEPAAD6IGgdoAs1AFjM +YmStyhrdCIsS0w/qosUrYASAAFmmzOPdDR0H5gAAixErshILyVHImWiSB/k/+RHSAJ0AjhGMEAO9 +AS3mEvyCphWgAgUA0Q9lLYSPEP6CphXgAgUA0Q/qEgIrWASAAFmlSCpFNIIQ8oKmFaACBQDRDyN9 +A/JvgBXgCwUA+mBoHaCMBQBZpNnqEgIp2ASAAFjMmSN9AyM8gCsw2cDEDLsC+n9mHae7AQD6eyYd +7+XSACN9AyM8gCgw2fogSBWgCSUACYgC6DTZK1gEgABZpS0rMNn6ewYdr+UqAAAAihJZmXoofQMo +gPx4qRqKElmZduykAAPYEwAA6hICJdv1AABZppFkobnAov25pAWgOwUAWar2xy/RDwAa3MSLEuqi +xytgBIAAWaaIZa4nixErshILyVFokQpokgf5P/Cx0gCdAB7cxAO9AQ7dAo4RjBAt5hL8gqYVoAIF +ANEPihP6ASId4AzVAFjL89Kg0Q8AAAAA+iBoHaALRQBYzARkrFIa3KqLEtMP6qLFK2AEgABZpm7j +3LIdBWYAAIsRK7ISC+lRyJlokgf5P+1R0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPGtyZixLqos8r +YASAAFmmXmWtfosRK7ISC5lSaJEKaJIH+T/radIAnQAf3JyCEe+/AgPoDwAA7yYSJuoBAAAs0NnA +4Q7MAizU2fKCphXgAgUA0Q+KE/oBAh3gDNUAWMvF0qDRDyN9AyM8gCsw2cDBDLsCCwtH+nsmHe/f +ngAAABrceosS6qLHK2AEgABZpj5lrP+LESuyEgvpUWiRCmiSB/k/53HSAJ0AHdx9A7wBDcwCjREs +1hKLEPqCphXgAgUA0Q8AAAAAAPbgAEKwCwUA+qBoHaCMBQBZpFTBYOoSAirYBIAAWMwUKzDZBrsC ++n9mHae7AQD6eyYd792eAAAAI30DIzyAKzDZwMgMuwILC0f6eyYd790yAIoT+gDiHeAM1QBYy5TS +oNEPAIoT+gICHeAMxQBYy4/SoNEPihP6AUId4AzFAFjLi9Kg0Q+KE/oBIh3gDMUAWMuH0qDRD4oT ++gECHeAMxQBYy4LSoNEPAIoT+gJCHeAMxQBYy37SoNEPihP6AiId4AzFAFjLetKg0Q8AihP6AMId +4AzFAFjLddKg0Q+KE/oA4h3gDMUAWMtx0qDRD4oT+gDCHeAM1QBYy23SoNEPAABsEAQkIhBkQGwp +MBAqMBEsMBrrMBIszgKAAAqZAuowEyzOAoAAC5kC6zAZLM4CgAAKmQLqMBgkhREAAAiqEQuqAusw +Gy1WAoAADKoCCKoRC6oCsarqJhYkhI0AACkiEuvcHxTAKIAAC5sBKyYSLEAFLQqVfcFJwCDRDwAu +MBQvMBXoMBYvdgKAAA/uAu8wFy92AoAACO4CCO4RD+4C/ddgAFCNBQAvIhJ49yTApf24GAWgOwUA +WaorwCDRDwAAAAD6gGgdoAtlAFjmlMAg0Q8AjCcpyRSLyfmEABWvygUA6ogBBMkBAADpxRQl2wEA +AOvGCSRBAQAAeLsGLsEVq+ubyRjb+Nmw+AAIHaAPRQBt+gIJAmEc29+csIog/UAAFTAMRQAMqgKa +sSkwFCowFR7b7u8wFizOAoAACpkC6jAXLM4CgAAPmQLutgIszgKAAAqZAum2BCHAIQAA6AYABfhh +AAAPAIoqIhKJIg2qAuomEiz35gAA+kBoHaANNQAL4ABj/ukAbBAGJCIQL0Bu9eAG2JCcVQAc29WN +II42LzEL+GPwFaAKVQD4IAYVoDsFAFmp7RrbzyQiGCwxC4gsiUqFR/0AAEQwCwUA+EGGFaANBQDl +Ug4kkFaAAC1GHgqeAv6BRhWgACoAAAAAK0Ie61oIAdiBAABZo5AvQh4uMQuNQK/uLkYeKlAELFAF +GNu661AGLVYCgAAMqgLpUActVgKAAAuqAuzbtR0uAoAACVUCCFUB9KBgFe/4xQD4oAQCsDsFAP6g +aB3gClUAWanGKiITKTELK0IeqpnpJhMiwMEAAHixQcAg0Q8AAAAAACtABXyx8BzbovxACBXgCiUA +/oAIFaA7BQBZqbf6gGgdoA0lAPxMhh3gCxUAWOYgwCDRDwAAAAAAAB/blo5KD+4B7kYKKVAEgABY +42L6QGgdoAsFAPwAAh2gDSUAWAGJwCDRDwBsEAYc24wtIgAuMgX0QOgVp1UBAP6/wBXgCBUAD485 +9IKCFaAKVQD0IAYVoDsFAFmpmYkiZZCYJiAHF9tRBgZB6jIFK0cCgACniCuCniSsH/m2lgXkRB0A +dLN8KIKdCWsKK7K/C4gB7YQABAOpgAAc22kMAIdtSQIIAmGINB7bS57QiSAc203q1gMm2EEAAOzW +AizOAoAA6UkCAeCBAADp1gEpUASAAAuAAAxvEaf/5PadIpR1AACKJ/oBQh3gDAUA+0QAFaANpQBY +aVPSoNEPwCDRDwAAAAD//iwNoAgFAOokAApoBIAA+sMAFeAMBQBYcujAINEPAGwQBIcnKnkUH9tF ++OKkFe/NBQDocgglUAcAAOxyCyVSgQAA6pN3c9iBAAANuwGrmejBdHTJAQAALo0B6nUUJ1KBAADq +k3F8MASAAHmhfZp47wAFCzgEgAAHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEX2xSXYIUg +k2WUZPO2XgWgB6UA4mYCKq4CgAAHVQLlZgErEASAANEPwCDRDwAAAAAAAPeAaB2gCAUA+OFmFa/+ +cgAImgwKugwqrQEqrOD64QYVr/4iACy8QPzhBhWv/fYAAGwQBMePCFgDCDgCCEgDqGjoIggLgQqA +AAIiGKIy0Q8AbBAEBDgDCFgDqGjoIggLgQqAAAIiGKIy0Q8AAGwQBAQ4AwhYAQhIA6ho6CIIC4EK +gAACIhiiMtEPAAAAbBAEBUgDCDgBCFgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQjIhAoMAX4QkgV +4JQlAHSJSP8ooAMQjQUAeJ89cJ8Z6trzFL1YgAAKmgH6QkYVoAIFANEPAAAAAAD9tdwFoApVAPxg +CBXgOwUAWaj+KzBu0w9psQUsMAV0wQbAINEPAAAA+mBoHaANJQD8TIYd4AsVAFjlYsAg0Q8AjCcv +yRSLyf+EABWvyAUA6O4BB/kBAADvxRQl2wEAAOvGCSdxAQAAfrsGKcEVq5ubyRzaxtmw/AAIHaAK +RQBtqgIJAmEc2q2csIkgHtrB+//iHaAMRQDqtgQszgKAAAyZApmxKCISjyKesg2IAugmEi/7hgAA ++kBoHaANNQAL4ADAINEPbBAEE9q9AyIC0Q8AbBAGJiAHiCIc2oj0QggV4WYBAOWCe2tPAoAArJko +kp4a2oH3ABOK0gCdACSSnQpoCiiCvwhEAejakBIS6YAAJyISiin4QUgV4HdBAJcQCHcKJ3KA6pkM +A9jBAAD7IA+z4gCdACsgFigK/3ixEvpA8BWgDAUAWHHP7NpsFRGhgAArIQcd2nT5tTQF6rsBAO/a +dB3fAoAADbsCm0CIIPu1LAXgSgUA+oBmFaAGVQDvRgIsdgKAAAbuAp5BLSISjhAvIRr7tRgFot1R +AOruEQ7tgoAADe4CC+4C+wYADDHeMQCp3S3QgOhGBC/6AoAAn0YNfQzuRgcm6MEAAJ1FKiIViyn3 +QABFf+kFAOe7CAVQwQAA6iYVJdjBAADrJgkiUIEAAPiAC2xiAJ0AG9pkxJD6AAgd4A0FAAoCYQoC +YQoCYSlEIC1EJC1EJy1EJvyEph3vigUAKkQhL1IR/odmHej/HQD+h0Yd6P8dAP6HJh3o/x0AL0Q4 +LiIW/ofmHajuHQD+h8YdqO4dAP6Hph2o7h0ALkQ8ijQY2lrv2k0R8GEAAPVABhgQ+fUA7gYAAlCh +AAAKAIopRDAoRDH+hkYd7/71AC5EM4o0LUQj+obmHaj9HQD+hEYd6OodAP6Gxh2o7h0A/oamHaju +HQAuRDTrAAUCSQEAAAkCYSggBwgIQQyIEayIJoadKyAWLwr/f7EK+kDwFaA8BQBYcTyINGiAJ4on ++gCCHeAMBQD7RAAVoA1FAFhoJCsiEiz6fwy7AfpCRhXgAgUA0Q8e2i4tIhIO3QL8QkYV7/8uANog +WHF47NnzFXApgABgACuIXhnaIbGImF4JiAL4hmYdqPgdAP6GRh3o/x0A/oYmHej/HQD+hgYd7/ze +AMAg0Q8AAOtsGClQBIAA/AAiHaANVQBYcaTAINEPAOtsEilQBIAA/AAiHaANBQBYcZ7AINEPAGwQ +BCoiFCkiExzZ1f2zqAXnNQEA6pkMAZQdAABkkIAqIAcKCkEMqxGsuy6ynm7ieCuynQ2uCi7ivx/Z +6BjZ1/9gBAWwFAUA7tnRFYLxgAAtIQcNDUrvnwIO7wKAAA7dAh7Z952wjSCftZiylLMY2dH/pgAP +MAQlAO62BC7uAoAABN0CnbHoABUF2GEAAAsAigyvEaz/JPadLiIUqe4uJhRpMhDAINEPAACIIsqB +aDI1wCDRD4on+gAiHeAMBQD7RAAVoA0VAFhnzNKg0Q8AAAD7QwAV4AwVAPpAaB2gDSUAWHFkaTLJ +jCctyRSKyfuEABXvzgUA7rsBBuhBAADtxRQlU8EAAOrGCSXZAQAAe6sqL8EVGdmjqvqayZmgiCDz +s5AFoAkVAOKmAixGAoAACYgC+UAmFaACBQDRDxnZmZmgiCDzs34FoAkVAOKmAixGAoAACYgC+UAm +FaACBQDRDwBsEAYvIhgv8HQoCo548XkoIAXp2bUUA5mAABjZsiQiEghEASQmEo05KzELLiIRfZh+ +KSITq5kpJhPygAUeUgCdAGTgxiriDH2nPijiC/vAaB2gCwUA/AACHaANJQALgAArIhQqIhMZ2aEL +qgzs2aEVWQMAAHuTGPuCtg2gCQUA6SYRLJAEgADRD8Ag0Q8AAAD6QGgdoAsFAPwAAh2gDSUAW/9/ +wJDpJhEskASAANEPAP2zIgWgCiUA/kAIFaA7BQBZp5QqIhAtoAUuCpV+0bnA8v5Mhh3gCxUAWOP8 +wCDRDxzZho3g/8CwFaAKVQD0IAYVoDsFAFmnhygiEin6vwmIAfhCRhWv/W4AAADaIFjhOGP/TABs +EAguIhgq4HQoCo54oQ0pIAUY2XXs2XUcgEYAAMAg0Q8kIhIpIhEIRALkJhIiNPqAAI0siTYmMCAl +MQr+EWId7/jFAP0opg3ltgEAKiIQK6AFLAqVfLHEwNL8TIYd4AsVAFjj1cAg0Q8AAADkka5h0IEA +AImXiZ75JgAV4AtlAMAgbbkFCgCGCQJh0Q8FBU4lXNsIVQH/QBNUYDcVAAxEAqXY+EGGFaAqJQD0 +QkYVoC0VAP1iRg3gLFUAfLEKd7EH+2AkPSIAnQAvMDAqIhAlMDEpMDLooHAv/gKAAAX/AuUwMy/+ +AoAACf8C6P8RBEAZAADl/wIMAgqAAA8JGfUgH1ZVXwEACpgRCFUCGNj6KYJ+KIKQpZUp4HTpFgUq +rkKAAKWFJSYR/qCwFaCItQD5IBiVIgCdACkKmvnAGDxgmLUA+cAX/CCZZQD5wBe8YJiVAPnAHPUi +AJ0A/WAGvGAGRQD9YAZ8IgCdACgwQS4wQC8wPCkwPeQwPi92AoAA6O4CD/4CgAAJ/wIoMD/pMEIv +/gKAAAT/AuQwQy92AoAA6e4CD/4CgADo/wIPdgKAAATuAg/pDGqQISSiEn9BCAT4DGaAAi+mEi+i +E9MP0w9+8QgP6QxmkAIuphOKXAaqAppcfLFp92AK5GIAnQD9YBEEYgCdAMLC/WAY1CIAnQAtEBBk +3hiKVyk8IPtByBWgDjUAbeoFCSCGCgJjwCDRD4nnKzELiZ6/uwtLS+W+UmTIwQAAY/3nKjAjwOEK +6jkqVEEqFBB8sQf6QggVr/yCAC8wIX/3jy4wQSswQCwwPC8wPe0wPi3eAoAA7rsCDmYCgAAPzAIu +MD/vMEIuZgKAAA3MAu0wQy3eAoAA77sCDmYCgADuzAIN3gKAAA27Agy4DOoiECQEi4AALaISfNEI +Dc4MZuACLKYSLKITe8EIDL8MZvACK6YTKjA4KzA5iVzsMDotVgKAAAuqAuswOy1WAoAADKoC6NjD +HVYCgAALqgLmmQIFUAUAAComFplc+KFmFa/7/gAA+ABiHaOU4QD5H+x2YgCdACgwJCkwJeowJixG +AoAACYgC6TAnLEYCgAAKiAIIiBHpiAIC0BEAAPlNAAq/9X4AACkwIfEgEI4SAJ0AKjAkKzAl7DAm +LVYCgAALqgLrMCctVgKAAAyqAgiqEQuqAmWh5yswTCwwTe0wTi3eAoAADLsC7DBPLd4CgAANuwLq +IhAt3gKAAAy7AmS8sCyiGPuf5VPiAJ0AK1YSLjBIKDBJ6TBKL3YCgAAI7gLoMEsvdgKAAAnuAu/Y +ix92AoAACO4CLlYUKDA2LTA0KjA1/mbwFaAJBQDpVhUu7gKAAArdAulWEy7uAoAACN0C71YLLu4C +gAAO3QL8oaYV7/fKACgwOCkwOeowOixGAoAACYgC6TA7LEYCgAAKiAIIiBEJiALv2HEUQAUAACgm +Fv6hZhXv9vYAjxUc2G38oAgV4ApVAPQgBhWgOwUAWaZpLSIS+kIIFaBOBQAO3QItJhIuMEErMEAs +MDwvMD3tMD4t3gKAAO67Ag5mAoAAD8wCLjA/7zBCLmYCgAANzALtMEMt3gKAAO+7Ag5mAoAA7swC +Dd4CgAANuwIMuQz3P9sAEgCdAC2iEnzRCA3PDGbwAiymEiyiE/uf2jRiAJ0ADLgMZos7+0JmFeAC +BQDRDwD/8HANr/X1AOzYQx9oBIAA/qAIFaAKJQD2IAYVoDsFAFmmPGP7OQAAKjA4KzA57DA6LVYC +gAALqgLrMDstVgKAAAyqAgiqEQuqAunYMxVQBQAAKiYW+KFmFe/y/gAAAAD1wGgd4AsFAPpCJhXv +8rIAKiIQY/rsAABsEAYrIgckIAcPAgAouRQFDUf1YcgV4UQBAOOyCSQU0YAA+aAWkVIAnQAc2B6I +IP9gSBWgClUA/b/AFeAJFQDtnTkJeASAAPggBhWgOwUAWaYTHNgV/GAQFeAKVQD+ShAVoDsFAFmm +DRfXx+zXxxowBIAA9IASShIAnQAMSRGsmSqSng8CAPdAFDJSAJ0AKZKdB0oKKqK/CpkBZJJoLyAH +FNfIKiBA/bACBeHvAQDn2AAfdAKAAPVAEbCQ/xEA9UAPcRIAnQD1YA8ykgCdAMCwKCEIKiEHCv8Q +/wYADDqqAQDniAINVwKAAA+qAg2qApqQjiCYlJeW9SBGFaA/BQD/IGYV4AQFAPUgphWgDUUA5JYH +L3YCgAD9xgAPcA8lAO6WAS32AoAA7+4CBNCBAAADIIYKAmMDAIYKAmH/ISYVr5t1AOUTHgTJAQAA +CQJpBWCGCQJnBUCGCQJl9a+sBe+aZQDoIhIrTwKAAKyZ7ZadITkhAAD3AAXUb2lFACYiEqlmI2Io +K2SBLGInnDAoYicvYiuTgSRmJyRmKCNSi+pkgSf8rIAAK2IxLjImC4pE+1oADTAMBQD/QAEFMA0V +APtACBWvu4EAWGUcJGYxKGImK2IfJGYr/wQAFe/JBQAJ/wHkhRQn+QEAAJ+Jn4guUnP6YigVoAwF +AP9vAA2wDRUAWGUO/kJIFe+aZQD8YkgV75t1AP4AIh2vaUUA9+8AD/AMBQDv7DgG6/0AAO02EiZ6 +cYAAiCwrJAUjUovqJAUkfLSAACsiEi4yJtMPC4pE+1oADTAMBQD/QAEFMA0VAPtACBWvu4EAWGT0 +JCYSiCeLIJQs/wQAFe/JBQAJ/wHkhRQn+QEAAC+GCS+GCC5Sc/piKBWgDAUA/28ADbANFQBYZOYq +MhKwqvpiRhWgAgUA0Q8A+qBQFe/4cgD/9ZgNoAMFABvXL4q4aqFPDGkRrJktkp5u1F4pkp0HbQot +0r8NmQFkkFGwrp64ZZ2zYAAZAAAAAPoQQh3v93IALyBACP8Q/mAGFe/0ogCIIsuFwCDRDwAA//YY +DaAJBQDAoFmh/hvXF4q47NcZFQ6LAAD//uANoAkFAMCQwNoNrTT9YQYV7/6mAI8w60wYKVAEgAD/ +rrYFp//BAP5IBh3gDBUA/mAGFaANRQBYbs7AINEPAABsEAaJJyMgByiZFAMDQeeSCSQLkYAABQhH ++QANUVIAnQAqIEEV1v32AIIdoAQFAPFaLA3gDAUAG9b5DDoR9GAKWhIAnQCrqi2invegELOiAJ0A +KaKdBT0KLdK/DZkB6pQABI2BgAAuIEHsFgAvDn4AABjW+B/XMy4hByUgBxnXMfxBBBXq7gEA9CAA +AnBVEQDqVRAPdwKAAOXuAgokAoAABN0CCd0CD+4CnqCPIJ2k+UBGFaAEBQCUpZSn+UDGFeA1BQCV +o/3gABewBUUA5f8CDnYCgADl1xwVSIEAAP9AJhXgDyUAByCGCQJjBwCGCQJhD+4CnqkMPREL3Qgm +1p3+QYgV75l1ACkkBfKxaBXvmGUA6CQFJ/ysgAArIhIuMiYLikT7WgANMAwFAP9AAQUwDRUA+0AI +Fa+7gQBYZGQkJhKIJ4sglCz/BAAV78kFAAn/AeSFFCf5AQAAn4mfiC5Sc/piKBWgDAUA/28ADbAN +FQBYZFYqMhKwqvpiRhWgAgUA0Q8A//o4DaAHBQAe1qGN6PegBriSAJ0ADDoRq6ovop734AdrogCd +ACqinQU/Ci/yvw+qAeSg22bD/QAAmOj5QGgd7/puACogQAiqEPrgBhWv+UIAiJ4kgAQrgAUW1rjq +gAYqJgKAAAtEAuiAByomAoAACkQCCEQRCEQCBkQBJkxn9o4ACzCMlQD2wIAVr/imAIlw7WQACVAE +gAD5rZoFp5nBAOkkQCHYYQAA+OAGFaAMFQBYbj7AINEPAO1EAAJhIQAA60xnKXAEgAD+4Ggd5Lsd +AFmkkRvWcfwgCBWv+E4AAAD/99gNoAkFAPwgBhWgCgUAWaFMHtZmjegb1miMEPm/+KCSAJ0A//zI +DaAKBQAAwKDA+g/fNP/BBhXv/IoAAAAAbBAEKSIHIyAHKJkUAwNB55IJJArpgAAU1lf3rK4Fp4UB +APkADBFSAJ0A9GAKUhIAnQAMOREGmQgqkp73QA1KUgCdACmSnQQ6CiqivwqZAWSRYyogByghBx/W +VhvWkPlAAAQwyhEA6swQDEcCgAAMiAILiAKYkIwg/yBGFeA+BQD/IGYVoA1FAO7Whh5mAoAADcwC +nJErIEH8QQQVoAQFAP8gxhWh+gEA5JYFL/wCgADvzAIE0IEAAO7MAg2JJgAAwLCUl/0ghhWgBSUA +ByCGCgJjBwCGCgJhCL8RBf8CFdZxn5kMPhGm7i3mnfhBiBWvnHUALCQF8rFoFe+aZQDqJAUkfKyA +ACsiEi4yJguKRPtaAA0wDAUA/0ABBTANFQD7QAgVr7uBAFhjwCQmEogniyCULP8EABXvyQUACf8B +5IUUJ/kBAACfiZ+ILlJz+mIoFaAMBQD/bwANsA0VAFhjsioyErCq+mJGFaACBQDRDwD/+owNoAcF +ABXV/YpYaqFvDDkRppkrkp5utHYpkp0EOworsr8LmQHkkGllY/0AAJxYZZ6tYAAOAC0gQAjdEPzg +BhXv+eIAj3DrPBgpUASAAP+seAWn/8EA/kgGHeAMFQD+4AYVoA1FAFhtrMAg0Q8A+hEiHe/7egD/ ++YwNoAkFAMCgWaDEilhroYX//owNoAkFAMCQwIoIqDT4oQYVr/5SAAAAAGwQBIoqjq8Y1iboJgsh +SIEAAOnmACV44QAA7yYIKVgEgAD+QSYVoAwFAPlB5hXvmIUA+ECmHaANJQBYbdXAINEPAAAAbBAE +G9YXKjEMK7J/HNX6+GIQFeAUZQD7Q9YN4AUFAHyhFuokAArYBIAA7DQACmgEgABY38zAINEPaJFI +aJIoaJQKwED//2gNoAUFAAB8odF7q87aMFjf+NWg//8QDaAEBQAAAAAAAAD9QOYNoBRlAHujAmAA +AcBA2jBY4A3//oQNoAUFANowWOAf5aQABQERgAD9q+gFoApVAPxgKBXgOwUAWaPk//3kDaAEBQAA +AAD//bgNoATFAGwQBCkwE/EmsA3g9YUAaJEEwCDRDwCEJ4ROHNXl7TARIkgPAAD9P4Yd4ApVAO4w +EiJAEwAA/xumHaA7BQBZo8/rPBgiUBMAAOwwESVT9QAAWOAt5TsIAlAXAADsMBIlU3kAAFjgKeok +AApYBIAAWOGuwCDRD4QnDwIAhE4c1c4tMBEtRAL+YlAVoApVAP6AZh2gOwUAWaO56zwYIlALAADs +MBElUyEAAFjgF+U7CAJQDwAA7DASJVKhAABY4BPAINEPAABsEAT0QGAl6LMdACNUV/qqxh3gRDUA +9KqmHaAIdQD4qoYdoAkFAPiqZh3gSgUAKlRS0Q8AbBAEjzj9q1wFoApVAPxiEBXgOwUA/+BoHaH/ +8QBZo5kpMBDq1agUjJEAAGiSWWmUEog2IqJ/CYgRqCIoIAUpCpV5gV7AINEPAAAA2jBY4jb/XwAN +4Al1AIuni74sso4MnVb9I0Ad6Oy5AMDTftAQ+2BAJeAMBQBY4gLAINEPAABY4WvAINEPAIs2KqJ/ +CbsR+0AARXALBQBY4OrAINEPAAAAAMCl/asQBaA7BQBZo3X6QGgdoAslAFjf4MAg0Q8AbBAEiC4j +LDhziQXAINEPAACLLoiz7EQACugEgADrvOApUASAAAuAAIwi7SAFLn7uAABk39WOLnPp1mP/zQAA +AGwQFiUWF4c1JjEPKyAHiDTjFhoqSASAAJkc/iNIFeAKFQCaH/uq1AWgyFkA/CNmFaG7AQD6IsYV +4/71APtPxBWgtnkA+iJmFeB3+QD547AV7EgdAPqPAA0wOFEA+CAGHe+qAQDqFhQkVFaAAAYMSfwh +xhWgADIAAAAAAAAAnh4uEhco8T0oFhIv8h/+IgYV5+4BAC4WFfXAPCESAJ0AiiL7QEGgkgCdAPDl +YA3gDQUA7RYRI4BJgADaQFjqXfQAAh3gBgUALxIb2nD+AGIdoAwlAO/sOQnYBIAAWOpF90AAQzAI +9QB2gFX0IWYVpJYdAOMWCiTIBQAA+CMGFeABPgAAACoSEmSnYysSGou1fbaf+iJIFeAMFQDsFhEq +UASAAOwSECjoBIAAWOpyZqeR/ABiHeAFBQAK1TpkV3vDYJQb8iFGFeTmHQAuFhgoEhYc1MUe1Mbj +1MccIASAAPUACTISAJ0A6hIYLDcCgACjZiling6ICiiCv/sgQOuiAJ0AJmKdCGYB22DmtAAFvXmA +AI/ImxX34D3gkgCdACkyrurVDBS7eYAALjKtLaJj7esBB9P9AAD9wDreYgCdAJrI/cA69mIAnQCN +HCwgFNMPrcwMDEcsJBT1gDx+UgCdAC4SGykSFPHAwA3gCDUA+QA9iOIAnQBkUM6KGg8CAMihZFBj +62QACVAEgAD8AGIdoB2FAFjqZu4SDi14BIAA5hILIq+ZgAAc1OwtEhP5qToF4AoFAJrymvOa9Jr1 +6WkCD0QCgADp9gAu6IKAAOjdAgr2woAA/6YADrAbxQD94CYV4ApVAFmiyCsSFflgOClSAJ0AwCDs +EhgqbwKAAKPdLNad0Q8AAAAAAACPyPfgOOCSAJ0A6RIYKjcCgACjZihinvkAOTviAJ0AK2KdDk0K +LdK/DbsB5rQABbjZgACw/p7I+sBoHe/7GgAvEhHTD2Twd+sSBSlQBIAA/ABiHaAdhQBY6jMZ1L4W +1LuOGygQACZinAnuAhnUkAgfFOaGCw/7AoAA6f8CBHyggAAsEhDtEhIjW/8AACiyPyuxfZ6gn6Gd +opyjm6T5QKYVoAByAAAsEhAtEhIrYQWIY56gn6GbopijnaScpSasGC0SE4weAt0Q7RYHLmQCgADs +Fggrpv4AABrUUPghaBWgDwUA/iDGFeAPJQCfHQqIAigWCetkAAlQBIAA/ABiHaAdhQBY6giNGS8S +GokWKxIaj/XxNdAN4/71ABzUj4u0/0BGFaCPmQD9QAYV4G+JAP1AJhWg36EA8NAAEzDPkQDu1Ice +6UKAAO6mAyxBAoAA/QYADHm7AQDrpgQuYMKAAAxmAghmAiamBSwSDemcASUwYQAA6RYGJmP9AADs +Fg0ue6YAAOtkAAlQBIAA/ABiHaAdhQBY6eQW1HKJF48Y+iEoFeANBQCdEZ0SnROdFJ2k/UCmFe/+ +9QCeop6jm6AuEhrp/wIKxsKAAOj/AgDgMQAA5v8CANghAADtHBAlMGEAAO+mASDQEQAAWOi0+UBo +HeAMFQDqyTkNKASAAOkWHiUgCYAAJBYf/gAiHaANBQAJ7TjlFiAm6uGAABPUUogYjBca1FErEhuE +GxXUIfF4ABSwDhUA6+s5CieCgAD0hgAKdg8FAAuvOf0mAAywDTUA+SYADDAMJQAL3DksFh0J+QIp +Fhn55gAPsAUFAP4jhhXgAwoAAA9WUP4YAAXwz8kA/CEoFeCPsQD9QAYV4O95AOzuEQxEAoAA68wQ +DdqCgADsuwILM8KAAPjGAAswz4EA/YgAFjGPaQDs7gIMRQKAAAjuAhzT+5yhKBAABu4C+8YAD3Bv +uQD0yAATO78BAPfGAA8wBiUA5u4CDd0CgADupgQsQgKAAAuIApilG9Qcm6IY1Bz5QGYVr/mOAJmh +lKCeop6jnqSepZ2mnaedqJ2pLxId5VwBJTChAAD+oBGcYgCdAOtkAAlQBIAA/ACCHaAthQBY6Xnk +UFFqzsKAAPSgCmCSAJ0AKxIcx+/7JgAM8A0FAOOZAgv9LgAAjRMsEhqOEo8Ri8wswhCZoZup9UAG +FaAIBQCYopimn6OepJ2nnKWMFP1BBhWv/iYALRIbLBIZG9P1DJkC65kCBoQZgADw4kAN7/71AJmh +lKCeop6jnqT/QKYVoA0FAJ2mnaedqP1BJhXv/TYALxIaIhYhK/IWJvE4IvE6LPIV6PE5KzQCgAAG +IgIm8Tst8hvu8hosRAKAAAhmAijyFy/yGZ+inqOdpJymm6eYqJalmaGUoJKp8iQoFa/79gAAAAAA +AAAA8OJADe/79QCZoZSgm6Kbo5uk+0CmFeAIBQCYppinmKj5QSYVr/s6ACwSGo0SL8E7JsE5KME4 +LsE668IYKzQCgADm/wIMRAKAAAjuAibCFIjMLMIQm6SYp5aomaGdopSgnKOfpZ6pjBT9QMYVr/oa +ACsSG+wSGSWDUYAAG9Ozx+/9JgAMsA0FAOuZAgOA8YAAmaGUoJ6inqOepJ6lnaadp52o/UEmFe/5 +MgAuEhoiFiEt4hIs4hMr4hiI7YbuL+IUgu8u4hGeop2jnKSbpZimlqefqZmhlKCSqPIkKBWv+FYA +KxIcx9/7JgAM8AwFAOOZAgOA8YAAmaGUoJ2inaOdpJ2lnKacp5yo/UEmFa/3mgCZoZSgjhP+ICgV +4AgFAJiimKOYpJimmKeYqJ+l/0EmFa/3CgAqEhoZ04WKpRPTISUSIOQSHyVMMIAA49MdE4O5gAAc +03+LGwy7Avs/RhXv56IAhR/A0vetAAr/6CYAwKX9pvIFoBvFAO5OEQpoBIAAWaFUY/hnAAD6IogV +oA4FAJ4RnhKeE54UWOe4JBYf5RYgJWJhgAD6IogVoAsFAFjnqyQWH/QkBhXv8NoALxIQZfiVY/g6 +GtM9iBsKiAL5P0YVr+XWAMCgWVscyKcb018rsIBksFoqEhRY56TpEh4tX04AAPoiiBWgCxUAWOeY ++CPIFe/vWgAAAP/gJA2gNgUA6xISKlAEgADsEhAo6ASAAFjoZ2P4VwAAKxIajBztEhcpUASAAFhn +UNKg0Q8AAAAA+6aOBaFLFQBZjB4sGgAMrAL7poQFoUsVAFmMHmP/hQAAwLDA2g39NO3GCC3FVgAA ++kBoHaAbxQD8AAIdoA0VAFhqlGP/oQAAAAArEhb6QGgdoAwFAO0SGCXYYQAAWGqNY/+EwKBZnakc +0sOPyPn/wdCSAJ0AY/+32iBb7ANj+GyKJ40cwMDqrCAu2ASAAFhg4tKg6xIYKmcCgACjzCvGndEP +AAAAAAAA/9+kDaAGBQD/4UgNoAVFAMCgWZ2UHNKtj8ge0q75/8a4kgCdAP/j8A2gBgUAAAAA/+OU +DaALBQDA2g39NP2BBhXv45IAAAAAbBAEFNLugiAkQn8T0wkEIgwDIgLRDwAAbBAMGtKfGNMFKaKQ +KqKHKIB9CaoR6pkIBHxAgAAknQH0kAAVoAAuAAAknQMkTIAZ0scoQSn5AAgsYgCdABrSs+oABQjI +BIAACQJhCQJhCQJhCQJhGdL0GNLSH9LxjiCfEvggxhWgCkUA6RYAL3YCgAAK6gKaESlABy9BKf2l +1gWhmQEA4+4CDMwCgAAJ/wII/wKfFCsgOf4hZhWgDSUAnRkMuwLrFggoBAqAAPRgBNGSAJ0AiUcq +mRTkoINk4IEAAI2Zi8D/+AIdoCWFAO7OAQaCOYAAbQgufbE8L9AAKdAHdfEzL8EF7vgIDM8CgADp +3QgEQQEAAOjbFX7QBIAA7aQABQCpgABj/8oAAAAAAAD/rwANf/+uAP1vAA1wCQUACp045tQADoGm +AADqRAAI2ASAAPwAgh2gDSUAWFxs0Q///fwNoA0FAAAAKhw6+kdAFeAMZQBZmkJj/1jCdo5o+gCi +HaA7BQDs0rEbaASAAP5HMBXj7gEAWaCFimgKj1d38W2KRy6hFftEABWvywUAC6sBq+vranBzaQEA +AO+iACaBgYAAffEoLNAA0w8PAgB1wR0p0AcMmRHp3QgFwQEAAOjbJH7QBIAA7aQADX7GAAD97wAN +8AoFAAutOObUAAb6YYAAY/92AAD/rwANP/9yACwgOQoNQ33JiI4gCO4RDj4CnmvRDwAAAP+vAA6/ +/kIAbBAEGNKHKYJ/KjAHLZECLpEE/SCkFaAPBQDrkgAmiSmAAO7s/yaT/QAA4pUCL3cCgADuuwgO +ZwKAAP1vAA2wAMYAK5EFLZEEsbv/v+AVr7sBAOuVBS93AoAA/WAG1GIAnQCMkO7MCA3fAoAAC8sM +CwCHD99g6wAHBvMngAAe0mkpkQUr4n8JmRGp2e3ifSWGKYAAjNGL0JvAi9CcsZ/Qn9Er4n+wuyvm +f/WgBjQfuQEAjNn5owAVr8kFAPkABAR/EgUAAtIIKyY6/6IEHeVJBQDp1REkIQEAAOTWBy0vAoAA +5NYGKlgEgAD1gATcIgCdACXVEOhYCAR4GwAA7IxAJ/oBAAD94ARbogCdAMky6UQABQCBgABtqQUD +AIYJAmErIkKrWP8ABYRiAJ0A6CZCJpPhAADRDwAAL5UF//yMDaALBQDApf2kcAWgOyUAWaALwCDR +Dy3igIzRi9CbwIvQnLGf0J/RK+KCsLv70EYV7/zuAADAwPsP6BWgDRUAWF9mwCDRDwAAAADv1gkm +k+EAANEPAMsw+mBoHeBcxQDsrDYKcASAAG3JBQsghg4CY/hgAEXwXkUAfqENL6ys0w9t+QULQIYE +AmUpjfvpJkImk+EAANEPAAAAAOQmQiaT4QAA0Q8AAAAAAABsEAwoIASMJ+QgBypQBIAA6hYKKTAE +gAD9gcgVoBnFAPkAGiRhRAEAiCLq0gYcA74AACsgUy0gFgu7CewWCC3fAoAAq6oqon+aGfRgGBGQ +/vUA9GAX0hBXBQB+0RgFC0f7f8AV4A8VAOv7OQlQBIAAWPztZKNn2iDrfB8r4ASAAPYhZhWkux0A +6xYNKmgEgABY/LHmpAANApYAAIwi0w8PAgBkwyKNGh/R6I4gkxKfEP3AABcwDyUAD+4C7hYBJoCJ +gADb0PohgBWgDGUAWZlm6iQACNgEgAD8oGgd4AwlAFhl1dKg0Q8AAIobjBn7o64F4A8FAPtE0BWg +3DkA/sFEHeLsQQDo7hEO7UKAAP+mAA62zAEA7cwCDVQCgAAMqgILqgKaZPRgEjmSAJ0A9GAR+hIA +nQDEsCtlCx3RxSkhGRjRxZ1m+yAAF7vJAQDo/wIGAHmAAAneFATuEQ6uAp5kn2b0YBJpEgCdAPRg +EioSAJ0AHtG56eECIOhhAADp1QIjUIEAAP/ACBWgDGUA7tYALtgEgABZmTQc0UEe0bDqbCYheQEA +AO8WDCms0AAALyBBLSBALWQmL2QnKyBDKiBCKmQoK2QpKCBFKSBEKWQq+MVmHaAAvgAAAAAAAAAA +jBsswCYb0S4MzAkMzBGsuyu9IPtzQBXgDGUAWZkbHtGYHNEnI2QzGtGW+sWmHaCJlQD4xYYd4BgF +APjFxh2gDwUA/sYGHeANVQAtZDH0YAmJkgCdAPRgCUoSAJ0AwKoqZDX6IWgV4A8lAC9kOP7HJh3g +DQUA/MbmHeANBQD8xsYd6PodAC9kNCuwJgu7CQy7EevLCANQ6QAA/2AARbAMZQBZmPoqbET6RwAV +4Ak1APjIJh3gCEUA+MgGHaAMhQBZmPLAtfrJph3gCrUA+smGHaAMZQDrEgwjUTkAAFmY6ypsWPpJ +ABXgDIUAWZjnKmxV+k0AFeAMNQBZmOTqEg0oBAqAAPRgBLGSAJ0A9GAEchIAnQAf0VwMThEP7gia +4CwgFi0K/33BCut88ClQBIAAWPwNihiLoYmgBQhH55kIBdgFAADrpgEky9EAAOmmACQUrQAAiif6 +AEId4AwFAPtEABWgDSUAWF710qDRDwAAAAAAAPYfAh3v9BoAwCDRDwAAAAD/+2QNoDpFAPZBCBWv +8vIAKwro+sFkHe/3DgAe0Tv8wCAl4An1APjMBh3gK5UA+swmHeAPZQD/oIYd4AgVACjUBf+g5h2g +DIUA/aDGHa/9EgAAAIsa+sQAFaAMZQBZmKpj/dQAAAAAAOokAAJYYQAA/CGoFeAMFQBYaG5j/MaM +ImXMwSsgU/pAaB2gDBUA+2JAFeANBQBYaGdj/KhsEAYoIAUsIAfBlPkAEG1hzAEAiSJlkcMtMAEb +0Jnm0JkeOASAAP+hQAbQD6UALiBOZeJX7tCRHk8CgAD1gArSEgCdAKaZKJKenBALywr3ABGU0gCd +ACuyvyqSnQurAesWASWOSYAAiuj3QA64kgCdAChiru3QhRQL+YAALGKtLdJ/7csBBUP9AAD9gAte +YgCdAJjo/YALZmIAnQApIBSkmQkJRykkFPUgDXXSAJ0AHtCBG9B7jCD4ICgV4AoFACq2Mu7MAg5u +AoAA/WcGFaAORQAO3QIttjEb0ObckOsPHg3QBIAADAJnC0CGDAJlCyCGDAJjCwCG7AwABNkBAAAK +4IYLAm8KwIYLAm0KoIYLAmsKgIYLAmkuMQEoIQktIAcsMAEb0NQqIST8IAAGMN0RAOrdEA5kAoAA +DcwCDKoCHdDOLCEiC6oCKpYgDcwCiyAd0GIoliMuliQsliL9YAAVsAwlAAy7AiuWIYoz6pYlJMgH +AADtABUEymEAAAkAigx4EaaI/xOmFeflAQD5wAa5UgCdAMAg0Q8AAIro90AH4JIAnQAMeRGmmS2S +ngt7Ciuyv/egCGTSAJ0ALZKdC9sBZLEAsK2d6OsWAS305gAA/CAGFaABZgAAAAAAAOokAAnYBIAA +7EQACugEgABYZJPSoNEPAAAAAMCwD6k06eYILfTmAAD6QGgdoBvFAPwAIh2gDRUAWGfgY//BAADq +JAAK2ASAAFhmFNKg0Q8AixD6QGgdoAwVAPtjABXgDaUAWGfWY/+XwKBZmvIe0AuK6Plf8PiQD6UA +Y/+q2iBb6Uz/+TQNoA+lAACKJ+tEAApoBIAA+0QAFaAMBQBYXijSoNEPAAAAAP/3XA2gCwUAwLgL +mwL6QEYV7/0eAAAAAPwgBhWgCgUAWZraHs/0iuiMEBvP9Plf93iQD6UA//woDaALBQAAwLAPrTT9 +wQYV7/vyAABsEAYSz+wX0Gn1n+IFoBOVAPhQyBWgpiUAKiKCf6cgKyKCf7cYKiKELKAIJaAHdsE3 +iETAoAuAAAUzDGU/2tEPLSKEKSKHKiKH+WAABPuqgQB6mS8K6jArQkHDwgy7KKuq+pmGFa/+6gAu +oQsu7PgODkPu7Pwi6/0AAP+iAAq//s4AAAAMAgAvIoJ//8Yl0AduW8DccPoAoh2gCwUA/qAAFzD/ +BQBZngglXPHKWygKcZgRwKFZk2/6ICgV4An1AAlZNpkQCbsM+iAmFeAKBQBZesiKEApVDGVf18Ch +WZNl+g4iHeAKBQBZesJj/2YAAABsEAYoIAUmIAfnNAAK2ASAAPgCgh3gBTUA+QAPnWFmAQALCEdo +ghSKIhjPpRfPpuRkAAUDyYAAwCDRDwArIh1lseGIJ4OI+wKkFe/MBQDpggskcIEAAAzsAey7CAp/ +AoAA7BYAJdkBAADzIA38YgCdAC2JFKP6r90thRT7YA3rogCdAMl1yUPZMG1JBQcAhgkCYYrgDwIA +DwIAr6r7QBCsYgCdAPvABhWv/f4A7GoRAyTxAAAHqggrop4PAgD3YArZ0gCdACqinQhrCiuyvwuq +AWWgT+tsGClQBIAA/AAiHaANNQBYZzzAINEPABvPc4m49yAMoJIAnQAMShEHqggsop73gA0B0gCd +ACqinQhMCizCvwyqAeShjmTr/QAALbYIZK+vGc+JmaCIIP+fygXgCxUA66YCLEYCgAAFiAKYoYgz +L/J//57oBaiIHQCo/5+j7gAVBUhBAAD/ntAF4AgFALGI6YMeDA/oAACfphnP1flBBhXgGAUAmKeO +IAjuEQXuAp6pDE0Rp90l1p2OIiwgBoknC+4C68/MFmAFAADsJAYkyIEAAIiR/SCCFe/MBQAMnAHu +JgIkQ0EAAOiWASbowQAA7ZUEJmEBAAB8iyIqkQUdz0yoqJiRnYCMIOuGAi5mAoAABcwC/QAmFaAC +BQDRDx3PRJ2AjCAbz7TrhgIuZgKAAAXMAv0AJhWgAgUA0Q/aIFhlKdKg0Q8AAAD/+sQNoAoFAFv/ +OmP+FwAA8yBoHeAOBQD/AWYVr/e+AOO6DAOBuYAACksU7LwIK8AEgADsTDYJyASAANMPbckFCACG +CQJhiRCqeOtNDATJAQAAbdkFCCCGCQJjixAK/Aysuyu8QPvABhXv9ooAwKBZmfEbzwqJuBjPC/k/ +8viSAJ0A//n8DaAKBQDAoMDaDZ00/WEGFe/5wgCPEC/8QP/ABhXv9aYAAABsEAyIJ/hASBXvygUA +64EVKmcCgADsPAgEQIEAAAqIAai46IxALngEgAD5gCQSogCdAC3wBysgBxbO8uzc/i+oBIAA+6Bg +FeH7AQDkkAlvxwKAAMAg0Q8A5o0IBsgZAAAo0p4ezuTrFgEv0ASAAPkAIjPiAJ0AG87hKdKdC/sK +K7K/C5kB55QABKG5gACN6Joc0w/3oCJIkgCdAC9iruvPWhee4YAALmKtL7LjD+gB6BYJJsv9AAD/ +wB4+YgCdABjOzZmI/8AeZmIAnQAtIBQpUAetmfohhhWnmQEAKSQU9SAg7dIAnQAZzw8fz0jqIgAt +bwKAAIg0Hs7Q5t0IDVYCgADxAAUCUgCdACggByshJPygJBWgFIUAlHP+4EYVoAQ1AASjAvudtgWg +iBEA43YBLEKCgAD5BgAMcAMFAPjgBhWgCCUA6gAFA9BBAABtigIKAmEuIQkpIAfy4KYV4DilAOx2 +CS91AoAA+cYADzHJAQDudgYuZAKAAAy8Ag/MApx0KyEJ2iD+oCQVoAwFAOTWnS3dAoAA+WYADbAN +BQBYZITAINEPAIYnKGEV6BYDIzCBAAD2IMYVr8kFAAlmAaaI71wgJEEBAAB48wSIEwj/DOnyACZA +BQAACKgCmBf4+AAE8IgVAHiZHB/PCogX6HYBJkv9AAD+4AYV4ZkdAPjgRhXgAFIAiRcYzwOYcJlx +ifEJWRSZco8WiTYbzv+WEPngpBWimR0AC5kBG873mBSmiCuyHe/yASRBAQAAKBYKCbsI63YDIkgJ +AADrzu8czwKAAAn/CCkWCAxJCOYSCCTICQAA6PMKfM8CgAAoEgQI/wzmmQwDwEEAAOSQTG43AoAA +mBWIGg9pCPkADuriAJ0AKRIFD4oM+iBGFaSqHQBtqQUPAIYJAmGIEikSAArPDAeICOmcQCRQQQAA +bfkFCSCGCgJjKiIACKoRGM7S9uAARLAPFQD/IMYV4AxFAAyqApqVmJSIUy+yGxbOzf2ctAWoiB0A +qP+fl/wAChWgCgUA7M7JFNiBAACxquuDHg0P6AAA/yFGFaAoBQCYm480iFOKNQb/ARbOv+yqAQxC +QoAACP8CBv8Cn5woUAkrUAsvUAomUAjszrkd2QKAAOb/EAxDAoAA+wYADDCmMQDr/wINUcKAAAr/ +Agj/Aoo2GM5On53+YUgV5bYdAOyqAQ3YQoAAC6oC+yHGFaRmAQDo/wELMgKAAAb/AohVmJ+GViaW +EIxXL5YSLJYRi1QrlhMqUAEvUQHrzlwYBAqAAPFABDfSAJ0AKiAHCipA7CEkLVKCgAALqgIqlhSI +IPoDAh3gCjUA65YXLEYCgAAKiAIazir/IsYVoAsFAPkiphWgCCUA6gAFBNGBAABtigIKAmEoIQku +IAf7AAAUMBqlAAqIAiiWGvmc9gWh7gEAAO4RDs4CCO4CiBErlhkvlh3ulhgkQA0AACgWAY4RLtad +LVAHiif1oABGsAwFAOvUAAVQgQAAWFwO0qDRDwAAAADpEgUmcuGAANMPbckFD0CGCQJlY/5DwPCf +GYgZH83cwJoJ2TTp9ggsYeYAAPpAaB2gG8UA/AAiHaANFQBYZZvAINEPAAAAAAD7jwAP/+36AP/v +JA2gCQUAjRHr/BgpUASAAP2gYBXgDBUAWGWQwCDRDwAAAAAAAAD8IWYVoAoFAFmYqB7Nwo3oihyM +G/m/3RiSAJ0AY/+UAJwb6xIJKVAEgABb5v+KHPwhaBWv71IAAGwQBikgBSYgB9gw9gBiHeAaRQD7 +IA/NIWYBAAUJR/0jAAFfxQUAiyIZza8Tza/kZAAFg7GAAMAg0Q+IJ4uILoEV6YILJHiBAAAF+gHq +7ggKbwKAAOoWACdxAQAA+yAORGIAnQAsiRSdEavarcwshRT7wA4jogCdAMk0yULZsG1JBQMAhgkC +YSwSASryAAyqCP9AESQiAJ0AmvDTsPhgaB2v/hoAAAAAAOxqEQMk/QAAA6oILaKeCWsKK7K/96AL +AdIAnQAqop0PAgALqgFloE/rbBgpUASAAPwAIh2gDTUAWGVGwCDRDwAAAAAdzXyL2JgS92AMkJIA +nQAMShGjqiyinveADRHSAJ0AKqKdCUwKLMK/DKoBZKGQsL6e2GSvrx7Nk56gjSD9m94FoAsVAOum +Ai7uAoAAB90CnaGJgyjCf/+a/AXomR0AqYiYo+8AFQVIQQAA/5rkBeAIBQCxiOmDHgwP6AAAn6YZ +zd/5QQYV4BgFAJinjiAI7hEH7gKeqekiBypvAoAAo90n1p0sIAbtIgIkyIEAAOWfAQZgBQAALCQG +iJEsmQQL3QLtJgIkQ0EAAOiWASZgwQAA7JUEJ/kBAAD/BTIN4AwFACqRBR3NVqiomJGdgIsg7IYC +Ld4CgAAHuwL7ACYV4AIFANEPAAAdzU6dgIsgwMDshgIt3gKAAAe7AvsAJhXgAgUA0Q8AAOokAArY +BIAAWGMw0qDRDwD/+qQNoAoFAPMgaB3gDgUA/wFmFa/5ogDr6gwBgbmAAApNFOzcCCnABIAA7Ew2 +DcgEgADTD23JBQgAhgkCYYkQqjjtTgwEyQEAAG3pBQgghgkCY40RjBAK3QytzCzMQP3gBhWv+F4A +AMCgWZf6Hc0Ti9iIEhnNFPl/8viSAJ0A//noDaAKBQAAwKDA6g6+NP+hBhWv+aoAAIgQKIxA+eAG +Fa/3ZgAAAABsEAQVzRMWzQ3wiAATsAlFAOTNfhnGAoAACYgCKGYxBTUC52YyKhgEgADlZjgpMASA +AANghgYCZwNAhgYCZQMghgYCYwMAhuYMAAEZAQAAIi0B5B8eARIBAAADAm8EwIYDAm0EoIYDAmsE +gIYDAmnRDwAAAAAAAABsEAYjIAcUzOgDA0HqzOYZzwKAAKSZKJKe+mABBjAFNQDswr8sGQwAACuS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 5 21:11:33 2015 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 723789B4A17; Wed, 5 Aug 2015 21:11:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 60ED2BF1; Wed, 5 Aug 2015 21:11:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75LBXSU039415; Wed, 5 Aug 2015 21:11:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75LBXah039414; Wed, 5 Aug 2015 21:11:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508052111.t75LBXah039414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Aug 2015 21:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286341 - head/usr.sbin/pw/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.20 Precedence: list List-Id: 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, 05 Aug 2015 21:11:33 -0000 Author: bapt Date: Wed Aug 5 21:11:32 2015 New Revision: 286341 URL: https://svnweb.freebsd.org/changeset/base/286341 Log: Add regression tests for a bug reported in stable/10 While pw(8) on head is not affected it is worth adding more regression tests ensuring this bug will not happen unnoticed in the futur Modified: head/usr.sbin/pw/tests/pw_usermod.sh Modified: head/usr.sbin/pw/tests/pw_usermod.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_usermod.sh Wed Aug 5 20:32:07 2015 (r286340) +++ head/usr.sbin/pw/tests/pw_usermod.sh Wed Aug 5 21:11:32 2015 (r286341) @@ -195,6 +195,14 @@ user_mod_renamehome_body() { test -d ${HOME}/home/bar || atf_fail "Directory not created" } +atf_test_case user_mod_uid +user_mod_uid_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -u 5000 +} + atf_init_test_cases() { atf_add_test_case user_mod atf_add_test_case user_mod_noupdate @@ -210,4 +218,5 @@ atf_init_test_cases() { atf_add_test_case user_mod_h atf_add_test_case user_mod_H atf_add_test_case user_mod_renamehome + atf_add_test_case user_mod_uid } From owner-svn-src-head@freebsd.org Wed Aug 5 21:16:13 2015 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 535E59B4AA1; Wed, 5 Aug 2015 21:16:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 441D0EAB; Wed, 5 Aug 2015 21:16:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75LGDJv041548; Wed, 5 Aug 2015 21:16:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75LGDgr041547; Wed, 5 Aug 2015 21:16:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508052116.t75LGDgr041547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 5 Aug 2015 21:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286342 - 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.20 Precedence: list List-Id: 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, 05 Aug 2015 21:16:13 -0000 Author: adrian Date: Wed Aug 5 21:16:12 2015 New Revision: 286342 URL: https://svnweb.freebsd.org/changeset/base/286342 Log: Add a missing method - ath_hal_settsf64(). This is required for TDMA slave mode. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Aug 5 21:11:32 2015 (r286341) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Aug 5 21:16:12 2015 (r286342) @@ -97,6 +97,18 @@ ar9300_freebsd_get_cts_timeout(struct at return ath_hal_mac_usec(ah, clks); /* convert from system clocks */ } +static void +ar9300_freebsd_set_tsf64(struct ath_hal *ah, uint64_t tsf64) +{ + + /* + * XXX TODO: read ar5416SetTsf64() - we should wait before we do + * this. + */ + OS_REG_WRITE(ah, AR_TSF_L32, tsf64 & 0xffffffff); + OS_REG_WRITE(ah, AR_TSF_U32, (tsf64 >> 32) & 0xffffffff); +} + void ar9300_attach_freebsd_ops(struct ath_hal *ah) { @@ -182,6 +194,7 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_getTsf32 = ar9300_get_tsf32; ah->ah_getTsf64 = ar9300_get_tsf64; ah->ah_resetTsf = ar9300_reset_tsf; + ah->ah_setTsf64 = ar9300_freebsd_set_tsf64; ah->ah_detectCardPresent = ar9300_detect_card_present; // ah->ah_updateMibCounters = ar9300_update_mib_counters; ah->ah_getRfGain = ar9300_get_rfgain; From owner-svn-src-head@freebsd.org Wed Aug 5 21:22:26 2015 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 1C9EC9B4C26; Wed, 5 Aug 2015 21:22:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0DA8915ED; Wed, 5 Aug 2015 21:22:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75LMPHp045422; Wed, 5 Aug 2015 21:22:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75LMPWa045421; Wed, 5 Aug 2015 21:22:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508052122.t75LMPWa045421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 5 Aug 2015 21:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286343 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 21:22:26 -0000 Author: adrian Date: Wed Aug 5 21:22:25 2015 New Revision: 286343 URL: https://svnweb.freebsd.org/changeset/base/286343 Log: Add a hack-around to this fatal taskqueue running whilst the NIC is detaching. This mostly fixes a panic - the reset path shouldn't run whilst the NIC is being torn down. It's not locked, so it's "mostly" ok, but most of the rest of the driver doesn't read sc->invalid with sensible locking. Grr. The real solution is to cleanly tear down taskqueues in the detach/suspend phase, but .. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Aug 5 21:16:12 2015 (r286342) +++ head/sys/dev/ath/if_ath.c Wed Aug 5 21:22:25 2015 (r286343) @@ -2318,6 +2318,9 @@ ath_fatal_proc(void *arg, int pending) u_int32_t len; void *sp; + if (sc->sc_invalid) + return; + device_printf(sc->sc_dev, "hardware error; resetting\n"); /* * Fatal errors are unrecoverable. Typically these From owner-svn-src-head@freebsd.org Wed Aug 5 21:23:30 2015 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 5102E9B4CB4; Wed, 5 Aug 2015 21:23:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::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 1D0F318D1; Wed, 5 Aug 2015 21:23:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iggf3 with SMTP id f3so41780213igg.1; Wed, 05 Aug 2015 14:23:29 -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:date:message-id:subject :from:to:cc:content-type; bh=CdUuSgyJ5Cm4Q+69+O/x+kHp+O+Xk7AzzziX2TUOqnU=; b=B6Rtj2gFsVoL239w8oAYi7OrE9ye4fqXihIP3fUlpFLUc4bFvw8V4HnTSRjrPAqDYB DKGA+mGaz1WDbS5MXmrl6nTGW+kk1pJI+ay4XAWbr9QdpOoc8eRiXTxo3hggJTre6jN4 DKb7iGKF8LZ9/6J2CsjRWZ0JxvQ+JZX/sVJPjmP+RROseHCqTjJ/kpiAgHPBgTBjs6hR mDjyWjIwm15S7HFFpEh34O4pJ0Ki4NRrBP4irdh+ciUsESXAoiAjAZZgW0EgXQwVDA+g 02jkdfXEIXPwq8Vozfo3bvwNL7ANf75+PHONPdVWCE14xAq4A42n78fTIrV3zgMT1uk4 wwPA== MIME-Version: 1.0 X-Received: by 10.50.128.169 with SMTP id np9mr1684805igb.37.1438809809546; Wed, 05 Aug 2015 14:23:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Wed, 5 Aug 2015 14:23:29 -0700 (PDT) In-Reply-To: <1438803660.4365.13.camel@hardenedbsd.org> References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Wed, 5 Aug 2015 14:23:29 -0700 X-Google-Sender-Auth: N8yvLnNRwBvFrPfaKgEjtPNJTuM Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: Shawn Webb 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.20 Precedence: list List-Id: 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, 05 Aug 2015 21:23:30 -0000 The whole wifi stack / drivers need backporting. :) -a On 5 August 2015 at 12:41, Shawn Webb wrote: > On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Wed Aug 5 19:32:35 2015 >> New Revision: 286337 >> URL: https://svnweb.freebsd.org/changeset/base/286337 >> >> Log: >> Add TXOP enforce support to the AR9300 HAL. >> >> This is required for (more) correct TDMA support. Without it, the >> code tries to calculate the required guard interval based on the >> current rate, and since this is an 11n NIC and people try using >> 11n, it calls ath_hal_computetxtime() on an 11n rate which then >> panics. >> >> This doesn't fix TDMA slave mode on AR9300 - it just makes it >> have one less bug. >> >> Reported by: Berislav Purgar >> >> Modified: >> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c > > Hey Adrian, > > Can this be MFC'd? > > Thanks, > > -- > Shawn Webb > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE From owner-svn-src-head@freebsd.org Wed Aug 5 21:33:32 2015 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 1526F9B4F3E; Wed, 5 Aug 2015 21:33:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E0BC51E2E; Wed, 5 Aug 2015 21:33:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75LXVPt049910; Wed, 5 Aug 2015 21:33:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75LXVoI049908; Wed, 5 Aug 2015 21:33:31 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508052133.t75LXVoI049908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 5 Aug 2015 21:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286344 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 21:33:32 -0000 Author: jilles Date: Wed Aug 5 21:33:30 2015 New Revision: 286344 URL: https://svnweb.freebsd.org/changeset/base/286344 Log: find: Fix segfault with very long path in -exec/-ok ... {} \;. If the resulting argument is longer than MAXPATHLEN, realloc() was called to extend the space, but the new pointer was not correctly stored. Different from what OpenBSD has done, rewrite brace_subst() to calculate the necessary space first and realloc() at most once. As before, the e_len fields are not updated in case of a realloc. Therefore, a following long argument will do another realloc. PR: 201750 MFC after: 1 week Modified: head/usr.bin/find/extern.h head/usr.bin/find/misc.c Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Wed Aug 5 21:22:25 2015 (r286343) +++ head/usr.bin/find/extern.h Wed Aug 5 21:33:30 2015 (r286344) @@ -32,7 +32,7 @@ #include -void brace_subst(char *, char **, char *, int); +void brace_subst(char *, char **, char *, size_t); PLAN *find_create(char ***); int find_execute(PLAN *, char **); PLAN *find_formplan(char **); Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Wed Aug 5 21:22:25 2015 (r286343) +++ head/usr.bin/find/misc.c Wed Aug 5 21:33:30 2015 (r286344) @@ -57,23 +57,33 @@ __FBSDID("$FreeBSD$"); * Replace occurrences of {} in s1 with s2 and return the result string. */ void -brace_subst(char *orig, char **store, char *path, int len) +brace_subst(char *orig, char **store, char *path, size_t len) { - int plen; - char ch, *p; + const char *pastorigend, *p, *q; + char *dst; + size_t newlen, plen; plen = strlen(path); - for (p = *store; (ch = *orig) != '\0'; ++orig) - if (ch == '{' && orig[1] == '}') { - while ((p - *store) + plen > len) - if (!(*store = realloc(*store, len *= 2))) - err(1, NULL); - memmove(p, path, plen); - p += plen; - ++orig; - } else - *p++ = ch; - *p = '\0'; + newlen = strlen(orig) + 1; + pastorigend = orig + newlen; + for (p = orig; (q = strstr(p, "{}")) != NULL; p = q + 2) { + if (plen > 2 && newlen + plen - 2 < newlen) + errx(2, "brace_subst overflow"); + newlen += plen - 2; + } + if (newlen > len) { + *store = reallocf(*store, newlen); + if (*store == NULL) + err(2, NULL); + } + dst = *store; + for (p = orig; (q = strstr(p, "{}")) != NULL; p = q + 2) { + memcpy(dst, p, q - p); + dst += q - p; + memcpy(dst, path, plen); + dst += plen; + } + memcpy(dst, p, pastorigend - p); } /* From owner-svn-src-head@freebsd.org Wed Aug 5 21:56:01 2015 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 13DC09B4414 for ; Wed, 5 Aug 2015 21:56:01 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (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 A47ECCF1 for ; Wed, 5 Aug 2015 21:56:00 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wibhh20 with SMTP id hh20so42861602wib.0 for ; Wed, 05 Aug 2015 14:55: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:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Ci9f7uuYSZCJFnpJsstiI5UYzel21rhmWJyul6H2G2w=; b=E9W35dJhx6smXgzKdraNS3NTzXbAEummZCzhT6W/8Ji+1LUxfwB5uMn+dEq0RNaKvr 75OoATTafKjl980aHma+s86w3rs9KLSUGwopP+/+IULTMIk1owawFjVih9pAfJJA1K0W 8UIyq5rgmMfRLhfbB4+9UL+vO8sb/8IDBnpIMe9Y7IbtJXSLf2wH4LdRMEMzI/WkeTqa 3P0U4RebIU78yEnLOMYvySboS1gaZtRbynnFoPvYvJFRO+QiftBDdI0z5Bp0b7FfzNz/ 829Ss7vAme4juTq5nrARpiO6By9gKjz7XySfMcuFbgMxLKOzH5MP39+kJfrp6KjcfHpV NsDg== X-Gm-Message-State: ALoCoQl3Fs3UjyMhuyxvjPJmhT3lDKWJCGP6OedvHpfkYtWyebRCTWl5WwIXrawJ4QPjUUl+7Ryu MIME-Version: 1.0 X-Received: by 10.180.39.65 with SMTP id n1mr2730229wik.59.1438811758900; Wed, 05 Aug 2015 14:55:58 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Wed, 5 Aug 2015 14:55:58 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Wed, 5 Aug 2015 23:55:58 +0200 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: Adrian Chadd Cc: Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 21:56:01 -0000 Yup. :) If you need testers with the backport, then ping me. ;) On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd wrote: > The whole wifi stack / drivers need backporting. :) > > > > -a > > > On 5 August 2015 at 12:41, Shawn Webb wrote: >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >>> Author: adrian >>> Date: Wed Aug 5 19:32:35 2015 >>> New Revision: 286337 >>> URL: https://svnweb.freebsd.org/changeset/base/286337 >>> >>> Log: >>> Add TXOP enforce support to the AR9300 HAL. >>> >>> This is required for (more) correct TDMA support. Without it, the >>> code tries to calculate the required guard interval based on the >>> current rate, and since this is an 11n NIC and people try using >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then >>> panics. >>> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it >>> have one less bug. >>> >>> Reported by: Berislav Purgar >>> >>> Modified: >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c >> >> Hey Adrian, >> >> Can this be MFC'd? >> >> Thanks, >> >> -- >> Shawn Webb >> HardenedBSD >> >> GPG Key ID: 0x6A84658F52456EEE >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Wed Aug 5 21:58:34 2015 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 65EA39B4476; Wed, 5 Aug 2015 21:58:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 49518E8C; Wed, 5 Aug 2015 21:58:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75LwYmB059165; Wed, 5 Aug 2015 21:58:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75LwXYQ059160; Wed, 5 Aug 2015 21:58:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508052158.t75LwXYQ059160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Aug 2015 21:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286345 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 21:58:34 -0000 Author: mav Date: Wed Aug 5 21:58:32 2015 New Revision: 286345 URL: https://svnweb.freebsd.org/changeset/base/286345 Log: Relax serialization of SYNCHRONIZE CACHE commands. Before this change SYNCHRONIZE CACHE commands were executed exclusively, as if they had ORDERED tag. But looking through SCSI specs I've found no any reason to be so strict. For reads this ordering seems pointless. For writes it looks less obvious, so I left ordering against preceeding write commands, while following ones are no longer required to wait. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_ser_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 5 21:33:30 2015 (r286344) +++ head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 5 21:58:32 2015 (r286345) @@ -785,8 +785,8 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 35 SYNCHRONIZE CACHE(10) */ -{ctl_sync_cache, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_SLUN | - CTL_FLAG_DATA_NONE, +{ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_NONE, CTL_LUN_PAT_NONE, 10, {0, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -1138,8 +1138,8 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 91 SYNCHRONIZE CACHE(16) */ -{ctl_sync_cache, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_SLUN | - CTL_FLAG_DATA_NONE, +{ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_NONE, CTL_LUN_PAT_NONE, 16, {0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Aug 5 21:33:30 2015 (r286344) +++ head/sys/cam/ctl/ctl_private.h Wed Aug 5 21:58:32 2015 (r286345) @@ -141,6 +141,7 @@ typedef enum { CTL_SERIDX_READ, CTL_SERIDX_WRITE, CTL_SERIDX_UNMAP, + CTL_SERIDX_SYNC, CTL_SERIDX_MD_SNS, CTL_SERIDX_MD_SEL, CTL_SERIDX_RQ_SNS, Modified: head/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- head/sys/cam/ctl/ctl_ser_table.c Wed Aug 5 21:33:30 2015 (r286344) +++ head/sys/cam/ctl/ctl_ser_table.c Wed Aug 5 21:58:32 2015 (r286345) @@ -63,19 +63,20 @@ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { -/**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ -/*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*READ */{ pS, xS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*WRITE */{ pS, xT, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*UNMAP */{ pS, xO, xO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, -/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, -/*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, pS}, -/*RES */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, -/*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, -/*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, -/*START */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, +/**>IDX_ :: 2nd:TUR RD WRT UNM SYN MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ +/*TUR */{ pS, pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*READ */{ pS, xS, xT, bO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*WRITE */{ pS, xT, xT, bO, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*UNMAP */{ pS, xO, xO, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*SYNC */{ pS, pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*MD_SNS */{ bK, bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, +/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, +/*INQ */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, pS}, +/*RES */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, +/*LOG_SNS */{ pS, pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, +/*FORMAT */{ pS, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, +/*START */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, }; From owner-svn-src-head@freebsd.org Wed Aug 5 22:04:57 2015 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 BC22C9B4776; Wed, 5 Aug 2015 22:04:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 ACFFD166F; Wed, 5 Aug 2015 22:04:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75M4vQM063342; Wed, 5 Aug 2015 22:04:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75M4vCp063341; Wed, 5 Aug 2015 22:04:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508052204.t75M4vCp063341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 5 Aug 2015 22:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286347 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 22:04:57 -0000 Author: delphij Date: Wed Aug 5 22:04:56 2015 New Revision: 286347 URL: https://svnweb.freebsd.org/changeset/base/286347 Log: Fix a bug which could make routed(8) daemon exit by sending a special RIP query from a remote machine, similar to SA-14:21.routed. Submitted by: hrs Modified: head/sbin/routed/input.c Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Wed Aug 5 22:04:54 2015 (r286346) +++ head/sbin/routed/input.c Wed Aug 5 22:04:56 2015 (r286347) @@ -160,6 +160,12 @@ input(struct sockaddr_in *from, /* rece trace_rip("Recv", "from", from, sifp, rip, cc); + if (sifp == 0) { + trace_pkt(" discard a request from an indirect router" + " (possibly an attack)"); + return; + } + if (rip->rip_vers == 0) { msglim(&bad_router, FROM_NADDR, "RIP version 0, cmd %d, packet received from %s", From owner-svn-src-head@freebsd.org Wed Aug 5 22:04:55 2015 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 D78BA9B4771; Wed, 5 Aug 2015 22:04:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 ADE8A166C; Wed, 5 Aug 2015 22:04:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75M4tSA063295; Wed, 5 Aug 2015 22:04:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75M4thU063292; Wed, 5 Aug 2015 22:04:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508052204.t75M4thU063292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 5 Aug 2015 22:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286346 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 22:04:55 -0000 Author: delphij Date: Wed Aug 5 22:04:54 2015 New Revision: 286346 URL: https://svnweb.freebsd.org/changeset/base/286346 Log: Fix shell injection vulnerability in patch(1) via ed(1) by tightening sanity check of the input. [1] While I'm there also replace ed(1) with red(1) because we do not need the unrestricted functionality. [2] Obtained from: Bitrig [1], DragonFly [2] Security: CVE-2015-1418 [1] Modified: head/usr.bin/patch/pathnames.h head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pathnames.h ============================================================================== --- head/usr.bin/patch/pathnames.h Wed Aug 5 21:58:32 2015 (r286345) +++ head/usr.bin/patch/pathnames.h Wed Aug 5 22:04:54 2015 (r286346) @@ -9,4 +9,4 @@ #include -#define _PATH_ED "/bin/ed" +#define _PATH_RED "/bin/red" Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Wed Aug 5 21:58:32 2015 (r286345) +++ head/usr.bin/patch/pch.c Wed Aug 5 22:04:54 2015 (r286346) @@ -1,4 +1,3 @@ - /*- * Copyright 1986, Larry Wall * @@ -1410,13 +1409,14 @@ do_ed_script(void) char *t; off_t beginning_of_this_line; FILE *pipefp = NULL; + int continuation; if (!skip_rest_of_patch) { if (copy_file(filearg[0], TMPOUTNAME) < 0) { unlink(TMPOUTNAME); fatal("can't create temp file %s", TMPOUTNAME); } - snprintf(buf, buf_size, "%s%s%s", _PATH_ED, + snprintf(buf, buf_size, "%s%s%s", _PATH_RED, verbose ? " " : " -s ", TMPOUTNAME); pipefp = popen(buf, "w"); } @@ -1434,7 +1434,19 @@ do_ed_script(void) (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) { if (pipefp != NULL) fputs(buf, pipefp); - if (*t != 'd') { + if (*t == 's') { + for (;;) { + continuation = 0; + t = strchr(buf, '\0') - 1; + while (--t >= buf && *t == '\\') + continuation = !continuation; + if (!continuation || + pgets(true) == 0) + break; + if (pipefp != NULL) + fputs(buf, pipefp); + } + } else if (*t != 'd') { while (pgets(true)) { p_input_line++; if (pipefp != NULL) From owner-svn-src-head@freebsd.org Wed Aug 5 22:24:51 2015 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 C04E29B3471; Wed, 5 Aug 2015 22:24:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A5C5F16A8; Wed, 5 Aug 2015 22:24:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75MOpVW072521; Wed, 5 Aug 2015 22:24:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75MOo5Q072518; Wed, 5 Aug 2015 22:24:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508052224.t75MOo5Q072518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Aug 2015 22:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286353 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 22:24:52 -0000 Author: mav Date: Wed Aug 5 22:24:49 2015 New Revision: 286353 URL: https://svnweb.freebsd.org/changeset/base/286353 Log: Pass SYNCHRONIZE CACHE command parameters to backends. At this point IMMED flag is translated to MNT_NOWAIT flag of VOP_FSYNC(), hoping that file system implements that (ZFS seems doesn't). MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Aug 5 22:05:24 2015 (r286352) +++ head/sys/cam/ctl/ctl.c Wed Aug 5 22:24:49 2015 (r286353) @@ -5507,9 +5507,11 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; struct ctl_softc *softc; + struct ctl_lba_len_flags *lbalen; uint64_t starting_lba; uint32_t block_count; int retval; + uint8_t byte2; CTL_DEBUG_PRINT(("ctl_sync_cache\n")); @@ -5524,6 +5526,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) starting_lba = scsi_4btoul(cdb->begin_lba); block_count = scsi_2btoul(cdb->lb_count); + byte2 = cdb->byte2; break; } case SYNCHRONIZE_CACHE_16: { @@ -5532,6 +5535,7 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) starting_lba = scsi_8btou64(cdb->begin_lba); block_count = scsi_4btoul(cdb->lb_count); + byte2 = cdb->byte2; break; } default: @@ -5562,6 +5566,11 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) goto bailout; } + lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = starting_lba; + lbalen->len = block_count; + lbalen->flags = byte2; + /* * Check to see whether we're configured to send the SYNCHRONIZE * CACHE command directly to the back end. Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Aug 5 22:05:24 2015 (r286352) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Aug 5 22:24:49 2015 (r286353) @@ -224,6 +224,7 @@ struct ctl_be_block_io { devstat_trans_flags ds_trans_type; uint64_t io_len; uint64_t io_offset; + int io_arg; struct ctl_be_block_softc *softc; struct ctl_be_block_lun *lun; void (*beio_cont)(struct ctl_be_block_io *beio); /* to continue processing */ @@ -581,7 +582,8 @@ ctl_be_block_flush_file(struct ctl_be_bl vn_lock(be_lun->vn, lock_flags | LK_RETRY); - error = VOP_FSYNC(be_lun->vn, MNT_WAIT, curthread); + error = VOP_FSYNC(be_lun->vn, beio->io_arg ? MNT_NOWAIT : MNT_WAIT, + curthread); VOP_UNLOCK(be_lun->vn, 0); vn_finished_write(mountpoint); @@ -674,9 +676,6 @@ ctl_be_block_dispatch_file(struct ctl_be * ZFS pays attention to IO_SYNC (which translates into the * Solaris define FRSYNC for zfs_read()) for reads. It * attempts to sync the file before reading. - * - * So, to attempt to provide some barrier semantics in the - * BIO_ORDERED case, set both IO_DIRECT and IO_SYNC. */ error = VOP_READ(be_lun->vn, &xuio, flags, file_data->cred); @@ -711,9 +710,6 @@ ctl_be_block_dispatch_file(struct ctl_be * ZFS pays attention to IO_SYNC (a.k.a. FSYNC or FRSYNC) * for writes. It will flush the transaction from the * cache before returning. - * - * So if we've got the BIO_ORDERED flag set, we want - * IO_SYNC in either the UFS or ZFS case. */ error = VOP_WRITE(be_lun->vn, &xuio, flags, file_data->cred); VOP_UNLOCK(be_lun->vn, 0); @@ -981,7 +977,6 @@ ctl_be_block_flush_dev(struct ctl_be_blo bio = g_alloc_bio(); bio->bio_cmd = BIO_FLUSH; - bio->bio_flags |= BIO_ORDERED; bio->bio_dev = dev_data->cdev; bio->bio_offset = 0; bio->bio_data = 0; @@ -1167,6 +1162,26 @@ ctl_be_block_getattr_dev(struct ctl_be_b } static void +ctl_be_block_cw_dispatch_sync(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_lba_len_flags *lbalen; + + DPRINTF("entered\n"); + beio = (struct ctl_be_block_io *)PRIV(io)->ptr; + lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + + beio->io_len = lbalen->len * be_lun->blocksize; + beio->io_offset = lbalen->lba * be_lun->blocksize; + beio->io_arg = (lbalen->flags & SSC_IMMED) != 0; + beio->bio_cmd = BIO_FLUSH; + beio->ds_trans_type = DEVSTAT_NO_DATA; + DPRINTF("SYNC\n"); + be_lun->lun_flush(be_lun, beio); +} + +static void ctl_be_block_cw_done_ws(struct ctl_be_block_io *beio) { union ctl_io *io; @@ -1188,7 +1203,6 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b union ctl_io *io) { struct ctl_be_block_io *beio; - struct ctl_be_block_softc *softc; struct ctl_lba_len_flags *lbalen; uint64_t len_left, lba; uint32_t pb, pbo, adj; @@ -1198,7 +1212,6 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b DPRINTF("entered\n"); beio = (struct ctl_be_block_io *)PRIV(io)->ptr; - softc = be_lun->softc; lbalen = ARGS(beio->io); if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP | SWS_ANCHOR | SWS_NDOB) || @@ -1214,21 +1227,6 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b return; } - switch (io->scsiio.tag_type) { - case CTL_TAG_ORDERED: - beio->ds_tag_type = DEVSTAT_TAG_ORDERED; - break; - case CTL_TAG_HEAD_OF_QUEUE: - beio->ds_tag_type = DEVSTAT_TAG_HEAD; - break; - case CTL_TAG_UNTAGGED: - case CTL_TAG_SIMPLE: - case CTL_TAG_ACA: - default: - beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; - break; - } - if (lbalen->flags & (SWS_UNMAP | SWS_ANCHOR)) { beio->io_offset = lbalen->lba * be_lun->blocksize; beio->io_len = (uint64_t)lbalen->len * be_lun->blocksize; @@ -1303,13 +1301,11 @@ ctl_be_block_cw_dispatch_unmap(struct ct union ctl_io *io) { struct ctl_be_block_io *beio; - struct ctl_be_block_softc *softc; struct ctl_ptr_len_flags *ptrlen; DPRINTF("entered\n"); beio = (struct ctl_be_block_io *)PRIV(io)->ptr; - softc = be_lun->softc; ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; if ((ptrlen->flags & ~SU_ANCHOR) != 0 || be_lun->unmap == NULL) { @@ -1324,29 +1320,11 @@ ctl_be_block_cw_dispatch_unmap(struct ct return; } - switch (io->scsiio.tag_type) { - case CTL_TAG_ORDERED: - beio->ds_tag_type = DEVSTAT_TAG_ORDERED; - break; - case CTL_TAG_HEAD_OF_QUEUE: - beio->ds_tag_type = DEVSTAT_TAG_HEAD; - break; - case CTL_TAG_UNTAGGED: - case CTL_TAG_SIMPLE: - case CTL_TAG_ACA: - default: - beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; - break; - } - beio->io_len = 0; beio->io_offset = -1; - beio->bio_cmd = BIO_DELETE; beio->ds_trans_type = DEVSTAT_FREE; - DPRINTF("UNMAP\n"); - be_lun->unmap(be_lun, beio); } @@ -1417,16 +1395,26 @@ ctl_be_block_cw_dispatch(struct ctl_be_b beio->io = io; beio->lun = be_lun; beio->beio_cont = ctl_be_block_cw_done; + switch (io->scsiio.tag_type) { + case CTL_TAG_ORDERED: + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + break; + case CTL_TAG_HEAD_OF_QUEUE: + beio->ds_tag_type = DEVSTAT_TAG_HEAD; + break; + case CTL_TAG_UNTAGGED: + case CTL_TAG_SIMPLE: + case CTL_TAG_ACA: + default: + beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; + break; + } PRIV(io)->ptr = (void *)beio; switch (io->scsiio.cdb[0]) { case SYNCHRONIZE_CACHE: case SYNCHRONIZE_CACHE_16: - beio->bio_cmd = BIO_FLUSH; - beio->ds_trans_type = DEVSTAT_NO_DATA; - beio->ds_tag_type = DEVSTAT_TAG_ORDERED; - beio->io_len = 0; - be_lun->lun_flush(be_lun, beio); + ctl_be_block_cw_dispatch_sync(be_lun, io); break; case WRITE_SAME_10: case WRITE_SAME_16: Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 5 22:05:24 2015 (r286352) +++ head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 5 22:24:49 2015 (r286353) @@ -788,7 +788,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_NONE, CTL_LUN_PAT_NONE, - 10, {0, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, + 10, {0x02, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, /* 36 LOCK UNLOCK CACHE(10) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -1141,7 +1141,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_NONE, CTL_LUN_PAT_NONE, - 16, {0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 92 LOCK UNLOCK CACHE(16) */ From owner-svn-src-head@freebsd.org Wed Aug 5 22:27:32 2015 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 E0F469B3662; Wed, 5 Aug 2015 22:27:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C5B521BF; Wed, 5 Aug 2015 22:27:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t75MRVRs072871; Wed, 5 Aug 2015 22:27:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t75MRVSm072870; Wed, 5 Aug 2015 22:27:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508052227.t75MRVSm072870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 5 Aug 2015 22:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286354 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 05 Aug 2015 22:27:32 -0000 Author: cem Date: Wed Aug 5 22:27:30 2015 New Revision: 286354 URL: https://svnweb.freebsd.org/changeset/base/286354 Log: nfsclient: Protest loudly when GETATTR responses are invalid BROKEN NFS SERVER OR MIDDLEWARE: Certain WAN "accelerators" attempt to cache NFS GETATTR traffic, but actually corrupt it (e.g., responding to requests with attributes for totally different files). Warn very verbosely when this is detected. Linux' NFS client has a similar warning. Adds a sysctl/tunable (vfs.nfs.fileid_maxwarnings) to configure the quantity of warnings; default to 10. (Zero disables; -1 is unlimited.) Adds a failpoint to aid in validating the warning / behavior with a non-broken server. Use something like: sysctl 'debug.fail_point.nfscl_force_fileid_warning=10%return(1)' Reviewed by: rmacklem Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3304 Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed Aug 5 22:24:49 2015 (r286353) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Aug 5 22:27:30 2015 (r286354) @@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$"); * generally, I don't like #includes inside .h files, but it seems to * be the easiest way to handle the port. */ +#include #include +#include #include #include #include @@ -83,6 +85,16 @@ NFSDLOCKMUTEX; extern void (*ncl_call_invalcaches)(struct vnode *); +SYSCTL_DECL(_vfs_nfs); +static int ncl_fileid_maxwarnings = 10; +SYSCTL_INT(_vfs_nfs, OID_AUTO, fileid_maxwarnings, CTLFLAG_RWTUN, + &ncl_fileid_maxwarnings, 0, + "Limit fileid corruption warnings; 0 is off; -1 is unlimited"); +static volatile int ncl_fileid_nwarnings; + +static void nfscl_warn_fileid(struct nfsmount *, struct nfsvattr *, + struct nfsvattr *); + /* * Comparison function for vfs_hash functions. */ @@ -343,6 +355,37 @@ nfscl_ngetreopen(struct mount *mntp, u_i return (EINVAL); } +static void +nfscl_warn_fileid(struct nfsmount *nmp, struct nfsvattr *oldnap, + struct nfsvattr *newnap) +{ + int off; + + if (ncl_fileid_maxwarnings >= 0 && + ncl_fileid_nwarnings >= ncl_fileid_maxwarnings) + return; + off = 0; + if (ncl_fileid_maxwarnings >= 0) { + if (++ncl_fileid_nwarnings >= ncl_fileid_maxwarnings) + off = 1; + } + + printf("newnfs: server '%s' error: fileid changed. " + "fsid %jx:%jx: expected fileid %#jx, got %#jx. " + "(BROKEN NFS SERVER OR MIDDLEWARE)\n", + nmp->nm_com.nmcom_hostname, + (uintmax_t)nmp->nm_fsid[0], + (uintmax_t)nmp->nm_fsid[1], + (uintmax_t)oldnap->na_fileid, + (uintmax_t)newnap->na_fileid); + + if (off) + printf("newnfs: Logged %d times about fileid corruption; " + "going quiet to avoid spamming logs excessively. (Limit " + "is: %d).\n", ncl_fileid_nwarnings, + ncl_fileid_maxwarnings); +} + /* * Load the attribute cache (that lives in the nfsnode entry) with * the attributes of the second argument and @@ -361,7 +404,11 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsmount *nmp; struct timespec mtime_save; u_quad_t nsize; - int setnsize; + int setnsize, error, force_fid_err; + + error = 0; + setnsize = 0; + nsize = 0; /* * If v_type == VNON it is a new node, so fill in the v_type, @@ -389,6 +436,34 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_vattr.na_fsid = nap->na_fsid; np->n_vattr.na_mode = nap->na_mode; } else { + force_fid_err = 0; + KFAIL_POINT_ERROR(DEBUG_FP, nfscl_force_fileid_warning, + force_fid_err); + /* + * BROKEN NFS SERVER OR MIDDLEWARE + * + * Certain NFS servers (certain old proprietary filers ca. + * 2006) or broken middleboxes (e.g. WAN accelerator products) + * will respond to GETATTR requests with results for a + * different fileid. + * + * The WAN accelerator we've observed not only serves stale + * cache results for a given file, it also occasionally serves + * results for wholly different files. This causes surprising + * problems; for example the cached size attribute of a file + * may truncate down and then back up, resulting in zero + * regions in file contents read by applications. We observed + * this reliably with Clang and .c files during parallel build. + * A pcap revealed packet fragmentation and GETATTR RPC + * responses with wholly wrong fileids. + */ + if ((np->n_vattr.na_fileid != 0 && + np->n_vattr.na_fileid != nap->na_fileid) || + force_fid_err) { + nfscl_warn_fileid(nmp, &np->n_vattr, nap); + error = EIDRM; + goto out; + } NFSBCOPY((caddr_t)nap, (caddr_t)&np->n_vattr, sizeof (struct nfsvattr)); } @@ -419,8 +494,6 @@ nfscl_loadattrcache(struct vnode **vpp, } else vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; np->n_attrstamp = time_second; - setnsize = 0; - nsize = 0; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -490,14 +563,16 @@ nfscl_loadattrcache(struct vnode **vpp, vaper->va_mtime = np->n_mtim; } } + +out: #ifdef KDTRACE_HOOKS if (np->n_attrstamp != 0) - KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); + KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error); #endif NFSUNLOCKNODE(np); if (setnsize) vnode_pager_setsize(vp, nsize); - return (0); + return (error); } /* From owner-svn-src-head@freebsd.org Thu Aug 6 01:49:19 2015 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 E87E39B228B; Thu, 6 Aug 2015 01:49:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D9F4C10ED; Thu, 6 Aug 2015 01:49:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t761nJgG054640; Thu, 6 Aug 2015 01:49:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t761nJgw054639; Thu, 6 Aug 2015 01:49:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508060149.t761nJgw054639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 01:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286358 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 01:49:20 -0000 Author: jhb Date: Thu Aug 6 01:49:18 2015 New Revision: 286358 URL: https://svnweb.freebsd.org/changeset/base/286358 Log: Add recently added values of various flags and enumerations including kevent filters, kevent flags, flags to mmap, seek locations, fcntl operations, file flags, socket domains, open flags, resource limits, and pathconf values. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 01:39:23 2015 (r286357) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 01:49:18 2015 (r286358) @@ -297,12 +297,14 @@ struct xlat { static struct xlat kevent_filters[] = { X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE) X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER) - X(EVFILT_FS) X(EVFILT_READ) XEND + X(EVFILT_PROCDESC) X(EVFILT_FS) X(EVFILT_LIO) X(EVFILT_USER) + X(EVFILT_SENDFILE) XEND }; static struct xlat kevent_flags[] = { X(EV_ADD) X(EV_DELETE) X(EV_ENABLE) X(EV_DISABLE) X(EV_ONESHOT) - X(EV_CLEAR) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND + X(EV_CLEAR) X(EV_RECEIPT) X(EV_DISPATCH) X(EV_FORCEONESHOT) + X(EV_DROP) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND }; static struct xlat poll_flags[] = { @@ -315,7 +317,7 @@ static struct xlat mmap_flags[] = { X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RESERVED0020) X(MAP_RESERVED0040) X(MAP_RESERVED0080) X(MAP_RESERVED0100) X(MAP_HASSEMAPHORE) X(MAP_STACK) X(MAP_NOSYNC) X(MAP_ANON) - X(MAP_NOCORE) X(MAP_PREFAULT_READ) + X(MAP_EXCL) X(MAP_NOCORE) X(MAP_PREFAULT_READ) #ifdef MAP_32BIT X(MAP_32BIT) #endif @@ -327,7 +329,7 @@ static struct xlat mprot_flags[] = { }; static struct xlat whence_arg[] = { - X(SEEK_SET) X(SEEK_CUR) X(SEEK_END) XEND + X(SEEK_SET) X(SEEK_CUR) X(SEEK_END) X(SEEK_DATA) X(SEEK_HOLE) XEND }; static struct xlat sigaction_flags[] = { @@ -337,7 +339,10 @@ static struct xlat sigaction_flags[] = { static struct xlat fcntl_arg[] = { X(F_DUPFD) X(F_GETFD) X(F_SETFD) X(F_GETFL) X(F_SETFL) - X(F_GETOWN) X(F_SETOWN) X(F_GETLK) X(F_SETLK) X(F_SETLKW) XEND + X(F_GETOWN) X(F_SETOWN) X(F_OGETLK) X(F_OSETLK) X(F_OSETLKW) + X(F_DUP2FD) X(F_GETLK) X(F_SETLK) X(F_SETLKW) X(F_SETLK_REMOTE) + X(F_READAHEAD) X(F_RDAHEAD) X(F_DUPFD_CLOEXEC) X(F_DUP2FD_CLOEXEC) + XEND }; static struct xlat fcntlfd_arg[] = { @@ -346,7 +351,7 @@ static struct xlat fcntlfd_arg[] = { static struct xlat fcntlfl_arg[] = { X(O_APPEND) X(O_ASYNC) X(O_FSYNC) X(O_NONBLOCK) X(O_NOFOLLOW) - X(O_DIRECT) XEND + X(FRDAHEAD) X(O_DIRECT) XEND }; static struct xlat sockdomain_arg[] = { @@ -357,7 +362,8 @@ static struct xlat sockdomain_arg[] = { X(PF_LINK) X(PF_XTP) X(PF_COIP) X(PF_CNT) X(PF_SIP) X(PF_IPX) X(PF_RTIP) X(PF_PIP) X(PF_ISDN) X(PF_KEY) X(PF_INET6) X(PF_NATM) X(PF_ATM) X(PF_NETGRAPH) X(PF_SLOW) X(PF_SCLUSTER) - X(PF_ARP) X(PF_BLUETOOTH) XEND + X(PF_ARP) X(PF_BLUETOOTH) X(PF_IEEE80211) X(PF_INET_SDP) + X(PF_INET6_SDP) XEND }; static struct xlat socktype_arg[] = { @@ -369,7 +375,8 @@ static struct xlat open_flags[] = { X(O_RDONLY) X(O_WRONLY) X(O_RDWR) X(O_ACCMODE) X(O_NONBLOCK) X(O_APPEND) X(O_SHLOCK) X(O_EXLOCK) X(O_ASYNC) X(O_FSYNC) X(O_NOFOLLOW) X(O_CREAT) X(O_TRUNC) X(O_EXCL) X(O_NOCTTY) - X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) XEND + X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) + X(O_VERIFY) XEND }; static struct xlat shutdown_arg[] = { @@ -379,7 +386,8 @@ static struct xlat shutdown_arg[] = { static struct xlat resource_arg[] = { X(RLIMIT_CPU) X(RLIMIT_FSIZE) X(RLIMIT_DATA) X(RLIMIT_STACK) X(RLIMIT_CORE) X(RLIMIT_RSS) X(RLIMIT_MEMLOCK) X(RLIMIT_NPROC) - X(RLIMIT_NOFILE) X(RLIMIT_SBSIZE) X(RLIMIT_VMEM) XEND + X(RLIMIT_NOFILE) X(RLIMIT_SBSIZE) X(RLIMIT_VMEM) X(RLIMIT_NPTS) + X(RLIMIT_SWAP) X(RLIMIT_KQUEUES) XEND }; static struct xlat pathconf_arg[] = { @@ -392,12 +400,12 @@ static struct xlat pathconf_arg[] = { X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN) X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX) X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT) - XEND + X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND }; static struct xlat rfork_flags[] = { - X(RFPROC) X(RFNOWAIT) X(RFFDG) X(RFCFDG) X(RFTHREAD) X(RFMEM) - X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND + X(RFFDG) X(RFPROC) X(RFMEM) X(RFNOWAIT) X(RFCFDG) X(RFTHREAD) + X(RFSIGSHARE) X(RFLINUXTHPN) X(RFTSIGZMB) X(RFPPWAIT) XEND }; static struct xlat wait_options[] = { From owner-svn-src-head@freebsd.org Thu Aug 6 02:15:33 2015 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 6BAB99B2A8A; Thu, 6 Aug 2015 02:15:33 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 35EAD1FE6; Thu, 6 Aug 2015 02:15:32 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from localhost (unknown [91.206.210.19]) by mail.dawidek.net (Postfix) with ESMTPSA id 5D777F9C; Thu, 6 Aug 2015 04:15:31 +0200 (CEST) Date: Thu, 6 Aug 2015 04:17:23 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Cc: "K. Macy" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150806021723.GB72832@garage.freebsd.pl> References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <55BF6A84.1040808@FreeBSD.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 02:15:33 -0000 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 03, 2015 at 04:20:04PM +0300, Andriy Gapon wrote: > On 30/07/2015 10:24, K. Macy wrote: > > Just FYI this change introduces a deadlock with with the > > spa_namespace_lock. Mount will be holding this lock while trying to > > acquire the spa_namespace_lock. zfskern on the other hand holds the > > spa_namespace_lock when calling zfs_freebsd_access which in turn > > tries to acquire the teardown lock. >=20 > I missed the fact that zpool.cache file is being written with spa_namespa= ce_lock > held. > I'll try to either resolve the problem in the next day or I will revert t= he change. FYI, I'm hitting this deadlock on my laptop. Reverting the change fixes the problem. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --gj572EiMnwbLXET9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJVwsOzAAoJEJVLhSuxKFt1+SIQAL4+NbsCTih0anW5tSCm2rVC oQCgD0nUcG4GW6Wxu/qI0yIpBKRzjo7jOMAmHqb90URl6XodJYqCXJe4kI+swkEa UzQD8PE0bWXCErxhnpneVTbuIyOQ3SodUeYedV7w00XJo+/3MJVzylUsxIgUQmGU shne+El8bwP5RMEerxwNQNcRiEydtIS2BliSQE8mKWxRy+D4ORLJ2jjGXXf88l1g phM1Ul+fGuGPg+EPhaRybblOqItCZJwuwr53QP+SV/6nncfz6eoYXDRzbF0AUoXL Xu52qzfjR0uMy/1ZeX/B0cvX4Vbt6rnom+9aVcHCXz5hwLWOhRbwpnm0uQRFamHa QXNWzADikJQjJyaD2DWreD355lTwywEIHeYsSIYpAlwQi61OTHrvty4U1iCUtLf6 SdPv6McI/GHQ9q8ID6noh6IWAI8c6sat+IlFwT/JSehJdfQQrMOIpVUj2tl7urjX GNs/KIg6PocELbivLwPD6DsB7cbE5gPJPDBvFjM+prvyFvXo8Xm3DCBHPLreoBzI /hZ/4EZNkLeHAG5wLLp1kqKLOTPKgERVaYukMedqQLO0LSk7prX7KQJaxo2QrIxH UXvOOBKnUVVJCisFH8R3rT8pDiPYfNbowAxuJJeFJAHUrvyw5MXB15qw/5T/q74k 5CLuq7HhxP6UzclB//qj =Sfu3 -----END PGP SIGNATURE----- --gj572EiMnwbLXET9-- From owner-svn-src-head@freebsd.org Thu Aug 6 02:22:50 2015 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 AE11F9B2D06; Thu, 6 Aug 2015 02:22:50 +0000 (UTC) (envelope-from gjb@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 9879680E; Thu, 6 Aug 2015 02:22:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 8FE301FE9; Thu, 6 Aug 2015 02:22:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 6 Aug 2015 02:22:47 +0000 From: Glen Barber To: Pawel Jakub Dawidek Cc: Andriy Gapon , "K. Macy" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150806022247.GG1484@FreeBSD.org> References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> <20150806021723.GB72832@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FKNvYlRPwIaB7a7A" Content-Disposition: inline In-Reply-To: <20150806021723.GB72832@garage.freebsd.pl> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 02:22:50 -0000 --FKNvYlRPwIaB7a7A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 06, 2015 at 04:17:23AM +0200, Pawel Jakub Dawidek wrote: > On Mon, Aug 03, 2015 at 04:20:04PM +0300, Andriy Gapon wrote: > > On 30/07/2015 10:24, K. Macy wrote: > > > Just FYI this change introduces a deadlock with with the > > > spa_namespace_lock. Mount will be holding this lock while trying to > > > acquire the spa_namespace_lock. zfskern on the other hand holds the > > > spa_namespace_lock when calling zfs_freebsd_access which in turn > > > tries to acquire the teardown lock. > >=20 > > I missed the fact that zpool.cache file is being written with spa_names= pace_lock > > held. > > I'll try to either resolve the problem in the next day or I will revert= the change. >=20 > FYI, I'm hitting this deadlock on my laptop. Reverting the change fixes > the problem. >=20 Since it is now 3 days after "I'll try to either resolve the problem in the next day or I will revert the change", my view is that this needs to be reverted now, if it hasn't been done already. Glen --FKNvYlRPwIaB7a7A Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVwsT3AAoJEAMUWKVHj+KTdzIP/0vZvt3OJer0VSmabwe8NPM8 UNmfH26O64kv9s0Vjk2sZhKQhI0fNK4caaI2WQrW7P/pyOuW9/G9VUzCMrHNm3hV p7hSFEhaBj4iFaS8rWqpwaV3twOH6IeGiLuwMx2E1JnGVnU09TSzotNTki4JkDmx BHTenhzvGPYX+FRDZL2hwoTkh/Y581rd8MKLeNNXHiiMi57yLFgurola3DJJ7l8q cefyK1HcP10mkySl4BfDF4tfSF74p5xrvslRohq+eu7OsEugljajOiGN4SRQB2l8 HMkjZrR+85b2QY3Neih/1pfFzKnVcoSbnSChtY3WLRxZUbRFBZEkAqjMDPHU4ED/ jDe76RYxaC5ChkKYdfUu5Xa2f1xCLoZ32TgK6UvUv8hIK+qn2ghwILWaCOTiO4aM Rit01BTRlogwJzhWJCI1SRbP6LlWG//dWDbHyupYeCGRnm8/5+Xub2RyLxD8ILv3 FpniER7tDoMUrABG+lMIJuDE3+E5UHX37tDcwQDr0zETJNXbXuRQFjm+fJDtM+uh ygYtriwN3RJNRo3zVyrEBITDpBBUXBlgHHg8v9OmlIcMiJqLzE0SoAFsT645sGxS kqnuy72gCQVtNKxsbbrcD43P/GlgFLpbY1SndR8v9b53m1V7HbimNbQ2rB5atoiZ ulf1WduAHHsPmEf8nV+b =DB+n -----END PGP SIGNATURE----- --FKNvYlRPwIaB7a7A-- From owner-svn-src-head@freebsd.org Thu Aug 6 03:04:56 2015 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 D12189B38FE; Thu, 6 Aug 2015 03:04:56 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 9B1471E87; Thu, 6 Aug 2015 03:04:56 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by ioeg141 with SMTP id g141so68699979ioe.3; Wed, 05 Aug 2015 20:04:56 -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:date:message-id:subject :from:to:cc:content-type; bh=0j+E3v4NHWke8XlFBZHGpa4szQJoLEkZzxLGWHg3jI4=; b=X3e2MKJyih0dFwUWrDa3siJAPL302PpM4CQf1FVO7dMmfW03yjhWlWyvF1m1mbVxbr gauLH+r9LDrwg4HdzLJe9bhgBOmvNwl63jNKQ9JX9rQtV3IKHiiiQVnbVNckumuAl1qE U4+QeLWVkG8rWQcj/R2N3cLmhOXgCjS1Lek5OzIoP+rpMxSalm5dGu/h1/4YpwTibPv3 Vrw5mTSutUoxys/Va1ykE0SZjubdtgcXHtAesgqi8W5r1HIsC4nQee1A32PpVg2YlIKx J3aO3gzQaVdJQp62OzZxBmVa6TMOet88LYcGq5PHj97M8yLrQMoFLUigSr85nGJvnC3l NI4w== MIME-Version: 1.0 X-Received: by 10.107.132.215 with SMTP id o84mr14911033ioi.36.1438830295949; Wed, 05 Aug 2015 20:04:55 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.36.29.193 with HTTP; Wed, 5 Aug 2015 20:04:55 -0700 (PDT) In-Reply-To: <20150806022247.GG1484@FreeBSD.org> References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> <20150806021723.GB72832@garage.freebsd.pl> <20150806022247.GG1484@FreeBSD.org> Date: Wed, 5 Aug 2015 20:04:55 -0700 X-Google-Sender-Auth: hAay4WPloHw4m2lbLaJv7el4gdI Message-ID: Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: "K. Macy" To: Glen Barber Cc: Pawel Jakub Dawidek , Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 03:04:56 -0000 His proposed solution looks fine to me. Why don't we commit that? -K On Wed, Aug 5, 2015 at 7:22 PM, Glen Barber wrote: > On Thu, Aug 06, 2015 at 04:17:23AM +0200, Pawel Jakub Dawidek wrote: >> On Mon, Aug 03, 2015 at 04:20:04PM +0300, Andriy Gapon wrote: >> > On 30/07/2015 10:24, K. Macy wrote: >> > > Just FYI this change introduces a deadlock with with the >> > > spa_namespace_lock. Mount will be holding this lock while trying to >> > > acquire the spa_namespace_lock. zfskern on the other hand holds the >> > > spa_namespace_lock when calling zfs_freebsd_access which in turn >> > > tries to acquire the teardown lock. >> > >> > I missed the fact that zpool.cache file is being written with spa_namespace_lock >> > held. >> > I'll try to either resolve the problem in the next day or I will revert the change. >> >> FYI, I'm hitting this deadlock on my laptop. Reverting the change fixes >> the problem. >> > > Since it is now 3 days after "I'll try to either resolve the problem in > the next day or I will revert the change", my view is that this needs to > be reverted now, if it hasn't been done already. > > Glen > From owner-svn-src-head@freebsd.org Thu Aug 6 03:07:36 2015 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 EEDEC9B39B0; Thu, 6 Aug 2015 03:07:35 +0000 (UTC) (envelope-from gjb@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 D81B4CF; Thu, 6 Aug 2015 03:07:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id F195C1BB1; Thu, 6 Aug 2015 03:07:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 6 Aug 2015 03:07:33 +0000 From: Glen Barber To: "K. Macy" Cc: Pawel Jakub Dawidek , Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150806030733.GI1484@FreeBSD.org> References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> <20150806021723.GB72832@garage.freebsd.pl> <20150806022247.GG1484@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Er/3qITiDpnrteFh" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 03:07:36 -0000 --Er/3qITiDpnrteFh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 05, 2015 at 08:04:55PM -0700, K. Macy wrote: > On Wed, Aug 5, 2015 at 7:22 PM, Glen Barber wrote: > > On Thu, Aug 06, 2015 at 04:17:23AM +0200, Pawel Jakub Dawidek wrote: > >> On Mon, Aug 03, 2015 at 04:20:04PM +0300, Andriy Gapon wrote: > >> > On 30/07/2015 10:24, K. Macy wrote: > >> > > Just FYI this change introduces a deadlock with with the > >> > > spa_namespace_lock. Mount will be holding this lock while trying to > >> > > acquire the spa_namespace_lock. zfskern on the other hand holds the > >> > > spa_namespace_lock when calling zfs_freebsd_access which in turn > >> > > tries to acquire the teardown lock. > >> > > >> > I missed the fact that zpool.cache file is being written with spa_na= mespace_lock > >> > held. > >> > I'll try to either resolve the problem in the next day or I will rev= ert the change. > >> > >> FYI, I'm hitting this deadlock on my laptop. Reverting the change fixes > >> the problem. > >> > > > > Since it is now 3 days after "I'll try to either resolve the problem in > > the next day or I will revert the change", my view is that this needs to > > be reverted now, if it hasn't been done already. > > > His proposed solution looks fine to me. Why don't we commit that? >=20 I must have missed the solution - was it part of this thread? If a solution exists, then yes, that should be the fix instead. Glen --Er/3qITiDpnrteFh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVws91AAoJEAMUWKVHj+KTe4kQAIZS2vdbkuC9Yy35s7/iLXg3 Ld2xCo6mvJD71/oRdRCZZSP0ZLHay29jxgQoar8wpli5iu8RNReqlxS+KLfsTZcK pqC6+QZc9euF+gFcSkR9HGh8YmWf++8eOmPnp4DddSKzVnOcbIYg7EAw8BB60E1P qWS9KPMA872XiREYG0jm3BBZ7yXfDoha3UAujk8HUwjkVLhly47OWCVqZDi/q3Td vq5Q5BR7eIvdSViBZhj9zl4OLEbQMs0jnqkQQ6chPX/eWN6oFKCrvwpZgPHAGKqO xtUKt+7HsQxzg3jTdqUTxpGhF4vaDZXmET4MpiHM7a96efvoKkW3AgUn8/r2/Zmg GMD0DI/MajEDdmxkFzM5i3UNroLLxV3eea4SAPboJZ0htTxUyxSA3zhTt8mHjft+ z7qeFaHjUnxzNrL3G0y06FQd100vwmZjL3edWIHn9z7XyFMo32uyISSiYxlCzyes id4ADzHVZPucIH9Km8mKq+DwLI0/liP0FDdBwLm860Eg9xMfEbnEo0e9DmqsvEkH ju8onU0VxSwMVqLYQTQyBtOoO0TB906MNjfhY9Jfijj32MldRu/kQ49HUEARZw23 pC3z0hbX5UieLAX4bMPolYrgc/jlqoegDtq44jzppK9EOPwi00fAtp/BwzD+pmMf eSzUQnZ+bFr++wZszki7 =MerD -----END PGP SIGNATURE----- --Er/3qITiDpnrteFh-- From owner-svn-src-head@freebsd.org Thu Aug 6 05:11:06 2015 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 919629B4655; Thu, 6 Aug 2015 05:11:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::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 4B8B018E3; Thu, 6 Aug 2015 05:11:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qgeh16 with SMTP id h16so45757243qge.3; Wed, 05 Aug 2015 22:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T4OG5SkUqFGAciup6kcSoKqfMlCpTCKydSFN1Qo3Jwo=; b=c9gKhkGAooxfPFP6hbNqGAtmTo/PV2GnbgUZCtT2bZymULCd89mNgqXowkLRCz4i8y 13xnL4R6jmONXPUmMQ0tcqDxgXhh5fvDWHGDG4Fcd5+ipJB9UESSpQvHpbBBdZyvcDdG fWva0aDkk593UZIZbs9UQDHPkfeBz6WydQgUrFRBHCfmJBjOj3djZEHE3gp2N0jAyPb6 SmJuw6EdTyYATZ6vbqButtgnBbwcFWEhfgENcFmD9W9OgSXbCRa5zS4keO6UJfPL7chU Q2Vm39k91lH6qAiMErvnDPY7tnyTaqJfyzuMPhRx4hY1Uiz7IoG8BfmWgJSqYbkItsAt W39Q== MIME-Version: 1.0 X-Received: by 10.140.102.225 with SMTP id w88mr21834309qge.25.1438837865314; Wed, 05 Aug 2015 22:11:05 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Wed, 5 Aug 2015 22:11:05 -0700 (PDT) In-Reply-To: <201508052111.t75LBXah039414@repo.freebsd.org> References: <201508052111.t75LBXah039414@repo.freebsd.org> Date: Wed, 5 Aug 2015 22:11:05 -0700 Message-ID: Subject: Re: svn commit: r286341 - head/usr.sbin/pw/tests From: NGie Cooper To: Baptiste Daroussin 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.20 Precedence: list List-Id: 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, 06 Aug 2015 05:11:06 -0000 On Wed, Aug 5, 2015 at 2:11 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Aug 5 21:11:32 2015 > New Revision: 286341 > URL: https://svnweb.freebsd.org/changeset/base/286341 > > Log: > Add regression tests for a bug reported in stable/10 > > While pw(8) on head is not affected it is worth adding more regression tests > ensuring this bug will not happen unnoticed in the futur With all of the changes that went into pw on head, it would be nice if bugs like this were _actually_ fixed on stable branches, and the tests (in and of themselves) could be backported. Could you please look at the non-API/interface related changes here and backport them so we could (in theory) keep things relatively in-sync? From owner-svn-src-head@freebsd.org Thu Aug 6 05:26:49 2015 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 215919B5837; Thu, 6 Aug 2015 05:26:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 29FFD7C1; Thu, 6 Aug 2015 05:26:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA13965; Thu, 06 Aug 2015 08:26:31 +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 1ZNDhG-000Ffv-QW; Thu, 06 Aug 2015 08:26:30 +0300 Message-ID: <55C2EFD1.1080308@FreeBSD.org> Date: Thu, 06 Aug 2015 08:25:37 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Glen Barber , "K. Macy" , Pawel Jakub Dawidek CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin Li Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> <20150806021723.GB72832@garage.freebsd.pl> <20150806022247.GG1484@FreeBSD.org> <20150806030733.GI1484@FreeBSD.org> In-Reply-To: <20150806030733.GI1484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 05:26:49 -0000 On 06/08/2015 06:07, Glen Barber wrote: > On Wed, Aug 05, 2015 at 08:04:55PM -0700, K. Macy wrote: >> On Wed, Aug 5, 2015 at 7:22 PM, Glen Barber wrote: >>> On Thu, Aug 06, 2015 at 04:17:23AM +0200, Pawel Jakub Dawidek wrote: >>>> On Mon, Aug 03, 2015 at 04:20:04PM +0300, Andriy Gapon wrote: >>>>> On 30/07/2015 10:24, K. Macy wrote: >>>>>> Just FYI this change introduces a deadlock with with the >>>>>> spa_namespace_lock. Mount will be holding this lock while trying >>>>>> to acquire the spa_namespace_lock. zfskern on the other hand >>>>>> holds the spa_namespace_lock when calling zfs_freebsd_access >>>>>> which in turn tries to acquire the teardown lock. >>>>> >>>>> I missed the fact that zpool.cache file is being written with >>>>> spa_namespace_lock held. I'll try to either resolve the problem in >>>>> the next day or I will revert the change. >>>> >>>> FYI, I'm hitting this deadlock on my laptop. Reverting the change >>>> fixes the problem. >>>> >>> >>> Since it is now 3 days after "I'll try to either resolve the problem >>> in the next day or I will revert the change", my view is that this >>> needs to be reverted now, if it hasn't been done already. >>> >> His proposed solution looks fine to me. Why don't we commit that? >> > > I must have missed the solution - was it part of this thread? If a > solution exists, then yes, that should be the fix instead. Sorry about this, again. I kind of hoped to get a review from Matt, but I guess I'll commit the potential fix sooner than later: https://reviews.freebsd.org/D3281 -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Aug 6 05:37:46 2015 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 84E669B419E; Thu, 6 Aug 2015 05:37:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::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 2C4A0CBA; Thu, 6 Aug 2015 05:37:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wibhh20 with SMTP id hh20so8559023wib.0; Wed, 05 Aug 2015 22:37:44 -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-type:content-disposition:in-reply-to:user-agent; bh=n8p6L2eyVr4lN3WcT90dZ8DV/eHYwGqrROZUyH4DVzc=; b=yHi8thPRkYS8Sl1GhD+aTgga4VabnkQatv4EdbAySCYn+Tp+V0TpVJjHoNzXcxVROk eYi42AtPnKhOSdk36R1PLA9dYnbuJ0VTsGs1X0rQoKCmdCK+cxXTS9jTq/nSwP6NkfEY pKSS5YeEXMfxR6C7ZEwikPPo6zqNumNqgAhd215+fRA0er5spcs0jMT61jXv4XHebd9p IR5AQJNyeRlXc9PeiBO765ygvwrbZAJt4nXkCmM+nV/1IzcHSkEgNy2tcx+9ABdKcWGI FY7L5i27lP3eS7JHBWraaZa8POc6s9MjCqQSUwFsRKLD01qTE2atJvXJWCDvt0OdYxAH MrJg== X-Received: by 10.180.104.8 with SMTP id ga8mr2842348wib.5.1438839464553; Wed, 05 Aug 2015 22:37:44 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id x6sm1302075wiy.6.2015.08.05.22.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 22:37:43 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 6 Aug 2015 07:37:41 +0200 From: Baptiste Daroussin To: NGie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286341 - head/usr.sbin/pw/tests Message-ID: <20150806053741.GB43782@ivaldir.etoilebsd.net> References: <201508052111.t75LBXah039414@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 05:37:46 -0000 --KFztAG8eRSV9hGtP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 05, 2015 at 10:11:05PM -0700, NGie Cooper wrote: > On Wed, Aug 5, 2015 at 2:11 PM, Baptiste Daroussin wro= te: > > Author: bapt > > Date: Wed Aug 5 21:11:32 2015 > > New Revision: 286341 > > URL: https://svnweb.freebsd.org/changeset/base/286341 > > > > Log: > > Add regression tests for a bug reported in stable/10 > > > > While pw(8) on head is not affected it is worth adding more regressio= n tests > > ensuring this bug will not happen unnoticed in the futur >=20 > With all of the changes that went into pw on head, it would be nice if > bugs like this were _actually_ fixed on stable branches, and the tests > (in and of themselves) could be backported. >=20 > Could you please look at the non-API/interface related changes here > and backport them so we could (in theory) keep things relatively > in-sync? I have been MFCing all the pw changes it has just stop due to 10.2-RELEASE.= The MFC will continue once 10.2 is out. Bapt --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXC8qUACgkQ8kTtMUmk6EwqcgCfa2B3fJ+cVAr00aCptzt+lIsH CBAAn2OC3x/DizTvubBhQR9qNfc3Sgd9 =BQL/ -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP-- From owner-svn-src-head@freebsd.org Thu Aug 6 06:47:30 2015 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 1E8879B4962; Thu, 6 Aug 2015 06:47:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 00A7ECD9; Thu, 6 Aug 2015 06:47:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t766lTKU077415; Thu, 6 Aug 2015 06:47:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t766lTCv077412; Thu, 6 Aug 2015 06:47:29 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508060647.t766lTCv077412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 6 Aug 2015 06:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286359 - head/sys/compat/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.20 Precedence: list List-Id: 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, 06 Aug 2015 06:47:30 -0000 Author: ed Date: Thu Aug 6 06:47:28 2015 New Revision: 286359 URL: https://svnweb.freebsd.org/changeset/base/286359 Log: Add file_open(): the underlying system call of openat(). CloudABI purely operates on file descriptor rights (CAP_*). File descriptor access modes (O_ACCMODE) are emulated on top of rights. Instead of accepting the traditional flags argument, file_open() copies in an fdstat_t object that contains the initial rights the descriptor should have, but also file descriptor flags that should persist after opening (APPEND, NONBLOCK, *SYNC). Only flags that don't persist (EXCL, TRUNC, CREAT, DIRECTORY) are passed in as an argument. file_open() first converts the rights, the persistent flags and the non-persistent flags to fflags. It then calls into vn_open(). If successful, it installs the file descriptor with the requested rights, trimming off rights that don't apply to the type of the file that has been opened. Unlike kern_openat(), this function does not support /dev/fd/*. I can't think of a reason why we need to support this for CloudABI. Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3235 Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_file.c head/sys/compat/cloudabi/cloudabi_util.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Thu Aug 6 01:49:18 2015 (r286358) +++ head/sys/compat/cloudabi/cloudabi_fd.c Thu Aug 6 06:47:28 2015 (r286359) @@ -290,7 +290,7 @@ cloudabi_convert_filetype(const struct f } /* Removes rights that conflict with the file descriptor type. */ -static void +void cloudabi_remove_conflicting_rights(cloudabi_filetype_t filetype, cloudabi_rights_t *base, cloudabi_rights_t *inheriting) { @@ -499,6 +499,25 @@ cloudabi_sys_fd_stat_get(struct thread * return (copyout(&fsb, (void *)uap->buf, sizeof(fsb))); } +/* Converts CloudABI rights to a set of Capsicum capabilities. */ +int +cloudabi_convert_rights(cloudabi_rights_t in, cap_rights_t *out) +{ + + cap_rights_init(out); +#define MAPPING(cloudabi, ...) do { \ + if (in & (cloudabi)) { \ + cap_rights_set(out, ##__VA_ARGS__); \ + in &= ~(cloudabi); \ + } \ +} while (0); + RIGHTS_MAPPINGS +#undef MAPPING + if (in != 0) + return (ENOTCAPABLE); + return (0); +} + int cloudabi_sys_fd_stat_put(struct thread *td, struct cloudabi_sys_fd_stat_put_args *uap) Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Thu Aug 6 01:49:18 2015 (r286358) +++ head/sys/compat/cloudabi/cloudabi_file.c Thu Aug 6 06:47:28 2015 (r286359) @@ -197,9 +197,128 @@ int cloudabi_sys_file_open(struct thread *td, struct cloudabi_sys_file_open_args *uap) { + cloudabi_fdstat_t fds; + cap_rights_t rights; + struct filecaps fcaps = {}; + struct nameidata nd; + struct file *fp; + struct vnode *vp; + char *path; + int error, fd, fflags; + bool read, write; + + error = copyin(uap->fds, &fds, sizeof(fds)); + if (error != 0) + return (error); + + /* All the requested rights should be set on the descriptor. */ + error = cloudabi_convert_rights( + fds.fs_rights_base | fds.fs_rights_inheriting, &rights); + if (error != 0) + return (error); + cap_rights_set(&rights, CAP_LOOKUP); - /* Not implemented. */ - return (ENOSYS); + /* Convert rights to corresponding access mode. */ + read = (fds.fs_rights_base & (CLOUDABI_RIGHT_FD_READ | + CLOUDABI_RIGHT_FILE_READDIR | CLOUDABI_RIGHT_MEM_MAP_EXEC)) != 0; + write = (fds.fs_rights_base & (CLOUDABI_RIGHT_FD_DATASYNC | + CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_ALLOCATE | + CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE)) != 0; + fflags = read ? write ? FREAD | FWRITE : FREAD : FWRITE; + + /* Convert open flags. */ + if ((uap->oflags & CLOUDABI_O_CREAT) != 0) { + fflags |= O_CREAT; + cap_rights_set(&rights, CAP_CREATE); + } + if ((uap->oflags & CLOUDABI_O_DIRECTORY) != 0) + fflags |= O_DIRECTORY; + if ((uap->oflags & CLOUDABI_O_EXCL) != 0) + fflags |= O_EXCL; + if ((uap->oflags & CLOUDABI_O_TRUNC) != 0) { + fflags |= O_TRUNC; + cap_rights_set(&rights, CAP_FTRUNCATE); + } + if ((fds.fs_flags & CLOUDABI_FDFLAG_APPEND) != 0) + fflags |= O_APPEND; + if ((fds.fs_flags & CLOUDABI_FDFLAG_NONBLOCK) != 0) + fflags |= O_NONBLOCK; + if ((fds.fs_flags & (CLOUDABI_FDFLAG_SYNC | CLOUDABI_FDFLAG_DSYNC | + CLOUDABI_FDFLAG_RSYNC)) != 0) { + fflags |= O_SYNC; + cap_rights_set(&rights, CAP_FSYNC); + } + if ((uap->fd & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) == 0) + fflags |= O_NOFOLLOW; + if (write && (fflags & (O_APPEND | O_TRUNC)) == 0) + cap_rights_set(&rights, CAP_SEEK); + + /* Allocate new file descriptor. */ + error = falloc_noinstall(td, &fp); + if (error != 0) + return (error); + fp->f_flag = fflags & FMASK; + + /* Open path. */ + error = copyin_path(uap->path, uap->pathlen, &path); + if (error != 0) { + fdrop(fp, td); + return (error); + } + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, uap->fd, + &rights, td); + error = vn_open(&nd, &fflags, 0777 & ~td->td_proc->p_fd->fd_cmask, fp); + cloudabi_freestr(path); + if (error != 0) { + /* Custom operations provided. */ + if (error == ENXIO && fp->f_ops != &badfileops) + goto success; + + /* + * POSIX compliance: return ELOOP in case openat() is + * called on a symbolic link and O_NOFOLLOW is set. + */ + if (error == EMLINK) + error = ELOOP; + fdrop(fp, td); + return (error); + } + NDFREE(&nd, NDF_ONLY_PNBUF); + filecaps_free(&nd.ni_filecaps); + fp->f_vnode = vp = nd.ni_vp; + + /* Install vnode operations if no custom operations are provided. */ + if (fp->f_ops == &badfileops) { + fp->f_seqcount = 1; + finit(fp, (fflags & FMASK) | (fp->f_flag & FHASLOCK), + DTYPE_VNODE, vp, &vnops); + } + VOP_UNLOCK(vp, 0); + + /* Truncate file. */ + if (fflags & O_TRUNC) { + error = fo_truncate(fp, 0, td->td_ucred, td); + if (error != 0) { + fdrop(fp, td); + return (error); + } + } + +success: + /* Determine which Capsicum rights to set on the file descriptor. */ + cloudabi_remove_conflicting_rights(cloudabi_convert_filetype(fp), + &fds.fs_rights_base, &fds.fs_rights_inheriting); + cloudabi_convert_rights(fds.fs_rights_base | fds.fs_rights_inheriting, + &fcaps.fc_rights); + if (cap_rights_is_set(&fcaps.fc_rights)) + fcaps.fc_fcntls = CAP_FCNTL_SETFL; + + error = finstall(td, fp, &fd, fflags, &fcaps); + fdrop(fp, td); + if (error != 0) + return (error); + td->td_retval[0] = fd; + return (0); } /* Converts a FreeBSD directory entry structure and writes it to userspace. */ Modified: head/sys/compat/cloudabi/cloudabi_util.h ============================================================================== --- head/sys/compat/cloudabi/cloudabi_util.h Thu Aug 6 01:49:18 2015 (r286358) +++ head/sys/compat/cloudabi/cloudabi_util.h Thu Aug 6 06:47:28 2015 (r286359) @@ -50,6 +50,13 @@ void cloudabi_convert_sockaddr(const str /* Converts a file descriptor to a CloudABI file descriptor type. */ cloudabi_filetype_t cloudabi_convert_filetype(const struct file *); +/* Converts CloudABI rights to a set of Capsicum capabilities. */ +int cloudabi_convert_rights(cloudabi_rights_t, cap_rights_t *); + +/* Removes rights that conflict with the file descriptor type. */ +void cloudabi_remove_conflicting_rights(cloudabi_filetype_t, + cloudabi_rights_t *, cloudabi_rights_t *); + /* Converts a struct timespec to a CloudABI timestamp. */ int cloudabi_convert_timespec(const struct timespec *, cloudabi_timestamp_t *); From owner-svn-src-head@freebsd.org Thu Aug 6 07:21:35 2015 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 D51419B53F6; Thu, 6 Aug 2015 07:21:35 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::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 90EB2B0; Thu, 6 Aug 2015 07:21:35 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykax123 with SMTP id x123so55881011yka.1; Thu, 06 Aug 2015 00:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bkS61TgweCkR0TMr8XWa/zcuNzIYPsYz0ZBX+NvaSNI=; b=b3kG1WtfxzBCWko4yHwEaeCr+ms8mqfox6ZBGvIvYgr8mExrWeTcbQKaY5cDZYPRlh leBDn29BtxlQKB5ufqC9oYPcvw2xzDcbYCxslxTcxQEqpmNnfgf1TzyWhLZ00gBPHFn4 W0Fenh/DJCV/8OL9GBxHYFGrlvIR0EIbWGtD1I0OUPKdLoFgUWZSM1fLAengAzcUqq19 0uwWv2AFfzavHgCHCv0oSucL0qNKihXOK+BqFNKgbgZK+IfqE+cSCGTYNI4H8VJQDxeT /vipm+JxfMLLau4Y3sJBK1aurUZJbgGl5C5OdBREggu7LJQeUL5z4kCCSnv8IM1y01HG E/3Q== MIME-Version: 1.0 X-Received: by 10.170.88.212 with SMTP id f203mr193797yka.34.1438845694602; Thu, 06 Aug 2015 00:21:34 -0700 (PDT) Received: by 10.129.83.139 with HTTP; Thu, 6 Aug 2015 00:21:34 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Thu, 6 Aug 2015 09:21:34 +0200 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Oliver Pinter Cc: Adrian Chadd , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 07:21:36 -0000 I did the port for pfSense and the whole stack works from HEAD into 10-STABLE. Just minor modifications were required. If you want i can try to send the diff. On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter < oliver.pinter@hardenedbsd.org> wrote: > Yup. :) If you need testers with the backport, then ping me. ;) > > On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd wrote: > > The whole wifi stack / drivers need backporting. :) > > > > > > > > -a > > > > > > On 5 August 2015 at 12:41, Shawn Webb > wrote: > >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: > >>> Author: adrian > >>> Date: Wed Aug 5 19:32:35 2015 > >>> New Revision: 286337 > >>> URL: https://svnweb.freebsd.org/changeset/base/286337 > >>> > >>> Log: > >>> Add TXOP enforce support to the AR9300 HAL. > >>> > >>> This is required for (more) correct TDMA support. Without it, the > >>> code tries to calculate the required guard interval based on the > >>> current rate, and since this is an 11n NIC and people try using > >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then > >>> panics. > >>> > >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it > >>> have one less bug. > >>> > >>> Reported by: Berislav Purgar > >>> > >>> Modified: > >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c > >> > >> Hey Adrian, > >> > >> Can this be MFC'd? > >> > >> Thanks, > >> > >> -- > >> Shawn Webb > >> HardenedBSD > >> > >> GPG Key ID: 0x6A84658F52456EEE > >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > -- Ermal From owner-svn-src-head@freebsd.org Thu Aug 6 07:47:14 2015 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 9E2C99B58B5; Thu, 6 Aug 2015 07:47:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8EC22C2E; Thu, 6 Aug 2015 07:47:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t767lEi0001865; Thu, 6 Aug 2015 07:47:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t767lEDw001864; Thu, 6 Aug 2015 07:47:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508060747.t767lEDw001864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 6 Aug 2015 07:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286360 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 07:47:14 -0000 Author: trasz Date: Thu Aug 6 07:47:13 2015 New Revision: 286360 URL: https://svnweb.freebsd.org/changeset/base/286360 Log: Tweak mdconfig(8) manual page, in particular revise the EXAMPLES section. This removes stuff that doesn't really belong there, and simplifies examples for the basic operations. Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3198 Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Thu Aug 6 06:47:28 2015 (r286359) +++ head/sbin/mdconfig/mdconfig.8 Thu Aug 6 07:47:13 2015 (r286360) @@ -37,12 +37,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2013 +.Dd August 6, 2015 .Dt MDCONFIG 8 .Os .Sh NAME .Nm mdconfig -.Nd configure and enable memory disks +.Nd create and control memory disks .Sh SYNOPSIS .Nm .Fl a @@ -75,7 +75,7 @@ .Sh DESCRIPTION The .Nm -utility configures and enables +utility creates and controls .Xr md 4 devices. .Pp @@ -103,7 +103,7 @@ If the .Fl o Cm reserve option is not set, creating and filling a large malloc-backed memory disk is a very easy way to -panic a system. +panic the system. .It Cm vnode A file specified with .Fl f Ar file @@ -164,7 +164,9 @@ or .Cm t which denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. -The +When used without the +.Fl r +option, the .Fl a and .Fl t Ar swap @@ -206,6 +208,11 @@ Enable/disable compression features to r .It Oo Cm no Oc Ns Cm force Disable/enable extra sanity checks to prevent the user from doing something that might adversely affect the system. +This can be used with the +.Fl u +flag to forcibly destroy an +.Xr md 4 +disk that is still in use. .It Oo Cm no Oc Ns Cm readonly Enable/disable readonly mode. .El @@ -227,66 +234,58 @@ is provided for convenience as an abbrev .Fl t Ar vnode .Fl f Ar file . .Sh EXAMPLES -Create a 4 megabyte -.Xr malloc 9 -backed memory disk. -The name of the allocated unit will be printed on stdout, such as -.Dq Li md3 : -.Pp -.Dl mdconfig -a -t malloc -s 4m -.Pp -Create a disk named -.Pa /dev/md4 -with +Create a disk with .Pa /tmp/boot.flp -as backing storage: +as backing storage. +The name of the allocated unit will be printed on stdout, such as +.Dq Li md0 : +.Bd -literal -offset indent +mdconfig /tmp/boot.flp +.Ed .Pp -.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u md4 +Create a 1 gigabyte swap backed memory disk named +.Dq Li md3 : +.Bd -literal -offset indent +mdconfig -s 1g -u md3 +.Ed .Pp Detach and free all resources used by -.Pa /dev/md4 : +.Pa /dev/md3 : +.Bd -literal -offset indent +mdconfig -du md3 +.Ed +.Pp +Show detailed information on current memory disks: +.Bd -literal -offset indent +mdconfig -lv +.Ed .Pp -.Dl mdconfig -d -u md4 +Resize the +.Dq Li md3 +memory disk to 2 gigabytes: +.Bd -literal -offset indent +mdconfig -rs 2g -u md3 +.Ed .Pp -Create a 128MByte swap backed disk, initialize an +Create a 1 gigabyte swap backed disk, initialize an .Xr ffs 7 file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent -mdconfig -a -t swap -s 128M -u md10 +mdconfig -s 1g -u md10 newfs -U /dev/md10 mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -Create a 5MB file-backed disk -.Po Fl a -and -.Fl t Ar vnode -are implied -.Pc : -.Bd -literal -offset indent -dd if=/dev/zero of=somebackingfile bs=1k count=5k -mdconfig -f somebackingfile -u md0 -bsdlabel -w md0 auto -newfs md0c -mount /dev/md0c /mnt -.Ed -.Pp -Create an -.Xr md 4 -device out of an ISO 9660 CD image file -.Po Fl a -and -.Fl t Ar vnode -are implied -.Pc , using the first available +Create a memory disk out of an ISO 9660 CD image file, +using the first available .Xr md 4 -device, and then mount the new memory disk: +device, and then mount it: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt -.Pp .Ed +.Pp Create a file-backed device from a hard disk image that begins with 512K of raw header information. .Xr gnop 8 @@ -294,7 +293,7 @@ is used to skip over the header informat .Pa md1.nop to the start of the filesystem in the image. .Bd -literal -offset indent -mdconfig -f diskimage.img -u md1 +mdconfig -u md1 -f diskimage.img gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed From owner-svn-src-head@freebsd.org Thu Aug 6 07:49:35 2015 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 879409B5927; Thu, 6 Aug 2015 07:49:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 78AF6DA8; Thu, 6 Aug 2015 07:49:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t767nZh6002054; Thu, 6 Aug 2015 07:49:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t767nZrI002053; Thu, 6 Aug 2015 07:49:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508060749.t767nZrI002053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 6 Aug 2015 07:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286361 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 07:49:35 -0000 Author: trasz Date: Thu Aug 6 07:49:34 2015 New Revision: 286361 URL: https://svnweb.freebsd.org/changeset/base/286361 Log: Whoops, wrong flag. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Thu Aug 6 07:47:13 2015 (r286360) +++ head/sbin/mdconfig/mdconfig.8 Thu Aug 6 07:49:34 2015 (r286361) @@ -209,7 +209,7 @@ Enable/disable compression features to r Disable/enable extra sanity checks to prevent the user from doing something that might adversely affect the system. This can be used with the -.Fl u +.Fl d flag to forcibly destroy an .Xr md 4 disk that is still in use. From owner-svn-src-head@freebsd.org Thu Aug 6 08:24:22 2015 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 A04279B43A4 for ; Thu, 6 Aug 2015 08:24:22 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) (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 729C583D for ; Thu, 6 Aug 2015 08:24:21 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by obnw1 with SMTP id w1so50377792obn.3 for ; Thu, 06 Aug 2015 01:24:20 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GN20HR/SChsTItDJfPfz7rtG0HQOUk6ouHuDJ1elWgY=; b=jWdhImaqrReL6OAPjpM+HvfxdC1JxbG0Fyz3/ZO1N+D0i5fQibhcvQ1iigsH+/5KC+ gPaVEFFm815o4vpCf3rNpI/1rNN7hTZg7T1Ni5SSU/yEXsx3jfj96aOQOweqNe4RCYsa 1NUcXQAb0uG3qgtQJrMZ7vy18Dmqh99p94766YqmSwjzn91QC55Ap5VkLedvEEadUXCT e0XXgojUTAoVsjq911WH25eDvrZom7DnVbFRc9KCf1RINOECwVTBIaWoaGqKX2baZLq8 oipWSxUuaROlwzMv0vE97+fZ/m2+gPpQf2qWdVJobmda5h23Ij+IQneSznAffI9bYbek fMsw== X-Gm-Message-State: ALoCoQlMRPJj9ReVAmbNQoz1tq600XVzZbqybcQg0exrVFmFXZJrGhM2skwlHThdXbdBs78KY9jg MIME-Version: 1.0 X-Received: by 10.182.20.141 with SMTP id n13mr459538obe.26.1438849460797; Thu, 06 Aug 2015 01:24:20 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Thu, 6 Aug 2015 01:24:20 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <55C23EB1.20903@FreeBSD.org> References: <201508051615.t75GFhdD003652@repo.freebsd.org> <55C23EB1.20903@FreeBSD.org> Date: Thu, 6 Aug 2015 10:24:20 +0200 Message-ID: Subject: Re: svn commit: r286323 - head/sys/compat/cloudabi From: Ed Schouten To: Pedro Giffuni Cc: Ed Schouten , svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 08:24:22 -0000 Hi Pedro, 2015-08-05 18:49 GMT+02:00 Pedro Giffuni : > This just reminded me: > > Clang has support for type-safety attributes[1] for fcntl and ioctls. > > I gave them a try[2] but they broke compatibility. > For a clean ABI you should consider them. That's interesting. That could also be useful for [gs]etsockopt(). Will take a look! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK/VAT number: 62051717 From owner-svn-src-head@freebsd.org Thu Aug 6 08:52:49 2015 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 6FC7E9B4B60; Thu, 6 Aug 2015 08:52:49 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::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 EB647156A; Thu, 6 Aug 2015 08:52:48 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: by labkb6 with SMTP id kb6so22824805lab.2; Thu, 06 Aug 2015 01:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=chE5PsGkPLlHlpwjUmxnMOfxFMiEjHYadlq+ZNj2bBU=; b=whhWjEhUo8BBS3iQRyBSSa5chPvtdCJ70GLnT0I+ofrAN2Yo5OWGwhANMHjGmj0y9J uOG+JO1Mq04moFWR8Lg5txEXIsBQDOCneva8EhpjhWLCal2eVOumY05SAu47MJg/xT9Z +0sdYdWZFl85/ToeoSxSty28vAn/ghnIHPpd/sSjjBVKt27N5Aa1Vn2jtsHJwE6ixeLQ 3twwdcPuQy9XYJTf/jbmtmbNKrP4k2uWJWJhMxU0Mn3Z+JXWQ0HajBh9bdpB6j/jyg2S J0OuWBu7dw/ugWuhG54ZZoCGpbKfGBUI+gMxHGX1HfaiNQ1jdOyDb+dSBativjUhlCq9 STmg== X-Received: by 10.152.87.72 with SMTP id v8mr530718laz.62.1438851167080; Thu, 06 Aug 2015 01:52:47 -0700 (PDT) Received: from [10.0.1.6] (broadband-5-228-251-172.nationalcablenetworks.ru. [5.228.251.172]) by smtp.gmail.com with ESMTPSA id u3sm1206158laj.31.2015.08.06.01.52.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Aug 2015 01:52:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286329 - in head/etc: defaults rc.d From: Dmitry Sivachenko In-Reply-To: <201508051738.t75Hc2MP038354@repo.freebsd.org> Date: Thu, 6 Aug 2015 11:52:44 +0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <92FC24C2-8B61-4B02-87E0-D4C6D4DA8ECF@gmail.com> References: <201508051738.t75Hc2MP038354@repo.freebsd.org> To: Edward Tomasz Napierala X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 08:52:49 -0000 > On 5 =D0=B0=D0=B2=D0=B3. 2015 =D0=B3., at 20:38, Edward Tomasz = Napierala wrote: >=20 > Author: trasz > Date: Wed Aug 5 17:38:02 2015 > New Revision: 286329 > URL: https://svnweb.freebsd.org/changeset/base/286329 >=20 > Log: > Make rctl_enable rc variable actually work. To avoid breaking = existing > setups that worked before, flip the default to "YES". Most people = don't > have /etc/rctl.conf, so they won't be affected in any way. >=20 > MFC after: 1 month > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/rctl >=20 > Modified: head/etc/defaults/rc.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/defaults/rc.conf Wed Aug 5 17:21:42 2015 = (r286328) > +++ head/etc/defaults/rc.conf Wed Aug 5 17:38:02 2015 = (r286329) > @@ -664,7 +664,7 @@ opensm_enable=3D"NO" # Opensm(8) for infin > casperd_enable=3D"YES" # casperd(8) daemon >=20 > # rctl(8) requires kernel options RACCT and RCTL > -rctl_enable=3D"NO" # Load rctl(8) rules on boot > +rctl_enable=3D"YES" # Load rctl(8) rules on boot Sad to see that rarely used feature has default as "YES". PS: Please adjust rc.conf(5) accordingly, it assumes the default is NO. From owner-svn-src-head@freebsd.org Thu Aug 6 12:29:08 2015 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 BD9A19B44E5 for ; Thu, 6 Aug 2015 12:29:08 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (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 6E6CA1178 for ; Thu, 6 Aug 2015 12:29:08 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wibxm9 with SMTP id xm9so20451623wib.0 for ; Thu, 06 Aug 2015 05:29:00 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=b1rRbvGQnJvoe7Gl6dyOm4DsJggFDW8mwGfH/x943Hk=; b=TIMAE58zSlqrzkhzBKA6dGVF14yoAI85aCNdjfTIaRKfnvtPovgylW+5F8fOmeUiT9 /9Yl4/qpG1bra9d5wMwLsXnPwbYZvM/AC9v6oIMHyqGmY0GZnufXb6weUmULvO1EG0Dc 9qiAKLcnbdVMiiUxfZcP/SkYQfENGkNMNy5sLMMXEs/PlOKNeplolfOzuWkacr9OMNi+ 5tyMV9xlKOhmtsp1RQLk/NXnFv95mRkvY+C82/3CkNljXFsSsxp5hRStm5HJVTaBbQla dgFaroQ+oJJYg5X3woT2bzR0cCIOpjA207qgMeGO5BmG5ij3gmr3JkxZwO8XobQocR80 TVYQ== X-Gm-Message-State: ALoCoQkwZFdyyUwY/kxYAIsyZsRfoMYmyT1+TrJ3tlgM2ZOqSnhKZGrgvSx1FduG1uDH+/5/uK3K MIME-Version: 1.0 X-Received: by 10.180.184.168 with SMTP id ev8mr6076553wic.28.1438864140790; Thu, 06 Aug 2015 05:29:00 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Thu, 6 Aug 2015 05:29:00 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Thu, 6 Aug 2015 14:29:00 +0200 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= Cc: Adrian Chadd , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@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.20 Precedence: list List-Id: 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, 06 Aug 2015 12:29:08 -0000 Cool! Please send me the patch. :) Thank you! (My last sync was from 2014 August or November in my branch: https://github.com/opntr/pkg/commit/f6c84ecd8a30a77eeefd8106496e6692d634819= 0 ) On 8/6/15, Ermal Lu=C3=A7i wrote: > I did the port for pfSense and the whole stack works from HEAD into > 10-STABLE. > > Just minor modifications were required. > If you want i can try to send the diff. > > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter < > oliver.pinter@hardenedbsd.org> wrote: > >> Yup. :) If you need testers with the backport, then ping me. ;) >> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd wrote= : >> > The whole wifi stack / drivers need backporting. :) >> > >> > >> > >> > -a >> > >> > >> > On 5 August 2015 at 12:41, Shawn Webb >> wrote: >> >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >> >>> Author: adrian >> >>> Date: Wed Aug 5 19:32:35 2015 >> >>> New Revision: 286337 >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337 >> >>> >> >>> Log: >> >>> Add TXOP enforce support to the AR9300 HAL. >> >>> >> >>> This is required for (more) correct TDMA support. Without it, the >> >>> code tries to calculate the required guard interval based on the >> >>> current rate, and since this is an 11n NIC and people try using >> >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then >> >>> panics. >> >>> >> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it >> >>> have one less bug. >> >>> >> >>> Reported by: Berislav Purgar >> >>> >> >>> Modified: >> >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c >> >> >> >> Hey Adrian, >> >> >> >> Can this be MFC'd? >> >> >> >> Thanks, >> >> >> >> -- >> >> Shawn Webb >> >> HardenedBSD >> >> >> >> GPG Key ID: 0x6A84658F52456EEE >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 >> >> 6EEE >> > _______________________________________________ >> > svn-src-head@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/svn-src-head >> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org= " >> >> > > > -- > Ermal > From owner-svn-src-head@freebsd.org Thu Aug 6 13:04:00 2015 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 C1E439B4F80; Thu, 6 Aug 2015 13:04:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::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 89C8586C; Thu, 6 Aug 2015 13:04:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igr7 with SMTP id 7so10429848igr.0; Thu, 06 Aug 2015 06:03:59 -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:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=dKQ34UhLkIvGdemeDTZRFGqDPapPur/dbO6EibERmy0=; b=q/a5UZrTfaI8iaLlHAmfyWV5SZILvWeK3oGMDVC1/hlFsqJct65NoJm9EaYrk7mB5o ODyYO0QbT37/aYzf3RWKBGEy4y+DlbaZai7PeuX+5a3CdbbPBB8o0OPLA52CyiYq83Nn XTwLIOx6WqD17o5QzlDIGm18B5Utp5JI8hgQ/s07LBYQD9mAvpb5KoxzsnLX/cGfQn00 oDyFo70NtJd/A99j8MU5msxgdro8FMh2d2GEZjAEmlxum4aZ4D5egxXMsvdmF9xAhhdP tHA4Tq7Vzqglw7MaVcdZ8NKlh/8Uxx1UEHZoU/WWs1elKOQ/XOY2UDoCB7dFHs4ogYGt GMkw== MIME-Version: 1.0 X-Received: by 10.50.43.227 with SMTP id z3mr3271177igl.22.1438866239889; Thu, 06 Aug 2015 06:03:59 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Thu, 6 Aug 2015 06:03:59 -0700 (PDT) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> Date: Thu, 6 Aug 2015 06:03:59 -0700 X-Google-Sender-Auth: l6kPeoL2ob_Vez-Cof0CDxez3ik Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Adrian Chadd To: =?UTF-8?Q?Ermal_Lu=C3=A7i?= Cc: Oliver Pinter , Shawn Webb , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@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.20 Precedence: list List-Id: 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, 06 Aug 2015 13:04:01 -0000 Ermal - yes please. :) Or, just do the MFC yourself. :) -a On 6 August 2015 at 00:21, Ermal Lu=C3=A7i wrote: > I did the port for pfSense and the whole stack works from HEAD into > 10-STABLE. > > Just minor modifications were required. > If you want i can try to send the diff. > > On Wed, Aug 5, 2015 at 11:55 PM, Oliver Pinter > wrote: >> >> Yup. :) If you need testers with the backport, then ping me. ;) >> >> On Wed, Aug 5, 2015 at 11:23 PM, Adrian Chadd wrote= : >> > The whole wifi stack / drivers need backporting. :) >> > >> > >> > >> > -a >> > >> > >> > On 5 August 2015 at 12:41, Shawn Webb >> > wrote: >> >> On Wed, 2015-08-05 at 19:32 +0000, Adrian Chadd wrote: >> >>> Author: adrian >> >>> Date: Wed Aug 5 19:32:35 2015 >> >>> New Revision: 286337 >> >>> URL: https://svnweb.freebsd.org/changeset/base/286337 >> >>> >> >>> Log: >> >>> Add TXOP enforce support to the AR9300 HAL. >> >>> >> >>> This is required for (more) correct TDMA support. Without it, the >> >>> code tries to calculate the required guard interval based on the >> >>> current rate, and since this is an 11n NIC and people try using >> >>> 11n, it calls ath_hal_computetxtime() on an 11n rate which then >> >>> panics. >> >>> >> >>> This doesn't fix TDMA slave mode on AR9300 - it just makes it >> >>> have one less bug. >> >>> >> >>> Reported by: Berislav Purgar >> >>> >> >>> Modified: >> >>> head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c >> >> >> >> Hey Adrian, >> >> >> >> Can this be MFC'd? >> >> >> >> Thanks, >> >> >> >> -- >> >> Shawn Webb >> >> HardenedBSD >> >> >> >> GPG Key ID: 0x6A84658F52456EEE >> >> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6E= EE >> > _______________________________________________ >> > svn-src-head@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/svn-src-head >> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org= " >> > > > > -- > Ermal From owner-svn-src-head@freebsd.org Thu Aug 6 14:05:19 2015 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 5575F9B4E06; Thu, 6 Aug 2015 14:05:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4612333B; Thu, 6 Aug 2015 14:05:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76E5JNu057736; Thu, 6 Aug 2015 14:05:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76E5Ig0057734; Thu, 6 Aug 2015 14:05:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508061405.t76E5Ig0057734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 6 Aug 2015 14:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286363 - head/sys/dev/wtap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 14:05:19 -0000 Author: glebius Date: Thu Aug 6 14:05:17 2015 New Revision: 286363 URL: https://svnweb.freebsd.org/changeset/base/286363 Log: Make it compilable. No idea if it works. Modified: head/sys/dev/wtap/if_wtap.c head/sys/dev/wtap/if_wtapvar.h Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Thu Aug 6 08:51:15 2015 (r286362) +++ head/sys/dev/wtap/if_wtap.c Thu Aug 6 14:05:17 2015 (r286363) @@ -163,13 +163,13 @@ wtap_media_change(struct ifnet *ifp) */ static void wtap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, - int subtype, int rssi, int nf) + int subtype, const struct ieee80211_rx_stats *stats, int rssi, int nf) { struct ieee80211vap *vap = ni->ni_vap; #if 0 DWTAP_PRINTF("[%d] %s\n", myath_id(ni), __func__); #endif - WTAP_VAP(vap)->av_recv_mgmt(ni, m, subtype, rssi, nf); + WTAP_VAP(vap)->av_recv_mgmt(ni, m, subtype, stats, rssi, nf); } static int Modified: head/sys/dev/wtap/if_wtapvar.h ============================================================================== --- head/sys/dev/wtap/if_wtapvar.h Thu Aug 6 08:51:15 2015 (r286362) +++ head/sys/dev/wtap/if_wtapvar.h Thu Aug 6 14:05:17 2015 (r286363) @@ -120,7 +120,7 @@ struct wtap_vap { struct callout av_swba; /* software beacon alert */ uint32_t av_bcinterval; /* beacon interval */ void (*av_recv_mgmt)(struct ieee80211_node *, - struct mbuf *, int, int, int); + struct mbuf *, int, const struct ieee80211_rx_stats *, int, int); int (*av_newstate)(struct ieee80211vap *, enum ieee80211_state, int); void (*av_bmiss)(struct ieee80211vap *); From owner-svn-src-head@freebsd.org Thu Aug 6 14:13:03 2015 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 94D169B40AF; Thu, 6 Aug 2015 14:13:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8558AD13; Thu, 6 Aug 2015 14:13:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76ED3q4061822; Thu, 6 Aug 2015 14:13:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76ED3RX061821; Thu, 6 Aug 2015 14:13:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201508061413.t76ED3RX061821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Aug 2015 14:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286364 - head/release/doc/en_US.ISO8859-1/relnotes stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 14:13:03 -0000 Author: gjb Date: Thu Aug 6 14:13:01 2015 New Revision: 286364 URL: https://svnweb.freebsd.org/changeset/base/286364 Log: Fix a typo. Submitted by: pkelsey Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Aug 6 14:05:17 2015 (r286363) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Aug 6 14:13:01 2015 (r286364) @@ -1405,7 +1405,7 @@ &os;. - Network Procols + Network Protocols Support for the IPX network transport protocol has been removed, and will not be supported in From owner-svn-src-head@freebsd.org Thu Aug 6 14:49:24 2015 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 A23C99B498C; Thu, 6 Aug 2015 14:49:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 934003C5; Thu, 6 Aug 2015 14:49:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76EnODS074227; Thu, 6 Aug 2015 14:49:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76EnOws074226; Thu, 6 Aug 2015 14:49:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508061449.t76EnOws074226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 6 Aug 2015 14:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286366 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 14:49:24 -0000 Author: andrew Date: Thu Aug 6 14:49:23 2015 New Revision: 286366 URL: https://svnweb.freebsd.org/changeset/base/286366 Log: Fill in dump_avail based on the physical memory from EFI. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Aug 6 14:13:44 2015 (r286365) +++ head/sys/arm64/arm64/machdep.c Thu Aug 6 14:49:23 2015 (r286366) @@ -822,8 +822,13 @@ initarm(struct arm64_bootparams *abp) /* Print the memory map */ mem_len = 0; - for (i = 0; i < physmap_idx; i += 2) + for (i = 0; i < physmap_idx; i += 2) { + dump_avail[i] = physmap[i]; + dump_avail[i + 1] = physmap[i + 1]; mem_len += physmap[i + 1] - physmap[i]; + } + dump_avail[i] = 0; + dump_avail[i + 1] = 0; /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; From owner-svn-src-head@freebsd.org Thu Aug 6 15:30:15 2015 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 68C099B476F; Thu, 6 Aug 2015 15:30:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 59FAD8B4; Thu, 6 Aug 2015 15:30:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76FUFt6091097; Thu, 6 Aug 2015 15:30:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76FUFEX091096; Thu, 6 Aug 2015 15:30:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201508061530.t76FUFEX091096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 6 Aug 2015 15:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286367 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 15:30:15 -0000 Author: ngie Date: Thu Aug 6 15:30:14 2015 New Revision: 286367 URL: https://svnweb.freebsd.org/changeset/base/286367 Log: Make some debug printf's into DPRINTF's to reduce noise on attach/detach Differential Revision: https://reviews.freebsd.org/D3306 MFC after: 1 week Reviewed by: loos Sponsored by: EMC / Isilon Storage Division Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Thu Aug 6 14:49:23 2015 (r286366) +++ head/sys/geom/uzip/g_uzip.c Thu Aug 6 15:30:14 2015 (r286367) @@ -94,8 +94,8 @@ g_uzip_softc_free(struct g_uzip_softc *s { if (gp != NULL) { - printf("%s: %d requests, %d cached\n", - gp->name, sc->req_total, sc->req_cached); + DPRINTF(("%s: %d requests, %d cached\n", + gp->name, sc->req_total, sc->req_cached)); } if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UZIP); @@ -519,7 +519,7 @@ g_uzip_taste(struct g_class *mp, struct gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); + DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz)); return (gp); err: @@ -547,7 +547,7 @@ g_uzip_destroy_geom(struct gctl_req *req g_topology_assert(); if (gp->softc == NULL) { - printf("%s(%s): gp->softc == NULL\n", __func__, gp->name); + DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name)); return (ENXIO); } From owner-svn-src-head@freebsd.org Thu Aug 6 16:07:32 2015 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 4B82F9B59A2; Thu, 6 Aug 2015 16:07:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 39EF65F6; Thu, 6 Aug 2015 16:07:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76G7Wnq007283; Thu, 6 Aug 2015 16:07:32 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76G7SL8007270; Thu, 6 Aug 2015 16:07:28 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201508061607.t76G7SL8007270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 6 Aug 2015 16:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286368 - in head: . sys/boot/forth sys/boot/i386/loader sys/boot/mips/beri/loader sys/boot/pc98/loader sys/boot/powerpc/kboot sys/boot/powerpc/ofw sys/boot/powerpc/ps3 sys/boot/sparc64... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 16:07:32 -0000 Author: allanjude Date: Thu Aug 6 16:07:27 2015 New Revision: 286368 URL: https://svnweb.freebsd.org/changeset/base/286368 Log: Remove guards around overwriting loader.rc and menu.rc There have been .local version of each for user modifications for some time This allows users to receive future updates to these files PR: 183765 Submitted by: Bertram Scharpf, Nikolai Lifanov (patch) Reviewed by: dteske, loos, eadler Approved by: bapt (mentor) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3176 Modified: head/UPDATING head/sys/boot/forth/loader.rc head/sys/boot/forth/menu.rc head/sys/boot/i386/loader/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/pc98/loader/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 6 15:30:14 2015 (r286367) +++ head/UPDATING Thu Aug 6 16:07:27 2015 (r286368) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150806: + The menu.rc and loader.rc files will now be replaced during + upgrades. Please migrate local changes to menu.rc.local and + loader.rc.local instead. + 20150805: GNU Binutils versions of addr2line, c++filt, nm, readelf, size, strings and strip have been removed. The src.conf(5) knob Modified: head/sys/boot/forth/loader.rc ============================================================================== --- head/sys/boot/forth/loader.rc Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/forth/loader.rc Thu Aug 6 16:07:27 2015 (r286368) @@ -1,6 +1,9 @@ \ Loader.rc \ $FreeBSD$ \ +\ You should not edit this file! Put any overrides in loader.rc.local +\ instead as this file can be replaced during system updates. +\ \ Includes additional commands include /boot/loader.4th try-include /boot/loader.rc.local Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/forth/menu.rc Thu Aug 6 16:07:27 2015 (r286368) @@ -1,6 +1,9 @@ \ Menu.rc \ $FreeBSD$ \ +\ You should not edit this file! Put any overrides in menu.rc.local +\ instead as this file can be replaced during system updates. +\ \ Load required Forth modules include /boot/version.4th include /boot/brand.4th Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/i386/loader/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -110,12 +110,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b .include "${.CURDIR}/../../forth/Makefile.inc" FILES+= pcibios.4th -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/mips/beri/loader/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -125,13 +125,7 @@ loader.help: help.common help.mips .PATH: ${.CURDIR}/../../../forth .include "${.CURDIR}/../../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .if defined(LOADER_USB_SUPPORT) # Do garbage collection Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/pc98/loader/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -90,12 +90,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= ${.CURDIR}/../../i386/loader/loader.rc -.endif -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= ${.CURDIR}/../../i386/loader/loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/powerpc/kboot/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -117,12 +117,6 @@ loader.help: help.common help.kboot ${.C .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/powerpc/ofw/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -112,12 +112,6 @@ loader.help: help.common help.ofw ${.CUR .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/powerpc/ps3/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -114,12 +114,6 @@ loader.help: help.common help.ps3 ${.CUR .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Thu Aug 6 15:30:14 2015 (r286367) +++ head/sys/boot/sparc64/loader/Makefile Thu Aug 6 16:07:27 2015 (r286368) @@ -99,12 +99,6 @@ loader.help: help.common help.sparc64 .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include From owner-svn-src-head@freebsd.org Thu Aug 6 16:12:14 2015 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 47D029B5B5A; Thu, 6 Aug 2015 16:12:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 33C08B8C; Thu, 6 Aug 2015 16:12:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76GCE5H011109; Thu, 6 Aug 2015 16:12:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76GCDcp011106; Thu, 6 Aug 2015 16:12:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061612.t76GCDcp011106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 16:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286369 - head/tests/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.20 Precedence: list List-Id: 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, 06 Aug 2015 16:12:14 -0000 Author: jhb Date: Thu Aug 6 16:12:12 2015 New Revision: 286369 URL: https://svnweb.freebsd.org/changeset/base/286369 Log: Convert the map_at_zero test case to ATF. In particular, this will facilitate adding more mmap() tests. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3268 Modified: head/tests/sys/vm/Makefile head/tests/sys/vm/mmap_test.c Modified: head/tests/sys/vm/Makefile ============================================================================== --- head/tests/sys/vm/Makefile Thu Aug 6 16:07:27 2015 (r286368) +++ head/tests/sys/vm/Makefile Thu Aug 6 16:12:12 2015 (r286369) @@ -2,6 +2,6 @@ TESTSDIR= ${TESTSBASE}/sys/vm -TAP_TESTS_C+= mmap_test +ATF_TESTS_C+= mmap_test .include Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Thu Aug 6 16:07:27 2015 (r286368) +++ head/tests/sys/vm/mmap_test.c Thu Aug 6 16:12:12 2015 (r286369) @@ -29,16 +29,14 @@ #include #include #include -#include +#include #include -#include -#include static const struct { void *addr; int ok[2]; /* Depending on security.bsd.map_at_zero {0, !=0}. */ -} tests[] = { +} map_at_zero_tests[] = { { (void *)0, { 0, 1 } }, /* Test sysctl. */ { (void *)1, { 0, 0 } }, { (void *)(PAGE_SIZE - 1), { 0, 0 } }, @@ -52,54 +50,43 @@ static const struct { #define MAP_AT_ZERO "security.bsd.map_at_zero" -int -main(void) +ATF_TC_WITHOUT_HEAD(mmap__map_at_zero); +ATF_TC_BODY(mmap__map_at_zero, tc) { void *p; size_t len; - int i, error, mib[3], map_at_zero; - - error = 0; - - /* Get the current sysctl value of security.bsd.map_at_zero. */ - len = sizeof(mib) / sizeof(*mib); - if (sysctlnametomib(MAP_AT_ZERO, mib, &len) == -1) { - printf("1..0 # SKIP: sysctlnametomib(\"%s\") failed: %s\n", - MAP_AT_ZERO, strerror(errno)); - return (0); - } + unsigned int i; + int map_at_zero; len = sizeof(map_at_zero); - if (sysctl(mib, 3, &map_at_zero, &len, NULL, 0) == -1) { - printf("1..0 # SKIP: sysctl for %s failed: %s\n", MAP_AT_ZERO, + if (sysctlbyname(MAP_AT_ZERO, &map_at_zero, &len, NULL, 0) == -1) { + atf_tc_skip("sysctl for %s failed: %s\n", MAP_AT_ZERO, strerror(errno)); - return (0); + return; } /* Normalize to 0 or 1 for array access. */ map_at_zero = !!map_at_zero; - printf("1..%zu\n", nitems(tests)); - for (i = 0; i < (int)nitems(tests); i++) { - p = mmap((void *)tests[i].addr, PAGE_SIZE, + for (i = 0; i < nitems(map_at_zero_tests); i++) { + p = mmap((void *)map_at_zero_tests[i].addr, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_FIXED, -1, 0); if (p == MAP_FAILED) { - if (tests[i].ok[map_at_zero] != 0) - error++; - printf("%sok %d # mmap(%p, ...) failed\n", - tests[i].ok[map_at_zero] == 0 ? "" : "not ", - i + 1, - tests[i].addr); + ATF_CHECK_MSG(map_at_zero_tests[i].ok[map_at_zero] == 0, + "mmap(%p, ...) failed", map_at_zero_tests[i].addr); } else { - if (tests[i].ok[map_at_zero] != 1) - error++; - printf("%sok %d # mmap(%p, ...) succeeded: p=%p\n", - tests[i].ok[map_at_zero] == 1 ? "" : "not ", - i + 1, - tests[i].addr, p); + ATF_CHECK_MSG(map_at_zero_tests[i].ok[map_at_zero] == 1, + "mmap(%p, ...) succeeded: p=%p\n", + map_at_zero_tests[i].addr, p); } } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, mmap__map_at_zero); - return (error != 0); + return (atf_no_error()); } From owner-svn-src-head@freebsd.org Thu Aug 6 16:14:30 2015 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 33CFD9B5C03; Thu, 6 Aug 2015 16:14:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 186B2D5D; Thu, 6 Aug 2015 16:14:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76GETj7011236; Thu, 6 Aug 2015 16:14:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76GETGp011235; Thu, 6 Aug 2015 16:14:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061614.t76GETGp011235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 16:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286370 - head/tests/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.20 Precedence: list List-Id: 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, 06 Aug 2015 16:14:30 -0000 Author: jhb Date: Thu Aug 6 16:14:29 2015 New Revision: 286370 URL: https://svnweb.freebsd.org/changeset/base/286370 Log: Add various tests to ensure that invalid arguments passed to mmap() trigger failures. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3269 Modified: head/tests/sys/vm/mmap_test.c Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Thu Aug 6 16:12:12 2015 (r286369) +++ head/tests/sys/vm/mmap_test.c Thu Aug 6 16:14:29 2015 (r286370) @@ -32,6 +32,10 @@ #include #include +#include +#include +#include +#include static const struct { void *addr; @@ -83,10 +87,78 @@ ATF_TC_BODY(mmap__map_at_zero, tc) } } +static void +checked_mmap(int prot, int flags, int fd, int error, const char *msg) +{ + void *p; + + p = mmap(NULL, getpagesize(), prot, flags, fd, 0); + if (p == MAP_FAILED) { + if (error == 0) + ATF_CHECK_MSG(0, "%s failed with errno %d", msg, + errno); + else + ATF_CHECK_EQ_MSG(error, errno, + "%s failed with wrong errno %d (expected %d)", msg, + errno, error); + } else { + ATF_CHECK_MSG(error == 0, "%s succeeded", msg); + munmap(p, getpagesize()); + } +} + +ATF_TC_WITHOUT_HEAD(mmap__bad_arguments); +ATF_TC_BODY(mmap__bad_arguments, tc) +{ + int fd; + + ATF_REQUIRE((fd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); + ATF_REQUIRE(ftruncate(fd, getpagesize()) == 0); + + /* These should work. */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON, -1, 0, + "simple MAP_ANON"); + checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0, + "simple shm fd shared"); + checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0, + "simple shm fd private"); + + /* Extra PROT flags. */ + checked_mmap(PROT_READ | PROT_WRITE | 0x100000, MAP_ANON, -1, EINVAL, + "MAP_ANON with extra PROT flags"); + checked_mmap(0xffff, MAP_SHARED, fd, EINVAL, + "shm fd with garbage PROT"); + + /* Undefined flag. */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_RESERVED0080, -1, + EINVAL, "Undefined flag"); + + /* Both MAP_SHARED and MAP_PRIVATE */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | + MAP_SHARED, -1, EINVAL, "MAP_ANON with both SHARED and PRIVATE"); + checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_SHARED, fd, + EINVAL, "shm fd with both SHARED and PRIVATE"); + + /* At least one of MAP_SHARED or MAP_PRIVATE without ANON */ + checked_mmap(PROT_READ | PROT_WRITE, 0, fd, EINVAL, + "shm fd without sharing flag"); + + /* MAP_ANON with either sharing flag (impacts fork). */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0, + "shared MAP_ANON"); + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0, + "private MAP_ANON"); + + /* MAP_ANON should require an fd of -1. */ + checked_mmap(PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, EINVAL, + "MAP_ANON with fd != -1"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, mmap__map_at_zero); + ATF_TP_ADD_TC(tp, mmap__bad_arguments); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Thu Aug 6 16:50:38 2015 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 81B8F9B445B; Thu, 6 Aug 2015 16:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5919C1EB4; Thu, 6 Aug 2015 16:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76GocCO024196; Thu, 6 Aug 2015 16:50:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76GocwN024195; Thu, 6 Aug 2015 16:50:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061650.t76GocwN024195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 16:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286371 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 16:50:38 -0000 Author: jhb Date: Thu Aug 6 16:50:37 2015 New Revision: 286371 URL: https://svnweb.freebsd.org/changeset/base/286371 Log: The changes that introduced fo_mmap() treated all character device mappings as if MAP_SHARED was always present since in general MAP_PRIVATE is not permitted for character devices. However, there is one exception in that MAP_PRIVATE mappings are permitted for /dev/zero. Only require a writable file descriptor (FWRITE) for shared, writable mappings of character devices. vm_mmap_cdev() will reject any private mappings for other devices. Reviewed by: kib Reported by: sbruno (broke qemu cross-builds), peter Differential Revision: https://reviews.freebsd.org/D3316 Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Aug 6 16:14:29 2015 (r286370) +++ head/sys/fs/devfs/devfs_vnops.c Thu Aug 6 16:50:37 2015 (r286371) @@ -1774,13 +1774,24 @@ devfs_mmap_f(struct file *fp, vm_map_t m return (EACCES); /* - * Character devices always share mappings, so - * require a writable fd for writable mappings. + * If we are sharing potential changes via MAP_SHARED and we + * are trying to get write permission although we opened it + * without asking for it, bail out. + * + * Note that most character devices always share mappings. + * The one exception is that D_MMAP_ANON devices + * (i.e. /dev/zero) permit private writable mappings. + * + * Rely on vm_mmap_cdev() to fail invalid MAP_PRIVATE requests + * as well as updating maxprot to permit writing for + * D_MMAP_ANON devices rather than doing that here. */ - if ((fp->f_flag & FWRITE) != 0) - maxprot |= VM_PROT_WRITE; - else if ((prot & VM_PROT_WRITE) != 0) - return (EACCES); + if ((flags & MAP_SHARED) != 0) { + if ((fp->f_flag & FWRITE) != 0) + maxprot |= VM_PROT_WRITE; + else if ((prot & VM_PROT_WRITE) != 0) + return (EACCES); + } maxprot &= cap_maxprot; fpop = td->td_fpop; From owner-svn-src-head@freebsd.org Thu Aug 6 17:07:24 2015 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 9C2779B4802; Thu, 6 Aug 2015 17:07:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8B7168EA; Thu, 6 Aug 2015 17:07:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76H7OGl031585; Thu, 6 Aug 2015 17:07:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76H7MMd031575; Thu, 6 Aug 2015 17:07:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061707.t76H7MMd031575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 17:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286372 - in head/sys: amd64/include/xen dev/xen/balloon dev/xen/blkfront dev/xen/control dev/xen/netback dev/xen/netfront dev/xen/pcifront i386/include/xen x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 17:07:24 -0000 Author: jhb Date: Thu Aug 6 17:07:21 2015 New Revision: 286372 URL: https://svnweb.freebsd.org/changeset/base/286372 Log: Remove some more vestiges of the Xen PV domu support. Specifically, use vtophys() directly instead of vtomach() and retire the no-longer-used headers and . Reported by: bde (stale bits in ) Reviewed by: royger (earlier version) Differential Revision: https://reviews.freebsd.org/D3266 Deleted: head/sys/amd64/include/xen/xenfunc.h head/sys/amd64/include/xen/xenvar.h head/sys/i386/include/xen/xenfunc.h head/sys/i386/include/xen/xenvar.h Modified: head/sys/dev/xen/balloon/balloon.c head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/control/control.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netfront/netfront.c head/sys/dev/xen/pcifront/pcifront.c head/sys/x86/xen/xen_intr.c Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/balloon/balloon.c Thu Aug 6 17:07:21 2015 (r286372) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static MALLOC_DEFINE(M_BALLOON, "Balloon", "Xen Balloon Driver"); /* Convert from KB (as fetched from xenstore) to number of PAGES */ Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/blkfront/blkfront.c Thu Aug 6 17:07:21 2015 (r286372) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -762,7 +761,7 @@ xbd_alloc_ring(struct xbd_softc *sc) i++, sring_page_addr += PAGE_SIZE) { error = xenbus_grant_ring(sc->xbd_dev, - (vtomach(sring_page_addr) >> PAGE_SHIFT), + (vtophys(sring_page_addr) >> PAGE_SHIFT), &sc->xbd_ring_ref[i]); if (error) { xenbus_dev_fatal(sc->xbd_dev, error, @@ -1305,7 +1304,7 @@ xbd_connect(struct xbd_softc *sc) for (j = 0; j < sc->xbd_max_request_indirectpages; j++) { if (gnttab_grant_foreign_access( xenbus_get_otherend_id(sc->xbd_dev), - (vtomach(indirectpages) >> PAGE_SHIFT) + j, + (vtophys(indirectpages) >> PAGE_SHIFT) + j, 1 /* grant read-only access */, &cm->cm_indirectionrefs[j])) break; Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/control/control.c Thu Aug 6 17:07:21 2015 (r286372) @@ -145,9 +145,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/netback/netback.c Thu Aug 6 17:07:21 2015 (r286372) @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - /*--------------------------- Compile-time Tunables --------------------------*/ /*---------------------------------- Macros ----------------------------------*/ @@ -132,7 +130,7 @@ static MALLOC_DEFINE(M_XENNETBACK, "xnb" req < rsp ? req : rsp; \ }) -#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) +#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) #define virt_to_offset(x) ((x) & (PAGE_SIZE - 1)) /** Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/netfront/netfront.c Thu Aug 6 17:07:21 2015 (r286372) @@ -86,8 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "xenbus_if.h" /* Features supported by all backends. TSO and LRO can be negotiated */ @@ -190,7 +188,7 @@ static int xennet_get_responses(struct n struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, struct mbuf **list, int *pages_flipped_p); -#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) +#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) #define INVALID_P2M_ENTRY (~0UL) @@ -901,7 +899,7 @@ refill: req->gref = ref; sc->rx_pfn_array[i] = - vtomach(mtod(m_new,vm_offset_t)) >> PAGE_SHIFT; + vtophys(mtod(m_new,vm_offset_t)) >> PAGE_SHIFT; } KASSERT(i, ("no mbufs processed")); /* should have returned earlier */ Modified: head/sys/dev/xen/pcifront/pcifront.c ============================================================================== --- head/sys/dev/xen/pcifront/pcifront.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/dev/xen/pcifront/pcifront.c Thu Aug 6 17:07:21 2015 (r286372) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define INVALID_GRANT_REF (0) #define INVALID_EVTCHN (-1) -#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) +#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) struct pcifront_device { STAILQ_ENTRY(pcifront_device) next; Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Thu Aug 6 16:50:37 2015 (r286371) +++ head/sys/x86/xen/xen_intr.c Thu Aug 6 17:07:21 2015 (r286372) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-head@freebsd.org Thu Aug 6 17:13:36 2015 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 DFC3A9B49E2; Thu, 6 Aug 2015 17:13:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BAE86CAB; Thu, 6 Aug 2015 17:13:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76HDZdU035456; Thu, 6 Aug 2015 17:13:35 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76HDZmo035454; Thu, 6 Aug 2015 17:13:35 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201508061713.t76HDZmo035454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 6 Aug 2015 17:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286373 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 17:13:36 -0000 Author: pjd Date: Thu Aug 6 17:13:34 2015 New Revision: 286373 URL: https://svnweb.freebsd.org/changeset/base/286373 Log: After crypto_dispatch() bio might be already delivered and destroyed, so we cannot access it anymore. Setting an error later lead to memory corruption. Assert that crypto_dispatch() was successful. It can fail only if we pass a bogus crypto request, which is a bug in the program, not a runtime condition. PR: 199705 Submitted by: luke.tw Reviewed by: emaste MFC after: 3 days Modified: head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Thu Aug 6 17:07:21 2015 (r286372) +++ head/sys/geom/eli/g_eli_integrity.c Thu Aug 6 17:13:34 2015 (r286373) @@ -408,8 +408,8 @@ g_eli_auth_run(struct g_eli_worker *wr, struct cryptodesc *crde, *crda; u_int i, lsec, nsec, data_secsize, decr_secsize, encr_secsize; off_t dstoff; - int err, error; u_char *p, *data, *auth, *authkey, *plaindata; + int error; G_ELI_LOGREQ(3, bp, "%s", __func__); @@ -451,7 +451,6 @@ g_eli_auth_run(struct g_eli_worker *wr, bp->bio_inbed = 0; bp->bio_children = nsec; - error = 0; for (i = 1; i <= nsec; i++, dstoff += encr_secsize) { crp = (struct cryptop *)p; p += sizeof(*crp); crde = (struct cryptodesc *)p; p += sizeof(*crde); @@ -519,10 +518,8 @@ g_eli_auth_run(struct g_eli_worker *wr, crda->crd_klen = G_ELI_AUTH_SECKEYLEN * 8; crp->crp_etype = 0; - err = crypto_dispatch(crp); - if (err != 0 && error == 0) - error = err; + error = crypto_dispatch(crp); + KASSERT(error == 0, ("crypto_dispatch() failed (error=%d)", + error)); } - if (bp->bio_error == 0) - bp->bio_error = error; } Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Aug 6 17:07:21 2015 (r286372) +++ head/sys/geom/eli/g_eli_privacy.c Thu Aug 6 17:13:34 2015 (r286373) @@ -230,10 +230,10 @@ g_eli_crypto_run(struct g_eli_worker *wr struct cryptop *crp; struct cryptodesc *crd; u_int i, nsec, secsize; - int err, error; off_t dstoff; size_t size; u_char *p, *data; + int error; G_ELI_LOGREQ(3, bp, "%s", __func__); @@ -271,7 +271,6 @@ g_eli_crypto_run(struct g_eli_worker *wr bcopy(bp->bio_data, data, bp->bio_length); } - error = 0; for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = (struct cryptop *)p; p += sizeof(*crp); crd = (struct cryptodesc *)p; p += sizeof(*crd); @@ -308,10 +307,8 @@ g_eli_crypto_run(struct g_eli_worker *wr crd->crd_next = NULL; crp->crp_etype = 0; - err = crypto_dispatch(crp); - if (error == 0) - error = err; + error = crypto_dispatch(crp); + KASSERT(error == 0, ("crypto_dispatch() failed (error=%d)", + error)); } - if (bp->bio_error == 0) - bp->bio_error = error; } From owner-svn-src-head@freebsd.org Thu Aug 6 18:02:55 2015 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 8D55C9B55B3; Thu, 6 Aug 2015 18:02:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7EF4A890; Thu, 6 Aug 2015 18:02:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76I2tSi055641; Thu, 6 Aug 2015 18:02:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76I2tDa055640; Thu, 6 Aug 2015 18:02:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508061802.t76I2tDa055640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 6 Aug 2015 18:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286374 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 18:02:55 -0000 Author: kib Date: Thu Aug 6 18:02:54 2015 New Revision: 286374 URL: https://svnweb.freebsd.org/changeset/base/286374 Log: Formally pair store_rel(&smp_started) with load_acq(&smp_started). The expected semantic is to have misc. data, e.g. CPU bitmaps, visible in the BSP after smp_started is written by the last started AP, which formally requires acquire barrier on the load. The change is mostly nop due to the ordered behaviour of the x86 CPUs. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu Aug 6 17:13:34 2015 (r286373) +++ head/sys/x86/x86/mp_x86.c Thu Aug 6 18:02:54 2015 (r286374) @@ -602,7 +602,7 @@ init_secondary_tail(void) mtx_unlock_spin(&ap_boot_mtx); /* Wait until all the AP's are up. */ - while (smp_started == 0) + while (atomic_load_acq_int(&smp_started) == 0) ia32_pause(); /* Start per-CPU event timers. */ From owner-svn-src-head@freebsd.org Thu Aug 6 18:15:57 2015 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 6F8709B58D5; Thu, 6 Aug 2015 18:15:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6129BE5E; Thu, 6 Aug 2015 18:15:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76IFvsc059914; Thu, 6 Aug 2015 18:15:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76IFvXU059913; Thu, 6 Aug 2015 18:15:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508061815.t76IFvXU059913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 6 Aug 2015 18:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286375 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 18:15:57 -0000 Author: delphij Date: Thu Aug 6 18:15:56 2015 New Revision: 286375 URL: https://svnweb.freebsd.org/changeset/base/286375 Log: Now that stable/8 is EOL, stop building INDEX-8. MFC after: 1 week Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Thu Aug 6 18:02:54 2015 (r286374) +++ head/etc/portsnap.conf Thu Aug 6 18:15:56 2015 (r286375) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 INDEX INDEX-10 DESCRIBE.10 From owner-svn-src-head@freebsd.org Thu Aug 6 18:28:16 2015 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 BE7E39B5B88; Thu, 6 Aug 2015 18:28:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B00CF1810; Thu, 6 Aug 2015 18:28:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76ISGnF064208; Thu, 6 Aug 2015 18:28:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76ISGBF064207; Thu, 6 Aug 2015 18:28:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061828.t76ISGBF064207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 18:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286378 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 18:28:16 -0000 Author: jhb Date: Thu Aug 6 18:28:15 2015 New Revision: 286378 URL: https://svnweb.freebsd.org/changeset/base/286378 Log: Don't mark the fcntl flag argument as an output parameter so that it is always decoded. Previously the argument was not decoded if fcntl() failed. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 18:19:30 2015 (r286377) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 18:28:15 2015 (r286378) @@ -93,7 +93,7 @@ static const char rcsid[] = */ static struct syscall syscalls[] = { { .name = "fcntl", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, + .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } }, { .name = "fork", .ret_type = 1, .nargs = 0 }, { .name = "vfork", .ret_type = 1, .nargs = 0 }, { .name = "rfork", .ret_type = 1, .nargs = 1, From owner-svn-src-head@freebsd.org Thu Aug 6 18:32:33 2015 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 0D2B29B5D05; Thu, 6 Aug 2015 18:32:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 F00B81D79; Thu, 6 Aug 2015 18:32:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76IWW6O068060; Thu, 6 Aug 2015 18:32:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76IWWTB068059; Thu, 6 Aug 2015 18:32:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061832.t76IWWTB068059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 18:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286380 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 18:32:33 -0000 Author: jhb Date: Thu Aug 6 18:32:32 2015 New Revision: 286380 URL: https://svnweb.freebsd.org/changeset/base/286380 Log: Decode the arguments to mkfifo() and fix an off-by-one error in the arguments to mknod(). Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 18:29:26 2015 (r286379) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 18:32:32 2015 (r286380) @@ -141,8 +141,10 @@ static struct syscall syscalls[] = { .args = { { Name, 0 } } }, { .name = "chroot", .ret_type = 0, .nargs = 1, .args = { { Name, 0 } } }, + { .name = "mkfifo", .ret_type = 0, .nargs = 2, + .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "mknod", .ret_type = 0, .nargs = 3, - .args = { { Name, 0 }, { Octal, 1 }, { Int, 3 } } }, + .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } }, { .name = "chmod", .ret_type = 0, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "chown", .ret_type = 0, .nargs = 3, From owner-svn-src-head@freebsd.org Thu Aug 6 19:08:35 2015 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 454939B52DF; Thu, 6 Aug 2015 19:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 293E5C57; Thu, 6 Aug 2015 19:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76J8ZGn080759; Thu, 6 Aug 2015 19:08:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76J8YG9080757; Thu, 6 Aug 2015 19:08:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061908.t76J8YG9080757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 19:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286381 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 19:08:35 -0000 Author: jhb Date: Thu Aug 6 19:08:33 2015 New Revision: 286381 URL: https://svnweb.freebsd.org/changeset/base/286381 Log: Decode the arguments passed to the *at() family of system calls. This is especially useful now that libc's open() always calls openat(). While here, fix a few other things: - Decode the mode argument passed to access(), eaccess(), and faccessat(). - Decode the atfd paramete to pretty-print AT_FDCWD. - Decode the special AT_* flags used with some of the *at() system calls. - Decode arguments for fchmod(), lchmod(), fchown(), lchown(), eaccess(), and futimens(). - Decode both of the timeval structures passed to futimes() instead of just the first one. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Thu Aug 6 18:32:32 2015 (r286380) +++ head/usr.bin/truss/syscall.h Thu Aug 6 19:08:33 2015 (r286381) @@ -41,7 +41,7 @@ enum Argtype { None = 1, Hex, Octal, Int Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, - LinuxSockArgs, Umtxop }; + LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode }; #define ARG_MASK 0xff #define OUT 0x100 Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 18:32:32 2015 (r286380) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 19:08:33 2015 (r286381) @@ -115,6 +115,9 @@ static struct syscall syscalls[] = { { .name = "getuid", .ret_type = 1, .nargs = 0 }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Int, 2 } } }, + { .name = "readlinkat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, + { Int, 3 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, .args = { { Int, 0 }, { Quad, 1 + QUAD_ALIGN }, { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } }, { .name = "linux_lseek", .ret_type = 2, .nargs = 3, @@ -127,28 +130,55 @@ static struct syscall syscalls[] = { .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, + { .name = "openat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Open, 2 }, + { Octal, 3 } } }, { .name = "mkdir", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, + { .name = "mkdirat", .ret_type = 1, .nargs = 3, + .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } }, { .name = "linux_open", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } }, { .name = "close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "link", .ret_type = 0, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, + { .name = "linkat", .ret_type = 0, .nargs = 5, + .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 }, + { Atflags, 4 } } }, { .name = "unlink", .ret_type = 0, .nargs = 1, .args = { { Name, 0 } } }, + { .name = "unlinkat", .ret_type = 0, .nargs = 3, + .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } }, { .name = "chdir", .ret_type = 0, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chroot", .ret_type = 0, .nargs = 1, .args = { { Name, 0 } } }, { .name = "mkfifo", .ret_type = 0, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, + { .name = "mkfifoat", .ret_type = 0, .nargs = 3, + .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } }, { .name = "mknod", .ret_type = 0, .nargs = 3, .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } }, + { .name = "mknodat", .ret_type = 0, .nargs = 4, + .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } }, { .name = "chmod", .ret_type = 0, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, + { .name = "fchmod", .ret_type = 0, .nargs = 2, + .args = { { Int, 0 }, { Octal, 1 } } }, + { .name = "lchmod", .ret_type = 0, .nargs = 2, + .args = { { Name, 0 }, { Octal, 1 } } }, + { .name = "fchmodat", .ret_type = 0, .nargs = 4, + .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Atflags, 3 } } }, { .name = "chown", .ret_type = 0, .nargs = 3, .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, + { .name = "fchown", .ret_type = 0, .nargs = 3, + .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } }, + { .name = "lchown", .ret_type = 0, .nargs = 3, + .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, + { .name = "fchownat", .ret_type = 0, .nargs = 5, + .args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 }, + { Atflags, 4 } } }, { .name = "linux_stat64", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}}, { .name = "mount", .ret_type = 0, .nargs = 4, @@ -157,6 +187,9 @@ static struct syscall syscalls[] = { .args = { { Name, 0 }, { Int, 2 } } }, { .name = "fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat | OUT, 1 } } }, + { .name = "fstatat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat | OUT, 2 }, + { Atflags, 3 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "lstat", .ret_type = 1, .nargs = 2, @@ -164,7 +197,7 @@ static struct syscall syscalls[] = { { .name = "linux_newstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, { .name = "linux_access", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 }, { Int, 1 }}}, + .args = { { Name, 0 }, { Accessmode, 1 }}}, { .name = "linux_newfstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr | OUT, 1 } } }, { .name = "write", .ret_type = 1, .nargs = 3, @@ -176,15 +209,26 @@ static struct syscall syscalls[] = { { .name = "exit", .ret_type = 0, .nargs = 1, .args = { { Hex, 0 } } }, { .name = "access", .ret_type = 1, .nargs = 2, - .args = { { Name | IN, 0 }, { Int, 1 } } }, + .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, + { .name = "eaccess", .ret_type = 1, .nargs = 2, + .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, + { .name = "faccessat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, + { Atflags, 3 } } }, { .name = "sigaction", .ret_type = 1, .nargs = 3, .args = { { Signal, 0 }, { Sigaction | IN, 1 }, { Sigaction | OUT, 2 } } }, { .name = "accept", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "bind", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } }, + { .name = "bindat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, + { Int, 3 } } }, { .name = "connect", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } }, + { .name = "connectat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, + { Int, 3 } } }, { .name = "getpeername", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "getsockname", .ret_type = 1, .nargs = 3, @@ -248,7 +292,14 @@ static struct syscall syscalls[] = { { .name = "lutimes", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } }, { .name = "futimes", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Timeval | IN, 1 } } }, + .args = { { Int, 0 }, { Timeval2 | IN, 1 } } }, + { .name = "futimesat", .ret_type = 1, .nargs = 3, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } }, + { .name = "futimens", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Timespec2 | IN, 1 } } }, + { .name = "utimensat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 }, + { Atflags, 3 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Hex, 1 } } }, { .name = "lchflags", .ret_type = 1, .nargs = 2, @@ -269,8 +320,12 @@ static struct syscall syscalls[] = { .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 } } }, { .name = "rename", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, + { .name = "renameat", .ret_type = 1, .nargs = 4, + .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, { .name = "symlink", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, + { .name = "symlinkat", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Atfd, 1 }, { Name, 2 } } }, { .name = "posix_openpt", .ret_type = 1, .nargs = 1, .args = { { Open, 0 } } }, { .name = "wait4", .ret_type = 1, .nargs = 4, @@ -438,6 +493,15 @@ static struct xlat umtx_ops[] = { XEND }; +static struct xlat at_flags[] = { + X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW) + X(AT_REMOVEDIR) XEND +}; + +static struct xlat access_modes[] = { + X(R_OK) X(W_OK) X(X_OK) XEND +}; + #undef X #undef XEND @@ -780,6 +844,40 @@ print_arg(struct syscall_args *sc, unsig asprintf(&tmp, "0x%lx", args[sc->offset]); break; } + case Timespec2: { + struct timespec ts[2]; + FILE *fp; + size_t len; + const char *sep; + unsigned int i; + + if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) + != -1) { + fp = open_memstream(&tmp, &len); + fputc('{', fp); + sep = ""; + for (i = 0; i < nitems(ts); i++) { + fputs(sep, fp); + sep = ", "; + switch (ts[i].tv_nsec) { + case UTIME_NOW: + fprintf(fp, "UTIME_NOW"); + break; + case UTIME_OMIT: + fprintf(fp, "UTIME_OMIT"); + break; + default: + fprintf(fp, "%ld.%09ld", + (long)ts[i].tv_sec, ts[i].tv_nsec); + break; + } + } + fputc('}', fp); + fclose(fp); + } else + asprintf(&tmp, "0x%lx", args[sc->offset]); + break; + } case Timeval: { struct timeval tv; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) @@ -1319,6 +1417,22 @@ print_arg(struct syscall_args *sc, unsig case Umtxop: tmp = strdup(xlookup(umtx_ops, args[sc->offset])); break; + case Atfd: + if ((int)args[sc->offset] == AT_FDCWD) + tmp = strdup("AT_FDCWD"); + else + asprintf(&tmp, "%d", (int)args[sc->offset]); + break; + case Atflags: + tmp = strdup(xlookup_bits(at_flags, args[sc->offset])); + break; + case Accessmode: + if (args[sc->offset] == F_OK) + tmp = strdup("F_OK"); + else + tmp = strdup(xlookup_bits(access_modes, + args[sc->offset])); + break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } From owner-svn-src-head@freebsd.org Thu Aug 6 19:29:28 2015 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 5D7159B5A23; Thu, 6 Aug 2015 19:29:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 41D33198C; Thu, 6 Aug 2015 19:29:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76JTSmc088976; Thu, 6 Aug 2015 19:29:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76JTRu1088973; Thu, 6 Aug 2015 19:29:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508061929.t76JTRu1088973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Aug 2015 19:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286382 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 19:29:28 -0000 Author: ian Date: Thu Aug 6 19:29:26 2015 New Revision: 286382 URL: https://svnweb.freebsd.org/changeset/base/286382 Log: Add support to the uftdi driver for reading and writing the serial eeprom that can be attached to the chips, via ioctl() calls. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/uftdi_reg.h head/sys/dev/usb/uftdiio.h Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Aug 6 19:08:33 2015 (r286381) +++ head/sys/dev/usb/serial/uftdi.c Thu Aug 6 19:29:26 2015 (r286382) @@ -1791,6 +1791,82 @@ uftdi_set_error_char(struct ucom_softc * } static int +uftdi_read_eeprom(struct ucom_softc *ucom, struct uftdi_eeio *eeio) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + usb_error_t err; + uint16_t widx, wlength, woffset; + + /* Offset and length must both be evenly divisible by two. */ + if ((eeio->offset | eeio->length) & 0x01) + return (EINVAL); + + woffset = eeio->offset / 2U; + wlength = eeio->length / 2U; + for (widx = 0; widx < wlength; widx++) { + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_READ_EEPROM; + USETW(req.wIndex, widx + woffset); + USETW(req.wLength, 2); + USETW(req.wValue, 0); + err = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, + &eeio->data[widx]); + if (err != USB_ERR_NORMAL_COMPLETION) + return (err); + } + return (USB_ERR_NORMAL_COMPLETION); +} + +static int +uftdi_write_eeprom(struct ucom_softc *ucom, struct uftdi_eeio *eeio) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + usb_error_t err; + uint16_t widx, wlength, woffset; + + /* Offset and length must both be evenly divisible by two. */ + if ((eeio->offset | eeio->length) & 0x01) + return (EINVAL); + + woffset = eeio->offset / 2U; + wlength = eeio->length / 2U; + for (widx = 0; widx < wlength; widx++) { + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_WRITE_EEPROM; + USETW(req.wIndex, widx + woffset); + USETW(req.wLength, 0); + USETW(req.wValue, eeio->data[widx]); + err = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + if (err != USB_ERR_NORMAL_COMPLETION) + return (err); + } + return (USB_ERR_NORMAL_COMPLETION); +} + +static int +uftdi_erase_eeprom(struct ucom_softc *ucom, int confirmation) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + usb_error_t err; + + /* Small effort to prevent accidental erasure. */ + if (confirmation != UFTDI_CONFIRM_ERASE) + return (EINVAL); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_ERASE_EEPROM; + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + USETW(req.wValue, 0); + err = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + + return (err); +} + +static int uftdi_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, int flag, struct thread *td) { @@ -1833,6 +1909,15 @@ uftdi_ioctl(struct ucom_softc *ucom, uin *(int *)data = sc->sc_bcdDevice; err = 0; break; + case UFTDIIOC_READ_EEPROM: + err = uftdi_read_eeprom(ucom, (struct uftdi_eeio *)data); + break; + case UFTDIIOC_WRITE_EEPROM: + err = uftdi_write_eeprom(ucom, (struct uftdi_eeio *)data); + break; + case UFTDIIOC_ERASE_EEPROM: + err = uftdi_erase_eeprom(ucom, *(int *)data); + break; default: return (ENOIOCTL); } Modified: head/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- head/sys/dev/usb/serial/uftdi_reg.h Thu Aug 6 19:08:33 2015 (r286381) +++ head/sys/dev/usb/serial/uftdi_reg.h Thu Aug 6 19:29:26 2015 (r286382) @@ -31,7 +31,10 @@ #define FTDI_SIO_SET_LATENCY 9 /* Set the latency timer */ #define FTDI_SIO_GET_LATENCY 10 /* Read the latency timer */ #define FTDI_SIO_SET_BITMODE 11 /* Set the bit bang I/O mode */ -#define FTDI_SIO_GET_BITMODE 12 /* Read pin states in bit bang mode */ +#define FTDI_SIO_GET_BITMODE 12 /* Read pin states from any mode */ +#define FTDI_SIO_READ_EEPROM 144 /* Read eeprom word */ +#define FTDI_SIO_WRITE_EEPROM 145 /* Write eeprom word */ +#define FTDI_SIO_ERASE_EEPROM 146 /* Erase entire eeprom */ /* Port Identifier Table */ #define FTDI_PIT_DEFAULT 0 /* SIOA */ Modified: head/sys/dev/usb/uftdiio.h ============================================================================== --- head/sys/dev/usb/uftdiio.h Thu Aug 6 19:08:33 2015 (r286381) +++ head/sys/dev/usb/uftdiio.h Thu Aug 6 19:29:26 2015 (r286382) @@ -61,6 +61,26 @@ struct uftdi_bitmode uint8_t iomask; }; +/* + * For UFTDIIOC_READ_EEPROM, UFTDIIOC_WRITE_EEPROM: + * + * IO is done in 16-bit words at the chip level; offset and length are in bytes, + * but must each be evenly divisible by two. + * + * It is not necessary to erase before writing. For the FT232R device (only) + * you must set the latency timer to 0x77 before doing a series of eeprom writes + * (and restore it to the prior value when done). + */ +struct uftdi_eeio +{ + uint16_t offset; + uint16_t length; + uint16_t data[64]; +}; + +/* Pass this value to confirm that eeprom erase request is not accidental. */ +#define UFTDI_CONFIRM_ERASE 0x26139108 + #define UFTDIIOC_RESET_IO _IO('c', 0) /* Reset config, flush fifos.*/ #define UFTDIIOC_RESET_RX _IO('c', 1) /* Flush input fifo. */ #define UFTDIIOC_RESET_TX _IO('c', 2) /* Flush output fifo. */ @@ -71,5 +91,8 @@ struct uftdi_bitmode #define UFTDIIOC_SET_LATENCY _IOW('c', 7, int) /* 1-255 ms */ #define UFTDIIOC_GET_LATENCY _IOR('c', 8, int) #define UFTDIIOC_GET_HWREV _IOR('c', 9, int) +#define UFTDIIOC_READ_EEPROM _IOWR('c', 10, struct uftdi_eeio) +#define UFTDIIOC_WRITE_EEPROM _IOW('c', 11, struct uftdi_eeio) +#define UFTDIIOC_ERASE_EEPROM _IOW('c', 12, int) #endif From owner-svn-src-head@freebsd.org Thu Aug 6 19:36:48 2015 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 35B1C9B5BCE; Thu, 6 Aug 2015 19:36:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 25A631E62; Thu, 6 Aug 2015 19:36:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76JamVh093085; Thu, 6 Aug 2015 19:36:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76JamFr093084; Thu, 6 Aug 2015 19:36:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508061936.t76JamFr093084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 19:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286383 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 19:36:48 -0000 Author: jhb Date: Thu Aug 6 19:36:47 2015 New Revision: 286383 URL: https://svnweb.freebsd.org/changeset/base/286383 Log: Whitespace fixes to consistently use spaces before }'s and wrap long lines. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 19:29:26 2015 (r286382) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 19:36:47 2015 (r286383) @@ -101,9 +101,9 @@ static struct syscall syscalls[] = { { .name = "getegid", .ret_type = 1, .nargs = 0 }, { .name = "geteuid", .ret_type = 1, .nargs = 0 }, { .name = "linux_readlink", .ret_type = 1, .nargs = 3, - .args = { { Name, 0 }, { Name | OUT, 1 }, { Int, 2 }}}, + .args = { { Name, 0 }, { Name | OUT, 1 }, { Int, 2 } } }, { .name = "linux_socketcall", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { LinuxSockArgs, 1 }}}, + .args = { { Int, 0 }, { LinuxSockArgs, 1 } } }, { .name = "getgid", .ret_type = 1, .nargs = 0 }, { .name = "getpid", .ret_type = 1, .nargs = 0 }, { .name = "getpgid", .ret_type = 1, .nargs = 1, @@ -119,13 +119,15 @@ static struct syscall syscalls[] = { .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Int, 3 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, - .args = { { Int, 0 }, { Quad, 1 + QUAD_ALIGN }, { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } }, + .args = { { Int, 0 }, { Quad, 1 + QUAD_ALIGN }, + { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } }, { .name = "linux_lseek", .ret_type = 2, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } }, { .name = "mmap", .ret_type = 2, .nargs = 6, - .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } }, + .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, + { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } }, { .name = "linux_mkdir", .ret_type = 1, .nargs = 2, - .args = { { Name | IN, 0}, {Int, 1}}}, + .args = { { Name | IN, 0 }, { Int, 1 } } }, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, @@ -180,7 +182,7 @@ static struct syscall syscalls[] = { .args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 }, { Atflags, 4 } } }, { .name = "linux_stat64", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}}, + .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 } } }, { .name = "mount", .ret_type = 0, .nargs = 4, .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "umount", .ret_type = 0, .nargs = 2, @@ -197,7 +199,7 @@ static struct syscall syscalls[] = { { .name = "linux_newstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, { .name = "linux_access", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 }, { Accessmode, 1 }}}, + .args = { { Name, 0 }, { Accessmode, 1 } } }, { .name = "linux_newfstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr | OUT, 1 } } }, { .name = "write", .ret_type = 1, .nargs = 3, @@ -216,7 +218,8 @@ static struct syscall syscalls[] = { .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, { Atflags, 3 } } }, { .name = "sigaction", .ret_type = 1, .nargs = 3, - .args = { { Signal, 0 }, { Sigaction | IN, 1 }, { Sigaction | OUT, 2 } } }, + .args = { { Signal, 0 }, { Sigaction | IN, 1 }, + { Sigaction | OUT, 2 } } }, { .name = "accept", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "bind", .ret_type = 1, .nargs = 3, @@ -234,13 +237,17 @@ static struct syscall syscalls[] = { { .name = "getsockname", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, - .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { Hex, 3 }, { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } }, + .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { Hex, 3 }, + { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } }, { .name = "sendto", .ret_type = 1, .nargs = 6, - .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Hex, 3 }, { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } }, + .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Hex, 3 }, + { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } }, { .name = "execve", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, + .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, + { StringArray | IN, 2 } } }, { .name = "linux_execve", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, + .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, + { StringArray | IN, 2 } } }, { .name = "kldload", .ret_type = 0, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "kldunload", .ret_type = 0, .nargs = 1, @@ -256,7 +263,8 @@ static struct syscall syscalls[] = { { .name = "nanosleep", .ret_type = 0, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, - .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, + .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, + { Timeval, 4 } } }, { .name = "poll", .ret_type = 1, .nargs = 3, .args = { { Pollfd, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "gettimeofday", .ret_type = 1, .nargs = 2, @@ -270,7 +278,8 @@ static struct syscall syscalls[] = { { .name = "kse_release", .ret_type = 0, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "kevent", .ret_type = 0, .nargs = 6, - .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } }, + .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, + { Int, 4 }, { Timespec, 5 } } }, { .name = "sigprocmask", .ret_type = 0, .nargs = 3, .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, @@ -979,7 +988,8 @@ print_arg(struct syscall_args *sc, unsig what = buf; break; } - asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, (long unsigned int)largs.args); + asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, + (long unsigned int)largs.args); break; } case Pollfd: { From owner-svn-src-head@freebsd.org Thu Aug 6 19:47:05 2015 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 C3C5B9B5F01; Thu, 6 Aug 2015 19:47:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B4969ADC; Thu, 6 Aug 2015 19:47:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76Jl5VF097203; Thu, 6 Aug 2015 19:47:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76Jl52N097201; Thu, 6 Aug 2015 19:47:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508061947.t76Jl52N097201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Aug 2015 19:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286385 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 19:47:05 -0000 Author: ian Date: Thu Aug 6 19:47:04 2015 New Revision: 286385 URL: https://svnweb.freebsd.org/changeset/base/286385 Log: Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl. The ftdi chip itself has a "get bitmode" command that doesn't actually return the current bitmode, just a snapshot of the gpio lines. The chip apparently has no way to provide the current bitmode. This implements the functionality at the driver level. The driver starts out assuming the chip is in UART mode (which it will be, coming out of reset) and keeps track of every successful set-bitmode operation so that it can always return the current mode with UFTDIIOC_GET_BITMODE. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/uftdiio.h Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Aug 6 19:45:25 2015 (r286384) +++ head/sys/dev/usb/serial/uftdi.c Thu Aug 6 19:47:04 2015 (r286385) @@ -161,6 +161,7 @@ struct uftdi_softc { uint8_t sc_hdrlen; uint8_t sc_msr; uint8_t sc_lsr; + uint8_t sc_bitmode; }; struct uftdi_param_config { @@ -196,7 +197,7 @@ static void uftdi_cfg_get_status(struct uint8_t *); static int uftdi_reset(struct ucom_softc *, int); static int uftdi_set_bitmode(struct ucom_softc *, uint8_t, uint8_t); -static int uftdi_get_bitmode(struct ucom_softc *, uint8_t *); +static int uftdi_get_bitmode(struct ucom_softc *, uint8_t *, uint8_t *); static int uftdi_set_latency(struct ucom_softc *, int); static int uftdi_get_latency(struct ucom_softc *, int *); static int uftdi_set_event_char(struct ucom_softc *, int); @@ -1090,6 +1091,7 @@ uftdi_attach(device_t dev) sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); + sc->sc_bitmode = UFTDI_BITMODE_NONE; device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uftdi", NULL, MTX_DEF); @@ -1681,6 +1683,7 @@ uftdi_set_bitmode(struct ucom_softc *uco { struct uftdi_softc *sc = ucom->sc_parent; usb_device_request_t req; + int rv; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = FTDI_SIO_SET_BITMODE; @@ -1693,11 +1696,15 @@ uftdi_set_bitmode(struct ucom_softc *uco else USETW2(req.wValue, (1 << bitmode), iomask); - return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); + rv = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + if (rv == USB_ERR_NORMAL_COMPLETION) + sc->sc_bitmode = bitmode; + + return (rv); } static int -uftdi_get_bitmode(struct ucom_softc *ucom, uint8_t *iomask) +uftdi_get_bitmode(struct ucom_softc *ucom, uint8_t *bitmode, uint8_t *iomask) { struct uftdi_softc *sc = ucom->sc_parent; usb_device_request_t req; @@ -1709,6 +1716,7 @@ uftdi_get_bitmode(struct ucom_softc *uco USETW(req.wLength, 1); USETW(req.wValue, 0); + *bitmode = sc->sc_bitmode; return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, iomask)); } @@ -1891,7 +1899,7 @@ uftdi_ioctl(struct ucom_softc *ucom, uin break; case UFTDIIOC_GET_BITMODE: mode = (struct uftdi_bitmode *)data; - err = uftdi_get_bitmode(ucom, &mode->iomask); + err = uftdi_get_bitmode(ucom, &mode->mode, &mode->iomask); break; case UFTDIIOC_SET_LATENCY: err = uftdi_set_latency(ucom, *((int *)data)); Modified: head/sys/dev/usb/uftdiio.h ============================================================================== --- head/sys/dev/usb/uftdiio.h Thu Aug 6 19:45:25 2015 (r286384) +++ head/sys/dev/usb/uftdiio.h Thu Aug 6 19:47:04 2015 (r286385) @@ -43,7 +43,7 @@ enum uftdi_bitmodes UFTDI_BITMODE_CPU_EMUL = 3, UFTDI_BITMODE_FAST_SERIAL = 4, UFTDI_BITMODE_CBUS = 5, - UFTDI_BITMODE_NONE = 0xff, + UFTDI_BITMODE_NONE = 0xff, /* aka UART mode. */ }; /* @@ -52,8 +52,9 @@ enum uftdi_bitmodes * iomask = Mask of bits enabled for bitbang output. * * For UFTDIIOC_GET_BITMODE: - * mode = Unused. - * iomask = Returned snapshot of bitbang pin states at time of call. + * mode = Mode most recently set using UFTDIIOC_SET_BITMODE. + * iomask = Returned snapshot of DBUS0..DBUS7 pin states at time of call. + * Pin states can be read in any mode, not just bitbang modes. */ struct uftdi_bitmode { From owner-svn-src-head@freebsd.org Thu Aug 6 20:05:41 2015 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 374C89B4439; Thu, 6 Aug 2015 20:05:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 27C2A1A79; Thu, 6 Aug 2015 20:05:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76K5fQg006396; Thu, 6 Aug 2015 20:05:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76K5fEK006395; Thu, 6 Aug 2015 20:05:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508062005.t76K5fEK006395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 6 Aug 2015 20:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286388 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 20:05:41 -0000 Author: jhb Date: Thu Aug 6 20:05:40 2015 New Revision: 286388 URL: https://svnweb.freebsd.org/changeset/base/286388 Log: Consistently use both leading and trailing spaces inside of the {}'s when pretty-printing structures. Most structures used both spaces, but some only used a trailing space and some used neither. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Aug 6 19:53:41 2015 (r286387) +++ head/usr.bin/truss/syscalls.c Thu Aug 6 20:05:40 2015 (r286388) @@ -847,7 +847,7 @@ print_arg(struct syscall_args *sc, unsig struct timespec ts; if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) - asprintf(&tmp, "{%ld.%09ld }", (long)ts.tv_sec, + asprintf(&tmp, "{ %ld.%09ld }", (long)ts.tv_sec, ts.tv_nsec); else asprintf(&tmp, "0x%lx", args[sc->offset]); @@ -863,7 +863,7 @@ print_arg(struct syscall_args *sc, unsig if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) { fp = open_memstream(&tmp, &len); - fputc('{', fp); + fputs("{ ", fp); sep = ""; for (i = 0; i < nitems(ts); i++) { fputs(sep, fp); @@ -881,7 +881,7 @@ print_arg(struct syscall_args *sc, unsig break; } } - fputc('}', fp); + fputs(" }", fp); fclose(fp); } else asprintf(&tmp, "0x%lx", args[sc->offset]); @@ -891,7 +891,7 @@ print_arg(struct syscall_args *sc, unsig struct timeval tv; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - asprintf(&tmp, "{%ld.%06ld }", (long)tv.tv_sec, + asprintf(&tmp, "{ %ld.%06ld }", (long)tv.tv_sec, tv.tv_usec); else asprintf(&tmp, "0x%lx", args[sc->offset]); @@ -901,7 +901,7 @@ print_arg(struct syscall_args *sc, unsig struct timeval tv[2]; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) - asprintf(&tmp, "{%ld.%06ld, %ld.%06ld }", + asprintf(&tmp, "{ %ld.%06ld, %ld.%06ld }", (long)tv[0].tv_sec, tv[0].tv_usec, (long)tv[1].tv_sec, tv[1].tv_usec); else @@ -912,7 +912,7 @@ print_arg(struct syscall_args *sc, unsig struct itimerval itv; if (get_struct(pid, (void *)args[sc->offset], &itv, sizeof(itv)) != -1) - asprintf(&tmp, "{%ld.%06ld, %ld.%06ld }", + asprintf(&tmp, "{ %ld.%06ld, %ld.%06ld }", (long)itv.it_interval.tv_sec, itv.it_interval.tv_usec, (long)itv.it_value.tv_sec, @@ -1016,6 +1016,7 @@ print_arg(struct syscall_args *sc, unsig tmpsize); tmp[used++] = '{'; + tmp[used++] = ' '; for (i = 0; i < numfds; i++) { u = snprintf(tmp + used, per_fd, "%s%d/%s", @@ -1024,6 +1025,7 @@ print_arg(struct syscall_args *sc, unsig if (u > 0) used += u < per_fd ? u : per_fd; } + tmp[used++] = ' '; tmp[used++] = '}'; tmp[used++] = '\0'; } else { @@ -1056,6 +1058,7 @@ print_arg(struct syscall_args *sc, unsig "output", tmpsize); tmp[used++] = '{'; + tmp[used++] = ' '; for (i = 0; i < numfds; i++) { if (FD_ISSET(i, fds)) { u = snprintf(tmp + used, per_fd, "%d ", @@ -1064,8 +1067,6 @@ print_arg(struct syscall_args *sc, unsig used += u < per_fd ? u : per_fd; } } - if (tmp[used-1] == ' ') - used--; tmp[used++] = '}'; tmp[used++] = '\0'; } else @@ -1266,8 +1267,9 @@ print_arg(struct syscall_args *sc, unsig default: sa = (struct sockaddr *)&ss; asprintf(&tmp, "{ sa_len = %d, sa_family = %d, sa_data " - "= {%n%*s } }", (int)sa->sa_len, (int)sa->sa_family, - &i, 6 * (int)(sa->sa_len - ((char *)&sa->sa_data - + "= { %n%*s } }", (int)sa->sa_len, + (int)sa->sa_family, &i, + 6 * (int)(sa->sa_len - ((char *)&sa->sa_data - (char *)sa)), ""); if (tmp != NULL) { p = tmp + i; @@ -1333,6 +1335,7 @@ print_arg(struct syscall_args *sc, unsig "output", tmpsize); tmp[used++] = '{'; + tmp[used++] = ' '; for (i = 0; i < numevents; i++) { u = snprintf(tmp + used, per_ke, "%s%p,%s,%s,%d,%p,%p", @@ -1346,6 +1349,7 @@ print_arg(struct syscall_args *sc, unsig if (u > 0) used += u < per_ke ? u : per_ke; } + tmp[used++] = ' '; tmp[used++] = '}'; tmp[used++] = '\0'; } else { From owner-svn-src-head@freebsd.org Thu Aug 6 20:59:04 2015 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 793ED9B521E; Thu, 6 Aug 2015 20:59:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5DAE11882; Thu, 6 Aug 2015 20:59:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76Kx4em027053; Thu, 6 Aug 2015 20:59:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76Kx4a7027052; Thu, 6 Aug 2015 20:59:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508062059.t76Kx4a7027052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Aug 2015 20:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286389 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 20:59:04 -0000 Author: ian Date: Thu Aug 6 20:59:03 2015 New Revision: 286389 URL: https://svnweb.freebsd.org/changeset/base/286389 Log: Document the recently added get-bitmode and eeprom read/write functionality. Modified: head/share/man/man4/uftdi.4 Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Thu Aug 6 20:05:40 2015 (r286388) +++ head/share/man/man4/uftdi.4 Thu Aug 6 20:59:03 2015 (r286389) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2014 +.Dd August 6, 2015 .Dt UFTDI 4 .Os .Sh NAME @@ -110,6 +110,11 @@ The must be one of the .Va uftdi_bitmodes values. +Setting +.Va mode +to +.Dv UFTDI_BITMODE_NONE +returns the channel to standard UART mode. .Bd -literal enum uftdi_bitmodes { @@ -139,12 +144,15 @@ and data which either reflects pin state or is interpreted as MPSSE commands and parameters, depending on the mode. .It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode" -Return the state of the bitbang pins at the time of the call in the +Return the current bitbang mode in the +.Va mode +member, and the state of the DBUS0..DBUS7 pins at the time +of the call in the .Va iomask member. -The -.Va mode -member is unused. +The pin state can be read while the chip is in any mode, including +.Dv UFTDI_BITMODE_NONE +(UART) mode. .It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int Set the character which is inserted into the buffer to mark the point of an error such as FIFO overflow. @@ -164,6 +172,54 @@ This is the .Va bcdDevice value from the .Va usb_device_descriptor . +.It Dv UFTDIIOC_READ_EEPROM Pq Vt "struct uftdi_eeio" +Read one or more words from the configuration eeprom. +The FTDI chip performs eeprom I/O in 16-bit words. +Set +.Va offset +and +.Va length +to values evenly divisible by two before the call, and the +.Va data +array will contain the requested values from eeprom after the call. +.Bd -literal +struct uftdi_eeio +{ + uint16_t offset; + uint16_t length; + uint16_t data[64]; +}; +.Ed +.Pp +The FT232R chip has an internal eeprom. +An external serial eeprom is optional on other FTDI chips. +The eeprom may contain 64, 128, or 256 words, +depending on the part used. +Multiple calls may be needed to read or write the larger parts. +When no eeprom is present, all words in the returned data are 0xffff. +An erased eeprom also reads as all 0xffff. +.It Dv UFTDIIOC_WRITE_EEPROM Pq Vt "struct uftdi_eeio" +Write one or more words to the configuration eeprom. +The +.Va uftdi_eeio +values are as described for +.Dv UFTDIIOC_READ_EEPROM . +.Pp +The FTDI chip does a blind write to the eeprom, and it will appear +to succeed even when no eeprom is present. +To ensure a good write you must read back and verify the data. +It is +.Em not +necessary to erase before writing. +Any position within the eeprom can be overwritten at any time. +.It Dv UFTDIIOC_ERASE_EEPROM Pq Vt int +Erase the entire eeprom. +This is useful primarily for test and debugging, as there is no +need to erase before writing. +To help prevent accidental erasure caused by calling the wrong +ioctl, you must pass the special value +.Dv UFTDI_CONFIRM_ERASE +as the argument to this ioctl. .El .Sh HARDWARE The From owner-svn-src-head@freebsd.org Thu Aug 6 21:27:52 2015 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 18DAF9B58CC; Thu, 6 Aug 2015 21:27:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E5B6879F; Thu, 6 Aug 2015 21:27:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76LRpxa039328; Thu, 6 Aug 2015 21:27:51 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76LRpOi039327; Thu, 6 Aug 2015 21:27:51 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508062127.t76LRpOi039327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 6 Aug 2015 21:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286390 - 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.20 Precedence: list List-Id: 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, 06 Aug 2015 21:27:52 -0000 Author: alc Date: Thu Aug 6 21:27:50 2015 New Revision: 286390 URL: https://svnweb.freebsd.org/changeset/base/286390 Log: Introduce a sysctl for reporting the number of fully populated reservations. Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Aug 6 20:59:03 2015 (r286389) +++ head/sys/vm/vm_reserv.c Thu Aug 6 21:27:50 2015 (r286390) @@ -217,6 +217,11 @@ static long vm_reserv_freed; SYSCTL_LONG(_vm_reserv, OID_AUTO, freed, CTLFLAG_RD, &vm_reserv_freed, 0, "Cumulative number of freed reservations"); +static int sysctl_vm_reserv_fullpop(SYSCTL_HANDLER_ARGS); + +SYSCTL_PROC(_vm_reserv, OID_AUTO, fullpop, CTLTYPE_INT | CTLFLAG_RD, NULL, 0, + sysctl_vm_reserv_fullpop, "I", "Current number of full reservations"); + static int sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS); SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, @@ -235,6 +240,33 @@ static void vm_reserv_populate(vm_reser static void vm_reserv_reclaim(vm_reserv_t rv); /* + * Returns the current number of full reservations. + * + * Since the number of full reservations is computed without acquiring the + * free page queue lock, the returned value may be inexact. + */ +static int +sysctl_vm_reserv_fullpop(SYSCTL_HANDLER_ARGS) +{ + vm_paddr_t paddr; + struct vm_phys_seg *seg; + vm_reserv_t rv; + int fullpop, segind; + + fullpop = 0; + for (segind = 0; segind < vm_phys_nsegs; segind++) { + seg = &vm_phys_segs[segind]; + paddr = roundup2(seg->start, VM_LEVEL_0_SIZE); + while (paddr + VM_LEVEL_0_SIZE <= seg->end) { + rv = &vm_reserv_array[paddr >> VM_LEVEL_0_SHIFT]; + fullpop += rv->popcnt == VM_LEVEL_0_NPAGES; + paddr += VM_LEVEL_0_SIZE; + } + } + return (sysctl_handle_int(oidp, &fullpop, 0, req)); +} + +/* * Describes the current state of the partially-populated reservation queue. */ static int From owner-svn-src-head@freebsd.org Thu Aug 6 23:44:47 2015 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 E46E69B5969; Thu, 6 Aug 2015 23:44:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D5A2AED7; Thu, 6 Aug 2015 23:44:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t76NilV9096292; Thu, 6 Aug 2015 23:44:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t76NilCx096291; Thu, 6 Aug 2015 23:44:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508062344.t76NilCx096291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 6 Aug 2015 23:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286392 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 06 Aug 2015 23:44:48 -0000 Author: delphij Date: Thu Aug 6 23:44:46 2015 New Revision: 286392 URL: https://svnweb.freebsd.org/changeset/base/286392 Log: Now that the portsnap buildbox is generating the raw bits for INDEX-11, add it to the set of INDEX files built by portsnap. MFC after: 2 weeks Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Thu Aug 6 22:01:09 2015 (r286391) +++ head/etc/portsnap.conf Thu Aug 6 23:44:46 2015 (r286392) @@ -32,3 +32,4 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # List of INDEX files to build and the DESCRIBE file to use for each INDEX INDEX-9 DESCRIBE.9 INDEX INDEX-10 DESCRIBE.10 +INDEX INDEX-11 DESCRIBE.11 From owner-svn-src-head@freebsd.org Fri Aug 7 02:05:17 2015 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 48A369B59E1; Fri, 7 Aug 2015 02:05:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3A063849; Fri, 7 Aug 2015 02:05:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7725H8e052620; Fri, 7 Aug 2015 02:05:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7725H2F052619; Fri, 7 Aug 2015 02:05:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201508070205.t7725H2F052619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 7 Aug 2015 02:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286393 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 02:05:17 -0000 Author: kevlo Date: Fri Aug 7 02:05:16 2015 New Revision: 286393 URL: https://svnweb.freebsd.org/changeset/base/286393 Log: Add support for ASUS WL-100g. Modified: head/share/man/man4/bwi.4 Modified: head/share/man/man4/bwi.4 ============================================================================== --- head/share/man/man4/bwi.4 Thu Aug 6 23:44:46 2015 (r286392) +++ head/share/man/man4/bwi.4 Fri Aug 7 02:05:16 2015 (r286393) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2011 +.Dd August 7, 2015 .Dt BWI 4 .Os .Sh NAME @@ -76,6 +76,7 @@ driver supports Broadcom BCM43xx based w .It Em "Card" Ta Em "Chip" Ta Em "Bus" Ta Em "Standard" .It "Apple Airport Extreme BCM4306 PCI b/g" .It "Apple Airport Extreme BCM4318 PCI b/g" +.It "ASUS WL-100g BCM4306 CardBus b/g" .It "ASUS WL-138g BCM4318 PCI b/g" .It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" .It "Buffalo WLI-PCI-G54S BCM4306 PCI b/g" From owner-svn-src-head@freebsd.org Fri Aug 7 02:37:48 2015 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 D4FCF9B51D0; Fri, 7 Aug 2015 02:37:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A1EF07A4; Fri, 7 Aug 2015 02:37:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t772bm89065073; Fri, 7 Aug 2015 02:37:48 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t772bmQJ065072; Fri, 7 Aug 2015 02:37:48 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508070237.t772bmQJ065072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 7 Aug 2015 02:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286394 - head/usr.bin/ypmatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 02:37:48 -0000 Author: araujo (ports committer) Date: Fri Aug 7 02:37:47 2015 New Revision: 286394 URL: https://svnweb.freebsd.org/changeset/base/286394 Log: Get closest as possible with style(9). No functional change. Differential Revision: D3295 Reviewed by: bapt Modified: head/usr.bin/ypmatch/ypmatch.c Modified: head/usr.bin/ypmatch/ypmatch.c ============================================================================== --- head/usr.bin/ypmatch/ypmatch.c Fri Aug 7 02:05:16 2015 (r286393) +++ head/usr.bin/ypmatch/ypmatch.c Fri Aug 7 02:37:47 2015 (r286394) @@ -34,20 +34,19 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include #include #include #include #include -#include -#include #include #include #include #include -void usage(void); - static const struct ypalias { char *alias, *name; } ypaliases[] = { @@ -63,11 +62,11 @@ static const struct ypalias { { "ethers", "ethers.byname" }, }; -void +static void usage(void) { - fprintf(stderr, - "usage: ypmatch [-kt] [-d domain] key ... mapname\n" + fprintf(stderr, "%s\n%s\n", + "usage: ypmatch [-kt] [-d domain] key ... mapname", " ypmatch -x\n"); fprintf(stderr, "where\n" @@ -82,8 +81,6 @@ int main(int argc, char *argv[]) { char *domainname, *inkey, *inmap, *outbuf; - extern char *optarg; - extern int optind; int outbuflen, key, notrans, rval; int c, r; u_int i; @@ -114,12 +111,12 @@ main(int argc, char *argv[]) if ((argc-optind) < 2 ) usage(); - if (!domainname) { + if (domainname == NULL) { yp_get_default_domain(&domainname); } inmap = argv[argc-1]; - if (!notrans) { + if (notrans == 0) { for (i=0; i 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 D44739B3B40; Fri, 7 Aug 2015 04:27:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A81AE1C25; Fri, 7 Aug 2015 04:27:52 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t774RqdB010799; Fri, 7 Aug 2015 04:27:52 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t774Rqep010798; Fri, 7 Aug 2015 04:27:52 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508070427.t774Rqep010798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Aug 2015 04:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286395 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 04:27:52 -0000 Author: marcel Date: Fri Aug 7 04:27:51 2015 New Revision: 286395 URL: https://svnweb.freebsd.org/changeset/base/286395 Log: Fix the dynamic VHD format to work with qemu. The size of the disk is taken to match the geometry and only when the geometry is max'd out, is the actual recorded size taken. Note that qemu has the same logic for the fixed VHD format. However that is known to conflict with Microsoft Azure, where the recorded size of the image is what counts. Pointed out by: gjb@ Modified: head/usr.bin/mkimg/vhd.c Modified: head/usr.bin/mkimg/vhd.c ============================================================================== --- head/usr.bin/mkimg/vhd.c Fri Aug 7 02:37:47 2015 (r286394) +++ head/usr.bin/mkimg/vhd.c Fri Aug 7 04:27:51 2015 (r286395) @@ -159,6 +159,34 @@ vhd_geometry(uint64_t image_size, struct geom->cylinders = cth / geom->heads; } +static uint64_t +vhd_resize(uint64_t origsz) +{ + struct vhd_geom geom; + uint64_t newsz; + + /* + * Round the image size to the pre-determined geometry that + * matches the image size. This circular dependency implies + * that we need to loop to handle boundary conditions. + * The first time, newsz equals origsz and the geometry will + * typically yield a new size that's smaller. We keep adding + * cylinder's worth of sectors to the new size until its + * larger or equal or origsz. But during those iterations, + * the geometry can change, so we need to account for that. + */ + newsz = origsz; + while (1) { + vhd_geometry(newsz, &geom); + newsz = (int64_t)geom.cylinders * geom.heads * + geom.sectors * VHD_SECTOR_SIZE; + if (newsz >= origsz) + break; + newsz += geom.heads * geom.sectors * VHD_SECTOR_SIZE; + } + return (newsz); +} + static uint32_t vhd_timestamp(void) { @@ -256,8 +284,7 @@ vhd_dyn_resize(lba_t imgsz) { uint64_t imagesz; - imagesz = imgsz * secsz; - imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); + imagesz = vhd_resize(imgsz * secsz); return (image_set_size(imagesz / secsz)); } @@ -266,7 +293,7 @@ vhd_dyn_write(int fd) { struct vhd_footer footer; struct vhd_dyn_header header; - uint64_t imgsz; + uint64_t imgsz, rawsz; lba_t blk, blkcnt, nblks; uint32_t *bat; void *bitmap; @@ -274,13 +301,14 @@ vhd_dyn_write(int fd) uint32_t sector; int bat_entries, error, entry; - imgsz = image_get_size() * secsz; - bat_entries = imgsz / VHD_BLOCK_SIZE; + rawsz = image_get_size() * secsz; + imgsz = (rawsz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); - vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_DYNAMIC, sizeof(footer)); + vhd_make_footer(&footer, rawsz, VHD_DISK_TYPE_DYNAMIC, sizeof(footer)); if (sparse_write(fd, &footer, sizeof(footer)) < 0) return (errno); + bat_entries = imgsz / VHD_BLOCK_SIZE; memset(&header, 0, sizeof(header)); be64enc(&header.cookie, VHD_HEADER_COOKIE); be64enc(&header.data_offset, ~0ULL); @@ -321,7 +349,7 @@ vhd_dyn_write(int fd) blk = 0; blkcnt = VHD_BLOCK_SIZE / secsz; error = 0; - nblks = image_get_size(); + nblks = rawsz / secsz; while (blk < nblks) { if (!image_data(blk, blkcnt)) { blk += blkcnt; @@ -331,15 +359,20 @@ vhd_dyn_write(int fd) error = errno; break; } + /* Handle partial last block */ + if (blk + blkcnt > nblks) + blkcnt = nblks - blk; error = image_copyout_region(fd, blk, blkcnt); if (error) break; blk += blkcnt; } free(bitmap); - if (blk != nblks) + if (error) + return (error); + error = image_copyout_zeroes(fd, imgsz - rawsz); + if (error) return (error); - if (sparse_write(fd, &footer, sizeof(footer)) < 0) return (errno); @@ -362,24 +395,9 @@ FORMAT_DEFINE(vhd_dyn_format); static int vhd_fix_resize(lba_t imgsz) { - struct vhd_geom geom; - int64_t imagesz; + uint64_t imagesz; - /* - * Round the image size to the pre-determined geometry that - * matches the image size. This circular dependency implies - * that we need to loop to handle boundary conditions. - */ - imgsz *= secsz; - imagesz = imgsz; - while (1) { - vhd_geometry(imagesz, &geom); - imagesz = (int64_t)geom.cylinders * geom.heads * - geom.sectors * VHD_SECTOR_SIZE; - if (imagesz >= imgsz) - break; - imagesz += geom.heads * geom.sectors * VHD_SECTOR_SIZE; - } + imagesz = vhd_resize(imgsz * secsz); /* * Azure demands that images are a whole number of megabytes. */ @@ -391,24 +409,24 @@ static int vhd_fix_write(int fd) { struct vhd_footer footer; - uint64_t imgsz; + uint64_t imagesz; int error; error = image_copyout(fd); - if (!error) { - imgsz = image_get_size() * secsz; - vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_FIXED, ~0ULL); - if (sparse_write(fd, &footer, sizeof(footer)) < 0) - error = errno; - } + if (error) + return (error); + + imagesz = image_get_size() * secsz; + vhd_make_footer(&footer, imagesz, VHD_DISK_TYPE_FIXED, ~0ULL); + error = (sparse_write(fd, &footer, sizeof(footer)) < 0) ? errno : 0; return (error); } static struct mkimg_format vhd_fix_format = { - .name = "vhdf", - .description = "Fixed Virtual Hard Disk", - .resize = vhd_fix_resize, - .write = vhd_fix_write, + .name = "vhdf", + .description = "Fixed Virtual Hard Disk", + .resize = vhd_fix_resize, + .write = vhd_fix_write, }; FORMAT_DEFINE(vhd_fix_format); From owner-svn-src-head@freebsd.org Fri Aug 7 04:31:46 2015 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 C7CEB9B3D01; Fri, 7 Aug 2015 04:31:46 +0000 (UTC) (envelope-from gjb@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 B6497FA; Fri, 7 Aug 2015 04:31:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 1A6B11122; Fri, 7 Aug 2015 04:31:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 7 Aug 2015 04:31:44 +0000 From: Glen Barber To: Marcel Moolenaar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286395 - head/usr.bin/mkimg Message-ID: <20150807043144.GH1484@FreeBSD.org> References: <201508070427.t774Rqep010798@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cgXXEQ20Gie/H8Jj" Content-Disposition: inline In-Reply-To: <201508070427.t774Rqep010798@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 04:31:46 -0000 --cgXXEQ20Gie/H8Jj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 07, 2015 at 04:27:52AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Fri Aug 7 04:27:51 2015 > New Revision: 286395 > URL: https://svnweb.freebsd.org/changeset/base/286395 >=20 > Log: > Fix the dynamic VHD format to work with qemu. The size of the disk > is taken to match the geometry and only when the geometry is max'd > out, is the actual recorded size taken. > =20 > Note that qemu has the same logic for the fixed VHD format. However > that is known to conflict with Microsoft Azure, where the recorded > size of the image is what counts. > =20 I'll test this out on the next 11-CURRENT builds. (Based on the content of the commit log, it's unclear to me if you received my last reply on this topic, so if you didn't let me know.) In any case, thanks! :) Glen --cgXXEQ20Gie/H8Jj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVxDSwAAoJEAMUWKVHj+KTz+0QAJPrY46PLX+Xi5HqeKu2Tqdq NjkA+BiNgKn/ijiy2hl9Atn9ZxRIAAyMED/qhYpJVfPUf6HXhHhGB9EQGB5k+U+a Vo4HZxxpEsLwdI6eP3dw1xu7YzwcWCOVTvyaHl2JbeRWWJOFPzyG8yOBR1TcTaIM wrks01Uw15rHqXwxctyles1BsLvHNwUc0Z/Nop/Mb9DbxQ6OO0j1cuagQgj9qmWv RXz14TEP7Ruks9sXKxgQUjrxWfTnlwdE948JlqvUZJY+LoCd2XiYuxMhFzR5q432 cxDi7p0K2O82vbXKBEVNWmizjuQFVkjbjwNN3m2W4NM6Ulc8qbAFQS0PZHm72B2w D10oKNeEDg8/TmTf23P9CiOgZFkiuqxCAZJcDk/yqZoPWtaA7OsY0babG/h04h3x Bi4yXQpCOZkooFYwKNjBbWgP157CoznPhc+5XUrFSqb7XAQ8ocA2JodHNKB0RLLn /eHZLLMO4IKvGtV0Z7a2IDkn8VigPca1nezzmQwgbCMafHpvBwrGl0hX2RWbfRFZ pfr4JV9b64tsYSbiSuJ9o8Wdwana28VqBovK46IU8EP1ZPEXNa2ut0Hq/gly8bP9 yOH5pu0cbyNzLsgWCDRcPeu6hJVkbPo0WNNVw61cWhocwaETjEhdKX7wh1mbglWP 3BjQtA531Zh0R1kYtARd =ztnY -----END PGP SIGNATURE----- --cgXXEQ20Gie/H8Jj-- From owner-svn-src-head@freebsd.org Fri Aug 7 04:45:48 2015 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 2A11B9B3FFF; Fri, 7 Aug 2015 04:45:48 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.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 D4C47B61; Fri, 7 Aug 2015 04:45:47 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.22] (atc.xcllnt.net [50.0.150.213]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id t774jk6J032821 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Aug 2015 21:45:46 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: svn commit: r286395 - head/usr.bin/mkimg Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F15183D4-E302-4132-B8DF-4E7A43BF37E5"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Marcel Moolenaar In-Reply-To: <20150807043144.GH1484@FreeBSD.org> Date: Thu, 6 Aug 2015 21:45:45 -0700 Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201508070427.t774Rqep010798@repo.freebsd.org> <20150807043144.GH1484@FreeBSD.org> To: Glen Barber X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 04:45:48 -0000 --Apple-Mail=_F15183D4-E302-4132-B8DF-4E7A43BF37E5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Aug 6, 2015, at 9:31 PM, Glen Barber wrote: > > On Fri, Aug 07, 2015 at 04:27:52AM +0000, Marcel Moolenaar wrote: >> Author: marcel >> Date: Fri Aug 7 04:27:51 2015 >> New Revision: 286395 >> URL: https://svnweb.freebsd.org/changeset/base/286395 >> >> Log: >> Fix the dynamic VHD format to work with qemu. The size of the disk >> is taken to match the geometry and only when the geometry is max'd >> out, is the actual recorded size taken. >> >> Note that qemu has the same logic for the fixed VHD format. However >> that is known to conflict with Microsoft Azure, where the recorded >> size of the image is what counts. >> > > I'll test this out on the next 11-CURRENT builds. (Based on the content > of the commit log, it's unclear to me if you received my last reply on > this topic, so if you didn't let me know.) I tested this in Azure: the fixed format VHD hasn't been changed. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_F15183D4-E302-4132-B8DF-4E7A43BF37E5 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 iQIcBAEBCgAGBQJVxDf5AAoJEIda8t8f0tjjyrkQAK9d5E9fm+RrJogN4A4qFURA 0Az526hI9RfUj2uYmTxOcPorreUqTyFSzDVRB6nzMeDL5yh37C0lUCoGrTehWlAv CrpBxZkSYvTl6BmLgQ+vhqWfNyE/45s0oFF0FMVlIRnIVHuR36iAp9KslOIsV/El f9uUKbBq7RGLfjoPlnSnuyHiQxfa4teuSkARoChxKrC+uSOSaynKQYCToPP9p8Ee 8y3u20WqWORm686d0MQd603Mx8fPqoMfiMw5tO4c8l7/KD/lPmSPl4k5OWRYJDzG Y2b+FtpwgajhPh0T224E4NhPtOYSXvMM/Rh3PO37+98kqvN/IEZ/Cbj6hpHSKU3W En9FU2XasWKvrs0V2nuFdHAMjBRIj/h595CU8K8CkAlQjsofSaOOYkrOoY4flmf9 73pVn9JSFx+QTJIA23NKcD+2kBVLo3ffx4/+o+4eAkY3ZAMZjYtqULzIcXtULSJ2 IN2n+twzCJIr25LZgcS9NAsnFLi7GjF6WQzrc2lcdrglAaEJanSbtqQQoL/Xq/zm BXX7FUhBgqmUoAjytV0PkH8fCn3/Rqca3f3NkdT8mTiWp7HmnfMmKLc4dpvwO9dJ NWU7LlFod0oAMUyw6f3WdwzOX/2eskR9+MR+djtz8AJEzmIJ1b2MoeAR4rhFrbAD Ygxh1JqWyHsUa816QeCd =zUzP -----END PGP SIGNATURE----- --Apple-Mail=_F15183D4-E302-4132-B8DF-4E7A43BF37E5-- From owner-svn-src-head@freebsd.org Fri Aug 7 04:49:51 2015 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 841219B414A; Fri, 7 Aug 2015 04:49:51 +0000 (UTC) (envelope-from gjb@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 6CAC4D18; Fri, 7 Aug 2015 04:49:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id ADD491776; Fri, 7 Aug 2015 04:49:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 7 Aug 2015 04:49:49 +0000 From: Glen Barber To: Marcel Moolenaar Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286395 - head/usr.bin/mkimg Message-ID: <20150807044949.GI1484@FreeBSD.org> References: <201508070427.t774Rqep010798@repo.freebsd.org> <20150807043144.GH1484@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uiFlv4Q51kMxrSfQ" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 04:49:51 -0000 --uiFlv4Q51kMxrSfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 06, 2015 at 09:45:45PM -0700, Marcel Moolenaar wrote: >=20 > > On Aug 6, 2015, at 9:31 PM, Glen Barber wrote: > >=20 > > On Fri, Aug 07, 2015 at 04:27:52AM +0000, Marcel Moolenaar wrote: > >> Author: marcel > >> Date: Fri Aug 7 04:27:51 2015 > >> New Revision: 286395 > >> URL: https://svnweb.freebsd.org/changeset/base/286395 > >>=20 > >> Log: > >> Fix the dynamic VHD format to work with qemu. The size of the disk > >> is taken to match the geometry and only when the geometry is max'd > >> out, is the actual recorded size taken. > >>=20 > >> Note that qemu has the same logic for the fixed VHD format. However > >> that is known to conflict with Microsoft Azure, where the recorded > >> size of the image is what counts. > >>=20 > >=20 > > I'll test this out on the next 11-CURRENT builds. (Based on the content > > of the commit log, it's unclear to me if you received my last reply on > > this topic, so if you didn't let me know.) >=20 > I tested this in Azure: the fixed format VHD hasn't been > changed. >=20 Doh. Sorry, misread the log. (And all these formats...!) :) Glen --uiFlv4Q51kMxrSfQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVxDjtAAoJEAMUWKVHj+KTQQUP/1QO/yGR9Zgd9YyJjIQsZHeJ nuIklEwUA8tnlkpvZiL73X9fkleycK1tcHU8aFlDEu4BUR9gTNjV6pir/S7telL3 Wp2JG7AqCyEsZDYr8HjRlw0YOULsTnNvv+uelpgsdKVj9NJvZx4pHz3LKIwQoR7z p3AYiT21t1/Rd5pyJIrS9gYCG94m+Mto/SQ7UtP209Tm43ydQe3UttzGIuFSXwL0 YljtucERgAdwtV1oY/KceA1V1OrHDrV1aVhyyzGkCDLBoAoEQwRLSIMFPQZ2QQfz jDAMrnYU8r0p5i2doJV535Ppl+ayuXZ9DC1sMWzflvyx04sRWzdGsc/53Aji5YT/ 3QaINN9oOKwRDjNQLp9amdjNMH3g0rc4AXMPjI8khIzw/sW83ZnX+XOQtNhKpqMk koJ05oeDtcC6SmISjZzVdKbU+FiZ/R35B6qu6zZFLgD0Jl9kbl0k1bJY1tfeweU2 LezxPbfiPb3zJjanmUJKn4r2y0Z3SHXS1emMSXZeGChBqMNLSQCJf5qfKneGcxSY 0gqdXDt/msYR+mzcm0O1Rtfpxtm5pC+DHMlP5LACC2yaCokCJn3TX/0vAqTQah2Z kHnakunry84B/lBJC157x+4++SjV7R57H6aKXHqufnnLhYPVkgzoveqzE1DWgq1W 7g7+VY9Jfa03wZO8/iFF =N0ed -----END PGP SIGNATURE----- --uiFlv4Q51kMxrSfQ-- From owner-svn-src-head@freebsd.org Fri Aug 7 04:58:36 2015 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 BE57A9B431A; Fri, 7 Aug 2015 04:58:36 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AB498144; Fri, 7 Aug 2015 04:58:36 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t774waQ7023226; Fri, 7 Aug 2015 04:58:36 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t774wapr023225; Fri, 7 Aug 2015 04:58:36 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <201508070458.t774wapr023225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Fri, 7 Aug 2015 04:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286400 - head/contrib/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 04:58:36 -0000 Author: gshapiro Date: Fri Aug 7 04:58:35 2015 New Revision: 286400 URL: https://svnweb.freebsd.org/changeset/base/286400 Log: Reminder to check tools/build/mk/OptionalObsoleteFiles.inc on new version imports. Obtained from: garga@ Modified: head/contrib/sendmail/FREEBSD-upgrade Modified: head/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- head/contrib/sendmail/FREEBSD-upgrade Fri Aug 7 04:38:13 2015 (r286399) +++ head/contrib/sendmail/FREEBSD-upgrade Fri Aug 7 04:58:35 2015 (r286400) @@ -86,6 +86,7 @@ infrastructure in FreeBSD: share/man/man8/rc.sendmail.8 share/mk/bsd.libnames.mk share/sendmail/Makefile + tools/build/mk/OptionalObsoleteFiles.inc usr.bin/Makefile usr.bin/vacation/Makefile usr.sbin/Makefile From owner-svn-src-head@freebsd.org Fri Aug 7 05:59:59 2015 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 CE7199B50D9; Fri, 7 Aug 2015 05:59:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9ADF5E48; Fri, 7 Aug 2015 05:59:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t775xxhY047540; Fri, 7 Aug 2015 05:59:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t775xxrA047539; Fri, 7 Aug 2015 05:59:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508070559.t775xxrA047539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Aug 2015 05:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286401 - in head/sys: i386/include pc98/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.20 Precedence: list List-Id: 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, 07 Aug 2015 05:59:59 -0000 Author: kib Date: Fri Aug 7 05:59:58 2015 New Revision: 286401 URL: https://svnweb.freebsd.org/changeset/base/286401 Log: Remove unused i386 header privatespace.h. For the native kernel, its use was removed in r173592 (Nov 2007), yet Xen PV bits continued referencing the privatespace structure, and were removed in r282274 (Apr 2015). Discussed with: jhb Sponsored by: The FreeBSD Foundation Deleted: head/sys/i386/include/privatespace.h head/sys/pc98/include/privatespace.h From owner-svn-src-head@freebsd.org Fri Aug 7 06:15:02 2015 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 3E2349B53F1; Fri, 7 Aug 2015 06:15:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2EFF97E1; Fri, 7 Aug 2015 06:15:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t776F22x055381; Fri, 7 Aug 2015 06:15:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t776F20k055380; Fri, 7 Aug 2015 06:15:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508070615.t776F20k055380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 7 Aug 2015 06:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286402 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 06:15:02 -0000 Author: araujo (ports committer) Date: Fri Aug 7 06:15:01 2015 New Revision: 286402 URL: https://svnweb.freebsd.org/changeset/base/286402 Log: Fix variable 'old' is used uninitialized whenever '&&' condition is false. Spotted by clang. Differential Revision: D2721 Reviewed by: rodrigc, bapt Modified: head/contrib/bsnmp/snmp_mibII/mibII_ip.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_ip.c Fri Aug 7 05:59:58 2015 (r286401) +++ head/contrib/bsnmp/snmp_mibII/mibII_ip.c Fri Aug 7 06:15:01 2015 (r286402) @@ -151,7 +151,7 @@ int op_ip(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { - int old; + int old = 0; switch (op) { From owner-svn-src-head@freebsd.org Fri Aug 7 07:05:48 2015 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 529999B50F7; Fri, 7 Aug 2015 07:05:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 438231EAD; Fri, 7 Aug 2015 07:05:48 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7775mXm078234; Fri, 7 Aug 2015 07:05:48 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7775mK7078233; Fri, 7 Aug 2015 07:05:48 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508070705.t7775mK7078233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 7 Aug 2015 07:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286403 - head/usr.bin/ypmatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 07:05:48 -0000 Author: araujo (ports committer) Date: Fri Aug 7 07:05:47 2015 New Revision: 286403 URL: https://svnweb.freebsd.org/changeset/base/286403 Log: Remove an extra new line on usage(). Rename domain to domainname to be identical to the man page. Reported by: bde Modified: head/usr.bin/ypmatch/ypmatch.c Modified: head/usr.bin/ypmatch/ypmatch.c ============================================================================== --- head/usr.bin/ypmatch/ypmatch.c Fri Aug 7 06:15:01 2015 (r286402) +++ head/usr.bin/ypmatch/ypmatch.c Fri Aug 7 07:05:47 2015 (r286403) @@ -66,8 +66,8 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n", - "usage: ypmatch [-kt] [-d domain] key ... mapname", - " ypmatch -x\n"); + "usage: ypmatch [-kt] [-d domainname] key ... mapname", + " ypmatch -x"); fprintf(stderr, "where\n" "\tmapname may be either a mapname or a nickname for a map.\n" From owner-svn-src-head@freebsd.org Fri Aug 7 08:13:35 2015 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 CFED69B65D3; Fri, 7 Aug 2015 08:13:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C1410DE; Fri, 7 Aug 2015 08:13:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t778DZLM010907; Fri, 7 Aug 2015 08:13:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t778DZUm010906; Fri, 7 Aug 2015 08:13:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508070813.t778DZUm010906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Aug 2015 08:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286404 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 08:13:35 -0000 Author: kib Date: Fri Aug 7 08:13:34 2015 New Revision: 286404 URL: https://svnweb.freebsd.org/changeset/base/286404 Log: The condition to use direct processing for the unmapped bio is reverted. We can do direct processing when g_io_check() does not need to perform transient remapping of the bio, otherwise the thread has to sleep. Reviewed by: mav (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Fri Aug 7 07:05:47 2015 (r286403) +++ head/sys/geom/geom_io.c Fri Aug 7 08:13:34 2015 (r286404) @@ -520,8 +520,8 @@ g_io_request(struct bio *bp, struct g_co direct = (cp->flags & G_CF_DIRECT_SEND) && (pp->flags & G_PF_DIRECT_RECEIVE) && !g_is_geom_thread(curthread) && - (((pp->flags & G_PF_ACCEPT_UNMAPPED) == 0 && - (bp->bio_flags & BIO_UNMAPPED) != 0) || THREAD_CAN_SLEEP()); + ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 || + (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()); if (direct) { /* Block direct execution if less then half of stack left. */ size_t st, su; From owner-svn-src-head@freebsd.org Fri Aug 7 08:24:12 2015 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 DED779B6770; Fri, 7 Aug 2015 08:24:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D00FA833; Fri, 7 Aug 2015 08:24:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t778OC86015396; Fri, 7 Aug 2015 08:24:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t778OCTU015395; Fri, 7 Aug 2015 08:24:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508070824.t778OCTU015395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Aug 2015 08:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286405 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 08:24:13 -0000 Author: kib Date: Fri Aug 7 08:24:12 2015 New Revision: 286405 URL: https://svnweb.freebsd.org/changeset/base/286405 Log: Minor style cleanup of the code surrounding r286404. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Fri Aug 7 08:13:34 2015 (r286404) +++ head/sys/geom/geom_io.c Fri Aug 7 08:24:12 2015 (r286405) @@ -517,11 +517,11 @@ g_io_request(struct bio *bp, struct g_co getbinuptime(&bp->bio_t0); #ifdef GET_STACK_USAGE - direct = (cp->flags & G_CF_DIRECT_SEND) && - (pp->flags & G_PF_DIRECT_RECEIVE) && - !g_is_geom_thread(curthread) && - ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 || - (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()); + direct = (cp->flags & G_CF_DIRECT_SEND) != 0 && + (pp->flags & G_PF_DIRECT_RECEIVE) != 0 && + !g_is_geom_thread(curthread) && + ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 || + (bp->bio_flags & BIO_UNMAPPED) == 0 || THREAD_CAN_SLEEP()); if (direct) { /* Block direct execution if less then half of stack left. */ size_t st, su; From owner-svn-src-head@freebsd.org Fri Aug 7 08:30:44 2015 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 C041B9B6840; Fri, 7 Aug 2015 08:30:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B193DAF3; Fri, 7 Aug 2015 08:30:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t778UiJ5016558; Fri, 7 Aug 2015 08:30:44 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t778UiuE016557; Fri, 7 Aug 2015 08:30:44 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508070830.t778UiuE016557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 7 Aug 2015 08:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286406 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 08:30:44 -0000 Author: araujo (ports committer) Date: Fri Aug 7 08:30:43 2015 New Revision: 286406 URL: https://svnweb.freebsd.org/changeset/base/286406 Log: Wrap some unused functions with notyet, it is necessary to be able to build the modules/ctl directly. Remove a dead MALLOC_DEFINE. Differential Revision: D3329 Reviewed by: mav Sponsored by: gandi.net Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Aug 7 08:24:12 2015 (r286405) +++ head/sys/cam/ctl/ctl.c Fri Aug 7 08:30:43 2015 (r286406) @@ -511,7 +511,6 @@ static struct cdevsw ctl_cdevsw = { MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); -MALLOC_DEFINE(M_CTLIO, "ctlio", "Memory used for CTL requests"); static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -14274,6 +14273,7 @@ ctl_init_isc_msg(void) printf("CTL: Still calling this thing\n"); } +#ifdef notyet /* * Init component * Initializes component into configuration defined by bootMode @@ -14365,6 +14365,7 @@ struct ctl_ha_component ctl_ha_component .start = ctl_isc_start, .quiesce = ctl_isc_quiesce }; +#endif /* * vim: ts=8 From owner-svn-src-head@freebsd.org Fri Aug 7 08:54:51 2015 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 4CA0A9B6DB2; Fri, 7 Aug 2015 08:54:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3DEED19E6; Fri, 7 Aug 2015 08:54:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t778spF3029082; Fri, 7 Aug 2015 08:54:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t778spcc029081; Fri, 7 Aug 2015 08:54:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508070854.t778spcc029081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 7 Aug 2015 08:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286407 - head/sys/dev/mmc/host X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 08:54:51 -0000 Author: andrew Date: Fri Aug 7 08:54:50 2015 New Revision: 286407 URL: https://svnweb.freebsd.org/changeset/base/286407 Log: Stop including machine/fdt.h, it's unneeded, and purposefully unimplemented on arm64. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri Aug 7 08:30:43 2015 (r286406) +++ head/sys/dev/mmc/host/dwmmc.c Fri Aug 7 08:54:50 2015 (r286407) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-head@freebsd.org Fri Aug 7 08:57:59 2015 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 8D2649B6E30; Fri, 7 Aug 2015 08:57:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7A0341C3F; Fri, 7 Aug 2015 08:57:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t778vxUe029448; Fri, 7 Aug 2015 08:57:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t778vxFm029447; Fri, 7 Aug 2015 08:57:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508070857.t778vxFm029447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 7 Aug 2015 08:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286408 - head/sys/dev/mmc/host X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 08:57:59 -0000 Author: andrew Date: Fri Aug 7 08:57:58 2015 New Revision: 286408 URL: https://svnweb.freebsd.org/changeset/base/286408 Log: Attach dwmmc to the ofwbus, som devicetrees place it here. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri Aug 7 08:54:50 2015 (r286407) +++ head/sys/dev/mmc/host/dwmmc.c Fri Aug 7 08:57:58 2015 (r286408) @@ -1208,4 +1208,5 @@ static driver_t dwmmc_driver = { static devclass_t dwmmc_devclass; DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); +DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); From owner-svn-src-head@freebsd.org Fri Aug 7 10:48:54 2015 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 DB0759B5BA7; Fri, 7 Aug 2015 10:48:53 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CBE2B8E5; Fri, 7 Aug 2015 10:48:53 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77AmrC4079672; Fri, 7 Aug 2015 10:48:53 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77AmrAI079671; Fri, 7 Aug 2015 10:48:53 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201508071048.t77AmrAI079671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 7 Aug 2015 10:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286409 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 10:48:54 -0000 Author: brueffer Date: Fri Aug 7 10:48:52 2015 New Revision: 286409 URL: https://svnweb.freebsd.org/changeset/base/286409 Log: Manpage cleanup. - new sentence -> new line - fix manpage references - fix macro usage - fix a typo MFC after: 1 week Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Aug 7 08:57:58 2015 (r286408) +++ head/usr.sbin/bhyve/bhyve.8 Fri Aug 7 10:48:52 2015 (r286409) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2014 +.Dd August 7, 2015 .Dt BHYVE 8 .Os .Sh NAME @@ -50,7 +50,7 @@ Parameters such as the number of virtual I/O connectivity can be specified with command-line parameters. .Pp The guest operating system must be loaded with -.Xr bhyveload 4 +.Xr bhyveload 8 or a similar boot loader before running .Nm . .Pp @@ -61,8 +61,8 @@ exit is detected. .Bl -tag -width 10n .It Fl a The guest's local APIC is configured in xAPIC mode. -The xAPIC mode is the default setting so this option is redundant. It will be -deprecated in a future version. +The xAPIC mode is the default setting so this option is redundant. +It will be deprecated in a future version. .It Fl A Generate ACPI tables. Required for @@ -124,7 +124,7 @@ Force the guest virtual CPU to exit when .It Fl s Ar slot,emulation Ns Op , Ns Ar conf Configure a virtual PCI slot and function. .Pp -.Nm bhyve +.Nm provides PCI bus emulation and virtual devices that can be attached to slots on the bus. There are 32 available slots, with the option of providing up to 8 functions @@ -136,11 +136,19 @@ per slot. .Pp The .Ar pcislot -value is 0 to 31. The optional function value is 0 to 7. The optional +value is 0 to 31. +The optional +.Ar function +value is 0 to 7. +The optional .Ar bus value is 0 to 255. -If not specified, the function value defaults to 0. -If not specified, the bus value defaults to 0. +If not specified, the +.Ar function +value defaults to 0. +If not specified, the +.Ar bus +value defaults to 0. .It Ar emulation .Bl -tag -width 10n .It Li hostbridge | Li amd_hostbridge @@ -221,7 +229,9 @@ TTY devices: .Bl -tag -width 10n .It Li stdio Connect the serial port to the standard input and output of -the bhyve process. +the +.Nm +process. .It Pa /dev/xxx Use the host TTY device for serial port I/O. .El @@ -265,7 +275,8 @@ in the guest's System Management BIOS Sy By default a UUID is generated from the host's hostname and .Ar vmname . .It Fl w -Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. +Ignore accesses to unimplemented Model Specific Registers (MSRs). +This is intended for debug purposes. .It Fl W Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts. @@ -280,7 +291,7 @@ This should be the same as that created .El .Sh EXAMPLES The guest operating system must have been loaded with -.Xr bhyveload 4 +.Xr bhyveload 8 or a similar boot loader before .Xr bhyve 4 can be run. @@ -308,7 +319,7 @@ Run an 8GB quad-CPU virtual machine with CD-ROM, a single virtio network port, an AMD hostbridge, and the console port connected to an .Xr nmdm 4 -null-model device. +null-modem device. .Bd -literal -offset indent bhyve -c 4 \e\ -s 0,amd_hostbridge -s 1,lpc \\ From owner-svn-src-head@freebsd.org Fri Aug 7 11:43:16 2015 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 E50BC9B589E; Fri, 7 Aug 2015 11:43:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D2965E33; Fri, 7 Aug 2015 11:43:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77BhGPB007292; Fri, 7 Aug 2015 11:43:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77BhFvr007283; Fri, 7 Aug 2015 11:43:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508071143.t77BhFvr007283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Aug 2015 11:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286410 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 11:43:17 -0000 Author: glebius Date: Fri Aug 7 11:43:14 2015 New Revision: 286410 URL: https://svnweb.freebsd.org/changeset/base/286410 Log: Change KPI of how device drivers that provide wireless connectivity interact with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Details here: https://wiki.freebsd.org/projects/ifnet/net80211 Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances of problems are low. The wtap wasn't compilable even before this change. But the ndis driver is complex, and it is likely to be broken with this commit. Help with testing and debugging it is appreciated. Differential Revision: D2655, D2740 Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/etc/network.subr head/etc/rc.d/netif head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h head/sys/dev/bwi/bwimac.c head/sys/dev/bwi/bwiphy.c head/sys/dev/bwi/bwirf.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwi/if_bwivar.h head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndisvar.h head/sys/dev/ipw/if_ipw.c head/sys/dev/ipw/if_ipwvar.h head/sys/dev/iwi/if_iwi.c head/sys/dev/iwi/if_iwivar.h head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malo.h head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/if_mwl_pci.c head/sys/dev/mwl/if_mwlvar.h head/sys/dev/ral/if_ral_pci.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2560var.h head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2661var.h head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860var.h head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_uathvar.h head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_upgtvar.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_uralvar.h head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwvar.h head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/wi/if_wi_pci.c head/sys/dev/wi/if_wivar.h head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h head/sys/dev/wtap/if_wtap.c head/sys/dev/wtap/if_wtapvar.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_var.h head/tools/tools/iwn/iwnstats/main.c Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Aug 7 10:48:52 2015 (r286409) +++ head/etc/network.subr Fri Aug 7 11:43:14 2015 (r286410) @@ -1249,6 +1249,70 @@ ifscript_down() fi } +# wlan_up +# Create IEEE802.3 interfaces. +# +wlan_up() +{ + local _list _iflist wlan parent ifn + _list= + _iflist=$* + + for wlan in `set | egrep ^wlans_[a-z]+[0-9]+=[a-z]+[0-9]+`; do + # Parse wlans_$parent=$ifn + wlan=`echo $wlan | sed -E 's/wlans_([a-z]+[0-9]+)=([a-z]+[0-9]+)/\1:\2/'` + OIFS=$IFS; IFS=:; set -- $wlan; parent=$1; ifn=$2; IFS=$OIFS + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + # Skip if ${ifn} already exists. + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} ${ifn} create wlandev ${parent} + if [ $? -eq 0 ]; then + _list="$_list $ifn" + fi + done + if [ -n "${_list# }" ]; then + echo "Created wlan(4) interfaces: ${_list# }." + fi + debug "Created wlan(4)s: ${_list# }" +} + +# wlan_down +# Destroy IEEE802.3 interfaces. +# +wlan_down() +{ + local _list _iflist wlan parent ifn + _list= + _iflist=$* + + for wlan in `set | egrep ^wlans_[a-z]+[0-9]+=[a-z]+[0-9]+`; do + # Parse wlans_$parent=$ifn + wlan=`echo $wlan | sed -E 's/wlans_([a-z]+[0-9]+)=([a-z]+[0-9]+)/\1:\2/'` + OIFS=$IFS; IFS=:; set -- $wlan; parent=$1; ifn=$2; IFS=$OIFS + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + # Skip if ${ifn} doesn't exists. + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} -n ${ifn} destroy + if [ $? -eq 0 ]; then + _list="$_list $ifn" + fi + done + if [ -n "${_list# }" ]; then + echo "Destroyed wlan(4) interfaces: ${_list# }." + fi + debug "Destroyed wlan(4)s: ${_list# }" +} + # clone_up # Create cloneable interfaces. # @@ -1398,6 +1462,9 @@ clone_down() # Create and configure child interfaces. Return 0 if child # interfaces are created. # +# XXXGL: the wlan code in this functions is superseded by wlan_up(), +# and will go away soon. +# childif_create() { local cfg child child_vlans child_wlans create_args debug_flags ifn i Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Fri Aug 7 10:48:52 2015 (r286409) +++ head/etc/rc.d/netif Fri Aug 7 11:43:14 2015 (r286410) @@ -37,6 +37,8 @@ name="netif" rcvar="${name}_enable" start_cmd="netif_start" stop_cmd="netif_stop" +wlanup_cmd="wlan_up" +wlandown_cmd="wlan_down" cloneup_cmd="clone_up" clonedown_cmd="clone_down" clear_cmd="doclear" @@ -65,6 +67,9 @@ netif_start() trap : 2 fi + # Create IEEE802.3 interface + wlan_up $cmdifn + # Create cloned interfaces clone_up $cmdifn @@ -91,12 +96,14 @@ netif_start() netif_stop() { _clone_down=1 + _wlan_down=1 netif_stop0 $* } doclear() { _clone_down= + _wlan_down= netif_stop0 $* } @@ -111,6 +118,11 @@ netif_stop0() # Deconfigure the interface(s) netif_common ifn_stop $cmdifn + # Destroy wlan interfaces + if [ -n "$_wlan_down" ]; then + wlan_down $cmdifn + fi + # Destroy cloned interfaces if [ -n "$_clone_down" ]; then clone_down $cmdifn Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri Aug 7 10:48:52 2015 (r286409) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri Aug 7 11:43:14 2015 (r286410) @@ -488,8 +488,7 @@ ath_rate_findrate(struct ath_softc *sc, #define RATE(ix) (DOT11RATE(ix) / 2) struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; const HAL_RATE_TABLE *rt = sc->sc_currates; const int size_bin = size_to_bin(frameLen); int rix, mrr, best_rix, change_rates; @@ -856,8 +855,7 @@ ath_rate_tx_complete(struct ath_softc *s const struct ath_rc_series *rc, const struct ath_tx_status *ts, int frame_size, int nframes, int nbad) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct sample_node *sn = ATH_NODE_SAMPLE(an); int final_rix, short_tries, long_tries; const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -1303,8 +1301,7 @@ static int ath_rate_sysctl_stats(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; int error, v; v = 0; Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Fri Aug 7 10:48:52 2015 (r286409) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri Aug 7 11:43:14 2015 (r286410) @@ -134,8 +134,7 @@ static unsigned calc_usecs_unicast_packe int long_retries, int is_ht40) { const HAL_RATE_TABLE *rt = sc->sc_currates; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; int rts, cts; unsigned t_slot = 20; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Aug 7 10:48:52 2015 (r286409) +++ head/sys/dev/ath/if_ath.c Fri Aug 7 11:43:14 2015 (r286410) @@ -151,15 +151,15 @@ static struct ieee80211vap *ath_vap_crea const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void ath_vap_delete(struct ieee80211vap *); -static void ath_init(void *); -static void ath_stop_locked(struct ifnet *); -static void ath_stop(struct ifnet *); +static void ath_init(struct ath_softc *); +static void ath_stop_locked(struct ath_softc *); +static void ath_stop(struct ath_softc *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static int ath_transmit(struct ifnet *ifp, struct mbuf *m); -static void ath_qflush(struct ifnet *ifp); +static int ath_transmit(struct ieee80211com *, struct mbuf *); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); -static int ath_ioctl(struct ifnet *, u_long, caddr_t); +static int ath_ioctl(struct ieee80211com *, u_long, void *); +static void ath_parent(struct ieee80211com *); static void ath_fatal_proc(void *, int); static void ath_bmiss_vap(struct ieee80211vap *); static void ath_bmiss_proc(void *, int); @@ -571,34 +571,19 @@ ath_fetch_mac_kenv(struct ath_softc *sc, int ath_attach(u_int16_t devid, struct ath_softc *sc) { - struct ifnet *ifp; - struct ieee80211com *ic; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = NULL; HAL_STATUS status; int error = 0, i; u_int wmodes; - uint8_t macaddr[IEEE80211_ADDR_LEN]; int rx_chainmask, tx_chainmask; HAL_OPS_CONFIG ah_config; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); - CURVNET_SET(vnet0); - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - error = ENOSPC; - CURVNET_RESTORE(); - goto bad; - } - ic = ifp->if_l2com; ic->ic_softc = sc; ic->ic_name = device_get_nameunit(sc->sc_dev); - if_initname(ifp, device_get_name(sc->sc_dev), - device_get_unit(sc->sc_dev)); - CURVNET_RESTORE(); - /* * Configure the initial configuration data. * @@ -732,8 +717,8 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_tq = taskqueue_create("ath_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->sc_tq); - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, - "%s taskq", ifp->if_xname); + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->sc_dev)); TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); @@ -876,17 +861,6 @@ ath_attach(u_int16_t devid, struct ath_s ath_led_config(sc); ath_hal_setledstate(ah, HAL_LED_INIT); - ifp->if_softc = sc; - ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_transmit = ath_transmit; - ifp->if_qflush = ath_qflush; - ifp->if_ioctl = ath_ioctl; - ifp->if_init = ath_init; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - - ic->ic_ifp = ifp; /* XXX not right but it's not used anywhere important */ ic->ic_phytype = IEEE80211_T_OFDM; ic->ic_opmode = IEEE80211_M_STA; @@ -1208,11 +1182,11 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hasveol = ath_hal_hasveol(ah); /* get mac address from kenv first, then hardware */ - if (ath_fetch_mac_kenv(sc, macaddr) == 0) { + if (ath_fetch_mac_kenv(sc, ic->ic_macaddr) == 0) { /* Tell the HAL now about the new MAC */ - ath_hal_setmac(ah, macaddr); + ath_hal_setmac(ah, ic->ic_macaddr); } else { - ath_hal_getmac(ah, macaddr); + ath_hal_getmac(ah, ic->ic_macaddr); } if (sc->sc_hasbmask) @@ -1221,12 +1195,15 @@ ath_attach(u_int16_t devid, struct ath_s /* NB: used to size node table key mapping array */ ic->ic_max_keyix = sc->sc_keymax; /* call MI attach routine. */ - ieee80211_ifattach(ic, macaddr); + ieee80211_ifattach(ic); ic->ic_setregdomain = ath_setregdomain; ic->ic_getradiocaps = ath_getradiocaps; sc->sc_opmode = HAL_M_STA; /* override default methods */ + ic->ic_ioctl = ath_ioctl; + ic->ic_parent = ath_parent; + ic->ic_transmit = ath_transmit; ic->ic_newassoc = ath_newassoc; ic->ic_updateslot = ath_updateslot; ic->ic_wme.wme_update = ath_wme_update; @@ -1322,16 +1299,6 @@ bad2: bad: if (ah) ath_hal_detach(ah); - - /* - * To work around scoping issues with CURVNET_SET/CURVNET_RESTORE.. - */ - if (ifp != NULL && ifp->if_vnet) { - CURVNET_SET(ifp->if_vnet); - if_free(ifp); - CURVNET_RESTORE(); - } else if (ifp != NULL) - if_free(ifp); sc->sc_invalid = 1; return error; } @@ -1339,10 +1306,6 @@ bad: int ath_detach(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); /* * NB: the order of these is important: @@ -1367,14 +1330,14 @@ ath_detach(struct ath_softc *sc) ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); - ATH_UNLOCK(sc); /* * Stop things cleanly. */ - ath_stop(ifp); + ath_stop_locked(sc); + ATH_UNLOCK(sc); - ieee80211_ifdetach(ifp->if_l2com); + ieee80211_ifdetach(&sc->sc_ic); taskqueue_free(sc->sc_tq); #ifdef ATH_TX99_DIAG if (sc->sc_tx99 != NULL) @@ -1394,10 +1357,6 @@ ath_detach(struct ath_softc *sc) ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ - CURVNET_SET(ifp->if_vnet); - if_free(ifp); - CURVNET_RESTORE(); - return 0; } @@ -1473,7 +1432,7 @@ ath_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_vap *avp; struct ieee80211vap *vap; uint8_t mac[IEEE80211_ADDR_LEN]; @@ -1581,8 +1540,7 @@ ath_vap_create(struct ieee80211com *ic, vap = &avp->av_vap; /* XXX can't hold mutex across if_alloc */ ATH_UNLOCK(sc); - error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, - bssid, mac); + error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid); ATH_LOCK(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: error %d creating vap\n", @@ -1716,7 +1674,8 @@ ath_vap_create(struct ieee80211com *ic, ATH_UNLOCK(sc); /* complete setup */ - ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status); + ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status, + mac); return vap; bad2: reclaim_address(sc, mac); @@ -1731,8 +1690,7 @@ static void ath_vap_delete(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); @@ -1741,7 +1699,7 @@ ath_vap_delete(struct ieee80211vap *vap) ATH_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Quiesce the hardware while we remove the vap. In * particular we need to reclaim all references to @@ -1824,7 +1782,7 @@ ath_vap_delete(struct ieee80211vap *vap) #endif free(avp, M_80211_VAP); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Restart rx+tx machines if still running (RUNNING will * be reset if we just destroyed the last vap). @@ -1851,13 +1809,9 @@ ath_vap_delete(struct ieee80211vap *vap) void ath_suspend(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); + struct ieee80211com *ic = &sc->sc_ic; - sc->sc_resume_up = (ifp->if_flags & IFF_UP) != 0; + sc->sc_resume_up = ic->ic_nrunning != 0; ieee80211_suspend_all(ic); /* @@ -1898,8 +1852,7 @@ ath_suspend(struct ath_softc *sc) static void ath_reset_keycache(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; int i; @@ -1941,8 +1894,7 @@ ath_update_chainmasks(struct ath_softc * void ath_resume(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; @@ -2015,12 +1967,8 @@ ath_resume(struct ath_softc *sc) void ath_shutdown(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); - ath_stop(ifp); + ath_stop(sc); /* NB: no point powering down chip as we're about to reboot */ } @@ -2031,7 +1979,6 @@ void ath_intr(void *arg) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; HAL_INT status = 0; uint32_t txqs; @@ -2070,12 +2017,11 @@ ath_intr(void *arg) ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); - if ((ifp->if_flags & IFF_UP) == 0 || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if (sc->sc_ic.ic_nrunning == 0 && sc->sc_running == 0) { HAL_INT status; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n", - __func__, ifp->if_flags); + DPRINTF(sc, ATH_DEBUG_ANY, "%s: ic_nrunning %d sc_running %d\n", + __func__, sc->sc_ic.ic_nrunning, sc->sc_running); ath_hal_getisr(ah, &status); /* clear ISR */ ath_hal_intrset(ah, 0); /* disable further intr's */ ATH_PCU_UNLOCK(sc); @@ -2313,7 +2259,6 @@ static void ath_fatal_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; u_int32_t *state; u_int32_t len; void *sp; @@ -2334,13 +2279,13 @@ ath_fatal_proc(void *arg, int pending) "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n", state[0], state[1] , state[2], state[3], state[4], state[5]); } - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; /* * Workaround phantom bmiss interrupts by sanity-checking @@ -2361,8 +2306,6 @@ ath_bmiss_vap(struct ieee80211vap *vap) ATH_UNLOCK(sc); if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; u_int64_t lastrx = sc->sc_lastrx; u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); /* XXX should take a locked ref to iv_bss */ @@ -2420,7 +2363,6 @@ static void ath_bmiss_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; uint32_t hangs; DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); @@ -2438,12 +2380,12 @@ ath_bmiss_proc(void *arg, int pending) * to clear. */ if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); device_printf(sc->sc_dev, "bb hang detected (0x%x), resetting\n", hangs); } else { - ath_reset(ifp, ATH_RESET_NOLOSS); - ieee80211_beacon_miss(ifp->if_l2com); + ath_reset(sc, ATH_RESET_NOLOSS); + ieee80211_beacon_miss(&sc->sc_ic); } /* Force a beacon resync, in case they've drifted */ @@ -2463,8 +2405,7 @@ ath_bmiss_proc(void *arg, int pending) static void ath_settkipmic(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; if ((ic->ic_cryptocaps & IEEE80211_CRYPTO_TKIP) && !sc->sc_wmetkipmic) { if (ic->ic_flags & IEEE80211_F_WME) { @@ -2478,11 +2419,9 @@ ath_settkipmic(struct ath_softc *sc) } static void -ath_init(void *arg) +ath_init(struct ath_softc *sc) { - struct ath_softc *sc = (struct ath_softc *) arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; @@ -2501,7 +2440,7 @@ ath_init(void *arg) * Stop anything previously setup. This is safe * whether this is the first time through or not. */ - ath_stop_locked(ifp); + ath_stop_locked(sc); /* * The basic interface to setting the hardware in a good @@ -2627,7 +2566,7 @@ ath_init(void *arg) DPRINTF(sc, ATH_DEBUG_RESET, "%s: imask=0x%x\n", __func__, sc->sc_imask); - ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->sc_running = 1; callout_reset(&sc->sc_wd_ch, hz, ath_watchdog, sc); ath_hal_intrset(ah, sc->sc_imask); @@ -2643,14 +2582,10 @@ ath_init(void *arg) } static void -ath_stop_locked(struct ifnet *ifp) +ath_stop_locked(struct ath_softc *sc) { - struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid %u if_flags 0x%x\n", - __func__, sc->sc_invalid, ifp->if_flags); - ATH_LOCK_ASSERT(sc); /* @@ -2658,7 +2593,7 @@ ath_stop_locked(struct ifnet *ifp) */ ath_power_set_power_state(sc, HAL_PM_AWAKE); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Shutdown the hardware and driver: * reset 802.11 state machine @@ -2680,7 +2615,7 @@ ath_stop_locked(struct ifnet *ifp) #endif callout_stop(&sc->sc_wd_ch); sc->sc_wd_timer = 0; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->sc_running = 0; if (!sc->sc_invalid) { if (sc->sc_softled) { callout_stop(&sc->sc_ledtimer); @@ -2832,12 +2767,11 @@ ath_reset_grablock(struct ath_softc *sc, */ static void -ath_stop(struct ifnet *ifp) +ath_stop(struct ath_softc *sc) { - struct ath_softc *sc = ifp->if_softc; - + ATH_LOCK(sc); - ath_stop_locked(ifp); + ath_stop_locked(sc); ATH_UNLOCK(sc); } @@ -2849,10 +2783,9 @@ ath_stop(struct ifnet *ifp) * to reset or reload hardware state. */ int -ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type) +ath_reset(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { - struct ath_softc *sc = ifp->if_softc; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; int i; @@ -3014,15 +2947,6 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T } } - /* - * This may have been set during an ath_start() call which - * set this once it detected a concurrent TX was going on. - * So, clear it. - */ - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - ATH_LOCK(sc); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); @@ -3044,8 +2968,7 @@ static int ath_reset_vap(struct ieee80211vap *vap, u_long cmd) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; switch (cmd) { @@ -3060,7 +2983,7 @@ ath_reset_vap(struct ieee80211vap *vap, return 0; } /* XXX? Full or NOLOSS? */ - return ath_reset(ifp, ATH_RESET_FULL); + return ath_reset(sc, ATH_RESET_FULL); } struct ath_buf * @@ -3220,24 +3143,12 @@ ath_getbuf(struct ath_softc *sc, ath_buf bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL); ATH_TXBUF_UNLOCK(sc); if (bf == NULL) { - struct ifnet *ifp = sc->sc_ifp; - DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); sc->sc_stats.ast_tx_qstop++; - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); } return bf; } -static void -ath_qflush(struct ifnet *ifp) -{ - - /* XXX TODO */ -} - /* * Transmit a single frame. * @@ -3245,10 +3156,9 @@ ath_qflush(struct ifnet *ifp) * fails, so don't free the node reference here. */ static int -ath_transmit(struct ifnet *ifp, struct mbuf *m) +ath_transmit(struct ieee80211com *ic, struct mbuf *m) { - struct ieee80211com *ic = ifp->if_l2com; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ieee80211_node *ni; struct mbuf *next; struct ath_buf *bf; @@ -3263,10 +3173,7 @@ ath_transmit(struct ifnet *ifp, struct m DPRINTF(sc, ATH_DEBUG_XMIT, "%s: sc_inreset_cnt > 0; bailing\n", __func__); ATH_PCU_UNLOCK(sc); - IF_LOCK(&ifp->if_snd); sc->sc_stats.ast_tx_qstop++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); return (ENOBUFS); /* XXX should be EINVAL or? */ } @@ -3306,8 +3213,6 @@ ath_transmit(struct ifnet *ifp, struct m if ((!(m->m_flags & M_EAPOL)) && (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { sc->sc_stats.ast_tx_nodeq_overflow++; - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3331,8 +3236,6 @@ ath_transmit(struct ifnet *ifp, struct m if ((!(m->m_flags & M_EAPOL)) && (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { sc->sc_stats.ast_tx_nobuf++; - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3360,11 +3263,6 @@ ath_transmit(struct ifnet *ifp, struct m * above. */ sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3386,8 +3284,13 @@ ath_transmit(struct ifnet *ifp, struct m DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + /* + * XXXGL: is mbuf valid after ath_txfrag_setup? If yes, + * we shouldn't free it but return back. + */ ath_freetx(m); + m = NULL; goto bad; } @@ -3429,12 +3332,6 @@ ath_transmit(struct ifnet *ifp, struct m } } - /* - * Bump the ifp output counter. - * - * XXX should use atomics? - */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); nextfrag: /* * Pass the frame to the h/w for transmission. @@ -3454,7 +3351,7 @@ nextfrag: next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { bad: - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); reclaim: bf->bf_m = NULL; bf->bf_node = NULL; @@ -3538,8 +3435,7 @@ ath_media_change(struct ifnet *ifp) static void ath_key_update_begin(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_block(sc->sc_tq); @@ -3548,8 +3444,7 @@ ath_key_update_begin(struct ieee80211vap static void ath_key_update_end(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; + struct ath_softc *sc = vap->iv_ic->ic_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_unblock(sc->sc_tq); @@ -3580,32 +3475,41 @@ ath_update_promisc(struct ieee80211com * static void ath_update_mcast_hw(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = &sc->sc_ic; u_int32_t mfilt[2]; /* calculate and install multicast filter */ - if ((ifp->if_flags & IFF_ALLMULTI) == 0) { + if (ic->ic_allmulti == 0) { + struct ieee80211vap *vap; + struct ifnet *ifp; struct ifmultiaddr *ifma; + /* * Merge multicast addresses to form the hardware filter. */ mfilt[0] = mfilt[1] = 0; - if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */ - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - caddr_t dl; - u_int32_t val; - u_int8_t pos; - - /* calculate XOR of eight 6bit values */ - dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); - val = LE_READ_4(dl + 0); - pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - val = LE_READ_4(dl + 3); - pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - pos &= 0x3f; - mfilt[pos / 32] |= (1 << (pos % 32)); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + caddr_t dl; + uint32_t val; + uint8_t pos; + + /* calculate XOR of eight 6bit values */ + dl = LLADDR((struct sockaddr_dl *) + ifma->ifma_addr); + val = LE_READ_4(dl + 0); + pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ + val; + val = LE_READ_4(dl + 3); + pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ + val; + pos &= 0x3f; + mfilt[pos / 32] |= (1 << (pos % 32)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; @@ -3638,7 +3542,7 @@ ath_update_mcast(struct ieee80211com *ic void ath_mode_init(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -3649,15 +3553,8 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); - DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_MODE, - "%s: ah=%p, ifp=%p, if_addr=%p\n", - __func__, - ah, - ifp, - (ifp == NULL) ? NULL : ifp->if_addr); - /* handle any link-level address change */ - ath_hal_setmac(ah, IF_LLADDR(ifp)); + ath_hal_setmac(ah, ic->ic_macaddr); /* calculate and install multicast filter */ ath_update_mcast_hw(sc); @@ -3669,7 +3566,7 @@ ath_mode_init(struct ath_softc *sc) void ath_setslottime(struct ath_softc *sc) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int usec; @@ -3753,12 +3650,11 @@ static void ath_reset_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; #if 0 device_printf(sc->sc_dev, "%s: resetting\n", __func__); #endif - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } /* @@ -3768,7 +3664,6 @@ static void ath_bstuck_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; uint32_t hangs = 0; if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) @@ -3786,7 +3681,7 @@ ath_bstuck_proc(void *arg, int pending) * This assumes that there's no simultaneous channel mode change * occuring. */ - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } static void @@ -4156,7 +4051,7 @@ static struct ieee80211_node * ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; struct ath_node *an; @@ -4183,7 +4078,7 @@ static void ath_node_cleanup(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4198,7 +4093,7 @@ static void ath_node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4210,7 +4105,7 @@ static void ath_node_getsignal(const struct ieee80211_node *ni, int8_t *rssi, int8_t *noise) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; *rssi = ic->ic_node_getrssi(ni); @@ -4348,8 +4243,7 @@ ath_txq_update(struct ath_softc *sc, int { #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_txq *txq = sc->sc_ac2q[ac]; struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; struct ath_hal *ah = sc->sc_ah; @@ -4422,7 +4316,7 @@ ath_txq_update(struct ath_softc *sc, int int ath_wme_update(struct ieee80211com *ic) { - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_softc; return !ath_txq_update(sc, WME_AC_BE) || !ath_txq_update(sc, WME_AC_BK) || @@ -4473,8 +4367,7 @@ ath_tx_update_stats(struct ath_softc *sc struct ath_buf *bf) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 7 12:13:17 2015 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 3DAA69B147B; Fri, 7 Aug 2015 12:13:17 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2183A38A; Fri, 7 Aug 2015 12:13:17 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77CDHsA023255; Fri, 7 Aug 2015 12:13:17 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77CDGFv023251; Fri, 7 Aug 2015 12:13:16 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201508071213.t77CDGFv023251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Fri, 7 Aug 2015 12:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286411 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 12:13:17 -0000 Author: jah Date: Fri Aug 7 12:13:15 2015 New Revision: 286411 URL: https://svnweb.freebsd.org/changeset/base/286411 Log: Create man page for pmap_quick_enter_page(9) and pmap_quick_remove_page(9) Reviewed by: kib, brueffer, wblock Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D3312 Added: head/share/man/man9/pmap_quick_enter_page.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/pmap.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Aug 7 11:43:14 2015 (r286410) +++ head/share/man/man9/Makefile Fri Aug 7 12:13:15 2015 (r286411) @@ -223,6 +223,7 @@ MAN= accept_filter.9 \ pmap_pinit.9 \ pmap_protect.9 \ pmap_qenter.9 \ + pmap_quick_enter_page.9 \ pmap_release.9 \ pmap_remove.9 \ pmap_resident_count.9 \ @@ -1265,6 +1266,7 @@ MLINKS+=pmap_is_modified.9 pmap_ts_refer MLINKS+=pmap_pinit.9 pmap_pinit0.9 \ pmap_pinit.9 pmap_pinit2.9 MLINKS+=pmap_qenter.9 pmap_qremove.9 +MLINKS+=pmap_quick_enter_page.9 pmap_quick_remove_page.9 MLINKS+=pmap_remove.9 pmap_remove_all.9 \ pmap_remove.9 pmap_remove_pages.9 MLINKS+=pmap_resident_count.9 pmap_wired_count.9 Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Fri Aug 7 11:43:14 2015 (r286410) +++ head/share/man/man9/pmap.9 Fri Aug 7 12:13:15 2015 (r286411) @@ -111,6 +111,8 @@ operation. .Xr pmap_protect 9 , .Xr pmap_qenter 9 , .Xr pmap_qremove 9 , +.Xr pmap_quick_enter_page 9 , +.Xr pmap_quick_remove_page 9 , .Xr pmap_release 9 , .Xr pmap_remove 9 , .Xr pmap_remove_all 9 , Added: head/share/man/man9/pmap_quick_enter_page.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/pmap_quick_enter_page.9 Fri Aug 7 12:13:15 2015 (r286411) @@ -0,0 +1,103 @@ +.\" +.\" Copyright (c) 2015 Jason A. Harmening +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 6, 2015 +.Dt PMAP_QUICK_ENTER_PAGE 9 +.Os +.Sh NAME +.Nm pmap_quick_enter_page , +.Nm pmap_quick_remove_page +.Nd manage fast, single-page kernel address space mappings +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/pmap.h +.Ft vm_offset_t +.Fn pmap_quick_enter_page "vm_page_t m" +.Ft void +.Fn pmap_quick_remove_page "vm_offset_t kva" +.Sh DESCRIPTION +The +.Fn pmap_quick_enter_page +function accepts a single page +.Fa m , +and enters this page into a preallocated address in kernel virtual +address (KVA) space. +This function is intended for temporary mappings that will only +be used for a very short period, for example a copy operation on +the page contents. +.Pp +The +.Fn pmap_quick_remove_page +function removes a mapping previously created by +.Fn pmap_quick_enter_page +at +.Fa kva , +making the KVA frame used by +.Fn pmap_quick_enter_page +available for reuse. +.Pp +On many architectures, +.Fn pmap_quick_enter_page +uses a per-CPU pageframe. +In those cases, it must disable preemption on the local CPU. +The corresponding call to +.Fn pmap_quick_remove_page +then re-enables preemption. +It is therefore not safe for machine-independent code to sleep +or perform locking operations while holding these mappings. +Current implementations only guarantee the availability of a single +page for the calling thread, so calls to +.Fn pmap_quick_enter_page +must not be nested. +.Pp +.Fn pmap_quick_enter_page +and +.Fn pmap_quick_remove_page +do not sleep, and +.Fn pmap_quick_enter_page +always returns a valid address. +It is safe to use these functions under all types of locks except spin mutexes. +It is also safe to use them in all thread contexts except primary interrupt +context. +.Pp +The page +.Em must +not be swapped or otherwise reused while the mapping is active. +It must be either wired or held, or it must belong to an unmanaged +region such as I/O device memory. +.Sh RETURN VALUES +The +.Fn pmap_quick_enter_page +function returns the kernel virtual address +that is mapped to the page +.Fa m . +.Sh SEE ALSO +.Xr pmap 9 +.Sh AUTHORS +This manual page was written by +.An Jason A Harmening Aq Mt jah@FreeBSD.org . From owner-svn-src-head@freebsd.org Fri Aug 7 12:34:21 2015 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 433089B1A1D; Fri, 7 Aug 2015 12:34:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2B9E8F03; Fri, 7 Aug 2015 12:34:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77CYLRO033695; Fri, 7 Aug 2015 12:34:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77CYL26033694; Fri, 7 Aug 2015 12:34:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508071234.t77CYL26033694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Aug 2015 12:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286413 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 12:34:21 -0000 Author: glebius Date: Fri Aug 7 12:34:20 2015 New Revision: 286413 URL: https://svnweb.freebsd.org/changeset/base/286413 Log: Fix !MWL_DEBUG build. Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Fri Aug 7 12:24:25 2015 (r286412) +++ head/sys/dev/mwl/if_mwl.c Fri Aug 7 12:34:20 2015 (r286413) @@ -245,10 +245,10 @@ enum { static void mwl_printrxbuf(const struct mwl_rxbuf *bf, u_int ix); static void mwl_printtxbuf(const struct mwl_txbuf *bf, u_int qnum, u_int ix); #else -#define IFF_DUMPPKTS_RECV(sc, wh) do {} while (0) -#define IFF_DUMPPKTS_XMIT(sc) do {} while (0) -#define DPRINTF(sc, m, fmt, ...) do {} while (0) -#define KEYPRINTF(sc, k, mac) do {} while (0) +#define IFF_DUMPPKTS_RECV(sc, wh) 0 +#define IFF_DUMPPKTS_XMIT(sc) 0 +#define DPRINTF(sc, m, fmt, ...) do { (void )sc; } while (0) +#define KEYPRINTF(sc, k, mac) do { (void )sc; } while (0) #endif static MALLOC_DEFINE(M_MWLDEV, "mwldev", "mwl driver dma buffers"); From owner-svn-src-head@freebsd.org Fri Aug 7 14:12:52 2015 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 6FD819B5292; Fri, 7 Aug 2015 14:12:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 60E1D1FA5; Fri, 7 Aug 2015 14:12:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77ECqgT078375; Fri, 7 Aug 2015 14:12:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77ECpFN078373; Fri, 7 Aug 2015 14:12:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508071412.t77ECpFN078373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Aug 2015 14:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286414 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 14:12:52 -0000 Author: mav Date: Fri Aug 7 14:12:51 2015 New Revision: 286414 URL: https://svnweb.freebsd.org/changeset/base/286414 Log: Add more ifdefs to fix build with GCC after r286406. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Aug 7 12:34:20 2015 (r286413) +++ head/sys/cam/ctl/ctl.c Fri Aug 7 14:12:51 2015 (r286414) @@ -374,9 +374,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, debu */ #define SCSI_EVPD_NUM_SUPPORTED_PAGES 10 +#ifdef notyet static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); +#endif static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); @@ -444,7 +446,9 @@ static int ctl_scsiio_lun_check(struct c const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio); //static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); +#ifdef notyet static void ctl_failover(void); +#endif static void ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx, ctl_ua_type ua_type); static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc, @@ -483,7 +487,9 @@ static void ctl_work_thread(void *arg); static void ctl_enqueue_incoming(union ctl_io *io); static void ctl_enqueue_rtr(union ctl_io *io); static void ctl_enqueue_done(union ctl_io *io); +#ifdef notyet static void ctl_enqueue_isc(union ctl_io *io); +#endif static const struct ctl_cmd_entry * ctl_get_cmd_entry(struct ctl_scsiio *ctsio, int *sa); static const struct ctl_cmd_entry * @@ -528,6 +534,7 @@ static struct ctl_frontend ioctl_fronten .name = "ioctl", }; +#ifdef notyet static void ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, union ctl_ha_msg *msg_info) @@ -962,6 +969,7 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->scsiio.sense_len = src->scsi.sense_len; dest->io_hdr.status = src->hdr.status; } +#endif static void ctl_est_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) @@ -11369,6 +11377,7 @@ ctl_failover_io(union ctl_io *io, int ha ctl_done(io); } +#ifdef notyet static void ctl_failover(void) { @@ -11609,6 +11618,7 @@ ctl_failover(void) ctl_pause_rtr = 0; mtx_unlock(&softc->ctl_lock); } +#endif static void ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx, @@ -14252,6 +14262,7 @@ ctl_enqueue_done(union ctl_io *io) wakeup(thr); } +#ifdef notyet static void ctl_enqueue_isc(union ctl_io *io) { @@ -14273,7 +14284,6 @@ ctl_init_isc_msg(void) printf("CTL: Still calling this thing\n"); } -#ifdef notyet /* * Init component * Initializes component into configuration defined by bootMode Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Fri Aug 7 12:34:20 2015 (r286413) +++ head/sys/cam/ctl/ctl.h Fri Aug 7 14:12:51 2015 (r286414) @@ -191,7 +191,9 @@ void ctl_data_submit_done(union ctl_io * void ctl_config_read_done(union ctl_io *io); void ctl_config_write_done(union ctl_io *io); void ctl_portDB_changed(int portnum); +#ifdef notyet void ctl_init_isc_msg(void); +#endif /* * KPI to manipulate LUN/port options From owner-svn-src-head@freebsd.org Fri Aug 7 14:38:27 2015 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 D3C019B5A00; Fri, 7 Aug 2015 14:38:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C436A100; Fri, 7 Aug 2015 14:38:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77EcRFd086688; Fri, 7 Aug 2015 14:38:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77EcRN2086686; Fri, 7 Aug 2015 14:38:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508071438.t77EcRN2086686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Aug 2015 14:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286415 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 14:38:28 -0000 Author: mav Date: Fri Aug 7 14:38:26 2015 New Revision: 286415 URL: https://svnweb.freebsd.org/changeset/base/286415 Log: Add unmapped I/O support to ata(4) driver. Main problem there was PIO mode support, that required KVA mapping. Handle that case using recently added pmap_quick_enter_page(9) KPI, mapping data pages to KVA one at a time. Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-lowlevel.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Fri Aug 7 14:12:51 2015 (r286414) +++ head/sys/dev/ata/ata-all.c Fri Aug 7 14:38:26 2015 (r286415) @@ -1074,7 +1074,7 @@ ataaction(struct cam_sim *sim, union ccb cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = PI_SDTR_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; if (ch->flags & ATA_NO_SLAVE) cpi->max_target = 0; Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Fri Aug 7 14:12:51 2015 (r286414) +++ head/sys/dev/ata/ata-lowlevel.c Fri Aug 7 14:38:26 2015 (r286415) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,6 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +#include +#include + /* prototypes */ static int ata_generic_status(device_t dev); static int ata_wait(struct ata_channel *ch, int unit, u_int8_t); @@ -811,86 +818,176 @@ ata_tf_write(struct ata_request *request static void ata_pio_read(struct ata_request *request, int length) { - struct ata_channel *ch = device_get_softc(request->parent); - uint8_t *addr; - int size = min(request->transfersize, length); - int resid; - uint8_t buf[2] __aligned(sizeof(int16_t)); -#ifndef __NO_STRICT_ALIGNMENT - int i; -#endif + struct ata_channel *ch = device_get_softc(request->parent); + struct bio *bio; + uint8_t *addr; + vm_offset_t page; + int todo, done, off, moff, resid, size, i; + uint8_t buf[2] __aligned(2); + + todo = min(request->transfersize, length); + page = done = resid = 0; + while (done < todo) { + size = todo - done; + + /* Prepare data address and limit size (if not sequential). */ + off = request->donecount + done; + if ((request->flags & ATA_R_DATA_IN_CCB) == 0 || + (request->ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) { + addr = (uint8_t *)request->data + off; + } else if ((request->ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO) { + bio = (struct bio *)request->data; + if ((bio->bio_flags & BIO_UNMAPPED) == 0) { + addr = (uint8_t *)bio->bio_data + off; + } else { + moff = bio->bio_ma_offset + off; + page = pmap_quick_enter_page( + bio->bio_ma[moff / PAGE_SIZE]); + moff %= PAGE_SIZE; + size = min(size, PAGE_SIZE - moff); + addr = (void *)(page + moff); + } + } else + panic("ata_pio_read: Unsupported CAM data type %x\n", + (request->ccb->ccb_h.flags & CAM_DATA_MASK)); + + /* We may have extra byte already red but not stored. */ + if (resid) { + addr[0] = buf[1]; + addr++; + done++; + size--; + } - addr = (uint8_t *)request->data + request->donecount; - if (__predict_false(ch->flags & ATA_USE_16BIT || - (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) { + /* Process main part of data. */ + resid = size % 2; + if (__predict_false((ch->flags & ATA_USE_16BIT) || + (size % 4) != 0 || ((uintptr_t)addr % 4) != 0)) { #ifndef __NO_STRICT_ALIGNMENT - if (__predict_false((uintptr_t)addr % sizeof(int16_t))) { - for (i = 0, resid = size & ~1; resid > 0; resid -= - sizeof(int16_t)) { - *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA); - addr[i++] = buf[0]; - addr[i++] = buf[1]; - } - } else + if (__predict_false((uintptr_t)addr % 2)) { + for (i = 0; i + 1 < size; i += 2) { + *(uint16_t *)&buf = + ATA_IDX_INW_STRM(ch, ATA_DATA); + addr[i] = buf[0]; + addr[i + 1] = buf[1]; + } + } else #endif - ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / - sizeof(int16_t)); - if (size & 1) { - *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA); - (addr + (size & ~1))[0] = buf[0]; - } - } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); - - if (request->transfersize < length) { - device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", - ata_cmd2str(request), length, request->transfersize); - for (resid = request->transfersize + (size & 1); resid < length; - resid += sizeof(int16_t)) - ATA_IDX_INW(ch, ATA_DATA); - } + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, + size / 2); + + /* If we have extra byte of data, leave it for later. */ + if (resid) { + *(uint16_t *)&buf = + ATA_IDX_INW_STRM(ch, ATA_DATA); + addr[size - 1] = buf[0]; + } + } else + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / 4); + + if (page) { + pmap_quick_remove_page(page); + page = 0; + } + done += size; + } + + if (length > done) { + device_printf(request->parent, + "WARNING - %s read data overrun %d > %d\n", + ata_cmd2str(request), length, done); + for (i = done + resid; i < length; i += 2) + ATA_IDX_INW(ch, ATA_DATA); + } } static void ata_pio_write(struct ata_request *request, int length) { - struct ata_channel *ch = device_get_softc(request->parent); - uint8_t *addr; - int size = min(request->transfersize, length); - int resid; - uint8_t buf[2] __aligned(sizeof(int16_t)); + struct ata_channel *ch = device_get_softc(request->parent); + struct bio *bio; + uint8_t *addr; + vm_offset_t page; + int todo, done, off, moff, resid, size, i; + uint8_t buf[2] __aligned(2); + + todo = min(request->transfersize, length); + page = done = resid = 0; + while (done < todo) { + size = todo - done; + + /* Prepare data address and limit size (if not sequential). */ + off = request->donecount + done; + if ((request->flags & ATA_R_DATA_IN_CCB) == 0 || + (request->ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) { + addr = (uint8_t *)request->data + off; + } else if ((request->ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO) { + bio = (struct bio *)request->data; + if ((bio->bio_flags & BIO_UNMAPPED) == 0) { + addr = (uint8_t *)bio->bio_data + off; + } else { + moff = bio->bio_ma_offset + off; + page = pmap_quick_enter_page( + bio->bio_ma[moff / PAGE_SIZE]); + moff %= PAGE_SIZE; + size = min(size, PAGE_SIZE - moff); + addr = (void *)(page + moff); + } + } else + panic("ata_pio_write: Unsupported CAM data type %x\n", + (request->ccb->ccb_h.flags & CAM_DATA_MASK)); + + /* We may have extra byte to be written first. */ + if (resid) { + buf[1] = addr[0]; + ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf); + addr++; + done++; + size--; + } + + /* Process main part of data. */ + resid = size % 2; + if (__predict_false((ch->flags & ATA_USE_16BIT) || + (size % 4) != 0 || ((uintptr_t)addr % 4) != 0)) { #ifndef __NO_STRICT_ALIGNMENT - int i; + if (__predict_false((uintptr_t)addr % 2)) { + for (i = 0; i + 1 < size; i += 2) { + buf[0] = addr[i]; + buf[1] = addr[i + 1]; + ATA_IDX_OUTW_STRM(ch, ATA_DATA, + *(uint16_t *)&buf); + } + } else #endif + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, + size / 2); - size = min(request->transfersize, length); - addr = (uint8_t *)request->data + request->donecount; - if (__predict_false(ch->flags & ATA_USE_16BIT || - (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) { -#ifndef __NO_STRICT_ALIGNMENT - if (__predict_false((uintptr_t)addr % sizeof(int16_t))) { - for (i = 0, resid = size & ~1; resid > 0; resid -= - sizeof(int16_t)) { - buf[0] = addr[i++]; - buf[1] = addr[i++]; + /* If we have extra byte of data, save it for later. */ + if (resid) + buf[0] = addr[size - 1]; + } else + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, + (void*)addr, size / sizeof(int32_t)); + + if (page) { + pmap_quick_remove_page(page); + page = 0; + } + done += size; + } + + /* We may have extra byte of data to be written. Pad it with zero. */ + if (resid) { + buf[1] = 0; ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf); - } - } else -#endif - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / - sizeof(int16_t)); - if (size & 1) { - buf[0] = (addr + (size & ~1))[0]; - ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf); - } - } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); - - if (request->transfersize < length) { - device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", - ata_cmd2str(request), length, request->transfersize); - for (resid = request->transfersize + (size & 1); resid < length; - resid += sizeof(int16_t)) - ATA_IDX_OUTW(ch, ATA_DATA, 0); - } + } + + if (length > done) { + device_printf(request->parent, + "WARNING - %s write data underrun %d > %d\n", + ata_cmd2str(request), length, done); + for (i = done + resid; i < length; i += 2) + ATA_IDX_OUTW(ch, ATA_DATA, 0); + } } From owner-svn-src-head@freebsd.org Fri Aug 7 16:23:17 2015 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 2B1589B442A; Fri, 7 Aug 2015 16:23:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 165DECB7; Fri, 7 Aug 2015 16:23:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77GNGGg030925; Fri, 7 Aug 2015 16:23:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77GNGbJ030924; Fri, 7 Aug 2015 16:23:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508071623.t77GNGbJ030924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Aug 2015 16:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286416 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 16:23:17 -0000 Author: glebius Date: Fri Aug 7 16:23:16 2015 New Revision: 286416 URL: https://svnweb.freebsd.org/changeset/base/286416 Log: Fix mtx_assert() argument. Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Aug 7 14:38:26 2015 (r286415) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Aug 7 16:23:16 2015 (r286416) @@ -2581,7 +2581,7 @@ zyd_start(struct zyd_softc *sc) struct ieee80211_node *ni; struct mbuf *m; - ZYD_LOCK_ASSERT(sc, MA_LOCKED); + ZYD_LOCK_ASSERT(sc, MA_OWNED); while (sc->tx_nfree > 0 && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; From owner-svn-src-head@freebsd.org Fri Aug 7 17:22:38 2015 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 5B43B9B5164; Fri, 7 Aug 2015 17:22:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 48BCDC30; Fri, 7 Aug 2015 17:22:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77HMc6L055143; Fri, 7 Aug 2015 17:22:38 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77HMcHY055142; Fri, 7 Aug 2015 17:22:38 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508071722.t77HMcHY055142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Aug 2015 17:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286417 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 17:22:38 -0000 Author: marcel Date: Fri Aug 7 17:22:37 2015 New Revision: 286417 URL: https://svnweb.freebsd.org/changeset/base/286417 Log: o Fix a typo. o Describe the file formats mkimg can create. Modified: head/usr.bin/mkimg/mkimg.1 Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Fri Aug 7 16:23:16 2015 (r286416) +++ head/usr.bin/mkimg/mkimg.1 Fri Aug 7 17:22:37 2015 (r286417) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2015 +.Dd August 7, 2015 .Dt MKIMG 1 .Os .Sh NAME @@ -141,7 +141,7 @@ utility will create images that are iden .Pp A set of long options exist to query about the .Nm -utilty itself. +utility itself. Options in this set should be given by themselves because the .Nm utility exits immediately after providing the requested information. @@ -165,6 +165,85 @@ run the .Nm utility without any arguments. This will print a usage message with all the necessary details. +.Sh DISK FORMATS +The +.Nm +utility supports a number of output file formats. +A short description of these is given below. +.Ss QCOW and QCOW2 +QCOW stands for "QEMU Copy On Write". +It's a sparse file format akin to VHD and VMDK and QCOW represents the +first version. +QCOW2 represents version 2 of the file format. +Version 2 is not backward compatible with version 1 and adds support for +snapshots among other things. +The QCOW file formats are natively supported by QEMU and Xen. +To write QCOW, specify +.Fl f Ar qcow +on the command line. +To write version 2 QCOW, specify +.Fl f Ar qcow2 +on the command line. +The preferred file extension is ".qcow" iand ".qcow2" for QCOW and QCOW2 +(resp.), but ".qcow" is sometimes used for version 2 files as well. +.Ss RAW file format +This file format is a sector by sector representation of an actual disk. +There is no extra information that describes or relates to the format +itself. The size of the file is the size of the (virtual) disk. +This file format is suitable for being copyied onto a disk with utilities +like +.Nm dd . +To write a raw disk file, either omit the +.Fl f +option, or specify +.Fl f Ar raw +on the command line. +The preferred file extension is one of ".img" or ".raw", but there's no +real convention for it. +.Ss Dynamic VHD and Fixed VHD +Microsoft's "Virtual Hard Disk" file formats. +The dynamic format is a sparse format akin to QCOW and VMDK. +The fixed format is effectively a raw format with a footer appended to the +file and as such it's often indistinguishable from the raw format. +The fixed file format has been added to support Microsoft's Azure platform +and due to inconsistencies in interpretation of the footer is not compatible +with utilities like +.Nm qemu +when it is specifically instructed to interpreted the file as a VHD file. +By default +.Nm qemu +will treat the file as a raw disk file, which mostly works fine. +To have +.Nm +create a dynamic VHD file, specify +.Fl f Ar vhd +on the command line. +To create a fixed VHD file for use by Azure, specify +.Fl f Ar vhdf +on the command line. +The preferred file extension is ".vhd". +.Ss VMDK +VMware's "Virtual Machine Disk" file format. +It's a sparse file format akin to QCOW and VHD and supported by many +virtualization solutions. +To create a VMDK file, specify +.Fl f Ar vmdk +on the command line. +The preferred file extension is ".vmdk". +.Pp +Not all virtualization solutions support all file formats, but often those +virtualization environments have utilities to convert from one format to +another. +Note however that conversion may require that the virtual disk size is +changed to match the constraints of the output format and this may invalidate +the contents of the disk image. +For example, the GUID Partition Table (GPT) scheme has a header in the last +sector on the disk. +When changing the disk size, the GPT must be changed so that the last header +is moved accordingly. +This is typically not part of the conversion process. +If possible, use an output format specifically for the environment in which +the file is intended to be used. .Sh ENVIRONMENT .Bl -tag -width "TMPDIR" -compact .It Ev TMPDIR @@ -235,6 +314,7 @@ utility supports assigning labels to the In the following example the file system partition is labeled as 'backup': .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img .Sh SEE ALSO +.Xr dd 1 , .Xr gpart 8 , .Xr makefs 8 , .Xr mdconfig 8 , From owner-svn-src-head@freebsd.org Fri Aug 7 18:30:12 2015 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 8B3869B615B; Fri, 7 Aug 2015 18:30:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7C6378FE; Fri, 7 Aug 2015 18:30:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77IUCdF080132; Fri, 7 Aug 2015 18:30:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77IUCpi080131; Fri, 7 Aug 2015 18:30:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508071830.t77IUCpi080131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Aug 2015 18:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286418 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 18:30:12 -0000 Author: markj Date: Fri Aug 7 18:30:11 2015 New Revision: 286418 URL: https://svnweb.freebsd.org/changeset/base/286418 Log: ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network order, but IN_ZERONET and IN_LOOPBACK expect it in host order. Submitted by: Tao Liu MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/include/linux/in.h Modified: head/sys/ofed/include/linux/in.h ============================================================================== --- head/sys/ofed/include/linux/in.h Fri Aug 7 17:22:37 2015 (r286417) +++ head/sys/ofed/include/linux/in.h Fri Aug 7 18:30:11 2015 (r286418) @@ -37,7 +37,7 @@ #include #include -#define ipv4_is_zeronet IN_ZERONET -#define ipv4_is_loopback IN_LOOPBACK +#define ipv4_is_zeronet(be) IN_ZERONET(ntohl(be)) +#define ipv4_is_loopback(be) IN_LOOPBACK(ntohl(be)) #endif /* _LINUX_IN_H_ */ From owner-svn-src-head@freebsd.org Fri Aug 7 18:40:45 2015 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 66B799B6315; Fri, 7 Aug 2015 18:40:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 57563DEF; Fri, 7 Aug 2015 18:40:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77IejUH085256; Fri, 7 Aug 2015 18:40:45 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77IejwQ085255; Fri, 7 Aug 2015 18:40:45 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508071840.t77IejwQ085255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Aug 2015 18:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286419 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 18:40:45 -0000 Author: marcel Date: Fri Aug 7 18:40:44 2015 New Revision: 286419 URL: https://svnweb.freebsd.org/changeset/base/286419 Log: Fix typo introduced in previous commit. Pointed out by: Nikolai Lifanov Modified: head/usr.bin/mkimg/mkimg.1 Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Fri Aug 7 18:30:11 2015 (r286418) +++ head/usr.bin/mkimg/mkimg.1 Fri Aug 7 18:40:44 2015 (r286419) @@ -184,7 +184,7 @@ on the command line. To write version 2 QCOW, specify .Fl f Ar qcow2 on the command line. -The preferred file extension is ".qcow" iand ".qcow2" for QCOW and QCOW2 +The preferred file extension is ".qcow" and ".qcow2" for QCOW and QCOW2 (resp.), but ".qcow" is sometimes used for version 2 files as well. .Ss RAW file format This file format is a sector by sector representation of an actual disk. From owner-svn-src-head@freebsd.org Fri Aug 7 19:56:26 2015 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 837D99B6140; Fri, 7 Aug 2015 19:56:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6A31B844; Fri, 7 Aug 2015 19:56:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77JuQeZ017072; Fri, 7 Aug 2015 19:56:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77JuMla017058; Fri, 7 Aug 2015 19:56:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508071956.t77JuMla017058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Aug 2015 19:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286420 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 19:56:26 -0000 Author: markj Date: Fri Aug 7 19:56:22 2015 New Revision: 286420 URL: https://svnweb.freebsd.org/changeset/base/286420 Log: - Use an explicit "depends_on module kernel" guard in DTrace libraries that reference types defined in the kernel. Otherwise dtrace(1) expects to find CTF definitions for all referenced types, which is not very reasonable when it is being used in a build environment. This was previously worked around by adding "-x nolibs" to dtrace -h or -G invocations, but as of r283025, dtrace(1) actually handles dependencies properly, so this is no longer necessary. - Remove "pragma ident" directives from DTrace libraries, as they're being phased out upstream as well. Submitted by: Krister Johansen [1] MFC after: 1 week Sponsored by: EMC / Isilon Storage Division > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. M libdtrace/io.d M libdtrace/ip.d M libdtrace/nfs.d M libdtrace/nfssrv.d M libdtrace/psinfo.d M libdtrace/regs_x86.d M libdtrace/sched.d M libdtrace/siftr.d M libdtrace/tcp.d M libdtrace/udp.d Modified: head/cddl/lib/libdtrace/io.d head/cddl/lib/libdtrace/ip.d head/cddl/lib/libdtrace/nfs.d head/cddl/lib/libdtrace/nfssrv.d head/cddl/lib/libdtrace/psinfo.d head/cddl/lib/libdtrace/regs_x86.d head/cddl/lib/libdtrace/sched.d head/cddl/lib/libdtrace/siftr.d head/cddl/lib/libdtrace/tcp.d head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/io.d ============================================================================== --- head/cddl/lib/libdtrace/io.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/io.d Fri Aug 7 19:56:22 2015 (r286420) @@ -25,8 +25,7 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +#pragma D depends_on module kernel #pragma D depends_on provider io typedef struct devinfo { Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/ip.d Fri Aug 7 19:56:22 2015 (r286420) @@ -25,6 +25,7 @@ * Copyright (c) 2013 Mark Johnston */ +#pragma D depends_on module kernel #pragma D depends_on provider ip /* Modified: head/cddl/lib/libdtrace/nfs.d ============================================================================== --- head/cddl/lib/libdtrace/nfs.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/nfs.d Fri Aug 7 19:56:22 2015 (r286420) @@ -30,6 +30,7 @@ #pragma D depends_on library ip.d #pragma D depends_on library net.d +#pragma D depends_on module kernel #pragma D depends_on module nfs typedef struct nfsv4opinfo { Modified: head/cddl/lib/libdtrace/nfssrv.d ============================================================================== --- head/cddl/lib/libdtrace/nfssrv.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/nfssrv.d Fri Aug 7 19:56:22 2015 (r286420) @@ -30,7 +30,8 @@ #pragma D depends_on library ip.d #pragma D depends_on library net.d -#pragma D depends_on module nfs.d +#pragma D depends_on library nfs.d +#pragma D depends_on module kernel #pragma D depends_on module nfssrv #pragma D binding "1.5" translator Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/psinfo.d Fri Aug 7 19:56:22 2015 (r286420) @@ -28,6 +28,8 @@ * Use is subject to license terms. */ +#pragma D depends_on module kernel + typedef struct psinfo { int pr_nlwp; /* number of threads */ pid_t pr_pid; /* unique process id */ Modified: head/cddl/lib/libdtrace/regs_x86.d ============================================================================== --- head/cddl/lib/libdtrace/regs_x86.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/regs_x86.d Fri Aug 7 19:56:22 2015 (r286420) @@ -28,8 +28,6 @@ * Use is subject to license terms. */ -#pragma ident "@(#)regs.d.in 1.1 04/09/28 SMI" - inline int R_GS = 0; #pragma D binding "1.0" R_GS inline int R_FS = 1; Modified: head/cddl/lib/libdtrace/sched.d ============================================================================== --- head/cddl/lib/libdtrace/sched.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/sched.d Fri Aug 7 19:56:22 2015 (r286420) @@ -27,9 +27,7 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - -#pragma D depends_on module unix +#pragma D depends_on module kernel #pragma D depends_on provider sched struct cpuinfo { Modified: head/cddl/lib/libdtrace/siftr.d ============================================================================== --- head/cddl/lib/libdtrace/siftr.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/siftr.d Fri Aug 7 19:56:22 2015 (r286420) @@ -21,6 +21,7 @@ * $FreeBSD$ */ +#pragma D depends_on module kernel #pragma D depends_on module siftr #pragma D depends_on provider tcp Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/tcp.d Fri Aug 7 19:56:22 2015 (r286420) @@ -26,6 +26,7 @@ */ #pragma D depends_on library ip.d +#pragma D depends_on module kernel #pragma D depends_on provider tcp /* Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Fri Aug 7 18:40:44 2015 (r286419) +++ head/cddl/lib/libdtrace/udp.d Fri Aug 7 19:56:22 2015 (r286420) @@ -26,6 +26,7 @@ */ #pragma D depends_on library ip.d +#pragma D depends_on module kernel #pragma D depends_on provider udp /* From owner-svn-src-head@freebsd.org Fri Aug 7 21:14:20 2015 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 DD4989B6ECA; Fri, 7 Aug 2015 21:14:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C6985B7; Fri, 7 Aug 2015 21:14:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77LEKb9049325; Fri, 7 Aug 2015 21:14:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77LEKnd049324; Fri, 7 Aug 2015 21:14:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508072114.t77LEKnd049324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 7 Aug 2015 21:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286423 - 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.20 Precedence: list List-Id: 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, 07 Aug 2015 21:14:21 -0000 Author: ian Date: Fri Aug 7 21:14:19 2015 New Revision: 286423 URL: https://svnweb.freebsd.org/changeset/base/286423 Log: RFC 2783 requires a status of ETIMEDOUT, not EWOULDBLOCK, on a timeout. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Aug 7 20:18:55 2015 (r286422) +++ head/sys/kern/kern_tc.c Fri Aug 7 21:14:19 2015 (r286423) @@ -1541,8 +1541,12 @@ pps_fetch(struct pps_fetch_args *fapi, s } else { err = tsleep(pps, PCATCH, "ppsfch", timo); } - if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { - continue; + if (err == EWOULDBLOCK) { + if (fapi->timeout.tv_sec == -1) { + continue; + } else { + return (ETIMEDOUT); + } } else if (err != 0) { return (err); } From owner-svn-src-head@freebsd.org Fri Aug 7 22:34:15 2015 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 B1C2D9B6B01; Fri, 7 Aug 2015 22:34:15 +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 5A1427D6; Fri, 7 Aug 2015 22:34:14 +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 BCBC225D3AD1; Fri, 7 Aug 2015 22:34:05 +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 A523EC76FE6; Fri, 7 Aug 2015 22:34:04 +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 38z12gWUW1x4; Fri, 7 Aug 2015 22:34:02 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:c4cf:f1eb:65ee:86] (unknown [IPv6:fde9:577b:c1a9:4410:c4cf:f1eb:65ee:86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 36BA7C76FD9; Fri, 7 Aug 2015 22:34:00 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286410 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral ... From: "Bjoern A. Zeeb" In-Reply-To: <201508071143.t77BhFvr007283@repo.freebsd.org> Date: Fri, 7 Aug 2015 22:33:55 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <72035147-7F25-4E63-B60B-A19A2FB58117@FreeBSD.org> References: <201508071143.t77BhFvr007283@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 07 Aug 2015 22:34:15 -0000 > On 07 Aug 2015, at 11:43 , Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Fri Aug 7 11:43:14 2015 > New Revision: 286410 > URL: https://svnweb.freebsd.org/changeset/base/286410 At least ath is still not compiling. Just to give you a short selection = of what I am seeing. I would have expected a change like this to pass = universe before commit .. sparc64.LINT /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath.c: In = function 'ath_intr': /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath.c:2106: = error: 'ifp' undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath.c:2106: = error: (Each undeclared identifier is reported only once /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath.c:2106: = error: for each function it appears in.) bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules/ath /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath_tdma.c: In = function 'ath_tdma_config': = /scratch/tmp/bz/head.svn/sys/modules/ath/../../dev/ath/if_ath_tdma.c:253: = error: =E2=80=98struct ath_softc' has no member named 'sc_ifp' mips.AP135 /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c: In function 'ath_resume': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:1901: error: 'ifp' = undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:1901: error: (Each = undeclared identifier is reported only once /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:1901: error: for each = function it appears in.) /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c: In function 'ath_intr': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:2106: error: 'ifp' = undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c: In function 'ath_init': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:2428: error: 'ifp' = undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c: In function = 'ath_tx_processq': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath.c:4571: error: 'struct = ath_softc' has no member named 'sc_ifp' --- if_ath.o --- *** [if_ath.o] Error code 1 bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP135 /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c: In function = 'ath_tx_normal_setup': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:1789: error: expected = ')' before 'ieee80211_dump_pkt' /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:1838: error: expected = expression before '}' token cc1: warnings being treated as errors /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:1546: warning: unused = variable 'ah' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c: In function = 'ath_tx_raw_start': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2207: error: expected = ')' before 'ieee80211_dump_pkt' /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2328: error: expected = expression before '}' token /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2090: warning: unused = variable 'queue_to_head' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2085: warning: unused = variable 'ds' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2077: warning: unused = variable 'vap' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2076: warning: unused = variable 'ah' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:2075: warning: unused = variable 'ic' [-Wunused-variable] /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c: In function = 'ath_tx_tid_drain_print': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:3804: error: expected = ')' before 'ieee80211_dump_pkt' /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tx.c:3807: error: expected = expression before '}' token --- if_ath_tx.o --- *** [if_ath_tx.o] Error code 1 bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP135 /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tdma.c: In function = 'ath_tdma_config': /scratch/tmp/bz/head.svn/sys/dev/ath/if_ath_tdma.c:253: error: 'struct = ath_softc' has no member named 'sc_ifp' --- if_ath_tdma.o --- From owner-svn-src-head@freebsd.org Fri Aug 7 23:31:32 2015 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 A0E7E9B644C; Fri, 7 Aug 2015 23:31:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8B4B0126; Fri, 7 Aug 2015 23:31:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t77NVWhP003873; Fri, 7 Aug 2015 23:31:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t77NVWaK003872; Fri, 7 Aug 2015 23:31:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508072331.t77NVWaK003872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 7 Aug 2015 23:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286429 - 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.20 Precedence: list List-Id: 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, 07 Aug 2015 23:31:32 -0000 Author: ian Date: Fri Aug 7 23:31:31 2015 New Revision: 286429 URL: https://svnweb.freebsd.org/changeset/base/286429 Log: Only process the PPS event types currently enabled in pps_params.mode. This makes the PPS API behave correctly, but isn't ideal -- we still end up capturing PPS data for non-enabled edges, we just don't process the data into an event that becomes visible outside of kern_tc. That's because the event type isn't passed to pps_capture(), so it can't do the filtering. Any solution for capture filtering is going to require touching every driver. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Aug 7 23:03:17 2015 (r286428) +++ head/sys/kern/kern_tc.c Fri Aug 7 23:31:31 2015 (r286429) @@ -1703,6 +1703,9 @@ pps_event(struct pps_state *pps, int eve #endif KASSERT(pps != NULL, ("NULL pps pointer in pps_event")); + /* Nothing to do if not currently set to capture this event type. */ + if ((event & pps->ppsparam.mode) == 0) + return; /* If the timecounter was wound up underneath us, bail out. */ if (pps->capgen == 0 || pps->capgen != atomic_load_acq_int(&pps->capth->th_generation)) From owner-svn-src-head@freebsd.org Fri Aug 7 23:49:19 2015 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 400D49B66B0; Fri, 7 Aug 2015 23:49:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (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 02F72C37; Fri, 7 Aug 2015 23:49:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbpg9 with SMTP id pg9so40872017igb.0; Fri, 07 Aug 2015 16:49: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:date:message-id:subject:from:to :cc:content-type; bh=vcCUHKLQHwUULab/5aFAy/6fVbPDCy1mHKHjmPn5eBg=; b=IYSGf61LfhW0l9rqMh5fF91XWFGg7ccN3t1q0VJzVbOufFJWWtX71bKSU2FeDNfItb V4IjGpjewDy1EkpbeZtfTj39l5WkItqkRmqUBfRXQazrzBLvSkT5sywa+73vqPGbnUVN tCY8LVuhQsh6F0wGEP7pFz2xw5NMTIvTNlL13oq75chKaj/jegRTiNY8IG1gew9iZieN aECqKKSiKxdVQ24+KeAWAUdT+sYosvgW2QB0Hj61sI0t/a2nx4UBrQVCI6WsY+Sk3tcg zrdEeT6LFaJUxUsz+jEjh9eh/LlRM8WgN2Uylj2gHLU2i8tAnQ5j0X86OLKXTCKLMgvU Ku1Q== MIME-Version: 1.0 X-Received: by 10.50.61.144 with SMTP id p16mr653028igr.22.1438991358340; Fri, 07 Aug 2015 16:49:18 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Fri, 7 Aug 2015 16:49:18 -0700 (PDT) In-Reply-To: <72035147-7F25-4E63-B60B-A19A2FB58117@FreeBSD.org> References: <201508071143.t77BhFvr007283@repo.freebsd.org> <72035147-7F25-4E63-B60B-A19A2FB58117@FreeBSD.org> Date: Fri, 7 Aug 2015 16:49:18 -0700 Message-ID: Subject: Re: svn commit: r286410 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral ... From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: Gleb Smirnoff , "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.20 Precedence: list List-Id: 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, 07 Aug 2015 23:49:19 -0000 Hi, Since I'm on holidays, and I really don't have time to tidy up after this commit: * everyone can commit to the wireless stuff to get this fixed up and working; * if hostap mode stays broken for more than 4 days, I'm going to back all the changes out. (And yes, gleb did run this stuff by me a few times and I'm okay with the general theory of this, but we'll see how it pans out. I'm totally fine with completely rolling it back if it's a failed experiment.) -adrian From owner-svn-src-head@freebsd.org Sat Aug 8 01:10:20 2015 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 E79CF9B5676; Sat, 8 Aug 2015 01:10:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D58FCDC9; Sat, 8 Aug 2015 01:10:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t781AJK3044742; Sat, 8 Aug 2015 01:10:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t781AJUf044737; Sat, 8 Aug 2015 01:10:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508080110.t781AJUf044737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 8 Aug 2015 01:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286437 - in head/sys: dev/ath dev/ath/ath_rate/sample dev/bwi dev/bwn dev/if_ndis dev/ipw dev/iwi dev/iwn dev/malo dev/mwl dev/ral dev/usb/wlan dev/wi dev/wpi dev/wtap 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.20 Precedence: list List-Id: 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, 08 Aug 2015 01:10:20 -0000 Author: adrian Date: Sat Aug 8 01:10:17 2015 New Revision: 286437 URL: https://svnweb.freebsd.org/changeset/base/286437 Log: Revert the wifi ifnet changes until things are more baked and tested. * 286410 * 286413 * 286416 The initial commit broke a variety of debug and features that aren't in the GENERIC kernels but are enabled in other platforms. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h head/sys/dev/bwi/bwimac.c head/sys/dev/bwi/bwiphy.c head/sys/dev/bwi/bwirf.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwi/if_bwivar.h head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndisvar.h head/sys/dev/ipw/if_ipw.c head/sys/dev/ipw/if_ipwvar.h head/sys/dev/iwi/if_iwi.c head/sys/dev/iwi/if_iwivar.h head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malo.h head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/if_mwl_pci.c head/sys/dev/mwl/if_mwlvar.h head/sys/dev/ral/if_ral_pci.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2560var.h head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2661var.h head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860var.h head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_uathvar.h head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_upgtvar.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_uralvar.h head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwvar.h head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/wi/if_wi_pci.c head/sys/dev/wi/if_wivar.h head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h head/sys/dev/wtap/if_wtap.c head/sys/dev/wtap/if_wtapvar.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat Aug 8 00:57:27 2015 (r286436) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat Aug 8 01:10:17 2015 (r286437) @@ -488,7 +488,8 @@ ath_rate_findrate(struct ath_softc *sc, #define RATE(ix) (DOT11RATE(ix) / 2) struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; const HAL_RATE_TABLE *rt = sc->sc_currates; const int size_bin = size_to_bin(frameLen); int rix, mrr, best_rix, change_rates; @@ -855,7 +856,8 @@ ath_rate_tx_complete(struct ath_softc *s const struct ath_rc_series *rc, const struct ath_tx_status *ts, int frame_size, int nframes, int nbad) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct sample_node *sn = ATH_NODE_SAMPLE(an); int final_rix, short_tries, long_tries; const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -1301,7 +1303,8 @@ static int ath_rate_sysctl_stats(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; int error, v; v = 0; Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Sat Aug 8 00:57:27 2015 (r286436) +++ head/sys/dev/ath/ath_rate/sample/sample.h Sat Aug 8 01:10:17 2015 (r286437) @@ -134,7 +134,8 @@ static unsigned calc_usecs_unicast_packe int long_retries, int is_ht40) { const HAL_RATE_TABLE *rt = sc->sc_currates; - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; int rts, cts; unsigned t_slot = 20; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Aug 8 00:57:27 2015 (r286436) +++ head/sys/dev/ath/if_ath.c Sat Aug 8 01:10:17 2015 (r286437) @@ -151,15 +151,15 @@ static struct ieee80211vap *ath_vap_crea const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void ath_vap_delete(struct ieee80211vap *); -static void ath_init(struct ath_softc *); -static void ath_stop_locked(struct ath_softc *); -static void ath_stop(struct ath_softc *); +static void ath_init(void *); +static void ath_stop_locked(struct ifnet *); +static void ath_stop(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static int ath_transmit(struct ieee80211com *, struct mbuf *); +static int ath_transmit(struct ifnet *ifp, struct mbuf *m); +static void ath_qflush(struct ifnet *ifp); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); -static int ath_ioctl(struct ieee80211com *, u_long, void *); -static void ath_parent(struct ieee80211com *); +static int ath_ioctl(struct ifnet *, u_long, caddr_t); static void ath_fatal_proc(void *, int); static void ath_bmiss_vap(struct ieee80211vap *); static void ath_bmiss_proc(void *, int); @@ -571,19 +571,34 @@ ath_fetch_mac_kenv(struct ath_softc *sc, int ath_attach(u_int16_t devid, struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp; + struct ieee80211com *ic; struct ath_hal *ah = NULL; HAL_STATUS status; int error = 0, i; u_int wmodes; + uint8_t macaddr[IEEE80211_ADDR_LEN]; int rx_chainmask, tx_chainmask; HAL_OPS_CONFIG ah_config; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); + CURVNET_SET(vnet0); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + error = ENOSPC; + CURVNET_RESTORE(); + goto bad; + } + ic = ifp->if_l2com; ic->ic_softc = sc; ic->ic_name = device_get_nameunit(sc->sc_dev); + if_initname(ifp, device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev)); + CURVNET_RESTORE(); + /* * Configure the initial configuration data. * @@ -717,8 +732,8 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_tq = taskqueue_create("ath_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->sc_tq); - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(sc->sc_dev)); + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, + "%s taskq", ifp->if_xname); TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); @@ -861,6 +876,17 @@ ath_attach(u_int16_t devid, struct ath_s ath_led_config(sc); ath_hal_setledstate(ah, HAL_LED_INIT); + ifp->if_softc = sc; + ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; + ifp->if_transmit = ath_transmit; + ifp->if_qflush = ath_qflush; + ifp->if_ioctl = ath_ioctl; + ifp->if_init = ath_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ic->ic_ifp = ifp; /* XXX not right but it's not used anywhere important */ ic->ic_phytype = IEEE80211_T_OFDM; ic->ic_opmode = IEEE80211_M_STA; @@ -1182,11 +1208,11 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hasveol = ath_hal_hasveol(ah); /* get mac address from kenv first, then hardware */ - if (ath_fetch_mac_kenv(sc, ic->ic_macaddr) == 0) { + if (ath_fetch_mac_kenv(sc, macaddr) == 0) { /* Tell the HAL now about the new MAC */ - ath_hal_setmac(ah, ic->ic_macaddr); + ath_hal_setmac(ah, macaddr); } else { - ath_hal_getmac(ah, ic->ic_macaddr); + ath_hal_getmac(ah, macaddr); } if (sc->sc_hasbmask) @@ -1195,15 +1221,12 @@ ath_attach(u_int16_t devid, struct ath_s /* NB: used to size node table key mapping array */ ic->ic_max_keyix = sc->sc_keymax; /* call MI attach routine. */ - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_setregdomain = ath_setregdomain; ic->ic_getradiocaps = ath_getradiocaps; sc->sc_opmode = HAL_M_STA; /* override default methods */ - ic->ic_ioctl = ath_ioctl; - ic->ic_parent = ath_parent; - ic->ic_transmit = ath_transmit; ic->ic_newassoc = ath_newassoc; ic->ic_updateslot = ath_updateslot; ic->ic_wme.wme_update = ath_wme_update; @@ -1299,6 +1322,16 @@ bad2: bad: if (ah) ath_hal_detach(ah); + + /* + * To work around scoping issues with CURVNET_SET/CURVNET_RESTORE.. + */ + if (ifp != NULL && ifp->if_vnet) { + CURVNET_SET(ifp->if_vnet); + if_free(ifp); + CURVNET_RESTORE(); + } else if (ifp != NULL) + if_free(ifp); sc->sc_invalid = 1; return error; } @@ -1306,6 +1339,10 @@ bad: int ath_detach(struct ath_softc *sc) { + struct ifnet *ifp = sc->sc_ifp; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", + __func__, ifp->if_flags); /* * NB: the order of these is important: @@ -1330,14 +1367,14 @@ ath_detach(struct ath_softc *sc) ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); /* * Stop things cleanly. */ - ath_stop_locked(sc); - ATH_UNLOCK(sc); + ath_stop(ifp); - ieee80211_ifdetach(&sc->sc_ic); + ieee80211_ifdetach(ifp->if_l2com); taskqueue_free(sc->sc_tq); #ifdef ATH_TX99_DIAG if (sc->sc_tx99 != NULL) @@ -1357,6 +1394,10 @@ ath_detach(struct ath_softc *sc) ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ + CURVNET_SET(ifp->if_vnet); + if_free(ifp); + CURVNET_RESTORE(); + return 0; } @@ -1432,7 +1473,7 @@ ath_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) { - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_vap *avp; struct ieee80211vap *vap; uint8_t mac[IEEE80211_ADDR_LEN]; @@ -1540,7 +1581,8 @@ ath_vap_create(struct ieee80211com *ic, vap = &avp->av_vap; /* XXX can't hold mutex across if_alloc */ ATH_UNLOCK(sc); - error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid); + error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, + bssid, mac); ATH_LOCK(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: error %d creating vap\n", @@ -1674,8 +1716,7 @@ ath_vap_create(struct ieee80211com *ic, ATH_UNLOCK(sc); /* complete setup */ - ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status); return vap; bad2: reclaim_address(sc, mac); @@ -1690,7 +1731,8 @@ static void ath_vap_delete(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_softc; + struct ifnet *ifp = ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); @@ -1699,7 +1741,7 @@ ath_vap_delete(struct ieee80211vap *vap) ATH_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); - if (sc->sc_running) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Quiesce the hardware while we remove the vap. In * particular we need to reclaim all references to @@ -1782,7 +1824,7 @@ ath_vap_delete(struct ieee80211vap *vap) #endif free(avp, M_80211_VAP); - if (sc->sc_running) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Restart rx+tx machines if still running (RUNNING will * be reset if we just destroyed the last vap). @@ -1809,9 +1851,13 @@ ath_vap_delete(struct ieee80211vap *vap) void ath_suspend(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", + __func__, ifp->if_flags); - sc->sc_resume_up = ic->ic_nrunning != 0; + sc->sc_resume_up = (ifp->if_flags & IFF_UP) != 0; ieee80211_suspend_all(ic); /* @@ -1852,7 +1898,8 @@ ath_suspend(struct ath_softc *sc) static void ath_reset_keycache(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int i; @@ -1894,7 +1941,8 @@ ath_update_chainmasks(struct ath_softc * void ath_resume(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; @@ -1967,8 +2015,12 @@ ath_resume(struct ath_softc *sc) void ath_shutdown(struct ath_softc *sc) { + struct ifnet *ifp = sc->sc_ifp; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", + __func__, ifp->if_flags); - ath_stop(sc); + ath_stop(ifp); /* NB: no point powering down chip as we're about to reboot */ } @@ -1979,6 +2031,7 @@ void ath_intr(void *arg) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; HAL_INT status = 0; uint32_t txqs; @@ -2017,11 +2070,12 @@ ath_intr(void *arg) ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); - if (sc->sc_ic.ic_nrunning == 0 && sc->sc_running == 0) { + if ((ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { HAL_INT status; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: ic_nrunning %d sc_running %d\n", - __func__, sc->sc_ic.ic_nrunning, sc->sc_running); + DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n", + __func__, ifp->if_flags); ath_hal_getisr(ah, &status); /* clear ISR */ ath_hal_intrset(ah, 0); /* disable further intr's */ ATH_PCU_UNLOCK(sc); @@ -2259,6 +2313,7 @@ static void ath_fatal_proc(void *arg, int pending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; u_int32_t *state; u_int32_t len; void *sp; @@ -2279,13 +2334,13 @@ ath_fatal_proc(void *arg, int pending) "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n", state[0], state[1] , state[2], state[3], state[4], state[5]); } - ath_reset(sc, ATH_RESET_NOLOSS); + ath_reset(ifp, ATH_RESET_NOLOSS); } static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ath_softc *sc = vap->iv_ic->ic_softc; + struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; /* * Workaround phantom bmiss interrupts by sanity-checking @@ -2306,6 +2361,8 @@ ath_bmiss_vap(struct ieee80211vap *vap) ATH_UNLOCK(sc); if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; u_int64_t lastrx = sc->sc_lastrx; u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); /* XXX should take a locked ref to iv_bss */ @@ -2363,6 +2420,7 @@ static void ath_bmiss_proc(void *arg, int pending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; uint32_t hangs; DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); @@ -2380,12 +2438,12 @@ ath_bmiss_proc(void *arg, int pending) * to clear. */ if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { - ath_reset(sc, ATH_RESET_NOLOSS); + ath_reset(ifp, ATH_RESET_NOLOSS); device_printf(sc->sc_dev, "bb hang detected (0x%x), resetting\n", hangs); } else { - ath_reset(sc, ATH_RESET_NOLOSS); - ieee80211_beacon_miss(&sc->sc_ic); + ath_reset(ifp, ATH_RESET_NOLOSS); + ieee80211_beacon_miss(ifp->if_l2com); } /* Force a beacon resync, in case they've drifted */ @@ -2405,7 +2463,8 @@ ath_bmiss_proc(void *arg, int pending) static void ath_settkipmic(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; if ((ic->ic_cryptocaps & IEEE80211_CRYPTO_TKIP) && !sc->sc_wmetkipmic) { if (ic->ic_flags & IEEE80211_F_WME) { @@ -2419,9 +2478,11 @@ ath_settkipmic(struct ath_softc *sc) } static void -ath_init(struct ath_softc *sc) +ath_init(void *arg) { - struct ieee80211com *ic = &sc->sc_ic; + struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; @@ -2440,7 +2501,7 @@ ath_init(struct ath_softc *sc) * Stop anything previously setup. This is safe * whether this is the first time through or not. */ - ath_stop_locked(sc); + ath_stop_locked(ifp); /* * The basic interface to setting the hardware in a good @@ -2566,7 +2627,7 @@ ath_init(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_RESET, "%s: imask=0x%x\n", __func__, sc->sc_imask); - sc->sc_running = 1; + ifp->if_drv_flags |= IFF_DRV_RUNNING; callout_reset(&sc->sc_wd_ch, hz, ath_watchdog, sc); ath_hal_intrset(ah, sc->sc_imask); @@ -2582,10 +2643,14 @@ ath_init(struct ath_softc *sc) } static void -ath_stop_locked(struct ath_softc *sc) +ath_stop_locked(struct ifnet *ifp) { + struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid %u if_flags 0x%x\n", + __func__, sc->sc_invalid, ifp->if_flags); + ATH_LOCK_ASSERT(sc); /* @@ -2593,7 +2658,7 @@ ath_stop_locked(struct ath_softc *sc) */ ath_power_set_power_state(sc, HAL_PM_AWAKE); - if (sc->sc_running) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Shutdown the hardware and driver: * reset 802.11 state machine @@ -2615,7 +2680,7 @@ ath_stop_locked(struct ath_softc *sc) #endif callout_stop(&sc->sc_wd_ch); sc->sc_wd_timer = 0; - sc->sc_running = 0; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (!sc->sc_invalid) { if (sc->sc_softled) { callout_stop(&sc->sc_ledtimer); @@ -2767,11 +2832,12 @@ ath_reset_grablock(struct ath_softc *sc, */ static void -ath_stop(struct ath_softc *sc) +ath_stop(struct ifnet *ifp) { - + struct ath_softc *sc = ifp->if_softc; + ATH_LOCK(sc); - ath_stop_locked(sc); + ath_stop_locked(ifp); ATH_UNLOCK(sc); } @@ -2783,9 +2849,10 @@ ath_stop(struct ath_softc *sc) * to reset or reload hardware state. */ int -ath_reset(struct ath_softc *sc, ATH_RESET_TYPE reset_type) +ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type) { - struct ieee80211com *ic = &sc->sc_ic; + struct ath_softc *sc = ifp->if_softc; + struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; int i; @@ -2947,6 +3014,15 @@ ath_reset(struct ath_softc *sc, ATH_RESE } } + /* + * This may have been set during an ath_start() call which + * set this once it detected a concurrent TX was going on. + * So, clear it. + */ + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + ATH_LOCK(sc); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); @@ -2968,7 +3044,8 @@ static int ath_reset_vap(struct ieee80211vap *vap, u_long cmd) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_softc; + struct ifnet *ifp = ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; switch (cmd) { @@ -2983,7 +3060,7 @@ ath_reset_vap(struct ieee80211vap *vap, return 0; } /* XXX? Full or NOLOSS? */ - return ath_reset(sc, ATH_RESET_FULL); + return ath_reset(ifp, ATH_RESET_FULL); } struct ath_buf * @@ -3143,12 +3220,24 @@ ath_getbuf(struct ath_softc *sc, ath_buf bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL); ATH_TXBUF_UNLOCK(sc); if (bf == NULL) { + struct ifnet *ifp = sc->sc_ifp; + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); sc->sc_stats.ast_tx_qstop++; + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); } return bf; } +static void +ath_qflush(struct ifnet *ifp) +{ + + /* XXX TODO */ +} + /* * Transmit a single frame. * @@ -3156,9 +3245,10 @@ ath_getbuf(struct ath_softc *sc, ath_buf * fails, so don't free the node reference here. */ static int -ath_transmit(struct ieee80211com *ic, struct mbuf *m) +ath_transmit(struct ifnet *ifp, struct mbuf *m) { - struct ath_softc *sc = ic->ic_softc; + struct ieee80211com *ic = ifp->if_l2com; + struct ath_softc *sc = ic->ic_ifp->if_softc; struct ieee80211_node *ni; struct mbuf *next; struct ath_buf *bf; @@ -3173,7 +3263,10 @@ ath_transmit(struct ieee80211com *ic, st DPRINTF(sc, ATH_DEBUG_XMIT, "%s: sc_inreset_cnt > 0; bailing\n", __func__); ATH_PCU_UNLOCK(sc); + IF_LOCK(&ifp->if_snd); sc->sc_stats.ast_tx_qstop++; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); return (ENOBUFS); /* XXX should be EINVAL or? */ } @@ -3213,6 +3306,8 @@ ath_transmit(struct ieee80211com *ic, st if ((!(m->m_flags & M_EAPOL)) && (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { sc->sc_stats.ast_tx_nodeq_overflow++; + m_freem(m); + m = NULL; retval = ENOBUFS; goto finish; } @@ -3236,6 +3331,8 @@ ath_transmit(struct ieee80211com *ic, st if ((!(m->m_flags & M_EAPOL)) && (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { sc->sc_stats.ast_tx_nobuf++; + m_freem(m); + m = NULL; retval = ENOBUFS; goto finish; } @@ -3263,6 +3360,11 @@ ath_transmit(struct ieee80211com *ic, st * above. */ sc->sc_stats.ast_tx_nobuf++; + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + m_freem(m); + m = NULL; retval = ENOBUFS; goto finish; } @@ -3284,13 +3386,8 @@ ath_transmit(struct ieee80211com *ic, st DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; - if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); - /* - * XXXGL: is mbuf valid after ath_txfrag_setup? If yes, - * we shouldn't free it but return back. - */ + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ath_freetx(m); - m = NULL; goto bad; } @@ -3332,6 +3429,12 @@ ath_transmit(struct ieee80211com *ic, st } } + /* + * Bump the ifp output counter. + * + * XXX should use atomics? + */ + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); nextfrag: /* * Pass the frame to the h/w for transmission. @@ -3351,7 +3454,7 @@ nextfrag: next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { bad: - if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); reclaim: bf->bf_m = NULL; bf->bf_node = NULL; @@ -3435,7 +3538,8 @@ ath_media_change(struct ifnet *ifp) static void ath_key_update_begin(struct ieee80211vap *vap) { - struct ath_softc *sc = vap->iv_ic->ic_softc; + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_block(sc->sc_tq); @@ -3444,7 +3548,8 @@ ath_key_update_begin(struct ieee80211vap static void ath_key_update_end(struct ieee80211vap *vap) { - struct ath_softc *sc = vap->iv_ic->ic_softc; + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_unblock(sc->sc_tq); @@ -3475,41 +3580,32 @@ ath_update_promisc(struct ieee80211com * static void ath_update_mcast_hw(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; u_int32_t mfilt[2]; /* calculate and install multicast filter */ - if (ic->ic_allmulti == 0) { - struct ieee80211vap *vap; - struct ifnet *ifp; + if ((ifp->if_flags & IFF_ALLMULTI) == 0) { struct ifmultiaddr *ifma; - /* * Merge multicast addresses to form the hardware filter. */ mfilt[0] = mfilt[1] = 0; - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - ifp = vap->iv_ifp; - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - caddr_t dl; - uint32_t val; - uint8_t pos; - - /* calculate XOR of eight 6bit values */ - dl = LLADDR((struct sockaddr_dl *) - ifma->ifma_addr); - val = LE_READ_4(dl + 0); - pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ - val; - val = LE_READ_4(dl + 3); - pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ - val; - pos &= 0x3f; - mfilt[pos / 32] |= (1 << (pos % 32)); - } - if_maddr_runlock(ifp); + if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */ + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + caddr_t dl; + u_int32_t val; + u_int8_t pos; + + /* calculate XOR of eight 6bit values */ + dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); + val = LE_READ_4(dl + 0); + pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; + val = LE_READ_4(dl + 3); + pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; + pos &= 0x3f; + mfilt[pos / 32] |= (1 << (pos % 32)); } + if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; @@ -3542,7 +3638,7 @@ ath_update_mcast(struct ieee80211com *ic void ath_mode_init(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -3553,8 +3649,15 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); + DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_MODE, + "%s: ah=%p, ifp=%p, if_addr=%p\n", + __func__, + ah, + ifp, + (ifp == NULL) ? NULL : ifp->if_addr); + /* handle any link-level address change */ - ath_hal_setmac(ah, ic->ic_macaddr); + ath_hal_setmac(ah, IF_LLADDR(ifp)); /* calculate and install multicast filter */ ath_update_mcast_hw(sc); @@ -3566,7 +3669,7 @@ ath_mode_init(struct ath_softc *sc) void ath_setslottime(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; u_int usec; @@ -3650,11 +3753,12 @@ static void ath_reset_proc(void *arg, int pending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; #if 0 device_printf(sc->sc_dev, "%s: resetting\n", __func__); #endif - ath_reset(sc, ATH_RESET_NOLOSS); + ath_reset(ifp, ATH_RESET_NOLOSS); } /* @@ -3664,6 +3768,7 @@ static void ath_bstuck_proc(void *arg, int pending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; uint32_t hangs = 0; if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) @@ -3681,7 +3786,7 @@ ath_bstuck_proc(void *arg, int pending) * This assumes that there's no simultaneous channel mode change * occuring. */ - ath_reset(sc, ATH_RESET_NOLOSS); + ath_reset(ifp, ATH_RESET_NOLOSS); } static void @@ -4051,7 +4156,7 @@ static struct ieee80211_node * ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ieee80211com *ic = vap->iv_ic; - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; struct ath_node *an; @@ -4078,7 +4183,7 @@ static void ath_node_cleanup(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4093,7 +4198,7 @@ static void ath_node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, ni->ni_macaddr, ":", ATH_NODE(ni)); @@ -4105,7 +4210,7 @@ static void ath_node_getsignal(const struct ieee80211_node *ni, int8_t *rssi, int8_t *noise) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_hal *ah = sc->sc_ah; *rssi = ic->ic_node_getrssi(ni); @@ -4243,7 +4348,8 @@ ath_txq_update(struct ath_softc *sc, int { #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ath_txq *txq = sc->sc_ac2q[ac]; struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; struct ath_hal *ah = sc->sc_ah; @@ -4316,7 +4422,7 @@ ath_txq_update(struct ath_softc *sc, int int ath_wme_update(struct ieee80211com *ic) { - struct ath_softc *sc = ic->ic_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; return !ath_txq_update(sc, WME_AC_BE) || !ath_txq_update(sc, WME_AC_BK) || @@ -4367,7 +4473,8 @@ ath_tx_update_stats(struct ath_softc *sc struct ath_buf *bf) { struct ieee80211_node *ni = bf->bf_node; - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; int sr, lr, pri; if (ts->ts_status == 0) { @@ -4722,6 +4829,7 @@ static void ath_tx_proc_q0(void *arg, int npending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; uint32_t txqs; ATH_PCU_LOCK(sc); @@ -4742,6 +4850,9 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) ath_tx_processq(sc, sc->sc_cabq, 1); + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -4766,6 +4877,7 @@ static void ath_tx_proc_q0123(void *arg, int npending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; int nacked; uint32_t txqs; @@ -4799,6 +4911,9 @@ ath_tx_proc_q0123(void *arg, int npendin if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -4822,6 +4937,7 @@ static void ath_tx_proc(void *arg, int npending) { struct ath_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; int i, nacked; uint32_t txqs; @@ -4847,6 +4963,10 @@ ath_tx_proc(void *arg, int npending) if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); + /* XXX check this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -5157,7 +5277,7 @@ ath_tx_draintxq(struct ath_softc *sc, st txq->axq_aggr_depth--; #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { - struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; int status = 0; /* @@ -5302,8 +5422,9 @@ void ath_legacy_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf_last; + struct ifnet *ifp = sc->sc_ifp; int i; + struct ath_buf *bf_last; (void) ath_stoptxdma(sc); @@ -5355,12 +5476,15 @@ ath_legacy_tx_drain(struct ath_softc *sc ath_printtxbuf(sc, bf, sc->sc_bhalq, 0, ath_hal_txprocdesc(ah, bf->bf_lastds, &bf->bf_status.ds_txstat) == HAL_OK); - ieee80211_dump_pkt(&sc->sc_ic, + ieee80211_dump_pkt(ifp->if_l2com, mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, 0, -1); } } #endif /* ATH_DEBUG */ + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; } @@ -5391,7 +5515,8 @@ ath_chan_change(struct ath_softc *sc, st static int ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) { - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int ret = 0; @@ -5526,6 +5651,9 @@ finish: ath_hal_intrset(ah, sc->sc_imask); ATH_PCU_UNLOCK(sc); + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); ath_txrx_start(sc); /* XXX ath_start? */ @@ -5541,7 +5669,8 @@ ath_calibrate(void *arg) { struct ath_softc *sc = arg; struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; HAL_BOOL longCal, isCalDone = AH_TRUE; HAL_BOOL aniCal, shortCal = AH_FALSE; int nextcal; @@ -5667,12 +5796,12 @@ restart: static void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 8 01:10:32 2015 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 1B2579B57B6; Sat, 8 Aug 2015 01:10:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.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 DEF89F1D; Sat, 8 Aug 2015 01:10:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodb91 with SMTP id b91so66923906iod.1; Fri, 07 Aug 2015 18:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/33xD2efnuo3/GWXg7WtOyI3vH+DwZrElTIf+2Pr4M4=; b=PBe9yUysUgIFPBXs2l2cO815+/yBb0ZM3y9SKl6VaUOGS1oIeWzku73vCcJNvkYpPw PbhtNxLEOPdYAXIXCLtvgZogn/1PINaHchGmxBuUKkN7H89u4gkNQ6F4FaWUFEBuVLeR WknLyx/KMNSnqIZm3jjZ0ZgttxEC0bZVFJJlKkTgTxn2nXU/P1BYiPbqjbL9zZ2BSJWn iF0G5QbYXW45nnmp3QHP6ln/fAueYPIijH0twMgkV3jfsb8V57SAOENljGBpo8RMhAm3 8t9NJN3hPR42a2QA4jFTpMCoaM85r7qnKvHgFfbFxvlsG/VMPlUiAGjZzrq0cKBgEFBd ZDEQ== MIME-Version: 1.0 X-Received: by 10.107.169.138 with SMTP id f10mr10731985ioj.75.1438996231365; Fri, 07 Aug 2015 18:10:31 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Fri, 7 Aug 2015 18:10:31 -0700 (PDT) In-Reply-To: References: <201508071143.t77BhFvr007283@repo.freebsd.org> <72035147-7F25-4E63-B60B-A19A2FB58117@FreeBSD.org> Date: Fri, 7 Aug 2015 18:10:31 -0700 Message-ID: Subject: Re: svn commit: r286410 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral ... From: Adrian Chadd To: "Bjoern A. Zeeb" Cc: Gleb Smirnoff , "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.20 Precedence: list List-Id: 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, 08 Aug 2015 01:10:32 -0000 Gleb, At least for ath(4), TDMA doesn't work, ATH_DEBUG doesn't work, IFF_DUMPPKTS() has an extra brace, and that's what I found in the last 15 minutes of this, compiling one of the many MIPS kernels that we have in -HEAD for hardware that people are using. I left this up to you to run to completion, and a single 'make universe' would've found these issues. Instead, head is actively broken leading into a weekend. There's at least one report of a hostapd problem, which indicates that hostapd didn't get enough testing. I don't know if adhoc or monitor mode got tested. I understand if mesh/tdma weren't tested - I'm slowly chipping away at those. I've just reverted the work. Let's get all the debug stuff more thoroughly tested and get more exposure before we try to land this again. If there are any follow up issues with the reversion then please poke me and I'll get it tested. Thanks, -adrian On 7 August 2015 at 16:49, Adrian Chadd wrote: > Hi, > > Since I'm on holidays, and I really don't have time to tidy up after > this commit: > > * everyone can commit to the wireless stuff to get this fixed up and working; > * if hostap mode stays broken for more than 4 days, I'm going to back > all the changes out. > > (And yes, gleb did run this stuff by me a few times and I'm okay with > the general theory of this, but we'll see how it pans out. I'm totally > fine with completely rolling it back if it's a failed experiment.) > > > > -adrian From owner-svn-src-head@freebsd.org Sat Aug 8 04:59:28 2015 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 9D4E49B6533; Sat, 8 Aug 2015 04:59:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7B210192B; Sat, 8 Aug 2015 04:59:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t784xSNp043781; Sat, 8 Aug 2015 04:59:28 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t784xSs9043780; Sat, 8 Aug 2015 04:59:28 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508080459.t784xSs9043780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 8 Aug 2015 04:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286439 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 04:59:28 -0000 Author: marcel Date: Sat Aug 8 04:59:27 2015 New Revision: 286439 URL: https://svnweb.freebsd.org/changeset/base/286439 Log: Document the application interface. Modified: head/share/man/man4/proto.4 Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Sat Aug 8 01:45:53 2015 (r286438) +++ head/share/man/man4/proto.4 Sat Aug 8 04:59:27 2015 (r286439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2015 +.Dd August 7, 2015 .Dt PROTO 4 .Os .\" @@ -74,7 +74,285 @@ logic in user space. Especially hardware diagnostics requires a somewhat user-friendly interface and adequate reporting. Neither is done easily as kernel code. -.\" +.Ss I/O port resources +Device special files created for I/O port resources allow +.Xr lseek 2 , +.Xr read 2 , +.Xr write 2 +and +.Xr ioctl 2 +operations to be performed on them. +The +.Xr read 2 +and +.Xr write 2 +system calls are used to perform input and output (resp.) on the port. +The amount of data that can be read or written at any single time is either +1, 2 or 4 bytes. +While the +.Nm +driver does not prevent reading or writing 8 bytes at a time for some +architectures, it should not be assumed that such actually produces +correct results. +The +.Xr lseek 2 +system call is used to select the port number, relative to the I/O port +region being represented by the device special file. +If, for example, the device special file corresponds to an I/O port region +from 0x3f8 to 0x3ff inclusive, then an offset of 4 given to lseek with a +whence value of SEEK_SET will target port 0x3fc on the next read or write +operation. +The +.Xr ioctl 2 +system call can be used for the +.Dv PROTO_IOC_REGION +request. +This ioctl request returns the extend of the resource covered by this +device special file. The extend is returned in the following structure: +.Bd -literal +struct proto_ioc_region { + unsigned long address; + unsigned long size; +}; +.Ed +.Ss Memory mapped I/O resources +The device special files created for memory mapped I/O resources behave +in the same way as those created for I/O port resources. +Additionally, device special files for memory mapped I/O resources allow +the memory to be mapped into the process' address space using +.Xr mmap 2 . +Reads and writes to the memory address returned by +.Xr mmap 2 +go directly to the hardware. +As such the use of +.Xr read 2 +and +.Xr write 2 +can be avoided, reducing the access overhead significantly. +Alignment and access width constraints put forth by the underlying device +apply. +Also, make sure the compiler does not optimize memory accesses away or has +them coalesced into bigger accesses. +.Ss DMA pseudo resource +A device special file named +.Pa busdma +is created for the purpose of doing DMA. +It only supports +.Xr ioctl 2 +and only for the +.Dv PROTO_IOC_BUSDMA +request. +This device special file does not support +.Xr read 2 +nor +.Xr write 2 . +The +.Dv PROTO_IOC_BUSDMA +request has an argument that is both in and out and is defined as +follows: +.Bd -literal +struct proto_ioc_busdma { + unsigned int request; + unsigned long key; + union { + struct { + unsigned long align; + unsigned long bndry; + unsigned long maxaddr; + unsigned long maxsz; + unsigned long maxsegsz; + unsigned int nsegs; + unsigned int datarate; + unsigned int flags; + } tag; + struct { + unsigned long tag; + unsigned int flags; + unsigned long virt_addr; + unsigned long virt_size; + unsigned int phys_nsegs; + unsigned long phys_addr; + unsigned long bus_addr; + unsigned int bus_nsegs; + } md; + struct { + unsigned int op; + unsigned long base; + unsigned long size; + } sync; + } u; + unsigned long result; +}; +.Ed +The +.Va request +field is used to specify which DMA operation is to be performed. +The +.Va key +field is used to specify which object the operation applies to. +An object is either a tag or a memory descriptor (md). +The following DMA operations are defined: +.Bl -tag -width XXXX +.It PROTO_IOC_BUSDMA_TAG_CREATE +Create a root tag. +The +.Va result +field is set on output with the key of the DMA tag. +The tag is created with the constraints given by the +.Va tag +sub-structure. These constraints correspond roughly to those that can be +given to the +.Xr bus_dma_tag_create 9 +function. +.It PROTO_IOC_BUSDMA_TAG_DERIVE +Create a derived tag. +The +.Va key +field is used to identify the parent tag from which to derive the new tag. +The key of the derived tag is returned in the +.Va result +field. +The derived tag combines the constraints of the parent tag with those +given by the +.Va tag +sub-structure. +The combined constraints are written back to the +.Va tag +sub-structure on return. +.It PROTO_IOC_BUSDMA_TAG_DESTROY +Destroy a root or derived tag previously created. +The +.Va key +field specifies the tag to destroy. +A tag can only be destroyed when not referenced anymore. +This means that derived tags that have this tag as a parent and memory +descriptors created from this tag must be destroyed first. +.It PROTO_IOC_BUSDMA_MEM_ALLOC +Allocate memory that satisfies the constraints put forth by the tag +given in the +.Va tag +field of the +.Va md +sub-structure. +The key of the memory descriptor for this memory is returned in the +.Va result +field. +The +.Va md +sub-structure is filled on return with details of the allocation. +The kernel virtual address and the size of the allocated memory are returned +in the +.Va virt_addr +and +.Va virt_size +fields. +The number of contigous physical memory segments and the address of the first +segment are returned in the +.Va phys_nsegs +and +.Va phys_addr +fields. +Allocated memory is automatically loaded and thus mapped into bus space. +The number of bus segments and the address of the first segment are returned +in the +.Va bus_nsegs +and +.Va bus_addr +fields. +The behaviour of this operation banks heavily on how +.Xr bus_dmamem_alloc 9 +is implemented, which means that memory is currently always allocated as a +single contigous region of physical memory. +In practice this also tends to give a single contigous region in bus space. +This may change over time. +.It PROTO_IOC_BUSDMA_MEM_FREE +Free previously allocated memory and destroy the memory desciptor. +The +.Nm +driver is not in a position to track whether the memory has been mapped in +the process' address space, so the application is responsible for unmapping +the memory before it is freed. +The +.Nm +driver also cannot protect against the hardware writing to or reading from +the memory, even after it has been freed. +When the memory is reused for other purposes it can be corrupted or cause +the hardware to behave in unpredictable ways when DMA has not stopped +completely before freeing. +.It PROTO_IOC_BUSDMA_MD_CREATE +Create an empty memory descriptor with the tag specified in the +.Va tag +field of the +.Va md +sub-structure. +The key of the memory descriptor is returned in the +.Va result +field. +.It PROTO_IOC_BUSDMA_MD_DESTROY +Destroy the previously created memory descriptor specified by the +.Va key +field. +When the memory descriptor is still loaded, it is unloaded first. +.It PROTO_IOC_BUSDMA_MD_LOAD +Load a contigous region of memory in the memory descriptor specified by the +.Va key +field. +The size and address in the process' virtual address space are specified +by the +.Va virt_size +and +.Va virt_addr +fields. +On return, the +.Va md +sub-structure contains the result of the operation. +The number of physical segments and the address of the first segment is +returned in the +.Va phys_nsegs +and +.Va phys_addr +fields. +The number of bus space segments and the address of the first segment in +bus space is returned in the +.Va bus_nsegs +and +.Va bus_addr +fields. +.It PROTO_IOC_BUSDMA_MD_UNLOAD +Unload the memory descriptor specified by the +.Va key +field. +.It PROTO_IOC_BUSDMA_SYNC +Guarantee that all hardware components have a coherent view of the memory +tracked by the memory descriptor, specified by the +.Va key +field. +A sub-section of the memory can be targeted by specifying the relative +offset and size of the memory to make coherent. +The offset and size are given by the +.Va base +and +.Va size +fields of the +.Va sync +sub-structure. +The +.Va op +field holds the sync operation to be performed. +This is similar to the +.Xr bus_dmamap_sync 9 +function. +.El +.Ss PCI configuration space +Access to PCI configuration space is possible through the +.Pa pcicfg +device special file. +The device special file supports +.Xr lseek 2 , +.Xr read 2 +and +.Xr write 2 . +Usage is the asme as for I/O port resources. .Sh FILES All device special files corresponding to a PCI device are located under .Pa /dev/proto/pci::: @@ -152,6 +430,16 @@ A legacy floppy controller will have the .It Pa /dev/proto/isa:0x3f0/busdma .El .\" +.Sh SEE ALSO +.Xr ioctl 2 , +.Xr lseek 2 , +.Xr mmap 2 , +.Xr read 2 , +.Xr write 2 , +.Xr bus_dma_tag_create 9 , +.Xr bus_dmamap_sync 9 , +.Xr bus_dmamem_alloc 9 +.\" .Sh AUTHORS The .Nm @@ -166,6 +454,13 @@ It is not advisable to use this driver o .Sh MISSING FUNCTIONALITY The .Nm +driver does not fully support memory descriptors that need multiple +physical memory segments or multiple bus space segments. +At the very least, an operation is needed on the DMA pseudo resource +for the application to obtain all segments. +.Pp +The +.Nm driver does not yet support interrupts. Since interrupts cannot be handled by the driver itself, they must be converted into signals and delivered to the program that has registered From owner-svn-src-head@freebsd.org Sat Aug 8 06:06:51 2015 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 E2CAC9AC29A; Sat, 8 Aug 2015 06:06:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CFB2F1AEC; Sat, 8 Aug 2015 06:06:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7866olV072499; Sat, 8 Aug 2015 06:06:50 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7866nw0072494; Sat, 8 Aug 2015 06:06:49 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508080606.t7866nw0072494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 06:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286441 - in head: share/man/man4 sys/contrib/dev/iwm sys/dev/iwm sys/modules/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm3160fw sys/modules/iwmfw/iwm7260fw sys/modules/iwmfw/iwm7265fw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 06:06:51 -0000 Author: rpaulo Date: Sat Aug 8 06:06:48 2015 New Revision: 286441 URL: https://svnweb.freebsd.org/changeset/base/286441 Log: Import OpenBSD's iwm WiFi driver for Intel 3160/7260/7265. There are still several bugs, but I've been using it for a while now. Thanks to all the testers and to Adrian for his help with this driver. This driver isn't connected to the build yet, but it will be soon. There's no MFC planned because the driver isn't very stable yet. Reviewed by: adrian Obtained from: https://github.com/rpaulo/iwm Tested by: adrian, gjb, dumbbell (others that I forgot). Relnotes: yes Added: head/share/man/man4/iwm.4 (contents, props changed) head/share/man/man4/iwmfw.4 (contents, props changed) head/sys/contrib/dev/iwm/ head/sys/contrib/dev/iwm/LICENSE head/sys/contrib/dev/iwm/iwm-3160-9.fw.uu (contents, props changed) head/sys/contrib/dev/iwm/iwm-7260-9.fw.uu (contents, props changed) head/sys/contrib/dev/iwm/iwm-7265-9.fw.uu (contents, props changed) head/sys/dev/iwm/ head/sys/dev/iwm/if_iwm.c (contents, props changed) head/sys/dev/iwm/if_iwm_binding.c (contents, props changed) head/sys/dev/iwm/if_iwm_binding.h (contents, props changed) head/sys/dev/iwm/if_iwm_debug.h (contents, props changed) head/sys/dev/iwm/if_iwm_mac_ctxt.c (contents, props changed) head/sys/dev/iwm/if_iwm_mac_ctxt.h (contents, props changed) head/sys/dev/iwm/if_iwm_pcie_trans.c (contents, props changed) head/sys/dev/iwm/if_iwm_pcie_trans.h (contents, props changed) head/sys/dev/iwm/if_iwm_phy_ctxt.c (contents, props changed) head/sys/dev/iwm/if_iwm_phy_ctxt.h (contents, props changed) head/sys/dev/iwm/if_iwm_phy_db.c (contents, props changed) head/sys/dev/iwm/if_iwm_phy_db.h (contents, props changed) head/sys/dev/iwm/if_iwm_power.c (contents, props changed) head/sys/dev/iwm/if_iwm_power.h (contents, props changed) head/sys/dev/iwm/if_iwm_scan.c (contents, props changed) head/sys/dev/iwm/if_iwm_scan.h (contents, props changed) head/sys/dev/iwm/if_iwm_time_event.c (contents, props changed) head/sys/dev/iwm/if_iwm_time_event.h (contents, props changed) head/sys/dev/iwm/if_iwm_util.c (contents, props changed) head/sys/dev/iwm/if_iwm_util.h (contents, props changed) head/sys/dev/iwm/if_iwmreg.h (contents, props changed) head/sys/dev/iwm/if_iwmvar.h (contents, props changed) head/sys/modules/iwm/ head/sys/modules/iwm/Makefile (contents, props changed) head/sys/modules/iwmfw/ head/sys/modules/iwmfw/Makefile (contents, props changed) head/sys/modules/iwmfw/Makefile.inc (contents, props changed) head/sys/modules/iwmfw/iwm3160fw/ head/sys/modules/iwmfw/iwm3160fw/Makefile (contents, props changed) head/sys/modules/iwmfw/iwm7260fw/ head/sys/modules/iwmfw/iwm7260fw/Makefile (contents, props changed) head/sys/modules/iwmfw/iwm7265fw/ head/sys/modules/iwmfw/iwm7265fw/Makefile (contents, props changed) Added: head/share/man/man4/iwm.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/iwm.4 Sat Aug 8 06:06:48 2015 (r286441) @@ -0,0 +1,153 @@ +.\" Copyright (c) 2004-2006 +.\" Damien Bergamini . 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 AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 1, 2015 +.Dt IWM 4 +.Os +.Sh NAME +.Nm iwm +.Nd Intel IEEE 802.11ac wireless network driver +.Sh SYNOPSIS +To compile this driver into the kernel, +include the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iwm" +.Cd "device pci" +.Cd "device wlan" +.Cd "device firmware" +.Ed +.Pp +You also need to select a firmware for your device. +Choose one from: +.Bd -ragged -offset indent +.Cd "device iwm3160fw" +.Cd "device iwm7260fw" +.Cd "device iwm7265fw" +.Ed +.Pp +Or you can use +.Bd -ragged -offset indent +.Cd "device iwmfw" +.Ed +.Pp +to include them all. +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_iwm_load="YES" +iwm3160fw_load="YES" +iwm7260fw_load="YES" +iwm7265fw_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It Intel Dual Band Wireless AC 3160 +.It Intel Dual Band Wireless AC 7260 +.It Intel Dual Band Wireless AC 7265 +.El +.Pp +.Nm +supports +.Cm station +mode operation. +Only one virtual interface may be configured at any time. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Pp +This driver requires the firmware built with the +.Nm iwmfw +module to work. +.Sh EXAMPLES +Join an existing BSS network (i.e., connect to an access point): +.Bd -literal -offset indent +ifconfig wlan create wlandev iwm0 inet 192.168.0.20 \e + netmask 0xffffff00 +.Ed +.Pp +Join a specific BSS network with network name +.Dq Li my_net : +.Pp +.Dl "ifconfig wlan create wlandev iwm0 ssid my_net up" +.Pp +Join a specific BSS network with 64-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev iwm0 ssid my_net \e + wepmode on wepkey 0x1234567890 weptxkey 1 up +.Ed +.Pp +Join a specific BSS network with 128-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev iwm0 wlanmode adhoc ssid my_net \e + wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 +.Ed +.Sh DIAGNOSTICS +.Bl -diag +.It "iwm%d: device timeout" +The driver will reset the hardware. +This should not happen. +.It "iwm%d: firmware error" +The onboard microcontroller crashed for some reason. +The driver will reset the hardware. +This should not happen. +.It "iwm%d: timeout waiting for firmware initialization to complete" +The onboard microcontroller failed to initialize in time. +This should not happen. +.It "iwm%d: could not load firmware image '%s'" +The driver failed to load the firmware image using the +.Xr firmware 9 +subsystem. +Verify the +.Xr iwmfw 4 +firmware module is present. +.It "iwm%d: could not load boot firmware" +An attempt to upload the boot firmware image to the onboard microcontroller +failed. +This should not happen. +.It "iwm%d: could not load microcode" +An attempt to upload the microcode image to the onboard microcontroller failed. +This should not happen. +.It "iwm%d: could not load main firmware" +An attempt to upload the main firmware image to the onboard microcontroller +failed. +This should not happen. +.El +.Sh SEE ALSO +.Xr iwmfw 4 , +.Xr pci 4 , +.Xr wlan 4 , +.Xr wlan_ccmp 4 , +.Xr wlan_tkip 4 , +.Xr wlan_wep 4 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 Added: head/share/man/man4/iwmfw.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/iwmfw.4 Sat Aug 8 06:06:48 2015 (r286441) @@ -0,0 +1,66 @@ +.\" Copyright (c) 2009 Sam Leffler, Errno Consulting +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 28, 2015 +.Dt IWMFW 4 +.Os +.Sh NAME +.Nm iwmfw +.Nd "Firmware Module for Intel Wireless driver" +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iwmfw" +.Ed +.Pp +This will include firmware images for all +.Xr iwm 4 +devices inside the kernel. +If you want to pick only the firmware image for your network adapter choose one +of the following: +.Bd -ragged -offset indent +.Cd "device iwm3160fw" +.Cd "device iwm7260fw" +.Cd "device iwm7265fw" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iwm3160fw_load="YES" +iwm7260fw_load="YES" +iwm7265fw_load="YES" +.Ed +.Sh DESCRIPTION +This module provides access to firmware sets for the +Intel Dual Band Wireless WiFi 3160, 7260 and 7265 series of +IEEE 802.11n/11ac adapters. +It may be +statically linked into the kernel, or loaded as a module. +.Sh SEE ALSO +.Xr iwm 4 , +.Xr firmware 9 Added: head/sys/contrib/dev/iwm/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/LICENSE Sat Aug 8 06:06:48 2015 (r286441) @@ -0,0 +1,39 @@ +Copyright (c) 2014, Intel Corporation. +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. Added: head/sys/contrib/dev/iwm/iwm-3160-9.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-3160-9.fw.uu Sat Aug 8 06:06:48 2015 (r286441) @@ -0,0 +1,14890 @@ +begin 644 iwm-3160-9.fw +M`````$E73`IS=')E86TZ0V]R94-Y8VQE,5]S=&%B7VQI;G5X0#@U,3@X```` +M``````````````````````````````````````GD&0````````````````8` +M```$``````(```<`````````$@````0```#_RQI8'0````@`````````$P`` +M`!X````(`````````("````<````$``````````````````````````;```` +M!`````$````3````!$`!````@```````Y!D$```)``$``````````$QQ@`#D +M,8``M)B``!@R@``0%8```(R`````````````````````````````;"#`$`\; +M"2(0`!MN`0``804``&$```!A```;)0`!&R1<',`1````8=P=P!```!TD```` +M(0]%`"(`7``Y]"7`$`$!$S(!`1,S`0`38N__`#('``!B!F``8@``6#A@1<`0 +M<$7`$'A%P!"01<`08@``8:P$P!(/$P$BL`3`$@`!$SCH'<`1`0!2)+0?P!`" +M`!-P`P``80@`6#`(`&0Q!@``80\34B*"!!,D"``3)0$`4FX0`!,Q!"C`$0@` +M6&[F#P!A```3)0``$R0D$,`1`(`3)#@!,B!`#*$0```20```$E"0``84``$R4&`1,D!"C`$0]V$R(L2,<1#W@3(@`` +MQA$#``$D```!)0]%`"(`7``Y[_\`,A@``&0``!,D`0`3)3@B!Z(6@```%8```!6B%:(`@$``*H```"JB*J(_@$``(P* +M``!4C%2,I!\```````````````#^```!`/\``@'_`0#_`0$`_@(!`P+_`0$` +M_P$!`?\"`/\#`@#^!`(#`O\"`@#_`@(!_P,`_P4#`/X&`P`#_P,#`/\#`P'_ +M````````````````'$(```H````$````('.``````````````````'Q"```% +M````!````"!S@````````0```&CX``#\^```B/@``-CX``!<]```6/0``"`O +M``"H+@```````````````0O_```%`P``!`(```;_````_P``#/\```<2```( +M$@``"1(```H2`0#_``$"`!$!`0(!`0$#_P$!!`(!`04#`0$&!`$!!P4!`0@& +M`0$)#P$!"A`!``S_`0#^_P(`_P<"`0'_`@(""`("`PD"`@0*`@(%"P("!@P" +M`@<-`@((#@(""0X"`@H-`@`,_P(`_O\```````````````````````#_!P`` +M`/\```?_``$)_P``"O\!`@```0,!_P$#`O\!`P/_`0$$_P$"!0`!!`8&`0$' +M_P$`"/\!``K_`@(`_P(#`?\"`P+_`@,#_P(!!`$"`@4``@0&!@("!P`"``@! +M`@`*`0,`_P(#`P#_`P,!_P,#`O\#`P,$`P$$!0,"!0`#!`8&`P,'_P,`"`4# +M``H%`P#^`P0$`/\$!`'_!`0"_P0$`_\$!`3_!`0%_P0$!@8$!`<&!``(_P0` +M"O\`````````````_P````$#``("`@`#``(```7_```&_P``!/\```<$```( +M_P$`_P$!`0`#`0(!`@$"`@(!``3_`0$'!`$`"/\"`P`&`@("!@(`!?\"``;_ +M`@`$_P(`!P<"``@'`P,`!@,``04#`@(&`P$%_P,`!O\#``0'`P`'!P,`"`<` +M``````$`_P$``?\!`@+_`@#_``(``?\"`0/_`@,$_P(""_\"`@S_`@(*_P,` +M`?\#`0,)`P0(_P,'!?\#!PH'`P4&_P,("_\#`PS_`P@-#P0``?\$`0,+!`,) +M_P0'"@<$!P7_!`4&_P0("_\$!`S_!`@-#P4`_P4%``'_!0$#"@4&"/\%`@?_ +M!0(*"`4#!/\%`@O_!04,_P8`_P8&``'_!@$##`8%"?\&`@H(!@('_P8#!/\& +M`@O_!@8,_P<`_P,'!0;_!P$#_P<``?\'!PO_!P<,#0<`_@0(`/\!"`4&_P@! +M`_\(``'_"`,$_P@(#`X("`O_"`#^`@&1```!/P```I$``#X]```#D0``/3T` +M``21```_`P``!9$```D0```&D0``%AP```>1```?'P``")$``!P6```)D0`` +M$`D```J1```#/P``"Y$``#T]```,D0``/3X```V1```_`0``$1`^2$A(X!`$ +M````#2`$````($,Y`````."$`0``X1`!`````A"7RP4`,&`+````#]($```` +M&-+\__\?">")AH2$"N"$A```"^"F5=<@#.`BBRPR#>"JB8>^PQ%^"2 +MC(N*&."*B@``&>!^2><@&N`BBRPR&^"33;>^PQ)&```````G,````` +M$2`4A0$``F#^%````V`1%```!F`1%```&1`$`````7,P`0``81`@````$B"4 +M`P``UA`<8P``UQ`<8P``V!`<8P``V1!Z@(``VA!X@(``VQ!X@(``"1!N7P`` +M&A``````,1"&`0``,A"0`0``,Q#(````-!!0````-1"`````.A!I````.Q#` +M````P1``````*N#YY>`>>^PQ*."+BXF)*>")B0`` +M`D'AX;%Q02"AX>'AX>'AX;%Q02"AX>'AX>'AX;%Q02"AX>```` +M````````````1+@!`!4````$````('.````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````$`<``!$'```3!P``,@;``#,&P``-`R@ +M`$`,H``<'*``0""@`"@DH`!L$*``&"2@`'@DH`!\)*``@"2@`(0DH`!0$*`` +M2":@`&`0H`!,)J``9!"@`&@0H`!8$*``,!"@`#P0H``T$*``+`R@``"!I``! +M@:0``X&D`(@DH`",)*``D"2@`)0DH`"8)*``G"2@`*`DH`"D)*`````````` +M````````<1L-`."!`0`6GP(`````````````````<0$)WP``Z```X@``/@%7 +M/P%F0`%W00&80@$'-@$`J@``7P&J8`&JW@#XS@`"O@`6SP`(TP`(T``(U``( +MT0`(U0`(T@`8U@``,0`D!`!,.```Y0%SY@$$CP'_@P%IC@$/D`$`D0%]D@%] +MDP%]60`&_0`!_@`3_P`&;@`$?`$-@`$-N0$%S@$"O0$)QP$?R`$6I`$0I0$0 +MJP$0J@$0L@$3LP$3WP$!UP$`>@$````````#`04`$``$`!$`$@`#``H`-`$U +M`38!)0`*``0`#P`#`3@`$``2````!PP3`,`2@`"H$H``Y!*``*02@``#`0(! +M!0`$`!``"@`&`'P!@`%S`7#AY.(@`0!4$P$`-!0!```3`0`\"@$`C`D!`-0-`0"<'@$`7!\!`$`?`0#@^@`` +M7/T``$`?`0!8``$`8/\``/@*`0`\!P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!` +M'P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`$`? +M`0`T!`$`,`0!`"P$`0!`'P$`0!\!`$`?`0!`'P$`0!\!`!P'`0!`'P$`0!\! +M`$`?`0!`'P$`0!\!`$`<`0!`'P$`0!\!`/@1`0`X$0$`0!\!`$`?`0!`'P$` +MQ!$!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`!`!`0`,`P$`Y`(!`$`?`0!` +M'P$`0!\!`$`?`0!`'P$`:`(!`$`?`0!`'P$`0!\!`$`?`0"@%@$`0!\!`+P, +M`0!`'P$`?!$!`'01`0`\!`$`0!\!`$`?`0!`'P$`0!\!`$`?`0!`'P$`Y`,! +M`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`)`;`0!($`$`_!(!`#01`0!`'P$` +M0!\!`$`?`0!L`@$`0!\!`$`?`0!D"P$`0!\!`$R?`0!`'P$`R`(!`&@+`0!` +M'P$`:`0!`$`?`0`$'`$`0!\!`$`?`0!`'P$`(`8!`$`?`0!("`$`L!L!`$`? +M`0!\#P$`:`$!`"@;`0!`'P$`0!\!```0`0!`'P$`0!\!`$`?`0#@"@$`Q`(! +M`$`?`0!`'P$`0!\!`,P5`0`$"`$`0!\!`.`#`0!`'P$`0!\!`$`?`0!0%@$` +MN`P!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!` +M'P$`0!\!`$`?`0!`'P$`;"$!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`"#_ +M``!`'P$`0!\!`$`?`0`H(0$`0!\!`"@"`0!0`@$`0!\!`"S_``!,"`$`[!8! +M`##_``!`'P$`0!\!`$`?`0!`'P$`0!\!`&@A`0!`'P$`;`L!`'P%`0!`"0$` +M0!\!`$`?`0#,%@$`0!\!`$`?`0!`'P$`0!\!`$`?`0!`'P$`0!\!`$`?`0!` +M'P$`0!\!`$`?`0#0%0$`0!\!`$`?`0#,!P$`4!L!`#0#`0!`'P$`6`,!`,0@ +M`0!`'P$`0!\!`(0&`0!`'P$`F```,1]@`!,=0$`+#>``#0W@`#_____`````/____\````` +M_____P````#_____````````````````JP`````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````#J"J(*7@H="N`)I0EM"3<)!`G3 +M"*0(=PA+""((^@?3!ZX'B@?\!\<'E0=F!SD'#@?E!KX&F09U!E(&,081!O,% +MU06Y!9X%A`4````````````````````````````````````````````````` +M``````````````````````````````````````````````"810```@````0` +M```@`````P```/____\````` +M``````````````````````````````````````````````````````````!F +M9@X``````&9F"@!F9@8`9F8&`&9F`@!F9@(`9F8^`&9F/@!F9CH`9F8Z```` +M``!F9C8``````&9F,@``````9F8.````````````9F8&```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````D`"0D)"0D)"0D)``D`"0`)```)```` +M``````````````````````````````````````````````````"4!8`````` +M`&@<@``````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````/L=#``S$0`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````0%!@<("0H+#`T.#Q`J*RPM+B]*2TQ- +M3D]0:FML;6YO<(J+C(V.CY"JJZRMKJ^PR\S-SL_0T=+3U-76U]C9VMO79Y;WEI>7UW=G=O=VEW?75V=6]U:75]R%T(8\%AP5_!7@%CP.'`W\#>`-] +M>79Y;WEI>7UW=G=O=VEW?75V=6]U:75]4-R0VQ#9D-Y07)!;$%F07HEB-S(VTC9R-Z(7,A;2%G(7T%=@5O!6D%?0-V`V\#:0-]>79Y;WEI>7UW=G=O +M=VEW?75V=6]U:75]7EY8!W>7=R=VQW@'5Y=7)U;'6` +M7%R<6QQ@&]Y;W)O;&^`;7EM6MR:VQK@&EY:7)I +M;&F`9WEG65R96QE@&-Y8W)C;&.`87EA$5Q16M%?T-X +M0W%#:T-_07A!<4%K080E?25V)6\EA"-](W8C;R.$(7TA=B%O(8<%?P5X!7(% +MAP-_`W@#<@,``````````-#0NKFWM[BWN`````````#OOJW>[[ZMWN^^K=[O +MOJW>``````````"````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````/\```````````````````#__P``7#```'`P``"$ +M,```%#````PP```<,```B"\``(`O``#TZ0``/.8``#CG``"DYP``Q.8``"3G +M``"$YP``:.H``!#Q``!D\0``-/(``*#R``#(\0``$/(``(SR```,YP``\.8` +M`##F``!`Z@`````````````"`@7_`@,```(!`0$#`P#_`P$!`0,``@(#`@4& +M```"_P````,```$#``$$!``#`P4``@4&`0$!_P$``@(!`P`%`0(%!@`````` +M`````````&PQ`@`&````!````"!S@`````````````````!\,0(`!0````0` +M```@ 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 B90E29AC30F; Sat, 8 Aug 2015 06:08:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AA26C1C65; Sat, 8 Aug 2015 06:08:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7868LUf072606; Sat, 8 Aug 2015 06:08:21 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7868L2Q072605; Sat, 8 Aug 2015 06:08:21 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508080608.t7868L2Q072605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 06:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286442 - head/sys/modules/iwmfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 06:08:21 -0000 Author: rpaulo Date: Sat Aug 8 06:08:20 2015 New Revision: 286442 URL: https://svnweb.freebsd.org/changeset/base/286442 Log: iwmfw: fix the path to the firmware file. Modified: head/sys/modules/iwmfw/Makefile.inc Modified: head/sys/modules/iwmfw/Makefile.inc ============================================================================== --- head/sys/modules/iwmfw/Makefile.inc Sat Aug 8 06:06:48 2015 (r286441) +++ head/sys/modules/iwmfw/Makefile.inc Sat Aug 8 06:08:20 2015 (r286442) @@ -14,5 +14,5 @@ FIRMWS= ${_FIRM}:${KMOD} # #FIRMWARE_LICENSE= -${_FIRM}: ${.CURDIR}/${_FIRM}.uu +${_FIRM}: ${.CURDIR}/../../../contrib/dev/iwm/${_FIRM}.uu uudecode -p $? > ${.TARGET} From owner-svn-src-head@freebsd.org Sat Aug 8 08:40:38 2015 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 6A6A49B325F; Sat, 8 Aug 2015 08:40:38 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 58C6215CA; Sat, 8 Aug 2015 08:40:38 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t788ecIo036291; Sat, 8 Aug 2015 08:40:38 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t788ebXb036287; Sat, 8 Aug 2015 08:40:37 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508080840.t788ebXb036287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Sat, 8 Aug 2015 08:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286443 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 08:40:38 -0000 Author: jch Date: Sat Aug 8 08:40:36 2015 New Revision: 286443 URL: https://svnweb.freebsd.org/changeset/base/286443 Log: Fix a kernel assertion issue introduced with r286227: Avoid too strict INP_INFO_RLOCK_ASSERT checks due to tcp_notify() being called from in6_pcbnotify(). Reported by: Larry Rosenman Submitted by: markj, jch Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sat Aug 8 06:08:20 2015 (r286442) +++ head/sys/netinet/in_pcb.c Sat Aug 8 08:40:36 2015 (r286443) @@ -1259,7 +1259,7 @@ in_pcbfree(struct inpcb *inp) #ifdef INVARIANTS if (pcbinfo == &V_tcbinfo) { - INP_INFO_RLOCK_ASSERT(pcbinfo); + INP_INFO_LOCK_ASSERT(pcbinfo); } else { INP_INFO_WLOCK_ASSERT(pcbinfo); } Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sat Aug 8 06:08:20 2015 (r286442) +++ head/sys/netinet/in_pcb.h Sat Aug 8 08:40:36 2015 (r286443) @@ -491,6 +491,7 @@ short inp_so_options(const struct inpcb #define INP_INFO_TRY_RLOCK(ipi) rw_try_rlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_WLOCK(ipi) rw_try_wlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_UPGRADE(ipi) rw_try_upgrade(&(ipi)->ipi_lock) +#define INP_INFO_WLOCKED(ipi) rw_wowned(&(ipi)->ipi_lock) #define INP_INFO_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_lock) #define INP_INFO_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_lock) #define INP_INFO_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_LOCKED) Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Aug 8 06:08:20 2015 (r286442) +++ head/sys/netinet/tcp_subr.c Sat Aug 8 08:40:36 2015 (r286443) @@ -906,7 +906,7 @@ tcp_drop(struct tcpcb *tp, int errno) { struct socket *so = tp->t_inpcb->inp_socket; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); if (TCPS_HAVERCVDSYN(tp->t_state)) { @@ -1108,7 +1108,7 @@ tcp_close(struct tcpcb *tp) struct inpcb *inp = tp->t_inpcb; struct socket *so; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); #ifdef TCP_OFFLOAD @@ -1186,7 +1186,7 @@ tcp_notify(struct inpcb *inp, int error) { struct tcpcb *tp; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sat Aug 8 06:08:20 2015 (r286442) +++ head/sys/netinet/tcp_usrreq.c Sat Aug 8 08:40:36 2015 (r286443) @@ -163,7 +163,7 @@ tcp_detach(struct socket *so, struct inp { struct tcpcb *tp; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); KASSERT(so->so_pcb == inp, ("tcp_detach: so_pcb != inp")); @@ -241,15 +241,20 @@ static void tcp_usr_detach(struct socket *so) { struct inpcb *inp; + int rlock = 0; inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL")); - INP_INFO_RLOCK(&V_tcbinfo); + if (!INP_INFO_WLOCKED(&V_tcbinfo)) { + INP_INFO_RLOCK(&V_tcbinfo); + rlock = 1; + } INP_WLOCK(inp); KASSERT(inp->inp_socket != NULL, ("tcp_usr_detach: inp_socket == NULL")); tcp_detach(so, inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + if (rlock) + INP_INFO_RUNLOCK(&V_tcbinfo); } #ifdef INET From owner-svn-src-head@freebsd.org Sat Aug 8 09:51:41 2015 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 5644D9B54C6; Sat, 8 Aug 2015 09:51:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3EFB41C2A; Sat, 8 Aug 2015 09:51:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t789pfCF066391; Sat, 8 Aug 2015 09:51:41 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t789pd6k066384; Sat, 8 Aug 2015 09:51:39 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201508080951.t789pd6k066384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sat, 8 Aug 2015 09:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286444 - in head: sbin/geom/class/eli sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 09:51:41 -0000 Author: pjd Date: Sat Aug 8 09:51:38 2015 New Revision: 286444 URL: https://svnweb.freebsd.org/changeset/base/286444 Log: Enable BIO_DELETE passthru in GELI, so TRIM/UNMAP can work as expected when GELI is used on a SSD or inside virtual machine, so that guest can tell host that it is no longer using some of the storage. Enabling BIO_DELETE passthru comes with a small security consequence - an attacker can tell how much space is being really used on encrypted device and has less data no analyse then. This is why the -T option can be given to the init subcommand to turn off this behaviour and -t/T options for the configure subcommand can be used to adjust this setting later. PR: 198863 Submitted by: Matthew D. Fuller fullermd at over-yonder dot net This commit also includes a fix from Fabian Keil freebsd-listen at fabiankeil.de for 'configure' on onetime providers which is not strictly related, but is entangled in the same code, so would cause conflicts if separated out. Modified: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_ctl.c Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sat Aug 8 08:40:36 2015 (r286443) +++ head/sbin/geom/class/eli/geli.8 Sat Aug 8 09:51:38 2015 (r286444) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2015 +.Dd July 10, 2015 .Dt GELI 8 .Os .Sh NAME @@ -51,7 +51,7 @@ utility: .Pp .Nm .Cm init -.Op Fl bPv +.Op Fl bPTv .Op Fl a Ar aalgo .Op Fl B Ar backupfile .Op Fl e Ar ealgo @@ -80,7 +80,7 @@ utility: .Cm detach .Nm .Cm onetime -.Op Fl d +.Op Fl dT .Op Fl a Ar aalgo .Op Fl e Ar ealgo .Op Fl l Ar keylen @@ -88,7 +88,7 @@ utility: .Ar prov .Nm .Cm configure -.Op Fl bB +.Op Fl bBtT .Ar prov ... .Nm .Cm setkey @@ -351,6 +351,17 @@ Change decrypted provider's sector size. Increasing the sector size allows increased performance, because encryption/decryption which requires an initialization vector is done per sector; fewer sectors means less computational work. +.It Fl T +Don't pass through +.Dv BIO_DELETE +calls (i.e., TRIM/UNMAP). +This can prevent an attacker from knowing how much space you're actually +using and which sectors contain live data, but will also prevent the +backing store (SSD, etc) from reclaiming space you're not using, which +may degrade its performance and lifespan. +The underlying provider may or may not actually obliterate the deleted +sectors when TRIM is enabled, so it should not be considered to add any +security. .It Fl V Ar version Metadata version to use. This option is helpful when creating a provider that may be used by older @@ -456,6 +467,11 @@ Change decrypted provider's sector size. For more information, see the description of the .Cm init subcommand. +.It Fl T +Disable TRIM/UNMAP passthru. +For more information, see the description of the +.Cm init +subcommand. .El .It Cm configure Change configuration of the given providers. @@ -469,6 +485,13 @@ For more information, see the descriptio subcommand. .It Fl B Remove the BOOT flag from the given providers. +.It Fl t +Enable TRIM/UNMAP passthru. +For more information, see the description of the +.Cm init +subcommand. +.It Fl T +Disable TRIM/UNMAP passthru. .El .It Cm setkey Install a copy of the Master Key into the selected slot, encrypted with Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Sat Aug 8 08:40:36 2015 (r286443) +++ head/sbin/geom/class/eli/geom_eli.c Sat Aug 8 09:51:38 2015 (r286444) @@ -114,10 +114,11 @@ struct g_command class_commands[] = { { 'l', "keylen", "0", G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, { 's', "sectorsize", "0", G_TYPE_NUMBER }, + { 'T', "notrim", NULL, G_TYPE_BOOL }, { 'V', "mdversion", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" + "[-bPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" }, { "label", G_FLAG_VERBOSE, eli_main, { @@ -170,17 +171,20 @@ struct g_command class_commands[] = { { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'l', "keylen", "0", G_TYPE_NUMBER }, { 's', "sectorsize", "0", G_TYPE_NUMBER }, + { 'T', "notrim", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov" + "[-dT] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov" }, { "configure", G_FLAG_VERBOSE, eli_main, { { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "noboot", NULL, G_TYPE_BOOL }, + { 't', "trim", NULL, G_TYPE_BOOL }, + { 'T', "notrim", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-bB] prov ..." + "[-bBtT] prov ..." }, { "setkey", G_FLAG_VERBOSE, eli_main, { @@ -698,6 +702,8 @@ eli_init(struct gctl_req *req) md.md_flags = 0; if (gctl_get_int(req, "boot")) md.md_flags |= G_ELI_FLAG_BOOT; + if (gctl_get_int(req, "notrim")) + md.md_flags |= G_ELI_FLAG_NODELETE; md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; str = gctl_get_ascii(req, "aalgo"); if (*str != '\0') { @@ -899,26 +905,45 @@ eli_attach(struct gctl_req *req) } static void -eli_configure_detached(struct gctl_req *req, const char *prov, bool boot) +eli_configure_detached(struct gctl_req *req, const char *prov, int boot, + int trim) { struct g_eli_metadata md; + bool changed = 0; if (eli_metadata_read(req, prov, &md) == -1) return; - if (boot && (md.md_flags & G_ELI_FLAG_BOOT)) { + if (boot == 1 && (md.md_flags & G_ELI_FLAG_BOOT)) { if (verbose) printf("BOOT flag already configured for %s.\n", prov); - } else if (!boot && !(md.md_flags & G_ELI_FLAG_BOOT)) { + } else if (boot == 0 && !(md.md_flags & G_ELI_FLAG_BOOT)) { if (verbose) printf("BOOT flag not configured for %s.\n", prov); - } else { + } else if (boot >= 0) { if (boot) md.md_flags |= G_ELI_FLAG_BOOT; else md.md_flags &= ~G_ELI_FLAG_BOOT; - eli_metadata_store(req, prov, &md); + changed = 1; + } + + if (trim == 0 && (md.md_flags & G_ELI_FLAG_NODELETE)) { + if (verbose) + printf("TRIM disable flag already configured for %s.\n", prov); + } else if (trim == 1 && !(md.md_flags & G_ELI_FLAG_NODELETE)) { + if (verbose) + printf("TRIM disable flag not configured for %s.\n", prov); + } else if (trim >= 0) { + if (trim) + md.md_flags &= ~G_ELI_FLAG_NODELETE; + else + md.md_flags |= G_ELI_FLAG_NODELETE; + changed = 1; } + + if (changed) + eli_metadata_store(req, prov, &md); bzero(&md, sizeof(md)); } @@ -926,7 +951,8 @@ static void eli_configure(struct gctl_req *req) { const char *prov; - bool boot, noboot; + bool boot, noboot, trim, notrim; + int doboot, dotrim; int i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -937,12 +963,30 @@ eli_configure(struct gctl_req *req) boot = gctl_get_int(req, "boot"); noboot = gctl_get_int(req, "noboot"); + trim = gctl_get_int(req, "trim"); + notrim = gctl_get_int(req, "notrim"); + doboot = -1; if (boot && noboot) { gctl_error(req, "Options -b and -B are mutually exclusive."); return; } - if (!boot && !noboot) { + if (boot) + doboot = 1; + else if (noboot) + doboot = 0; + + dotrim = -1; + if (trim && notrim) { + gctl_error(req, "Options -t and -T are mutually exclusive."); + return; + } + if (trim) + dotrim = 1; + else if (notrim) + dotrim = 0; + + if (doboot == -1 && dotrim == -1) { gctl_error(req, "No option given."); return; } @@ -953,7 +997,7 @@ eli_configure(struct gctl_req *req) for (i = 0; i < nargs; i++) { prov = gctl_get_ascii(req, "arg%d", i); if (!eli_is_attached(prov)) - eli_configure_detached(req, prov, boot); + eli_configure_detached(req, prov, doboot, dotrim); } } Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat Aug 8 08:40:36 2015 (r286443) +++ head/sys/geom/eli/g_eli.c Sat Aug 8 09:51:38 2015 (r286444) @@ -312,10 +312,15 @@ g_eli_start(struct bio *bp) break; case BIO_DELETE: /* - * We could eventually support BIO_DELETE request. - * It could be done by overwritting requested sector with - * random data g_eli_overwrites number of times. + * If the user hasn't set the NODELETE flag, we just pass + * it down the stack and let the layers beneath us do (or + * not) whatever they do with it. If they have, we + * reject it. A possible extension would be an + * additional flag to take it as a hint to shred the data + * with [multiple?] overwrites. */ + if (!(sc->sc_flags & G_ELI_FLAG_NODELETE)) + break; default: g_io_deliver(bp, EOPNOTSUPP); return; @@ -342,6 +347,7 @@ g_eli_start(struct bio *bp) break; case BIO_GETATTR: case BIO_FLUSH: + case BIO_DELETE: cbp->bio_done = g_std_done; cp = LIST_FIRST(&sc->sc_geom->consumer); cbp->bio_to = cp->provider; @@ -1255,6 +1261,7 @@ g_eli_dumpconf(struct sbuf *sb, const ch ADD_FLAG(G_ELI_FLAG_WOPEN, "W-OPEN"); ADD_FLAG(G_ELI_FLAG_DESTROY, "DESTROY"); ADD_FLAG(G_ELI_FLAG_RO, "READ-ONLY"); + ADD_FLAG(G_ELI_FLAG_NODELETE, "NODELETE"); #undef ADD_FLAG } sbuf_printf(sb, "\n"); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sat Aug 8 08:40:36 2015 (r286443) +++ head/sys/geom/eli/g_eli.h Sat Aug 8 09:51:38 2015 (r286444) @@ -94,6 +94,8 @@ #define G_ELI_FLAG_AUTH 0x00000010 /* Provider is read-only, we should deny all write attempts. */ #define G_ELI_FLAG_RO 0x00000020 +/* Don't pass through BIO_DELETE requests. */ +#define G_ELI_FLAG_NODELETE 0x00000040 /* RUNTIME FLAGS. */ /* Provider was open for writing. */ #define G_ELI_FLAG_WOPEN 0x00010000 Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sat Aug 8 08:40:36 2015 (r286443) +++ head/sys/geom/eli/g_eli_ctl.c Sat Aug 8 09:51:38 2015 (r286444) @@ -236,7 +236,7 @@ g_eli_ctl_onetime(struct gctl_req *req, const char *name; intmax_t *keylen, *sectorsize; u_char mkey[G_ELI_DATAIVKEYLEN]; - int *nargs, *detach; + int *nargs, *detach, *notrim; g_topology_assert(); bzero(&md, sizeof(md)); @@ -251,17 +251,16 @@ g_eli_ctl_onetime(struct gctl_req *req, return; } - detach = gctl_get_paraml(req, "detach", sizeof(*detach)); - if (detach == NULL) { - gctl_error(req, "No '%s' argument.", "detach"); - return; - } - strlcpy(md.md_magic, G_ELI_MAGIC, sizeof(md.md_magic)); md.md_version = G_ELI_VERSION; md.md_flags |= G_ELI_FLAG_ONETIME; - if (*detach) + + detach = gctl_get_paraml(req, "detach", sizeof(*detach)); + if (detach != NULL && *detach) md.md_flags |= G_ELI_FLAG_WO_DETACH; + notrim = gctl_get_paraml(req, "notrim", sizeof(*notrim)); + if (notrim != NULL && *notrim) + md.md_flags |= G_ELI_FLAG_NODELETE; md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; name = gctl_get_asciiparam(req, "aalgo"); @@ -377,12 +376,15 @@ g_eli_ctl_configure(struct gctl_req *req char param[16]; const char *prov; u_char *sector; - int *nargs, *boot, *noboot; - int error; + int *nargs, *boot, *noboot, *trim, *notrim; + int zero, error, changed; u_int i; g_topology_assert(); + changed = 0; + zero = 0; + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { gctl_error(req, "No '%s' argument.", "nargs"); @@ -394,20 +396,32 @@ g_eli_ctl_configure(struct gctl_req *req } boot = gctl_get_paraml(req, "boot", sizeof(*boot)); - if (boot == NULL) { - gctl_error(req, "No '%s' argument.", "boot"); - return; - } + if (boot == NULL) + boot = &zero; noboot = gctl_get_paraml(req, "noboot", sizeof(*noboot)); - if (noboot == NULL) { - gctl_error(req, "No '%s' argument.", "noboot"); - return; - } + if (noboot == NULL) + noboot = &zero; if (*boot && *noboot) { gctl_error(req, "Options -b and -B are mutually exclusive."); return; } - if (!*boot && !*noboot) { + if (*boot || *noboot) + changed = 1; + + trim = gctl_get_paraml(req, "trim", sizeof(*trim)); + if (trim == NULL) + trim = &zero; + notrim = gctl_get_paraml(req, "notrim", sizeof(*notrim)); + if (notrim == NULL) + notrim = &zero; + if (*trim && *notrim) { + gctl_error(req, "Options -t and -T are mutually exclusive."); + return; + } + if (*trim || *notrim) + changed = 1; + + if (!changed) { gctl_error(req, "No option given."); return; } @@ -429,38 +443,72 @@ g_eli_ctl_configure(struct gctl_req *req "provider %s.", prov); continue; } + if (sc->sc_flags & G_ELI_FLAG_RO) { + gctl_error(req, "Cannot change configuration of " + "read-only provider %s.", prov); + continue; + } + if (*boot && (sc->sc_flags & G_ELI_FLAG_BOOT)) { G_ELI_DEBUG(1, "BOOT flag already configured for %s.", prov); continue; - } else if (!*boot && !(sc->sc_flags & G_ELI_FLAG_BOOT)) { + } else if (*noboot && !(sc->sc_flags & G_ELI_FLAG_BOOT)) { G_ELI_DEBUG(1, "BOOT flag not configured for %s.", prov); continue; } - if (sc->sc_flags & G_ELI_FLAG_RO) { - gctl_error(req, "Cannot change configuration of " - "read-only provider %s.", prov); + + if (*notrim && (sc->sc_flags & G_ELI_FLAG_NODELETE)) { + G_ELI_DEBUG(1, "TRIM disable flag already configured for %s.", + prov); continue; - } - cp = LIST_FIRST(&sc->sc_geom->consumer); - pp = cp->provider; - error = g_eli_read_metadata(mp, pp, &md); - if (error != 0) { - gctl_error(req, - "Cannot read metadata from %s (error=%d).", - prov, error); + } else if (*trim && !(sc->sc_flags & G_ELI_FLAG_NODELETE)) { + G_ELI_DEBUG(1, "TRIM disable flag not configured for %s.", + prov); continue; } + if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) { + /* + * ONETIME providers don't write metadata to + * disk, so don't try reading it. This means + * we're bit-flipping uninitialized memory in md + * below, but that's OK; we don't do anything + * with it later. + */ + cp = LIST_FIRST(&sc->sc_geom->consumer); + pp = cp->provider; + error = g_eli_read_metadata(mp, pp, &md); + if (error != 0) { + gctl_error(req, + "Cannot read metadata from %s (error=%d).", + prov, error); + continue; + } + } + if (*boot) { md.md_flags |= G_ELI_FLAG_BOOT; sc->sc_flags |= G_ELI_FLAG_BOOT; - } else { + } else if (*noboot) { md.md_flags &= ~G_ELI_FLAG_BOOT; sc->sc_flags &= ~G_ELI_FLAG_BOOT; } + if (*notrim) { + md.md_flags |= G_ELI_FLAG_NODELETE; + sc->sc_flags |= G_ELI_FLAG_NODELETE; + } else if (*trim) { + md.md_flags &= ~G_ELI_FLAG_NODELETE; + sc->sc_flags &= ~G_ELI_FLAG_NODELETE; + } + + if (sc->sc_flags & G_ELI_FLAG_ONETIME) { + /* There's no metadata on disk so we are done here. */ + continue; + } + sector = malloc(pp->sectorsize, M_ELI, M_WAITOK | M_ZERO); eli_metadata_encode(&md, sector); error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector, From owner-svn-src-head@freebsd.org Sat Aug 8 09:57:40 2015 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 6D1A89B5618; Sat, 8 Aug 2015 09:57:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3C6EE1F16; Sat, 8 Aug 2015 09:57:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t789vedY066747; Sat, 8 Aug 2015 09:57:40 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t789vdX3066745; Sat, 8 Aug 2015 09:57:39 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201508080957.t789vdX3066745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sat, 8 Aug 2015 09:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286445 - in head: sbin/swapon share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 09:57:40 -0000 Author: pjd Date: Sat Aug 8 09:57:38 2015 New Revision: 286445 URL: https://svnweb.freebsd.org/changeset/base/286445 Log: Allow to disable BIO_DELETE passthru in fstab for swap-on-geli devices by passing 'notrim' option. PR: 198863 Submitted by: Matthew D. Fuller fullermd at over-yonder dot net Modified: head/sbin/swapon/swapon.c head/share/man/man5/fstab.5 Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Aug 8 09:51:38 2015 (r286444) +++ head/sbin/swapon/swapon.c Sat Aug 8 09:57:38 2015 (r286445) @@ -313,7 +313,7 @@ static char * swap_on_geli_args(const char *mntops) { const char *aalgo, *ealgo, *keylen_str, *sectorsize_str; - const char *aflag, *eflag, *lflag, *sflag; + const char *aflag, *eflag, *lflag, *Tflag, *sflag; char *p, *args, *token, *string, *ops; int argsize, pagesize; size_t pagesize_len; @@ -321,7 +321,7 @@ swap_on_geli_args(const char *mntops) /* Use built-in defaults for geli(8). */ aalgo = ealgo = keylen_str = ""; - aflag = eflag = lflag = ""; + aflag = eflag = lflag = Tflag = ""; /* We will always specify sectorsize. */ sflag = " -s "; @@ -365,6 +365,8 @@ swap_on_geli_args(const char *mntops) free(ops); return (NULL); } + } else if ((p = strstr(token, "notrim")) == token) { + Tflag = " -T "; } else if (strcmp(token, "sw") != 0) { warnx("Invalid option: %s", token); free(ops); @@ -387,8 +389,8 @@ swap_on_geli_args(const char *mntops) sectorsize_str = p; } - argsize = asprintf(&args, "%s%s%s%s%s%s%s%s -d", - aflag, aalgo, eflag, ealgo, lflag, keylen_str, + argsize = asprintf(&args, "%s%s%s%s%s%s%s%s%s -d", + aflag, aalgo, eflag, ealgo, lflag, keylen_str, Tflag, sflag, sectorsize_str); free(ops); Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Sat Aug 8 09:51:38 2015 (r286444) +++ head/share/man/man5/fstab.5 Sat Aug 8 09:57:38 2015 (r286445) @@ -242,6 +242,7 @@ The .Dq ealgo , .Dq aalgo , .Dq keylen , +.Dq notrim , and .Dq sectorsize options may be passed to control those From owner-svn-src-head@freebsd.org Sat Aug 8 10:38:39 2015 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 026BB9B507B; Sat, 8 Aug 2015 10:38:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E78CB13DC; Sat, 8 Aug 2015 10:38:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78Acc7o083176; Sat, 8 Aug 2015 10:38:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78AccbQ083175; Sat, 8 Aug 2015 10:38:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508081038.t78AccbQ083175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 8 Aug 2015 10:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286446 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 10:38:39 -0000 Author: trasz Date: Sat Aug 8 10:38:37 2015 New Revision: 286446 URL: https://svnweb.freebsd.org/changeset/base/286446 Log: Fix interaction between libedit initialization and Capsicum in units(1). The most visible is the removal of libedit warnings about being unable to open termcap database. Reviewed by: eadler@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3322 Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sat Aug 8 09:57:38 2015 (r286445) +++ head/usr.bin/units/units.c Sat Aug 8 10:38:37 2015 (r286446) @@ -802,10 +802,10 @@ main(int argc, char **argv) if (!readfile) readunits(NULL); - if (cap_enter() < 0 && errno != ENOSYS) - err(1, "unable to enter capability mode"); - if (optind == argc - 2) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + havestr = argv[optind]; wantstr = argv[optind + 1]; initializeunit(&have); @@ -815,8 +815,7 @@ main(int argc, char **argv) addunit(&want, wantstr, 0, 1); completereduce(&want); showanswer(&have, &want); - } - else { + } else { inhistory = history_init(); el = el_init(argv[0], stdin, stdout, stderr); el_set(el, EL_PROMPT, &prompt); @@ -828,6 +827,9 @@ main(int argc, char **argv) if (inhistory == 0) err(1, "Could not initialize history"); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + if (!quiet) printf("%d units, %d prefixes\n", unitcount, prefixcount); From owner-svn-src-head@freebsd.org Sat Aug 8 11:22:46 2015 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 A467D9B5E8F; Sat, 8 Aug 2015 11:22:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9595FC44; Sat, 8 Aug 2015 11:22:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78BMkHJ003609; Sat, 8 Aug 2015 11:22:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78BMkfe003608; Sat, 8 Aug 2015 11:22:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508081122.t78BMkfe003608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Aug 2015 11:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286447 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 11:22:46 -0000 Author: mav Date: Sat Aug 8 11:22:45 2015 New Revision: 286447 URL: https://svnweb.freebsd.org/changeset/base/286447 Log: Don't panic if disk lost TRIM support due to switching to PIO mode. MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Aug 8 10:38:37 2015 (r286446) +++ head/sys/cam/ata/ata_da.c Sat Aug 8 11:22:45 2015 (r286447) @@ -767,10 +767,6 @@ adastrategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ if (bp->bio_cmd == BIO_DELETE) { - KASSERT((softc->flags & ADA_FLAG_CAN_TRIM) || - ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT)), - ("BIO_DELETE but no supported TRIM method.")); bioq_disksort(&softc->trim_queue, bp); } else { if (ADA_SIO) @@ -1544,7 +1540,14 @@ adastart(struct cam_periph *periph, unio !(softc->flags & ADA_FLAG_CAN_48BIT)) { ada_cfaerase(softc, bp, ataio); } else { - panic("adastart: BIO_DELETE without method, not possible."); + /* This can happen if DMA was disabled. */ + bioq_remove(&softc->trim_queue, bp); + bp->bio_error = EOPNOTSUPP; + bp->bio_flags |= BIO_ERROR; + biodone(bp); + xpt_release_ccb(start_ccb); + adaschedule(periph); + return; } softc->trim_running = 1; start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; From owner-svn-src-head@freebsd.org Sat Aug 8 11:48:13 2015 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 146CB9B63CE; Sat, 8 Aug 2015 11:48:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 04AD6189E; Sat, 8 Aug 2015 11:48:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78BmCIK012234; Sat, 8 Aug 2015 11:48:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78BmC3F012231; Sat, 8 Aug 2015 11:48:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508081148.t78BmC3F012231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Aug 2015 11:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286448 - in head/sys: dev/ata dev/ata/chipsets 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.20 Precedence: list List-Id: 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, 08 Aug 2015 11:48:13 -0000 Author: mav Date: Sat Aug 8 11:48:11 2015 New Revision: 286448 URL: https://svnweb.freebsd.org/changeset/base/286448 Log: Disable 32-bit PIO for 6Gbit/s Intel SATA controllers. For some reason 32-bit PIO writes are not working on 6Gbit/s Intel SATA ports, while 16/32-bit PIO reads and 16-bit PIO writes are working fine. 3Gbit/s ports on the same controllers have no this problem. Workaround this by disabling 32-bit PIO for all Intel controllers that may have 6Gbit/s ports. It halves PIO performance from 6MB/s to 3MB/s, but who bother about speed of such rare and slow mode, which is also highly discouraged by SATA specifications? MFC after: 2 weeks Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/sys/ata.h Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Aug 8 11:22:45 2015 (r286447) +++ head/sys/dev/ata/ata-all.c Sat Aug 8 11:48:11 2015 (r286448) @@ -572,6 +572,7 @@ ata_mode2str(int mode) case ATA_UDMA6: return "UDMA133"; case ATA_SA150: return "SATA150"; case ATA_SA300: return "SATA300"; + case ATA_SA600: return "SATA600"; default: if (mode & ATA_DMA_MASK) return "BIOSDMA"; Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sat Aug 8 11:22:45 2015 (r286447) +++ head/sys/dev/ata/chipsets/ata-intel.c Sat Aug 8 11:48:11 2015 (r286448) @@ -155,34 +155,34 @@ ata_intel_probe(device_t dev) { ATA_5Series_S4, 0, INTEL_6CH, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S5, 0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series PCH" }, { ATA_5Series_S6, 0, INTEL_6CH, 0, ATA_SA300, "5 Series/3400 Series PCH" }, - { ATA_CPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Cougar Point" }, - { ATA_CPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Cougar Point" }, + { ATA_CPT_S1, 0, INTEL_6CH, 0, ATA_SA600, "Cougar Point" }, + { ATA_CPT_S2, 0, INTEL_6CH, 0, ATA_SA600, "Cougar Point" }, { ATA_CPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Cougar Point" }, { ATA_CPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Cougar Point" }, - { ATA_PBG_S1, 0, INTEL_6CH, 0, ATA_SA300, "Patsburg" }, + { ATA_PBG_S1, 0, INTEL_6CH, 0, ATA_SA600, "Patsburg" }, { ATA_PBG_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Patsburg" }, - { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, - { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA600, "Panther Point" }, + { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA600, "Panther Point" }, { ATA_PPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, - { ATA_AVOTON_S1, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, - { ATA_AVOTON_S2, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, + { ATA_AVOTON_S1, 0, INTEL_6CH, 0, ATA_SA600, "Avoton" }, + { ATA_AVOTON_S2, 0, INTEL_6CH, 0, ATA_SA600, "Avoton" }, { ATA_AVOTON_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, { ATA_AVOTON_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, - { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, - { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, - { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, - { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, - { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, - { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, - { ATA_WELLS_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, - { ATA_LPTLP_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point-LP" }, - { ATA_LPTLP_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point-LP" }, + { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA600, "Lynx Point" }, + { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA600, "Lynx Point" }, + { ATA_LPT_S3, 0, INTEL_6CH2, 0, ATA_SA600, "Lynx Point" }, + { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA600, "Lynx Point" }, + { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA600, "Wildcat Point" }, + { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA600, "Wildcat Point" }, + { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA600, "Wildcat Point" }, + { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA600, "Wildcat Point" }, + { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA600, "Wellsburg" }, + { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA600, "Wellsburg" }, + { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA600, "Wellsburg" }, + { ATA_WELLS_S4, 0, INTEL_6CH2, 0, ATA_SA600, "Wellsburg" }, + { ATA_LPTLP_S1, 0, INTEL_6CH, 0, ATA_SA600, "Lynx Point-LP" }, + { ATA_LPTLP_S2, 0, INTEL_6CH, 0, ATA_SA600, "Lynx Point-LP" }, { ATA_LPTLP_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point-LP" }, { ATA_LPTLP_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point-LP" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, @@ -394,6 +394,8 @@ ata_intel_ch_attach(device_t dev) } } else ctlr->setmode = ata_intel_new_setmode; + if (ctlr->chip->max_dma >= ATA_SA600) + ch->flags |= ATA_USE_16BIT; } else if (ctlr->chip->chipid != ATA_ISCH) ch->flags |= ATA_CHECKS_CABLE; return (0); Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Sat Aug 8 11:22:45 2015 (r286447) +++ head/sys/sys/ata.h Sat Aug 8 11:48:11 2015 (r286448) @@ -335,6 +335,7 @@ struct ata_params { #define ATA_UDMA6 0x46 #define ATA_SA150 0x47 #define ATA_SA300 0x48 +#define ATA_SA600 0x49 #define ATA_DMA_MAX 0x4f From owner-svn-src-head@freebsd.org Sat Aug 8 13:23:10 2015 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 04AF49B5AEC; Sat, 8 Aug 2015 13:23:10 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2C233A; Sat, 8 Aug 2015 13:23:09 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 5B094358C62; Sat, 8 Aug 2015 15:23:05 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 2A2E328494; Sat, 8 Aug 2015 15:23:05 +0200 (CEST) Date: Sat, 8 Aug 2015 15:23:05 +0200 From: Jilles Tjoelker To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284162 - head/bin/ls Message-ID: <20150808132304.GA97913@stack.nl> References: <201506081913.t58JD5KX090442@svn.freebsd.org> <20150619215423.GA34741@stack.nl> <20150719130012.GA23514@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150719130012.GA23514@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 13:23:10 -0000 On Sun, Jul 19, 2015 at 03:00:12PM +0200, Jilles Tjoelker wrote: > On Fri, Jun 19, 2015 at 11:54:23PM +0200, Jilles Tjoelker wrote: > > On Mon, Jun 08, 2015 at 07:13:05PM +0000, Xin LI wrote: > > > Author: delphij > > > Date: Mon Jun 8 19:13:04 2015 > > > New Revision: 284162 > > > URL: https://svnweb.freebsd.org/changeset/base/284162 > > > Log: > > > It has been long time that when doing 'ls -G /path/to/a/symlink', > > > instead of using the color of symbolic link, the color is > > > determined by the link target. This behavior was quite confusing. > > > Looking at the file history, it looks like that r203665 intends to > > > fix this but the issue was never actually fixed. > > > Fix this by not setting FTS_COMFOLLOW when color is requested like > > > what was done in r203665. > > > MFC after: 2 weeks > > > Modified: > > > head/bin/ls/ls.c > > Hmm. This makes -G or CLICOLOR env behave like -F in that symlinks are > > no longer followed by default. This at least needs a change in the man > > page to document it, and I'm not sure whether -G should actually modify > > ls's action beyond adding colour. > > For example, in stable/10 doing ls /sys, ls -p /sys and ls -G /sys show > > a directory listing of the kernel source, while ls -F /sys shows just > > the symlink. > > What r203665 fixed was colour, inode number, etc. when -P was given and > > -F/-d/-l were not. > > I'll admit that this -F/-d/-l thing is bizarre but it has grown that way > > historically and I've found ls implementations that deviate from this > > annoying (e.g. on some embedded systems). > What's more, the behaviour even depends on TERM, leading to strange > things like: > $ TERM=dumb CLICOLOR=1 ls /sys > Makefile crypto libkern netsmb sparc64 > amd64 ddb mips nfs sys > arm dev modules nfsclient teken > arm64 fs net nfsserver tools > boot gdb net80211 nlm ufs > bsm geom netgraph ofed vm > cam gnu netinet opencrypto x86 > cddl i386 netinet6 pc98 xdr > compat isa netipsec powerpc xen > conf kern netnatm rpc > contrib kgssapi netpfil security > $ TERM=xterm CLICOLOR=1 ls /sys > /sys > $ > The bottommost /sys is purple. OK, I thought some more and looked at how GNU ls deals with this issue. My goal is to remain POSIX-compliant about following symlinks (ignoring colour) while still colouring a command line symlink to a non-directory as a symlink in the default mode. What makes this complicated are the -i, -p, -s, -S and -t options, which show stat information without disabling the implicit following of symlinks like -F and -l do. What GNU ls seems to do is not follow command line symlinks to non-directories. As a result, ls -i symlink_to_non_directory shows the symlink's inode number instead of the target's required by POSIX. This bug applies both in colour and non-colour mode. To avoid POSIX violations and keep the colour consistent with information shown by -i/-p/-s/-S/-t, we could revert r284162 and skip following command line symlinks to non-directories only if -i/-s/-S/-t are not given (-p only affects display of directories, so it is irrelevant here). This would involve adding an lstat() call to printaname() if p->fts_level == FTS_ROOTLEVEL and a flag set in ls.c is true. It would also require additions to the man page. An alternative is to revert r284162 and do nothing else. This does not require any man page changes but users may expect seeing symlink colour when listing a symlink to a non-directory in the default mode. What do you think? -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sat Aug 8 15:50:48 2015 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 1D4639B6287; Sat, 8 Aug 2015 15:50:48 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0B2971E92; Sat, 8 Aug 2015 15:50:48 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78FolPl018521; Sat, 8 Aug 2015 15:50:47 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78FolXr018517; Sat, 8 Aug 2015 15:50:47 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508081550.t78FolXr018517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 8 Aug 2015 15:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286450 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 15:50:48 -0000 Author: melifaro Date: Sat Aug 8 15:50:46 2015 New Revision: 286450 URL: https://svnweb.freebsd.org/changeset/base/286450 Log: Add const-qualifiers for source mbuf argument in m_dup(), m_copym(), m_dup_pkthdr() and m_tag_copy_chain(). Modified: head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat Aug 8 12:29:03 2015 (r286449) +++ head/sys/kern/uipc_mbuf.c Sat Aug 8 15:50:46 2015 (r286450) @@ -396,7 +396,7 @@ mb_free_ext(struct mbuf *m) * and bump the refcount of the cluster. */ static void -mb_dupcl(struct mbuf *n, struct mbuf *m) +mb_dupcl(struct mbuf *n, const struct mbuf *m) { KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); @@ -567,7 +567,7 @@ m_move_pkthdr(struct mbuf *to, struct mb * In particular, this does a deep copy of the packet tags. */ int -m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how) +m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, int how) { #if 0 @@ -631,7 +631,7 @@ m_prepend(struct mbuf *m, int len, int h * only their reference counts are incremented. */ struct mbuf * -m_copym(struct mbuf *m, int off0, int len, int wait) +m_copym(const struct mbuf *m, int off0, int len, int wait) { struct mbuf *n, **np; int off = off0; @@ -785,7 +785,7 @@ m_copydata(const struct mbuf *m, int off * you need a writable copy of an mbuf chain. */ struct mbuf * -m_dup(struct mbuf *m, int how) +m_dup(const struct mbuf *m, int how) { struct mbuf **p, *top = NULL; int remain, moff, nsize; Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Sat Aug 8 12:29:03 2015 (r286449) +++ head/sys/kern/uipc_mbuf2.c Sat Aug 8 15:50:46 2015 (r286450) @@ -427,7 +427,7 @@ m_tag_copy(struct m_tag *t, int how) * destination mbuf. */ int -m_tag_copy_chain(struct mbuf *to, struct mbuf *from, int how) +m_tag_copy_chain(struct mbuf *to, const struct mbuf *from, int how) { struct m_tag *p, *t, *tprev = NULL; Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 8 12:29:03 2015 (r286449) +++ head/sys/sys/mbuf.h Sat Aug 8 15:50:46 2015 (r286450) @@ -953,7 +953,7 @@ int m_extadd(struct mbuf *, caddr_t, u struct mbuf *m_collapse(struct mbuf *, int, int); void m_copyback(struct mbuf *, int, int, c_caddr_t); void m_copydata(const struct mbuf *, int, int, caddr_t); -struct mbuf *m_copym(struct mbuf *, int, int, int); +struct mbuf *m_copym(const struct mbuf *, int, int, int); struct mbuf *m_copypacket(struct mbuf *, int); void m_copy_pkthdr(struct mbuf *, struct mbuf *); struct mbuf *m_copyup(struct mbuf *, int, int); @@ -962,8 +962,8 @@ void m_demote_pkthdr(struct mbuf *); void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); -struct mbuf *m_dup(struct mbuf *, int); -int m_dup_pkthdr(struct mbuf *, struct mbuf *, int); +struct mbuf *m_dup(const struct mbuf *, int); +int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); @@ -1070,7 +1070,7 @@ void m_tag_delete_chain(struct mbuf *, void m_tag_free_default(struct m_tag *); struct m_tag *m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *); struct m_tag *m_tag_copy(struct m_tag *, int); -int m_tag_copy_chain(struct mbuf *, struct mbuf *, int); +int m_tag_copy_chain(struct mbuf *, const struct mbuf *, int); void m_tag_delete_nonpersistent(struct mbuf *); /* From owner-svn-src-head@freebsd.org Sat Aug 8 15:51:30 2015 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 9A0AB9B638B; Sat, 8 Aug 2015 15:51:30 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6EE62AE; Sat, 8 Aug 2015 15:51:30 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78FpURE019771; Sat, 8 Aug 2015 15:51:30 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78FpUbF019770; Sat, 8 Aug 2015 15:51:30 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201508081551.t78FpUbF019770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Sat, 8 Aug 2015 15:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286451 - head/tools/build/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.20 Precedence: list List-Id: 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, 08 Aug 2015 15:51:30 -0000 Author: garga (ports committer) Date: Sat Aug 8 15:51:29 2015 New Revision: 286451 URL: https://svnweb.freebsd.org/changeset/base/286451 Log: Add missing files to sendmail obsolete files list Approved by: gshapiro MFC after: 3 days Sponsored by: Netgate Differential Revision: https://reviews.freebsd.org/D3302 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 8 15:50:46 2015 (r286450) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 8 15:51:29 2015 (r286451) @@ -6458,6 +6458,7 @@ OLD_FILES+=usr/share/sendmail/cf/feature OLD_FILES+=usr/share/sendmail/cf/feature/always_add_domain.m4 OLD_FILES+=usr/share/sendmail/cf/feature/authinfo.m4 OLD_FILES+=usr/share/sendmail/cf/feature/badmx.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/bcc.m4 OLD_FILES+=usr/share/sendmail/cf/feature/bestmx_is_local.m4 OLD_FILES+=usr/share/sendmail/cf/feature/bitdomain.m4 OLD_FILES+=usr/share/sendmail/cf/feature/blacklist_recipients.m4 @@ -6485,9 +6486,11 @@ OLD_FILES+=usr/share/sendmail/cf/feature OLD_FILES+=usr/share/sendmail/cf/feature/mtamark.m4 OLD_FILES+=usr/share/sendmail/cf/feature/no_default_msa.m4 OLD_FILES+=usr/share/sendmail/cf/feature/nocanonify.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/nopercenthack.m4 OLD_FILES+=usr/share/sendmail/cf/feature/notsticky.m4 OLD_FILES+=usr/share/sendmail/cf/feature/nouucp.m4 OLD_FILES+=usr/share/sendmail/cf/feature/nullclient.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/prefixmod.m4 OLD_FILES+=usr/share/sendmail/cf/feature/preserve_local_plus_detail.m4 OLD_FILES+=usr/share/sendmail/cf/feature/preserve_luser_host.m4 OLD_FILES+=usr/share/sendmail/cf/feature/promiscuous_relay.m4 @@ -6502,6 +6505,7 @@ OLD_FILES+=usr/share/sendmail/cf/feature OLD_FILES+=usr/share/sendmail/cf/feature/require_rdns.m4 OLD_FILES+=usr/share/sendmail/cf/feature/smrsh.m4 OLD_FILES+=usr/share/sendmail/cf/feature/stickyhost.m4 +OLD_FILES+=usr/share/sendmail/cf/feature/tls_session_features.m4 OLD_FILES+=usr/share/sendmail/cf/feature/use_client_ptr.m4 OLD_FILES+=usr/share/sendmail/cf/feature/use_ct_file.m4 OLD_FILES+=usr/share/sendmail/cf/feature/use_cw_file.m4 @@ -6510,6 +6514,7 @@ OLD_FILES+=usr/share/sendmail/cf/feature OLD_FILES+=usr/share/sendmail/cf/feature/virtusertable.m4 OLD_DIRS+=usr/share/sendmail/cf/feature OLD_FILES+=usr/share/sendmail/cf/hack/cssubdomain.m4 +OLD_FILES+=usr/share/sendmail/cf/hack/xconnect.m4 OLD_DIRS+=usr/share/sendmail/cf/hack OLD_FILES+=usr/share/sendmail/cf/m4/cf.m4 OLD_FILES+=usr/share/sendmail/cf/m4/cfhead.m4 From owner-svn-src-head@freebsd.org Sat Aug 8 15:58:38 2015 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 1B7279B63DE; Sat, 8 Aug 2015 15:58:38 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 038A4381; Sat, 8 Aug 2015 15:58:38 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78FwbDk020317; Sat, 8 Aug 2015 15:58:37 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78FwaNX020312; Sat, 8 Aug 2015 15:58:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508081558.t78FwaNX020312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 8 Aug 2015 15:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286452 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 15:58:38 -0000 Author: melifaro Date: Sat Aug 8 15:58:35 2015 New Revision: 286452 URL: https://svnweb.freebsd.org/changeset/base/286452 Log: Simplify ip[6] simploop: Do not pass 'dst' sockaddr to ip[6]_mloopback: - We have explicit check for AF_INET in ip_output() - We assume ip header inside passed mbuf in ip_mloopback - We assume ip6 header inside passed mbuf in ip6_mloopback Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sat Aug 8 15:51:29 2015 (r286451) +++ head/sys/netinet/ip_output.c Sat Aug 8 15:58:35 2015 (r286452) @@ -99,8 +99,7 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, mbuf_ &mbuf_frag_size, 0, "Fragment outgoing mbufs to this size"); #endif -static void ip_mloopback - (struct ifnet *, struct mbuf *, struct sockaddr_in *, int); +static void ip_mloopback(struct ifnet *, const struct mbuf *, int); extern int in_mcast_loop; @@ -446,7 +445,7 @@ again: * thus deferring a hash lookup and mutex acquisition * at the expense of a cheap copy using m_copym(). */ - ip_mloopback(ifp, m, dst, hlen); + ip_mloopback(ifp, m, hlen); } else { /* * If we are acting as a multicast router, perform @@ -1359,10 +1358,9 @@ ip_ctloutput(struct socket *so, struct s * replicating that code here. */ static void -ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, - int hlen) +ip_mloopback(struct ifnet *ifp, const struct mbuf *m, int hlen) { - register struct ip *ip; + struct ip *ip; struct mbuf *copym; /* @@ -1388,13 +1386,6 @@ ip_mloopback(struct ifnet *ifp, struct m ip = mtod(copym, struct ip *); ip->ip_sum = 0; ip->ip_sum = in_cksum(copym, hlen); -#if 1 /* XXX */ - if (dst->sin_family != AF_INET) { - printf("ip_mloopback: bad address family %d\n", - dst->sin_family); - dst->sin_family = AF_INET; - } -#endif - if_simloop(ifp, copym, dst->sin_family, 0); + if_simloop(ifp, copym, AF_INET, 0); } } Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Sat Aug 8 15:51:29 2015 (r286451) +++ head/sys/netinet6/ip6_mroute.c Sat Aug 8 15:58:35 2015 (r286452) @@ -1583,15 +1583,8 @@ phyint_send(struct ip6_hdr *ip6, struct * If configured to loop back multicasts by default, * loop back a copy now. */ - if (in6_mcast_loop) { - struct sockaddr_in6 dst6; - - bzero(&dst6, sizeof(dst6)); - dst6.sin6_len = sizeof(struct sockaddr_in6); - dst6.sin6_family = AF_INET6; - dst6.sin6_addr = ip6->ip6_dst; - ip6_mloopback(ifp, m, &dst6); - } + if (in6_mcast_loop) + ip6_mloopback(ifp, m); /* * Put the packet into the sending queue of the outgoing interface Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sat Aug 8 15:51:29 2015 (r286451) +++ head/sys/netinet6/ip6_output.c Sat Aug 8 15:58:35 2015 (r286452) @@ -662,7 +662,7 @@ again: * thus deferring a hash lookup and lock acquisition * at the expense of an m_copym(). */ - ip6_mloopback(ifp, m, dst); + ip6_mloopback(ifp, m); } else { /* * If we are acting as a multicast router, perform @@ -2883,7 +2883,7 @@ ip6_setpktopt(int optname, u_char *buf, * pointer that might NOT be &loif -- easier than replicating that code here. */ void -ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) +ip6_mloopback(struct ifnet *ifp, const struct mbuf *m) { struct mbuf *copym; struct ip6_hdr *ip6; @@ -2915,7 +2915,7 @@ ip6_mloopback(struct ifnet *ifp, struct CSUM_PSEUDO_HDR; copym->m_pkthdr.csum_data = 0xffff; } - (void)if_simloop(ifp, copym, dst->sin6_family, 0); + if_simloop(ifp, copym, AF_INET6, 0); } /* Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sat Aug 8 15:51:29 2015 (r286451) +++ head/sys/netinet6/ip6_var.h Sat Aug 8 15:58:35 2015 (r286452) @@ -373,7 +373,7 @@ int ip6_sysctl(int *, u_int, void *, siz void ip6_forward(struct mbuf *, int); -void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *); +void ip6_mloopback(struct ifnet *, const struct mbuf *); int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *, int, From owner-svn-src-head@freebsd.org Sat Aug 8 16:39:29 2015 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 3767D9B6B43; Sat, 8 Aug 2015 16:39:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 070E81CA0; Sat, 8 Aug 2015 16:39:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78GdS5X038369; Sat, 8 Aug 2015 16:39:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78GdSep038368; Sat, 8 Aug 2015 16:39:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508081639.t78GdSep038368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Aug 2015 16:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286456 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 16:39:29 -0000 Author: mav Date: Sat Aug 8 16:39:28 2015 New Revision: 286456 URL: https://svnweb.freebsd.org/changeset/base/286456 Log: Remove some code duplication. MFC after: 1 week Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sat Aug 8 16:35:42 2015 (r286455) +++ head/usr.sbin/ctld/login.c Sat Aug 8 16:39:28 2015 (r286456) @@ -57,6 +57,7 @@ login_set_nsg(struct pdu *response, int bhslr->bhslr_flags &= 0xFC; bhslr->bhslr_flags |= nsg; + bhslr->bhslr_flags |= BHSLR_FLAGS_TRANSIT; } static int @@ -337,15 +338,12 @@ login_send_chap_success(struct pdu *requ { struct pdu *response; struct keys *request_keys, *response_keys; - struct iscsi_bhs_login_response *bhslr2; struct rchap *rchap; const char *chap_i, *chap_c; char *chap_r; int error; response = login_new_response(request); - bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs; - bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT; login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); /* @@ -716,7 +714,6 @@ login_negotiate(struct connection *conn, response = login_new_response(request); bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs; - bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT; bhslr2->bhslr_tsih = htons(0xbadd); login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE); @@ -756,7 +753,6 @@ login(struct connection *conn) { struct pdu *request, *response; struct iscsi_bhs_login_request *bhslr; - struct iscsi_bhs_login_response *bhslr2; struct keys *request_keys, *response_keys; struct auth_group *ag; struct portal_group *pg; @@ -917,8 +913,6 @@ login(struct connection *conn) "transitioning anyway"); response = login_new_response(request); - bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs; - bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT; login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); response_keys = keys_new(); /* From owner-svn-src-head@freebsd.org Sat Aug 8 17:48:58 2015 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 7C1C09B561A; Sat, 8 Aug 2015 17:48:58 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6BDD117D9; Sat, 8 Aug 2015 17:48:58 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78Hmw22068797; Sat, 8 Aug 2015 17:48:58 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78HmtxL068784; Sat, 8 Aug 2015 17:48:55 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508081748.t78HmtxL068784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 8 Aug 2015 17:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286457 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 17:48:58 -0000 Author: melifaro Date: Sat Aug 8 17:48:54 2015 New Revision: 286457 URL: https://svnweb.freebsd.org/changeset/base/286457 Log: MFP r274553: * Move lle creation/deletion from lla_lookup to separate functions: lla_lookup(LLE_CREATE) -> lla_create lla_lookup(LLE_DELETE) -> lla_delete lla_create now returns with LLE_EXCLUSIVE lock for lle. * Provide typedefs for new/existing lltable callbacks. Reviewed by: ae Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet/toecore.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h Directory Properties: head/sys/ (props changed) Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/net/if_llatbl.c Sat Aug 8 17:48:54 2015 (r286457) @@ -147,8 +147,7 @@ llentry_alloc(struct ifnet *ifp, struct if ((la == NULL) && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { IF_AFDATA_WLOCK(ifp); - la = lla_lookup(lt, (LLE_CREATE | LLE_EXCLUSIVE), - (struct sockaddr *)dst); + la = lla_create(lt, 0, (struct sockaddr *)dst); IF_AFDATA_WUNLOCK(ifp); } @@ -259,7 +258,7 @@ lltable_init(struct ifnet *ifp, int af) } /* - * Called in route_output when adding/deleting a route to an interface. + * Called in route_output when rtm_flags contains RTF_LLDATA. */ int lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info) @@ -270,8 +269,8 @@ lla_rt_output(struct rt_msghdr *rtm, str struct ifnet *ifp; struct lltable *llt; struct llentry *lle; - u_int laflags = 0, flags = 0; - int error = 0; + u_int laflags = 0; + int error; KASSERT(dl != NULL && dl->sdl_family == AF_LINK, ("%s: invalid dl\n", __func__)); @@ -283,24 +282,6 @@ lla_rt_output(struct rt_msghdr *rtm, str return EINVAL; } - switch (rtm->rtm_type) { - case RTM_ADD: - if (rtm->rtm_flags & RTF_ANNOUNCE) - flags |= LLE_PUB; - flags |= LLE_CREATE; - break; - - case RTM_DELETE: - flags |= LLE_DELETE; - break; - - case RTM_CHANGE: - break; - - default: - return EINVAL; /* XXX not implemented yet */ - } - /* XXX linked list may be too expensive */ LLTABLE_RLOCK(); SLIST_FOREACH(llt, &V_lltables, llt_link) { @@ -311,58 +292,62 @@ lla_rt_output(struct rt_msghdr *rtm, str LLTABLE_RUNLOCK(); KASSERT(llt != NULL, ("Yep, ugly hacks are bad\n")); - if (flags & LLE_CREATE) - flags |= LLE_EXCLUSIVE; + error = 0; - IF_AFDATA_LOCK(ifp); - lle = lla_lookup(llt, flags, dst); - IF_AFDATA_UNLOCK(ifp); - if (LLE_IS_VALID(lle)) { - if (flags & LLE_CREATE) { - /* - * If we delay the delete, then a subsequent - * "arp add" should look up this entry, reset the - * LLE_DELETED flag, and reset the expiration timer - */ - bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); - lle->la_flags |= (flags & LLE_PUB); - lle->la_flags |= LLE_VALID; - lle->la_flags &= ~LLE_DELETED; + switch (rtm->rtm_type) { + case RTM_ADD: + /* Add static LLE */ + IF_AFDATA_WLOCK(ifp); + lle = lla_create(llt, 0, dst); + if (lle == NULL) { + IF_AFDATA_WUNLOCK(ifp); + return (ENOMEM); + } + + + bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); + if ((rtm->rtm_flags & RTF_ANNOUNCE)) + lle->la_flags |= LLE_PUB; + lle->la_flags |= LLE_VALID; #ifdef INET6 - /* - * ND6 - */ - if (dst->sa_family == AF_INET6) - lle->ln_state = ND6_LLINFO_REACHABLE; + /* + * ND6 + */ + if (dst->sa_family == AF_INET6) + lle->ln_state = ND6_LLINFO_REACHABLE; #endif - /* - * NB: arp and ndp always set (RTF_STATIC | RTF_HOST) - */ - - if (rtm->rtm_rmx.rmx_expire == 0) { - lle->la_flags |= LLE_STATIC; - lle->la_expire = 0; - } else - lle->la_expire = rtm->rtm_rmx.rmx_expire; - laflags = lle->la_flags; - LLE_WUNLOCK(lle); + /* + * NB: arp and ndp always set (RTF_STATIC | RTF_HOST) + */ + + if (rtm->rtm_rmx.rmx_expire == 0) { + lle->la_flags |= LLE_STATIC; + lle->la_expire = 0; + } else + lle->la_expire = rtm->rtm_rmx.rmx_expire; + laflags = lle->la_flags; + LLE_WUNLOCK(lle); + IF_AFDATA_WUNLOCK(ifp); #ifdef INET - /* gratuitous ARP */ - if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) - arprequest(ifp, - &((struct sockaddr_in *)dst)->sin_addr, - &((struct sockaddr_in *)dst)->sin_addr, - (u_char *)LLADDR(dl)); + /* gratuitous ARP */ + if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) + arprequest(ifp, + &((struct sockaddr_in *)dst)->sin_addr, + &((struct sockaddr_in *)dst)->sin_addr, + (u_char *)LLADDR(dl)); #endif - } else { - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(lle); - else - LLE_RUNLOCK(lle); - } - } else if ((lle == NULL) && (flags & LLE_DELETE)) - error = EINVAL; + break; + + case RTM_DELETE: + IF_AFDATA_WLOCK(ifp); + error = lla_delete(llt, 0, dst); + IF_AFDATA_WUNLOCK(ifp); + return (error == 0 ? 0 : ENOENT); + + default: + error = EINVAL; + } return (error); } Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/net/if_llatbl.h Sat Aug 8 17:48:54 2015 (r286457) @@ -144,25 +144,33 @@ struct llentry { #define LLTBL_HASHMASK (LLTBL_HASHTBL_SIZE - 1) #endif +typedef struct llentry *(llt_lookup_t)(struct lltable *, u_int flags, + const struct sockaddr *l3addr); +typedef struct llentry *(llt_create_t)(struct lltable *, u_int flags, + const struct sockaddr *l3addr); +typedef int (llt_delete_t)(struct lltable *, u_int flags, + const struct sockaddr *l3addr); +typedef void (llt_prefix_free_t)(struct lltable *, + const struct sockaddr *prefix, const struct sockaddr *mask, u_int flags); +typedef int (llt_dump_t)(struct lltable *, struct sysctl_req *); + struct lltable { SLIST_ENTRY(lltable) llt_link; struct llentries lle_head[LLTBL_HASHTBL_SIZE]; int llt_af; struct ifnet *llt_ifp; - void (*llt_prefix_free)(struct lltable *, - const struct sockaddr *prefix, - const struct sockaddr *mask, - u_int flags); - struct llentry * (*llt_lookup)(struct lltable *, u_int flags, - const struct sockaddr *l3addr); - int (*llt_dump)(struct lltable *, - struct sysctl_req *); + llt_lookup_t *llt_lookup; + llt_create_t *llt_create; + llt_delete_t *llt_delete; + llt_prefix_free_t *llt_prefix_free; + llt_dump_t *llt_dump; }; + MALLOC_DECLARE(M_LLTABLE); /* - * flags to be passed to arplookup. + * LLentry flags */ #define LLE_DELETED 0x0001 /* entry must be deleted */ #define LLE_STATIC 0x0002 /* entry is static */ @@ -170,9 +178,8 @@ MALLOC_DECLARE(M_LLTABLE); #define LLE_VALID 0x0008 /* ll_addr is valid */ #define LLE_PUB 0x0020 /* publish entry ??? */ #define LLE_LINKED 0x0040 /* linked to lookup structure */ +/* LLE request flags */ #define LLE_EXCLUSIVE 0x2000 /* return lle xlocked */ -#define LLE_DELETE 0x4000 /* delete on a lookup - match LLE_IFADDR */ -#define LLE_CREATE 0x8000 /* create on a lookup miss */ #define LLATBL_HASH(key, mask) \ (((((((key >> 8) ^ key) >> 8) ^ key) >> 8) ^ key) & mask) @@ -196,9 +203,25 @@ struct llentry *llentry_alloc(struct if static __inline struct llentry * lla_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { - return llt->llt_lookup(llt, flags, l3addr); + + return (llt->llt_lookup(llt, flags, l3addr)); } +static __inline struct llentry * +lla_create(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) +{ + + return (llt->llt_create(llt, flags, l3addr)); +} + +static __inline int +lla_delete(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) +{ + + return (llt->llt_delete(llt, flags, l3addr)); +} + + int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); #include Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet/if_ether.c Sat Aug 8 17:48:54 2015 (r286457) @@ -152,8 +152,7 @@ arp_ifscrub(struct ifnet *ifp, uint32_t addr4.sin_family = AF_INET; addr4.sin_addr.s_addr = addr; IF_AFDATA_WLOCK(ifp); - lla_lookup(LLTABLE(ifp), (LLE_DELETE | LLE_IFADDR), - (struct sockaddr *)&addr4); + lla_delete(LLTABLE(ifp), LLE_IFADDR, (struct sockaddr *)&addr4); IF_AFDATA_WUNLOCK(ifp); } #endif @@ -325,11 +324,12 @@ arpresolve(struct ifnet *ifp, int is_gw, u_int flags = 0; struct mbuf *curr = NULL; struct mbuf *next = NULL; - int error, renew; + int create, error, renew; if (pflags != NULL) *pflags = 0; + create = 0; if (m != NULL) { if (m->m_flags & M_BCAST) { /* broadcast */ @@ -349,13 +349,14 @@ retry: IF_AFDATA_RUNLOCK(ifp); if ((la == NULL) && ((flags & LLE_EXCLUSIVE) == 0) && ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0)) { - flags |= (LLE_CREATE | LLE_EXCLUSIVE); + create = 1; + flags |= LLE_EXCLUSIVE; IF_AFDATA_WLOCK(ifp); - la = lla_lookup(LLTABLE(ifp), flags, dst); + la = lla_create(LLTABLE(ifp), flags, dst); IF_AFDATA_WUNLOCK(ifp); } if (la == NULL) { - if (flags & LLE_CREATE) + if (create != 0) log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s on %s\n", inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); @@ -578,7 +579,7 @@ in_arpinput(struct mbuf *m) int op, flags; int req_len; int bridged = 0, is_bridge = 0; - int carped; + int carped, create; struct sockaddr_in sin; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; @@ -729,10 +730,13 @@ match: sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr = isaddr; - flags = (itaddr.s_addr == myaddr.s_addr) ? LLE_CREATE : 0; - flags |= LLE_EXCLUSIVE; + create = (itaddr.s_addr == myaddr.s_addr) ? 1 : 0; + flags = LLE_EXCLUSIVE; IF_AFDATA_LOCK(ifp); - la = lla_lookup(LLTABLE(ifp), flags, (struct sockaddr *)&sin); + if (create != 0) + la = lla_create(LLTABLE(ifp), 0, (struct sockaddr *)&sin); + else + la = lla_lookup(LLTABLE(ifp), flags, (struct sockaddr *)&sin); IF_AFDATA_UNLOCK(ifp); if (la != NULL) { /* the following is not an error when doing bridging */ @@ -947,14 +951,14 @@ arp_ifinit(struct ifnet *ifp, struct ifa * that L2 entry as permanent */ IF_AFDATA_LOCK(ifp); - lle = lla_lookup(LLTABLE(ifp), (LLE_CREATE | LLE_IFADDR | LLE_STATIC), + lle = lla_create(LLTABLE(ifp), LLE_IFADDR | LLE_STATIC, (struct sockaddr *)IA_SIN(ifa)); IF_AFDATA_UNLOCK(ifp); if (lle == NULL) log(LOG_INFO, "arp_ifinit: cannot create arp " "entry for interface address\n"); else - LLE_RUNLOCK(lle); + LLE_WUNLOCK(lle); } ifa->ifa_rtrequest = NULL; } Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet/in.c Sat Aug 8 17:48:54 2015 (r286457) @@ -1107,6 +1107,117 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ return (0); } +static inline struct llentry * +in_lltable_find_dst(struct lltable *llt, struct in_addr dst) +{ + struct llentry *lle; + struct llentries *lleh; + struct sockaddr_in *sin; + u_int hashkey; + + hashkey = dst.s_addr; + lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)]; + LIST_FOREACH(lle, lleh, lle_next) { + sin = satosin(L3_ADDR(lle)); + if (lle->la_flags & LLE_DELETED) + continue; + if (sin->sin_addr.s_addr == dst.s_addr) + break; + } + + return (lle); +} + +static int +in_lltable_delete(struct lltable *llt, u_int flags, + const struct sockaddr *l3addr) +{ + const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; + struct ifnet *ifp = llt->llt_ifp; + struct llentry *lle; + + IF_AFDATA_WLOCK_ASSERT(ifp); + KASSERT(l3addr->sa_family == AF_INET, + ("sin_family %d", l3addr->sa_family)); + + lle = in_lltable_find_dst(llt, sin->sin_addr); + if (lle == NULL) { +#ifdef DIAGNOSTIC + log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); +#endif + return (ENOENT); + } + + if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { + LLE_WLOCK(lle); + lle->la_flags |= LLE_DELETED; + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); +#ifdef DIAGNOSTIC + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); +#endif + if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); + else + LLE_WUNLOCK(lle); + } + + return (0); +} + +static struct llentry * +in_lltable_create(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) +{ + const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; + struct ifnet *ifp = llt->llt_ifp; + struct llentry *lle; + struct llentries *lleh; + u_int hashkey; + + IF_AFDATA_WLOCK_ASSERT(ifp); + KASSERT(l3addr->sa_family == AF_INET, + ("sin_family %d", l3addr->sa_family)); + + lle = in_lltable_find_dst(llt, sin->sin_addr); + + if (lle != NULL) { + LLE_WLOCK(lle); + return (lle); + } + + /* no existing record, we need to create new one */ + + /* + * A route that covers the given address must have + * been installed 1st because we are doing a resolution, + * verify this. + */ + if (!(flags & LLE_IFADDR) && + in_lltable_rtcheck(ifp, flags, l3addr) != 0) + return (NULL); + + lle = in_lltable_new(l3addr, flags); + if (lle == NULL) { + log(LOG_INFO, "lla_lookup: new lle malloc failed\n"); + return (NULL); + } + lle->la_flags = flags; + if ((flags & LLE_IFADDR) == LLE_IFADDR) { + bcopy(IF_LLADDR(ifp), &lle->ll_addr, ifp->if_addrlen); + lle->la_flags |= (LLE_VALID | LLE_STATIC); + } + + hashkey = sin->sin_addr.s_addr; + lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)]; + + lle->lle_tbl = llt; + lle->lle_head = lleh; + lle->la_flags |= LLE_LINKED; + LIST_INSERT_HEAD(lleh, lle, lle_next); + LLE_WLOCK(lle); + + return (lle); +} + /* * Return NULL if not found or marked for deletion. * If found return lle read locked. @@ -1133,62 +1244,15 @@ in_lltable_lookup(struct lltable *llt, u if (sa2->sin_addr.s_addr == sin->sin_addr.s_addr) break; } - if (lle == NULL) { -#ifdef DIAGNOSTIC - if (flags & LLE_DELETE) - log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); -#endif - if (!(flags & LLE_CREATE)) - return (NULL); - IF_AFDATA_WLOCK_ASSERT(ifp); - /* - * A route that covers the given address must have - * been installed 1st because we are doing a resolution, - * verify this. - */ - if (!(flags & LLE_IFADDR) && - in_lltable_rtcheck(ifp, flags, l3addr) != 0) - goto done; - - lle = in_lltable_new(l3addr, flags); - if (lle == NULL) { - log(LOG_INFO, "lla_lookup: new lle malloc failed\n"); - goto done; - } - lle->la_flags = flags & ~LLE_CREATE; - if ((flags & (LLE_CREATE | LLE_IFADDR)) == (LLE_CREATE | LLE_IFADDR)) { - bcopy(IF_LLADDR(ifp), &lle->ll_addr, ifp->if_addrlen); - lle->la_flags |= (LLE_VALID | LLE_STATIC); - } - lle->lle_tbl = llt; - lle->lle_head = lleh; - lle->la_flags |= LLE_LINKED; - LIST_INSERT_HEAD(lleh, lle, lle_next); - } else if (flags & LLE_DELETE) { - if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { - LLE_WLOCK(lle); - lle->la_flags |= LLE_DELETED; - EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); -#ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); -#endif - if ((lle->la_flags & - (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) - llentry_free(lle); - else - LLE_WUNLOCK(lle); - } - lle = (void *)-1; + if (lle == NULL) + return (NULL); + + if (flags & LLE_EXCLUSIVE) + LLE_WLOCK(lle); + else + LLE_RLOCK(lle); - } - if (LLE_IS_VALID(lle)) { - if (flags & LLE_EXCLUSIVE) - LLE_WLOCK(lle); - else - LLE_RLOCK(lle); - } -done: return (lle); } @@ -1279,6 +1343,8 @@ in_domifattach(struct ifnet *ifp) if (llt != NULL) { llt->llt_prefix_free = in_lltable_prefix_free; llt->llt_lookup = in_lltable_lookup; + llt->llt_create = in_lltable_create; + llt->llt_delete = in_lltable_delete; llt->llt_dump = in_lltable_dump; } ii->ii_llt = llt; Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet/toecore.c Sat Aug 8 17:48:54 2015 (r286457) @@ -463,8 +463,7 @@ restart: IF_AFDATA_RUNLOCK(ifp); if (lle == NULL) { IF_AFDATA_LOCK(ifp); - lle = nd6_lookup(&sin6->sin6_addr, ND6_CREATE | ND6_EXCLUSIVE, - ifp); + lle = nd6_create(&sin6->sin6_addr, 0, ifp); IF_AFDATA_UNLOCK(ifp); if (lle == NULL) return (ENOMEM); /* Couldn't create entry in cache. */ Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet6/in6.c Sat Aug 8 17:48:54 2015 (r286457) @@ -2152,81 +2152,134 @@ in6_lltable_rtcheck(struct ifnet *ifp, return 0; } -static struct llentry * -in6_lltable_lookup(struct lltable *llt, u_int flags, - const struct sockaddr *l3addr) +static inline struct llentry * +in6_lltable_find_dst(struct lltable *llt, const struct in6_addr *dst) { - const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; - struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; struct llentries *lleh; + const struct sockaddr_in6 *sin6; u_int hashkey; - IF_AFDATA_LOCK_ASSERT(ifp); - KASSERT(l3addr->sa_family == AF_INET6, - ("sin_family %d", l3addr->sa_family)); - - hashkey = sin6->sin6_addr.s6_addr32[3]; + hashkey = dst->s6_addr32[3]; lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)]; LIST_FOREACH(lle, lleh, lle_next) { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)L3_ADDR(lle); + sin6 = (const struct sockaddr_in6 *)L3_ADDR(lle); if (lle->la_flags & LLE_DELETED) continue; - if (bcmp(&sa6->sin6_addr, &sin6->sin6_addr, - sizeof(struct in6_addr)) == 0) + if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, dst)) break; } - if (lle == NULL) { - if (!(flags & LLE_CREATE)) - return (NULL); - IF_AFDATA_WLOCK_ASSERT(ifp); - /* - * A route that covers the given address must have - * been installed 1st because we are doing a resolution, - * verify this. - */ - if (!(flags & LLE_IFADDR) && - in6_lltable_rtcheck(ifp, flags, l3addr) != 0) - return NULL; - - lle = in6_lltable_new(l3addr, flags); - if (lle == NULL) { - log(LOG_INFO, "lla_lookup: new lle malloc failed\n"); - return NULL; - } - lle->la_flags = flags & ~LLE_CREATE; - if ((flags & (LLE_CREATE | LLE_IFADDR)) == (LLE_CREATE | LLE_IFADDR)) { - bcopy(IF_LLADDR(ifp), &lle->ll_addr, ifp->if_addrlen); - lle->la_flags |= (LLE_VALID | LLE_STATIC); - } + return (lle); +} - lle->lle_tbl = llt; - lle->lle_head = lleh; - lle->la_flags |= LLE_LINKED; - LIST_INSERT_HEAD(lleh, lle, lle_next); - } else if (flags & LLE_DELETE) { - if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { - LLE_WLOCK(lle); - lle->la_flags |= LLE_DELETED; - EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); +static int +in6_lltable_delete(struct lltable *llt, u_int flags, + const struct sockaddr *l3addr) +{ + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; + struct ifnet *ifp = llt->llt_ifp; + struct llentry *lle; + + IF_AFDATA_LOCK_ASSERT(ifp); + KASSERT(l3addr->sa_family == AF_INET6, + ("sin_family %d", l3addr->sa_family)); + + lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); + + if (lle == NULL) + return (ENOENT); + + if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { + LLE_WLOCK(lle); + lle->la_flags |= LLE_DELETED; + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); #ifdef DIAGNOSTIC - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif - if ((lle->la_flags & - (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) - llentry_free(lle); - else - LLE_WUNLOCK(lle); - } - lle = (void *)-1; - } - if (LLE_IS_VALID(lle)) { - if (flags & LLE_EXCLUSIVE) - LLE_WLOCK(lle); + if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC) + llentry_free(lle); else - LLE_RLOCK(lle); + LLE_WUNLOCK(lle); } + + return (0); +} + +static struct llentry * +in6_lltable_create(struct lltable *llt, u_int flags, + const struct sockaddr *l3addr) +{ + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; + struct ifnet *ifp = llt->llt_ifp; + struct llentry *lle; + struct llentries *lleh; + u_int hashkey; + + IF_AFDATA_WLOCK_ASSERT(ifp); + KASSERT(l3addr->sa_family == AF_INET6, + ("sin_family %d", l3addr->sa_family)); + + lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); + + if (lle != NULL) { + LLE_WLOCK(lle); + return (lle); + } + + /* + * A route that covers the given address must have + * been installed 1st because we are doing a resolution, + * verify this. + */ + if (!(flags & LLE_IFADDR) && + in6_lltable_rtcheck(ifp, flags, l3addr) != 0) + return (NULL); + + lle = in6_lltable_new(l3addr, flags); + if (lle == NULL) { + log(LOG_INFO, "lla_lookup: new lle malloc failed\n"); + return (NULL); + } + lle->la_flags = flags; + if ((flags & LLE_IFADDR) == LLE_IFADDR) { + bcopy(IF_LLADDR(ifp), &lle->ll_addr, ifp->if_addrlen); + lle->la_flags |= (LLE_VALID | LLE_STATIC); + } + + hashkey = sin6->sin6_addr.s6_addr32[3]; + lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)]; + + lle->lle_tbl = llt; + lle->lle_head = lleh; + lle->la_flags |= LLE_LINKED; + LIST_INSERT_HEAD(lleh, lle, lle_next); + LLE_WLOCK(lle); + + return (lle); +} + +static struct llentry * +in6_lltable_lookup(struct lltable *llt, u_int flags, + const struct sockaddr *l3addr) +{ + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; + struct ifnet *ifp = llt->llt_ifp; + struct llentry *lle; + + IF_AFDATA_LOCK_ASSERT(ifp); + KASSERT(l3addr->sa_family == AF_INET6, + ("sin_family %d", l3addr->sa_family)); + + lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); + + if (lle == NULL) + return (NULL); + + if (flags & LLE_EXCLUSIVE) + LLE_WLOCK(lle); + else + LLE_RLOCK(lle); return (lle); } @@ -2340,6 +2393,8 @@ in6_domifattach(struct ifnet *ifp) if (ext->lltable != NULL) { ext->lltable->llt_prefix_free = in6_lltable_prefix_free; ext->lltable->llt_lookup = in6_lltable_lookup; + ext->lltable->llt_create = in6_lltable_create; + ext->lltable->llt_delete = in6_lltable_delete; ext->lltable->llt_dump = in6_lltable_dump; } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet6/nd6.c Sat Aug 8 17:48:54 2015 (r286457) @@ -937,16 +937,33 @@ nd6_lookup(struct in6_addr *addr6, int f IF_AFDATA_LOCK_ASSERT(ifp); - llflags = 0; - if (flags & ND6_CREATE) - llflags |= LLE_CREATE; - if (flags & ND6_EXCLUSIVE) - llflags |= LLE_EXCLUSIVE; - + llflags = (flags & ND6_EXCLUSIVE) ? LLE_EXCLUSIVE : 0; ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); - if ((ln != NULL) && (llflags & LLE_CREATE)) + + return (ln); +} + +/* + * the caller acquires and releases the lock on the lltbls + * Returns the llentry wlocked + */ +struct llentry * +nd6_create(struct in6_addr *addr6, int flags, struct ifnet *ifp) +{ + struct sockaddr_in6 sin6; + struct llentry *ln; + + bzero(&sin6, sizeof(sin6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_addr = *addr6; + + IF_AFDATA_WLOCK_ASSERT(ifp); + + ln = lla_create(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6); + if (ln != NULL) ln->ln_state = ND6_LLINFO_NOSTATE; - + return (ln); } @@ -1664,7 +1681,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru if (ln == NULL) { flags |= ND6_EXCLUSIVE; IF_AFDATA_LOCK(ifp); - ln = nd6_lookup(from, flags | ND6_CREATE, ifp); + ln = nd6_create(from, 0, ifp); IF_AFDATA_UNLOCK(ifp); is_newentry = 1; } else { @@ -2020,7 +2037,6 @@ nd6_output_lle(struct ifnet *ifp, struct struct sockaddr_in6 *dst) { struct llentry *lle = NULL; - int flags = 0; KASSERT(m != NULL, ("NULL mbuf, nothing to send")); /* discard the packet if IPv6 operation is disabled on the interface */ @@ -2051,9 +2067,8 @@ nd6_output_lle(struct ifnet *ifp, struct * the condition below is not very efficient. But we believe * it is tolerable, because this should be a rare case. */ - flags = ND6_CREATE | ND6_EXCLUSIVE; IF_AFDATA_LOCK(ifp); - lle = nd6_lookup(&dst->sin6_addr, flags, ifp); + lle = nd6_create(&dst->sin6_addr, 0, ifp); IF_AFDATA_UNLOCK(ifp); } } @@ -2237,8 +2252,8 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia) return (0); IF_AFDATA_LOCK(ifp); ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; - ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | - LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); + ln = lla_create(LLTABLE6(ifp), LLE_IFADDR, + (struct sockaddr *)&ia->ia_addr); IF_AFDATA_UNLOCK(ifp); if (ln != NULL) { ln->la_expire = 0; /* for IPv6 this means permanent */ Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Sat Aug 8 16:39:28 2015 (r286456) +++ head/sys/netinet6/nd6.h Sat Aug 8 17:48:54 2015 (r286457) @@ -89,7 +89,6 @@ struct nd_ifinfo { #define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */ #define ND6_IFF_NO_DAD 0x100 -#define ND6_CREATE LLE_CREATE #define ND6_EXCLUSIVE LLE_EXCLUSIVE #ifdef _KERNEL @@ -407,7 +406,8 @@ int nd6_is_addr_neighbor(struct sockaddr void nd6_option_init(void *, int, union nd_opts *); struct nd_opt_hdr *nd6_option(union nd_opts *); int nd6_options(union nd_opts *); -struct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *); +struct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *); +struct llentry *nd6_create(struct in6_addr *, int, struct ifnet *); void nd6_setmtu(struct ifnet *); void nd6_llinfo_settimer(struct llentry *, long); void nd6_llinfo_settimer_locked(struct llentry *, long); From owner-svn-src-head@freebsd.org Sat Aug 8 18:15:02 2015 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 56F729B5AE3; Sat, 8 Aug 2015 18:15:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3E983276; Sat, 8 Aug 2015 18:15:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78IF2HC081021; Sat, 8 Aug 2015 18:15:02 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78IF0xJ081015; Sat, 8 Aug 2015 18:15:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508081815.t78IF0xJ081015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 8 Aug 2015 18:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286458 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 18:15:02 -0000 Author: melifaro Date: Sat Aug 8 18:14:59 2015 New Revision: 286458 URL: https://svnweb.freebsd.org/changeset/base/286458 Log: MFP r274295: * Move interface route cleanup to route.c:rt_flushifroutes() * Convert most of "for (fibnum = 0; fibnum < rt_numfibs; fibnum++)" users to use new rt_foreach_fib() instead of hand-rolling cycles. Modified: head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/net/if.c Sat Aug 8 18:14:59 2015 (r286458) @@ -166,7 +166,6 @@ static int if_setflag(struct ifnet *, in static int if_transmit(struct ifnet *ifp, struct mbuf *m); static void if_unroute(struct ifnet *, int flag, int fam); static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *); -static int if_rtdel(struct radix_node *, void *); static int ifhwioctl(u_long, struct ifnet *, caddr_t, struct thread *); static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int); static void do_link_state_change(void *, int); @@ -885,8 +884,7 @@ static void if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) { struct ifaddr *ifa; - struct radix_node_head *rnh; - int i, j; + int i; struct domain *dp; struct ifnet *iter; int found = 0; @@ -974,23 +972,7 @@ if_detach_internal(struct ifnet *ifp, in } } - /* - * Delete all remaining routes using this interface - * Unfortuneatly the only way to do this is to slog through - * the entire routing table looking for routes which point - * to this interface...oh well... - */ - for (i = 1; i <= AF_MAX; i++) { - for (j = 0; j < rt_numfibs; j++) { - rnh = rt_tables_get_rnh(j, i); - if (rnh == NULL) - continue; - RADIX_NODE_HEAD_LOCK(rnh); - (void) rnh->rnh_walktree(rnh, if_rtdel, ifp); - RADIX_NODE_HEAD_UNLOCK(rnh); - } - } - + rt_flushifroutes(ifp); if_delgroups(ifp); /* @@ -1411,49 +1393,6 @@ if_getgroupmembers(struct ifgroupreq *da } /* - * Delete Routes for a Network Interface - * - * Called for each routing entry via the rnh->rnh_walktree() call above - * to delete all route entries referencing a detaching network interface. - * - * Arguments: - * rn pointer to node in the routing table - * arg argument passed to rnh->rnh_walktree() - detaching interface - * - * Returns: - * 0 successful - * errno failed - reason indicated - * - */ -static int -if_rtdel(struct radix_node *rn, void *arg) -{ - struct rtentry *rt = (struct rtentry *)rn; - struct ifnet *ifp = arg; - int err; - - if (rt->rt_ifp == ifp) { - - /* - * Protect (sorta) against walktree recursion problems - * with cloned routes - */ - if ((rt->rt_flags & RTF_UP) == 0) - return (0); - - err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), - rt->rt_flags|RTF_RNH_LOCKED|RTF_PINNED, - (struct rtentry **) NULL, rt->rt_fibnum); - if (err) { - log(LOG_WARNING, "if_rtdel: error %d\n", err); - } - } - - return (0); -} - -/* * Return counter values from counter(9)s stored in ifnet. */ uint64_t Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/net/route.c Sat Aug 8 18:14:59 2015 (r286458) @@ -139,6 +139,7 @@ static VNET_DEFINE(uma_zone_t, rtzone); static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo *, struct rtentry **, u_int); static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); +static int rt_ifdelroute(struct rtentry *rt, void *arg); struct if_mtuinfo { @@ -811,6 +812,96 @@ rtrequest_fib(int req, return rtrequest1_fib(req, &info, ret_nrt, fibnum); } + +void +rt_foreach_fib(int af, rt_setwarg_t *setwa_f, rt_walktree_f_t *wa_f, void *arg) +{ + struct radix_node_head *rnh; + uint32_t fibnum; + int i; + + for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { + /* Do we want some specific family? */ + if (af != AF_UNSPEC) { + rnh = rt_tables_get_rnh(fibnum, af); + if (rnh == NULL) + continue; + if (setwa_f != NULL) + setwa_f(rnh, fibnum, i, arg); + + RADIX_NODE_HEAD_LOCK(rnh); + rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); + RADIX_NODE_HEAD_UNLOCK(rnh); + continue; + } + + for (i = 1; i <= AF_MAX; i++) { + rnh = rt_tables_get_rnh(fibnum, i); + if (rnh == NULL) + continue; + if (setwa_f != NULL) + setwa_f(rnh, fibnum, i, arg); + + RADIX_NODE_HEAD_LOCK(rnh); + rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); + RADIX_NODE_HEAD_UNLOCK(rnh); + } + } +} + +/* + * Delete Routes for a Network Interface + * + * Called for each routing entry via the rnh->rnh_walktree() call above + * to delete all route entries referencing a detaching network interface. + * + * Arguments: + * rt pointer to rtentry + * arg argument passed to rnh->rnh_walktree() - detaching interface + * + * Returns: + * 0 successful + * errno failed - reason indicated + */ +static int +rt_ifdelroute(struct rtentry *rt, void *arg) +{ + struct ifnet *ifp = arg; + int err; + + if (rt->rt_ifp != ifp) + return (0); + + /* + * Protect (sorta) against walktree recursion problems + * with cloned routes + */ + if ((rt->rt_flags & RTF_UP) == 0) + return (0); + + err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, + rt_mask(rt), + rt->rt_flags | RTF_RNH_LOCKED | RTF_PINNED, + (struct rtentry **) NULL, rt->rt_fibnum); + if (err != 0) + log(LOG_WARNING, "rt_ifdelroute: error %d\n", err); + + return (0); +} + +/* + * Delete all remaining routes using this interface + * Unfortuneatly the only way to do this is to slog through + * the entire routing table looking for routes which point + * to this interface...oh well... + */ +void +rt_flushifroutes(struct ifnet *ifp) +{ + + rt_foreach_fib(AF_UNSPEC, NULL, rt_ifdelroute, ifp); +} + /* * These (questionable) definitions of apparent local variables apply * to the next two functions. XXXXXX!!! Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/net/route.h Sat Aug 8 18:14:59 2015 (r286458) @@ -380,6 +380,11 @@ void rtfree(struct rtentry *); int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); void rt_updatemtu(struct ifnet *); +typedef int rt_walktree_f_t(struct rtentry *, void *); +typedef void rt_setwarg_t(struct radix_node_head *, uint32_t, int, void *); +void rt_foreach_fib(int af, rt_setwarg_t *, rt_walktree_f_t *, void *); +void rt_flushifroutes(struct ifnet *ifp); + /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ int rt_getifa(struct rt_addrinfo *); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/netinet/in_rmx.c Sat Aug 8 18:14:59 2015 (r286458) @@ -53,6 +53,11 @@ extern int in_inithead(void **head, int extern int in_detachhead(void **head, int off); #endif +static void in_setifarnh(struct radix_node_head *rnh, uint32_t fibnum, + int af, void *_arg); +static void in_rtqtimo_setrnh(struct radix_node_head *rnh, uint32_t fibnum, + int af, void *_arg); + /* * Do what we need to do when inserting a route. */ @@ -153,10 +158,9 @@ struct in_ifadown_arg { }; static int -in_ifadownkill(struct radix_node *rn, void *xap) +in_ifadownkill(struct rtentry *rt, void *xap) { struct in_ifadown_arg *ap = xap; - struct rtentry *rt = (struct rtentry *)rn; RT_LOCK(rt); if (rt->rt_ifa == ap->ifa && @@ -189,26 +193,30 @@ in_ifadownkill(struct radix_node *rn, vo return 0; } +static void +in_setifarnh(struct radix_node_head *rnh, uint32_t fibnum, int af, + void *_arg) +{ + struct in_ifadown_arg *arg; + + arg = (struct in_ifadown_arg *)_arg; + + arg->rnh = rnh; +} + void in_ifadown(struct ifaddr *ifa, int delete) { struct in_ifadown_arg arg; - struct radix_node_head *rnh; - int fibnum; KASSERT(ifa->ifa_addr->sa_family == AF_INET, ("%s: wrong family", __func__)); - for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET); - arg.rnh = rnh; - arg.ifa = ifa; - arg.del = delete; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in_ifadownkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */ - } + arg.ifa = ifa; + arg.del = delete; + + rt_foreach_fib(AF_INET, in_setifarnh, in_ifadownkill, &arg); + ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */ } /* Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/netinet6/in6_rmx.c Sat Aug 8 18:14:59 2015 (r286458) @@ -189,15 +189,10 @@ static VNET_DEFINE(struct callout, rtq_m #define V_rtq_mtutimer VNET(rtq_mtutimer) static int -in6_mtuexpire(struct radix_node *rn, void *rock) +in6_mtuexpire(struct rtentry *rt, void *rock) { - struct rtentry *rt = (struct rtentry *)rn; struct mtuex_arg *ap = rock; - /* sanity */ - if (!rt) - panic("rt == NULL in in6_mtuexpire"); - if (rt->rt_expire && !(rt->rt_flags & RTF_PROBEMTU)) { if (rt->rt_expire <= time_uptime) { rt->rt_flags |= RTF_PROBEMTU; @@ -206,36 +201,29 @@ in6_mtuexpire(struct radix_node *rn, voi } } - return 0; + return (0); } #define MTUTIMO_DEFAULT (60*1) static void -in6_mtutimo_one(struct radix_node_head *rnh) +in6_mtutimo_setwa(struct radix_node_head *rnh, uint32_t fibum, int af, void *_arg) { - struct mtuex_arg arg; + struct mtuex_arg *arg; + + arg = (struct mtuex_arg *)_arg; - arg.rnh = rnh; - arg.nextstop = time_uptime + MTUTIMO_DEFAULT; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_mtuexpire, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); + arg->rnh = rnh; } static void in6_mtutimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); - struct radix_node_head *rnh; struct timeval atv; - u_int fibnum; + struct mtuex_arg arg; - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET6); - if (rnh != NULL) - in6_mtutimo_one(rnh); - } + rt_foreach_fib(AF_INET6, in6_mtutimo_setwa, in6_mtuexpire, &arg); atv.tv_sec = MTUTIMO_DEFAULT; atv.tv_usec = 0; Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sat Aug 8 17:48:54 2015 (r286457) +++ head/sys/netinet6/nd6_rtr.c Sat Aug 8 18:14:59 2015 (r286458) @@ -88,7 +88,7 @@ static void in6_init_address_ltimes(stru static int nd6_prefix_onlink(struct nd_prefix *); static int nd6_prefix_offlink(struct nd_prefix *); -static int rt6_deleteroute(struct radix_node *, void *); +static int rt6_deleteroute(struct rtentry *, void *); VNET_DECLARE(int, nd6_recalc_reachtm_interval); #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) @@ -2067,30 +2067,19 @@ in6_init_address_ltimes(struct nd_prefix void rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) { - struct radix_node_head *rnh; - u_int fibnum; /* We'll care only link-local addresses */ if (!IN6_IS_ADDR_LINKLOCAL(gateway)) return; /* XXX Do we really need to walk any but the default FIB? */ - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET6); - if (rnh == NULL) - continue; - - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, rt6_deleteroute, (void *)gateway); - RADIX_NODE_HEAD_UNLOCK(rnh); - } + rt_foreach_fib(AF_INET6, NULL, rt6_deleteroute, (void *)gateway); } static int -rt6_deleteroute(struct radix_node *rn, void *arg) +rt6_deleteroute(struct rtentry *rt, void *arg) { #define SIN6(s) ((struct sockaddr_in6 *)s) - struct rtentry *rt = (struct rtentry *)rn; struct in6_addr *gate = (struct in6_addr *)arg; if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) From owner-svn-src-head@freebsd.org Sat Aug 8 18:37:23 2015 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 9D5CF9B5F2B; Sat, 8 Aug 2015 18:37:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 77315104F; Sat, 8 Aug 2015 18:37:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78IbN8q089551; Sat, 8 Aug 2015 18:37:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78IbLfl089545; Sat, 8 Aug 2015 18:37:21 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201508081837.t78IbLfl089545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 8 Aug 2015 18:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286461 - in head/usr.bin/xargs: . 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.20 Precedence: list List-Id: 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, 08 Aug 2015 18:37:23 -0000 Author: allanjude Date: Sat Aug 8 18:37:20 2015 New Revision: 286461 URL: https://svnweb.freebsd.org/changeset/base/286461 Log: fix regression in xargs -Px (introduced in r286289) and add regression tests PR: 202152 Submitted by: jbeich (original), Nikolai Lifanov (final) Reviewed by: jbeich Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D3330 Added: head/usr.bin/xargs/tests/regress.0P1.out (contents, props changed) head/usr.bin/xargs/tests/regress.P1.out (contents, props changed) head/usr.bin/xargs/tests/regress.n2P0.out (contents, props changed) Modified: head/usr.bin/xargs/tests/Makefile head/usr.bin/xargs/tests/regress.sh head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/tests/Makefile ============================================================================== --- head/usr.bin/xargs/tests/Makefile Sat Aug 8 18:29:45 2015 (r286460) +++ head/usr.bin/xargs/tests/Makefile Sat Aug 8 18:37:20 2015 (r286461) @@ -10,13 +10,16 @@ FILES+= regress.0.out FILES+= regress.0I.out FILES+= regress.0J.out FILES+= regress.0L.out +FILES+= regress.0P1.out FILES+= regress.I.out FILES+= regress.J.out FILES+= regress.L.out +FILES+= regress.P1.out FILES+= regress.R.out FILES+= regress.in FILES+= regress.n1.out FILES+= regress.n2.out +FILES+= regress.n2P0.out FILES+= regress.n3.out FILES+= regress.normal.out FILES+= regress.quotes.in Added: head/usr.bin/xargs/tests/regress.0P1.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xargs/tests/regress.0P1.out Sat Aug 8 18:37:20 2015 (r286461) @@ -0,0 +1,4 @@ +quick ' brown fox jumped +over "the lazy dog +quick brown fox jumped over the lazy dog + Added: head/usr.bin/xargs/tests/regress.P1.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xargs/tests/regress.P1.out Sat Aug 8 18:37:20 2015 (r286461) @@ -0,0 +1 @@ +quick brown fox jumped over the lazy dog Added: head/usr.bin/xargs/tests/regress.n2P0.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xargs/tests/regress.n2P0.out Sat Aug 8 18:37:20 2015 (r286461) @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the +lazy dog Modified: head/usr.bin/xargs/tests/regress.sh ============================================================================== --- head/usr.bin/xargs/tests/regress.sh Sat Aug 8 18:29:45 2015 (r286460) +++ head/usr.bin/xargs/tests/regress.sh Sat Aug 8 18:37:20 2015 (r286461) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..13 +echo 1..16 REGRESSION_START($1) @@ -8,14 +8,17 @@ REGRESSION_TEST(`normal', `xargs echo Th REGRESSION_TEST(`I', `xargs -I% echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`J', `xargs -J% echo The % again. <${SRCDIR}/regress.in') REGRESSION_TEST(`L', `xargs -L3 echo <${SRCDIR}/regress.in') +REGRESSION_TEST(`P1', `xargs -P1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in') REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in') +REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in') REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in') REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in') REGRESSION_TEST(`0J', `xargs -0 -J% echo The % again. <${SRCDIR}/regress.0.in') REGRESSION_TEST(`0L', `xargs -0 -L2 echo <${SRCDIR}/regress.0.in') +REGRESSION_TEST(`0P1', `xargs -0 -P1 echo <${SRCDIR}/regress.0.in') REGRESSION_TEST(`quotes', `xargs -n1 echo <${SRCDIR}/regress.quotes.in') REGRESSION_END() Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Sat Aug 8 18:29:45 2015 (r286460) +++ head/usr.bin/xargs/xargs.c Sat Aug 8 18:37:20 2015 (r286461) @@ -166,15 +166,11 @@ main(int argc, char *argv[]) oflag = 1; break; case 'P': - maxprocs = strtonum(optarg, 1, INT_MAX, &errstr); + maxprocs = strtonum(optarg, 0, INT_MAX, &errstr); if (errstr) errx(1, "-P %s: %s", optarg, errstr); if (getrlimit(RLIMIT_NPROC, &rl) != 0) errx(1, "getrlimit failed"); - if (*endptr != '\0') - errx(1, "invalid number for -P option"); - if (maxprocs < 0) - errx(1, "value for -P option should be >= 0"); if (maxprocs == 0 || maxprocs > rl.rlim_cur) maxprocs = rl.rlim_cur; break; From owner-svn-src-head@freebsd.org Sat Aug 8 19:04:38 2015 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 62D579B64EC; Sat, 8 Aug 2015 19:04:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4664D1DD3; Sat, 8 Aug 2015 19:04:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78J4cZr001848; Sat, 8 Aug 2015 19:04:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78J4c0R001847; Sat, 8 Aug 2015 19:04:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508081904.t78J4c0R001847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 8 Aug 2015 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286462 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 19:04:38 -0000 Author: mav Date: Sat Aug 8 19:04:37 2015 New Revision: 286462 URL: https://svnweb.freebsd.org/changeset/base/286462 Log: Refactor early stages of security negotiation. MFC after: 2 weeks Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sat Aug 8 18:37:20 2015 (r286461) +++ head/usr.sbin/ctld/login.c Sat Aug 8 19:04:37 2015 (r286462) @@ -748,6 +748,30 @@ login_negotiate(struct connection *conn, keys_delete(request_keys); } +static void +login_wait_transition(struct connection *conn) +{ + struct pdu *request, *response; + struct iscsi_bhs_login_request *bhslr; + + log_debugx("waiting for state transition request"); + request = login_receive(conn, false); + bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs; + if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) { + login_send_error(request, 0x02, 0x00); + log_errx(1, "got no \"T\" flag after answering AuthMethod"); + } + pdu_delete(request); + + log_debugx("got state transition request"); + response = login_new_response(request); + login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + pdu_send(response); + pdu_delete(response); + + login_negotiate(conn, NULL); +} + void login(struct connection *conn) { @@ -758,7 +782,7 @@ login(struct connection *conn) struct portal_group *pg; const char *initiator_name, *initiator_alias, *session_type, *target_name, *auth_method; - bool redirected; + bool redirected, fail, trans; /* * Handle the initial Login Request - figure out required authentication @@ -867,6 +891,19 @@ login(struct connection *conn) } } + if (ag->ag_type == AG_TYPE_DENY) { + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-type is \"deny\""); + } + + if (ag->ag_type == AG_TYPE_UNKNOWN) { + /* + * This can happen with empty auth-group. + */ + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-type not set, denying access"); + } + /* * Enforce initiator-name and initiator-portal. */ @@ -900,80 +937,37 @@ login(struct connection *conn) return; } + fail = false; + response = login_new_response(request); + response_keys = keys_new(); + trans = (bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) != 0; + auth_method = keys_find(request_keys, "AuthMethod"); if (ag->ag_type == AG_TYPE_NO_AUTHENTICATION) { - /* - * Initiator might want to to authenticate, - * but we don't need it. - */ - log_debugx("authentication not required; " - "transitioning to operational parameter negotiation"); - - if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) - log_warnx("initiator did not set the \"T\" flag; " - "transitioning anyway"); - - response = login_new_response(request); - login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); - response_keys = keys_new(); - /* - * Required by Linux initiator. - */ - auth_method = keys_find(request_keys, "AuthMethod"); - if (auth_method != NULL && - login_list_contains(auth_method, "None")) + log_debugx("authentication not required"); + if (auth_method == NULL || + login_list_contains(auth_method, "None")) { keys_add(response_keys, "AuthMethod", "None"); - - if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { - if (conn->conn_target->t_alias != NULL) - keys_add(response_keys, - "TargetAlias", conn->conn_target->t_alias); - keys_add_int(response_keys, - "TargetPortalGroupTag", pg->pg_tag); - } - keys_save(response_keys, response); - pdu_send(response); - pdu_delete(response); - keys_delete(response_keys); - pdu_delete(request); - keys_delete(request_keys); - - login_negotiate(conn, NULL); - return; - } - - if (ag->ag_type == AG_TYPE_DENY) { - login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-type is \"deny\""); - } - - if (ag->ag_type == AG_TYPE_UNKNOWN) { - /* - * This can happen with empty auth-group. - */ - login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-type not set, denying access"); - } - - log_debugx("CHAP authentication required"); - - auth_method = keys_find(request_keys, "AuthMethod"); - if (auth_method == NULL) { - login_send_error(request, 0x02, 0x07); - log_errx(1, "received Login PDU without AuthMethod"); - } - /* - * XXX: This should be Reject, not just a login failure (5.3.2). - */ - if (login_list_contains(auth_method, "CHAP") == 0) { - login_send_error(request, 0x02, 0x01); - log_errx(1, "initiator requests unsupported AuthMethod \"%s\" " - "instead of \"CHAP\"", auth_method); + } else { + log_warnx("initiator requests " + "AuthMethod \"%s\" instead of \"None\"", + auth_method); + keys_add(response_keys, "AuthMethod", "Reject"); + } + if (trans) + login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + } else { + log_debugx("CHAP authentication required"); + if (auth_method == NULL || + login_list_contains(auth_method, "CHAP")) { + keys_add(response_keys, "AuthMethod", "CHAP"); + } else { + log_warnx("initiator requests unsupported " + "AuthMethod \"%s\" instead of \"CHAP\"", + auth_method); + keys_add(response_keys, "AuthMethod", "Reject"); + fail = true; + } } - - response = login_new_response(request); - - response_keys = keys_new(); - keys_add(response_keys, "AuthMethod", "CHAP"); if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { if (conn->conn_target->t_alias != NULL) keys_add(response_keys, @@ -989,7 +983,17 @@ login(struct connection *conn) pdu_delete(request); keys_delete(request_keys); - login_chap(conn, ag); + if (fail) { + log_debugx("sent reject for AuthMethod; exiting"); + exit(1); + } - login_negotiate(conn, NULL); + if (ag->ag_type != AG_TYPE_NO_AUTHENTICATION) { + login_chap(conn, ag); + login_negotiate(conn, NULL); + } else if (trans) { + login_negotiate(conn, NULL); + } else { + login_wait_transition(conn); + } } From owner-svn-src-head@freebsd.org Sat Aug 8 19:05:47 2015 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 ECA339B6524; Sat, 8 Aug 2015 19:05:46 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::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 A730F1F21; Sat, 8 Aug 2015 19:05:46 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qgj62 with SMTP id 62so69792134qgj.2; Sat, 08 Aug 2015 12:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=3rPT9dKCUOQs485LkaUfUoQuJBw/h4+yWaUndG3R9ws=; b=WxtFUekYpNggFkZSt4C7gSZ1wJCGYSKV9QfzaG+iNZcsEl4nPB6dVAJYDpez2AKhZV d0xP8hOmNmhjlcUSNfRAbmuxqkXkhEGwn94Rn76Hu/onYvpCfztRiSbkQrnA79bH6KMU B2pMI8YZEWaYkvbyE45HTeeQvrLKOM3tqndvkr7zaTVPSokGpR6f5PAOaecoys6Byude slxGUm2fcDU9awYXMOxtbe6p0f6QDk+VaabfIfFJYXYwCR3u2oefU/ADF4j3YMbEbXLg hGAMNZRFH94wmFEvnIowr6LB9P2LfR7PvIz+UVv86UfC40/obcZCrdWuAkeUAVjo8Jlg Yd8g== X-Received: by 10.140.133.16 with SMTP id 16mr26789592qhf.43.1439060745844; Sat, 08 Aug 2015 12:05:45 -0700 (PDT) Received: from kan ([2601:18f:0:1570:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 1sm6945895qhu.11.2015.08.08.12.05.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Aug 2015 12:05:44 -0700 (PDT) Date: Sat, 8 Aug 2015 15:05:39 -0400 From: Alexander Kabaev To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285910 - in head: lib/libc/sys sys/kern sys/sys Message-ID: <20150808150539.0b43cfcd@kan> In-Reply-To: <201507271317.t6RDHwpj067194@repo.freebsd.org> References: <201507271317.t6RDHwpj067194@repo.freebsd.org> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/BbKdeIG_rtzy/3KPa5m0ARF"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 19:05:47 -0000 --Sig_/BbKdeIG_rtzy/3KPa5m0ARF Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 27 Jul 2015 13:17:58 +0000 (UTC) Ed Schouten wrote: > Author: ed > Date: Mon Jul 27 13:17:57 2015 > New Revision: 285910 > URL: https://svnweb.freebsd.org/changeset/base/285910 >=20 > Log: > Make shutdown() return ENOTCONN as required by POSIX, part deux. > =20 > Summary: > Back in 2005, maxim@ attempted to fix shutdown() to return ENOTCONN > in case the socket was not connected (r150152). This had to be rolled > back (r150155), as it broke some of the existing programs that depend > on this behavior. I reapplied this change on my system and indeed, > syslogd failed to start up. I fixed this back in February (279016) > and MFC'ed it to the supported stable branches. Apart from that, > things seem to work out all right. Since at least Linux and Mac OS X > do the right thing, I'd like to go ahead and give this another try. > To keep old copies of syslogd working, only start returning ENOTCONN > for recent binaries. I took a look at the XNU sources and they seem > to test against both SS_ISCONNECTED, SS_ISCONNECTING and > SS_ISDISCONNECTING, instead of just SS_ISCONNECTED. That seams > reasonable, so let's do the same. Test Plan: This issue was uncovered > while writing tests for shutdown() in CloudABI: > https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/sys/socket/shutd= own_test.c#L26 > Reviewers: glebius, rwatson, #manpages, gnn, #network Reviewed By: > gnn, #network Subscribers: bms, mjg, imp=20 > Differential Revision: https://reviews.freebsd.org/D3039 >=20 Hi Ed, this commit broke more than just syslogd. rtsol and rtsold both are victims of the change as they are trying to shutdown unconnected raw sockets to make then 'send-only' and fail. --=20 Alexander Kabaev --Sig_/BbKdeIG_rtzy/3KPa5m0ARF Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJVxlMEXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+uZ0P/1PY2Qg259PwCr8IU/ASxOhf LqGSGAkjdXMIua65wCjpuFFLAmdxeRpew/ES1bCKUc/VFyGMSzwo9gAPk8LJD7+1 l+CK1s6ouvf4fSXa7YPTyfDDotu+LeS1yoH401GL58lDe1Iyr6xZkmEb8wNAriS/ EH0bhw5bpG9sVXHCq403BBbRN9jQrQ8YKU2duuMPa15pxSlFugN1gXxl3O7r3MIW 12InxhmFPX8B+lzKx2xbemzh0rBJtgV1bv+cVh7DenqPHyPN28SY4jhsxRUdiEZy 6+4C2lO48jgb6NOfAtWnMQgW/20J2T71mh3L6ZIh3BQ8LMQtOzLsd+nAZ/mqe3/t X0PYhepDdmehKGVXgjuwVnkWtoILF9KmVBzkkd/A26aVpfFY/lVh+K4FsVz8lCtN VJNGehrD+5s1AnZ8nYMk3weq7wDihqfTYXELdZxy/RKgNwVRysg7H3nU89iLtSOh YvpC0ThTUm8Bu4WhStRcn/P0FfxqOrrvvl+Vtv3UMQJIvU1NmeSPW5G5H3lUWkHm NDwmV5cijwgfyEzeVJ9COYmxLiL0lbZxYHdyr5j+Z7PzB82qkINL92GD5KPux3RB MzTDqUL/ET9inlfJ/Pj3vynRmsG+cF3J70L4/TRVUmnw4QOiCM5EYrm2X6hAjlU1 v8ZQsLpIswPNWrFZAiqm =NIzU -----END PGP SIGNATURE----- --Sig_/BbKdeIG_rtzy/3KPa5m0ARF-- From owner-svn-src-head@freebsd.org Sat Aug 8 20:07:26 2015 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 D9A3C9B6F6A; Sat, 8 Aug 2015 20:07:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CA5A61BFD; Sat, 8 Aug 2015 20:07:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78K7QCw026447; Sat, 8 Aug 2015 20:07:26 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78K7QMS026446; Sat, 8 Aug 2015 20:07:26 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082007.t78K7QMS026446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 20:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286466 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 20:07:26 -0000 Author: rpaulo Date: Sat Aug 8 20:07:25 2015 New Revision: 286466 URL: https://svnweb.freebsd.org/changeset/base/286466 Log: iwm: fix a KASSERT: s/ds_size/ds_len/. Modified: head/sys/dev/iwm/if_iwm_util.c Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Sat Aug 8 19:29:59 2015 (r286465) +++ head/sys/dev/iwm/if_iwm_util.c Sat Aug 8 20:07:25 2015 (r286466) @@ -163,7 +163,7 @@ iwm_dma_map_mem(void *arg, bus_dma_segme KASSERT(nsegs <= 2, ("too many DMA segments, %d should be <= 2", nsegs)); if (nsegs > 1) - KASSERT(segs[1].ds_addr == segs[0].ds_addr + segs[0].ds_size, + KASSERT(segs[1].ds_addr == segs[0].ds_addr + segs[0].ds_len, ("fragmented DMA memory")); *(bus_addr_t *)arg = segs[0].ds_addr; } @@ -402,4 +402,3 @@ iwm_free_resp(struct iwm_softc *sc, stru sc->sc_wantresp = -1; wakeup(&sc->sc_wantresp); } - From owner-svn-src-head@freebsd.org Sat Aug 8 20:11:49 2015 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 5B4169B60CB; Sat, 8 Aug 2015 20:11:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 39731192; Sat, 8 Aug 2015 20:11:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78KBnRd030404; Sat, 8 Aug 2015 20:11:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78KBmdH030401; Sat, 8 Aug 2015 20:11:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508082011.t78KBmdH030401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 8 Aug 2015 20:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286469 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 20:11:49 -0000 Author: ian Date: Sat Aug 8 20:11:47 2015 New Revision: 286469 URL: https://svnweb.freebsd.org/changeset/base/286469 Log: Provide the tty-layer mutex when initializing the pps api. This allows time_pps_fetch() to be used in blocking mode. Also, don't init the pps api for system devices (consoles) that provide a custom attach routine. The device may actually be a keyboard or other non- tty device. If it wants to do pps processing (unlikely) it must handle everything for itself. (In reality, only a sun keyboard uses a custom attach routine, and it doesn't make a good pps device.) Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_core.c head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Sat Aug 8 20:08:09 2015 (r286468) +++ head/sys/dev/uart/uart_bus.h Sat Aug 8 20:11:47 2015 (r286469) @@ -150,6 +150,7 @@ void uart_sched_softih(struct uart_softc int uart_tty_attach(struct uart_softc *); int uart_tty_detach(struct uart_softc *); +struct mtx *uart_tty_getlock(struct uart_softc *); void uart_tty_intr(void *arg); /* Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Aug 8 20:08:09 2015 (r286468) +++ head/sys/dev/uart/uart_core.c Sat Aug 8 20:11:47 2015 (r286469) @@ -511,9 +511,6 @@ uart_bus_attach(device_t dev) sc->sc_sysdev->stopbits); } - sc->sc_pps.ppscap = PPS_CAPTUREBOTH; - pps_init(&sc->sc_pps); - sc->sc_leaving = 0; sc->sc_testintr = 1; filt = uart_intr(sc); @@ -568,10 +565,17 @@ uart_bus_attach(device_t dev) printf("\n"); } - error = (sc->sc_sysdev != NULL && sc->sc_sysdev->attach != NULL) - ? (*sc->sc_sysdev->attach)(sc) : uart_tty_attach(sc); - if (error) - goto fail; + if (sc->sc_sysdev != NULL && sc->sc_sysdev->attach != NULL) { + if ((error = sc->sc_sysdev->attach(sc)) != 0) + goto fail; + } else { + if ((error = uart_tty_attach(sc)) != 0) + goto fail; + sc->sc_pps.ppscap = PPS_CAPTUREBOTH; + sc->sc_pps.driver_mtx = uart_tty_getlock(sc); + sc->sc_pps.driver_abi = PPS_ABI_VERSION; + pps_init_abi(&sc->sc_pps); + } if (sc->sc_sysdev != NULL) sc->sc_sysdev->hwmtx = sc->sc_hwmtx; Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Sat Aug 8 20:08:09 2015 (r286468) +++ head/sys/dev/uart/uart_tty.c Sat Aug 8 20:11:47 2015 (r286469) @@ -404,3 +404,13 @@ uart_tty_detach(struct uart_softc *sc) return (0); } + +struct mtx * +uart_tty_getlock(struct uart_softc *sc) +{ + + if (sc->sc_u.u_tty.tp != NULL) + return (tty_getlock(sc->sc_u.u_tty.tp)); + else + return (NULL); +} From owner-svn-src-head@freebsd.org Sat Aug 8 20:34:58 2015 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 21FFF9B6409; Sat, 8 Aug 2015 20:34:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 07A1DD0F; Sat, 8 Aug 2015 20:34:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78KYvgL038674; Sat, 8 Aug 2015 20:34:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78KYu5t038669; Sat, 8 Aug 2015 20:34:56 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508082034.t78KYu5t038669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 8 Aug 2015 20:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286470 - in head/sys: arm64/cavium arm64/conf 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.20 Precedence: list List-Id: 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, 08 Aug 2015 20:34:58 -0000 Author: zbb Date: Sat Aug 8 20:34:55 2015 New Revision: 286470 URL: https://svnweb.freebsd.org/changeset/base/286470 Log: Introduce support for internal PCIe for Cavium's ThunderX This driver supports internal PCIe Root Complex on Cavium ThunderX Pass 1.1 hardware. Reviewed by: andrew, jhb Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3031 Added: head/sys/arm64/cavium/ head/sys/arm64/cavium/thunder_pcie.c (contents, props changed) head/sys/arm64/cavium/thunder_pcie_common.c (contents, props changed) head/sys/arm64/cavium/thunder_pcie_common.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Added: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie.c Sat Aug 8 20:34:55 2015 (r286470) @@ -0,0 +1,558 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * 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. + */ + +/* PCIe root complex driver for Cavium Thunder SOC */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "thunder_pcie_common.h" + +#include "pcib_if.h" + +/* Assembling ECAM Configuration Address */ +#define PCIE_BUS_SHIFT 20 +#define PCIE_SLOT_SHIFT 15 +#define PCIE_FUNC_SHIFT 12 +#define PCIE_BUS_MASK 0xFF +#define PCIE_SLOT_MASK 0x1F +#define PCIE_FUNC_MASK 0x07 +#define PCIE_REG_MASK 0xFFF + +#define PCIE_ADDR_OFFSET(bus, slot, func, reg) \ + ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \ + (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT) | \ + (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ + ((reg) & PCIE_REG_MASK)) + +#define THUNDER_ECAM0_CFG_BASE 0x848000000000UL +#define THUNDER_ECAM1_CFG_BASE 0x849000000000UL +#define THUNDER_ECAM2_CFG_BASE 0x84a000000000UL +#define THUNDER_ECAM3_CFG_BASE 0x84b000000000UL +#define THUNDER_ECAM4_CFG_BASE 0x948000000000UL +#define THUNDER_ECAM5_CFG_BASE 0x949000000000UL +#define THUNDER_ECAM6_CFG_BASE 0x94a000000000UL +#define THUNDER_ECAM7_CFG_BASE 0x94b000000000UL + +#define OFW_CELL_TO_UINT64(cell) \ + (((uint64_t)(*(cell)) << 32) | (uint64_t)(*((cell) + 1))) + +#define SPACE_CODE_SHIFT 24 +#define SPACE_CODE_MASK 0x3 +#define SPACE_CODE_IO_SPACE 0x1 +#define PROPS_CELL_SIZE 1 +#define PCI_ADDR_CELL_SIZE 2 + +struct thunder_pcie_softc { + struct pcie_range ranges[MAX_RANGES_TUPLES]; + struct rman mem_rman; + struct resource *res; + int ecam; + device_t dev; +}; + +/* Forward prototypes */ +static struct resource *thunder_pcie_alloc_resource(device_t, + device_t, int, int *, u_long, u_long, u_long, u_int); +static int thunder_pcie_attach(device_t); +static int thunder_pcie_identify_pcib(device_t); +static int thunder_pcie_maxslots(device_t); +static int parse_pci_mem_ranges(struct thunder_pcie_softc *); +static int thunder_pcie_probe(device_t); +static uint32_t thunder_pcie_read_config(device_t, u_int, u_int, u_int, u_int, + int); +static int thunder_pcie_read_ivar(device_t, device_t, int, uintptr_t *); +static int thunder_pcie_release_resource(device_t, device_t, int, int, + struct resource *); +static void thunder_pcie_write_config(device_t, u_int, u_int, + u_int, u_int, uint32_t, int); +static int thunder_pcie_write_ivar(device_t, device_t, int, uintptr_t); + +static int +thunder_pcie_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "cavium,thunder-pcie")) { + device_set_desc(dev, "Cavium Integrated PCI/PCI-E Controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +thunder_pcie_attach(device_t dev) +{ + int rid; + struct thunder_pcie_softc *sc; + int error; + int tuple; + uint64_t base, size; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Identify pcib domain */ + if (thunder_pcie_identify_pcib(dev)) + return (ENXIO); + + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not map memory.\n"); + return (ENXIO); + } + + sc->mem_rman.rm_type = RMAN_ARRAY; + sc->mem_rman.rm_descr = "PCIe Memory"; + + /* Retrieve 'ranges' property from FDT */ + if (bootverbose) + device_printf(dev, "parsing FDT for ECAM%d:\n", + sc->ecam); + if (parse_pci_mem_ranges(sc)) + return (ENXIO); + + /* Initialize rman and allocate memory regions */ + error = rman_init(&sc->mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + base = sc->ranges[tuple].phys_base; + size = sc->ranges[tuple].size; + if ((base == 0) || (size == 0)) + continue; /* empty range element */ + + error = rman_manage_region(&sc->mem_rman, base, base + size - 1); + if (error) { + device_printf(dev, "rman_manage_region() failed. error = %d\n", error); + rman_fini(&sc->mem_rman); + return (error); + } + } + device_add_child(dev, "pci", -1); + + return (bus_generic_attach(dev)); +} + +static int +parse_pci_mem_ranges(struct thunder_pcie_softc *sc) +{ + phandle_t node; + pcell_t pci_addr_cells, parent_addr_cells, size_cells; + pcell_t attributes; + pcell_t *ranges_buf, *cell_ptr; + int cells_count, tuples_count; + int tuple; + int rv; + + node = ofw_bus_get_node(sc->dev); + + /* Find address cells if present */ + if (OF_getencprop(node, "#address-cells", &pci_addr_cells, + sizeof(pci_addr_cells)) < sizeof(pci_addr_cells)) + pci_addr_cells = 2; + + /* Find size cells if present */ + if (OF_getencprop(node, "#size-cells", &size_cells, + sizeof(size_cells)) < sizeof(size_cells)) + size_cells = 1; + + /* Find parent address cells if present */ + if (OF_getencprop(OF_parent(node), "#address-cells", + &parent_addr_cells, sizeof(parent_addr_cells)) < sizeof(parent_addr_cells)) + parent_addr_cells = 2; + + /* Check if FDT format matches driver requirements */ + if ((parent_addr_cells != 2) || (pci_addr_cells != 3) || + (size_cells != 2)) { + device_printf(sc->dev, + "Unexpected number of address or size cells in FDT " + " %d:%d:%d\n", + parent_addr_cells, pci_addr_cells, size_cells); + return (ENXIO); + } + + cells_count = OF_getencprop_alloc(node, "ranges", + sizeof(pcell_t), (void **)&ranges_buf); + if (cells_count == -1) { + device_printf(sc->dev, "Error parsing FDT 'ranges' property\n"); + return (ENXIO); + } + + tuples_count = cells_count / + (pci_addr_cells + parent_addr_cells + size_cells); + if ((tuples_count > MAX_RANGES_TUPLES) || + (tuples_count < MIN_RANGES_TUPLES)) { + device_printf(sc->dev, + "Unexpected number of 'ranges' tuples in FDT\n"); + rv = ENXIO; + goto out; + } + + cell_ptr = ranges_buf; + + for (tuple = 0; tuple < tuples_count; tuple++) { + /* + * TUPLE FORMAT: + * attributes - 32-bit attributes field + * PCI address - bus address combined of two cells in + * a following format: + * + * PA address - physical address combined of two cells in + * a following format: + * + * size - range size combined of two cells in + * a following format: + * + */ + attributes = *cell_ptr; + attributes = (attributes >> SPACE_CODE_SHIFT) & SPACE_CODE_MASK; + if (attributes == SPACE_CODE_IO_SPACE) { + /* Internal PCIe does not support IO space, ignore. */ + sc->ranges[tuple].phys_base = 0; + sc->ranges[tuple].size = 0; + cell_ptr += + (pci_addr_cells + parent_addr_cells + size_cells); + continue; + } + cell_ptr += PROPS_CELL_SIZE; + sc->ranges[tuple].pci_base = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += PCI_ADDR_CELL_SIZE; + sc->ranges[tuple].phys_base = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += parent_addr_cells; + sc->ranges[tuple].size = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += size_cells; + + if (bootverbose) { + device_printf(sc->dev, + "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", + sc->ranges[tuple].pci_base, + sc->ranges[tuple].phys_base, + sc->ranges[tuple].size); + } + + } + for (; tuple < MAX_RANGES_TUPLES; tuple++) { + /* zero-fill remaining tuples to mark empty elements in array */ + sc->ranges[tuple].phys_base = 0; + sc->ranges[tuple].size = 0; + } + + rv = 0; +out: + free(ranges_buf, M_OFWPROP); + return (rv); +} + +static uint32_t +thunder_pcie_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes) +{ + uint64_t offset; + uint32_t data; + struct thunder_pcie_softc *sc; + bus_space_tag_t t; + bus_space_handle_t h; + + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + return (~0U); + + sc = device_get_softc(dev); + + offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); + t = rman_get_bustag(sc->res); + h = rman_get_bushandle(sc->res); + + switch (bytes) { + case 1: + data = bus_space_read_1(t, h, offset); + break; + case 2: + data = le16toh(bus_space_read_2(t, h, offset)); + break; + case 4: + data = le32toh(bus_space_read_4(t, h, offset)); + break; + default: + return (~0U); + } + + return (data); +} + +static void +thunder_pcie_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t val, int bytes) +{ + uint64_t offset; + struct thunder_pcie_softc *sc; + bus_space_tag_t t; + bus_space_handle_t h; + + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + return ; + + sc = device_get_softc(dev); + + offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); + t = rman_get_bustag(sc->res); + h = rman_get_bushandle(sc->res); + + switch (bytes) { + case 1: + bus_space_write_1(t, h, offset, val); + break; + case 2: + bus_space_write_2(t, h, offset, htole16(val)); + break; + case 4: + bus_space_write_4(t, h, offset, htole32(val)); + break; + default: + return; + } + +} + +static int +thunder_pcie_maxslots(device_t dev) +{ + + /* max slots per bus acc. to standard */ + return (PCI_SLOTMAX); +} + +static int +thunder_pcie_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result) +{ + struct thunder_pcie_softc *sc; + + sc = device_get_softc(dev); + + if (index == PCIB_IVAR_BUS) { + /* this pcib is always on bus 0 */ + *result = 0; + return (0); + } + if (index == PCIB_IVAR_DOMAIN) { + *result = sc->ecam; + return (0); + } + + return (ENOENT); +} + +static int +thunder_pcie_write_ivar(device_t dev, device_t child, int index, + uintptr_t value) +{ + + return (ENOENT); +} + +static int +thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *res) +{ + + if (type != SYS_RES_MEMORY) + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, rid, res)); + + return (rman_release_resource(res)); +} + +static struct resource * +thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct thunder_pcie_softc *sc = device_get_softc(dev); + struct rman *rm = NULL; + struct resource *res; + + switch (type) { + case SYS_RES_IOPORT: + goto fail; + break; + case SYS_RES_MEMORY: + rm = &sc->mem_rman; + break; + default: + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + type, rid, start, end, count, flags)); + }; + + if ((start == 0UL) && (end == ~0UL)) { + device_printf(dev, + "Cannot allocate resource with unspecified range\n"); + goto fail; + } + + /* Convert input BUS address to required PHYS */ + if (range_addr_is_pci(sc->ranges, start, count) == 0) + goto fail; + start = range_addr_pci_to_phys(sc->ranges, start); + end = start + count - 1; + + if (bootverbose) { + device_printf(dev, + "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n", + start, end, count); + } + + res = rman_reserve_resource(rm, start, end, count, flags, child); + if (res == NULL) + goto fail; + + rman_set_rid(res, *rid); + + if ((flags & RF_ACTIVE) != 0) + if (bus_activate_resource(child, type, *rid, res)) { + rman_release_resource(res); + goto fail; + } + + return (res); + +fail: + if (bootverbose) { + device_printf(dev, "%s FAIL: type=%d, rid=%d, " + "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", + __func__, type, *rid, start, end, count, flags); + } + + return (NULL); +} + +static int +thunder_pcie_identify_pcib(device_t dev) +{ + struct thunder_pcie_softc *sc; + u_long start; + + sc = device_get_softc(dev); + start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0); + + switch(start) { + case THUNDER_ECAM0_CFG_BASE: + sc->ecam = 0; + break; + case THUNDER_ECAM1_CFG_BASE: + sc->ecam = 1; + break; + case THUNDER_ECAM2_CFG_BASE: + sc->ecam = 2; + break; + case THUNDER_ECAM3_CFG_BASE: + sc->ecam = 3; + break; + case THUNDER_ECAM4_CFG_BASE: + sc->ecam = 4; + break; + case THUNDER_ECAM5_CFG_BASE: + sc->ecam = 5; + break; + case THUNDER_ECAM6_CFG_BASE: + sc->ecam = 6; + break; + case THUNDER_ECAM7_CFG_BASE: + sc->ecam = 7; + break; + default: + device_printf(dev, + "error: incorrect resource address=%#lx.\n", start); + return (ENXIO); + } + return (0); +} + +static device_method_t thunder_pcie_methods[] = { + DEVMETHOD(device_probe, thunder_pcie_probe), + DEVMETHOD(device_attach, thunder_pcie_attach), + DEVMETHOD(pcib_maxslots, thunder_pcie_maxslots), + DEVMETHOD(pcib_read_config, thunder_pcie_read_config), + DEVMETHOD(pcib_write_config, thunder_pcie_write_config), + DEVMETHOD(bus_read_ivar, thunder_pcie_read_ivar), + DEVMETHOD(bus_write_ivar, thunder_pcie_write_ivar), + DEVMETHOD(bus_alloc_resource, thunder_pcie_alloc_resource), + DEVMETHOD(bus_release_resource, thunder_pcie_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(pcib_map_msi, thunder_common_map_msi), + DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_common_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + + DEVMETHOD_END +}; + +static driver_t thunder_pcie_driver = { + "pcib", + thunder_pcie_methods, + sizeof(struct thunder_pcie_softc), +}; + +static devclass_t thunder_pcie_devclass; + +DRIVER_MODULE(thunder_pcib, simplebus, thunder_pcie_driver, +thunder_pcie_devclass, 0, 0); +DRIVER_MODULE(thunder_pcib, ofwbus, thunder_pcie_driver, +thunder_pcie_devclass, 0, 0); Added: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_common.c Sat Aug 8 20:34:55 2015 (r286470) @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * 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. + */ + +/* Common PCIe functions for Cavium Thunder SOC */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "thunder_pcie_common.h" + + +int +thunder_common_map_msi(device_t pcib, device_t child, int irq, + uint64_t *addr, uint32_t *data) +{ + int error; + + error = arm_map_msix(child, irq, addr, data); + return (error); +} + +int +thunder_common_alloc_msix(device_t pcib, device_t child, int *irq) +{ + int error; + + error = arm_alloc_msix(child, irq); + return (error); +} + +int +thunder_common_release_msix(device_t pcib, device_t child, int irq) +{ + int error; + + error = arm_release_msix(child, irq); + return (error); +} + +int +thunder_common_alloc_msi(device_t pcib, device_t child, int count, int maxcount, + int *irqs) +{ + int error; + + error = arm_alloc_msi(child, count, irqs); + return (error); +} + +int +thunder_common_release_msi(device_t pcib, device_t child, int count, int *irqs) +{ + int error; + + error = arm_release_msi(child, count, irqs); + return (error); +} + +uint32_t +range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) +{ + struct pcie_range *r; + int tuple; + + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + r = &ranges[tuple]; + if (addr >= r->pci_base && + addr < (r->pci_base + r->size) && + size < r->size) { + /* Address is within PCI range */ + return (1); + } + } + + /* Address is outside PCI range */ + return (0); +} + +uint32_t +range_addr_is_phys(struct pcie_range *ranges, uint64_t addr, uint64_t size) +{ + struct pcie_range *r; + int tuple; + + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + r = &ranges[tuple]; + if (addr >= r->phys_base && + addr < (r->phys_base + r->size) && + size < r->size) { + /* Address is within Physical range */ + return (1); + } + } + + /* Address is outside Physical range */ + return (0); +} + +uint64_t +range_addr_pci_to_phys(struct pcie_range *ranges, uint64_t pci_addr) +{ + struct pcie_range *r; + uint64_t offset; + int tuple; + + /* Find physical address corresponding to given bus address */ + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + r = &ranges[tuple]; + if (pci_addr >= r->pci_base && + pci_addr < (r->pci_base + r->size)) { + /* Given pci addr is in this range. + * Translate bus addr to phys addr. + */ + offset = pci_addr - r->pci_base; + return (r->phys_base + offset); + } + } + return (0); +} + Added: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_common.h Sat Aug 8 20:34:55 2015 (r286470) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * 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$ + */ + +#ifndef _CAVIUM_THUNDER_PCIE_COMMON_H_ +#define _CAVIUM_THUNDER_PCIE_COMMON_H_ + +#define MAX_RANGES_TUPLES 5 +#define MIN_RANGES_TUPLES 2 + +struct pcie_range { + uint64_t pci_base; + uint64_t phys_base; + uint64_t size; + uint64_t flags; +}; + +uint32_t range_addr_is_pci(struct pcie_range *, uint64_t, uint64_t); +uint32_t range_addr_is_phys(struct pcie_range *, uint64_t, uint64_t); +uint64_t range_addr_pci_to_phys(struct pcie_range *, uint64_t); +int thunder_common_alloc_msi(device_t, device_t, int, int, int *); +int thunder_common_alloc_msix(device_t, device_t, int *); +int thunder_common_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +int thunder_common_release_msi(device_t, device_t, int, int *); +int thunder_common_release_msix(device_t, device_t, int); + +#endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Aug 8 20:11:47 2015 (r286469) +++ head/sys/arm64/conf/GENERIC Sat Aug 8 20:34:55 2015 (r286470) @@ -89,6 +89,10 @@ device virtio_mmio device virtio_blk device vtnet +# Bus drivers +device pci +device thunder_pci + # Serial (COM) ports device uart # Generic UART driver device pl011 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Aug 8 20:11:47 2015 (r286469) +++ head/sys/conf/files.arm64 Sat Aug 8 20:34:55 2015 (r286470) @@ -50,6 +50,8 @@ arm64/arm64/uma_machdep.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard +arm64/cavium/thunder_pcie.c optional thunder_pci fdt +arm64/cavium/thunder_pcie_common.c optional thunder_pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/acpica/acpi_if.m optional acpi From owner-svn-src-head@freebsd.org Sat Aug 8 20:45:13 2015 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 3A9B29B657A; Sat, 8 Aug 2015 20:45:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2B16E1566; Sat, 8 Aug 2015 20:45:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78KjDkE042853; Sat, 8 Aug 2015 20:45:13 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78KjD0M042852; Sat, 8 Aug 2015 20:45:13 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082045.t78KjD0M042852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 20:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286471 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 20:45:13 -0000 Author: rpaulo Date: Sat Aug 8 20:45:12 2015 New Revision: 286471 URL: https://svnweb.freebsd.org/changeset/base/286471 Log: sys/conf/options: add IWM_DEBUG. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Aug 8 20:34:55 2015 (r286470) +++ head/sys/conf/options Sat Aug 8 20:45:12 2015 (r286471) @@ -852,6 +852,9 @@ MWL_AGGR_SIZE opt_mwl.h MWL_TX_NODROP opt_mwl.h # Options for the Intel 802.11n wireless driver +IWM_DEBUG opt_iwm.h + +# Options for the Intel 802.11n wireless driver IWN_DEBUG opt_iwn.h # Options for the Intel 3945ABG wireless driver From owner-svn-src-head@freebsd.org Sat Aug 8 20:45:48 2015 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 2B9749B65AE; Sat, 8 Aug 2015 20:45:48 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1D08A16BC; Sat, 8 Aug 2015 20:45:48 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78KjlS7042916; Sat, 8 Aug 2015 20:45:47 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78KjlK1042915; Sat, 8 Aug 2015 20:45:47 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082045.t78KjlK1042915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 20:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286472 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 20:45:48 -0000 Author: rpaulo Date: Sat Aug 8 20:45:47 2015 New Revision: 286472 URL: https://svnweb.freebsd.org/changeset/base/286472 Log: Add nodevice iwmfw to WITHOUT_SOURCELESS_UCODE. Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_UCODE Sat Aug 8 20:45:12 2015 (r286471) +++ head/sys/conf/WITHOUT_SOURCELESS_UCODE Sat Aug 8 20:45:47 2015 (r286472) @@ -20,6 +20,7 @@ nodevice cp nodevice ctau nodevice ipwfw nodevice iwifw +nodevice iwmfw nodevice iwnfw nodevice wpifw From owner-svn-src-head@freebsd.org Sat Aug 8 20:56:31 2015 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 6578C9B67C4; Sat, 8 Aug 2015 20:56:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4C19C1D71; Sat, 8 Aug 2015 20:56:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78KuVoh047086; Sat, 8 Aug 2015 20:56:31 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78KuVBv047085; Sat, 8 Aug 2015 20:56:31 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508082056.t78KuVBv047085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 8 Aug 2015 20:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286473 - head/sys/arm64/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.20 Precedence: list List-Id: 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, 08 Aug 2015 20:56:31 -0000 Author: zbb Date: Sat Aug 8 20:56:30 2015 New Revision: 286473 URL: https://svnweb.freebsd.org/changeset/base/286473 Log: Add Ethernet and block device drivers to ARM64 GENERIC Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Aug 8 20:45:47 2015 (r286472) +++ head/sys/arm64/conf/GENERIC Sat Aug 8 20:56:30 2015 (r286473) @@ -93,6 +93,16 @@ device vtnet device pci device thunder_pci +# Ethernet NICs +device em # Intel PRO/1000 Gigabit Ethernet Family +device mii +device miibus # MII bus support + +# Block devices +device ahci +device scbus +device da + # Serial (COM) ports device uart # Generic UART driver device pl011 From owner-svn-src-head@freebsd.org Sat Aug 8 21:08:11 2015 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 65B5D9B6A2C; Sat, 8 Aug 2015 21:08:11 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3C5666AF; Sat, 8 Aug 2015 21:08:11 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78L8Bbs051532; Sat, 8 Aug 2015 21:08:11 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78L8BYY051531; Sat, 8 Aug 2015 21:08:11 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082108.t78L8BYY051531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 21:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286474 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 21:08:11 -0000 Author: rpaulo Date: Sat Aug 8 21:08:10 2015 New Revision: 286474 URL: https://svnweb.freebsd.org/changeset/base/286474 Log: sys/conf/files: add iwm and iwmfw. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 8 20:56:30 2015 (r286473) +++ head/sys/conf/files Sat Aug 8 21:08:10 2015 (r286474) @@ -1605,6 +1605,58 @@ iwi_monitor.fw optional iwimonitorfw | compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" +dev/iwm/if_iwm.c optional iwm +dev/iwm/if_iwm_binding.c optional iwm +dev/iwm/if_iwm_mac_ctxt.c optional iwm +dev/iwm/if_iwm_pcie_trans.c optional iwm +dev/iwm/if_iwm_phy_ctxt.c optional iwm +dev/iwm/if_iwm_phy_db.c optional iwm +dev/iwm/if_iwm_power.c optional iwm +dev/iwm/if_iwm_scan.c optional iwm +dev/iwm/if_iwm_time_event.c optional iwm +dev/iwm/if_iwm_util.c optional iwm +iwm3160fw.c optional iwm3160fw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm3160.fw:iwm3160fw -miwm3160fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm3160fw.c" +iwm3160fw.fwo optional iwm3160fw | iwmfw \ + dependency "iwm3160.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm3160fw.fwo" +iwm3160.fw optional iwm3160fw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-3160-9.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm3160.fw" +iwm7260fw.c optional iwm7260fw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm7260.fw:iwm7260fw -miwm7260fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm7260fw.c" +iwm7260fw.fwo optional iwm7260fw | iwmfw \ + dependency "iwm7260.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm7260fw.fwo" +iwm7260.fw optional iwm7260fw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-7260-9.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm7260.fw" +iwm7265fw.c optional iwm7265fw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm7265.fw:iwm7265fw -miwm7265fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm7265fw.c" +iwm7265fw.fwo optional iwm7265fw | iwmfw \ + dependency "iwm7265.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm7265fw.fwo" +iwm7265.fw optional iwm7265fw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-7265-9.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm7265.fw" dev/iwn/if_iwn.c optional iwn iwn1000fw.c optional iwn1000fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \ From owner-svn-src-head@freebsd.org Sat Aug 8 21:08:40 2015 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 4F9F89B6A8A; Sat, 8 Aug 2015 21:08:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3C460853; Sat, 8 Aug 2015 21:08:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78L8e34051618; Sat, 8 Aug 2015 21:08:40 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78L8aRP051604; Sat, 8 Aug 2015 21:08:36 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082108.t78L8aRP051604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 21:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286475 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 21:08:40 -0000 Author: rpaulo Date: Sat Aug 8 21:08:35 2015 New Revision: 286475 URL: https://svnweb.freebsd.org/changeset/base/286475 Log: iwm: use the proper include path for iwm headers. Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_binding.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwm_phy_ctxt.c head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_util.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,19 +148,19 @@ __FBSDID("$FreeBSD$"); #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 const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ Modified: head/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- head/sys/dev/iwm/if_iwm_binding.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_binding.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,11 +148,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * BEGIN iwlwifi/mvm/binding.c Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,11 +148,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * BEGIN mvm/mac-ctxt.c Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,11 +148,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - -#include +#include +#include +#include +#include /* * This is a subset of what's in linux iwlwifi/pcie/trans.c. Modified: head/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_ctxt.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_phy_ctxt.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,18 +148,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include - -#if 0 -#include -#include -#include -#include -#endif -#include +#include +#include +#include +#include +#include /* * BEGIN iwlwifi/mvm/phy-ctxt.c Modified: head/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_phy_db.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,11 +148,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * BEGIN iwl-phy-db.c Modified: head/sys/dev/iwm/if_iwm_power.c ============================================================================== --- head/sys/dev/iwm/if_iwm_power.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_power.c Sat Aug 8 21:08:35 2015 (r286475) @@ -132,11 +132,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * BEGIN mvm/power.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_scan.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,21 +148,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#if 0 -#include -#include -#include -#include -#include -#include -#include -#endif - -#include +#include +#include +#include +#include +#include /* * BEGIN mvm/scan.c Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_time_event.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,12 +148,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* * For the high priority TE use a time event type that has similar priority to Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Sat Aug 8 21:08:10 2015 (r286474) +++ head/sys/dev/iwm/if_iwm_util.c Sat Aug 8 21:08:35 2015 (r286475) @@ -148,12 +148,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static void iwm_dma_map_mem(void *arg, bus_dma_segment_t *segs, int nsegs, int error) From owner-svn-src-head@freebsd.org Sat Aug 8 21:09:42 2015 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 E8E819B6AC9; Sat, 8 Aug 2015 21:09:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D9E5C999; Sat, 8 Aug 2015 21:09:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78L9gsg051737; Sat, 8 Aug 2015 21:09:42 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78L9gSc051733; Sat, 8 Aug 2015 21:09:42 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201508082109.t78L9gSc051733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 8 Aug 2015 21:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286476 - in head/sys/modules: . iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 21:09:43 -0000 Author: rpaulo Date: Sat Aug 8 21:09:41 2015 New Revision: 286476 URL: https://svnweb.freebsd.org/changeset/base/286476 Log: Build the iwm and iwmfw modules by default on x86. Modified: head/sys/modules/Makefile head/sys/modules/iwm/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Aug 8 21:08:35 2015 (r286475) +++ head/sys/modules/Makefile Sat Aug 8 21:09:41 2015 (r286476) @@ -174,6 +174,8 @@ SUBDIR= \ ${_ispfw} \ ${_iwi} \ ${_iwifw} \ + ${_iwm} \ + ${_iwmfw} \ ${_iwn} \ ${_iwnfw} \ ${_ix} \ @@ -575,20 +577,18 @@ _ida= ida _iir= iir _ipmi= ipmi _ips= ips -_ipw= ipw -.if ${MK_SOURCELESS_UCODE} != "no" -_ipwfw= ipwfw -.endif _isci= isci +_ipw= ipw _iwi= iwi -.if ${MK_SOURCELESS_UCODE} != "no" -_iwifw= iwifw -.endif +_iwm= iwm _iwn= iwn +_ixgb= ixgb .if ${MK_SOURCELESS_UCODE} != "no" +_ipwfw= ipwfw +_iwifw= iwifw +_iwmfw= iwmfw _iwnfw= iwnfw .endif -_ixgb= ixgb .if ${MK_OFED} != "no" || defined(ALL_MODULES) _mlx4= mlx4 _mlx4ib= mlx4ib Modified: head/sys/modules/iwm/Makefile ============================================================================== --- head/sys/modules/iwm/Makefile Sat Aug 8 21:08:35 2015 (r286475) +++ head/sys/modules/iwm/Makefile Sat Aug 8 21:09:41 2015 (r286476) @@ -9,9 +9,8 @@ SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt SRCS+= if_iwm_power.c if_iwm_scan.c # bus layer SRCS+= if_iwm_pcie_trans.c - SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h -CFLAGS+= -DIWM_DEBUG -I${.CURDIR}/../../dev/iwm +CFLAGS+= -DIWM_DEBUG .include From owner-svn-src-head@freebsd.org Sat Aug 8 21:32:04 2015 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 6A14B9B6E95; Sat, 8 Aug 2015 21:32:04 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5A5141476; Sat, 8 Aug 2015 21:32:04 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78LW4oY064492; Sat, 8 Aug 2015 21:32:04 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78LW3gr064489; Sat, 8 Aug 2015 21:32:03 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508082132.t78LW3gr064489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 8 Aug 2015 21:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286477 - in head/sys: arm64/cavium 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.20 Precedence: list List-Id: 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, 08 Aug 2015 21:32:04 -0000 Author: zbb Date: Sat Aug 8 21:32:03 2015 New Revision: 286477 URL: https://svnweb.freebsd.org/changeset/base/286477 Log: Add support for external PCIe (PEM) on Cavium's ThunderX Reviewed by: jhb Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3257 Added: head/sys/arm64/cavium/thunder_pcie_pem.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Sat Aug 8 21:32:03 2015 (r286477) @@ -0,0 +1,637 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * 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. + */ + +/* PCIe external MAC root complex driver (PEM) for Cavium Thunder SOC */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "thunder_pcie_common.h" +#include "pcib_if.h" + +#define THUNDER_PEM_DEVICE_ID 0xa020 +#define THUNDER_PEM_VENDOR_ID 0x177d +#define THUNDER_PEM_DESC "ThunderX PEM" + +/* ThunderX specific defines */ +#define THUNDER_PEMn_REG_BASE(unit) (0x87e0c0000000UL | ((unit) << 24)) +#define PCIERC_CFG002 0x08 +#define PCIERC_CFG006 0x18 +#define PCIERC_CFG032 0x80 +#define PCIERC_CFG006_SEC_BUS(reg) (((reg) >> 8) & 0xFF) +#define PEM_CFG_RD_REG_ALIGN(reg) ((reg) & ~0x3) +#define PEM_CFG_RD_REG_DATA(val) (((val) >> 32) & 0xFFFFFFFF) +#define PEM_CFG_RD 0x30 +#define PEM_CFG_LINK_MASK 0x3 +#define PEM_CFG_LINK_RDY 0x3 +#define PEM_CFG_SLIX_TO_REG(slix) ((slix) << 4) +#define SBNUM_OFFSET 0x8 +#define SBNUM_MASK 0xFF +#define PEM_ON_REG 0x420 +#define PEM_CTL_STATUS 0x0 +#define PEM_LINK_ENABLE (1 << 4) +#define PEM_LINK_DLLA (1 << 29) +#define PEM_LINK_LT (1 << 27) +#define PEM_BUS_SHIFT (24) +#define PEM_SLOT_SHIFT (19) +#define PEM_FUNC_SHIFT (16) +#define SLIX_S2M_REGX_ACC 0x874001000000UL +#define SLIX_S2M_REGX_ACC_SIZE 0x1000 +#define SLIX_S2M_REGX_ACC_SPACING 0x001000000000UL +#define SLI_BASE 0x880000000000UL +#define SLI_WINDOW_SPACING 0x004000000000UL +#define SLI_WINDOW_SIZE 0x0000FF000000UL +#define SLI_PCI_OFFSET 0x001000000000UL +#define SLI_NODE_SHIFT (44) +#define SLI_NODE_MASK (3) +#define SLI_GROUP_SHIFT (40) +#define SLI_ID_SHIFT (24) +#define SLI_ID_MASK (7) +#define SLI_PEMS_PER_GROUP (3) +#define SLI_GROUPS_PER_NODE (2) +#define SLI_PEMS_PER_NODE (SLI_PEMS_PER_GROUP * SLI_GROUPS_PER_NODE) +#define SLI_ACC_REG_CNT (256) + +/* + * Each PEM device creates its own bus with + * own address translation, so we can adjust bus addresses + * as we want. To support 32-bit cards let's assume + * PCI window assignment looks as following: + * + * 0x00000000 - 0x000FFFFF IO + * 0x00100000 - 0xFFFFFFFF Memory + */ +#define PCI_IO_BASE 0x00000000UL +#define PCI_IO_SIZE 0x00100000UL +#define PCI_MEMORY_BASE PCI_IO_SIZE +#define PCI_MEMORY_SIZE 0xFFF00000UL + +struct thunder_pem_softc { + device_t dev; + struct resource *reg; + bus_space_tag_t reg_bst; + bus_space_handle_t reg_bsh; + struct pcie_range ranges[MAX_RANGES_TUPLES]; + struct rman mem_rman; + struct rman io_rman; + bus_space_handle_t pem_sli_base; + uint32_t node; + uint32_t id; + uint32_t sli; + uint32_t sli_group; + uint64_t sli_window_base; +}; + +static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, + int *, u_long, u_long, u_long, u_int); +static int thunder_pem_attach(device_t); +static int thunder_pem_detach(device_t); +static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); +static int thunder_pem_link_init(struct thunder_pem_softc *); +static int thunder_pem_maxslots(device_t); +static int thunder_pem_probe(device_t); +static uint32_t thunder_pem_read_config(device_t, u_int, u_int, u_int, u_int, + int); +static int thunder_pem_read_ivar(device_t, device_t, int, uintptr_t *); +static void thunder_pem_release_all(device_t); +static int thunder_pem_release_resource(device_t, device_t, int, int, + struct resource *); +static void thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *, + int, int); +static void thunder_pem_write_config(device_t, u_int, u_int, u_int, u_int, + uint32_t, int); +static int thunder_pem_write_ivar(device_t, device_t, int, uintptr_t); + +/* Global handlers for SLI interface */ +static bus_space_handle_t sli0_s2m_regx_base = 0; +static bus_space_handle_t sli1_s2m_regx_base = 0; + +static device_method_t thunder_pem_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, thunder_pem_probe), + DEVMETHOD(device_attach, thunder_pem_attach), + DEVMETHOD(device_detach, thunder_pem_detach), + DEVMETHOD(pcib_maxslots, thunder_pem_maxslots), + DEVMETHOD(pcib_read_config, thunder_pem_read_config), + DEVMETHOD(pcib_write_config, thunder_pem_write_config), + DEVMETHOD(bus_read_ivar, thunder_pem_read_ivar), + DEVMETHOD(bus_write_ivar, thunder_pem_write_ivar), + DEVMETHOD(bus_alloc_resource, thunder_pem_alloc_resource), + DEVMETHOD(bus_release_resource, thunder_pem_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(pcib_map_msi, thunder_common_map_msi), + DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_common_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + DEVMETHOD_END +}; + +static driver_t thunder_pem_driver = { + "pcib", + thunder_pem_methods, + sizeof(struct thunder_pem_softc), +}; + +static int +thunder_pem_maxslots(device_t dev) +{ + + /* max slots per bus acc. to standard */ + return (PCI_SLOTMAX); +} + +static int +thunder_pem_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result) +{ + struct thunder_pem_softc *sc; + int secondary_bus = 0; + + sc = device_get_softc(dev); + + if (index == PCIB_IVAR_BUS) { + secondary_bus = thunder_pem_config_reg_read(sc, PCIERC_CFG006); + *result = PCIERC_CFG006_SEC_BUS(secondary_bus); + return (0); + } + if (index == PCIB_IVAR_DOMAIN) { + *result = sc->id; + return (0); + } + + return (ENOENT); +} + +static int +thunder_pem_write_ivar(device_t dev, device_t child, int index, + uintptr_t value) +{ + + return (ENOENT); +} + +static int +thunder_pem_identify(device_t dev) +{ + struct thunder_pem_softc *sc; + u_long start; + + sc = device_get_softc(dev); + start = rman_get_start(sc->reg); + + /* Calculate PEM designations from its address */ + sc->node = (start >> SLI_NODE_SHIFT) & SLI_NODE_MASK; + sc->id = ((start >> SLI_ID_SHIFT) & SLI_ID_MASK) + + (SLI_PEMS_PER_NODE * sc->node); + sc->sli = sc->id % SLI_PEMS_PER_GROUP; + sc->sli_group = (sc->id / SLI_PEMS_PER_GROUP) % SLI_GROUPS_PER_NODE; + sc->sli_window_base = SLI_BASE | + (((uint64_t)sc->node) << SLI_NODE_SHIFT) | + ((uint64_t)sc->sli_group << SLI_GROUP_SHIFT); + sc->sli_window_base += SLI_WINDOW_SPACING * sc->sli; + + return (0); +} + +static void +thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *sc, + int sli_group, int slix) +{ + uint64_t regval; + bus_space_handle_t handle = 0; + + KASSERT(slix >= 0 && slix <= SLI_ACC_REG_CNT, ("Invalid SLI index")); + + if (sli_group == 0) + handle = sli0_s2m_regx_base; + else if (sli_group == 1) + handle = sli1_s2m_regx_base; + else + device_printf(sc->dev, "SLI group is not correct\n"); + + if (handle) { + /* Clear lower 32-bits of the SLIx register */ + regval = bus_space_read_8(sc->reg_bst, handle, + PEM_CFG_SLIX_TO_REG(slix)); + regval &= ~(0xFFFFFFFFUL); + bus_space_write_8(sc->reg_bst, handle, + PEM_CFG_SLIX_TO_REG(slix), regval); + } +} + +static int +thunder_pem_link_init(struct thunder_pem_softc *sc) +{ + uint64_t regval; + + /* check whether PEM is safe to access. */ + regval = bus_space_read_8(sc->reg_bst, sc->reg_bsh, PEM_ON_REG); + if ((regval & PEM_CFG_LINK_MASK) != PEM_CFG_LINK_RDY) { + device_printf(sc->dev, "PEM%d is not ON\n", sc->id); + return (ENXIO); + } + + regval = bus_space_read_8(sc->reg_bst, sc->reg_bsh, PEM_CTL_STATUS); + regval |= PEM_LINK_ENABLE; + bus_space_write_8(sc->reg_bst, sc->reg_bsh, PEM_CTL_STATUS, regval); + + /* Wait 1ms as per Cavium specification */ + DELAY(1000); + + regval = thunder_pem_config_reg_read(sc, PCIERC_CFG032); + + if (((regval & PEM_LINK_DLLA) == 0) || ((regval & PEM_LINK_LT) != 0)) { + device_printf(sc->dev, "PCIe RC: Port %d Link Timeout\n", + sc->id); + return (ENXIO); + } + + return (0); +} + +static int +thunder_pem_init(struct thunder_pem_softc *sc) +{ + int i, retval = 0; + + retval = thunder_pem_link_init(sc); + if (retval) { + device_printf(sc->dev, "%s failed\n", __func__); + return retval; + } + + retval = bus_space_map(sc->reg_bst, sc->sli_window_base, + SLI_WINDOW_SIZE, 0, &sc->pem_sli_base); + if (retval) { + device_printf(sc->dev, + "Unable to map RC%d pem_addr base address", sc->id); + return (ENOMEM); + } + + /* To support 32-bit PCIe devices, set S2M_REGx_ACC[BA]=0x0 */ + for (i = 0; i < SLI_ACC_REG_CNT; i++) { + thunder_pem_slix_s2m_regx_acc_modify(sc, sc->sli_group, i); + } + + return (retval); +} + +static uint64_t +thunder_pem_config_reg_read(struct thunder_pem_softc *sc, int reg) +{ + uint64_t data; + + /* Write to ADDR register */ + bus_space_write_8(sc->reg_bst, sc->reg_bsh, PEM_CFG_RD, + PEM_CFG_RD_REG_ALIGN(reg)); + bus_space_barrier(sc->reg_bst, sc->reg_bsh, PEM_CFG_RD, 8, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + /* Read from DATA register */ + data = PEM_CFG_RD_REG_DATA(bus_space_read_8(sc->reg_bst, sc->reg_bsh, + PEM_CFG_RD)); + + return (data); +} + +static uint32_t +thunder_pem_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes) +{ + uint64_t offset; + uint32_t data; + struct thunder_pem_softc *sc; + bus_space_tag_t t; + bus_space_handle_t h; + + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + return (~0U); + + sc = device_get_softc(dev); + + /* Calculate offset */ + offset = (bus << PEM_BUS_SHIFT) | (slot << PEM_SLOT_SHIFT) | + (func << PEM_FUNC_SHIFT) | reg; + t = sc->reg_bst; + h = sc->pem_sli_base; + + switch (bytes) { + case 1: + data = bus_space_read_1(t, h, offset); + break; + case 2: + data = le16toh(bus_space_read_2(t, h, offset)); + break; + case 4: + data = le32toh(bus_space_read_4(t, h, offset)); + break; + default: + return (~0U); + } + + return (data); +} + +static void +thunder_pem_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t val, int bytes) +{ + uint64_t offset; + struct thunder_pem_softc *sc; + bus_space_tag_t t; + bus_space_handle_t h; + + if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || + (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + return; + + sc = device_get_softc(dev); + + /* Calculate offset */ + offset = (bus << PEM_BUS_SHIFT) | (slot << PEM_SLOT_SHIFT) | + (func << PEM_FUNC_SHIFT) | reg; + t = sc->reg_bst; + h = sc->pem_sli_base; + + switch (bytes) { + case 1: + bus_space_write_1(t, h, offset, val); + break; + case 2: + bus_space_write_2(t, h, offset, htole16(val)); + break; + case 4: + bus_space_write_4(t, h, offset, htole32(val)); + break; + default: + return; + } +} + +static struct resource * +thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct thunder_pem_softc *sc = device_get_softc(dev); + struct rman *rm = NULL; + struct resource *res; + device_t parent_dev; + + switch (type) { + case SYS_RES_IOPORT: + rm = &sc->io_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->mem_rman; + break; + default: + /* Find parent device. On ThunderX we know an exact path. */ + parent_dev = device_get_parent(device_get_parent(dev)); + return (BUS_ALLOC_RESOURCE(parent_dev, dev, type, rid, start, + end, count, flags)); + }; + + if ((start == 0UL) && (end == ~0UL)) { + device_printf(dev, + "Cannot allocate resource with unspecified range\n"); + goto fail; + } + + /* Translate PCI address to host PHYS */ + if (range_addr_is_pci(sc->ranges, start, count) == 0) + goto fail; + start = range_addr_pci_to_phys(sc->ranges, start); + end = start + count - 1; + + if (bootverbose) { + device_printf(dev, + "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n", + start, end, count); + } + + res = rman_reserve_resource(rm, start, end, count, flags, child); + if (res == NULL) + goto fail; + + rman_set_rid(res, *rid); + + if (flags & RF_ACTIVE) + if (bus_activate_resource(child, type, *rid, res)) { + rman_release_resource(res); + goto fail; + } + + return (res); + +fail: + if (bootverbose) { + device_printf(dev, "%s FAIL: type=%d, rid=%d, " + "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", + __func__, type, *rid, start, end, count, flags); + } + + return (NULL); +} + +static int +thunder_pem_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *res) +{ + device_t parent_dev; + + /* Find parent device. On ThunderX we know an exact path. */ + parent_dev = device_get_parent(device_get_parent(dev)); + + if ((type != SYS_RES_MEMORY) && (type != SYS_RES_IOPORT)) + return (BUS_RELEASE_RESOURCE(parent_dev, child, + type, rid, res)); + + return (rman_release_resource(res)); +} + +static int +thunder_pem_probe(device_t dev) +{ + uint16_t pci_vendor_id; + uint16_t pci_device_id; + + pci_vendor_id = pci_get_vendor(dev); + pci_device_id = pci_get_device(dev); + + if ((pci_vendor_id == THUNDER_PEM_VENDOR_ID) && + (pci_device_id == THUNDER_PEM_DEVICE_ID)) { + device_set_desc_copy(dev, THUNDER_PEM_DESC); + return (0); + } + + return (ENXIO); +} + +static int +thunder_pem_attach(device_t dev) +{ + struct thunder_pem_softc *sc; + int error; + int rid; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Allocate memory for BAR(0) */ + rid = PCIR_BAR(0); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->reg == NULL) { + device_printf(dev, "Failed to allocate resource\n"); + return (ENXIO); + } + sc->reg_bst = rman_get_bustag(sc->reg); + sc->reg_bsh = rman_get_bushandle(sc->reg); + + /* Map SLI, do it only once */ + if (!sli0_s2m_regx_base) { + bus_space_map(sc->reg_bst, SLIX_S2M_REGX_ACC, + SLIX_S2M_REGX_ACC_SIZE, 0, &sli0_s2m_regx_base); + } + if (!sli1_s2m_regx_base) { + bus_space_map(sc->reg_bst, SLIX_S2M_REGX_ACC + + SLIX_S2M_REGX_ACC_SPACING, SLIX_S2M_REGX_ACC_SIZE, 0, + &sli1_s2m_regx_base); + } + + if ((sli0_s2m_regx_base == 0) || (sli1_s2m_regx_base == 0)) { + device_printf(dev, + "bus_space_map failed to map slix_s2m_regx_base\n"); + goto fail; + } + + /* Identify PEM */ + if (thunder_pem_identify(dev) != 0) + goto fail; + + /* Initialize rman and allocate regions */ + sc->mem_rman.rm_type = RMAN_ARRAY; + sc->mem_rman.rm_descr = "PEM PCIe Memory"; + error = rman_init(&sc->mem_rman); + if (error != 0) { + device_printf(dev, "memory rman_init() failed. error = %d\n", + error); + goto fail; + } + sc->io_rman.rm_type = RMAN_ARRAY; + sc->io_rman.rm_descr = "PEM PCIe IO"; + error = rman_init(&sc->io_rman); + if (error != 0) { + device_printf(dev, "IO rman_init() failed. error = %d\n", + error); + goto fail_mem; + } + + /* Fill memory window */ + sc->ranges[0].pci_base = PCI_MEMORY_BASE; + sc->ranges[0].size = PCI_MEMORY_SIZE; + sc->ranges[0].phys_base = sc->sli_window_base + SLI_PCI_OFFSET + + sc->ranges[0].pci_base; + rman_manage_region(&sc->mem_rman, sc->ranges[0].phys_base, + sc->ranges[0].phys_base + sc->ranges[0].size - 1); + + /* Fill IO window */ + sc->ranges[1].pci_base = PCI_IO_BASE; + sc->ranges[1].size = PCI_IO_SIZE; + sc->ranges[1].phys_base = sc->sli_window_base + SLI_PCI_OFFSET + + sc->ranges[1].pci_base; + rman_manage_region(&sc->io_rman, sc->ranges[1].phys_base, + sc->ranges[1].phys_base + sc->ranges[1].size - 1); + + if (thunder_pem_init(sc)) { + device_printf(dev, "Failure during PEM init\n"); + goto fail_io; + } + + device_add_child(dev, "pci", -1); + + return (bus_generic_attach(dev)); + +fail_io: + rman_fini(&sc->io_rman); +fail_mem: + rman_fini(&sc->mem_rman); +fail: + bus_free_resource(dev, SYS_RES_MEMORY, sc->reg); + return (ENXIO); +} + +static void +thunder_pem_release_all(device_t dev) +{ + struct thunder_pem_softc *sc; + + sc = device_get_softc(dev); + + rman_fini(&sc->io_rman); + rman_fini(&sc->mem_rman); + + if (sc->reg != NULL) + bus_free_resource(dev, SYS_RES_MEMORY, sc->reg); +} + +static int +thunder_pem_detach(device_t dev) +{ + + thunder_pem_release_all(dev); + + return (0); +} + +static devclass_t thunder_pem_devclass; + +DRIVER_MODULE(thunder_pem, pci, thunder_pem_driver, thunder_pem_devclass, 0, 0); +MODULE_DEPEND(thunder_pem, pci, 1, 1, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Aug 8 21:09:41 2015 (r286476) +++ head/sys/conf/files.arm64 Sat Aug 8 21:32:03 2015 (r286477) @@ -51,6 +51,7 @@ arm64/arm64/unwind.c optional ddb | kdt arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard arm64/cavium/thunder_pcie.c optional thunder_pci fdt +arm64/cavium/thunder_pcie_pem.c optional thunder_pci arm64/cavium/thunder_pcie_common.c optional thunder_pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb From owner-svn-src-head@freebsd.org Sat Aug 8 21:42:01 2015 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 055FC9B6118; Sat, 8 Aug 2015 21:42:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D08161BD3; Sat, 8 Aug 2015 21:42:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78Lg0Dc069039; Sat, 8 Aug 2015 21:42:00 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78Lg0dA069035; Sat, 8 Aug 2015 21:42:00 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201508082142.t78Lg0dA069035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 8 Aug 2015 21:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286478 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 21:42:01 -0000 Author: marius Date: Sat Aug 8 21:41:59 2015 New Revision: 286478 URL: https://svnweb.freebsd.org/changeset/base/286478 Log: Fix compilation after r286457 w/o INVARIANTS or INVARIANT_SUPPORT. Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sat Aug 8 21:32:03 2015 (r286477) +++ head/sys/netinet/in.c Sat Aug 8 21:41:59 2015 (r286478) @@ -1133,10 +1133,9 @@ in_lltable_delete(struct lltable *llt, u const struct sockaddr *l3addr) { const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; - struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; - IF_AFDATA_WLOCK_ASSERT(ifp); + IF_AFDATA_WLOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); @@ -1226,12 +1225,11 @@ static struct llentry * in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { const struct sockaddr_in *sin = (const struct sockaddr_in *)l3addr; - struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; struct llentries *lleh; u_int hashkey; - IF_AFDATA_LOCK_ASSERT(ifp); + IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Aug 8 21:32:03 2015 (r286477) +++ head/sys/netinet6/in6.c Sat Aug 8 21:41:59 2015 (r286478) @@ -2178,10 +2178,9 @@ in6_lltable_delete(struct lltable *llt, const struct sockaddr *l3addr) { const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; - struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; - IF_AFDATA_LOCK_ASSERT(ifp); + IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); @@ -2264,10 +2263,9 @@ in6_lltable_lookup(struct lltable *llt, const struct sockaddr *l3addr) { const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; - struct ifnet *ifp = llt->llt_ifp; struct llentry *lle; - IF_AFDATA_LOCK_ASSERT(ifp); + IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); From owner-svn-src-head@freebsd.org Sat Aug 8 21:42:17 2015 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 033649B6146; Sat, 8 Aug 2015 21:42:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E87371D14; Sat, 8 Aug 2015 21:42:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78LgGVZ069103; Sat, 8 Aug 2015 21:42:16 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78LgG9H069102; Sat, 8 Aug 2015 21:42:16 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201508082142.t78LgG9H069102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 8 Aug 2015 21:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286479 - 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.20 Precedence: list List-Id: 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, 08 Aug 2015 21:42:17 -0000 Author: marius Date: Sat Aug 8 21:42:15 2015 New Revision: 286479 URL: https://svnweb.freebsd.org/changeset/base/286479 Log: Fix compilation after r286458. Modified: head/sys/netinet/in_rmx.c Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat Aug 8 21:41:59 2015 (r286478) +++ head/sys/netinet/in_rmx.c Sat Aug 8 21:42:15 2015 (r286479) @@ -55,8 +55,6 @@ extern int in_detachhead(void **head, in static void in_setifarnh(struct radix_node_head *rnh, uint32_t fibnum, int af, void *_arg); -static void in_rtqtimo_setrnh(struct radix_node_head *rnh, uint32_t fibnum, - int af, void *_arg); /* * Do what we need to do when inserting a route. From owner-svn-src-head@freebsd.org Sat Aug 8 21:46:39 2015 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 307BF9B61C4; Sat, 8 Aug 2015 21:46:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 215FF1ED7; Sat, 8 Aug 2015 21:46:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78Lkdb6069559; Sat, 8 Aug 2015 21:46:39 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78LkcUU069558; Sat, 8 Aug 2015 21:46:38 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508082146.t78LkcUU069558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sat, 8 Aug 2015 21:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286480 - head/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.20 Precedence: list List-Id: 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, 08 Aug 2015 21:46:39 -0000 Author: zbb Date: Sat Aug 8 21:46:38 2015 New Revision: 286480 URL: https://svnweb.freebsd.org/changeset/base/286480 Log: Treat internal bridge as subtractive on ThunderX ARM64 Internal bridges in Cavium ThunderX SoC behave as subtractive, but they are unable to be identified. Force setting an appropriate flag. Reviewed by: emaste, imp Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3277 Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Sat Aug 8 21:42:15 2015 (r286479) +++ head/sys/dev/pci/pci_pci.c Sat Aug 8 21:46:38 2015 (r286480) @@ -960,9 +960,10 @@ pcib_attach_common(device_t dev) * The i82380FB mobile docking controller is a PCI-PCI bridge, * and it is a subtractive bridge. However, the ProgIf is wrong * so the normal setting of PCIB_SUBTRACTIVE bit doesn't - * happen. There's also a Toshiba bridge that behaves this - * way. + * happen. There are also Toshiba and Cavium ThunderX bridges + * that behave this way. */ + case 0xa002177d: /* Cavium ThunderX */ case 0x124b8086: /* Intel 82380FB Mobile */ case 0x060513d7: /* Toshiba ???? */ sc->flags |= PCIB_SUBTRACTIVE; From owner-svn-src-head@freebsd.org Sat Aug 8 22:18:46 2015 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 708449B676C; Sat, 8 Aug 2015 22:18:46 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward17p.cmail.yandex.net (forward17p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::b3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B83A13CC; Sat, 8 Aug 2015 22:18:45 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web26g.yandex.ru (web26g.yandex.ru [95.108.253.235]) by forward17p.cmail.yandex.net (Yandex) with ESMTP id D6EB22165A; Sun, 9 Aug 2015 01:18:40 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web26g.yandex.ru (Yandex) with ESMTP id 26D9743C080D; Sun, 9 Aug 2015 01:18:40 +0300 (MSK) Received: by web26g.yandex.ru with HTTP; Sun, 09 Aug 2015 01:18:39 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Marius Strobl , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201508082142.t78LgG9H069102@repo.freebsd.org> References: null <201508082142.t78LgG9H069102@repo.freebsd.org> Subject: Re: svn commit: r286479 - head/sys/netinet Message-Id: <417951439072319@web26g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 09 Aug 2015 01:18:39 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 22:18:46 -0000 From owner-svn-src-head@freebsd.org Sat Aug 8 23:13:53 2015 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 DA2129B6FD8; Sat, 8 Aug 2015 23:13:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CB1E91087; Sat, 8 Aug 2015 23:13:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78NDrIB009606; Sat, 8 Aug 2015 23:13:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78NDrmG009605; Sat, 8 Aug 2015 23:13:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508082313.t78NDrmG009605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 8 Aug 2015 23:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286487 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 23:13:53 -0000 Author: jhibbits Date: Sat Aug 8 23:13:53 2015 New Revision: 286487 URL: https://svnweb.freebsd.org/changeset/base/286487 Log: Correct return type of booke_init() prototype. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Sat Aug 8 23:05:12 2015 (r286486) +++ head/sys/powerpc/booke/booke_machdep.c Sat Aug 8 23:13:53 2015 (r286487) @@ -173,7 +173,7 @@ uint32_t *bootinfo; void print_kernel_section_addr(void); void print_kenv(void); -u_int booke_init(uint32_t, uint32_t); +uintptr_t booke_init(uint32_t, uint32_t); void ivor_setup(void); extern void *interrupt_vector_base; From owner-svn-src-head@freebsd.org Sat Aug 8 23:59:16 2015 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 EA9A59B768A; Sat, 8 Aug 2015 23:59:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DB67D381; Sat, 8 Aug 2015 23:59:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t78NxGeQ026907; Sat, 8 Aug 2015 23:59:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t78NxGGZ026906; Sat, 8 Aug 2015 23:59:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508082359.t78NxGGZ026906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 8 Aug 2015 23:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286490 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 08 Aug 2015 23:59:17 -0000 Author: bapt Date: Sat Aug 8 23:59:15 2015 New Revision: 286490 URL: https://svnweb.freebsd.org/changeset/base/286490 Log: Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. Per rfc3629 value greater than 0x10ffff should be rejected Suggested by: jilles Modified: head/lib/libc/locale/utf8.c Modified: head/lib/libc/locale/utf8.c ============================================================================== --- head/lib/libc/locale/utf8.c Sat Aug 8 23:26:11 2015 (r286489) +++ head/lib/libc/locale/utf8.c Sat Aug 8 23:59:15 2015 (r286490) @@ -145,14 +145,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, mask = 0x07; want = 4; lbound = 0x10000; - } else if ((ch & 0xfc) == 0xf8) { - mask = 0x03; - want = 5; - lbound = 0x200000; - } else if ((ch & 0xfe) == 0xfc) { - mask = 0x01; - want = 6; - lbound = 0x4000000; } else { /* * Malformed input; input is not UTF-8.