From owner-svn-src-stable@freebsd.org Mon Sep 17 02:51:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D29E108F038; Mon, 17 Sep 2018 02:51:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C63658AB74; Mon, 17 Sep 2018 02:51:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C088F2E32; Mon, 17 Sep 2018 02:51:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8H2pE81048558; Mon, 17 Sep 2018 02:51:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8H2p9kj048531; Mon, 17 Sep 2018 02:51:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201809170251.w8H2p9kj048531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 17 Sep 2018 02:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338707 - in stable/11: include lib/libthr/thread share/man/man3 X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in stable/11: include lib/libthr/thread share/man/man3 X-SVN-Commit-Revision: 338707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 02:51:15 -0000 Author: pfg Date: Mon Sep 17 02:51:08 2018 New Revision: 338707 URL: https://svnweb.freebsd.org/changeset/base/338707 Log: MFC r337992, r338125: POSIX compliance improvements in the pthread(3) functions. This basically adds makes use of the C99 restrict keyword, and also adds some 'const's to four threading functions: pthread_mutexattr_gettype(), pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018. Hinted by: DragonFlyBSD Relnotes: yes Modified: stable/11/include/pthread.h stable/11/lib/libthr/thread/thr_attr.c stable/11/lib/libthr/thread/thr_barrier.c stable/11/lib/libthr/thread/thr_barrierattr.c stable/11/lib/libthr/thread/thr_cond.c stable/11/lib/libthr/thread/thr_condattr.c stable/11/lib/libthr/thread/thr_create.c stable/11/lib/libthr/thread/thr_getschedparam.c stable/11/lib/libthr/thread/thr_mutex.c stable/11/lib/libthr/thread/thr_mutexattr.c stable/11/lib/libthr/thread/thr_rwlock.c stable/11/lib/libthr/thread/thr_rwlockattr.c stable/11/share/man/man3/pthread.3 stable/11/share/man/man3/pthread_attr.3 stable/11/share/man/man3/pthread_barrier_destroy.3 stable/11/share/man/man3/pthread_barrierattr.3 stable/11/share/man/man3/pthread_cond_init.3 stable/11/share/man/man3/pthread_cond_wait.3 stable/11/share/man/man3/pthread_create.3 stable/11/share/man/man3/pthread_mutex_init.3 stable/11/share/man/man3/pthread_mutex_timedlock.3 stable/11/share/man/man3/pthread_mutexattr.3 stable/11/share/man/man3/pthread_rwlock_init.3 stable/11/share/man/man3/pthread_rwlock_timedrdlock.3 stable/11/share/man/man3/pthread_rwlock_timedwrlock.3 stable/11/share/man/man3/pthread_rwlockattr_getpshared.3 stable/11/share/man/man3/pthread_schedparam.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/include/pthread.h ============================================================================== --- stable/11/include/pthread.h Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/include/pthread.h Mon Sep 17 02:51:08 2018 (r338707) @@ -151,10 +151,10 @@ int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( const pthread_attr_t * __restrict, void ** __restrict, size_t * __restrict); -int pthread_attr_getstacksize(const pthread_attr_t *, - size_t *); -int pthread_attr_getguardsize(const pthread_attr_t *, - size_t *); +int pthread_attr_getstacksize(const pthread_attr_t * __restrict, + size_t * __restrict); +int pthread_attr_getguardsize(const pthread_attr_t * __restrict, + size_t * __restrict); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); int pthread_attr_getdetachstate(const pthread_attr_t *, int *); @@ -166,12 +166,12 @@ int pthread_attr_setstack(pthread_attr_t *, void *, int pthread_attr_setstackaddr(pthread_attr_t *, void *); int pthread_attr_setdetachstate(pthread_attr_t *, int); int pthread_barrier_destroy(pthread_barrier_t *); -int pthread_barrier_init(pthread_barrier_t *, - const pthread_barrierattr_t *, unsigned); +int pthread_barrier_init(pthread_barrier_t * __restrict, + const pthread_barrierattr_t * __restrict, unsigned); int pthread_barrier_wait(pthread_barrier_t *); int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t *, int *); + const pthread_barrierattr_t * __restrict, int * __restrict); int pthread_barrierattr_init(pthread_barrierattr_t *); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); @@ -189,24 +189,27 @@ int pthread_barrierattr_setpshared(pthread_barrieratt } int pthread_condattr_destroy(pthread_condattr_t *); -int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *); +int pthread_condattr_getclock(const pthread_condattr_t * __restrict, + clockid_t * __restrict); int pthread_condattr_getpshared(const pthread_condattr_t *, int *); int pthread_condattr_init(pthread_condattr_t *); int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); int pthread_condattr_setpshared(pthread_condattr_t *, int); int pthread_cond_broadcast(pthread_cond_t *); int pthread_cond_destroy(pthread_cond_t *); -int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_init(pthread_cond_t * __restrict, + const pthread_condattr_t * __restrict); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t * __mutex, const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) +int pthread_cond_wait(pthread_cond_t * __restrict, + pthread_mutex_t * __restrict __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *); +int pthread_create(pthread_t * __restrict, + const pthread_attr_t * __restrict, void *(*) (void *), + void * __restrict); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; @@ -217,40 +220,44 @@ int pthread_key_create(pthread_key_t *, void (*) (voi int pthread_key_delete(pthread_key_t); int pthread_mutexattr_init(pthread_mutexattr_t *); int pthread_mutexattr_destroy(pthread_mutexattr_t *); -int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getpshared( + const pthread_mutexattr_t * __restrict, + int * __restrict); +int pthread_mutexattr_gettype( + const pthread_mutexattr_t * __restrict, int * __restrict); int pthread_mutexattr_settype(pthread_mutexattr_t *, int); int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * __mutex, - const pthread_mutexattr_t *) +int pthread_mutex_init(pthread_mutex_t * __restrict __mutex, + const pthread_mutexattr_t * __restrict) __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * __mutex, - const struct timespec *) +int pthread_mutex_timedlock(pthread_mutex_t * __restrict __mutex, + const struct timespec * __restrict) __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * __rwlock, - const pthread_rwlockattr_t *) +int pthread_rwlock_init(pthread_rwlock_t * __restrict __rwlock, + const pthread_rwlockattr_t * __restrict) __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, - const struct timespec *) +int pthread_rwlock_timedrdlock( + pthread_rwlock_t * __restrict __rwlock, + const struct timespec * __restrict) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, - const struct timespec *) +int pthread_rwlock_timedwrlock( + pthread_rwlock_t * __restrict __rwlock, + const struct timespec * __restrict) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); @@ -263,8 +270,9 @@ int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); -int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *); +int pthread_rwlockattr_getpshared( + const pthread_rwlockattr_t * __restrict, + int * __restrict); int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); @@ -293,30 +301,39 @@ int pthread_setprio(pthread_t, int); void pthread_yield(void); #endif -int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getprioceiling( + const pthread_mutexattr_t * __restrict, + int * __restrict); int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); -int pthread_mutex_getprioceiling(pthread_mutex_t *, int *); -int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *); +int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict, + int * __restrict); +int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict, int, + int * __restrict); -int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getprotocol( + const pthread_mutexattr_t * __restrict, + int * __restrict); int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( pthread_mutexattr_t * __restrict, int * __restrict); int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); -int pthread_attr_getinheritsched(const pthread_attr_t *, int *); +int pthread_attr_getinheritsched(const pthread_attr_t * __restrict, + int * __restrict); int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); -int pthread_attr_getscope(const pthread_attr_t *, int *); +int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict, + int * __restrict); +int pthread_attr_getscope(const pthread_attr_t * __restrict, + int * __restrict); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param *); int pthread_attr_setschedpolicy(pthread_attr_t *, int); int pthread_attr_setscope(pthread_attr_t *, int); -int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *); +int pthread_getschedparam(pthread_t pthread, int * __restrict, + struct sched_param * __restrict); int pthread_setschedparam(pthread_t, int, const struct sched_param *); #if __XSI_VISIBLE Modified: stable/11/lib/libthr/thread/thr_attr.c ============================================================================== --- stable/11/lib/libthr/thread/thr_attr.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_attr.c Mon Sep 17 02:51:08 2018 (r338707) @@ -197,7 +197,8 @@ _pthread_attr_getdetachstate(const pthread_attr_t *att __weak_reference(_pthread_attr_getguardsize, pthread_attr_getguardsize); int -_pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize) +_pthread_attr_getguardsize(const pthread_attr_t * __restrict attr, + size_t * __restrict guardsize) { int ret; @@ -215,7 +216,8 @@ _pthread_attr_getguardsize(const pthread_attr_t *attr, __weak_reference(_pthread_attr_getinheritsched, pthread_attr_getinheritsched); int -_pthread_attr_getinheritsched(const pthread_attr_t *attr, int *sched_inherit) +_pthread_attr_getinheritsched(const pthread_attr_t * __restrict attr, + int * __restrict sched_inherit) { int ret = 0; @@ -230,7 +232,8 @@ _pthread_attr_getinheritsched(const pthread_attr_t *at __weak_reference(_pthread_attr_getschedparam, pthread_attr_getschedparam); int -_pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param) +_pthread_attr_getschedparam(const pthread_attr_t * __restrict attr, + struct sched_param * __restrict param) { int ret = 0; @@ -245,7 +248,8 @@ _pthread_attr_getschedparam(const pthread_attr_t *attr __weak_reference(_pthread_attr_getschedpolicy, pthread_attr_getschedpolicy); int -_pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy) +_pthread_attr_getschedpolicy(const pthread_attr_t * __restrict attr, + int * __restrict policy) { int ret = 0; @@ -260,7 +264,8 @@ _pthread_attr_getschedpolicy(const pthread_attr_t *att __weak_reference(_pthread_attr_getscope, pthread_attr_getscope); int -_pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope) +_pthread_attr_getscope(const pthread_attr_t * __restrict attr, + int * __restrict contentionscope) { int ret = 0; @@ -318,7 +323,8 @@ _pthread_attr_getstackaddr(const pthread_attr_t *attr, __weak_reference(_pthread_attr_getstacksize, pthread_attr_getstacksize); int -_pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize) +_pthread_attr_getstacksize(const pthread_attr_t * __restrict attr, + size_t * __restrict stacksize) { int ret; @@ -438,7 +444,8 @@ _pthread_attr_setinheritsched(pthread_attr_t *attr, in __weak_reference(_pthread_attr_setschedparam, pthread_attr_setschedparam); int -_pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param) +_pthread_attr_setschedparam(pthread_attr_t * __restrict attr, + const struct sched_param * __restrict param) { int policy; Modified: stable/11/lib/libthr/thread/thr_barrier.c ============================================================================== --- stable/11/lib/libthr/thread/thr_barrier.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_barrier.c Mon Sep 17 02:51:08 2018 (r338707) @@ -94,8 +94,8 @@ _pthread_barrier_destroy(pthread_barrier_t *barrier) } int -_pthread_barrier_init(pthread_barrier_t *barrier, - const pthread_barrierattr_t *attr, unsigned count) +_pthread_barrier_init(pthread_barrier_t * __restrict barrier, + const pthread_barrierattr_t * __restrict attr, unsigned count) { pthread_barrier_t bar; int pshared; Modified: stable/11/lib/libthr/thread/thr_barrierattr.c ============================================================================== --- stable/11/lib/libthr/thread/thr_barrierattr.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_barrierattr.c Mon Sep 17 02:51:08 2018 (r338707) @@ -56,8 +56,8 @@ _pthread_barrierattr_destroy(pthread_barrierattr_t *at } int -_pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, - int *pshared) +_pthread_barrierattr_getpshared(const pthread_barrierattr_t * __restrict attr, + int * __restrict pshared) { if (attr == NULL || *attr == NULL) Modified: stable/11/lib/libthr/thread/thr_cond.c ============================================================================== --- stable/11/lib/libthr/thread/thr_cond.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_cond.c Mon Sep 17 02:51:08 2018 (r338707) @@ -147,7 +147,8 @@ init_static(struct pthread *thread, pthread_cond_t *co } int -_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) +_pthread_cond_init(pthread_cond_t * __restrict cond, + const pthread_condattr_t * __restrict cond_attr) { *cond = NULL; @@ -372,15 +373,17 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex } int -__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +__pthread_cond_wait(pthread_cond_t * __restrict cond, + pthread_mutex_t * __restrict mutex) { return (cond_wait_common(cond, mutex, NULL, 1)); } int -_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime) +_pthread_cond_timedwait(pthread_cond_t * __restrict cond, + pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime) { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || Modified: stable/11/lib/libthr/thread/thr_condattr.c ============================================================================== --- stable/11/lib/libthr/thread/thr_condattr.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_condattr.c Mon Sep 17 02:51:08 2018 (r338707) @@ -80,7 +80,8 @@ _pthread_condattr_destroy(pthread_condattr_t *attr) } int -_pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id) +_pthread_condattr_getclock(const pthread_condattr_t * __restrict attr, + clockid_t * __restrict clock_id) { if (attr == NULL || *attr == NULL) return (EINVAL); @@ -104,7 +105,8 @@ _pthread_condattr_setclock(pthread_condattr_t *attr, c } int -_pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared) +_pthread_condattr_getpshared(const pthread_condattr_t * __restrict attr, + int * __restrict pshared) { if (attr == NULL || *attr == NULL) Modified: stable/11/lib/libthr/thread/thr_create.c ============================================================================== --- stable/11/lib/libthr/thread/thr_create.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_create.c Mon Sep 17 02:51:08 2018 (r338707) @@ -50,8 +50,9 @@ static void thread_start(struct pthread *curthread); __weak_reference(_pthread_create, pthread_create); int -_pthread_create(pthread_t * thread, const pthread_attr_t * attr, - void *(*start_routine) (void *), void *arg) +_pthread_create(pthread_t * __restrict thread, + const pthread_attr_t * __restrict attr, void *(*start_routine) (void *), + void * __restrict arg) { struct pthread *curthread, *new_thread; struct thr_param param; Modified: stable/11/lib/libthr/thread/thr_getschedparam.c ============================================================================== --- stable/11/lib/libthr/thread/thr_getschedparam.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_getschedparam.c Mon Sep 17 02:51:08 2018 (r338707) @@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$"); __weak_reference(_pthread_getschedparam, pthread_getschedparam); int -_pthread_getschedparam(pthread_t pthread, int *policy, - struct sched_param *param) +_pthread_getschedparam(pthread_t pthread, int * __restrict policy, + struct sched_param * __restrict param) { struct pthread *curthread = _get_curthread(); int ret = 0; Modified: stable/11/lib/libthr/thread/thr_mutex.c ============================================================================== --- stable/11/lib/libthr/thread/thr_mutex.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_mutex.c Mon Sep 17 02:51:08 2018 (r338707) @@ -64,12 +64,12 @@ _Static_assert(sizeof(struct pthread_mutex) <= PAGE_SI * Prototypes */ int __pthread_mutex_consistent(pthread_mutex_t *mutex); -int __pthread_mutex_init(pthread_mutex_t *mutex, - const pthread_mutexattr_t *mutex_attr); +int __pthread_mutex_init(pthread_mutex_t * __restrict mutex, + const pthread_mutexattr_t * __restrict mutex_attr); int __pthread_mutex_trylock(pthread_mutex_t *mutex); int __pthread_mutex_lock(pthread_mutex_t *mutex); -int __pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime); +int __pthread_mutex_timedlock(pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime); int _pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); int _pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); int __pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); @@ -374,8 +374,8 @@ shared_mutex_init(struct pthread_mutex *pmtx, const st } int -__pthread_mutex_init(pthread_mutex_t *mutex, - const pthread_mutexattr_t *mutex_attr) +__pthread_mutex_init(pthread_mutex_t * __restrict mutex, + const pthread_mutexattr_t * __restrict mutex_attr) { struct pthread_mutex *pmtx; int ret; @@ -390,7 +390,7 @@ __pthread_mutex_init(pthread_mutex_t *mutex, return (mutex_init(mutex, mutex_attr ? *mutex_attr : NULL, calloc)); } - pmtx = __thr_pshared_offpage(mutex, 1); + pmtx = __thr_pshared_offpage(__DECONST(void *, mutex), 1); if (pmtx == NULL) return (EFAULT); *mutex = THR_PSHARED_PTR; @@ -746,8 +746,8 @@ __pthread_mutex_lock(pthread_mutex_t *mutex) } int -__pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime) +__pthread_mutex_timedlock(pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime) { struct pthread_mutex *m; int ret; @@ -993,13 +993,13 @@ mutex_unlock_common(struct pthread_mutex *m, bool cv, } int -_pthread_mutex_getprioceiling(pthread_mutex_t *mutex, - int *prioceiling) +_pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict mutex, + int * __restrict prioceiling) { struct pthread_mutex *m; if (*mutex == THR_PSHARED_PTR) { - m = __thr_pshared_offpage(mutex, 0); + m = __thr_pshared_offpage(__DECONST(void *, mutex), 0); if (m == NULL) return (EINVAL); shared_mutex_init(m, NULL); @@ -1015,8 +1015,8 @@ _pthread_mutex_getprioceiling(pthread_mutex_t *mutex, } int -_pthread_mutex_setprioceiling(pthread_mutex_t *mutex, - int ceiling, int *old_ceiling) +_pthread_mutex_setprioceiling(pthread_mutex_t * __restrict mutex, + int ceiling, int * __restrict old_ceiling) { struct pthread *curthread; struct pthread_mutex *m, *m1, *m2; Modified: stable/11/lib/libthr/thread/thr_mutexattr.c ============================================================================== --- stable/11/lib/libthr/thread/thr_mutexattr.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_mutexattr.c Mon Sep 17 02:51:08 2018 (r338707) @@ -148,7 +148,8 @@ _pthread_mutexattr_settype(pthread_mutexattr_t *attr, } int -_pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type) +_pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict attr, + int * __restrict type) { int ret; @@ -200,7 +201,8 @@ _pthread_mutexattr_setpshared(pthread_mutexattr_t *att } int -_pthread_mutexattr_getprotocol(pthread_mutexattr_t *mattr, int *protocol) +_pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict mattr, + int * __restrict protocol) { int ret = 0; @@ -228,7 +230,8 @@ _pthread_mutexattr_setprotocol(pthread_mutexattr_t *ma } int -_pthread_mutexattr_getprioceiling(pthread_mutexattr_t *mattr, int *prioceiling) +_pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict mattr, + int * __restrict prioceiling) { int ret = 0; Modified: stable/11/lib/libthr/thread/thr_rwlock.c ============================================================================== --- stable/11/lib/libthr/thread/thr_rwlock.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_rwlock.c Mon Sep 17 02:51:08 2018 (r338707) @@ -223,8 +223,8 @@ _pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) } int -_pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict rwlock, + const struct timespec * __restrict abstime) { return (rwlock_rdlock_common(rwlock, abstime)); } @@ -335,8 +335,8 @@ _pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) } int -_pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, + const struct timespec * __restrict abstime) { return (rwlock_wrlock_common (rwlock, abstime)); } Modified: stable/11/lib/libthr/thread/thr_rwlockattr.c ============================================================================== --- stable/11/lib/libthr/thread/thr_rwlockattr.c Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/lib/libthr/thread/thr_rwlockattr.c Mon Sep 17 02:51:08 2018 (r338707) @@ -55,8 +55,9 @@ _pthread_rwlockattr_destroy(pthread_rwlockattr_t *rwlo } int -_pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *rwlockattr, - int *pshared) +_pthread_rwlockattr_getpshared( + const pthread_rwlockattr_t * __restrict rwlockattr, + int * __restrict pshared) { *pshared = (*rwlockattr)->pshared; Modified: stable/11/share/man/man3/pthread.3 ============================================================================== --- stable/11/share/man/man3/pthread.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2014 +.Dd August 17, 2018 .Dt PTHREAD 3 .Os .Sh NAME @@ -236,17 +236,17 @@ Set the detach state in a thread attributes object. Destroy a mutex attributes object. .It Xo .Ft int -.Fn pthread_mutexattr_getprioceiling "pthread_mutexattr_t *attr" "int *ceiling" +.Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *restrict attr" "int *restrict ceiling" .Xc Obtain priority ceiling attribute of mutex attribute object. .It Xo .Ft int -.Fn pthread_mutexattr_getprotocol "pthread_mutexattr_t *attr" "int *protocol" +.Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Xc Obtain protocol attribute of mutex attribute object. .It Xo .Ft int -.Fn pthread_mutexattr_gettype "pthread_mutexattr_t *attr" "int *type" +.Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" .Xc Obtain the mutex type attribute in the specified mutex attributes object. .It Xo Modified: stable/11/share/man/man3/pthread_attr.3 ============================================================================== --- stable/11/share/man/man3/pthread_attr.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_attr.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 8, 2010 +.Dd August 17, 2018 .Dt PTHREAD_ATTR 3 .Os .Sh NAME @@ -66,11 +66,11 @@ .Ft int .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" .Ft int -.Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" +.Fn pthread_attr_getstacksize "const pthread_attr_t *restrict attr" "size_t *restrict stacksize" .Ft int .Fn pthread_attr_setguardsize "pthread_attr_t *attr" "size_t guardsize" .Ft int -.Fn pthread_attr_getguardsize "const pthread_attr_t *attr" "size_t *guardsize" +.Fn pthread_attr_getguardsize "const pthread_attr_t * restrict attr" "size_t * restrict guardsize" .Ft int .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr" .Ft int @@ -82,7 +82,7 @@ .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Ft int -.Fn pthread_attr_getinheritsched "const pthread_attr_t *attr" "int *inheritsched" +.Fn pthread_attr_getinheritsched "const pthread_attr_t *restrict attr" "int *restrct inheritsched" .Ft int .Fn pthread_attr_setschedparam "pthread_attr_t *attr" "const struct sched_param *param" .Ft int @@ -90,11 +90,11 @@ .Ft int .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy" .Ft int -.Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy" +.Fn pthread_attr_getschedpolicy "const pthread_attr_t *restrict attr" "int *restrict policy" .Ft int .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope" .Ft int -.Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope" +.Fn pthread_attr_getscope "const pthread_attr_t *restrict attr" "int *restrict contentionscope" .Sh DESCRIPTION Thread attributes are used to specify parameters to .Fn pthread_create . Modified: stable/11/share/man/man3/pthread_barrier_destroy.3 ============================================================================== --- stable/11/share/man/man3/pthread_barrier_destroy.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_barrier_destroy.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2004 +.Dd August 17, 2018 .Dt PTHREAD_BARRIER 3 .Os .Sh NAME @@ -37,7 +37,7 @@ .Ft int .Fn pthread_barrier_destroy "pthread_barrier_t *barrier" .Ft int -.Fn pthread_barrier_init "pthread_barrier_t *barrier" "const pthread_barrierattr_t *attr" "unsigned count" +.Fn pthread_barrier_init "pthread_barrier_t *restrict barrier" "const pthread_barrierattr_t *attr" "unsigned count" .Ft int .Fn pthread_barrier_wait "pthread_barrier_t *barrier" .Sh DESCRIPTION Modified: stable/11/share/man/man3/pthread_barrierattr.3 ============================================================================== --- stable/11/share/man/man3/pthread_barrierattr.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_barrierattr.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd August 17, 2018 .Dt PTHREAD_BARRIERATTR 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Ft int .Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr" .Ft int -.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *attr" "int *pshared" +.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *restrict attr" "int *restrict pshared" .Ft int .Fn pthread_barrierattr_init "pthread_barrierattr_t *attr" .Ft int Modified: stable/11/share/man/man3/pthread_cond_init.3 ============================================================================== --- stable/11/share/man/man3/pthread_cond_init.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_cond_init.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd August 17, 2018 .Dt PTHREAD_COND_INIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr" +.Fn pthread_cond_init "pthread_cond_t *restrict cond" "const pthread_condattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_cond_init Modified: stable/11/share/man/man3/pthread_cond_wait.3 ============================================================================== --- stable/11/share/man/man3/pthread_cond_wait.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_cond_wait.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_COND_WAIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_cond_wait "pthread_cond_t *cond" "pthread_mutex_t *mutex" +.Fn pthread_cond_wait "pthread_cond_t *restrict cond" "pthread_mutex_t *restrict mutex" .Sh DESCRIPTION The .Fn pthread_cond_wait Modified: stable/11/share/man/man3/pthread_create.3 ============================================================================== --- stable/11/share/man/man3/pthread_create.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_create.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd August 17, 2018 .Dt PTHREAD_CREATE 3 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_create "pthread_t *thread" "const pthread_attr_t *attr" "void *(*start_routine)(void *)" "void *arg" +.Fn pthread_create "pthread_t *restrict thread" "const pthread_attr_t *restrict attr" "void *(*start_routine)(void *)" "void *restrict arg" .Sh DESCRIPTION The .Fn pthread_create Modified: stable/11/share/man/man3/pthread_mutex_init.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_init.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_mutex_init.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd August 17, 2018 .Dt PTHREAD_MUTEX_INIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_mutex_init "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" +.Fn pthread_mutex_init "pthread_mutex_t *restrict mutex" "const pthread_mutexattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_mutex_init Modified: stable/11/share/man/man3/pthread_mutex_timedlock.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_timedlock.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_mutex_timedlock.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME @@ -36,7 +36,7 @@ .In pthread.h .In time.h .Ft int -.Fn pthread_mutex_timedlock "pthread_mutex_t *mutex" "const struct timespec *abs_timeout" +.Fn pthread_mutex_timedlock "pthread_mutex_t *restrict mutex" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION The .Fn pthread_mutex_timedlock Modified: stable/11/share/man/man3/pthread_mutexattr.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutexattr.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_mutexattr.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_MUTEXATTR 3 .Os .Sh NAME @@ -52,11 +52,11 @@ .Ft int .Fn pthread_mutexattr_setprioceiling "pthread_mutexattr_t *attr" "int prioceiling" .Ft int -.Fn pthread_mutexattr_getprioceiling "pthread_mutexattr_t *attr" "int *prioceiling" +.Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *attr" "int *prioceiling" .Ft int .Fn pthread_mutexattr_setprotocol "pthread_mutexattr_t *attr" "int protocol" .Ft int -.Fn pthread_mutexattr_getprotocol "pthread_mutexattr_t *attr" "int *protocol" +.Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Ft int .Fn pthread_mutexattr_setrobust "pthread_mutexattr_t *attr" "int robust" .Ft int @@ -64,7 +64,7 @@ .Ft int .Fn pthread_mutexattr_settype "pthread_mutexattr_t *attr" "int type" .Ft int -.Fn pthread_mutexattr_gettype "pthread_mutexattr_t *attr" "int *type" +.Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" .Sh DESCRIPTION Mutex attributes are used to specify parameters to .Fn pthread_mutex_init . Modified: stable/11/share/man/man3/pthread_rwlock_init.3 ============================================================================== --- stable/11/share/man/man3/pthread_rwlock_init.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_rwlock_init.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_INIT 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_init "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" +.Fn pthread_rwlock_init "pthread_rwlock_t *restrict lock" "const pthread_rwlockattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_rwlock_init Modified: stable/11/share/man/man3/pthread_rwlock_timedrdlock.3 ============================================================================== --- stable/11/share/man/man3/pthread_rwlock_timedrdlock.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_rwlock_timedrdlock.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_TIMEDRDLOCK 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_timedrdlock "pthread_rwlock_t *rwlock" "const struct timespec *abs_timeout" +.Fn pthread_rwlock_timedrdlock "pthread_rwlock_t *restrict rwlock" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION This function acquires a read lock on the read-write lock .Fa rwlock . Modified: stable/11/share/man/man3/pthread_rwlock_timedwrlock.3 ============================================================================== --- stable/11/share/man/man3/pthread_rwlock_timedwrlock.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_rwlock_timedwrlock.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_TIMEDWRLOCK 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_timedwrlock "pthread_rwlock_t *rwlock" "const struct timespec *abs_timeout" +.Fn pthread_rwlock_timedwrlock "pthread_rwlock_t *restrict rwlock" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION This function acquires a write lock on the read-write lock .Fa rwlock . Modified: stable/11/share/man/man3/pthread_rwlockattr_getpshared.3 ============================================================================== --- stable/11/share/man/man3/pthread_rwlockattr_getpshared.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_rwlockattr_getpshared.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 1999 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCKATTR_GETPSHARED 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *attr" "int *pshared" +.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *restrict attr" "int *restrict pshared" .Sh DESCRIPTION The .Fn pthread_rwlockattr_getpshared Modified: stable/11/share/man/man3/pthread_schedparam.3 ============================================================================== --- stable/11/share/man/man3/pthread_schedparam.3 Mon Sep 17 00:59:56 2018 (r338706) +++ stable/11/share/man/man3/pthread_schedparam.3 Mon Sep 17 02:51:08 2018 (r338707) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2006 +.Dd August 17, 2018 .Dt PTHREAD_SCHEDPARAM 3 .Os .Sh NAME @@ -41,7 +41,7 @@ .Ft int .Fn pthread_setschedparam "pthread_t thread" "int policy" "const struct sched_param *param" .Ft int -.Fn pthread_getschedparam "pthread_t thread" "int *policy" "struct sched_param *param" +.Fn pthread_getschedparam "pthread_t thread" "int *restrict policy" "struct sched_param *restrict param" .Sh DESCRIPTION The .Fn pthread_setschedparam From owner-svn-src-stable@freebsd.org Mon Sep 17 11:24:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C90551099E20; Mon, 17 Sep 2018 11:24:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE0D78455; Mon, 17 Sep 2018 11:24:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79B7B105EF; Mon, 17 Sep 2018 11:24:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8HBOGJA015375; Mon, 17 Sep 2018 11:24:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8HBOG5D015374; Mon, 17 Sep 2018 11:24:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809171124.w8HBOG5D015374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 17 Sep 2018 11:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338709 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 338709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 11:24:17 -0000 Author: hselasky Date: Mon Sep 17 11:24:16 2018 New Revision: 338709 URL: https://svnweb.freebsd.org/changeset/base/338709 Log: MFC r338613: Fix for backends which doesn't support capsicum. Not all libpcap backends use the BPF compatible set of IOCTLs. For example the mlx5 backend uses libibverbs which is currently not capsicum compatible. Disable sandboxing for such backends. Discussed with: emaste@ Sponsored by: Mellanox Technologies Modified: stable/11/contrib/tcpdump/tcpdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/11/contrib/tcpdump/tcpdump.c Mon Sep 17 10:10:14 2018 (r338708) +++ stable/11/contrib/tcpdump/tcpdump.c Mon Sep 17 11:24:16 2018 (r338709) @@ -2069,6 +2069,9 @@ main(int argc, char **argv) #else cansandbox = (cansandbox && ndo->ndo_nflag); #endif /* HAVE_CASPER */ + cansandbox = (cansandbox && (pcap_fileno(pd) != -1 || + RFileName != NULL)); + if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); #endif /* HAVE_CAPSICUM */ From owner-svn-src-stable@freebsd.org Mon Sep 17 14:53:04 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80904109F588; Mon, 17 Sep 2018 14:53:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307797F181; Mon, 17 Sep 2018 14:53:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 270B912826; Mon, 17 Sep 2018 14:53:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8HEr4rN023085; Mon, 17 Sep 2018 14:53:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8HEr4R3023084; Mon, 17 Sep 2018 14:53:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809171453.w8HEr4R3023084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 17 Sep 2018 14:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338710 - stable/11/contrib/llvm/lib/CodeGen X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/contrib/llvm/lib/CodeGen X-SVN-Commit-Revision: 338710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 14:53:04 -0000 Author: dim Date: Mon Sep 17 14:53:03 2018 New Revision: 338710 URL: https://svnweb.freebsd.org/changeset/base/338710 Log: MFC r338689: Pull in r335365 from upstream llvm trunk (by Krzysztof Parzyszek): Initialize LiveRegs once in BranchFolder::mergeCommonTails This should fix '(TRI && "LivePhysRegs is not initialized."' assertions when building the lang/qt5-qml port in certain configurations. Reported by: Piotr Kubaj PR: 231355 Modified: stable/11/contrib/llvm/lib/CodeGen/BranchFolding.cpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/lib/CodeGen/BranchFolding.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/BranchFolding.cpp Mon Sep 17 11:24:16 2018 (r338709) +++ stable/11/contrib/llvm/lib/CodeGen/BranchFolding.cpp Mon Sep 17 14:53:03 2018 (r338710) @@ -884,11 +884,12 @@ void BranchFolder::mergeCommonTails(unsigned commonTai if (UpdateLiveIns) { LivePhysRegs NewLiveIns(*TRI); computeLiveIns(NewLiveIns, *MBB); + LiveRegs.init(*TRI); // The flag merging may lead to some register uses no longer using the // flag, add IMPLICIT_DEFs in the predecessors as necessary. for (MachineBasicBlock *Pred : MBB->predecessors()) { - LiveRegs.init(*TRI); + LiveRegs.clear(); LiveRegs.addLiveOuts(*Pred); MachineBasicBlock::iterator InsertBefore = Pred->getFirstTerminator(); for (unsigned Reg : NewLiveIns) { From owner-svn-src-stable@freebsd.org Mon Sep 17 18:36:30 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5489D10A41CE; Mon, 17 Sep 2018 18:36:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01C1586C02; Mon, 17 Sep 2018 18:36:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E75C314CAF; Mon, 17 Sep 2018 18:36:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8HIaTcQ036534; Mon, 17 Sep 2018 18:36:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8HIaT7J036533; Mon, 17 Sep 2018 18:36:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201809171836.w8HIaT7J036533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Sep 2018 18:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338726 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 338726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 18:36:30 -0000 Author: emaste Date: Mon Sep 17 18:36:29 2018 New Revision: 338726 URL: https://svnweb.freebsd.org/changeset/base/338726 Log: MFC r335900 (oshogbo): capsicum: add getdirentries to the freebsd32 compact There is a getdirentries syscall in freebsd32 and it's capability ready so allow calling it in the capability mode. PR: 228671 Modified: stable/11/sys/compat/freebsd32/capabilities.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/capabilities.conf ============================================================================== --- stable/11/sys/compat/freebsd32/capabilities.conf Mon Sep 17 17:18:54 2018 (r338725) +++ stable/11/sys/compat/freebsd32/capabilities.conf Mon Sep 17 18:36:29 2018 (r338726) @@ -112,6 +112,7 @@ getauid freebsd32_getcontext getdents freebsd32_getdirentries +getdirentries getdomainname getdtablesize getegid From owner-svn-src-stable@freebsd.org Mon Sep 17 18:45:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E167110A4608; Mon, 17 Sep 2018 18:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 963C68733A; Mon, 17 Sep 2018 18:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9125914E5D; Mon, 17 Sep 2018 18:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8HIjGoS043201; Mon, 17 Sep 2018 18:45:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8HIjG1u043200; Mon, 17 Sep 2018 18:45:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809171845.w8HIjG1u043200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 17 Sep 2018 18:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338727 - stable/11/sys/amd64/include X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/amd64/include X-SVN-Commit-Revision: 338727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 18:45:17 -0000 Author: jhb Date: Mon Sep 17 18:45:16 2018 New Revision: 338727 URL: https://svnweb.freebsd.org/changeset/base/338727 Log: MFC 335913: Use 'e' instead of 'i' constraints with 64-bit atomic operations on amd64. The ADD, AND, OR, and SUB instructions take at most a 32-bit sign-extended immediate operand. 64-bit constants that do not fit into that constraint need to be loaded into a register. The 'i' constraint tells the compiler it can pass any integer constant to the assembler, whereas the 'e' constrain only permits constants that fit into a 32-bit sign-extended value. This fixes using atomic_add/clear/set/subtract_long/64 with constants that do not fit into a 32-bit sign-extended immediate. Modified: stable/11/sys/amd64/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/atomic.h ============================================================================== --- stable/11/sys/amd64/include/atomic.h Mon Sep 17 18:36:29 2018 (r338726) +++ stable/11/sys/amd64/include/atomic.h Mon Sep 17 18:45:16 2018 (r338727) @@ -444,10 +444,10 @@ ATOMIC_ASM(clear, int, "andl %1,%0", "ir", ~v); ATOMIC_ASM(add, int, "addl %1,%0", "ir", v); ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v); -ATOMIC_ASM(set, long, "orq %1,%0", "ir", v); -ATOMIC_ASM(clear, long, "andq %1,%0", "ir", ~v); -ATOMIC_ASM(add, long, "addq %1,%0", "ir", v); -ATOMIC_ASM(subtract, long, "subq %1,%0", "ir", v); +ATOMIC_ASM(set, long, "orq %1,%0", "er", v); +ATOMIC_ASM(clear, long, "andq %1,%0", "er", ~v); +ATOMIC_ASM(add, long, "addq %1,%0", "er", v); +ATOMIC_ASM(subtract, long, "subq %1,%0", "er", v); #define ATOMIC_LOADSTORE(TYPE) \ ATOMIC_LOAD(TYPE); \ From owner-svn-src-stable@freebsd.org Mon Sep 17 18:46:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC4410A4700; Mon, 17 Sep 2018 18:46:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0D698756E; Mon, 17 Sep 2018 18:46:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B9DD14E62; Mon, 17 Sep 2018 18:46:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8HIkUp0043391; Mon, 17 Sep 2018 18:46:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8HIkUjx043390; Mon, 17 Sep 2018 18:46:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201809171846.w8HIkUjx043390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Sep 2018 18:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338728 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 338728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 18:46:31 -0000 Author: emaste Date: Mon Sep 17 18:46:30 2018 New Revision: 338728 URL: https://svnweb.freebsd.org/changeset/base/338728 Log: revert r338726 (getdirentries capsicum addition) Compat getdirentries was added with the ino64 project and is not needed in stable/11. I MFC'd r335900 accidentally as a side effect of some other WIP. PR: 228671 Modified: stable/11/sys/compat/freebsd32/capabilities.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/capabilities.conf ============================================================================== --- stable/11/sys/compat/freebsd32/capabilities.conf Mon Sep 17 18:45:16 2018 (r338727) +++ stable/11/sys/compat/freebsd32/capabilities.conf Mon Sep 17 18:46:30 2018 (r338728) @@ -112,7 +112,6 @@ getauid freebsd32_getcontext getdents freebsd32_getdirentries -getdirentries getdomainname getdtablesize getegid From owner-svn-src-stable@freebsd.org Tue Sep 18 07:29:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB4E1094E16; Tue, 18 Sep 2018 07:29:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 280EE81EA3; Tue, 18 Sep 2018 07:29:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224951CDCE; Tue, 18 Sep 2018 07:29:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8I7T1Qj037981; Tue, 18 Sep 2018 07:29:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8I7T1R9037980; Tue, 18 Sep 2018 07:29:01 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809180729.w8I7T1R9037980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 07:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338748 - stable/11/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Commit-Revision: 338748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 07:29:02 -0000 Author: dim Date: Tue Sep 18 07:29:01 2018 New Revision: 338748 URL: https://svnweb.freebsd.org/changeset/base/338748 Log: MFC r338697: Pull in r325478 from upstream clang trunk (by Ivan A. Kosarev): [CodeGen] Initialize large arrays by copying from a global Currently, clang compiles explicit initializers for array elements into series of store instructions. For large arrays of built-in types this results in bloated output code and significant amount of time spent on the instruction selection phase. This patch fixes the issue by initializing such arrays with global constants that store the binary image of the initializer. Differential Revision: https://reviews.llvm.org/D43181 This should fix a compiler hang (and excessive memory usage) while building the science/rmg port. Reported by: yuri@tsoft.com See also: https://bugs.llvm.org/show_bug.cgi?id=38798 Modified: stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp Tue Sep 18 01:51:28 2018 (r338747) +++ stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp Tue Sep 18 07:29:01 2018 (r338748) @@ -14,6 +14,7 @@ #include "CodeGenFunction.h" #include "CGObjCRuntime.h" #include "CodeGenModule.h" +#include "ConstantEmitter.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" @@ -85,7 +86,7 @@ class AggExprEmitter : public StmtVisitorgetNumInits(); uint64_t NumArrayElements = AType->getNumElements(); assert(NumInitElements <= NumArrayElements); + QualType elementType = + CGF.getContext().getAsArrayType(ArrayQTy)->getElementType(); + // DestPtr is an array*. Construct an elementType* by drilling // down a level. llvm::Value *zero = llvm::ConstantInt::get(CGF.SizeTy, 0); @@ -409,6 +413,29 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr, ll CharUnits elementAlign = DestPtr.getAlignment().alignmentOfArrayElement(elementSize); + // Consider initializing the array by copying from a global. For this to be + // more efficient than per-element initialization, the size of the elements + // with explicit initializers should be large enough. + if (NumInitElements * elementSize.getQuantity() > 16 && + elementType.isTriviallyCopyableType(CGF.getContext())) { + CodeGen::CodeGenModule &CGM = CGF.CGM; + ConstantEmitter Emitter(CGM); + LangAS AS = ArrayQTy.getAddressSpace(); + if (llvm::Constant *C = Emitter.tryEmitForInitializer(E, AS, ArrayQTy)) { + auto GV = new llvm::GlobalVariable( + CGM.getModule(), C->getType(), + CGM.isTypeConstant(ArrayQTy, /* ExcludeCtorDtor= */ true), + llvm::GlobalValue::PrivateLinkage, C, "constinit", + /* InsertBefore= */ nullptr, llvm::GlobalVariable::NotThreadLocal, + CGM.getContext().getTargetAddressSpace(AS)); + Emitter.finalize(GV); + CharUnits Align = CGM.getContext().getTypeAlignInChars(ArrayQTy); + GV->setAlignment(Align.getQuantity()); + EmitFinalDestCopy(ArrayQTy, CGF.MakeAddrLValue(GV, ArrayQTy, Align)); + return; + } + } + // Exception safety requires us to destroy all the // already-constructed members if an initializer throws. // For that, we'll need an EH cleanup. @@ -1156,11 +1183,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E // Handle initialization of an array. if (E->getType()->isArrayType()) { - QualType elementType = - CGF.getContext().getAsArrayType(E->getType())->getElementType(); - auto AType = cast(Dest.getAddress().getElementType()); - EmitArrayInit(Dest.getAddress(), AType, elementType, E); + EmitArrayInit(Dest.getAddress(), AType, E->getType(), E); return; } From owner-svn-src-stable@freebsd.org Tue Sep 18 20:46:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CBA110A8954; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB3A82ACD; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1132D2513C; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IKktxD055594; Tue, 18 Sep 2018 20:46:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IKkt0C055593; Tue, 18 Sep 2018 20:46:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809182046.w8IKkt0C055593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 20:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r338756 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Group: stable-9 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Commit-Revision: 338756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 20:46:56 -0000 Author: dim Date: Tue Sep 18 20:46:55 2018 New Revision: 338756 URL: https://svnweb.freebsd.org/changeset/base/338756 Log: MFC r309748 (by glebius): Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Modified: stable/9/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/elf_machdep.c stable/11/sys/amd64/amd64/elf_machdep.c stable/8/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/9/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/elf_machdep.c Tue Sep 18 17:51:45 2018 (r338755) +++ stable/9/sys/amd64/amd64/elf_machdep.c Tue Sep 18 20:46:55 2018 (r338756) @@ -163,6 +163,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -196,6 +197,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ addr = lookup(lf, symidx, 1); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); From owner-svn-src-stable@freebsd.org Tue Sep 18 20:46:56 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C1310A8958; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6029682AD0; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 595492513D; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IKkuTS055600; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IKkuCp055599; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809182046.w8IKkuCp055599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r338756 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Group: stable-8 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Commit-Revision: 338756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 20:46:56 -0000 Author: dim Date: Tue Sep 18 20:46:55 2018 New Revision: 338756 URL: https://svnweb.freebsd.org/changeset/base/338756 Log: MFC r309748 (by glebius): Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Modified: stable/8/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/elf_machdep.c stable/11/sys/amd64/amd64/elf_machdep.c stable/9/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/elf_machdep.c Tue Sep 18 17:51:45 2018 (r338755) +++ stable/8/sys/amd64/amd64/elf_machdep.c Tue Sep 18 20:46:55 2018 (r338756) @@ -161,6 +161,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -194,6 +195,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ addr = lookup(lf, symidx, 1); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); From owner-svn-src-stable@freebsd.org Tue Sep 18 20:46:57 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09CB010A895C; Tue, 18 Sep 2018 20:46:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B349882AD4; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB0C32513E; Tue, 18 Sep 2018 20:46:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IKkupW055606; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IKkuJm055605; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809182046.w8IKkuJm055605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338756 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Commit-Revision: 338756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 20:46:57 -0000 Author: dim Date: Tue Sep 18 20:46:55 2018 New Revision: 338756 URL: https://svnweb.freebsd.org/changeset/base/338756 Log: MFC r309748 (by glebius): Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Modified: stable/11/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/elf_machdep.c stable/8/sys/amd64/amd64/elf_machdep.c stable/9/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/11/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/elf_machdep.c Tue Sep 18 17:51:45 2018 (r338755) +++ stable/11/sys/amd64/amd64/elf_machdep.c Tue Sep 18 20:46:55 2018 (r338756) @@ -200,6 +200,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -235,6 +236,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ error = lookup(lf, symidx, 1, &addr); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); From owner-svn-src-stable@freebsd.org Tue Sep 18 20:46:57 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576C810A8962; Tue, 18 Sep 2018 20:46:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DFDC82ADC; Tue, 18 Sep 2018 20:46:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08D622513F; Tue, 18 Sep 2018 20:46:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8IKku5G055612; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8IKkuk1055611; Tue, 18 Sep 2018 20:46:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201809182046.w8IKkuk1055611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Sep 2018 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338756 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 8/sys/amd64/amd64 9/sys/amd64/amd64 X-SVN-Commit-Revision: 338756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2018 20:46:57 -0000 Author: dim Date: Tue Sep 18 20:46:55 2018 New Revision: 338756 URL: https://svnweb.freebsd.org/changeset/base/338756 Log: MFC r309748 (by glebius): Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Modified: stable/10/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/amd64/elf_machdep.c stable/8/sys/amd64/amd64/elf_machdep.c stable/9/sys/amd64/amd64/elf_machdep.c Directory Properties: stable/11/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/elf_machdep.c Tue Sep 18 17:51:45 2018 (r338755) +++ stable/10/sys/amd64/amd64/elf_machdep.c Tue Sep 18 20:46:55 2018 (r338756) @@ -181,6 +181,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -214,6 +215,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ error = lookup(lf, symidx, 1, &addr); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); From owner-svn-src-stable@freebsd.org Wed Sep 19 07:56:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E5B10928C2; Wed, 19 Sep 2018 07:56:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0155575DAD; Wed, 19 Sep 2018 07:56:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2555437F; Wed, 19 Sep 2018 07:56:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J7uKVj097274; Wed, 19 Sep 2018 07:56:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J7uK1s097271; Wed, 19 Sep 2018 07:56:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190756.w8J7uK1s097271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 07:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338788 - stable/11/lib/libusb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/lib/libusb X-SVN-Commit-Revision: 338788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 07:56:21 -0000 Author: hselasky Date: Wed Sep 19 07:56:19 2018 New Revision: 338788 URL: https://svnweb.freebsd.org/changeset/base/338788 Log: MFC r338616: Fix issues about cancelling USB transfers in LibUSB when the USB device has been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau PR: 231076 Sponsored by: Mellanox Technologies Modified: stable/11/lib/libusb/libusb10.c stable/11/lib/libusb/libusb10.h stable/11/lib/libusb/libusb10_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libusb/libusb10.c ============================================================================== --- stable/11/lib/libusb/libusb10.c Wed Sep 19 07:10:28 2018 (r338787) +++ stable/11/lib/libusb/libusb10.c Wed Sep 19 07:56:19 2018 (r338788) @@ -112,6 +112,19 @@ libusb_set_nonblocking(int f) fcntl(f, F_SETFL, flags); } +static void +libusb10_wakeup_event_loop(libusb_context *ctx) +{ + uint8_t dummy = 0; + int err; + + err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + if (err < (int)sizeof(dummy)) { + /* ignore error, if any */ + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); + } +} + int libusb_init(libusb_context **context) { @@ -482,7 +495,6 @@ libusb_open(libusb_device *dev, libusb_device_handle * { libusb_context *ctx = dev->ctx; struct libusb20_device *pdev = dev->os_priv; - uint8_t dummy; int err; if (devh == NULL) @@ -504,12 +516,8 @@ libusb_open(libusb_device *dev, libusb_device_handle * POLLOUT | POLLRDNORM | POLLWRNORM); /* make sure our event loop detects the new device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open write failed!"); - } + libusb10_wakeup_event_loop(ctx); + *devh = pdev; return (0); @@ -562,8 +570,6 @@ libusb_close(struct libusb20_device *pdev) { libusb_context *ctx; struct libusb_device *dev; - uint8_t dummy; - int err; if (pdev == NULL) return; /* be NULL safe */ @@ -579,12 +585,7 @@ libusb_close(struct libusb20_device *pdev) libusb_unref_device(dev); /* make sure our event loop detects the closed device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close write failed!"); - } + libusb10_wakeup_event_loop(ctx); } libusb_device * @@ -1312,7 +1313,6 @@ libusb10_submit_transfer_sub(struct libusb20_device *p int buffsize; int maxframe; int temp; - uint8_t dummy; dev = libusb_get_device(pdev); @@ -1413,10 +1413,8 @@ found: failure: libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_ERROR); - /* make sure our event loop spins the done handler */ - dummy = 0; - err = write(dev->ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + libusb10_wakeup_event_loop(dev->ctx); } /* The following function must be called unlocked */ @@ -1457,6 +1455,8 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) || (libusb20_tr_get_priv_sc1(pxfer1) == sxfer)) { err = LIBUSB_ERROR_BUSY; + } else if (dev->device_is_gone != 0) { + err = LIBUSB_ERROR_NO_DEVICE; } else { /* set pending state */ @@ -1488,6 +1488,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) struct libusb20_transfer *pxfer1; struct libusb_super_transfer *sxfer; struct libusb_device *dev; + struct libusb_device_handle *devh; uint8_t endpoint; int retval; @@ -1495,12 +1496,12 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) return (LIBUSB_ERROR_INVALID_PARAM); /* check if not initialised */ - if (uxfer->dev_handle == NULL) + if ((devh = uxfer->dev_handle) == NULL) return (LIBUSB_ERROR_NOT_FOUND); endpoint = uxfer->endpoint; - dev = libusb_get_device(uxfer->dev_handle); + dev = libusb_get_device(devh); DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter"); @@ -1511,8 +1512,8 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) CTX_LOCK(dev->ctx); - pxfer0 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 0); - pxfer1 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 1); + pxfer0 = libusb10_get_transfer(devh, endpoint, 0); + pxfer1 = libusb10_get_transfer(devh, endpoint, 1); if (sxfer->state != LIBUSB_SUPER_XFER_ST_PEND) { /* only update the transfer status */ @@ -1524,23 +1525,38 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) sxfer->entry.tqe_prev = NULL; libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_CANCELLED); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); } else if (pxfer0 == NULL || pxfer1 == NULL) { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; } else if (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) { libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer0); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer0, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer0); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else if (libusb20_tr_get_priv_sc1(pxfer1) == sxfer) { libusb10_complete_transfer(pxfer1, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer1); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + /* check if handle is still active */ + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer1, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer1); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; @@ -1566,6 +1582,35 @@ libusb10_cancel_all_transfer(libusb_device *dev) if (xfer == NULL) continue; libusb20_tr_close(xfer); + } +} + +UNEXPORTED void +libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev) +{ + struct libusb_super_transfer *sxfer; + unsigned x; + + for (x = 0; x != LIBUSB_NUM_SW_ENDPOINTS; x++) { + struct libusb20_transfer *xfer; + + xfer = libusb20_tr_get_pointer(pdev, x); + if (xfer == NULL) + continue; + if (libusb20_tr_pending(xfer) == 0) + continue; + sxfer = libusb20_tr_get_priv_sc1(xfer); + if (sxfer == NULL) + continue; + /* complete pending transfer */ + libusb10_complete_transfer(xfer, sxfer, LIBUSB_TRANSFER_ERROR); + } + + while ((sxfer = TAILQ_FIRST(&dev->tr_head))) { + TAILQ_REMOVE(&dev->tr_head, sxfer, entry); + + /* complete pending transfer */ + libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_ERROR); } } Modified: stable/11/lib/libusb/libusb10.h ============================================================================== --- stable/11/lib/libusb/libusb10.h Wed Sep 19 07:10:28 2018 (r338787) +++ stable/11/lib/libusb/libusb10.h Wed Sep 19 07:56:19 2018 (r338788) @@ -114,6 +114,8 @@ struct libusb_context { struct libusb_device { int refcnt; + int device_is_gone; + uint32_t claimed_interfaces; struct libusb_super_pollfd dev_poll; @@ -132,5 +134,6 @@ extern struct libusb_context *usbi_default_context; void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events); void libusb10_remove_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd); void libusb10_cancel_all_transfer(libusb_device *dev); +void libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev); #endif /* __LIBUSB10_H__ */ Modified: stable/11/lib/libusb/libusb10_io.c ============================================================================== --- stable/11/lib/libusb/libusb10_io.c Wed Sep 19 07:10:28 2018 (r338787) +++ stable/11/lib/libusb/libusb10_io.c Wed Sep 19 07:56:19 2018 (r338788) @@ -159,17 +159,19 @@ libusb10_handle_events_sub(struct libusb_context *ctx, if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); - if (fds[i].revents == 0) - err = 0; /* nothing to do */ - else + if (fds[i].revents != 0) { err = libusb20_dev_process(ppdev[i]); - if (err) { - /* cancel all transfers - device is gone */ - libusb10_cancel_all_transfer(dev); + if (err) { + /* set device is gone */ + dev->device_is_gone = 1; - /* remove USB device from polling loop */ - libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + /* remove USB device from polling loop */ + libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + + /* cancel all pending transfers */ + libusb10_cancel_all_transfer_locked(ppdev[i], dev); + } } CTX_UNLOCK(ctx); libusb_unref_device(dev); @@ -178,10 +180,8 @@ libusb10_handle_events_sub(struct libusb_context *ctx, } else { uint8_t dummy; - while (1) { - if (read(fds[i].fd, &dummy, 1) != 1) - break; - } + while (read(fds[i].fd, &dummy, 1) == 1) + ; } } From owner-svn-src-stable@freebsd.org Wed Sep 19 07:57:32 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36661092961; Wed, 19 Sep 2018 07:57:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9391075F0E; Wed, 19 Sep 2018 07:57:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D13E4382; Wed, 19 Sep 2018 07:57:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J7vV1f097392; Wed, 19 Sep 2018 07:57:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J7vVZ2097390; Wed, 19 Sep 2018 07:57:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190757.w8J7vVZ2097390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 07:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338789 - stable/10/lib/libusb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/lib/libusb X-SVN-Commit-Revision: 338789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 07:57:32 -0000 Author: hselasky Date: Wed Sep 19 07:57:30 2018 New Revision: 338789 URL: https://svnweb.freebsd.org/changeset/base/338789 Log: MFC r338616: Fix issues about cancelling USB transfers in LibUSB when the USB device has been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau PR: 231076 Sponsored by: Mellanox Technologies Modified: stable/10/lib/libusb/libusb10.c stable/10/lib/libusb/libusb10.h stable/10/lib/libusb/libusb10_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb10.c ============================================================================== --- stable/10/lib/libusb/libusb10.c Wed Sep 19 07:56:19 2018 (r338788) +++ stable/10/lib/libusb/libusb10.c Wed Sep 19 07:57:30 2018 (r338789) @@ -112,6 +112,19 @@ libusb_set_nonblocking(int f) fcntl(f, F_SETFL, flags); } +static void +libusb10_wakeup_event_loop(libusb_context *ctx) +{ + uint8_t dummy = 0; + int err; + + err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + if (err < (int)sizeof(dummy)) { + /* ignore error, if any */ + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); + } +} + int libusb_init(libusb_context **context) { @@ -482,7 +495,6 @@ libusb_open(libusb_device *dev, libusb_device_handle * { libusb_context *ctx = dev->ctx; struct libusb20_device *pdev = dev->os_priv; - uint8_t dummy; int err; if (devh == NULL) @@ -504,12 +516,8 @@ libusb_open(libusb_device *dev, libusb_device_handle * POLLOUT | POLLRDNORM | POLLWRNORM); /* make sure our event loop detects the new device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open write failed!"); - } + libusb10_wakeup_event_loop(ctx); + *devh = pdev; return (0); @@ -562,8 +570,6 @@ libusb_close(struct libusb20_device *pdev) { libusb_context *ctx; struct libusb_device *dev; - uint8_t dummy; - int err; if (pdev == NULL) return; /* be NULL safe */ @@ -579,12 +585,7 @@ libusb_close(struct libusb20_device *pdev) libusb_unref_device(dev); /* make sure our event loop detects the closed device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close write failed!"); - } + libusb10_wakeup_event_loop(ctx); } libusb_device * @@ -1319,7 +1320,6 @@ libusb10_submit_transfer_sub(struct libusb20_device *p int buffsize; int maxframe; int temp; - uint8_t dummy; dev = libusb_get_device(pdev); @@ -1420,10 +1420,8 @@ found: failure: libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_ERROR); - /* make sure our event loop spins the done handler */ - dummy = 0; - err = write(dev->ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + libusb10_wakeup_event_loop(dev->ctx); } /* The following function must be called unlocked */ @@ -1464,6 +1462,8 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) || (libusb20_tr_get_priv_sc1(pxfer1) == sxfer)) { err = LIBUSB_ERROR_BUSY; + } else if (dev->device_is_gone != 0) { + err = LIBUSB_ERROR_NO_DEVICE; } else { /* set pending state */ @@ -1495,6 +1495,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) struct libusb20_transfer *pxfer1; struct libusb_super_transfer *sxfer; struct libusb_device *dev; + struct libusb_device_handle *devh; uint8_t endpoint; int retval; @@ -1502,12 +1503,12 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) return (LIBUSB_ERROR_INVALID_PARAM); /* check if not initialised */ - if (uxfer->dev_handle == NULL) + if ((devh = uxfer->dev_handle) == NULL) return (LIBUSB_ERROR_NOT_FOUND); endpoint = uxfer->endpoint; - dev = libusb_get_device(uxfer->dev_handle); + dev = libusb_get_device(devh); DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter"); @@ -1518,8 +1519,8 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) CTX_LOCK(dev->ctx); - pxfer0 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 0); - pxfer1 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 1); + pxfer0 = libusb10_get_transfer(devh, endpoint, 0); + pxfer1 = libusb10_get_transfer(devh, endpoint, 1); if (sxfer->state != LIBUSB_SUPER_XFER_ST_PEND) { /* only update the transfer status */ @@ -1531,23 +1532,38 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) sxfer->entry.tqe_prev = NULL; libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_CANCELLED); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); } else if (pxfer0 == NULL || pxfer1 == NULL) { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; } else if (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) { libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer0); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer0, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer0); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else if (libusb20_tr_get_priv_sc1(pxfer1) == sxfer) { libusb10_complete_transfer(pxfer1, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer1); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + /* check if handle is still active */ + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer1, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer1); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; @@ -1573,6 +1589,35 @@ libusb10_cancel_all_transfer(libusb_device *dev) if (xfer == NULL) continue; libusb20_tr_close(xfer); + } +} + +UNEXPORTED void +libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev) +{ + struct libusb_super_transfer *sxfer; + unsigned x; + + for (x = 0; x != LIBUSB_NUM_SW_ENDPOINTS; x++) { + struct libusb20_transfer *xfer; + + xfer = libusb20_tr_get_pointer(pdev, x); + if (xfer == NULL) + continue; + if (libusb20_tr_pending(xfer) == 0) + continue; + sxfer = libusb20_tr_get_priv_sc1(xfer); + if (sxfer == NULL) + continue; + /* complete pending transfer */ + libusb10_complete_transfer(xfer, sxfer, LIBUSB_TRANSFER_ERROR); + } + + while ((sxfer = TAILQ_FIRST(&dev->tr_head))) { + TAILQ_REMOVE(&dev->tr_head, sxfer, entry); + + /* complete pending transfer */ + libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_ERROR); } } Modified: stable/10/lib/libusb/libusb10.h ============================================================================== --- stable/10/lib/libusb/libusb10.h Wed Sep 19 07:56:19 2018 (r338788) +++ stable/10/lib/libusb/libusb10.h Wed Sep 19 07:57:30 2018 (r338789) @@ -114,6 +114,8 @@ struct libusb_context { struct libusb_device { int refcnt; + int device_is_gone; + uint32_t claimed_interfaces; struct libusb_super_pollfd dev_poll; @@ -132,5 +134,6 @@ extern struct libusb_context *usbi_default_context; void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events); void libusb10_remove_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd); void libusb10_cancel_all_transfer(libusb_device *dev); +void libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev); #endif /* __LIBUSB10_H__ */ Modified: stable/10/lib/libusb/libusb10_io.c ============================================================================== --- stable/10/lib/libusb/libusb10_io.c Wed Sep 19 07:56:19 2018 (r338788) +++ stable/10/lib/libusb/libusb10_io.c Wed Sep 19 07:57:30 2018 (r338789) @@ -159,17 +159,19 @@ libusb10_handle_events_sub(struct libusb_context *ctx, if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); - if (fds[i].revents == 0) - err = 0; /* nothing to do */ - else + if (fds[i].revents != 0) { err = libusb20_dev_process(ppdev[i]); - if (err) { - /* cancel all transfers - device is gone */ - libusb10_cancel_all_transfer(dev); + if (err) { + /* set device is gone */ + dev->device_is_gone = 1; - /* remove USB device from polling loop */ - libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + /* remove USB device from polling loop */ + libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + + /* cancel all pending transfers */ + libusb10_cancel_all_transfer_locked(ppdev[i], dev); + } } CTX_UNLOCK(ctx); libusb_unref_device(dev); @@ -178,10 +180,8 @@ libusb10_handle_events_sub(struct libusb_context *ctx, } else { uint8_t dummy; - while (1) { - if (read(fds[i].fd, &dummy, 1) != 1) - break; - } + while (read(fds[i].fd, &dummy, 1) == 1) + ; } } From owner-svn-src-stable@freebsd.org Wed Sep 19 08:10:01 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18F5F10930BF; Wed, 19 Sep 2018 08:10:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F6776541; Wed, 19 Sep 2018 08:10:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B889D4518; Wed, 19 Sep 2018 08:10:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J8A078003245; Wed, 19 Sep 2018 08:10:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J8A0fS003242; Wed, 19 Sep 2018 08:10:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190810.w8J8A0fS003242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 08:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r338790 - stable/9/lib/libusb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/lib/libusb X-SVN-Commit-Revision: 338790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 08:10:01 -0000 Author: hselasky Date: Wed Sep 19 08:09:59 2018 New Revision: 338790 URL: https://svnweb.freebsd.org/changeset/base/338790 Log: MFC r338616: Fix issues about cancelling USB transfers in LibUSB when the USB device has been detached. When a USB device has been detached the kernel file handle stops responding to commands. USB applications which continue to run after the USB device has been detached, depend on LibUSB generated events to tear down its pending USB transfers. Add code to handle the needed cleanup when processing the USB transfer(s) fails and prevent new USB transfer(s) from being submitted. Found by: Ludovic Rousseau PR: 231076 Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusb/libusb10.c stable/9/lib/libusb/libusb10.h stable/9/lib/libusb/libusb10_io.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Wed Sep 19 07:57:30 2018 (r338789) +++ stable/9/lib/libusb/libusb10.c Wed Sep 19 08:09:59 2018 (r338790) @@ -106,6 +106,19 @@ libusb_set_nonblocking(int f) fcntl(f, F_SETFL, flags); } +static void +libusb10_wakeup_event_loop(libusb_context *ctx) +{ + uint8_t dummy = 0; + int err; + + err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + if (err < (int)sizeof(dummy)) { + /* ignore error, if any */ + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); + } +} + int libusb_init(libusb_context **context) { @@ -476,7 +489,6 @@ libusb_open(libusb_device *dev, libusb_device_handle * { libusb_context *ctx = dev->ctx; struct libusb20_device *pdev = dev->os_priv; - uint8_t dummy; int err; if (devh == NULL) @@ -498,12 +510,8 @@ libusb_open(libusb_device *dev, libusb_device_handle * POLLOUT | POLLRDNORM | POLLWRNORM); /* make sure our event loop detects the new device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open write failed!"); - } + libusb10_wakeup_event_loop(ctx); + *devh = pdev; return (0); @@ -556,8 +564,6 @@ libusb_close(struct libusb20_device *pdev) { libusb_context *ctx; struct libusb_device *dev; - uint8_t dummy; - int err; if (pdev == NULL) return; /* be NULL safe */ @@ -573,12 +579,7 @@ libusb_close(struct libusb20_device *pdev) libusb_unref_device(dev); /* make sure our event loop detects the closed device */ - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { - /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close write failed!"); - } + libusb10_wakeup_event_loop(ctx); } libusb_device * @@ -1313,7 +1314,6 @@ libusb10_submit_transfer_sub(struct libusb20_device *p int buffsize; int maxframe; int temp; - uint8_t dummy; dev = libusb_get_device(pdev); @@ -1413,10 +1413,8 @@ found: failure: libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_ERROR); - /* make sure our event loop spins the done handler */ - dummy = 0; - write(dev->ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + libusb10_wakeup_event_loop(dev->ctx); } /* The following function must be called unlocked */ @@ -1460,6 +1458,8 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) || (libusb20_tr_get_priv_sc1(pxfer1) == sxfer)) { err = LIBUSB_ERROR_BUSY; + } else if (dev->device_is_gone != 0) { + err = LIBUSB_ERROR_NO_DEVICE; } else { /* set pending state */ @@ -1491,6 +1491,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) struct libusb20_transfer *pxfer1; struct libusb_super_transfer *sxfer; struct libusb_device *dev; + struct libusb_device_handle *devh; uint32_t endpoint; int retval; @@ -1498,7 +1499,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) return (LIBUSB_ERROR_INVALID_PARAM); /* check if not initialised */ - if (uxfer->dev_handle == NULL) + if ((devh = uxfer->dev_handle) == NULL) return (LIBUSB_ERROR_NOT_FOUND); endpoint = uxfer->endpoint; @@ -1506,7 +1507,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) if (endpoint > 255) return (LIBUSB_ERROR_INVALID_PARAM); - dev = libusb_get_device(uxfer->dev_handle); + dev = libusb_get_device(devh); DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter"); @@ -1517,8 +1518,8 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) CTX_LOCK(dev->ctx); - pxfer0 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 0); - pxfer1 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 1); + pxfer0 = libusb10_get_transfer(devh, endpoint, 0); + pxfer1 = libusb10_get_transfer(devh, endpoint, 1); if (sxfer->state != LIBUSB_SUPER_XFER_ST_PEND) { /* only update the transfer status */ @@ -1530,23 +1531,38 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) sxfer->entry.tqe_prev = NULL; libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_CANCELLED); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); } else if (pxfer0 == NULL || pxfer1 == NULL) { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; } else if (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) { libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer0); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer0, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer0); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else if (libusb20_tr_get_priv_sc1(pxfer1) == sxfer) { libusb10_complete_transfer(pxfer1, sxfer, LIBUSB_TRANSFER_CANCELLED); - libusb20_tr_stop(pxfer1); - /* make sure the queue doesn't stall */ - libusb10_submit_transfer_sub( - uxfer->dev_handle, endpoint); + /* check if handle is still active */ + if (dev->device_is_gone != 0) { + /* clear transfer pointer */ + libusb20_tr_set_priv_sc1(pxfer1, NULL); + /* make sure our event loop spins the done handler */ + libusb10_wakeup_event_loop(dev->ctx); + } else { + libusb20_tr_stop(pxfer1); + /* make sure the queue doesn't stall */ + libusb10_submit_transfer_sub(devh, endpoint); + } } else { /* not started */ retval = LIBUSB_ERROR_NOT_FOUND; @@ -1572,6 +1588,35 @@ libusb10_cancel_all_transfer(libusb_device *dev) if (xfer == NULL) continue; libusb20_tr_close(xfer); + } +} + +UNEXPORTED void +libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev) +{ + struct libusb_super_transfer *sxfer; + unsigned x; + + for (x = 0; x != LIBUSB_NUM_SW_ENDPOINTS; x++) { + struct libusb20_transfer *xfer; + + xfer = libusb20_tr_get_pointer(pdev, x); + if (xfer == NULL) + continue; + if (libusb20_tr_pending(xfer) == 0) + continue; + sxfer = libusb20_tr_get_priv_sc1(xfer); + if (sxfer == NULL) + continue; + /* complete pending transfer */ + libusb10_complete_transfer(xfer, sxfer, LIBUSB_TRANSFER_ERROR); + } + + while ((sxfer = TAILQ_FIRST(&dev->tr_head))) { + TAILQ_REMOVE(&dev->tr_head, sxfer, entry); + + /* complete pending transfer */ + libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_ERROR); } } Modified: stable/9/lib/libusb/libusb10.h ============================================================================== --- stable/9/lib/libusb/libusb10.h Wed Sep 19 07:57:30 2018 (r338789) +++ stable/9/lib/libusb/libusb10.h Wed Sep 19 08:09:59 2018 (r338790) @@ -112,6 +112,8 @@ struct libusb_context { struct libusb_device { int refcnt; + int device_is_gone; + uint32_t claimed_interfaces; struct libusb_super_pollfd dev_poll; @@ -130,5 +132,6 @@ extern struct libusb_context *usbi_default_context; void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events); void libusb10_remove_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd); void libusb10_cancel_all_transfer(libusb_device *dev); +void libusb10_cancel_all_transfer_locked(struct libusb20_device *pdev, struct libusb_device *dev); #endif /* __LIBUSB10_H__ */ Modified: stable/9/lib/libusb/libusb10_io.c ============================================================================== --- stable/9/lib/libusb/libusb10_io.c Wed Sep 19 07:57:30 2018 (r338789) +++ stable/9/lib/libusb/libusb10_io.c Wed Sep 19 08:09:59 2018 (r338790) @@ -154,17 +154,19 @@ libusb10_handle_events_sub(struct libusb_context *ctx, if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); - if (fds[i].revents == 0) - err = 0; /* nothing to do */ - else + if (fds[i].revents != 0) { err = libusb20_dev_process(ppdev[i]); - if (err) { - /* cancel all transfers - device is gone */ - libusb10_cancel_all_transfer(dev); + if (err) { + /* set device is gone */ + dev->device_is_gone = 1; - /* remove USB device from polling loop */ - libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + /* remove USB device from polling loop */ + libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + + /* cancel all pending transfers */ + libusb10_cancel_all_transfer_locked(ppdev[i], dev); + } } CTX_UNLOCK(ctx); libusb_unref_device(dev); @@ -173,10 +175,8 @@ libusb10_handle_events_sub(struct libusb_context *ctx, } else { uint8_t dummy; - while (1) { - if (read(fds[i].fd, &dummy, 1) != 1) - break; - } + while (read(fds[i].fd, &dummy, 1) == 1) + ; } } From owner-svn-src-stable@freebsd.org Wed Sep 19 08:11:45 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2260810931CA; Wed, 19 Sep 2018 08:11:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBD707679F; Wed, 19 Sep 2018 08:11:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6D28468D; Wed, 19 Sep 2018 08:11:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J8BiGL007092; Wed, 19 Sep 2018 08:11:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J8BiD7007090; Wed, 19 Sep 2018 08:11:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190811.w8J8BiD7007090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 08:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338791 - stable/11/lib/libusb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/lib/libusb X-SVN-Commit-Revision: 338791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 08:11:45 -0000 Author: hselasky Date: Wed Sep 19 08:11:44 2018 New Revision: 338791 URL: https://svnweb.freebsd.org/changeset/base/338791 Log: MFC r338679: Improve LibUSB debugging by simultaneously allowing both function and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau PR: 231264 Sponsored by: Mellanox Technologies Modified: stable/11/lib/libusb/libusb10.h stable/11/lib/libusb/libusb10_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libusb/libusb10.h ============================================================================== --- stable/11/lib/libusb/libusb10.h Wed Sep 19 08:09:59 2018 (r338790) +++ stable/11/lib/libusb/libusb10.h Wed Sep 19 08:11:44 2018 (r338791) @@ -39,22 +39,24 @@ #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) -#define DPRINTF(ctx, dbg, format, args...) do { \ - if ((ctx)->debug == dbg) { \ - switch (dbg) { \ - case LIBUSB_DEBUG_FUNCTION: \ - printf("LIBUSB_FUNCTION: " \ - format "\n", ## args); \ - break; \ - case LIBUSB_DEBUG_TRANSFER: \ - printf("LIBUSB_TRANSFER: " \ - format "\n", ## args); \ - break; \ - default: \ - break; \ - } \ - } \ -} while(0) +#define DPRINTF(ctx, dbg, format, ...) do { \ + switch (dbg) { \ + case LIBUSB_DEBUG_FUNCTION: \ + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ + printf("LIBUSB_FUNCTION: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + case LIBUSB_DEBUG_TRANSFER: \ + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ + printf("LIBUSB_TRANSFER: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + default: \ + break; \ + } \ +} while (0) /* internal structures */ Modified: stable/11/lib/libusb/libusb10_io.c ============================================================================== --- stable/11/lib/libusb/libusb10_io.c Wed Sep 19 08:09:59 2018 (r338790) +++ stable/11/lib/libusb/libusb10_io.c Wed Sep 19 08:11:44 2018 (r338791) @@ -487,13 +487,26 @@ libusb_control_transfer(libusb_device_handle *devh, return (actlen); } +static libusb_context * +libusb10_get_context_by_device_handle(libusb_device_handle *devh) +{ + libusb_context *ctx; + + if (devh != NULL) + ctx = libusb_get_device(devh)->ctx; + else + ctx = NULL; + + return (GET_CONTEXT(ctx)); +} + static void libusb10_do_transfer_cb(struct libusb_transfer *transfer) { libusb_context *ctx; int *pdone; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(transfer->dev_handle); DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); @@ -583,7 +596,8 @@ libusb_bulk_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, @@ -601,7 +615,8 @@ libusb_interrupt_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, From owner-svn-src-stable@freebsd.org Wed Sep 19 08:12:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A8EF10933B1; Wed, 19 Sep 2018 08:12:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0B0C76A7B; Wed, 19 Sep 2018 08:12:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB63246BF; Wed, 19 Sep 2018 08:12:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J8Cfiw007909; Wed, 19 Sep 2018 08:12:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J8CfT6007908; Wed, 19 Sep 2018 08:12:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190812.w8J8CfT6007908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 08:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338792 - stable/10/lib/libusb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/lib/libusb X-SVN-Commit-Revision: 338792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 08:12:42 -0000 Author: hselasky Date: Wed Sep 19 08:12:41 2018 New Revision: 338792 URL: https://svnweb.freebsd.org/changeset/base/338792 Log: MFC r338679: Improve LibUSB debugging by simultaneously allowing both function and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau PR: 231264 Sponsored by: Mellanox Technologies Modified: stable/10/lib/libusb/libusb10.h stable/10/lib/libusb/libusb10_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb10.h ============================================================================== --- stable/10/lib/libusb/libusb10.h Wed Sep 19 08:11:44 2018 (r338791) +++ stable/10/lib/libusb/libusb10.h Wed Sep 19 08:12:41 2018 (r338792) @@ -39,22 +39,24 @@ #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) -#define DPRINTF(ctx, dbg, format, args...) do { \ - if ((ctx)->debug == dbg) { \ - switch (dbg) { \ - case LIBUSB_DEBUG_FUNCTION: \ - printf("LIBUSB_FUNCTION: " \ - format "\n", ## args); \ - break; \ - case LIBUSB_DEBUG_TRANSFER: \ - printf("LIBUSB_TRANSFER: " \ - format "\n", ## args); \ - break; \ - default: \ - break; \ - } \ - } \ -} while(0) +#define DPRINTF(ctx, dbg, format, ...) do { \ + switch (dbg) { \ + case LIBUSB_DEBUG_FUNCTION: \ + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ + printf("LIBUSB_FUNCTION: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + case LIBUSB_DEBUG_TRANSFER: \ + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ + printf("LIBUSB_TRANSFER: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + default: \ + break; \ + } \ +} while (0) /* internal structures */ Modified: stable/10/lib/libusb/libusb10_io.c ============================================================================== --- stable/10/lib/libusb/libusb10_io.c Wed Sep 19 08:11:44 2018 (r338791) +++ stable/10/lib/libusb/libusb10_io.c Wed Sep 19 08:12:41 2018 (r338792) @@ -487,13 +487,26 @@ libusb_control_transfer(libusb_device_handle *devh, return (actlen); } +static libusb_context * +libusb10_get_context_by_device_handle(libusb_device_handle *devh) +{ + libusb_context *ctx; + + if (devh != NULL) + ctx = libusb_get_device(devh)->ctx; + else + ctx = NULL; + + return (GET_CONTEXT(ctx)); +} + static void libusb10_do_transfer_cb(struct libusb_transfer *transfer) { libusb_context *ctx; int *pdone; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(transfer->dev_handle); DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); @@ -583,7 +596,8 @@ libusb_bulk_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, @@ -601,7 +615,8 @@ libusb_interrupt_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, From owner-svn-src-stable@freebsd.org Wed Sep 19 08:13:59 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336F01093504; Wed, 19 Sep 2018 08:13:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDAC776C26; Wed, 19 Sep 2018 08:13:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A0E46C1; Wed, 19 Sep 2018 08:13:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J8Dwg9008030; Wed, 19 Sep 2018 08:13:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J8DwZH008029; Wed, 19 Sep 2018 08:13:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201809190813.w8J8DwZH008029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Sep 2018 08:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r338793 - stable/9/lib/libusb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/lib/libusb X-SVN-Commit-Revision: 338793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 08:13:59 -0000 Author: hselasky Date: Wed Sep 19 08:13:58 2018 New Revision: 338793 URL: https://svnweb.freebsd.org/changeset/base/338793 Log: MFC r338679: Improve LibUSB debugging by simultaneously allowing both function and transfer prints. Make sure the debug level comes from the correct USB context. Found by: Ludovic Rousseau PR: 231264 Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusb/libusb10.h stable/9/lib/libusb/libusb10_io.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10.h ============================================================================== --- stable/9/lib/libusb/libusb10.h Wed Sep 19 08:12:41 2018 (r338792) +++ stable/9/lib/libusb/libusb10.h Wed Sep 19 08:13:58 2018 (r338793) @@ -37,22 +37,24 @@ #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) -#define DPRINTF(ctx, dbg, format, args...) do { \ - if ((ctx)->debug == dbg) { \ - switch (dbg) { \ - case LIBUSB_DEBUG_FUNCTION: \ - printf("LIBUSB_FUNCTION: " \ - format "\n", ## args); \ - break; \ - case LIBUSB_DEBUG_TRANSFER: \ - printf("LIBUSB_TRANSFER: " \ - format "\n", ## args); \ - break; \ - default: \ - break; \ - } \ - } \ -} while(0) +#define DPRINTF(ctx, dbg, format, ...) do { \ + switch (dbg) { \ + case LIBUSB_DEBUG_FUNCTION: \ + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ + printf("LIBUSB_FUNCTION: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + case LIBUSB_DEBUG_TRANSFER: \ + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ + printf("LIBUSB_TRANSFER: " \ + format "\n", ## __VA_ARGS__); \ + } \ + break; \ + default: \ + break; \ + } \ +} while (0) /* internal structures */ Modified: stable/9/lib/libusb/libusb10_io.c ============================================================================== --- stable/9/lib/libusb/libusb10_io.c Wed Sep 19 08:12:41 2018 (r338792) +++ stable/9/lib/libusb/libusb10_io.c Wed Sep 19 08:13:58 2018 (r338793) @@ -482,13 +482,26 @@ libusb_control_transfer(libusb_device_handle *devh, return (actlen); } +static libusb_context * +libusb10_get_context_by_device_handle(libusb_device_handle *devh) +{ + libusb_context *ctx; + + if (devh != NULL) + ctx = libusb_get_device(devh)->ctx; + else + ctx = NULL; + + return (GET_CONTEXT(ctx)); +} + static void libusb10_do_transfer_cb(struct libusb_transfer *transfer) { libusb_context *ctx; int *pdone; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(transfer->dev_handle); DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); @@ -578,7 +591,8 @@ libusb_bulk_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, @@ -596,7 +610,8 @@ libusb_interrupt_transfer(libusb_device_handle *devh, libusb_context *ctx; int ret; - ctx = GET_CONTEXT(NULL); + ctx = libusb10_get_context_by_device_handle(devh); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, From owner-svn-src-stable@freebsd.org Wed Sep 19 09:41:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7CDF1095430; Wed, 19 Sep 2018 09:41:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCBF79B70; Wed, 19 Sep 2018 09:41:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76AA85501; Wed, 19 Sep 2018 09:41:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J9faOS049796; Wed, 19 Sep 2018 09:41:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J9fYc5049785; Wed, 19 Sep 2018 09:41:34 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201809190941.w8J9fYc5049785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 19 Sep 2018 09:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338795 - in stable/11: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 338795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 09:41:37 -0000 Author: mm Date: Wed Sep 19 09:41:33 2018 New Revision: 338795 URL: https://svnweb.freebsd.org/changeset/base/338795 Log: MFC r338600: Update libarchive to 3.3.3 As all important changes have already been merged from libarchive git this is just a version number bump, documentation update and some polishing for cpio tests. Other source code changes are not relevant to FreeBSD. Relnotes: yes Modified: stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/README.md stable/11/contrib/libarchive/cpio/test/test_basic.c stable/11/contrib/libarchive/cpio/test/test_format_newc.c stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_cryptor.c stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/archive_pack_dev.c stable/11/usr.bin/bsdcat/Makefile stable/11/usr.bin/cpio/Makefile stable/11/usr.bin/tar/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/NEWS Wed Sep 19 09:41:33 2018 (r338795) @@ -1,3 +1,13 @@ +Sep 03, 2018: libarchive 3.3.3 released + +Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files + +Jan 27, 2018: Many fixes for building with Visual Studio + +Oct 19, 2017: NO_OVERWRITE doesn't change existing directory attributes + +Aug 12, 2017: New support for Zstandard read and write filters + Jul 09, 2017: libarchive 3.3.2 released Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) Modified: stable/11/contrib/libarchive/README.md ============================================================================== --- stable/11/contrib/libarchive/README.md Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/README.md Wed Sep 19 09:41:33 2018 (r338795) @@ -99,6 +99,7 @@ The library also detects and handles any of the follow * lzma, lzip, and xz compression * lz4 compression * lzop compression + * zstandard compression The library can create archives in any of the following formats: * POSIX ustar @@ -125,6 +126,7 @@ When creating archives, the result can be filtered wit * lzma, lzip, and xz compression * lz4 compression * lzop compression + * zstandard compression ## Notes about the Library Design @@ -159,7 +161,7 @@ questions we are asked about libarchive: * On read, compression and format are always detected automatically. -* The same API is used for all formats; in particular, it's very +* The same API is used for all formats; it should be very easy for software using libarchive to transparently handle any of libarchive's archiving formats. Modified: stable/11/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_basic.c Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/cpio/test/test_basic.c Wed Sep 19 09:41:33 2018 (r338795) @@ -144,49 +144,79 @@ DEFINE_TEST(test_basic) /* File with 10 bytes content. */ assertMakeFile("file", 0644, "1234567890"); fprintf(filelist, "file\n"); - if (is_LargeInode("file")) + if (is_LargeInode("file")) { strncat(result, - "bsdcpio: file: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* hardlink to above file. */ assertMakeHardlink("linkfile", "file"); fprintf(filelist, "linkfile\n"); - if (is_LargeInode("linkfile")) + if (is_LargeInode("linkfile")) { strncat(result, - "bsdcpio: linkfile: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: linkfile: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* Symlink to above file. */ if (canSymlink()) { assertMakeSymlink("symlink", "file"); fprintf(filelist, "symlink\n"); - if (is_LargeInode("symlink")) + if (is_LargeInode("symlink")) { strncat(result, - "bsdcpio: symlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: symlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } } /* Another file with different permissions. */ assertMakeFile("file2", 0777, "1234567890"); fprintf(filelist, "file2\n"); - if (is_LargeInode("file2")) + if (is_LargeInode("file2")) { strncat(result, - "bsdcpio: file2: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file2: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* Directory. */ assertMakeDir("dir", 0775); fprintf(filelist, "dir\n"); - if (is_LargeInode("dir")) + if (is_LargeInode("dir")) { strncat(result, - "bsdcpio: dir: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: dir: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } strncat(result, "2 blocks\n", sizeof(result) - strlen(result) -1); /* All done. */ Modified: stable/11/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- stable/11/contrib/libarchive/cpio/test/test_format_newc.c Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/cpio/test/test_format_newc.c Wed Sep 19 09:41:33 2018 (r338795) @@ -124,26 +124,42 @@ DEFINE_TEST(test_format_newc) /* Setup result message. */ memset(result, 0, sizeof(result)); - if (is_LargeInode("file1")) + if (is_LargeInode("file1")) { strncat(result, - "bsdcpio: file1: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file1: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (canSymlink() && is_LargeInode("symlink")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (canSymlink() && is_LargeInode("symlink")) { strncat(result, - "bsdcpio: symlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: symlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (is_LargeInode("dir")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (is_LargeInode("dir")) { strncat(result, - "bsdcpio: dir: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: dir: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (is_LargeInode("hardlink")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (is_LargeInode("hardlink")) { strncat(result, - "bsdcpio: hardlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: hardlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } /* Record some facts about what we just created: */ now = time(NULL); /* They were all created w/in last two seconds. */ Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/libarchive/archive.h Wed Sep 19 09:41:33 2018 (r338795) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003002 +#define ARCHIVE_VERSION_NUMBER 3003003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/11/contrib/libarchive/libarchive/archive_cryptor.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_cryptor.c Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/libarchive/archive_cryptor.c Wed Sep 19 09:41:33 2018 (r338795) @@ -153,7 +153,7 @@ aes_ctr_encrypt_counter(archive_crypto_ctx *ctx) CCCryptorStatus r; r = CCCryptorReset(ref, NULL); - if (r != kCCSuccess) + if (r != kCCSuccess && r != kCCUnimplemented) return -1; r = CCCryptorUpdate(ref, ctx->nonce, AES_BLOCK_SIZE, ctx->encr_buf, AES_BLOCK_SIZE, NULL); Modified: stable/11/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.h Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/libarchive/archive_entry.h Wed Sep 19 09:41:33 2018 (r338795) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003002 +#define ARCHIVE_VERSION_NUMBER 3003003 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/11/contrib/libarchive/libarchive/archive_pack_dev.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_pack_dev.c Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/contrib/libarchive/libarchive/archive_pack_dev.c Wed Sep 19 09:41:33 2018 (r338795) @@ -57,6 +57,9 @@ __RCSID("$NetBSD$"); #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif Modified: stable/11/usr.bin/bsdcat/Makefile ============================================================================== --- stable/11/usr.bin/bsdcat/Makefile Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/usr.bin/bsdcat/Makefile Wed Sep 19 09:41:33 2018 (r338795) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.3.2 +BSDCAT_VERSION_STRING= 3.3.3 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c Modified: stable/11/usr.bin/cpio/Makefile ============================================================================== --- stable/11/usr.bin/cpio/Makefile Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/usr.bin/cpio/Makefile Wed Sep 19 09:41:33 2018 (r338795) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.3.2 +BSDCPIO_VERSION_STRING= 3.3.3 .PATH: ${_LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c Modified: stable/11/usr.bin/tar/Makefile ============================================================================== --- stable/11/usr.bin/tar/Makefile Wed Sep 19 09:29:06 2018 (r338794) +++ stable/11/usr.bin/tar/Makefile Wed Sep 19 09:41:33 2018 (r338795) @@ -4,7 +4,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.3.2 +BSDTAR_VERSION_STRING= 3.3.3 .PATH: ${_LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-svn-src-stable@freebsd.org Wed Sep 19 09:41:47 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD8F1095462; Wed, 19 Sep 2018 09:41:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C91C79C83; Wed, 19 Sep 2018 09:41:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17839550D; Wed, 19 Sep 2018 09:41:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8J9fkia052069; Wed, 19 Sep 2018 09:41:46 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8J9fiY6052055; Wed, 19 Sep 2018 09:41:44 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201809190941.w8J9fiY6052055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 19 Sep 2018 09:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338796 - in stable/10: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 338796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 09:41:47 -0000 Author: mm Date: Wed Sep 19 09:41:44 2018 New Revision: 338796 URL: https://svnweb.freebsd.org/changeset/base/338796 Log: MFC r338600: Update libarchive to 3.3.3 As all important changes have already been merged from libarchive git this is just a version number bump, documentation update and some polishing for cpio tests. Other source code changes are not relevant to FreeBSD. Relnotes: yes Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/README.md stable/10/contrib/libarchive/cpio/test/test_basic.c stable/10/contrib/libarchive/cpio/test/test_format_newc.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_cryptor.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_pack_dev.c stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/NEWS Wed Sep 19 09:41:44 2018 (r338796) @@ -1,3 +1,13 @@ +Sep 03, 2018: libarchive 3.3.3 released + +Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files + +Jan 27, 2018: Many fixes for building with Visual Studio + +Oct 19, 2017: NO_OVERWRITE doesn't change existing directory attributes + +Aug 12, 2017: New support for Zstandard read and write filters + Jul 09, 2017: libarchive 3.3.2 released Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) Modified: stable/10/contrib/libarchive/README.md ============================================================================== --- stable/10/contrib/libarchive/README.md Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/README.md Wed Sep 19 09:41:44 2018 (r338796) @@ -99,6 +99,7 @@ The library also detects and handles any of the follow * lzma, lzip, and xz compression * lz4 compression * lzop compression + * zstandard compression The library can create archives in any of the following formats: * POSIX ustar @@ -125,6 +126,7 @@ When creating archives, the result can be filtered wit * lzma, lzip, and xz compression * lz4 compression * lzop compression + * zstandard compression ## Notes about the Library Design @@ -159,7 +161,7 @@ questions we are asked about libarchive: * On read, compression and format are always detected automatically. -* The same API is used for all formats; in particular, it's very +* The same API is used for all formats; it should be very easy for software using libarchive to transparently handle any of libarchive's archiving formats. Modified: stable/10/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_basic.c Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/cpio/test/test_basic.c Wed Sep 19 09:41:44 2018 (r338796) @@ -144,49 +144,79 @@ DEFINE_TEST(test_basic) /* File with 10 bytes content. */ assertMakeFile("file", 0644, "1234567890"); fprintf(filelist, "file\n"); - if (is_LargeInode("file")) + if (is_LargeInode("file")) { strncat(result, - "bsdcpio: file: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* hardlink to above file. */ assertMakeHardlink("linkfile", "file"); fprintf(filelist, "linkfile\n"); - if (is_LargeInode("linkfile")) + if (is_LargeInode("linkfile")) { strncat(result, - "bsdcpio: linkfile: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: linkfile: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* Symlink to above file. */ if (canSymlink()) { assertMakeSymlink("symlink", "file"); fprintf(filelist, "symlink\n"); - if (is_LargeInode("symlink")) + if (is_LargeInode("symlink")) { strncat(result, - "bsdcpio: symlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: symlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } } /* Another file with different permissions. */ assertMakeFile("file2", 0777, "1234567890"); fprintf(filelist, "file2\n"); - if (is_LargeInode("file2")) + if (is_LargeInode("file2")) { strncat(result, - "bsdcpio: file2: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file2: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } /* Directory. */ assertMakeDir("dir", 0775); fprintf(filelist, "dir\n"); - if (is_LargeInode("dir")) + if (is_LargeInode("dir")) { strncat(result, - "bsdcpio: dir: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: dir: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, + strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, + "\n", + sizeof(result) - strlen(result) -1); + } strncat(result, "2 blocks\n", sizeof(result) - strlen(result) -1); /* All done. */ Modified: stable/10/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_format_newc.c Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/cpio/test/test_format_newc.c Wed Sep 19 09:41:44 2018 (r338796) @@ -124,26 +124,42 @@ DEFINE_TEST(test_format_newc) /* Setup result message. */ memset(result, 0, sizeof(result)); - if (is_LargeInode("file1")) + if (is_LargeInode("file1")) { strncat(result, - "bsdcpio: file1: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: file1: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (canSymlink() && is_LargeInode("symlink")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (canSymlink() && is_LargeInode("symlink")) { strncat(result, - "bsdcpio: symlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: symlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (is_LargeInode("dir")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (is_LargeInode("dir")) { strncat(result, - "bsdcpio: dir: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: dir: large inode number truncated: ", sizeof(result) - strlen(result) -1); - if (is_LargeInode("hardlink")) + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } + if (is_LargeInode("hardlink")) { strncat(result, - "bsdcpio: hardlink: large inode number truncated: " - "Numerical result out of range\n", + "bsdcpio: hardlink: large inode number truncated: ", sizeof(result) - strlen(result) -1); + strncat(result, strerror(ERANGE), + sizeof(result) - strlen(result) -1); + strncat(result, "\n", + sizeof(result) - strlen(result) -1); + } /* Record some facts about what we just created: */ now = time(NULL); /* They were all created w/in last two seconds. */ Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/libarchive/archive.h Wed Sep 19 09:41:44 2018 (r338796) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003002 +#define ARCHIVE_VERSION_NUMBER 3003003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.3.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cryptor.c Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/libarchive/archive_cryptor.c Wed Sep 19 09:41:44 2018 (r338796) @@ -153,7 +153,7 @@ aes_ctr_encrypt_counter(archive_crypto_ctx *ctx) CCCryptorStatus r; r = CCCryptorReset(ref, NULL); - if (r != kCCSuccess) + if (r != kCCSuccess && r != kCCUnimplemented) return -1; r = CCCryptorUpdate(ref, ctx->nonce, AES_BLOCK_SIZE, ctx->encr_buf, AES_BLOCK_SIZE, NULL); Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Wed Sep 19 09:41:44 2018 (r338796) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003002 +#define ARCHIVE_VERSION_NUMBER 3003003 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/10/contrib/libarchive/libarchive/archive_pack_dev.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_pack_dev.c Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/contrib/libarchive/libarchive/archive_pack_dev.c Wed Sep 19 09:41:44 2018 (r338796) @@ -57,6 +57,9 @@ __RCSID("$NetBSD$"); #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif Modified: stable/10/usr.bin/bsdcat/Makefile ============================================================================== --- stable/10/usr.bin/bsdcat/Makefile Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/usr.bin/bsdcat/Makefile Wed Sep 19 09:41:44 2018 (r338796) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.3.2 +BSDCAT_VERSION_STRING= 3.3.3 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c Modified: stable/10/usr.bin/cpio/Makefile ============================================================================== --- stable/10/usr.bin/cpio/Makefile Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/usr.bin/cpio/Makefile Wed Sep 19 09:41:44 2018 (r338796) @@ -6,7 +6,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.3.2 +BSDCPIO_VERSION_STRING= 3.3.3 .PATH: ${LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c Modified: stable/10/usr.bin/tar/Makefile ============================================================================== --- stable/10/usr.bin/tar/Makefile Wed Sep 19 09:41:33 2018 (r338795) +++ stable/10/usr.bin/tar/Makefile Wed Sep 19 09:41:44 2018 (r338796) @@ -4,7 +4,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.3.2 +BSDTAR_VERSION_STRING= 3.3.3 .PATH: ${LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-svn-src-stable@freebsd.org Wed Sep 19 19:52:54 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A80C10A51E6; Wed, 19 Sep 2018 19:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFA688F920; Wed, 19 Sep 2018 19:52:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E959A1397A; Wed, 19 Sep 2018 19:52:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8JJqrNw064695; Wed, 19 Sep 2018 19:52:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8JJqrQd064694; Wed, 19 Sep 2018 19:52:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201809191952.w8JJqrQd064694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 19 Sep 2018 19:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338808 - in stable/10/sys/dev: ic uart X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/10/sys/dev: ic uart X-SVN-Commit-Revision: 338808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 19:52:54 -0000 Author: mav Date: Wed Sep 19 19:52:53 2018 New Revision: 338808 URL: https://svnweb.freebsd.org/changeset/base/338808 Log: MFC r308750: Add support for UART found in the Ingenic XBurst system on chips. These CPUs has non-standard UART enable bit hidden in the UART FIFO Control Register. Modified: stable/10/sys/dev/ic/ns16550.h stable/10/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ic/ns16550.h ============================================================================== --- stable/10/sys/dev/ic/ns16550.h Wed Sep 19 19:35:02 2018 (r338807) +++ stable/10/sys/dev/ic/ns16550.h Wed Sep 19 19:52:53 2018 (r338808) @@ -156,6 +156,9 @@ #define FIFO_XMT_RST FCR_XMT_RST #define FCR_DMA 0x08 #define FIFO_DMA_MODE FCR_DMA +#ifdef CPU_XBURST +#define FCR_UART_ON 0x10 +#endif #define FCR_RX_LOW 0x00 #define FIFO_RX_LOW FCR_RX_LOW #define FCR_RX_MEDL 0x40 Modified: stable/10/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.c Wed Sep 19 19:35:02 2018 (r338807) +++ stable/10/sys/dev/uart/uart_dev_ns8250.c Wed Sep 19 19:52:53 2018 (r338808) @@ -188,6 +188,9 @@ ns8250_flush(struct uart_bas *bas, int what) uint8_t fcr; fcr = FCR_ENABLE; +#ifdef CPU_XBURST + fcr |= FCR_UART_ON; +#endif if (what & UART_FLUSH_TRANSMITTER) fcr |= FCR_XMT_RST; if (what & UART_FLUSH_RECEIVER) @@ -258,6 +261,10 @@ ns8250_probe(struct uart_bas *bas) { u_char val; +#ifdef CPU_XBURST + uart_setreg(bas, REG_FCR, FCR_UART_ON); +#endif + /* Check known 0 bits that don't depend on DLAB. */ val = uart_getreg(bas, REG_IIR); if (val & 0x30) @@ -279,7 +286,7 @@ static void ns8250_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { - u_char ier; + u_char ier, val; if (bas->rclk == 0) bas->rclk = DEFAULT_RCLK; @@ -296,7 +303,11 @@ ns8250_init(struct uart_bas *bas, int baudrate, int da uart_barrier(bas); /* Disable the FIFO (if present). */ - uart_setreg(bas, REG_FCR, 0); + val = 0; +#ifdef CPU_XBURST + val = FCR_UART_ON; +#endif + uart_setreg(bas, REG_FCR, val); uart_barrier(bas); /* Set RTS & DTR. */ @@ -456,6 +467,9 @@ ns8250_bus_attach(struct uart_softc *sc) ns8250->mcr = uart_getreg(bas, REG_MCR); ns8250->fcr = FCR_ENABLE; +#ifdef CPU_XBURST + ns8250->fcr |= FCR_UART_ON; +#endif if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags", &ivar)) { if (UART_FLAGS_FCR_RX_LOW(ivar)) @@ -747,6 +761,7 @@ ns8250_bus_probe(struct uart_softc *sc) struct uart_bas *bas; int count, delay, error, limit; uint8_t lsr, mcr, ier; + uint8_t val; ns8250 = (struct ns8250_softc *)sc; bas = &sc->sc_bas; @@ -780,7 +795,11 @@ ns8250_bus_probe(struct uart_softc *sc) * done. Since this is the first time we enable the FIFOs, we reset * them. */ - uart_setreg(bas, REG_FCR, FCR_ENABLE); + val = FCR_ENABLE; +#ifdef CPU_XBURST + val |= FCR_UART_ON; +#endif + uart_setreg(bas, REG_FCR, val); uart_barrier(bas); if (!(uart_getreg(bas, REG_IIR) & IIR_FIFO_MASK)) { /* @@ -794,7 +813,11 @@ ns8250_bus_probe(struct uart_softc *sc) return (0); } - uart_setreg(bas, REG_FCR, FCR_ENABLE | FCR_XMT_RST | FCR_RCV_RST); + val = FCR_ENABLE | FCR_XMT_RST | FCR_RCV_RST; +#ifdef CPU_XBURST + val |= FCR_UART_ON; +#endif + uart_setreg(bas, REG_FCR, val); uart_barrier(bas); count = 0; @@ -804,7 +827,11 @@ ns8250_bus_probe(struct uart_softc *sc) error = ns8250_drain(bas, UART_DRAIN_RECEIVER|UART_DRAIN_TRANSMITTER); if (error) { uart_setreg(bas, REG_MCR, mcr); - uart_setreg(bas, REG_FCR, 0); + val = 0; +#ifdef CPU_XBURST + val |= FCR_UART_ON; +#endif + uart_setreg(bas, REG_FCR, val); uart_barrier(bas); goto describe; } @@ -834,7 +861,11 @@ ns8250_bus_probe(struct uart_softc *sc) ier = uart_getreg(bas, REG_IER) & ns8250->ier_mask; uart_setreg(bas, REG_IER, ier); uart_setreg(bas, REG_MCR, mcr); - uart_setreg(bas, REG_FCR, 0); + val = 0; +#ifdef CPU_XBURST + val |= FCR_UART_ON; +#endif + uart_setreg(bas, REG_FCR, val); uart_barrier(bas); count = 0; goto describe; From owner-svn-src-stable@freebsd.org Wed Sep 19 19:54:15 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B3810A5287; Wed, 19 Sep 2018 19:54:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7898C8FA76; Wed, 19 Sep 2018 19:54:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53E731397D; Wed, 19 Sep 2018 19:54:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8JJsEW2064820; Wed, 19 Sep 2018 19:54:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8JJsDh0064819; Wed, 19 Sep 2018 19:54:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201809191954.w8JJsDh0064819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 19 Sep 2018 19:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338809 - stable/10/sys/dev/uart X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/dev/uart X-SVN-Commit-Revision: 338809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 19:54:15 -0000 Author: mav Date: Wed Sep 19 19:54:13 2018 New Revision: 338809 URL: https://svnweb.freebsd.org/changeset/base/338809 Log: MFC r317659, r317752: Make some UART consoles to not spin wait for data to be sent. At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot time with serial console at 115200 baud. Modified: stable/10/sys/dev/uart/uart_dev_lpc.c stable/10/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_lpc.c Wed Sep 19 19:52:53 2018 (r338808) +++ stable/10/sys/dev/uart/uart_dev_lpc.c Wed Sep 19 19:54:13 2018 (r338809) @@ -346,9 +346,6 @@ lpc_ns8250_putc(struct uart_bas *bas, int c) DELAY(4); uart_setreg(bas, REG_DATA, c); uart_barrier(bas); - limit = 250000; - while ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(4); } static int @@ -889,8 +886,13 @@ lpc_ns8250_bus_transmit(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - ; + if (sc->sc_txdatasz > 1) { + if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) + lpc_ns8250_drain(bas, UART_DRAIN_TRANSMITTER); + } else { + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); + } uart_setreg(bas, REG_IER, lpc_ns8250->ier | IER_ETXRDY); uart_barrier(bas); for (i = 0; i < sc->sc_txdatasz; i++) { Modified: stable/10/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.c Wed Sep 19 19:52:53 2018 (r338808) +++ stable/10/sys/dev/uart/uart_dev_ns8250.c Wed Sep 19 19:54:13 2018 (r338809) @@ -305,7 +305,7 @@ ns8250_init(struct uart_bas *bas, int baudrate, int da /* Disable the FIFO (if present). */ val = 0; #ifdef CPU_XBURST - val = FCR_UART_ON; + val |= FCR_UART_ON; #endif uart_setreg(bas, REG_FCR, val); uart_barrier(bas); @@ -336,9 +336,6 @@ ns8250_putc(struct uart_bas *bas, int c) DELAY(4); uart_setreg(bas, REG_DATA, c); uart_barrier(bas); - limit = 250000; - while ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(4); } static int @@ -993,8 +990,13 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - ; + if (sc->sc_txdatasz > 1) { + if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); + } else { + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); + } uart_setreg(bas, REG_IER, ns8250->ier | IER_ETXRDY); uart_barrier(bas); for (i = 0; i < sc->sc_txdatasz; i++) { From owner-svn-src-stable@freebsd.org Thu Sep 20 16:44:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14E5F10A24DE; Thu, 20 Sep 2018 16:44:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD0FE74A6D; Thu, 20 Sep 2018 16:43:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7FDE2098D; Thu, 20 Sep 2018 16:43:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8KGhxtf012033; Thu, 20 Sep 2018 16:43:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8KGhxgO012031; Thu, 20 Sep 2018 16:43:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201809201643.w8KGhxgO012031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 20 Sep 2018 16:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338833 - in stable/11: . lib/libclang_rt X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: . lib/libclang_rt X-SVN-Commit-Revision: 338833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 16:44:00 -0000 Author: jhb Date: Thu Sep 20 16:43:58 2018 New Revision: 338833 URL: https://svnweb.freebsd.org/changeset/base/338833 Log: MFC 337270: Install the 32-bit compat sanitizer libraries. The lib32 build was already building the i386 version of the clang sanitizers (libclang_rt) but they were not being installed. This enables the installation. MK_TOOLCHAIN=no was originally added to the install make environment to disable includes so that NO_INCS could be removed. The MK_TOOLCHAIN in bsd.incs.mk was subsequently renamed to MK_INCLUDES, but bsd.lib.mk doesn't even include bsd.incs.mk when LIBRARIES_ONLY is defined which the install make environment for compat libs now defines. However, setting MK_TOOLCHAIN=no forced MK_CLANG=no which disabled libclang_rt during the install32 phase. Remove MK_TOOLCHAIN=no since LIBRARIES_ONLY is now sufficient. Since the libcompat environment overrides both LIBDIR and SHLIBDIR, libclang_rt/Makefile.inc has to set both variables to force the libraries to be installed to the location expected by the compiler. Modified: stable/11/Makefile.libcompat stable/11/lib/libclang_rt/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.libcompat ============================================================================== --- stable/11/Makefile.libcompat Thu Sep 20 16:37:50 2018 (r338832) +++ stable/11/Makefile.libcompat Thu Sep 20 16:43:58 2018 (r338833) @@ -111,7 +111,7 @@ LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ - MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ + ${IMAKE_INSTALL} \ -DLIBRARIES_ONLY _LC_LIBDIRS.yes= lib gnu/lib Modified: stable/11/lib/libclang_rt/Makefile.inc ============================================================================== --- stable/11/lib/libclang_rt/Makefile.inc Thu Sep 20 16:37:50 2018 (r338832) +++ stable/11/lib/libclang_rt/Makefile.inc Thu Sep 20 16:43:58 2018 (r338833) @@ -9,6 +9,7 @@ CRTSRC= ${SRCTOP}/contrib/compiler-rt CLANGDIR= /usr/lib/clang/6.0.1 LIBDIR= ${CLANGDIR}/lib/freebsd +SHLIBDIR= ${LIBDIR} NO_PIC= MK_PROFILE= no From owner-svn-src-stable@freebsd.org Fri Sep 21 15:58:09 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D41109D70C; Fri, 21 Sep 2018 15:58:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0328C84768; Fri, 21 Sep 2018 15:58:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED9D27253; Fri, 21 Sep 2018 15:58:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LFw8ZM034783; Fri, 21 Sep 2018 15:58:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LFw85E034782; Fri, 21 Sep 2018 15:58:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201809211558.w8LFw85E034782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 21 Sep 2018 15:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338859 - in stable: 10/release/scripts 11/release/scripts X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/scripts 11/release/scripts X-SVN-Commit-Revision: 338859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 15:58:09 -0000 Author: gjb Date: Fri Sep 21 15:58:08 2018 New Revision: 338859 URL: https://svnweb.freebsd.org/changeset/base/338859 Log: MFC r338754: Update the pkg-stage.sh script used to populate packages on the dvd1.iso installation medium from including KDE4 to KDE5, as the KDE4-based ports have been marked as deprecated in the Ports Collection. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/scripts/pkg-stage.sh Directory Properties: stable/11/ (props changed) Modified: stable/10/release/scripts/pkg-stage.sh ============================================================================== --- stable/10/release/scripts/pkg-stage.sh Fri Sep 21 15:00:46 2018 (r338858) +++ stable/10/release/scripts/pkg-stage.sh Fri Sep 21 15:58:08 2018 (r338859) @@ -29,7 +29,7 @@ www/firefox www/links x11-drivers/xf86-video-vmware x11/gnome3 -x11/kde4 +x11/kde5 x11/xorg" # If NOPORTS is set for the release, do not attempt to build pkg(8). From owner-svn-src-stable@freebsd.org Fri Sep 21 15:58:09 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7872D109D70D; Fri, 21 Sep 2018 15:58:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFE984769; Fri, 21 Sep 2018 15:58:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25F677254; Fri, 21 Sep 2018 15:58:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LFw9Ja034789; Fri, 21 Sep 2018 15:58:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LFw9sq034788; Fri, 21 Sep 2018 15:58:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201809211558.w8LFw9sq034788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 21 Sep 2018 15:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338859 - in stable: 10/release/scripts 11/release/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/scripts 11/release/scripts X-SVN-Commit-Revision: 338859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 15:58:09 -0000 Author: gjb Date: Fri Sep 21 15:58:08 2018 New Revision: 338859 URL: https://svnweb.freebsd.org/changeset/base/338859 Log: MFC r338754: Update the pkg-stage.sh script used to populate packages on the dvd1.iso installation medium from including KDE4 to KDE5, as the KDE4-based ports have been marked as deprecated in the Ports Collection. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/scripts/pkg-stage.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Modified: stable/11/release/scripts/pkg-stage.sh ============================================================================== --- stable/11/release/scripts/pkg-stage.sh Fri Sep 21 15:00:46 2018 (r338858) +++ stable/11/release/scripts/pkg-stage.sh Fri Sep 21 15:58:08 2018 (r338859) @@ -30,7 +30,7 @@ www/firefox www/links x11-drivers/xf86-video-vmware x11/gnome3 -x11/kde4 +x11/kde5 x11/xorg" # If NOPORTS is set for the release, do not attempt to build pkg(8). From owner-svn-src-stable@freebsd.org Fri Sep 21 20:40:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F8C10A39ED; Fri, 21 Sep 2018 20:40:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484668F8CF; Fri, 21 Sep 2018 20:40:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4311F11FCF; Fri, 21 Sep 2018 20:40:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LKeeGP082593; Fri, 21 Sep 2018 20:40:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LKebY9082578; Fri, 21 Sep 2018 20:40:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809212040.w8LKebY9082578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 21 Sep 2018 20:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338867 - in stable/11/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys X-SVN-Commit-Revision: 338867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 20:40:40 -0000 Author: markj Date: Fri Sep 21 20:40:37 2018 New Revision: 338867 URL: https://svnweb.freebsd.org/changeset/base/338867 Log: MFC r338211: Prepare the kernel linker to handle PC-relative ifunc relocations. Modified: stable/11/sys/amd64/amd64/elf_machdep.c stable/11/sys/arm/arm/elf_machdep.c stable/11/sys/arm64/arm64/elf_machdep.c stable/11/sys/i386/i386/elf_machdep.c stable/11/sys/kern/link_elf.c stable/11/sys/kern/link_elf_obj.c stable/11/sys/mips/mips/elf_machdep.c stable/11/sys/powerpc/powerpc/elf32_machdep.c stable/11/sys/powerpc/powerpc/elf64_machdep.c stable/11/sys/riscv/riscv/elf_machdep.c stable/11/sys/sparc64/sparc64/elf_machdep.c stable/11/sys/sys/linker.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/amd64/amd64/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -173,13 +173,17 @@ elf64_dump_thread(struct thread *td, void *dst, size_t *off = len; } -#define ERI_LOCAL 0x0001 -#define ERI_ONLYIFUNC 0x0002 +bool +elf_is_ifunc_reloc(Elf_Size r_info) +{ + return (ELF_R_TYPE(r_info) == R_X86_64_IRELATIVE); +} + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, elf_lookup_fn lookup, int flags) + int type, elf_lookup_fn lookup) { Elf64_Addr *where, val; Elf32_Addr *where32, val32; @@ -219,9 +223,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } - if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_X86_64_IRELATIVE)) - return (0); - switch (rtype) { case R_X86_64_NONE: /* none */ break; @@ -298,20 +299,11 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas } int -elf_reloc_ifunc(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, elf_lookup_fn lookup) -{ - - return (elf_reloc_internal(lf, relocbase, data, type, lookup, - ERI_ONLYIFUNC)); -} - -int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, lookup, 0)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup)); } int @@ -319,8 +311,7 @@ elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, lookup, - ERI_LOCAL)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup)); } int Modified: stable/11/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/11/sys/arm/arm/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/arm/arm/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -147,6 +147,13 @@ elf32_dump_thread(struct thread *td, void *dst, size_t #endif } +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + /* * It is possible for the compiler to emit relocations for unaligned data. * We handle this situation with these inlines. Modified: stable/11/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/arm64/arm64/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -129,6 +129,13 @@ elf64_dump_thread(struct thread *td __unused, void *ds } +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) Modified: stable/11/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/11/sys/i386/i386/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/i386/i386/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -158,8 +158,14 @@ elf32_dump_thread(struct thread *td, void *dst, size_t *off = len; } +bool +elf_is_ifunc_reloc(Elf_Size r_info) +{ + + return (ELF_R_TYPE(r_info) == R_386_IRELATIVE); +} + #define ERI_LOCAL 0x0001 -#define ERI_ONLYIFUNC 0x0002 /* Process one elf relocation with addend. */ static int @@ -193,9 +199,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } - if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_386_IRELATIVE)) - return (0); - if ((flags & ERI_LOCAL) != 0) { if (rtype == R_386_RELATIVE) { /* A + B */ addr = elf_relocaddr(lf, relocbase + addend); @@ -260,15 +263,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas return -1; } return(0); -} - -int -elf_reloc_ifunc(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, elf_lookup_fn lookup) -{ - - return (elf_reloc_internal(lf, relocbase, data, type, lookup, - ERI_ONLYIFUNC)); } int Modified: stable/11/sys/kern/link_elf.c ============================================================================== --- stable/11/sys/kern/link_elf.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/kern/link_elf.c Fri Sep 21 20:40:37 2018 (r338867) @@ -186,11 +186,13 @@ static struct linker_class link_elf_class = { link_elf_methods, sizeof(struct elf_file) }; +typedef int (*elf_reloc_fn)(linker_file_t lf, Elf_Addr relocbase, + const void *data, int type, elf_lookup_fn lookup); + static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); -static int relocate_file1(elf_file_t ef, int (*elf_reloc_func)( - linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, elf_lookup_fn lookup)); +static int relocate_file1(elf_file_t ef, elf_lookup_fn lookup, + elf_reloc_fn reloc, bool ifuncs); static int link_elf_preload_parse_symbols(elf_file_t); static struct elf_set_head set_pcpu_list; @@ -1186,96 +1188,61 @@ symbol_name(elf_file_t ef, Elf_Size r_info) } static int -relocate_file1(elf_file_t ef, int (*elf_reloc_func)(linker_file_t lf, - Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup)) +symbol_type(elf_file_t ef, Elf_Size r_info) { - const Elf_Rel *rellim; + const Elf_Sym *ref; + + if (ELF_R_SYM(r_info)) { + ref = ef->symtab + ELF_R_SYM(r_info); + return (ELF_ST_TYPE(ref->st_info)); + } + return (STT_NOTYPE); +} + +static int +relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, + bool ifuncs) +{ const Elf_Rel *rel; - const Elf_Rela *relalim; const Elf_Rela *rela; const char *symname; - /* Perform relocations without addend if there are any: */ - rel = ef->rel; - if (rel != NULL) { - rellim = (const Elf_Rel *) - ((const char *)ef->rel + ef->relsize); - while (rel < rellim) { - if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rel, - ELF_RELOC_REL, elf_lookup)) { - symname = symbol_name(ef, rel->r_info); - printf("link_elf: symbol %s undefined\n", symname); - return (ENOENT); - } - rel++; - } - } +#define APPLY_RELOCS(iter, tbl, tblsize, type) do { \ + for ((iter) = (tbl); (iter) != NULL && \ + (iter) < (tbl) + (tblsize) / sizeof(*(iter)); (iter)++) { \ + if ((symbol_type(ef, (iter)->r_info) == \ + STT_GNU_IFUNC || \ + elf_is_ifunc_reloc((iter)->r_info)) != ifuncs) \ + continue; \ + if (reloc(&ef->lf, (Elf_Addr)ef->address, \ + (iter), (type), lookup)) { \ + symname = symbol_name(ef, (iter)->r_info); \ + printf("link_elf: symbol %s undefined\n", \ + symname); \ + return (ENOENT); \ + } \ + } \ +} while (0) - /* Perform relocations with addend if there are any: */ - rela = ef->rela; - if (rela != NULL) { - relalim = (const Elf_Rela *) - ((const char *)ef->rela + ef->relasize); - while (rela < relalim) { - if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rela, - ELF_RELOC_RELA, elf_lookup)) { - symname = symbol_name(ef, rela->r_info); - printf("link_elf: symbol %s undefined\n", - symname); - return (ENOENT); - } - rela++; - } - } + APPLY_RELOCS(rel, ef->rel, ef->relsize, ELF_RELOC_REL); + APPLY_RELOCS(rela, ef->rela, ef->relasize, ELF_RELOC_RELA); + APPLY_RELOCS(rel, ef->pltrel, ef->pltrelsize, ELF_RELOC_REL); + APPLY_RELOCS(rela, ef->pltrela, ef->pltrelasize, ELF_RELOC_RELA); - /* Perform PLT relocations without addend if there are any: */ - rel = ef->pltrel; - if (rel != NULL) { - rellim = (const Elf_Rel *) - ((const char *)ef->pltrel + ef->pltrelsize); - while (rel < rellim) { - if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rel, - ELF_RELOC_REL, elf_lookup)) { - symname = symbol_name(ef, rel->r_info); - printf("link_elf: symbol %s undefined\n", - symname); - return (ENOENT); - } - rel++; - } - } +#undef APPLY_RELOCS - /* Perform relocations with addend if there are any: */ - rela = ef->pltrela; - if (rela != NULL) { - relalim = (const Elf_Rela *) - ((const char *)ef->pltrela + ef->pltrelasize); - while (rela < relalim) { - if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rela, - ELF_RELOC_RELA, elf_lookup)) { - symname = symbol_name(ef, rela->r_info); - printf("link_elf: symbol %s undefined\n", - symname); - return (ENOENT); - } - rela++; - } - } - return (0); } static int relocate_file(elf_file_t ef) { - int e; + int error; - e = relocate_file1(ef, elf_reloc); -#if defined(__i386__) || defined(__amd64__) - if (e == 0) - e = relocate_file1(ef, elf_reloc_ifunc); -#endif - return (e); + error = relocate_file1(ef, elf_lookup, elf_reloc, false); + if (error == 0) + error = relocate_file1(ef, elf_lookup, elf_reloc, true); + return (error); } /* @@ -1299,7 +1266,7 @@ elf_hash(const char *name) } static int -link_elf_lookup_symbol(linker_file_t lf, const char* name, c_linker_sym_t* sym) +link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym) { elf_file_t ef = (elf_file_t) lf; unsigned long symnum; @@ -1688,6 +1655,29 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) } #if defined(__i386__) || defined(__amd64__) +/* + * Use this lookup routine when performing relocations early during boot. + * The generic lookup routine depends on kobj, which is not initialized + * at that point. + */ +static int +elf_lookup_ifunc(linker_file_t lf, Elf_Size symidx, int deps __unused, + Elf_Addr *res) +{ + elf_file_t ef; + const Elf_Sym *symp; + caddr_t val; + + ef = (elf_file_t)lf; + symp = ef->symtab + symidx; + if (ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC) { + val = (caddr_t)ef->address + symp->st_value; + *res = ((Elf_Addr (*)(void))val)(); + return (0); + } + return (ENOENT); +} + void link_elf_ireloc(caddr_t kmdp) { @@ -1696,7 +1686,7 @@ link_elf_ireloc(caddr_t kmdp) volatile char *c; size_t i; - ef = &eff; + ef = &eff; /* Do not use bzero/memset before ireloc is done. */ for (c = (char *)ef, i = 0; i < sizeof(*ef); i++) @@ -1707,6 +1697,6 @@ link_elf_ireloc(caddr_t kmdp) parse_dynamic(ef); ef->address = 0; link_elf_preload_parse_symbols(ef); - relocate_file1(ef, elf_reloc_ifunc); + relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); } #endif Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/kern/link_elf_obj.c Fri Sep 21 20:40:37 2018 (r338867) @@ -1513,15 +1513,10 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == - ifuncs) + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rel->r_info)) == ifuncs) elf_reloc_local(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); -#if defined(__i386__) || defined(__amd64__) - else if (ifuncs) - elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); -#endif } } @@ -1546,15 +1541,10 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == - ifuncs) + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || + elf_is_ifunc_reloc(rela->r_info)) == ifuncs) elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); -#if defined(__i386__) || defined(__amd64__) - else if (ifuncs) - elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); -#endif } } return (0); Modified: stable/11/sys/mips/mips/elf_machdep.c ============================================================================== --- stable/11/sys/mips/mips/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/mips/mips/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -161,6 +161,13 @@ elf32_dump_thread(struct thread *td __unused, void *ds } #endif +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, Modified: stable/11/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- stable/11/sys/powerpc/powerpc/elf32_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/powerpc/powerpc/elf32_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -170,6 +170,13 @@ elf32_dump_thread(struct thread *td, void *dst, size_t } #ifndef __powerpc64__ +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, Modified: stable/11/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- stable/11/sys/powerpc/powerpc/elf64_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/powerpc/powerpc/elf64_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -246,6 +246,12 @@ elf64_dump_thread(struct thread *td, void *dst, size_t *off = len; } +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} /* Process one elf relocation with addend. */ static int Modified: stable/11/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/11/sys/riscv/riscv/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/riscv/riscv/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -259,6 +259,13 @@ reloctype_to_str(int type) return "*unknown*"; } +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + /* * Currently kernel loadable module for RISCV is compiled with -fPIC option. * (see also additional CFLAGS definition for RISCV in sys/conf/kmod.mk) Modified: stable/11/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/11/sys/sparc64/sparc64/elf_machdep.c Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/sparc64/sparc64/elf_machdep.c Fri Sep 21 20:40:37 2018 (r338867) @@ -310,6 +310,13 @@ static const long reloc_target_bitmask[] = { }; #define RELOC_VALUE_BITMASK(t) (reloc_target_bitmask[t]) +bool +elf_is_ifunc_reloc(Elf_Size r_info __unused) +{ + + return (false); +} + int elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup __unused) Modified: stable/11/sys/sys/linker.h ============================================================================== --- stable/11/sys/sys/linker.h Fri Sep 21 20:38:23 2018 (r338866) +++ stable/11/sys/sys/linker.h Fri Sep 21 20:40:37 2018 (r338867) @@ -269,9 +269,8 @@ extern int kld_debug; typedef int elf_lookup_fn(linker_file_t, Elf_Size, int, Elf_Addr *); /* Support functions */ +bool elf_is_ifunc_reloc(Elf_Size r_info); int elf_reloc(linker_file_t _lf, Elf_Addr base, const void *_rel, - int _type, elf_lookup_fn _lu); -int elf_reloc_ifunc(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu); int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu); From owner-svn-src-stable@freebsd.org Fri Sep 21 21:15:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4416710A4434; Fri, 21 Sep 2018 21:15:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF13D709A3; Fri, 21 Sep 2018 21:15:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E94D91262B; Fri, 21 Sep 2018 21:15:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LLFhNf000422; Fri, 21 Sep 2018 21:15:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LLFhDw000421; Fri, 21 Sep 2018 21:15:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201809212115.w8LLFhDw000421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 21 Sep 2018 21:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338868 - stable/11/usr.sbin/asf X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.sbin/asf X-SVN-Commit-Revision: 338868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 21:15:44 -0000 Author: markj Date: Fri Sep 21 21:15:43 2018 New Revision: 338868 URL: https://svnweb.freebsd.org/changeset/base/338868 Log: Include stdbool.h so that we can use bool in linker.h. As asf(8) is gone in head, this is a direct commit to stable/11. Modified: stable/11/usr.sbin/asf/asf_kvm.c Modified: stable/11/usr.sbin/asf/asf_kvm.c ============================================================================== --- stable/11/usr.sbin/asf/asf_kvm.c Fri Sep 21 20:40:37 2018 (r338867) +++ stable/11/usr.sbin/asf/asf_kvm.c Fri Sep 21 21:15:43 2018 (r338868) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-stable@freebsd.org Fri Sep 21 23:31:06 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3011110A7154; Fri, 21 Sep 2018 23:31:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B1B755DE; Fri, 21 Sep 2018 23:31:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D48F313B93; Fri, 21 Sep 2018 23:31:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LNV5Rb071613; Fri, 21 Sep 2018 23:31:05 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LNV5C5071609; Fri, 21 Sep 2018 23:31:05 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201809212331.w8LNV5C5071609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 21 Sep 2018 23:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338871 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 338871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 23:31:06 -0000 Author: erj Date: Fri Sep 21 23:31:04 2018 New Revision: 338871 URL: https://svnweb.freebsd.org/changeset/base/338871 Log: MFC r334231, r334779, r335322, and r338208 to stable/11 from head These include: r334231: iflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN r334779: iflib: Record TCP checksum info in iflib when TCP checksum is requested r335322: iflib: Style fixes r338208: if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types Sponsored by: Intel Corporation Modified: stable/11/sys/net/ieee8023ad_lacp.c stable/11/sys/net/if_media.h stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/11/sys/net/ieee8023ad_lacp.c Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/ieee8023ad_lacp.c Fri Sep 21 23:31:04 2018 (r338871) @@ -1071,6 +1071,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_100_VG: case IFM_100_T2: case IFM_100_T: + case IFM_100_SGMII: key = IFM_100_TX; break; case IFM_1000_SX: @@ -1102,14 +1103,31 @@ lacp_compose_key(struct lacp_port *lp) break; case IFM_2500_KX: case IFM_2500_T: + case IFM_2500_X: key = IFM_2500_KX; break; case IFM_5000_T: + case IFM_5000_KR: + case IFM_5000_KR_S: + case IFM_5000_KR1: key = IFM_5000_T; break; case IFM_50G_PCIE: case IFM_50G_CR2: case IFM_50G_KR2: + case IFM_50G_SR2: + case IFM_50G_LR2: + case IFM_50G_LAUI2_AC: + case IFM_50G_LAUI2: + case IFM_50G_AUI2_AC: + case IFM_50G_AUI2: + case IFM_50G_CP: + case IFM_50G_SR: + case IFM_50G_LR: + case IFM_50G_FR: + case IFM_50G_KR_PAM4: + case IFM_50G_AUI1_AC: + case IFM_50G_AUI1: key = IFM_50G_PCIE; break; case IFM_56G_R4: @@ -1122,6 +1140,12 @@ lacp_compose_key(struct lacp_port *lp) case IFM_25G_LR: case IFM_25G_ACC: case IFM_25G_AOC: + case IFM_25G_T: + case IFM_25G_CR_S: + case IFM_25G_CR1: + case IFM_25G_KR_S: + case IFM_25G_AUI: + case IFM_25G_KR1: key = IFM_25G_PCIE; break; case IFM_40G_CR4: @@ -1129,13 +1153,49 @@ lacp_compose_key(struct lacp_port *lp) case IFM_40G_LR4: case IFM_40G_XLPPI: case IFM_40G_KR4: + case IFM_40G_XLAUI: + case IFM_40G_XLAUI_AC: + case IFM_40G_ER4: key = IFM_40G_CR4; break; case IFM_100G_CR4: case IFM_100G_SR4: case IFM_100G_KR4: case IFM_100G_LR4: + case IFM_100G_CAUI4_AC: + case IFM_100G_CAUI4: + case IFM_100G_AUI4_AC: + case IFM_100G_AUI4: + case IFM_100G_CR_PAM4: + case IFM_100G_KR_PAM4: + case IFM_100G_CP2: + case IFM_100G_SR2: + case IFM_100G_DR: + case IFM_100G_KR2_PAM4: + case IFM_100G_CAUI2_AC: + case IFM_100G_CAUI2: + case IFM_100G_AUI2_AC: + case IFM_100G_AUI2: key = IFM_100G_CR4; + break; + case IFM_200G_CR4_PAM4: + case IFM_200G_SR4: + case IFM_200G_FR4: + case IFM_200G_LR4: + case IFM_200G_DR4: + case IFM_200G_KR4_PAM4: + case IFM_200G_AUI4_AC: + case IFM_200G_AUI4: + case IFM_200G_AUI8_AC: + case IFM_200G_AUI8: + key = IFM_200G_CR4_PAM4; + break; + case IFM_400G_FR8: + case IFM_400G_LR8: + case IFM_400G_DR4: + case IFM_400G_AUI8_AC: + case IFM_400G_AUI8: + key = IFM_400G_FR8; break; default: key = subtype; Modified: stable/11/sys/net/if_media.h ============================================================================== --- stable/11/sys/net/if_media.h Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/if_media.h Fri Sep 21 23:31:04 2018 (r338871) @@ -200,6 +200,62 @@ uint64_t ifmedia_baudrate(int); #define IFM_10G_AOC IFM_X(59) /* 10G active optical cable */ #define IFM_25G_ACC IFM_X(60) /* 25G active copper cable */ #define IFM_25G_AOC IFM_X(61) /* 25G active optical cable */ +#define IFM_100_SGMII IFM_X(62) /* 100M media interface */ +#define IFM_2500_X IFM_X(63) /* 2500BaseX */ +#define IFM_5000_KR IFM_X(64) /* 5GBase-KR backplane */ +#define IFM_25G_T IFM_X(65) /* 25GBase-T - RJ45 */ +#define IFM_25G_CR_S IFM_X(66) /* 25GBase-CR (short) */ +#define IFM_25G_CR1 IFM_X(67) /* 25GBase-CR1 DA cable */ +#define IFM_25G_KR_S IFM_X(68) /* 25GBase-KR (short) */ +#define IFM_5000_KR_S IFM_X(69) /* 5GBase-KR backplane (short) */ +#define IFM_5000_KR1 IFM_X(70) /* 5GBase-KR backplane */ +#define IFM_25G_AUI IFM_X(71) /* 25G-AUI-C2C (chip to chip) */ +#define IFM_40G_XLAUI IFM_X(72) /* 40G-XLAUI */ +#define IFM_40G_XLAUI_AC IFM_X(73) /* 40G active copper/optical */ +#define IFM_40G_ER4 IFM_X(74) /* 40GBase-ER4 */ +#define IFM_50G_SR2 IFM_X(75) /* 50GBase-SR2 */ +#define IFM_50G_LR2 IFM_X(76) /* 50GBase-LR2 */ +#define IFM_50G_LAUI2_AC IFM_X(77) /* 50G active copper/optical */ +#define IFM_50G_LAUI2 IFM_X(78) /* 50G-LAUI2 */ +#define IFM_50G_AUI2_AC IFM_X(79) /* 50G active copper/optical */ +#define IFM_50G_AUI2 IFM_X(80) /* 50G-AUI2 */ +#define IFM_50G_CP IFM_X(81) /* 50GBase-CP */ +#define IFM_50G_SR IFM_X(82) /* 50GBase-SR */ +#define IFM_50G_LR IFM_X(83) /* 50GBase-LR */ +#define IFM_50G_FR IFM_X(84) /* 50GBase-FR */ +#define IFM_50G_KR_PAM4 IFM_X(85) /* 50GBase-KR PAM4 */ +#define IFM_25G_KR1 IFM_X(86) /* 25GBase-KR1 */ +#define IFM_50G_AUI1_AC IFM_X(87) /* 50G active copper/optical */ +#define IFM_50G_AUI1 IFM_X(88) /* 50G-AUI1 */ +#define IFM_100G_CAUI4_AC IFM_X(89) /* 100G-CAUI4 active copper/optical */ +#define IFM_100G_CAUI4 IFM_X(90) /* 100G-CAUI4 */ +#define IFM_100G_AUI4_AC IFM_X(91) /* 100G-AUI4 active copper/optical */ +#define IFM_100G_AUI4 IFM_X(92) /* 100G-AUI4 */ +#define IFM_100G_CR_PAM4 IFM_X(93) /* 100GBase-CR PAM4 */ +#define IFM_100G_KR_PAM4 IFM_X(94) /* 100GBase-CR PAM4 */ +#define IFM_100G_CP2 IFM_X(95) /* 100GBase-CP2 */ +#define IFM_100G_SR2 IFM_X(96) /* 100GBase-SR2 */ +#define IFM_100G_DR IFM_X(97) /* 100GBase-DR */ +#define IFM_100G_KR2_PAM4 IFM_X(98) /* 100GBase-KR2 PAM4 */ +#define IFM_100G_CAUI2_AC IFM_X(99) /* 100G-CAUI2 active copper/optical */ +#define IFM_100G_CAUI2 IFM_X(100) /* 100G-CAUI2 */ +#define IFM_100G_AUI2_AC IFM_X(101) /* 100G-AUI2 active copper/optical */ +#define IFM_100G_AUI2 IFM_X(102) /* 100G-AUI2 */ +#define IFM_200G_CR4_PAM4 IFM_X(103) /* 200GBase-CR4 PAM4 */ +#define IFM_200G_SR4 IFM_X(104) /* 200GBase-SR4 */ +#define IFM_200G_FR4 IFM_X(105) /* 200GBase-FR4 */ +#define IFM_200G_LR4 IFM_X(106) /* 200GBase-LR4 */ +#define IFM_200G_DR4 IFM_X(107) /* 200GBase-DR4 */ +#define IFM_200G_KR4_PAM4 IFM_X(108) /* 200GBase-KR4 PAM4 */ +#define IFM_200G_AUI4_AC IFM_X(109) /* 200G-AUI4 active copper/optical */ +#define IFM_200G_AUI4 IFM_X(110) /* 200G-AUI4 */ +#define IFM_200G_AUI8_AC IFM_X(111) /* 200G-AUI8 active copper/optical */ +#define IFM_200G_AUI8 IFM_X(112) /* 200G-AUI8 */ +#define IFM_400G_FR8 IFM_X(113) /* 400GBase-FR8 */ +#define IFM_400G_LR8 IFM_X(114) /* 400GBase-LR8 */ +#define IFM_400G_DR4 IFM_X(115) /* 400GBase-DR4 */ +#define IFM_400G_AUI8_AC IFM_X(116) /* 400G-AUI8 active copper/optical */ +#define IFM_400G_AUI8 IFM_X(117) /* 400G-AUI8 */ /* * Please update ieee8023ad_lacp.c:lacp_compose_key() @@ -455,6 +511,62 @@ struct ifmedia_description { { IFM_10G_AOC, "10GBase-AOC" }, \ { IFM_25G_ACC, "25GBase-ACC" }, \ { IFM_25G_AOC, "25GBase-AOC" }, \ + { IFM_100_SGMII, "100M-SGMII" }, \ + { IFM_2500_X, "2500Base-X" }, \ + { IFM_5000_KR, "5000Base-KR" }, \ + { IFM_25G_T, "25GBase-T" }, \ + { IFM_25G_CR_S, "25GBase-CR-S" }, \ + { IFM_25G_CR1, "25GBase-CR1" }, \ + { IFM_25G_KR_S, "25GBase-KR-S" }, \ + { IFM_5000_KR_S, "5000Base-KR-S" }, \ + { IFM_5000_KR1, "5000Base-KR1" }, \ + { IFM_25G_AUI, "25G-AUI" }, \ + { IFM_40G_XLAUI, "40G-XLAUI" }, \ + { IFM_40G_XLAUI_AC, "40G-XLAUI-AC" }, \ + { IFM_40G_ER4, "40GBase-ER4" }, \ + { IFM_50G_SR2, "50GBase-SR2" }, \ + { IFM_50G_LR2, "50GBase-LR2" }, \ + { IFM_50G_LAUI2_AC, "50G-LAUI2-AC" }, \ + { IFM_50G_LAUI2, "50G-LAUI2" }, \ + { IFM_50G_AUI2_AC, "50G-AUI2-AC" }, \ + { IFM_50G_AUI2, "50G-AUI2" }, \ + { IFM_50G_CP, "50GBase-CP" }, \ + { IFM_50G_SR, "50GBase-SR" }, \ + { IFM_50G_LR, "50GBase-LR" }, \ + { IFM_50G_FR, "50GBase-FR" }, \ + { IFM_50G_KR_PAM4, "50GBase-KR-PAM4" }, \ + { IFM_25G_KR1, "25GBase-KR1" }, \ + { IFM_50G_AUI1_AC, "50G-AUI1-AC" }, \ + { IFM_50G_AUI1, "50G-AUI1" }, \ + { IFM_100G_CAUI4_AC, "100G-CAUI4-AC" }, \ + { IFM_100G_CAUI4, "100G-CAUI4" }, \ + { IFM_100G_AUI4_AC, "100G-AUI4-AC" }, \ + { IFM_100G_AUI4, "100G-AUI4" }, \ + { IFM_100G_CR_PAM4, "100GBase-CR-PAM4" }, \ + { IFM_100G_KR_PAM4, "100GBase-KR-PAM4" }, \ + { IFM_100G_CP2, "100GBase-CP2" }, \ + { IFM_100G_SR2, "100GBase-SR2" }, \ + { IFM_100G_DR, "100GBase-DR" }, \ + { IFM_100G_KR2_PAM4, "100GBase-KR2-PAM4" }, \ + { IFM_100G_CAUI2_AC, "100G-CAUI2-AC" }, \ + { IFM_100G_CAUI2, "100G-CAUI2" }, \ + { IFM_100G_AUI2_AC, "100G-AUI2-AC" }, \ + { IFM_100G_AUI2, "100G-AUI2" }, \ + { IFM_200G_CR4_PAM4, "200GBase-CR4-PAM4" }, \ + { IFM_200G_SR4, "200GBase-SR4" }, \ + { IFM_200G_FR4, "200GBase-FR4" }, \ + { IFM_200G_LR4, "200GBase-LR4" }, \ + { IFM_200G_DR4, "200GBase-DR4" }, \ + { IFM_200G_KR4_PAM4, "200GBase-KR4-PAM4" }, \ + { IFM_200G_AUI4_AC, "200G-AUI4-AC" }, \ + { IFM_200G_AUI4, "200G-AUI4" }, \ + { IFM_200G_AUI8_AC, "200G-AUI8-AC" }, \ + { IFM_200G_AUI8, "200G-AUI8" }, \ + { IFM_400G_FR8, "400GBase-FR8" }, \ + { IFM_400G_LR8, "400GBase-LR8" }, \ + { IFM_400G_DR4, "400GBase-DR4" }, \ + { IFM_400G_AUI8_AC, "400G-AUI8-AC" }, \ + { IFM_400G_AUI8, "400G-AUI8" }, \ { 0, NULL }, \ } @@ -787,6 +899,62 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10G_AOC, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25ULL) }, \ { IFM_ETHER | IFM_25G_AOC, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_100_SGMII, IF_Mbps(100) }, \ + { IFM_ETHER | IFM_2500_X, IF_Mbps(2500ULL) }, \ + { IFM_ETHER | IFM_5000_KR, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_25G_T, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_CR_S, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_CR1, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_KR_S, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_5000_KR_S, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_5000_KR1, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_25G_AUI, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_40G_XLAUI, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_XLAUI_AC, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_ER4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_50G_SR2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LR2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LAUI2_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LAUI2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI2_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_CP, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_SR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_FR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_KR_PAM4, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_25G_KR1, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_50G_AUI1_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI1, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI4_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI4_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CR_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_KR_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CP2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_SR2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_DR, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_KR2_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI2_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI2_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_200G_CR4_PAM4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_SR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_FR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_LR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_DR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_KR4_PAM4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI4_AC, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI8_AC, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI8, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_400G_FR8, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_LR8, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_DR4, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_AUI8_AC, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_AUI8, IF_Gbps(400ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/iflib.c Fri Sep 21 23:31:04 2018 (r338871) @@ -2192,7 +2192,7 @@ iflib_init_locked(if_ctx_t ctx) } } } - done: +done: if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); IFDI_INTR_ENABLE(ctx); txq = ctx->ifc_txqs; @@ -2739,7 +2739,9 @@ print_pkt(if_pkt_info_t pi) #endif #define IS_TSO4(pi) ((pi)->ipi_csum_flags & CSUM_IP_TSO) +#define IS_TX_OFFLOAD4(pi) ((pi)->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP_TSO)) #define IS_TSO6(pi) ((pi)->ipi_csum_flags & CSUM_IP6_TSO) +#define IS_TX_OFFLOAD6(pi) ((pi)->ipi_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_TSO)) static int iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) @@ -2825,8 +2827,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) ip->ip_sum = 0; - if (IS_TSO4(pi)) { - if (pi->ipi_ipproto == IPPROTO_TCP) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD4(pi)) { + if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { if (__predict_false(th == NULL)) { txq->ift_pullups++; if (__predict_false((m = m_pullup(m, (ip->ip_hl << 2) + sizeof(*th))) == NULL)) @@ -2837,14 +2840,16 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_tcp_hlen = th->th_off << 2; pi->ipi_tcp_seq = th->th_seq; } - if (__predict_false(ip->ip_p != IPPROTO_TCP)) - return (ENXIO); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; - if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { - ip->ip_sum = 0; - ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + if (IS_TSO4(pi)) { + if (__predict_false(ip->ip_p != IPPROTO_TCP)) + return (ENXIO); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { + ip->ip_sum = 0; + ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + } } } break; @@ -2867,26 +2872,30 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip6->ip6_nxt; pi->ipi_flags |= IPI_TX_IPV6; - if (IS_TSO6(pi)) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD6(pi)) { if (pi->ipi_ipproto == IPPROTO_TCP) { if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) { + txq->ift_pullups++; if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) == NULL)) return (ENOMEM); } pi->ipi_tcp_hflags = th->th_flags; pi->ipi_tcp_hlen = th->th_off << 2; + pi->ipi_tcp_seq = th->th_seq; } - - if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) - return (ENXIO); - /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. - */ - pi->ipi_csum_flags |= CSUM_TCP_IPV6; - th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (IS_TSO6(pi)) { + if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) + return (ENXIO); + /* + * The corresponding flag is set by the stack in the IPv4 + * TSO case, but not in IPv6 (at least in FreeBSD 10.2). + * So, set it here because the rest of the flow requires it. + */ + pi->ipi_csum_flags |= CSUM_IP6_TCP; + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + } } break; } @@ -3694,6 +3703,10 @@ _task_fn_admin(void *context) } } + if ((!running & !oactive) && + !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) + return; + CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); @@ -3896,7 +3909,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) */ if (avoid_reset) { if_setflagbits(ifp, IFF_UP,0); - if (!(if_getdrvflags(ifp)& IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) reinit = 1; #ifdef INET if (!(if_getflags(ifp) & IFF_NOARP)) @@ -3993,7 +4006,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) #endif setmask |= (mask & IFCAP_FLAGS); - if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); if ((mask & IFCAP_WOL) && (if_getcapabilities(ifp) & IFCAP_WOL) != 0) @@ -4014,7 +4027,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) CTX_UNLOCK(ctx); } break; - } + } case SIOCGPRIVATE_0: case SIOCSDRVSPEC: case SIOCGDRVSPEC: @@ -4722,7 +4735,7 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1")); -/* Allocate the TX ring struct memory */ + /* Allocate the TX ring struct memory */ if (!(ctx->ifc_txqs = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/iflib.h Fri Sep 21 23:31:04 2018 (r338871) @@ -321,7 +321,10 @@ typedef enum { * Driver needs frames padded to some minimum length */ #define IFLIB_NEED_ETHER_PAD 0x100 - +/* + * Interface needs admin task to ignore interface up/down status + */ +#define IFLIB_ADMIN_ALWAYS_RUN 0x10000 /* From owner-svn-src-stable@freebsd.org Fri Sep 21 23:54:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2945310A791A; Fri, 21 Sep 2018 23:54:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C048B7621D; Fri, 21 Sep 2018 23:54:01 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B516D1403E; Fri, 21 Sep 2018 23:54:01 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LNs1X2085431; Fri, 21 Sep 2018 23:54:01 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LNs1ET085428; Fri, 21 Sep 2018 23:54:01 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201809212354.w8LNs1ET085428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 21 Sep 2018 23:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338873 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 338873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 23:54:02 -0000 Author: erj Date: Fri Sep 21 23:54:01 2018 New Revision: 338873 URL: https://svnweb.freebsd.org/changeset/base/338873 Log: Revert MFC of r334231 in r338871. It did not apply cleanly and was causing build errors. Modified: stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Fri Sep 21 23:48:40 2018 (r338872) +++ stable/11/sys/net/iflib.c Fri Sep 21 23:54:01 2018 (r338873) @@ -3703,10 +3703,6 @@ _task_fn_admin(void *context) } } - if ((!running & !oactive) && - !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) - return; - CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Fri Sep 21 23:48:40 2018 (r338872) +++ stable/11/sys/net/iflib.h Fri Sep 21 23:54:01 2018 (r338873) @@ -321,10 +321,7 @@ typedef enum { * Driver needs frames padded to some minimum length */ #define IFLIB_NEED_ETHER_PAD 0x100 -/* - * Interface needs admin task to ignore interface up/down status - */ -#define IFLIB_ADMIN_ALWAYS_RUN 0x10000 + /* From owner-svn-src-stable@freebsd.org Sat Sep 22 16:19:22 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A28109C3CC; Sat, 22 Sep 2018 16:19:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8978517; Sat, 22 Sep 2018 16:19:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F2921E2FB; Sat, 22 Sep 2018 16:19:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8MGJMkE094371; Sat, 22 Sep 2018 16:19:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8MGJMxT094370; Sat, 22 Sep 2018 16:19:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201809221619.w8MGJMxT094370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 22 Sep 2018 16:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338889 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 338889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2018 16:19:22 -0000 Author: kib Date: Sat Sep 22 16:19:21 2018 New Revision: 338889 URL: https://svnweb.freebsd.org/changeset/base/338889 Log: MFC r338801: amd64 pmap: remove tautological assert. Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sat Sep 22 15:32:53 2018 (r338888) +++ stable/11/sys/amd64/amd64/pmap.c Sat Sep 22 16:19:21 2018 (r338889) @@ -7409,8 +7409,7 @@ pmap_activate_sw(struct thread *td) cr3 = rcr3(); if (pmap_pcid_enabled) { cached = pmap_pcid_alloc(pmap, cpuid); - KASSERT(pmap->pm_pcids[cpuid].pm_pcid >= 0 && - pmap->pm_pcids[cpuid].pm_pcid < PMAP_PCID_OVERMAX, + KASSERT(pmap->pm_pcids[cpuid].pm_pcid < PMAP_PCID_OVERMAX, ("pmap %p cpu %d pcid %#x", pmap, cpuid, pmap->pm_pcids[cpuid].pm_pcid)); KASSERT(pmap->pm_pcids[cpuid].pm_pcid != PMAP_PCID_KERN ||